├── .gitignore ├── LICENSE ├── README.md ├── central ├── README.md ├── auto-tbd.user.js ├── central-collapsable-sidebar.user.js ├── central-estimates-time-conversion.user.js ├── central-friendly-ui-for-multiple-pr.user.js ├── central-issues-kanban.user.js ├── central-link-pr-formatting.user.js ├── central-links.user.js ├── central-my-favorite-tickets.user.js ├── central-new-issue-templates.user.js ├── central-redirect-to-jira.user.js ├── clocking-nag.user.js ├── cmd-save.user.js ├── issue-list-tools.user.js ├── issue-summary.user.js ├── key-commands.js ├── over-estimate.user.js ├── party-llamacorn.user.js ├── qa-headers.user.js ├── qa-testing-instructions.user.js ├── relay-for-toggl.user.js ├── sticky-clocker-dropdowns.user.js ├── target-blank.user.js └── uncheck-email-all.user.js ├── dotorg ├── README.md ├── dotorg-helper.user.js ├── dotorg-hider.user.js └── dotorg-review-collector.user.js ├── github ├── README.md ├── github-pr-tools-merge.user.js ├── github-pr-tools.user.js ├── github-products-branch-protection.user.js └── github-pull-prefix-removal.user.js ├── img └── toggl.gif ├── jira ├── README.md ├── jira-bulk-edit-uncheck-email.user.js ├── jira-convert-threads-to-links.user.js ├── jira-dashboard-styles-sprint-health-gadget.user.js ├── jira-global-nav-dashboard.user.js ├── jira-global-nav-your-work.user.js ├── jira-mywork-hide-events.user.js └── jira-remove-harvest.user.js ├── liveagent ├── README.md ├── liveagent-clickafy-urls.user.js └── liveagent-plugin-versions.user.js ├── other ├── README.md ├── tribe-sniffer.min.js └── tribe-sniffer.user.js ├── premium-forum ├── README.md ├── premium-forum-collapse-convo.user.js ├── premium-forum-move-status-box.user.js ├── premium-forum-plugin-versions.user.js ├── premium-forum-private-topic.user.js ├── premium-forum-reformat-sysinfo.user.js ├── premium-forum-thread-list-colors.user.js └── premium-forum-users-licenses.user.js ├── uservoice ├── README.md └── uservoice.user.js └── waitForKeyElements.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Matthew Batchelder 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tampermonkey-scripts 2 | 3 | These are some common Modern Tribe Tampermonkey scripts. 4 | 5 | ## Installation 6 | 7 | 1. Install [Tampermonkey](https://tampermonkey.net/) 8 | 1. Select a script in this repo that you wish to use. View the file and click the _Raw_ button at the top of the file to view its source 9 | 1. Copy the source 10 | 1. Open Tampermonkey in your browser and click the Add Script tab (icon with a plus symbol) 11 | 1. Paste the source into the script window and hit save 12 | 1. Voila! 13 | 14 | ## Scripts 15 | 16 | * [GitHub](/github) 17 | * [Jira](/jira) 18 | * [LiveAgent](/liveagent) 19 | * [UserVoice](/uservoice) 20 | * [WP.org](/dotorg) 21 | * [Other](other) 22 | 23 | ## Old Scripts 24 | 25 | These ones are largely retired, but may still have some use. 26 | 27 | * [Central](/central) 28 | * [Premium Forum](/premium-forum) 29 | 30 | -------------------------------------------------------------------------------- /central/README.md: -------------------------------------------------------------------------------- 1 | # Central 2 | 3 | ## `central-redirect-to-jira.user.js` 4 | 5 | Redirect single Central Issue links to finding it in Jira. 6 | Won't work for issues that didn't migrate over to Jira. 7 | Won't work if your Central Issue URL has cruft on it, such as anchor links. 8 | 9 | ![Central issue redirecting to Jira](https://user-images.githubusercontent.com/1812179/71703646-6079d780-2d9b-11ea-85d0-692d86a98631.gif) 10 | 11 | ## `central-collapsable-sidebar.user.js` 12 | 13 | Improves the content space and make sure sidebar is collapsible to the same width of http://tri.be/ and sidebar is accessible just by moving the cursor to the sidebar to make it available when only needed it. 14 | 15 | ![collapsible sidebar](https://user-images.githubusercontent.com/3921289/37617341-82bc4994-2b78-11e8-8856-288de6d2c8e5.gif) 16 | 17 | ## `central-link-pr-formatting.user.js` 18 | 19 | Format the links that points to Pull Request in Central from a format like: `https://github.com/moderntribe/event-tickets-plus/pull/490` into a format like `event-tickets-plus#490 20 | `event-tickets-plus#490` similar to what GitHub does when a Pull Request is referenced inside of an issue. 21 | 22 | ## `central-friendly-ui-for-multiple-pr.user.js` 23 | 24 | Improves the UI when an issue has more than a single Pull Request to improve the addition / removal of new Pull Requests. 25 | 26 | ![Multiple PR Image](https://user-images.githubusercontent.com/3921289/36676235-b69b5434-1ad0-11e8-9df3-345627c01aff.gif) 27 | 28 | ## `central-estimates-time-conversion.user.js` 29 | 30 | Updates the estimate field to make it wider and available to accepts entries such as: 4h 5m and make them work exactly the same as **Spent time** field. 31 | 32 | ## `central-issues-kanban.user.js` 33 | 34 | Creates a kanban board for all issues queried. The board is hidden by default and can be toggled open and closed. 35 | 36 | ## `central-links.user.js` 37 | 38 | Turns the _Pull Request_ field in Modern Tribe's "Central" issues pages into a link. 39 | 40 | ## `central-my-favorite-tickets.user.js` 41 | 42 | Add your favorite ticket numbers to the main menu for easy access. 43 | The ticket numbers and descriptions need to be manually adjusted in the script. 44 | 45 | ![screen shot](https://dl.dropboxusercontent.com/s/ni5i38m93hvxmjc/shot_190304_231637.jpg) 46 | 47 | ## `central-new-issue-templates.user.js` 48 | 49 | Starter Templates for New Central Issues 50 | 51 | ## `clocking-nag.user.js` 52 | 53 | Shows your week of clocking at the top of Central and prompts you to enter some clocked time if you are falling behind. 54 | 55 | ![screen shot 2017-08-16 at 10 04 53 am](https://user-images.githubusercontent.com/430385/29367332-8beceac6-826a-11e7-9e62-3800663c5b22.png) 56 | 57 | 58 | ## `issue-list-tools.user.js` 59 | 60 | This script provides handy tools when viewing an issue list: 61 | 62 | * Toggle open/close row groupings of issues 63 | 64 | Ok...fine...that's just one tool, but this has room to grow. 65 | 66 | ## `issue-summary.user.js` 67 | 68 | * Color-codes central issues by status and swaps out issue types (Support, Feature, Bug) with FontAwesome "icons". 69 | * Adds a summary of on-page issues grouped by issue status. 70 | 71 | ![screen shot 2017-08-16 at 10 08 03 am](https://user-images.githubusercontent.com/430385/29367418-db3e3328-826a-11e7-8dd1-2e9e48a338c9.png) 72 | 73 | ## `key-commands.js` 74 | 75 | Sorta like vim/gmail key commands 76 | * `/` places your cursor in the search box. 77 | * in query view: `j` and `k` move your selection up or down. Pressing `enter` on the selection takes you to that ticket. 78 | * `i` takes you to the My Query. 79 | If you don't like the query view `i` takes you to, change the URL in line 15. 80 | 81 | ## `over-estimate.user.js` 82 | 83 | * highlight the spent hours with pink if they are over estimate 84 | * works on both issue lists and single issues 85 | 86 | ## `party-llamacorn.user.js` 87 | 88 | When a ticket is set to _Pending Merge_ or _Complete_, a llamacorn flies across the screen. 89 | 90 | ## `qa-headers.user.js` 91 | 92 | Styles QA headers so scanning QA activity on tickets is quicker. Relies on using the following headers in Central: 93 | 94 | ``` 95 | h2. QA PASSED (plus any extra text you want here) 96 | 97 | h2. RETURNED (plus any extra text you want here) 98 | ``` 99 | 100 | ## `qa-testing-instructions.user.js` 101 | 102 | Adds a button to the update form in a specific issue. 103 | When clicking the button, the notes and testing instructions fields are automatically populated with formatted starter text. 104 | 105 | ## `relay-for-toggl.user.js` 106 | 107 | Adds a button to tasks in central to start toggl. 108 | You need to provide your toggl API key and the proxy address. 109 | You are welcome to use the proxy at https://relay-for-toggl.herokuapp.com/ 110 | Proxy repo: https://github.com/binarygary/relay-for-toggl 111 | ![example](https://github.com/moderntribe/tampermonkey-scripts/img/toggl.gif) 112 | 113 | ## `sticky-clocker-dropdowns.user.js` 114 | 115 | Sets the __project__ and __activity__ to previous values after clocking time on the clocking tool. 116 | This does not work if the clocking tool is opened in a pop-up window. 117 | 118 | ## `target-blank.user.js` 119 | 120 | Auto-adds `target="_blank"` to all external links. 121 | 122 | ## `uncheck-email-all.user.js` 123 | 124 | Auto-uncheck the "email all" checkbox so you only send an email when you _really_ want to. 125 | -------------------------------------------------------------------------------- /central/auto-tbd.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Auto-TBD on new 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1 5 | // @description Auto-sets TBD on new issues 6 | // @author You 7 | // @include /^https:\/\/central.tri.be\/projects\/premium-plugins\/issues\/new\/?/ 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | var central_links = {}; 12 | 13 | ( function( $, my ) { 14 | my.init = function() { 15 | $( '#issue_fixed_version_id' ).val( 444 ); 16 | }; 17 | 18 | $( function() { 19 | my.init(); 20 | }); 21 | } )( jQuery, central_links ); 22 | -------------------------------------------------------------------------------- /central/central-collapsable-sidebar.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Collapsable Sidebar 3 | // @namespace http://tampermonkey.net/ 4 | // @version 0.1 5 | // @description Collapse sidebar on the left on central, available on hover on the sidebar (only on desktop). 6 | // @author Crisoforo Gaspar Hernandez 7 | // @include https://central.tri.be/* 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | (function() { 12 | var sidebarContainer = document.getElementById('side-container'); 13 | var sidebar = document.getElementById('sidebar'); 14 | var menu = document.getElementById('main-menu'); 15 | var wrapper = document.getElementById('wrapper'); 16 | var topMenu = document.getElementById('top-menu'); 17 | var navLogo = document.getElementById('nav-logo'); 18 | var banner = document.querySelector('a.banner'); 19 | 20 | if ( ! sidebarContainer || ! sidebar || ! menu || ! topMenu ) { 21 | return; 22 | } 23 | 24 | var mobileBreakpoint = 950; 25 | var logoURL = 'https://tri.be/content/uploads/2017/06/tribelogo.png'; 26 | 27 | // Create a new logo element 28 | var img = document.createElement('img'); 29 | img.style.width = '48px'; 30 | img.style.position = 'absolute'; 31 | img.style.right = '15px'; 32 | img.style.top = '25px'; 33 | img.setAttribute('src', logoURL); 34 | img.style.transition = 'opacity .1s ease-in'; 35 | navLogo.insertAdjacentElement( 'beforebegin', img ); 36 | 37 | menu.style.transition = 'opacity .25s ease-in'; 38 | sidebar.style.transition = 'opacity .1s ease-in'; 39 | navLogo.style.transition = 'opacity .1s ease-in'; 40 | sidebarContainer.style.transition = 'transform .25s ease-in'; 41 | 42 | var isOpen = true; 43 | 44 | function close() { 45 | sidebarContainer.style.transform = 'translateX(-120px)'; 46 | sidebar.style.opacity = '0'; 47 | menu.style.opacity = '0'; 48 | navLogo.style.opacity = '0'; 49 | sidebar.style.pointerEvents = 'none'; 50 | menu.style.pointerEvents = 'none'; 51 | navLogo.style.pointerEvents = 'none'; 52 | isOpen = false; 53 | } 54 | 55 | function open() { 56 | img.style.opacity = '0'; 57 | topMenu.style.zIndex = '1'; 58 | wrapper.style.width = 'calc(100% - 80px)'; 59 | sidebarContainer.style.transform = 'translateX(0)'; 60 | 61 | if ( banner ) { 62 | banner.style.width = 'calc(100% - 80px)'; 63 | } 64 | isOpen = true; 65 | } 66 | 67 | sidebarContainer.addEventListener('transitionend', function( event ) { 68 | if ( 'propertyName' in event && 'transform' === event.propertyName ) { 69 | if ( isOpen ) { 70 | sidebar.style.opacity = '1'; 71 | menu.style.opacity = '1'; 72 | navLogo.style.opacity = '1'; 73 | sidebar.style.pointerEvents = 'auto'; 74 | menu.style.pointerEvents = 'auto'; 75 | navLogo.style.pointerEvents = 'auto'; 76 | } else { 77 | img.style.opacity = '1'; 78 | } 79 | topMenu.style.zIndex = isOpen ? '1' : ''; 80 | } 81 | }); 82 | 83 | function destroy() { 84 | img.style.opacity = '0'; 85 | topMenu.style.zIndex = ''; 86 | wrapper.style.width = ''; 87 | sidebarContainer.style.transform = 'translateX(0)'; 88 | isOpen = true; 89 | // Remove Listeners 90 | sidebarContainer.removeEventListener('mouseenter', open); 91 | sidebarContainer.removeEventListener('mouseleave', close); 92 | } 93 | 94 | function init() { 95 | // Adjust new width 96 | wrapper.style.width = 'calc(100% - 80px)'; 97 | 98 | if ( banner ) { 99 | banner.style.width = 'calc(100% - 80px)'; 100 | } 101 | topMenu.style.zIndex = '1'; 102 | // Attach Listeners 103 | sidebarContainer.addEventListener('mouseenter', open); 104 | sidebarContainer.addEventListener('mouseleave', close); 105 | 106 | isOpen = true; 107 | // By default it should be closed 108 | close(); 109 | } 110 | 111 | function onResize() { 112 | if ( document.documentElement.clientWidth <= mobileBreakpoint ) { 113 | destroy(); 114 | } else { 115 | init(); 116 | } 117 | } 118 | 119 | // Fire it manually on start. 120 | onResize(); 121 | window.addEventListener( 'resize', onResize ); 122 | })(); 123 | -------------------------------------------------------------------------------- /central/central-estimates-time-conversion.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Central Estimates time conversion 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1 5 | // @description Makes sure estimate field accepts format such as 2h 5m and converts it into an float value. 6 | // @author Crisoforo Gaspar Hernandez 7 | // @include https://central.tri.be/issues/* 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | (function() { 12 | 'use strict'; 13 | 14 | var input = document.getElementById('issue_estimated_hours'); 15 | var KEYS = { 16 | MINUTE: 'm', 17 | HOUR: 'h', 18 | }; 19 | 20 | if ( ! input ) { 21 | return; 22 | } 23 | 24 | input.style.width = '40px'; 25 | var NOT_FOUND = -1; 26 | var decimalPlaces = 2; 27 | 28 | function to_float( str ) { 29 | var number = parseFloat( str ); 30 | return isNaN( number ) ? 0 : number; 31 | } 32 | 33 | function format( input ) { 34 | return input.toFixed( decimalPlaces ); 35 | } 36 | 37 | function getAmount( value ) { 38 | return value 39 | // Separate words 40 | .split(' ') 41 | // Translate strings to float numbers 42 | .map( function( chunk ) { 43 | if ( chunk.indexOf( KEYS.HOUR ) !== NOT_FOUND ) { 44 | return to_float( chunk.replace( KEYS.HOUR, '') ); 45 | } else if ( chunk.indexOf( KEYS.MINUTE ) !== NOT_FOUND ) { 46 | return to_float( chunk.replace( KEYS.MINUTE, '') ) / 60 ; 47 | } else { 48 | return 0; 49 | } 50 | // return the math (sum) on them 51 | }).reduce(function(accumulator, currentValue) { 52 | return accumulator + currentValue; 53 | }, 0); 54 | } 55 | 56 | function onBlur() { 57 | if ( ! input.value ) { 58 | return; 59 | } 60 | 61 | var value = input.value.toLowerCase(); 62 | 63 | // does not contain an h or an m 64 | if ( value.indexOf( KEYS.HOUR ) === NOT_FOUND && value.indexOf( KEYS.MINUTE ) === NOT_FOUND ) { 65 | input.value = format( to_float( value ) ); 66 | } else { 67 | input.value = format( to_float( getAmount( value ) ) ); 68 | } 69 | } 70 | 71 | input.addEventListener( 'blur', onBlur ); 72 | 73 | })(); 74 | -------------------------------------------------------------------------------- /central/central-friendly-ui-for-multiple-pr.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Friendly UI for PR list and forums Threads 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1 5 | // @description Update the UI to allow improve the UI to add more than one PR to an issue. 6 | // @author Crisoforo Gaspar Hernandez 7 | // @include https://central.tri.be/issues/* 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | (function() { 12 | 'use strict'; 13 | 14 | var prEl = document.querySelector('#issue_custom_field_values_56'); 15 | var issueForm = document.querySelector('#issue-form'); 16 | 17 | if ( ! issueForm || ! prEl ) { 18 | return; 19 | } 20 | 21 | hide(prEl); 22 | 23 | var PULL_REQUESTS = []; 24 | var ZERO = 0; 25 | var currentValue = toMultipleValue(prEl.value).map( function( value ) { 26 | createDynamicField( value, prEl.parentNode ); 27 | }); 28 | 29 | if ( currentValue.length === ZERO ) { 30 | createDynamicField( '', prEl.parentNode ); 31 | } 32 | 33 | function createDynamicField( value, parentNode ) { 34 | var container = document.createElement('div'); 35 | 36 | var input = document.createElement('input'); 37 | input.style.width = 'calc(100% - 80px)'; 38 | input.style.padding = '2px 5px'; 39 | input.style.marginRight = '10px'; 40 | input.value = value; 41 | 42 | var add = document.createElement('button'); 43 | add.innerText = '+'; 44 | addButtonStyles(add); 45 | 46 | var remove = document.createElement('button'); 47 | remove.innerText = '-'; 48 | addButtonStyles(remove); 49 | remove.style.backgroundColor = '#e4554a'; 50 | 51 | // Add field 52 | add.addEventListener('click', function(e) { 53 | e.preventDefault(); 54 | createDynamicField( '', parentNode ); 55 | }); 56 | 57 | // Remove Field 58 | remove.addEventListener('click', function(e) { 59 | e.preventDefault(); 60 | 61 | prEl.parentNode.removeChild( container ); 62 | PULL_REQUESTS.splice(container.index, 1); 63 | 64 | // If all has been removed add one back so we never are empty 65 | if ( PULL_REQUESTS.length === 0 ) { 66 | createDynamicField( '', parentNode ); 67 | } 68 | }); 69 | 70 | 71 | container.appendChild(input); 72 | container.appendChild(add); 73 | container.appendChild(remove); 74 | // Save them for future use. 75 | container.index = PULL_REQUESTS.length; 76 | PULL_REQUESTS.push( container ); 77 | 78 | container.style.marginBottom = '5px'; 79 | 80 | parentNode.appendChild( container ); 81 | } 82 | 83 | 84 | issueForm.addEventListener('submit', function( e ) { 85 | prEl.value = toSingleValue( PULL_REQUESTS ); 86 | }); 87 | 88 | function toSingleValue( group ) { 89 | return group.map(function(container) { 90 | return container.querySelector('input'); 91 | }).filter(function( input ) { 92 | return input.value.replace(/\s/g, '').length > 0; 93 | }).map( function( item ) { 94 | return item && item.value ? item.value : ''; 95 | }).join( ' ' ); 96 | } 97 | 98 | function toMultipleValue( singleValue ) { 99 | var values = singleValue ? singleValue.trim().split(' ') : []; 100 | return values.map(function( item ) { 101 | return item.replace(/\s/g,''); 102 | }).filter(function( item ) { 103 | return item.length > 0; 104 | }); 105 | } 106 | 107 | function hide( el ) { 108 | if ( el ) { 109 | el.style.display = 'none'; 110 | } 111 | } 112 | 113 | function addButtonStyles( el ) { 114 | el.style.padding = '2px 5px'; 115 | el.style.border = 'none'; 116 | el.style.backgroundColor = '#1ca8c7'; 117 | el.style.margin = '0 7px 0 0'; 118 | el.style.color = '#FFF'; 119 | el.style.fontWeight = 'bold'; 120 | el.style.width = '20px'; 121 | } 122 | 123 | })(); 124 | -------------------------------------------------------------------------------- /central/central-issues-kanban.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Central Issues Kanban 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1 5 | // @description Display a Kanban board of queried tickets 6 | // @author Paul Kim, Aaron Hanson 7 | // @include /https?:\/\/central.tri.be\/(projects\/)*[^\/]*\/?issues\/?/ 8 | // @exclude /https?:\/\/central.tri.be\/(projects\/)*[^\/]*\/?issues\/[0-9]+\/?/ 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | ( function($) { 13 | 14 | var columns = { 15 | new: [], 16 | inProgress: [], 17 | designQA: [], 18 | codeReview: [], 19 | qa: [], 20 | merge: [], 21 | smoketest: [], 22 | release: [], 23 | }; 24 | 25 | var status = { 26 | new: 'New', 27 | inProgress: 'In Progress', 28 | designQA: 'Design QA', 29 | codeReview: 'Pending Code Review', 30 | qa: 'Pending QA', 31 | merge: 'Pending Merge', 32 | smoketest: 'Pending Smoketest', 33 | release: 'Pending Release', 34 | }; 35 | 36 | var keys = Object.keys(columns); 37 | 38 | var el = { 39 | titleBar: null, 40 | kanban: null, 41 | toggle: null, 42 | }; 43 | 44 | var state = { 45 | showKanban: false, 46 | }; 47 | 48 | var addStyles = function() { 49 | var css = '.kanban{display:-webkit-box;display:-ms-flexbox;display:flex;overflow-x:scroll;margin-bottom:2rem}.kanban a{text-decoration:none;color:#000}.kanban--hidden{display:none}.kanban-toggle{margin:2rem 0}.kanban-toggle__button{margin:0px;border:none;background:#157F9D;color:#fff;border-radius:2px;padding:5px 8px}.kanban-toggle__button:hover{background:#1CA8C7}.kanban__column{-webkit-box-flex:0;-ms-flex:none;flex:none;width:250px;margin:.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.kanban__column-header{-webkit-box-flex:0;-ms-flex:none;flex:none}.kanban__column-content{padding:.25rem;background:#f9f9f9;-webkit-box-flex:1;-ms-flex:auto;flex:auto}.card{background:#fff;margin:.75rem .45rem;padding:.45rem .75rem .45rem 1.25rem;border:#e6e6e6 1px solid;position:relative;vertical-align:middle;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-box-shadow:0 0 1px transparent;box-shadow:0 0 1px transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;-moz-osx-font-smoothing:grayscale;-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.card:before{content:"";height:calc(100% + 2px);width:5px;background:#666;position:absolute;top:-1px;left:-1px}.card:hover{background-color:#f9f9f9;-webkit-transform:scale(1.03);transform:scale(1.03)}.card .card__issue,.card .card__subject,.card .card__assigned-to{margin:.5rem 0;display:block}.card .card__issue a:hover,.card .card__issue a:focus,.card .card__subject a:hover,.card .card__subject a:focus,.card .card__assigned-to a:hover,.card .card__assigned-to a:focus{color:#136379}.card .card__issue{text-transform:uppercase;font-size:.75rem}.card .card__issue a{color:#21A6CB}.card .card__subject{font-size:1rem;margin:0}.card .card__assigned-to{font-size:.75rem}.card .card__assigned-to a{color:#666}.card--p1:before{background-color:#EA3546}.card--p2:before{background-color:#FF6700}.card--p3:before{background-color:#70BF67}.card--p4:before{background-color:#43BCCD}.card--p5:before{background-color:#9F9AA4}'; 50 | var head = document.head; 51 | var style = document.createElement('style'); 52 | style.type = 'text/css'; 53 | style.appendChild(document.createTextNode(css)); 54 | 55 | head.appendChild(style); 56 | }; 57 | 58 | var insertAfter = function(newNode, refNode) { 59 | refNode.parentNode.insertBefore(newNode, refNode.nextSibling); 60 | }; 61 | 62 | var arrangeCard = function(card) { 63 | switch(card.status) { 64 | case 'New': 65 | columns.new.push(card); 66 | break; 67 | case 'In Progress': 68 | columns.inProgress.push(card); 69 | break; 70 | case 'Design QA': 71 | columns.designQA.push(card); 72 | break; 73 | case 'Pending Code Review': 74 | columns.codeReview.push(card); 75 | break; 76 | case 'Pending QA': 77 | columns.qa.push(card); 78 | break; 79 | case 'Pending Merge': 80 | columns.merge.push(card); 81 | break; 82 | case 'Pending Smoketest': 83 | columns.smoketest.push(card); 84 | break; 85 | case 'Pending Release': 86 | columns.release.push(card); 87 | break; 88 | } 89 | }; 90 | 91 | var getCards = function() { 92 | var issuesArray = [].slice.call(document.querySelectorAll('#issue-list-body tr.issue')); 93 | 94 | issuesArray.forEach(function(issue) { 95 | var card = { 96 | issueNumber: issue.querySelector('.issue').innerHTML, 97 | status: issue.querySelector('.status').textContent, 98 | priority: issue.querySelector('.priority').textContent, 99 | subject: issue.querySelector('.subject').innerHTML, 100 | assignedTo: issue.querySelector('.assigned_to').innerHTML, 101 | }; 102 | 103 | arrangeCard(card); 104 | }); 105 | }; 106 | 107 | var comparePriority = function(a, b) { 108 | return a.priority - b.priority; 109 | }; 110 | 111 | var sortColumns = function() { 112 | keys.forEach(function(key) { 113 | columns[key].sort(comparePriority); 114 | }); 115 | }; 116 | 117 | var getColumnHeader = function(title) { 118 | var headerHtml = '
'; 119 | headerHtml += '

' + title + '

'; 120 | headerHtml += '
'; 121 | 122 | return headerHtml; 123 | }; 124 | 125 | var getCardHtml = function(card) { 126 | var cardHtml = '
'; 127 | cardHtml += '' + card.issueNumber + ''; 128 | cardHtml += '

' + card.subject + '

'; 129 | cardHtml += '' + card.assignedTo + ''; 130 | cardHtml += '
'; 131 | 132 | return cardHtml; 133 | }; 134 | 135 | var getKanbanHtml = function() { 136 | var html = ''; 137 | 138 | keys.forEach(function(key) { 139 | html += '
'; 140 | html += getColumnHeader(status[key]); 141 | html += '
'; 142 | columns[key].forEach(function(card) { 143 | html += getCardHtml(card); 144 | }); 145 | html += '
'; 146 | html += '
'; 147 | }); 148 | 149 | return html; 150 | }; 151 | 152 | var setKanban = function() { 153 | var wrapper = document.createElement('div'); 154 | wrapper.classList.add('kanban', 'kanban--hidden'); 155 | wrapper.innerHTML = getKanbanHtml(); 156 | el.kanban = wrapper; 157 | insertAfter(wrapper, el.titleBar); 158 | }; 159 | 160 | var getToggleHtml = function() { 161 | var button = document.createElement('button'); 162 | button.classList.add('kanban-toggle__button'); 163 | button.textContent = 'Toggle Kanban'; 164 | el.toggle = button; 165 | return button; 166 | }; 167 | 168 | var setToggle = function() { 169 | var wrapper = document.createElement('div'); 170 | wrapper.classList.add('kanban-toggle'); 171 | wrapper.appendChild(getToggleHtml()); 172 | insertAfter(wrapper, el.titleBar); 173 | }; 174 | 175 | var handleClick = function() { 176 | if (state.kanbanShown) { 177 | el.kanban.classList.add('kanban--hidden'); 178 | state.kanbanShown = false; 179 | } else { 180 | el.kanban.classList.remove('kanban--hidden'); 181 | state.kanbanShown = true; 182 | } 183 | }; 184 | 185 | var bindEvents = function() { 186 | el.toggle.addEventListener('click', handleClick); 187 | }; 188 | 189 | var init = function() { 190 | el.titleBar = document.querySelector('#content .title-bar'); 191 | addStyles(); 192 | getCards(); 193 | sortColumns(); 194 | setKanban(); 195 | setToggle(); 196 | bindEvents(); 197 | }; 198 | 199 | init(); 200 | 201 | } )(jQuery); 202 | -------------------------------------------------------------------------------- /central/central-link-pr-formatting.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Github PR name formatting. 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1 5 | // @description Format Github PR Links same as Github does. 6 | // @author Crisoforo Gaspar Hernandez 7 | // @match https://central.tri.be/issues/* 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | (function() { 12 | 'use strict'; 13 | 14 | var links = Array.prototype.slice.call( document.querySelectorAll('.linkified') ); 15 | 16 | links.forEach(function(node) { 17 | node.innerText = node.innerText.replace('https://github.com/moderntribe/', '').replace('/pull/', '#'); 18 | }); 19 | 20 | })(); -------------------------------------------------------------------------------- /central/central-links.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Anchor tags in Central 3 | // @namespace https://central.tri.be/ 4 | // @version 0.1.1 5 | // @description Adds anchor tags to some links in central 6 | // @author Gustavo Bordoni 7 | // @include /^https:\/\/central.tri.be(\/.*)?/ 8 | // @require http://soapbox.github.io/linkifyjs/js/linkify/linkify.min.js 9 | // @require http://soapbox.github.io/linkifyjs/js/linkify/linkify-jquery.min.js 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | var central_links = {}; 14 | 15 | ( function( $, my ) { 16 | my.init = function() { 17 | my.build_styles(); 18 | 19 | var regExpGoogleDocs = /docs\.google\.com.+\/d\/([^\/]+)/ig; 20 | 21 | my.$headings = $( 'table.attributes' ).find( 'th:contains(Pull Request:), th:contains(Forum Threads:), th:contains(User Story:), th:contains(UserVoice Threads:)' ); 22 | my.$headings.each( function() { 23 | var $this = $( this ); 24 | var $link_cell = $this.next( 'td' ); 25 | 26 | $link_cell.linkify({ 27 | target: "_blank", 28 | format: function( value, type ) { 29 | var matches = regExpGoogleDocs.exec( value ); 30 | 31 | if ( ! matches ){ 32 | return value; 33 | } 34 | 35 | return 'Google#' + matches[1]; 36 | } 37 | }); 38 | 39 | $link_cell.find( 'a' ).append( '
' ); 40 | } ); 41 | }; 42 | 43 | my.build_styles = function() { 44 | $( 'head' ).append( ''; 555 | 556 | return style; 557 | } 558 | 559 | function renderMarkup() { 560 | 561 | var html = ''; 562 | html = '
'; 563 | html += '
Tribe Sniffer ' + snifferVersionNumber + '
'; 564 | html += '
 
'; 565 | html += '
'; 566 | html += '
'; 567 | 568 | if ( false !== competitorHtml ) { 569 | html += '

' + competitorHtml + '

'; 570 | } else { 571 | html += '

About this page

'; 572 | html += '

View: '; 573 | html += tecView; 574 | html += '

'; 575 | 576 | html += '

'; 577 | html += 'Editor used: '; 578 | html += editorUsed; 579 | html += '

'; 580 | 581 | html += '

Design: '; 582 | html += tecDesignVersion; 583 | html += '

'; 584 | 585 | html += '

Generated by shortcode: '; 586 | html += shortcode; 587 | html += '

'; 588 | 589 | html += '

Theme used: '; 590 | html += theme; 591 | html += '

'; 592 | 593 | html += '
'; 594 | 595 | html += '
'; 596 | html += '

Versions

'; 597 | 598 | html += WordPress; 599 | 600 | html += versionNumbers; 601 | 602 | html += otherPlugins; 603 | 604 | html += '
'; 605 | 606 | html += '
'; 607 | html += '

Caching / Minification

'; 608 | 609 | if ( true === autoptimize ) { 610 | html += '

AUTOPTIMIZE FOUND!!!

'; 611 | } 612 | 613 | html += '

' + cachingPlugin + '

'; 614 | 615 | } 616 | html += '
'; 617 | 618 | return html; 619 | } 620 | 621 | /** 622 | * Animation 623 | */ 624 | function hideBlock() { 625 | var block = document.getElementById( 'sniffer-container' ); 626 | var str = document.getElementById( 'hider' ); 627 | var right = window.outerWidth - block.offsetLeft; 628 | var hideRight = -block.offsetWidth + 55; 629 | if ( logLevel2 ) console.log( 'block.offsetLeft: ' + block.offsetLeft ); 630 | if ( logLevel2 ) console.log( 'block.offsetWidth: ' + block.offsetWidth ); 631 | if ( logLevel2 ) console.log( 'window.outerWidth: ' + window.outerWidth ); 632 | if ( logLevel2 ) console.log( 'right: ' + right ); 633 | if ( logLevel2 ) console.log( 'hideRight: ' + hideRight ); 634 | 635 | 636 | if ( block.offsetLeft + 150 > window.outerWidth ) { 637 | block.style.right = "10px"; 638 | if ( logLevel2 ) console.log( 'move left' ); 639 | } else { 640 | block.style.right = hideRight + "px"; 641 | if ( logLevel2 ) console.log( 'move right' ); 642 | } 643 | } 644 | 645 | })(); 646 | -------------------------------------------------------------------------------- /premium-forum/README.md: -------------------------------------------------------------------------------- 1 | # Premium Forum 2 | 3 | ## `premium-forum-collapse-convo.user.js` 4 | 5 | You have a long exchange with a client. Tired of always scrolling down and up? This is for you. 6 | If there are more than 6 replies in a thread, then everything between the first and the last will be collapsed. 7 | 8 | Screenshot: https://cloudup.com/cn2yDKGCZ4v 9 | 10 | ## `premium-forum-move-status-box.user.js` 11 | 12 | Moves the Assignee box and the Status box to the top, above the posts. 13 | 14 | ## `premium-forum-plugin-versions.user.js` 15 | 16 | Shows the following info: 17 | * Plugin version numbers of the last 5 releases 18 | * Version numbers of the user's plugins, if system information is submitted 19 | * The users nick for easy access / copy-paste 20 | 21 | Screenshot: https://cloudup.com/cU1Tp-rggXe 22 | 23 | ## `premium-forum-private-topic.user.js` 24 | 25 | If the thread is marked private then puts a red label at the top and bottom, and draws a red border around the posts. 26 | 27 | ## `premium-forum-reformat-sysinfo.user.js` 28 | 29 | Reformats the user submitted system information if it comes through without line breaks. 30 | 31 | It will re-color "View raw system information" to red to signal the formatting. 32 | 33 | If you still see improvement areas, like a plugin in 2 lines, let me know. 34 | 35 | Screenshot before: https://cloudup.com/ibZxM-aYwLA 36 | 37 | Screenshot after: https://cloudup.com/i4JtjHdOgaP 38 | 39 | ## `premium-forum-thread-list-colors.user.js` 40 | 41 | Colors the thead list on theeventscalendar.com based on urgency. 42 | * Critical (past a 24h): red 43 | * Overdue (past 20h): orange 44 | * Resolved: green 45 | 46 | Screenshot: https://cloudup.com/ccdWJTkiF30 47 | 48 | ## `premium-forum-users-licenses.user.js` 49 | 50 | Show the user's licenses at the bottom right, making them visible when the thread is long. 51 | -------------------------------------------------------------------------------- /premium-forum/premium-forum-collapse-convo.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Collapse Convo 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.2 5 | // @description You have a long exchange with a client. Tired of always scrolling down and up? This is for you. Kicks in after 6 replies. 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-collapse-convo.user.js 10 | // @grant none 11 | // @run-at document-idle 12 | 13 | // ==/UserScript== 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * Show a red label if the topic is private 20 | */ 21 | var heads = document.getElementsByClassName( 'bbp-reply-header' ); 22 | var threads = document.getElementsByClassName( 'type-reply' ); 23 | var tlen = threads.length; 24 | if ( tlen > 6 ) { 25 | var lastFour = 2 * tlen - 3; 26 | var ntlen = '.bbp-body div:nth-child(n+' + lastFour + ')'; 27 | //console.log( 'tlen: ' + tlen); 28 | $( '.bbp-reply-header' ).css({ 'display': 'none' }); 29 | $( '.type-reply' ).css({ 'display': 'none' }); 30 | $( ntlen ).css({ 'display': 'block' }); 31 | 32 | var htmlstring; 33 | htmlstring = '
 
'; 34 | htmlstring += tlen-3; 35 | htmlstring += 'more
 
'; 36 | 37 | var htmlJumpToTop; 38 | htmlJumpToTop = 'Hide`em again | Jump to first post'; 39 | 40 | var htmlHideemTop; 41 | htmlHideemTop = '
Hide`em again
'; 42 | 43 | $( '#bbp-topic-0-lead' ).after( htmlstring ); 44 | $( '#count-container' ).css({ 'cursor': 'pointer' }); 45 | $( '.count-number' ).css({ 'display': 'inline-block', 'float': 'left', 'clear': 'both' }); 46 | $( '.count-round' ).css({ 'border-width': '1px', 'border-style': 'solid', 'border-color': '#ccc', 'border-radius': '50%', 'display': 'inline-block', 'padding': '5px', 'margin-left': '5px', 'margin-right': '5px', 'width': '20px', 'text-align': 'center' }); 47 | $( '.count-line' ).css({ 'display': 'inline-block', 'float': 'left', 'clear': 'both', 'width': '20px', 'border-right-width': '3px', 'border-right-style': 'dashed', 'border-right-color': '#999', 'margin-top': '1px', 'margin-bottom': '1px' }); 48 | 49 | $( '#topic-0-replies' ).after( htmlJumpToTop ); 50 | 51 | $( '#bbp-topic-0-lead' ).after( htmlHideemTop ); 52 | $( '.hideem' ).css({ 'cursor': 'pointer', 'display': 'none' }); 53 | 54 | // Handle hover 55 | if ( document.getElementById( 'count-container' ) != null ) { 56 | document.getElementById( 'count-container' ).addEventListener( 'click', showPosts ); 57 | document.getElementById( 'hideem' ).addEventListener( 'click', hidePosts ); 58 | document.getElementById( 'hideemTop' ).addEventListener( 'click', hidePosts ); 59 | } 60 | } 61 | 62 | function showPosts() { 63 | $( '.bbp-reply-header' ).css({ 'display': 'block' }); 64 | $( '.type-reply' ).css({ 'display': 'block' }); 65 | $( '#count-container' ).css({ 'display': 'none' }); 66 | $( '.hideem' ).css({ 'display': 'inline-block' }); 67 | } 68 | function hidePosts() { 69 | $( '.bbp-reply-header' ).css({ 'display': 'none' }); 70 | $( '.type-reply' ).css({ 'display': 'none' }); 71 | $( ntlen ).css({ 'display': 'block' }); 72 | $( '#count-container' ).css({ 'display': 'block' }); 73 | $( '.hideem' ).css({ 'display': 'none' }); 74 | } 75 | 76 | })(); 77 | -------------------------------------------------------------------------------- /premium-forum/premium-forum-move-status-box.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Move status box 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.8 5 | // @description Move Assignee and Status box to the top 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @grant none 10 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-move-status-box.user.js 11 | // @run-at document-idle 12 | 13 | // ==/UserScript== 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * Move Assignee and Status box to the top 20 | */ 21 | $( '#staff_update_box' ).detach().insertAfter( '#bbps_extra' ); 22 | 23 | })(); -------------------------------------------------------------------------------- /premium-forum/premium-forum-plugin-versions.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Latest plugin versions 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 1.6 5 | // @description Display our plugins' latest version numbers (manually updated) and the user's version numbers from sysinfo 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-plugin-versions.user.js 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | (function() { 14 | 'use strict'; 15 | 16 | /** 17 | * Defining our plugin version history 18 | * When a new release is out then: 19 | * - update script version number in the header 20 | * - make a copy of the last line 21 | * - adjust the starting number 22 | * - adjust the note: show|last (usually show the last 5 versions) 23 | * - add the new plugin version numbers 24 | * - if it is a new version compared to last release, add 'x' at the end, like '4.6.19x' 25 | * - if it is a hotfix, then creating a new line is not needed, just update the version number in the last line (See Event Tickets (eti) in line 12) 26 | */ 27 | var pluginHistory = { 28 | 0: { note: "", date: "", name: "", tec: "", pro: "", eti: "", etp: "", ebt: "", cev: "", ctx: "", fib: "", apm: "", iwp: "", woo: "", edd: "" }, 29 | 1: { note: "", date: "Jan 7", name: "M18.01", tec: "4.6.9x", pro: "4.4.21", eti: "4.6.3", etp: "4.6.2", ebt: "4.4.9", cev: "4.5.8", ctx: "4.5.3", fib: "4.5.2", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 30 | 2: { note: "", date: "Jan 22", name: "M18.02", tec: "4.6.10x", pro: "4.4.22x", eti: "4.6.3", etp: "4.6.2", ebt: "4.4.9", cev: "4.5.8", ctx: "4.5.3", fib: "4.5.3x", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 31 | 3: { note: "", date: "Feb 14", name: "M18.03", tec: "4.6.11.1x", pro: "4.4.23x", eti: "4.6.3.1x", etp: "4.6.2", ebt: "4.4.9", cev: "4.5.9x", ctx: "4.5.3", fib: "4.5.3", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 32 | 4: { note: "", date: "Mar 8", name: "M18.04", tec: "4.6.12x", pro: "4.4.24.2x", eti: "4.6.3.1", etp: "4.6.2", ebt: "4.4.9", cev: "4.5.9", ctx: "4.5.3", fib: "4.5.4x", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 33 | 5: { note: "", date: "Mar 13", name: "TC", tec: "4.6.12", pro: "4.4.24.2", eti: "4.7x", etp: "4.7x", ebt: "4.4.9", cev: "4.5.9", ctx: "4.5.3", fib: "4.5.4", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 34 | 6: { note: "", date: "Mar 28", name: "M18.05", tec: "4.6.13x", pro: "4.4.24.2", eti: "4.7.1x", etp: "4.7.1x", ebt: "4.4.9", cev: "4.5.10x", ctx: "4.5.4x", fib: "4.5.4", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 35 | 7: { note: "", date: "Apr 4", name: "M18.06", tec: "4.6.14.1x", pro: "4.4.25x", eti: "4.7.2x", etp: "4.7.2x", ebt: "4.4.9", cev: "4.5.11x", ctx: "4.5.4", fib: "4.5.5x", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 36 | 8: { note: "", date: "May 9", name: "M18.07", tec: "4.6.15x", pro: "4.4.26x", eti: "4.7.2", etp: "4.7.2", ebt: "4.4.9", cev: "4.5.11", ctx: "4.5.4", fib: "4.5.5", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 37 | 9: { note: "", date: "May 16", name: "TEC", tec: "4.6.16x", pro: "4.4.26", eti: "4.7.2", etp: "4.7.2", ebt: "4.4.9", cev: "4.5.11", ctx: "4.5.4", fib: "4.5.5", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 38 | 10: { note: "", date: "May 29", name: "M18.08", tec: "4.6.17x", pro: "4.4.27x", eti: "4.7.3.1x", etp: "4.7.3x", ebt: "4.4.9", cev: "4.5.12x", ctx: "4.5.4", fib: "4.5.6x", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 39 | 11: { note: "", date: "Jun 4", name: "ETR", tec: "4.6.18x", pro: "4.4.27", eti: "4.7.3.1", etp: "4.7.3", ebt: "4.5x", cev: "4.5.12", ctx: "4.5.4", fib: "4.5.6", apm: "4.4", iwp: "1.0.2", woo: "", edd: "" }, 40 | 12: { note: "", date: "Jun 20", name: "M18.09", tec: "4.6.19x", pro: "4.4.28x", eti: "4.7.4.1x", etp: "4.7.4x", ebt: "4.5.1x", cev: "4.5.12", ctx: "4.5.4", fib: "4.5.6", apm: "4.4", iwp: "1.0.2", woo: "3.4.3", edd: "2.9.3" }, 41 | 13: { note: "show", date: "Jul 9", name: "M18.10", tec: "4.6.20.1x", pro: "4.4.29.2x", eti: "4.7.5.1x", etp: "4.7.5x", ebt: "4.5.1", cev: "4.5.12", ctx: "4.5.4", fib: "4.5.6", apm: "4.4", iwp: "1.0.2", woo: "3.4.3", edd: "2.9.3" }, 42 | 14: { note: "show", date: "Aug 1", name: "M18.11", tec: "4.6.21x", pro: "4.4.30.1x", eti: "4.7.6x", etp: "4.7.6x", ebt: "4.5.2x", cev: "4.5.13x", ctx: "4.5.5x", fib: "4.5.7x", apm: "4.4", iwp: "1.0.2", woo: "3.4.4", edd: "2.9.6" }, 43 | 15: { note: "show", date: "Aug 22", name: "M18.12", tec: "4.6.22.1x", pro: "4.4.31x", eti: "4.8x", etp: "4.8x", ebt: "4.5.2", cev: "4.5.13.1x", ctx: "4.5.6x", fib: "4.5.7", apm: "4.4", iwp: "1.0.2", woo: "3.4.4", edd: "2.9.6" }, 44 | 16: { note: "show", date: "Sep 12", name: "M18.13", tec: "4.6.23x", pro: "4.4.32x", eti: "4.8.1x", etp: "4.8.1x", ebt: "4.5.3x", cev: "4.5.13.1", ctx: "4.5.6", fib: "4.5.8x", apm: "4.4", iwp: "1.0.2", woo: "3.4.5", edd: "2.9.7" }, 45 | 17: { note: "last", date: "Oct 3", name: "M18.14", tec: "4.6.24.1x", pro: "4.4.33x", eti: "4.8.2.1x", etp: "4.8.2x", ebt: "4.5.4x", cev: "4.5.13.1", ctx: "4.5.6", fib: "4.5.8", apm: "4.4", iwp: "1.0.2", woo: "3.4.5", edd: "2.9.8" }, 46 | }; 47 | 48 | var pluginNames = ['tec', 'pro', 'eti', 'etp', 'ebt', 'cev', 'ctx', 'fib', 'apm', 'iwp']; 49 | 50 | /** 51 | * Defining our plugins 52 | * (Probably "version" here is not needed.) 53 | */ 54 | var pluginVersions = { 55 | tec: { name: '(The Events Calendar version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '28', version: '', curr: '#currtecver', user: '#usertecver' }, 56 | pro: { name: '(Events Calendar PRO version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '28', version: '', curr: '#currprover', user: '#userprover' }, 57 | eti: { name: '(Event Tickets version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '22', version: '', curr: '#curretiver', user: '#useretiver' }, 58 | etp: { name: '(Event Tickets Plus version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '27', version: '', curr: '#curretpver', user: '#useretpver' }, 59 | ebt: { name: '(The Events Calendar: Eventbrite Tickets version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '48', version: '', curr: '#currebtver', user: '#userebtver' }, 60 | cev: { name: '(The Events Calendar: Community Events version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '46', version: '', curr: '#currcevver', user: '#usercevver' }, 61 | ctx: { name: '(The Events Calendar: Community Events Tickets version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '54', version: '', curr: '#currctxver', user: '#userctxver' }, 62 | fib: { name: '(The Events Calendar: Filter Bar version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '40', version: '', curr: '#currfibver', user: '#userfibver' }, 63 | apm: { name: '(Advanced Post Manager version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '30', version: '', curr: '#currapmver', user: '#userapmver' }, 64 | iwp: { name: '(Image Widget Plus version )(.{0,})( by )(){0,1}(Modern Tribe, Inc.)', namelength: '26', version: '', curr: '#curriwpver', user: '#useriwpver' }, 65 | woo: { name: '(WooCommerce version )(.{0,})( by )(){0,1}(Automattic)', namelength: '20', version: '', curr: '#currecmver', user: '#userecmver' }, 66 | edd: { name: '(Easy Digital Downloads version )(.{0,})( by )(){0,1}(Easy Digital Downloads)', namelength: '31', version: '', curr: '#currecmver', user: '#userecmver' } 67 | }; 68 | 69 | /** 70 | * i = contains the sysinfo from the sysinfo box 71 | * k = counter 72 | * inReply = returns a positive if sysinfo is submitted/found in a reply 73 | * replyHtml = stores the HTML of a reply in the cycle 74 | * ecmUsed = stores the string of the eCommerce solution used by the client (woo|edd) 75 | * userEcmVer = stores the version number of the eCommerce solution used by the client 76 | */ 77 | var i, k, inReply, replyHtml, ecmUsed = "-", userEcmVer = "-"; 78 | 79 | /** 80 | * Getting the system info in a string 81 | * fullstats = contains the full html string of the sysinfo box 82 | */ 83 | i = document.getElementsByClassName( 'system-info' ); 84 | 85 | if ( i.length > 0 ) { 86 | var fullstats; 87 | fullstats = i[0].innerHTML; 88 | } 89 | 90 | // console.log("FS1" + fullstats); 91 | 92 | /** 93 | * If system information is submitted in a reply, take that instead 94 | * Go from the last reply forward 95 | * replies = array containing all the replies 96 | */ 97 | var replies = document.getElementsByClassName( 'bbp-reply-content' ); 98 | for ( k = replies.length-1; k >= 0; k-- ) { 99 | replyHtml = replies[k].innerHTML; 100 | // Search for the string "Home URL" case insensitive 101 | inReply = replyHtml.search( /home url/i ); 102 | if ( inReply >= 0 ) { 103 | fullstats = replyHtml; 104 | break; 105 | } 106 | } 107 | 108 | //console.log("FS2" + fullstats); 109 | //console.log( typeof fullstats ); 110 | 111 | // If there is no sysinfo, then stop the execution of the scirpt 112 | 113 | if ( typeof fullstats == 'undefined' ) return; 114 | 115 | /** 116 | * j = counter 117 | * pname = plugin name + plugin name length = start of version number 118 | * pby = start of by | end of version number 119 | * pver = version number string 120 | * result = ??? 121 | */ 122 | var j, pname, pby, pver; 123 | var result = ""; 124 | 125 | /** 126 | * Going through the array and checking for our plugins in system info 127 | * key = the short name of the plugin 128 | */ 129 | for( var key in pluginVersions ) { 130 | 131 | //console.log( 'key: ' + key ); 132 | 133 | // This is the for-cycle for named arrays 134 | if ( pluginVersions.hasOwnProperty( key ) ) { 135 | 136 | // If plugin name is found in the sysinfo ... 137 | pname = fullstats.search( pluginVersions[key].name ); 138 | 139 | if ( pname != -1 ) { 140 | // Starting position of version number = start of plugin name + plugin name length 141 | pname = parseInt( fullstats.search( pluginVersions[key].name ) ) + parseInt( pluginVersions[key].namelength ); 142 | //console.log("p2: " + pname); 143 | // Starting position of by (after the plugin name) | end of version number 144 | pby = fullstats.indexOf( "by", pname ); 145 | //console.log("pby: " + pby); 146 | // Get version number only 147 | pver = fullstats.substring( pname, pby ); 148 | //console.log("pver: " + pver); 149 | // Trim it 150 | pluginVersions[key].version = pver.trim(); 151 | // Which eCommerce used? 152 | if ( key == "woo" || key == "edd" ) { 153 | ecmUsed = key; 154 | } 155 | } 156 | // If plugin name is not found in the sysinfo 157 | else { 158 | pluginVersions[key].version = "-"; 159 | } 160 | } 161 | } 162 | 163 | /** 164 | * Table of the plugin versions 165 | */ 166 | var htmlstring = '
'; 167 | 168 | htmlstring += ''; 169 | htmlstring += ''; 170 | 171 | // Header row 172 | htmlstring += ''; 173 | if ( ecmUsed != "-" ) { 174 | htmlstring += ''; 177 | } 178 | htmlstring += ''; 179 | 180 | // Go through the plugin history row by row 181 | for( var number in pluginHistory ) { 182 | 183 | // Check if it has a note 184 | if ( pluginHistory.hasOwnProperty( number ) && ( pluginHistory[number].note == 'show' || pluginHistory[number].note == 'last' ) ) { 185 | htmlstring += ''; 191 | htmlstring += ''; 192 | htmlstring += ''; 193 | 194 | /** 195 | * Go through all the plugins 196 | * pN = stores the plugin name so we can refer to it 197 | */ 198 | for ( j = 0; j < pluginNames.length; j++ ) { 199 | var pN = pluginNames[j]; 200 | 201 | // Open the cell 202 | htmlstring += ''; 216 | } // end for ( j = 0; j < pluginNames.length; j++ ) 217 | 218 | if ( ecmUsed != "-" ) { 219 | // eCommerce versions 220 | htmlstring += ''; 246 | if ( ecmUsed != "-" ) { 247 | htmlstring += ''; 248 | } 249 | htmlstring += ''; 250 | htmlstring += '
TECPROETET+EventbriteCommEventsCommTixFilter BarAPMIW+'; 175 | htmlstring += ecmUsed.toUpperCase(); 176 | htmlstring += '
' + pluginHistory[number].date + '' + pluginHistory[number].name + '' + pluginVersions.tec.version + '' + pluginVersions.pro.version + '' + pluginVersions.eti.version + '' + pluginVersions.etp.version + '' + pluginVersions.ebt.version + '' + pluginVersions.cev.version + '' + pluginVersions.ctx.version + '' + pluginVersions.fib.version + '' + pluginVersions.apm.version + '' + pluginVersions.iwp.version + '' + userEcmVer + '
'; 251 | htmlstring += '
'; 252 | 253 | // Formatting 254 | $( '#wp-admin-bar-top-secondary' ).after( htmlstring ); 255 | $( '#plugin-versions' ).css({ 'position': 'fixed', 'bottom': '0', 'right': '150px', 'background-color': 'rgb(35, 40, 45)', 'color': '#eee' }); 256 | $( '.versions td' ).css({ 'line-height': '1.5em !important' }); 257 | $( '.version-number' ).css({ 'font-weight': 'bold' }); 258 | $( '.row' ).css({ 'display': 'none', 'text-align': 'center' }); 259 | $( '.alwayson' ).css({ 'display': 'table-row' }); 260 | 261 | // Handle hover 262 | if ( document.getElementById( 'plugin-versions' ) != null ) { 263 | document.getElementById( 'plugin-versions' ).addEventListener( 'mouseover', showRows ); 264 | document.getElementById( 'plugin-versions' ).addEventListener( 'mouseout', hideRows ); 265 | } 266 | 267 | // Compare current and user, and color it 268 | for( var plugin in pluginVersions ) { 269 | // This is the for-cycle for named arrays 270 | if ( pluginVersions.hasOwnProperty( plugin ) && pluginVersions[plugin].version != "-" ) { 271 | if ( $( pluginVersions[plugin].curr ).html() == pluginVersions[plugin].version ) { 272 | $( pluginVersions[plugin].user ).css({ 'color': '#2dd39c', 'font-weight': 'bold' }); 273 | } 274 | else { 275 | $( pluginVersions[plugin].user ).css({ 'color': '#e4554a', 'font-weight': 'bold' }); 276 | } 277 | } 278 | } 279 | 280 | /* Hover/unhover actions */ 281 | function showRows() { 282 | $( '.row' ).css({ 'display': 'table-row ' }); 283 | } 284 | function hideRows() { 285 | $( '.row' ).css({ 'display': 'none' }); 286 | $( '.alwayson' ).css({ 'display': 'table-row' }); 287 | } 288 | 289 | })(); 290 | -------------------------------------------------------------------------------- /premium-forum/premium-forum-private-topic.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Private topic 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.8 5 | // @description Shows a red label if topic is private 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @grant none 10 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-private-topic.user.js 11 | // @run-at document-idle 12 | 13 | // ==/UserScript== 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * Show a red label if the topic is private 20 | */ 21 | if ( document.getElementById( 'mark_private' ) !== null ) { 22 | var isPrivate = document.getElementById( 'mark_private' ).checked; 23 | var top = document.getElementById( 'bbps_extra' ); 24 | var replybox = document.getElementById( 'new-reply-0' ); 25 | var convo = document.getElementById( 'bbps_conversation' ); 26 | 27 | if ( true === isPrivate ) { 28 | 29 | convo.style.border = '2px solid red'; 30 | var privateTopic = document.createElement( 'div' ); 31 | privateTopic.id = 'privateTopic'; 32 | privateTopic.innerHTML = 'This is a fully private topic.'; 33 | privateTopic.style.fontWeight = 'bold'; 34 | privateTopic.style.color = 'red'; 35 | 36 | replybox.insertBefore( privateTopic, replybox.firstChild ); 37 | var privateTopic2 = privateTopic.cloneNode( true ); 38 | top.parentNode.insertBefore( privateTopic2, top.nextSibling ); 39 | } 40 | } 41 | 42 | })(); -------------------------------------------------------------------------------- /premium-forum/premium-forum-reformat-sysinfo.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Reformat Sysinfo 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.1 5 | // @description Reformat system information if it comes through without line breaks. If you still see improvement areas, let me know. 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-reformat-sysinfo.user.js 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | // @to-test https://theeventscalendar.com/wp-admin/post.php?post=1597502&action=edit 14 | // @to-test https://theeventscalendar.com/wp-admin/post.php?post=1597502&action=edit 15 | 16 | (function() { 17 | 'use strict'; 18 | 19 | // Get sysinfo 20 | var s = document.getElementsByClassName( 'system-info' ); 21 | 22 | if ( s.length > 0 ) { 23 | var fullstats = s[0].innerHTML; 24 | 25 | // Normal case #1 26 | if ( fullstats.startsWith('

') ) { 27 | //console.log( 'p' ) 28 | } 29 | // Normal case #2 30 | else if ( fullstats.startsWith('&])/g, '
$&' ); 38 | // Split plugin list into new lines 39 | // (exclude also Google Analytics Dashboard for WP (GADWP)) 40 | fullstats = fullstats.replace( /[^(GADWP)]\)/g, '$&
' ); 41 | // Split WordPress version into new line 42 | // and skip plugins that end with "for WordPress version x.y" 43 | fullstats = fullstats.replace( /(wordpress version)\s([4-5])([0-9\.]{2,5})/ig, '
 
$&
' ); 44 | // Split 'Theme' into new line 45 | // And exclude iThemes, ThemeFusions, theme-fusion etc. 46 | fullstats = fullstats.replace( /theme[^\w\-]/ig, '
 
$&
' ); 47 | 48 | var titles = [ 49 | 'Home URL', 50 | 'Site URL', 51 | 'Site Language', 52 | 'Character Set', 53 | 'Name', 54 | 'Email', 55 | 'Install keys', 56 | 'Permalink Structure', 57 | 'PHP version', 58 | 'Server', 59 | 'SAPI', 60 | 'Plugins', 61 | 'Network Plugins', 62 | 'MU Plugins', 63 | 'Multisite', 64 | 'Settings', 65 | 'Community Add', 66 | 'Community List', 67 | 'Community Options', 68 | 'WP Timezone', 69 | 'WP GMT Offset', 70 | 'Default PHP Timezone', 71 | 'WP Date Format', 72 | 'WP Time Format', 73 | 'Week Starts On', 74 | 'Common Library Dir', 75 | 'Common Library Version', 76 | ]; 77 | 78 | // Split section headers into new lines 79 | for ( var t = 0; t < titles.length; t++ ) { 80 | fullstats = fullstats.replace( titles[t], '
 
' + titles[t].toUpperCase() + '
' ); 81 | fullstats = fullstats.replace( titles[t].toUpperCase(), '
 
' + titles[t].toUpperCase() + '
' ); 82 | } 83 | 84 | // Replace double new lines to single 85 | fullstats = fullstats.replace( /(
)(\s){0,1}(
)/ig, '
' ); 86 | 87 | // Remove blank lines from beginning 88 | fullstats = fullstats.replace( /(.*)home url/ig, 'HOME URL' ); 89 | 90 | // Replace sysinfo 91 | s[0].innerHTML = fullstats; 92 | 93 | // Color red to signal change 94 | $( '.when-collapsed' ).css({ 'color': 'red' }); 95 | $( '.when-expanded' ).css({ 'color': 'red' }); 96 | } // else { 97 | } 98 | 99 | })(); 100 | -------------------------------------------------------------------------------- /premium-forum/premium-forum-thread-list-colors.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Thread List Colors 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.1 5 | // @description Colors thead list based on urgency: Critical (past a 24h): red; Overdue (past 20h): orange; Resolved: green 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/edit.php?post_type=topic&page=tribe-support-queues* 8 | // @include https://theeventscalendar.com/wp-admin/edit.php?page=tribe-support-queues&post_type=topic* 9 | // @match https://theeventscalendar.com/wp-admin/edit.php?post_type=topic&page=tribe-support-queues* 10 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-thread-list-colors.user.js 11 | // @grant none 12 | // ==/UserScript== 13 | 14 | (function() { 15 | 'use strict'; 16 | 17 | var resolvedRows, criticalRows, i; 18 | criticalRows = document.getElementsByClassName( 'column-activity' ); 19 | resolvedRows = document.getElementsByClassName( 'column-status' ); 20 | 21 | for ( i = 0; i < criticalRows.length; i++ ) { 22 | 23 | /* Resolved - green */ 24 | var replyHtml = resolvedRows[i].innerHTML; 25 | var isResolved = replyHtml.search( /resolved/gi ); 26 | if ( isResolved >= 0 ) { 27 | resolvedRows[i].parentNode.style.backgroundColor = 'lightgreen'; 28 | continue; 29 | } 30 | 31 | /* Overdue - past 20 hours - orange */ 32 | replyHtml = criticalRows[i].innerHTML; 33 | var isOverdue = replyHtml.search( /^(2)([0-9]{1})h/g ); 34 | if ( isOverdue >= 0 ) { 35 | criticalRows[i].parentNode.style.backgroundColor = '#f4af49'; 36 | continue; 37 | } 38 | 39 | /* Critical - past 24 hours - red */ 40 | var isCritical = replyHtml.search( /^([0-9]{1,2})(D|W|M|Y)/g ); 41 | if ( isCritical >= 0 ) { 42 | criticalRows[i].parentNode.style.backgroundColor = 'rgba(228, 85, 74,0.3)'; 43 | continue; 44 | } 45 | 46 | } 47 | 48 | })(); 49 | -------------------------------------------------------------------------------- /premium-forum/premium-forum-users-licenses.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Premium Forum Extras - Show user's licenses 3 | // @namespace https://theeventscalendar.com/ 4 | // @version 0.8 5 | // @description Show the user's licenses at the bottom right 6 | // @author Andras Guseo 7 | // @include https://theeventscalendar.com/wp-admin/post.php?* 8 | // @match https://theeventscalendar.com/wp-admin/post.php?* 9 | // @grant none 10 | // @downloadURL https://raw.githubusercontent.com/moderntribe/tampermonkey-scripts/master/premium-forum-users-licenses.user.js 11 | // @run-at document-idle 12 | 13 | // ==/UserScript== 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * Show the user's licenses at the bottom right 20 | */ 21 | $( '.licenses' ).clone().appendTo( '#poststuff' ).addClass( 'newLicenses' ); 22 | 23 | var cssLicenses = 'li.newLicenses { position: fixed; bottom: 80px; right: 20px; font-size: 85%; list-style: none; tight: 20px; z-index: -1; } li.newLicenses .nonactive { color: #A00000; } ', 24 | head = document.head || document.getElementsByTagName( 'head' )[0], 25 | style = document.createElement( 'style' ); 26 | 27 | style.type = 'text/css'; 28 | if ( style.styleSheet ) { 29 | style.styleSheet.cssText = 'css'; 30 | } 31 | else { 32 | style.appendChild( document.createTextNode( cssLicenses ) ); 33 | } 34 | 35 | head.appendChild( style ); 36 | 37 | })(); -------------------------------------------------------------------------------- /uservoice/README.md: -------------------------------------------------------------------------------- 1 | # UserVoice Scripts 2 | 3 | ## `uservoice.user.js` 4 | 5 | Tweaks the UserVoice UI by throwing out portions of the interface that we don't care about; resizing stuff; and other small tweaks. 6 | -------------------------------------------------------------------------------- /uservoice/uservoice.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Uservoice Overrides 3 | // @namespace http://tampermonkey.net/ 4 | // @version 0.1 5 | // @description Minimize some UI crap 6 | // @author Matthew Batchelder 7 | // @include /https:\/\/tribe.uservoice.com\/admin\/.*/ 8 | // @grant none 9 | // ==/UserScript== 10 | /* jshint -W097 */ 11 | 'use strict'; 12 | 13 | var mt_uservoice = {}; 14 | 15 | ( function( $, my ) { 16 | 'use strict'; 17 | 18 | my.init = function() { 19 | var $graph = $( '.cols-5.mb2 + .content-box' ); 20 | var $graph_body = $graph.find( '.content-box-body' ); 21 | var $graph_header = $graph.find( 'header' ); 22 | var $activity_stream = $( '#activity-stream' ); 23 | 24 | $graph.on( 'click', 'header', function( e ) { 25 | if ( $graph_body.is( ':visible' ) ) { 26 | $graph_body.hide(); 27 | } else { 28 | $graph_body.show(); 29 | } 30 | } ); 31 | 32 | $activity_stream.find( '.hfeed .hentry:not(.supported) h3.entry-title a' ).each( function() { 33 | var $el = $( this ); 34 | var href = $el.attr( 'href' ); 35 | var $article = $el.closest( 'article' ); 36 | var $footer = $article.find( 'footer' ); 37 | 38 | var jqxhr = $.get( href ); 39 | 40 | jqxhr.done( function( data ) { 41 | var $html = $( data ); 42 | var breadcrumbs = $html.find( '.breadcrumbs' ).html(); 43 | if ( breadcrumbs ) { 44 | $footer.prepend( '

' + breadcrumbs + ' @
' ); 45 | } 46 | 47 | var $chicklet = $html.find( '.vote_chicklet .chicklet' ); 48 | var votes = $chicklet.find( 'strong' ).html(); 49 | 50 | if ( votes ) { 51 | $footer.prepend( '
' + votes + ' Votes
' ); 52 | } 53 | } ); 54 | } ); 55 | 56 | $activity_stream.addClass( 'hide-supported' ); 57 | $activity_stream.find( '.activity-stream-header-table thead th[data-object-type="supported"]' ).addClass( 'is-disabled' ); 58 | 59 | $( '.blog-posts' ).closest( '.cols-span-1' ).hide(); 60 | 61 | $( '.activity-stream-header-table' ).each( function() { 62 | var $table = $( this ); 63 | $table.find( 'tbody td' ).each( function() { 64 | var $cell = $( this ); 65 | if ( '0' === $cell.html() ) { 66 | $cell.hide(); 67 | $table.find( 'thead th[data-object-type="' + $cell.data( 'object-type' ) + '"]' ).hide(); 68 | } 69 | } ); 70 | } ); 71 | 72 | my.build_styles(); 73 | }; 74 | 75 | my.build_styles = function() { 76 | $( 'head' ).append( '