├── tool-labs ├── content │ ├── favicon.ico │ ├── sidebar-bg.gif │ ├── dataTables │ │ ├── asc.gif │ │ ├── bg.gif │ │ ├── desc.gif │ │ └── jquery.dataTables.plain.css │ ├── tablesorter │ │ ├── bg.gif │ │ ├── asc.gif │ │ ├── desc.gif │ │ └── style.css │ ├── main.js │ ├── regex │ │ └── jsresyntaxhighlighter.css │ └── jquery.multiselect │ │ └── jquery.multiselect.css ├── pgkbot │ ├── pgkbot_1.1.zip │ ├── pgkbot_1.2.zip │ ├── pgkbot_1.3.zip │ ├── pgkbot_1.4.zip │ ├── pgkbot_1.5.zip │ ├── pgkbot_1.6.zip │ ├── pgkbot_1.7.zip │ ├── stylesheet.css │ └── index.php ├── magicredirect │ └── stylesheet.css ├── backend │ ├── notice.php │ ├── modules │ │ ├── external │ │ │ ├── README.md │ │ │ └── mediawiki-globalfunctions.php │ │ ├── Logger.php │ │ ├── Form.php │ │ ├── Base.php │ │ ├── Profiler.php │ │ ├── __config__.php │ │ ├── Wikimedia.php │ │ └── IPAddress.php │ └── models │ │ ├── GlobalUser.php │ │ ├── LocalUser.php │ │ └── Wiki.php ├── globalgroups │ ├── stylesheet.css │ └── framework │ │ └── GlobalGroupsEngine.php ├── userpages │ ├── stylesheet.css │ ├── scripts.js │ └── index.php ├── .lighttpd.legacy-crossactivity.conf ├── stewardry │ ├── scripts.js │ ├── index.php │ └── framework │ │ └── StewardryEngine.php ├── accounteligibility │ ├── framework │ │ ├── localRules │ │ │ ├── NotBotRule.php │ │ │ ├── LocalRule.php │ │ │ ├── CustomRule.php │ │ │ ├── DateRegisteredRule.php │ │ │ ├── HasGroupRule.php │ │ │ ├── NotBlockedRule.php │ │ │ └── AccountAgeRule.php │ │ ├── constants │ │ │ ├── Workflow.php │ │ │ └── Result.php │ │ ├── globalRules │ │ │ ├── GlobalRule.php │ │ │ ├── HasGlobalAccountRule.php │ │ │ ├── NotGloballyLockedRule.php │ │ │ └── NotGloballyBlockedRule.php │ │ ├── GlobalRuleManager.php │ │ ├── models │ │ │ ├── ResultInfo.php │ │ │ ├── LocalRuleEntry.php │ │ │ ├── DateWrapper.php │ │ │ └── Event.php │ │ └── LocalRuleManager.php │ └── stylesheet.css ├── stalktoy │ ├── framework │ │ └── models │ │ │ ├── GlobalIP.php │ │ │ ├── Block.php │ │ │ ├── GlobalAccountStats.php │ │ │ ├── GlobalAccount.php │ │ │ └── LocalAccount.php │ ├── stylesheet.css │ └── scripts.js ├── gusersearch │ ├── javascript.js │ └── stylesheet.css ├── iso639db │ ├── scripts.js │ ├── stylesheet.css │ ├── index.php │ └── framework │ │ └── Iso639dbEngine.php ├── catanalysis │ ├── stylesheet.css │ └── framework │ │ └── models │ │ ├── UserData.php │ │ ├── PageData.php │ │ ├── Metrics.php │ │ └── MonthMetrics.php ├── .lighttpd.meta3.conf ├── .lighttpd.meta2.conf ├── .lighttpd.meta.conf ├── crossactivity │ ├── framework │ │ └── CrossactivityEngine.php │ └── index.php └── toolinfo.json ├── .gitignore ├── user-scripts ├── .jshintrc ├── pathoschild.ajaxsysop.css ├── dependencies │ ├── regex-colorizer.css │ └── WebConsole.js ├── i18n │ ├── zh-hans.js │ ├── ja.js │ ├── sr-ec.js │ ├── sr-el.js │ ├── ur.js │ ├── ru.js │ ├── es.js │ ├── th.js │ ├── bn.js │ ├── ca.js │ ├── de.js │ ├── fr.js │ ├── it.js │ ├── pt.js │ └── en.js ├── pathoschild.forceltr.js ├── toolinfo.json ├── templates │ └── pathoschild.templatescript.settings.htm ├── pathoschild.usejs.js ├── pathoschild.regexeditor.css └── pathoschild.ajaxtransclusiontable.js └── LICENSE.txt /tool-labs/content/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/favicon.ico -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cs 2 | *.csproj 3 | *.phpproj 4 | *.sln 5 | *.suo 6 | *.user 7 | bin/ 8 | obj/ 9 | .data/ 10 | .idea/ 11 | -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.1.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.2.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.3.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.4.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.5.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.6.zip -------------------------------------------------------------------------------- /tool-labs/pgkbot/pgkbot_1.7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/pgkbot/pgkbot_1.7.zip -------------------------------------------------------------------------------- /tool-labs/content/sidebar-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/sidebar-bg.gif -------------------------------------------------------------------------------- /tool-labs/content/dataTables/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/dataTables/asc.gif -------------------------------------------------------------------------------- /tool-labs/content/dataTables/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/dataTables/bg.gif -------------------------------------------------------------------------------- /tool-labs/content/tablesorter/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/tablesorter/bg.gif -------------------------------------------------------------------------------- /tool-labs/content/dataTables/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/dataTables/desc.gif -------------------------------------------------------------------------------- /tool-labs/content/tablesorter/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/tablesorter/asc.gif -------------------------------------------------------------------------------- /tool-labs/content/tablesorter/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pathoschild/Wikimedia-contrib/HEAD/tool-labs/content/tablesorter/desc.gif -------------------------------------------------------------------------------- /tool-labs/magicredirect/stylesheet.css: -------------------------------------------------------------------------------- 1 | #token-documentation { 2 | color: gray; 3 | font-size: small; 4 | padding-left: 1em; 5 | } 6 | -------------------------------------------------------------------------------- /tool-labs/pgkbot/stylesheet.css: -------------------------------------------------------------------------------- 1 | #editor { 2 | width: 100%; 3 | height: 30em; 4 | } 5 | 6 | #tsre { 7 | border: none !important; 8 | } 9 | 10 | #tsre h3, #tsre p { 11 | display: none; 12 | } 13 | -------------------------------------------------------------------------------- /tool-labs/backend/notice.php: -------------------------------------------------------------------------------- 1 | ', $message, ''; 11 | } -------------------------------------------------------------------------------- /tool-labs/globalgroups/stylesheet.css: -------------------------------------------------------------------------------- 1 | .group { 2 | margin-left: 2em; 3 | margin-bottom: 1em; 4 | } 5 | 6 | ul { 7 | margin-top: 0; 8 | } 9 | 10 | .group-rights { 11 | margin-left: 1em; 12 | } 13 | 14 | .group-rights-name, 15 | .group-rights-blurb { 16 | font-size: 0.9em; 17 | } 18 | 19 | .group-rights-name { 20 | color: gray; 21 | font-size: 0.9em; 22 | } 23 | 24 | table tr { 25 | border: 0 !important; 26 | } 27 | -------------------------------------------------------------------------------- /tool-labs/userpages/stylesheet.css: -------------------------------------------------------------------------------- 1 | li[data-redirect="1"], li[data-redirect="1"] a { 2 | font-style: italic; 3 | color: gray; 4 | } 5 | 6 | .filter { 7 | background: #EEE; 8 | border: 1px solid #CCC; 9 | border-radius: 5px; 10 | padding: 3px 5px; 11 | color: #CCC; 12 | text-decoration: none; 13 | } 14 | 15 | .filter.selected { 16 | background: #CFC; 17 | border-color: #0C0; 18 | color: #000; 19 | } 20 | -------------------------------------------------------------------------------- /tool-labs/.lighttpd.legacy-crossactivity.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This Lighttpd config is used for the deprecated `crossactivity` account. 3 | # 4 | 5 | # redirect to the main account 6 | url.redirect += ( 7 | "^(?:/crossactivity)?(.*)$" => "https://meta.toolforge.org/crossactivity$1" 8 | ) 9 | 10 | # enable status pages 11 | server.modules += ("mod_auth", "mod_status") 12 | status.status-url = "/server-status" 13 | status.statistics-url = "/server-statistics" 14 | -------------------------------------------------------------------------------- /tool-labs/stewardry/scripts.js: -------------------------------------------------------------------------------- 1 | /*jshint bitwise:true, eqeqeq:true, forin:false, immed:true, latedef:true, loopfunc:true, noarg:true, noempty:true, nonew:false, smarttabs:true, strict:true, trailing:true, undef:true*/ 2 | /*global $:true, google: true*/ 3 | var pathoschild = pathoschild || {}; 4 | (function () { 5 | "use strict"; 6 | 7 | $(function () { 8 | $(".sortable").tablesorter({sortList: [[1, 1], [2, 1]]}); 9 | }); 10 | }()); 11 | -------------------------------------------------------------------------------- /user-scripts/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "eqeqeq": true, 4 | "forin": false, 5 | "immed": true, 6 | "latedef": true, 7 | "noarg": true, 8 | "noempty": true, 9 | "nonew": true, 10 | "strict": true, 11 | "trailing": true, 12 | "undef": true, 13 | "unused": true, 14 | "quotmark": "single", 15 | 16 | "browser": true, 17 | "loopfunc": true, 18 | "laxbreak": true, 19 | "smarttabs": true, 20 | 21 | "predef": [ 22 | "mw", 23 | "$", 24 | "prompt" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/localRules/NotBotRule.php: -------------------------------------------------------------------------------- 1 | negate = true; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tool-labs/stalktoy/framework/models/GlobalIP.php: -------------------------------------------------------------------------------- 1 | isLocked 21 | ? new ResultInfo(Result::FAIL, "globally locked.") 22 | : new ResultInfo(Result::PASS, "not globally locked."); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tool-labs/catanalysis/framework/models/MonthMetrics.php: -------------------------------------------------------------------------------- 1 | "https://meta.toolforge.org/$1$2", 9 | "^/(crossactivity)(.*)$" => "https://meta2.toolforge.org/$1$2", 10 | #"^/(stalktoy)(.*)$" => "https://meta3.toolforge.org/$1$2", 11 | 12 | # redirect root 13 | "^/?$" => "/stalktoy/", 14 | 15 | # prettify generated tool URLs that have a route version 16 | "^/stalktoy(?:/index.php|/)?\?target=([^&]+)$" => "/stalktoy/$1" 17 | ) 18 | 19 | # rewrite pretty URLs (e.g. /tool/a/b/c => /tool/index.php?@path=/a/b/c) 20 | url.rewrite-if-not-file += ( 21 | "^/stalktoy(/[^\?]+)(?:\?(.*))?$" => "/stalktoy/index.php?@path=$1&$2" 22 | ) 23 | 24 | # enable status pages 25 | server.modules += ("mod_auth", "mod_status") 26 | status.status-url = "/server-status" 27 | status.statistics-url = "/server-statistics" 28 | -------------------------------------------------------------------------------- /tool-labs/.lighttpd.meta2.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This Lighttpd config is used when deploying to the 'meta2' account, which only has Crossactivity 3 | # by default. See the README.md for usage. 4 | # 5 | 6 | url.redirect += ( 7 | # redirect to other tool accounts 8 | "^/(accounteligibility|catanalysis|globalgroups|gusersearch|iso639db|magicredirect|pgkbot|scripts|stewardry|userpages)(.*)$" => "https://meta.toolforge.org/$1$2", 9 | #"^/(crossactivity)(.*)$" => "https://meta2.toolforge.org/$1$2", 10 | "^/(stalktoy)(.*)$" => "https://meta3.toolforge.org/$1$2", 11 | 12 | # redirect root 13 | "^/?$" => "/crossactivity/", 14 | 15 | # prettify generated tool URLs that have a route version 16 | "^/crossactivity(?:/index.php|/)?\?user=([^&]+)$" => "/crossactivity/$1" 17 | ) 18 | 19 | # rewrite pretty URLs (e.g. /tool/a/b/c => /tool/index.php?@path=/a/b/c) 20 | url.rewrite-if-not-file += ( 21 | "^/crossactivity(/[^\?]*+)(?:\?(.*))?$" => "/crossactivity/index.php?@path=$1&$2" 22 | ) 23 | 24 | # enable status pages 25 | server.modules += ("mod_auth", "mod_status") 26 | status.status-url = "/server-status" 27 | status.statistics-url = "/server-statistics" 28 | -------------------------------------------------------------------------------- /user-scripts/dependencies/regex-colorizer.css: -------------------------------------------------------------------------------- 1 | /* 2 | Regex Colorizer RegexPal theme 3 | 4 | This CSS has been modified for Pathoschild's regex editor. The text colour has been changed 5 | to always match the background color, because the syntax-highlighted text is shown behind 6 | a transparent textbox containing the user's text. If the text isn't hidden, that causes 7 | the text to appear blurred. 8 | */ 9 | 10 | .regex {/*color: #000;*/ font-family: Consolas, "Source Code Pro", Monospace; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;} 11 | .regex b {font-weight: normal;} 12 | .regex i {font-style: normal;} 13 | .regex u {text-decoration: none;} 14 | 15 | /* metasequence */ 16 | .regex b {background: #aad1f7;} 17 | /* error */ 18 | .regex b.err {background: #ff4300;} 19 | 20 | /* char class */ 21 | .regex i {background: #f9ca69;} 22 | /* char class: metasequence */ 23 | .regex i b {background: #f7a700;} 24 | /* char class: range-hyphen */ 25 | .regex i u {background: #efba4a;} 26 | 27 | /* group: depth */ 28 | .regex b.g1 {background: #d2f854;} 29 | .regex b.g2 {background: #9ec70c;} 30 | .regex b.g3 {background: #ecc9f7;} 31 | .regex b.g4 {background: #54b70b;} 32 | .regex b.g5 {background: #b688cf;} -------------------------------------------------------------------------------- /tool-labs/stalktoy/framework/models/Block.php: -------------------------------------------------------------------------------- 1 | 56 | */ 57 | public array $wikiHash = []; 58 | } 59 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/localRules/CustomRule.php: -------------------------------------------------------------------------------- 1 | accumulator = $accumulator; 29 | } 30 | 31 | /** 32 | * Collect information from a wiki and return whether the rule has been met. 33 | * @param Toolserver $db The database wrapper. 34 | * @param Wiki $wiki The current wiki. 35 | * @param LocalUser $user The local user account. 36 | * @return ResultInfo|null The eligibility check result, or null if the rule doesn't apply to this wiki. 37 | */ 38 | public function accumulate(Toolserver $db, Wiki $wiki, LocalUser $user): ?ResultInfo 39 | { 40 | return ($this->accumulator)($db, $wiki, $user); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tool-labs/globalgroups/framework/GlobalGroupsEngine.php: -------------------------------------------------------------------------------- 1 | $a The left group. 15 | * @param array<'members'|'rights'|'name', mixed> $b The right group. 16 | * @param 'members'|'name'|'permissions' $sortBy The field to sort by. 17 | */ 18 | function groupSort(array $a, array $b, string $sortBy): int 19 | { 20 | global $sort; 21 | switch ($sort) { 22 | case 'members': 23 | $countA = $a['members']; 24 | $countB = $b['members']; 25 | if ($countA == $countB) 26 | return 0; 27 | if ($countA < $countB) 28 | return 1; 29 | return -1; 30 | 31 | case 'permissions': 32 | $countA = count($a['rights']); 33 | $countB = count($b['rights']); 34 | if ($countA == $countB) 35 | return 0; 36 | if ($countA < $countB) 37 | return 1; 38 | return -1; 39 | 40 | default: 41 | return strcasecmp($a['name'], $b['name']); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/globalRules/NotGloballyBlockedRule.php: -------------------------------------------------------------------------------- 1 | isGloballyBlocked($db, $user) 21 | ? new ResultInfo(Result::FAIL, "globally blocked.") 22 | : new ResultInfo(Result::PASS, "not globally blocked."); 23 | } 24 | 25 | 26 | ########## 27 | ## Private methods 28 | ########## 29 | /** 30 | * Get whether the user is globally blocked. 31 | * @param Toolserver $db The database wrapper. 32 | * @param GlobalUser $user The global user account. 33 | */ 34 | private function isGloballyBlocked(Toolserver $db, GlobalUser $user): bool 35 | { 36 | $db->query('SELECT 1 FROM centralauth_p.globalblocks WHERE gb_target_central_id = ? LIMIT 1', [$user->id]); 37 | return boolval($db->fetchColumn()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tool-labs/backend/modules/Logger.php: -------------------------------------------------------------------------------- 1 | key = $key; 37 | $this->logger = $enabled 38 | ? new KLogger($path, KLogger::DEBUG) 39 | : null; 40 | } 41 | 42 | /** 43 | * Write a message to the log. 44 | * @param string $message The message to log. 45 | */ 46 | public function log(string $message): void 47 | { 48 | if ($this->logger != null) { 49 | $message = "[{$this->key}] $message"; 50 | $this->logger->logInfo($message); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /tool-labs/.lighttpd.meta.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This Lighttpd config is used when deploying to the 'meta' account, which has all tools except 3 | # Crossactivity by default. See the README.md for usage. 4 | # 5 | 6 | url.redirect += ( 7 | # redirect to other tool accounts 8 | #"^/(accounteligibility|catanalysis|globalgroups|gusersearch|iso639db|magicredirect|pgkbot|scripts|stewardry|userpages)(.*)$" => "https://meta.toolforge.org/$1$2", 9 | "^/(crossactivity)(.*)$" => "https://meta2.toolforge.org/$1$2", 10 | "^/(stalktoy)(.*)$" => "https://meta3.toolforge.org/$1$2", 11 | 12 | # redirect root 13 | "^/?$" => "/accounteligibility/", 14 | 15 | # prettify generated tool URLs that have a route version 16 | "^/accounteligibility(?:/index.php|/)?\?user=([^&]+)&(?:(wiki=[^&]+)|wiki=)&event=(\d+)$" => "/accounteligibility/$3/$1?$2", 17 | "^/stewardry(?:/index.php|/)?\?wiki=([^&]+)&?(.*)$" => "/stewardry/$1?$2", 18 | "^/userpages(?:/index.php|/)?\?user=([^&]+)$" => "/userpages/$1", 19 | 20 | # scripts to static server 21 | "^/scripts/(.*)$" => "https://tools-static.wmflabs.org/meta/scripts/$1" 22 | ) 23 | 24 | # convert route value into query string 25 | url.rewrite-if-not-file += ( 26 | "^/(accounteligibility|gusersearch|stewardry|userpages)(/[^\?]+)(?:\?(.*))?$" => "/$1/index.php?@path=$2&$3" 27 | ) 28 | 29 | # enable status pages 30 | server.modules += ("mod_auth", "mod_status") 31 | status.status-url = "/server-status" 32 | status.statistics-url = "/server-statistics" 33 | -------------------------------------------------------------------------------- /tool-labs/stalktoy/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Generic */ 2 | table { 3 | font-size: 0.8em; 4 | } 5 | 6 | th { 7 | font-size: 1.2em; 8 | } 9 | 10 | th a { 11 | text-decoration: none; 12 | color: #000; 13 | } 14 | 15 | span.bad, span.good { 16 | padding: 0 3px; 17 | background: #FCC; 18 | } 19 | 20 | span.good { 21 | background: #CFC; 22 | } 23 | 24 | /* wiki data */ 25 | tr[data-open="0"] { 26 | color: #666; 27 | } 28 | 29 | tr[data-open="0"] .wiki:after { 30 | content: ' (closed)'; 31 | } 32 | 33 | /* user data */ 34 | .account-id { 35 | color: gray; 36 | } 37 | 38 | tr[data-exists="0"], 39 | tr[data-groups="0"] td.groups, 40 | tr[data-global-groups="0"] td.global-groups, 41 | tr[data-blocked="0"] td.blocks { 42 | background: #CCC; 43 | color: #666; 44 | } 45 | 46 | tr[data-groups="1"] td.groups, 47 | tr[data-global-groups="1"] td.global-groups, 48 | tr[data-unified="1"] td.unification { 49 | background: #CFC; 50 | } 51 | 52 | tr[data-unified="0"] td.unification, 53 | tr[data-blocked="1"] td.blocks { 54 | background: #FCC; 55 | } 56 | 57 | tr[data-unified="0"][data-unifiable="0"] td.unification { 58 | background: #CFC; 59 | } 60 | 61 | td.edit-count { 62 | text-align: right; 63 | } 64 | 65 | td.edit-count span { 66 | color: #FFF; 67 | font-size: 1px; 68 | } 69 | 70 | /* visualizations */ 71 | #account-visualizations { 72 | margin: 1em 1em 1em 2em; 73 | } 74 | 75 | #account-visualizations .viz-chart { 76 | float: left; 77 | margin-right: 2em; 78 | } 79 | -------------------------------------------------------------------------------- /tool-labs/stalktoy/framework/models/LocalAccount.php: -------------------------------------------------------------------------------- 1 | pgk that processes and filters IRC change feeds for wiki installations (see the onwiki documentation).') 6 | ->link('/pgkbot/stylesheet.css') 7 | ->header(); 8 | 9 | echo " 10 |

The pgkbot package is obsolete and no longer actively maintained. This mirror is maintained for historical interest.

11 |

Download

12 | 22 | "; 23 | 24 | $backend->footer(); -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/GlobalRuleManager.php: -------------------------------------------------------------------------------- 1 | rules = $rules; 33 | } 34 | 35 | /** 36 | * Check the rule against the global account. 37 | * @param Toolserver $db The database wrapper for metawiki. 38 | * @param GlobalUser|null $user The global user account to analyze, or null if it doesn't exist. 39 | * @return ResultInfo[] The eligibility check results. 40 | */ 41 | function verify(Toolserver $db, ?GlobalUser $user): array 42 | { 43 | // check rules 44 | $results = []; 45 | $anyFailed = false; 46 | foreach ($this->rules as $rule) { 47 | $result = $rule->verify($db, $user); 48 | 49 | if ($result->isFail()) 50 | $anyFailed = true; 51 | 52 | array_push($results, $result); 53 | } 54 | 55 | // handle workflow 56 | $this->result = $anyFailed 57 | ? Result::FAIL 58 | : Result::PASS; 59 | 60 | return $results; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tool-labs/crossactivity/framework/CrossactivityEngine.php: -------------------------------------------------------------------------------- 1 | = date('Ymd', strtotime('-1 week'))) 23 | $color = "CFC"; 24 | else if ($dateValue >= date('Ymd', strtotime('-3 week'))) 25 | $color = "FFC"; 26 | else 27 | $color = "FCC"; 28 | } 29 | 30 | return "$date"; 31 | } 32 | 33 | /** 34 | * Get HTML for a table cell containing a list of groups. 35 | * @param string|null $groups The comma-separated groups to show. 36 | */ 37 | function getGroupCellHtml(?string $groups): string 38 | { 39 | $text = $this->formatText($groups); 40 | 41 | return empty($groups) 42 | ? " " 43 | : "$text"; 44 | } 45 | 46 | /** 47 | * Get an HTML wiki link. 48 | * @param string $domain The wiki domain. 49 | * @param string $page The page title. 50 | */ 51 | function getLinkHtml(string $domain, string $page): string 52 | { 53 | return "$domain"; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tool-labs/backend/models/LocalUser.php: -------------------------------------------------------------------------------- 1 | id = $id; 58 | $this->name = $name; 59 | $this->registered = $registered; 60 | $this->registeredStr = $registeredStr; 61 | $this->edits = $edits; 62 | $this->actorID = $actorID; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /user-scripts/i18n/zh-hans.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "正则编辑器" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "正则编辑器", // the header text shown in the form 14 | search: "查找", // the search input label 15 | replace: "替换", // the replace input label 16 | nameSession: "输入该会话的名称:", // the prompt shown when saving the session 17 | loadSession: '载入会话"{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: '删除会话"{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "关闭正则编辑器", // tooltip shown for the close-editor icon 20 | addPatterns: "添加新模式", // button text 21 | addPatternsTooltip: "添加一个新的查找替换框", // button tooltip 22 | apply: "应用", // button text 23 | applyTooltip: "应用以上模式", // button tooltip 24 | undo: "撤销上一步应用", // button text 25 | undoTooltip: "撤销上一步应用", // button tooltip 26 | save: "保存方案", // button text 27 | saveTooltip: "保存该会话以便下次使用", // button tooltip 28 | instructions: '本工具能够输入并执行任意数量的正则表达式。查找功能的模式(pattern)可以直接使用 {code|text=模式},也可以使用 {code|text=/模式/修饰符},搜索功能的模式中可包含捕获组,例如 {code|text=$1}(参见{helplink|text=教程|title=Tutorial JavaScript regex|url=https://www.regular-expressions.info/javascript.html})。' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /tool-labs/content/jquery.multiselect/jquery.multiselect.css: -------------------------------------------------------------------------------- 1 | a.multiSelect { 2 | background: #FFF url(images/dropdown.blue.png) right center no-repeat; 3 | border: solid 1px #BBB; 4 | padding-right: 20px; 5 | position: relative; 6 | cursor: default; 7 | text-decoration: none; 8 | color: black; 9 | display: -moz-inline-stack; 10 | display: inline-block; 11 | vertical-align: top; 12 | } 13 | 14 | a.multiSelect:link, a.multiSelect:visited, a.multiSelect:hover, a.multiSelect:active { 15 | color: black; 16 | text-decoration: none; 17 | } 18 | 19 | a.multiSelect span 20 | { 21 | margin: 1px 0px 1px 3px; 22 | overflow: hidden; 23 | display: -moz-inline-stack; 24 | display: inline-block; 25 | white-space: nowrap; 26 | } 27 | 28 | a.multiSelect.hover { 29 | background-image: url(images/dropdown.blue.hover.png); 30 | } 31 | 32 | a.multiSelect.active, 33 | a.multiSelect.focus { 34 | border: inset 1px #000; 35 | } 36 | 37 | a.multiSelect.active { 38 | background-image: url(images/dropdown.blue.active.png); 39 | } 40 | 41 | .multiSelectOptions { 42 | margin-top: -1px; 43 | overflow-y: auto; 44 | overflow-x: hidden; 45 | border: solid 1px #B2B2B2; 46 | background: #FFF; 47 | } 48 | 49 | .multiSelectOptions LABEL { 50 | padding: 0px 2px; 51 | display: block; 52 | white-space: nowrap; 53 | } 54 | 55 | .multiSelectOptions LABEL.optGroup 56 | { 57 | font-weight: bold; 58 | } 59 | 60 | .multiSelectOptions .optGroupContainer LABEL 61 | { 62 | padding-left: 10px; 63 | } 64 | 65 | .multiSelectOptions.optGroupHasCheckboxes .optGroupContainer LABEL 66 | { 67 | padding-left: 18px; 68 | } 69 | 70 | .multiSelectOptions input{ 71 | vertical-align: middle; 72 | } 73 | 74 | .multiSelectOptions LABEL.checked { 75 | background-color: #dce5f8; 76 | } 77 | 78 | .multiSelectOptions LABEL.selectAll { 79 | border-bottom: dotted 1px #CCC; 80 | } 81 | 82 | .multiSelectOptions LABEL.hover { 83 | background-color: #3399ff; 84 | color: white; 85 | } -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/localRules/DateRegisteredRule.php: -------------------------------------------------------------------------------- 1 | maxDate = new DateWrapper($maxDate); 28 | } 29 | 30 | /** 31 | * Collect information from a wiki and return whether the rule has been met. 32 | * @param Toolserver $db The database wrapper. 33 | * @param Wiki $wiki The current wiki. 34 | * @param LocalUser $user The local user account. 35 | * @return ResultInfo|null The eligibility check result, or null if the rule doesn't apply to this wiki. 36 | */ 37 | public function accumulate(Toolserver $db, Wiki $wiki, LocalUser $user): ?ResultInfo 38 | { 39 | // accumulate 40 | $registered = $user->registered; 41 | if (!$user->registered) 42 | $registered = $db->getRegistrationDate($user->id, $user->actorID, "d F Y", true)[0]; 43 | $isMet = !$registered/*before 2005*/ || $registered <= $this->maxDate->mediawiki; 44 | 45 | // get result 46 | $result = $isMet ? Result::PASS : Result::FAIL; 47 | $message = $isMet 48 | ? "was registered as of {$this->maxDate->readable}." 49 | : "was not registered as of {$this->maxDate->readable}..."; 50 | return new ResultInfo($result, $message); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /user-scripts/i18n/ja.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "テンプレートスクリプト", // the sidebar header text label for the default group 10 | regexEditor: "正規表現エディタ" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "正規表現エディタ", // the header text shown in the form 14 | search: "検索", // the search input label 15 | replace: "置換", // the replace input label 16 | nameSession: "セッション名を入力する", // the prompt shown when saving the session 17 | loadSession: 'セッション"{name}"を開く', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'セッション"{name}"を削除する', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "正規表現エディタを終了する", // tooltip shown for the close-editor icon 20 | addPatterns: "パターンを追加する", // button text 21 | addPatternsTooltip: "検索・置換ボックスを追加する", // button tooltip 22 | apply: "適用する", // button text 23 | applyTooltip: "上記のパターンを適用する", // button tooltip 24 | undo: "最後の適用を取り消す", // button text 25 | undoTooltip: "最後の適用を取り消す", // button tooltip 26 | save: "保存する", // button text 27 | saveTooltip: "後で使うためにセッションを保存する", // button tooltip 28 | instructions: '任意の数の正規表現を入力できます。検索パターンは"{code|text=検索パターン}"または"{code|text=/パターン/修飾子}"のように指定します。置換パターンには"{code|text=$1}"のように参照グループを含めることができます({helplink|text=チュートリアル|title=JavaScript regex tutorial|url=https://www.regular-expressions.info/javascript.html}を参照してください)。' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/pathoschild.forceltr.js: -------------------------------------------------------------------------------- 1 | var pathoschild = pathoschild || {}; 2 | (function() { 3 | "use strict"; 4 | 5 | /** 6 | * Forces MediaWiki into displaying text in left-to-right format, even if the wiki's primary language is right-to-left. 7 | * @see https://github.com/Pathoschild/Wikimedia-contrib#readme 8 | */ 9 | pathoschild.forceLtr = { 10 | version: "1.3", 11 | langUrlToken: /(\?|&|&)lang=(.+?)(&|$)/, 12 | rtlCodes: /ar|arc|arz|azb|bcc|ckb|bqi|dv|fa|fa-af|glk|ha|he|kk-arab|kk-cn|ks|ku-arab|mzn|pnb|prd|ps|sd|ug|ur|ydd|yi/, // derived from meta.wikimedia.org/wiki/Template:Dir 13 | 14 | /** 15 | * Apply the changes. 16 | */ 17 | initialize: function() { 18 | var self = pathoschild.forceLtr; 19 | 20 | if ($("body").is(".rtl, .sitedir-rtl")) { 21 | // adjust classes 22 | $("body").removeClass("mw-content-ltr mw-content-rtl"); 23 | $(".sitedir-rtl").removeClass("sitedir-rtl").addClass("sitedir-ltr"); 24 | $(".rtl").removeClass("rtl").addClass("ltr"); 25 | $('[dir="rtl"]').attr("dir", "ltr"); 26 | 27 | // switch rtl styles 28 | $('link[rel="stylesheet"]').each(function() { 29 | var link = $(this); 30 | var href = link.attr("href"); 31 | var lang = href.match(self.langUrlToken); 32 | if (lang && lang[2].match(self.rtlCodes)) 33 | link.attr("href", href.replace(self.langUrlToken, "$1lang=en$3")); 34 | }); 35 | 36 | // fix harcoded RTL styles 37 | mw.util.addCSS( 38 | ` 39 | .mw-content-ltr { text-align:left; } 40 | .ltr, .ltr dd, .ltr ol, .ltr ul { direction: ltr !important; } 41 | ` 42 | ); 43 | } 44 | } 45 | }; 46 | 47 | $.when($.ready, mw.loader.using("mediawiki.util")).done(pathoschild.forceLtr.initialize); 48 | }()); 49 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/localRules/HasGroupRule.php: -------------------------------------------------------------------------------- 1 | group = $group; 37 | } 38 | 39 | /** 40 | * Collect information from a wiki and return whether the rule has been met. 41 | * @param Toolserver $db The database wrapper. 42 | * @param Wiki $wiki The current wiki. 43 | * @param LocalUser $user The local user account. 44 | * @return ResultInfo|null The eligibility check result, or null if the rule doesn't apply to this wiki. 45 | */ 46 | public function accumulate(Toolserver $db, Wiki $wiki, LocalUser $user): ?ResultInfo 47 | { 48 | // accumulate 49 | $hasGroup = (bool)$db->query('SELECT COUNT(ug_user) FROM user_groups WHERE ug_user=? AND ug_group=? LIMIT 1', [$user->id, $this->group])->fetchColumn(); 50 | $isMet = $hasGroup == !$this->negate; 51 | 52 | // get message 53 | $message = $hasGroup 54 | ? "is a {$this->group}" 55 | : "is not a {$this->group}"; 56 | $message .= $isMet ? "..." : "."; 57 | 58 | // build result 59 | return new ResultInfo($isMet ? Result::PASS : Result::FAIL, $message); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /user-scripts/i18n/sr-ec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Уређивач регуларних израза." // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Уређивач регуларних израза", // the header text shown in the form 14 | search: "Претражи", // the search input label 15 | replace: "Замени", // the replace input label 16 | nameSession: "Унеси име за ову сесију", // the prompt shown when saving the session 17 | loadSession: "Учитај сесију «{name}»", // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: "Уклони сесију «{name}»", // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Затвори уређивач", // tooltip shown for the close-editor icon 20 | addPatterns: "Додај шаблоне", // button text 21 | addPatternsTooltip: "Додај поље за претрагу и замену", // button tooltip 22 | apply: "Примени", // button text 23 | applyTooltip: "Изведите горње шаблоне", // button tooltip 24 | undo: "Поништи претходну измену", // button text 25 | undoTooltip: "Поништи претходну измену", // button tooltip 26 | save: "Сачувај", // button text 27 | saveTooltip: "Сачувај ову сесију за касније коришћење", // button tooltip 28 | instructions: "Унесите било који број регуларних израза за извршавање. Шема за претрагу може бити попут «{code|text=претрага узорка}», било као «{code|text=/шаблон/застава}», и заменски шаблон може садржавати референтне групе као што су «{code|text=$1}» (види {helplink|text=tutorial|title=Туторијал|url=https://www.regular-expressions.info/javascript.html}).'" 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/sr-el.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Uređivač regularnih izraza." // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Uređivač regularnih izraza", // the header text shown in the form 14 | search: "Pretraži", // the search input label 15 | replace: "Zameni", // the replace input label 16 | nameSession: "Unesi ime za ovu sesiju", // the prompt shown when saving the session 17 | loadSession: "Učitaj sesiju «{name}»", // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: "Ukloni sesiju «{name}»", // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Zatvori uređivač", // tooltip shown for the close-editor icon 20 | addPatterns: "Dodaj šablone", // button text 21 | addPatternsTooltip: "Dodaj polje za pretragu i zamenu", // button tooltip 22 | apply: "Primeni", // button text 23 | applyTooltip: "Izvedite gornje šablone", // button tooltip 24 | undo: "Poništi prethodnu izmenu", // button text 25 | undoTooltip: "Poništi prethodnu izmenu", // button tooltip 26 | save: "Sačuvaj", // button text 27 | saveTooltip: "Sačuvaj ovu sesiju za kasnije korišćenje", // button tooltip 28 | instructions: "Unesite bilo koji broj regularnih izraza za izvršavanje. Šema za pretragu može biti poput «{code|text=pretraga uzorka}», bilo kao «{code|text=/šablon/zastava}», i zamenski šablon može sadržavati referentne grupe kao što su «{code|text=$1}» (vidi {helplink|text=tutorial|title=Tutorijal|url=https://www.regular-expressions.info/javascript.html}).'" 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/ur.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "سانچہ سکرپٹ", // the sidebar header text label for the default group 10 | regexEditor: "ریجیکس خانہ ترمیم" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "ریجیکس خانہ ترمیم", // the header text shown in the form 14 | search: "تلاش", // the search input label 15 | replace: "تبدیلی", // the replace input label 16 | nameSession: "اس نشست کا نام درج کریں", // the prompt shown when saving the session 17 | loadSession: '"{name}" نشست لوڈ کریں', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: '"{name}" نشست حذف کریں', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "ریجیکس خانہ ترمیم بند کریں", // tooltip shown for the close-editor icon 20 | addPatterns: "پیٹرنز شامل کریں", // button text 21 | addPatternsTooltip: "خانہ ہائے تلاش و تبدیلی شامل کریں", // button tooltip 22 | apply: "اطلاق", // button text 23 | applyTooltip: "درج بالا پیٹرنز کو نافذ کریں", // button tooltip 24 | undo: "آخری تنفیذ کا استرجع کریں", // button text 25 | undoTooltip: "آخری تنفیذ کا استرجع کریں", // button tooltip 26 | save: "محفوظ کریں", // button text 27 | saveTooltip: "آئندہ استعمال کے لیے اس نشست کو محفوظ کریں", // button tooltip 28 | instructions: 'تنفیذ کے لیے ریگیولر ایکسپریشنز درج کریں۔ تلاش کا پیٹرن اس طرح ہوگا "{code|text=search pattern}" یا "{code|text=/pattern/modifiers}"، اور تبدیلی پیٹرن میں ریفرینس گروپس بھی شامل کیے جا سکتے ہیں مثلاً "{code|text=$1}" ({helplink|text=tutorial|title=JavaScript regex یہ ٹیوٹوریل|url=https://www.regular-expressions.info/javascript.html} ملاحظہ فرمائیں)۔' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/ru.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Редактор рег. выраж." // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Редактор регулярных выражений", // the header text shown in the form 14 | search: "Поиск", // the search input label 15 | replace: "Замена", // the replace input label 16 | nameSession: "Укажите имя данной сессии", // the prompt shown when saving the session 17 | loadSession: "Загрузить сессию «{name}»", // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: "Удалить сессию «{name}»", // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Закрыть редактор", // tooltip shown for the close-editor icon 20 | addPatterns: "Добавить шаблон", // button text 21 | addPatternsTooltip: "Добавить поле поиска и замены", // button tooltip 22 | apply: "Применить", // button text 23 | applyTooltip: "Выполнить данные шаблоны", // button tooltip 24 | undo: "Отмена последнего действия", // button text 25 | undoTooltip: "Отмена последнего действия", // button tooltip 26 | save: "Сохранить", // button text 27 | saveTooltip: "Сохранение сессии для применения в будущем", // button tooltip 28 | instructions: "Вы можете указать любое количество шаблонов для использования. Шаблон поиска может выглядеть как «{code|text=шаблон поиска}», либо как «{code|text=/шаблон/флаги}», а шаблон замены может содержать ссылки на группы вида «{code|text=$1}» (см. {helplink|text=справку|title=Справка по регулярным выражениям JavaScript|url=https://learn.javascript.ru/regular-expressions-javascript})." 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Editor de regex" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Editor de regex", // the header text shown in the form 14 | search: "Buscar", // the search input label 15 | replace: "Reemplazar", // the replace input label 16 | nameSession: "Introduzca un nombre para esta sesión", // the prompt shown when saving the session 17 | loadSession: 'Cargar sesión "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'Borrar sesión "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Cerrar el editor de regex", // tooltip shown for the close-editor icon 20 | addPatterns: "añadir patrones", // button text 21 | addPatternsTooltip: "Añadir botones de búsqueda y reemplazo", // button tooltip 22 | apply: "aplicar", // button text 23 | applyTooltip: "Realizar los patrones designados más arriba", // button tooltip 24 | undo: "deshacer lo último", // button text 25 | undoTooltip: "Deshacer lo último", // button tooltip 26 | save: "guardar", // button text 27 | saveTooltip: "Guardar esta sesión para uso posterior", // button tooltip 28 | instructions: 'Introduce cualquier número de expresiones regulares a ejecutar. El patrón de búsqueda puede ser tipo "{code|text=patrón de búsqueda}" o "{code|text=/patrón/modificadores}", y el patrón de reemplazos puede contener referencias a grupos como "{code|text=$1}" (ver {helplink|text=tutorial|title=Tutorial JavaScript regex|url=https://www.regular-expressions.info/javascript.html}).' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/th.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "แม่แบบสคริปต์", // the sidebar header text label for the default group 10 | regexEditor: "แก้ไขด้วย RegEx" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "เครื่องมือแก้ไขด้วย RegEx", // the header text shown in the form 14 | search: "ค้นหา", // the search input label 15 | replace: "แทนที่ด้วย", // the replace input label 16 | nameSession: "ตั้งชื่อสำหรับการตั้งค่านี้", // the prompt shown when saving the session 17 | loadSession: 'โหลด "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'ลบ "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "ปิดหน้าเครื่องมือนี้", // tooltip shown for the close-editor icon 20 | addPatterns: "เพิ่มรูปแบบ", // button text 21 | addPatternsTooltip: "เพิ่มช่องสำหรับค้นหาและแทนที่", // button tooltip 22 | apply: "ใช้งาน", // button text 23 | applyTooltip: "เริ่มการทำงานของรูปแบบด้านบน", // button tooltip 24 | undo: "ย้อน", // button text 25 | undoTooltip: "ย้อนกลับการใช้งานก่อนหน้า", // button tooltip 26 | save: "บันทึก", // button text 27 | saveTooltip: "บันทึกไว้สำหรับการใช้ในครั้งถัดไป", // button tooltip 28 | instructions: 'ใช้นิพจน์ปรกติในการประมวลผล หรือค้นหารูปแบบของข้อความเช่น "{code|text=รูปแบบค้นหา}" หรือ "{code|text=/<รูปแบบ RegEx>/}" และสามารถใช้งานการอ้างอิงไปยังกลุ่มโดยใช้ "{code|text=$1}" (ดูที่{helplink|text=การใช้งาน|title=การใช้งาน RegEx ในจาวาสคริปต์|url=https://www.regular-expressions.info/javascript.html})' 29 | } 30 | 31 | 32 | }; 33 | -------------------------------------------------------------------------------- /user-scripts/i18n/bn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "টেমপ্লেট স্ক্রিপ্ট", // the sidebar header text label for the default group 10 | regexEditor: "Regex সম্পাদক" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Regex সম্পাদক", // the header text shown in the form 14 | search: "অনুসন্ধান", // the search input label 15 | replace: "প্রতিস্থাপন", // the replace input label 16 | nameSession: "এই সেশনের জন্য একটি নাম লিখুন", // the prompt shown when saving the session 17 | loadSession: 'সেশন "{name}" লোড করুন', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'সেশন "{name}" অপসারণ করুন', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Regex সম্পাদক বন্ধ করুন", // tooltip shown for the close-editor icon 20 | addPatterns: "প্যাটার্ন যোগ", // button text 21 | addPatternsTooltip: "অনুসন্ধান ও প্রতিস্থাপন বাক্স যোগ করুন", // button tooltip 22 | apply: "প্রয়োগ করুন", // button text 23 | applyTooltip: "উপরের প্যাটার্ন সঞ্চালন করুন", // button tooltip 24 | undo: "সর্বশেষ প্রয়োগ বাতিল করুন", // button text 25 | undoTooltip: "সর্বশেষ প্রয়োগ বাতিল করবে", // button tooltip 26 | save: "সংরক্ষণ", // button text 27 | saveTooltip: "পরে ব্যবহার করার জন্য এই সেশন সংরক্ষণ করুন", // button tooltip 28 | instructions: 'কার্যকর করার জন্য রেগুলার এক্সপ্রেশনের যে কোন একটি নম্বর লিখুন। অনুসন্ধান প্যাটার্ন দেখতে "{code|text=অনুসন্ধান প্যাটার্ন}" বা "{code|text=/pattern/modifiers}"-এর মত হতে পারে, এবং প্রতিস্থাপন প্যাটার্নে তথ্যসূত্রের গ্রুপ থাকতে পারে যেমন "{code|text=$1}" ({helplink|text=নির্দেশিকা|title=জাভাস্ক্রিপ্ট regex টিউটোরিয়াল|url=https://www.regular-expressions.info/javascript.html} দেখুন)।' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/ca.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Editor regex" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Editor d´expressions regulars", // the header text shown in the form 14 | search: "Cercar", // the search input label 15 | replace: "Reemplaçar", // the replace input label 16 | nameSession: "Introdueixi un nom per aquesta sessió", // the prompt shown when saving the session 17 | loadSession: 'Carregar sessió "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'Esborrar sessió "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Tancar l´editor regex", // tooltip shown for the close-editor icon 20 | addPatterns: "Afegeix patrons", // button text 21 | addPatternsTooltip: "Afegeix caixes de cerca i reemplaçament", // button tooltip 22 | apply: "Aplica", // button text 23 | applyTooltip: "Aplica els patrons indicats", // button tooltip 24 | undo: "Desfés darrer canvi", // button text 25 | undoTooltip: "Desfà el darrer canvi", // button tooltip 26 | save: "Desa canvis", // button text 27 | saveTooltip: "Desa aquesta sessió per usar-la més endavant", // button tooltip 28 | instructions: 'Introdueixi les expressions regulars a executar. El patró de cerca pot ser de com "{code|text=patró de cerca}" o "{code|text=/patró/modificadors}" i el patró de reemplaçament pot contenir grups de referència com "{code|text=$1}" (vegeu {helplink|text=tutorial|title=JavaScript regex tutorial|url=https://www.regular-expressions.info/javascript.html}).' 29 | } 30 | }; -------------------------------------------------------------------------------- /user-scripts/toolinfo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "meta-templatescript", 4 | "title": "TemplateScript", 5 | "description": "JavaScript which adds a menu of configurable templates and scripts to the sidebar. It automatically handles templates for various forms (from editing to protection), edit summaries, auto-submission, and filtering which templates are shown based on namespace, form, or arbitrary conditions. Templates can be inserted at the cursor position or at a preconfigured position, and scripts can be invoked when a sidebar link is activated. TemplateScript is also used as a framework for other scripts, and includes a fully-featured regex editor.", 6 | "url": "https://meta.wikimedia.org/wiki/TemplateScript", 7 | "keywords": "editing, user script", 8 | "author": "Pathoschild", 9 | "repository": "https://github.com/Pathoschild/Wikimedia-contrib.git" 10 | }, 11 | { 12 | "name": "meta-forceltr", 13 | "title": "ForceLTR", 14 | "description": "JavaScript which enforces left-to-right layout and editing on right-to-left wikis. This resolves editing glitches in many browsers when one's preferred language is left-to-right, and corrects display when the interface language is not right-to-left.", 15 | "url": "https://meta.wikimedia.org/wiki/Force_ltr", 16 | "keywords": "editing, user script", 17 | "author": "Pathoschild", 18 | "repository": "https://github.com/Pathoschild/Wikimedia-contrib.git" 19 | }, 20 | { 21 | "name": "meta-stewardscript", 22 | "title": "StewardScript", 23 | "description": "JavaScript which extends the user interface for Wikimedia stewards' convenience.", 24 | "url": "https://meta.wikimedia.org/wiki/Scripts/StewardScript", 25 | "keywords": "editing, user script", 26 | "author": "Pathoschild", 27 | "repository": "https://github.com/Pathoschild/Wikimedia-contrib.git" 28 | }, 29 | { 30 | "name": "meta-usejs", 31 | "title": "UseJS", 32 | "description": "JavaScript which imports JavaScript for the current page when the URL contains a parameter like &usejs=MediaWiki:Common.js. It only accepts scripts in the protected MediaWiki: namespace.", 33 | "url": "https://meta.wikimedia.org/wiki/UseJS", 34 | "keywords": "editing, user script", 35 | "author": "Pathoschild", 36 | "repository": "https://github.com/Pathoschild/Wikimedia-contrib.git" 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /user-scripts/i18n/de.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Regex-Editor" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Regex-Editor", // the header text shown in the form 14 | search: "Suchen", // the search input label 15 | replace: "Ersetzen", // the replace input label 16 | nameSession: "Namen für diese Sitzung angeben", // the prompt shown when saving the session 17 | loadSession: 'Sitzung "{name}" laden', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'Sitzung "{name}" löschen', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Regex-Editor schließen", // tooltip shown for the close-editor icon 20 | addPatterns: "Weiteres Feld", // button text 21 | addPatternsTooltip: "Weiteres Feld für Such- und Ersetzungsmuster hinzufügen", // button tooltip 22 | apply: "Anwenden", // button text 23 | applyTooltip: "Obenstehende Muster anwenden", // button tooltip 24 | undo: "Letzte Ersetzung zurücknehmen", // button text 25 | undoTooltip: "Letzte Ersetzung rückgängig machen", // button tooltip 26 | save: "Speichern", // button text 27 | saveTooltip: "Diese Sitzung zur erneuten Verwendung speichern", // button tooltip 28 | instructions: 'Gib einen Regulären Ausdruck ein, der angewendet werden soll. Das Suchmuster kann eine einfache Folge sein wie "{code|text=Suchmuster}" oder ein Ausdruck "{code|text=/Muster/Modifikatoren}" und das Ersetzungsmuster kann Referenzgruppen enthalten wie "{code|text=$1}" (siehe {helplink|text=englisches Tutorial|title=JavaScript-Regex-Tutorial|url=https://www.regular-expressions.info/javascript.html}).' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/fr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "éditeur regex" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "éditeur regex", // the header text shown in the form 14 | search: "Recherche", // the search input label 15 | replace: "Remplacement", // the replace input label 16 | nameSession: "Entrez un nom pour cette session", // the prompt shown when saving the session 17 | loadSession: 'Charger la session "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'Supprimer la session "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Fermer l'éditeur de regex", // tooltip shown for the close-editor icon 20 | addPatterns: "ajouter des motifs", // button text 21 | addPatternsTooltip: "Ajouter des motifs", // button tooltip 22 | apply: "appliquer", // button text 23 | applyTooltip: "Effectuer les motifs ci-dessus", // button tooltip 24 | undo: "annuler la dernière application", // button text 25 | undoTooltip: "Annuler la dernière application", // button tooltip 26 | save: "sauvegarder", // button text 27 | saveTooltip: "Enregistrer cette session pour une utilisation ultérieure", // button tooltip 28 | instructions: "Entrez un nombre quelconque d'expressions régulières à exécuter. Le motif de recherche peut être « {code|text=texte simple} » ou un motif regex tel que « {code|text=/motif/modificateurs} », et le remplacement peut contenir des groupes de référence tel que « {code|text=$1} » (voir {helplink|text=un tutoriel (en anglais)|title=tutoriel de regex JavaScript|url=https://www.regular-expressions.info/javascript.html})." 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /user-scripts/i18n/it.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | var pathoschild = pathoschild || {}; 6 | pathoschild.i18n = { 7 | templatescript: { 8 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 9 | regexEditor: "Editor Regex" // the default 'regex editor' script 10 | }, 11 | regexeditor: { 12 | header: "Editor Regex", // the header text shown in the form 13 | search: "Cerca", // the search input label 14 | replace: "Sostituisci", // the replace input label 15 | nameSession: "Inserisci un nome per questa sessione", // the prompt shown when saving the session 16 | loadSession: 'Carica la sessione "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 17 | deleteSession: 'Elimina la sessione "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 18 | closeEditor: "Chiudi l'editor di regex", // tooltip shown for the close-editor icon 19 | addPatterns: "aggiungi modello", // button text 20 | addPatternsTooltip: "Aggiungi caselle cerca & sostituisci", // button tooltip 21 | apply: "applica", // button text 22 | applyTooltip: "Esegui il modello", // button tooltip 23 | undo: "annulla l'ultimo applica", // button text 24 | undoTooltip: "Annulla l'ultimo applica", // button tooltip 25 | save: "salva", // button text 26 | saveTooltip: "Salva questa sessione per utilizzarla più tardi", // button tooltip 27 | instructions: 'Inserisci qualsiasi numero di espressioni regolari da eseguire. Il modello può essere ad esempio "{code|text=modello di cerca}" o "{code|text=/pattern/modifiers}", e il modello sostituito può contenere riferimenti a gruppi, ad esempio "{code|text=$1}" (vedi il {helplink|text=tutorial|title=JavaScript regex tutorial|url=https://www.regular-expressions.info/javascript.html}).' 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /user-scripts/templates/pathoschild.templatescript.settings.htm: -------------------------------------------------------------------------------- 1 |

TemplateScript adds custom one-click templates and scripts to your sidebar when editing pages (or other forms). You can import libraries of scripts maintained by other users, or write your own scripts if you're feeling adventurous. See m:TemplateScript for more information.

2 | 3 |
4 |
5 |

Contents

6 |  [hide 7 |
8 | 18 |
19 | 20 |

Imported libraries

21 |

These libraries have been imported for you (probably via your common.js or a gadget). You can choose which scripts will be shown. Your settings will be saved permanently to your user preferences; you can return to this page anytime to edit them. Changes are saved immediately.

22 | 23 | {{#if libraries.length}} 24 | {{#each libraries}} 25 |

{{this.name}}

26 |

{{{this.description}}}

27 | 39 | {{/each}} 40 | {{else}} 41 |

(You haven't imported any libraries.)

42 | {{/if}} 43 | -------------------------------------------------------------------------------- /user-scripts/i18n/pt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | */ 5 | 6 | var pathoschild = pathoschild || {}; 7 | pathoschild.i18n = { 8 | templatescript: { 9 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 10 | regexEditor: "Editor de regex" // the default 'regex editor' script 11 | }, 12 | regexeditor: { 13 | header: "Editor de expressões regulares (regex)", // the header text shown in the form 14 | search: "Localizar", // the search input label 15 | replace: "Substituir", // the replace input label 16 | nameSession: "Forneça um nome para esta sessão", // the prompt shown when saving the session 17 | loadSession: 'Carregar a sessão "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 18 | deleteSession: 'Apagar a sessão "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 19 | closeEditor: "Fechar o editor de expressões regulares", // tooltip shown for the close-editor icon 20 | addPatterns: "incluir padrões", // button text 21 | addPatternsTooltip: "Incluir caixas de localizar e substituir", // button tooltip 22 | apply: "aplicar", // button text 23 | applyTooltip: "Executar os padrões acima", // button tooltip 24 | undo: "desfazer a última aplicação", // button text 25 | undoTooltip: "Desfazer a última aplicação", // button tooltip 26 | save: "salvar", // button text 27 | saveTooltip: "Salvar esta sessão para uso posterior", // button tooltip 28 | instructions: 'Insira qualquer número de expressõres regulares a serem executadas. O padrão de busca pode ser como "{code|text=padrão de busca}" ou "{code|text=/padrão/modificadores}", e o padrão de substituição pode conter grupos de referência como "{code|text=$1}" (ver {helplink|text=um tutorial|title=Tutorial sobre expressões regulares em JavaScript|url=https://www.regular-expressions.info/javascript.html}).' 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/models/ResultInfo.php: -------------------------------------------------------------------------------- 1 | result = $result; 52 | $this->message = $message; 53 | $this->isFinal = $isFinal; 54 | } 55 | 56 | /** 57 | * Get whether the eligibility check passed. 58 | */ 59 | public function isPass(): bool 60 | { 61 | return $this->result == Result::PASS; 62 | } 63 | 64 | /** 65 | * Get whether the eligibility check passed, but we should still check other wikis. 66 | */ 67 | public function isSoftPass(): bool 68 | { 69 | return $this->result == Result::SOFT_PASS; 70 | } 71 | 72 | /** 73 | * Get whether the eligibility check failed. 74 | */ 75 | public function isFail(): bool 76 | { 77 | return $this->result == Result::FAIL; 78 | } 79 | 80 | /** 81 | * Add a warning message for this result. 82 | * @param string $message The warning message. 83 | */ 84 | public function addWarning(string $message): void 85 | { 86 | array_push($this->warnings, $message); 87 | } 88 | 89 | /** 90 | * Add a note about this result. 91 | * @param string $message The note message. 92 | */ 93 | public function addNote(string $message): void 94 | { 95 | array_push($this->notes, $message); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /user-scripts/i18n/en.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a sample translation file for these scripts. See https://meta.wikimedia.org/wiki/TemplateScript#Translation 3 | * for instructions on using translation files. 4 | * 5 | * To translate these scripts: 6 | * 1. Copy this to a *new* file named with your language code. 7 | * 2. Translate the text inside 'quotes'. Be careful with the special tokens that look like 8 | * {variable}; these are placeholders. Only translate the text right of the '=' symbol. For example, 9 | * only "reset the form" should be translated for the "{resetForm|text=reset the form}" token. 10 | * 3. Submit a pull request to the Git repository, or simply post it to https://meta.wikimedia.org/wiki/User_talk:Pathoschild 11 | * and I'll do the rest. 12 | */ 13 | 14 | var pathoschild = pathoschild || {}; 15 | pathoschild.i18n = { 16 | templatescript: { 17 | defaultHeaderText: "TemplateScript", // the sidebar header text label for the default group 18 | regexEditor: "Regex editor" // the default 'regex editor' script 19 | }, 20 | regexeditor: { 21 | header: "Regex editor", // the header text shown in the form 22 | search: "Search", // the search input label 23 | replace: "Replace", // the replace input label 24 | nameSession: "Enter a name for this session", // the prompt shown when saving the session 25 | loadSession: 'Load session "{name}"', // tooltip shown for a saved session, where {name} is replaced with the session name 26 | deleteSession: 'Delete session "{name}"', // tooltip shown for the delete icon on a saved session, where {name} is replaced with the session name 27 | closeEditor: "Close the regex editor", // tooltip shown for the close-editor icon 28 | addPatterns: "add patterns", // button text 29 | addPatternsTooltip: "Add search & replace boxes", // button tooltip 30 | apply: "apply", // button text 31 | applyTooltip: "Perform the above patterns", // button tooltip 32 | undo: "undo the last apply", // button text 33 | undoTooltip: "Undo the last apply", // button tooltip 34 | save: "save", // button text 35 | saveTooltip: "Save this session for later use", // button tooltip 36 | instructions: 'Enter any number of regular expressions to execute. The search pattern can be like "{code|text=search pattern}" or "{code|text=/pattern/modifiers}", and the replace pattern can contain reference groups like "{code|text=$1}" (see {helplink|text=tutorial|title=JavaScript regex tutorial|url=https://www.regular-expressions.info/javascript.html}).' 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /tool-labs/userpages/scripts.js: -------------------------------------------------------------------------------- 1 | var pathoschild = pathoschild || {}; 2 | pathoschild.PageFilters = function () { 3 | /** 4 | * Filters the user page list to only show pages matching the selected filters. 5 | */ 6 | 7 | var filters = $(".filter"); 8 | this.apply = function () { 9 | /** 10 | * Reapply the selected filters. 11 | */ 12 | // reset filters 13 | $(".result-box").find("ul, li, h2").filter(":hidden").show(); 14 | 15 | // apply filters 16 | var items = $(".result-box li"); 17 | $("[data-filters]").each(function () { 18 | var toggle = $(this); 19 | if (!toggle.hasClass("selected")) 20 | items.filter(toggle.data("filters")).hide(); 21 | }); 22 | 23 | // hide wikis with no pages shown 24 | $(".result-box ul:not(:has(li:visible))").hide(); 25 | $(".result-box ul:not(:visible)").prev("h2").hide(); 26 | }; 27 | 28 | this.getToggle = function (key) { 29 | /** 30 | * Get the toggle element for a filter. 31 | * @param key {string} The unique key for the filter. 32 | */ 33 | return filters.filter('[data-filter-key="' + key + '"]'); 34 | } 35 | 36 | this.isEnabled = function (key) { 37 | /** 38 | * Get whether the specified filter is enabled. 39 | * @param key {string} The unique key for the filter. 40 | */ 41 | return this.getToggle(key).hasClass("selected"); 42 | }; 43 | 44 | this.toggle = function (key) { 45 | /** 46 | * Toggle a filter in the UI and URL. 47 | * @param key {string} The unique key for the filter. 48 | */ 49 | this.getToggle(key).toggleClass("selected"); 50 | location.hash = "#" + $("[data-filters].selected").map(function () { 51 | return $(this).attr("data-filter-key"); 52 | }).get().join(); 53 | this.apply(); 54 | } 55 | 56 | this.readHash = function () { 57 | /** 58 | * Update the filters based on the URL's hash. 59 | */ 60 | // read hash from URL 61 | var selected = location.hash.replace(/^#/, ""); 62 | if (!selected.length) 63 | return; 64 | selected = decodeURIComponent(selected.replace(/\./g, "%")); // reverse MediaWiki link munging 65 | 66 | // apply 67 | selected = selected.split(","); 68 | if (selected.length) { 69 | $("[data-filters]").removeClass("selected"); 70 | for (var i = 0, len = selected.length; i < len; i++) 71 | this.getToggle(selected[i]).addClass("selected"); 72 | this.apply(); 73 | } 74 | }; 75 | 76 | return this; 77 | }; 78 | 79 | $(function () { 80 | var filters = pathoschild.PageFilters(); 81 | $(".filter").click(function (event) { 82 | filters.toggle($(this).attr("data-filter-key")); 83 | event.preventDefault(); 84 | }); 85 | filters.readHash(); 86 | }); 87 | -------------------------------------------------------------------------------- /user-scripts/pathoschild.usejs.js: -------------------------------------------------------------------------------- 1 | var pathoschild = pathoschild || {}; 2 | 3 | /** 4 | * Usejs imports JavaScript for the current page when the URL contains a parameter like &usejs=MediaWiki:Common.js. It only accepts scripts in the protected MediaWiki: namespace (so these are all equivalent: &usejs=MediaWiki:Common.js, &usejs=Common.js, &usejs=common). 5 | * @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts 6 | * @update-token [[File:Pathoschild/usejs.js]] 7 | */ 8 | pathoschild.usejs = function() { 9 | /********* 10 | ** Public methods 11 | *********/ 12 | /** 13 | * Initialise the script and load the script if requested. 14 | */ 15 | this.initialise = function() { 16 | var self = this; 17 | 18 | // get script info 19 | var scriptName = self.getScriptName(); 20 | if (!scriptName) 21 | return; 22 | var scriptUrl = self.getScriptUrl(scriptName); 23 | var scriptLink = '' + scriptName + ""; 24 | // load script 25 | self.notify("↻ loading " + scriptName + "..."); 26 | $.getScript(scriptUrl) 27 | .done(function(data) { 28 | if (!data) 29 | self.notify("Couldn't load " + scriptLink + " because it doesn't exist.", "error"); 30 | else 31 | self.notify("Loaded " + scriptLink + "!"); 32 | }) 33 | .fail(function(xhr, settings, err) { 34 | self.notify("Couldn't load " + scriptLink + ": " + err, "error"); 35 | }); 36 | }; 37 | 38 | /********* 39 | ** Private methods 40 | *********/ 41 | /** 42 | * Get the normalised name of the script to load (like 'MediaWiki:Common.js'). 43 | */ 44 | this.getScriptName = function() { 45 | var script = mw.util.getParamValue("usejs"); 46 | return script && "MediaWiki:" + script.replace(/^MediaWiki:|\.js$/ig, "") + ".js"; 47 | }; 48 | 49 | /** 50 | * Get the executable relative script URL. 51 | * @param name The page name of the script to load (like 'MediaWiki:Common.js'). 52 | */ 53 | this.getScriptUrl = function(name) { 54 | return mw.config.get("wgScript") + "?title=" + name + "&action=raw&ctype=text/javascript"; 55 | }; 56 | 57 | /** 58 | * Show a notification message to the user. 59 | * @param content the text or jQuery element to show to the user. 60 | * @param cssClass a CSS class with which to wrap the content (default is 'warning'). 61 | */ 62 | this.notify = function(content, cssClass) { 63 | var message = '' + content + ""; 64 | var infoBlurb = 'You see this because usejs is enabled and the URL has &usejs.'; 65 | mw.notify($(message + "
" + infoBlurb), { tag: "usejs" }); 66 | }; 67 | 68 | this.initialise(); 69 | }; 70 | $.when($.ready, mw.loader.using("mediawiki.util")).done(function() { pathoschild.usejs(); }); 71 | -------------------------------------------------------------------------------- /tool-labs/accounteligibility/framework/models/LocalRuleEntry.php: -------------------------------------------------------------------------------- 1 | rule = $rule; 62 | $this->shouldSkipOnFail = (bool)($workflow & Workflow::SKIP_ON_FAIL); 63 | $this->shouldFailHard = (bool)($workflow & Workflow::HARD_FAIL); 64 | $this->onAnyWiki = (bool)($workflow & Workflow::ON_ANY_WIKI); 65 | } 66 | 67 | /** 68 | * Collect information from a wiki and return whether all rules has been met. 69 | * @param Toolserver $db The database wrapper. 70 | * @param Wiki $wiki The current wiki. 71 | * @param LocalUser $user The local user account. 72 | * @return ResultInfo|null The eligibility check result, or null if the rule doesn't apply to this wiki. 73 | */ 74 | public function accumulate(Toolserver $db, Wiki $wiki, LocalUser $user): ?ResultInfo 75 | { 76 | // already final 77 | if ($this->isFinal) 78 | return null; 79 | 80 | // accumulate rule 81 | $result = $this->rule->accumulate($db, $wiki, $user); 82 | if (!$result) 83 | return null; // not applicable 84 | $this->lastResult = $result; 85 | 86 | // mark final 87 | $this->isFinal = 88 | $this->lastResult->isFinal 89 | || ($this->shouldFailHard && $this->lastResult->isFail()) 90 | || ($this->onAnyWiki && $this->lastResult->isPass()); 91 | if ($this->isFinal) 92 | $this->result = $this->lastResult->result; 93 | 94 | return $this->lastResult; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /tool-labs/backend/modules/Form.php: -------------------------------------------------------------------------------- 1 | $attrs The tag attributes as a name => value lookup. 25 | * @param string|null $text The inner tag HTML. 26 | * @param int|null $options The tag options (one of {@see Form::SELF_CLOSING}). 27 | */ 28 | static function element(string $tag, array $attrs, ?string $text, ?int $options = null): string 29 | { 30 | $out = "<{$tag}"; 31 | 32 | foreach ($attrs as $field => $value) 33 | $out .= " {$field}='{$value}'"; 34 | 35 | if ($options & self::SELF_CLOSING) 36 | $out .= " />"; 37 | else 38 | $out .= ">{$text}"; 39 | 40 | return $out; 41 | } 42 | 43 | /** 44 | * Get an HTML string for a checkbox. 45 | * @param string $name The checkbox name value. 46 | * @param bool|null $checked Whether the checkbox should be checked. 47 | * @param array $attrs The tag attributes as a name => value lookup. 48 | * @param int|null $options The tag options (one of {@see Form::SELF_CLOSING}). 49 | */ 50 | static function checkbox(string $name, ?bool $checked, array $attrs = [], ?int $options = null): string 51 | { 52 | $attrs['type'] = 'checkbox'; 53 | $attrs['name'] = $name; 54 | $attrs['id'] = $name; 55 | if ($checked) 56 | $attrs['checked'] = 'checked'; 57 | 58 | return self::element('input', $attrs, null, $options | self::SELF_CLOSING); 59 | } 60 | 61 | /** 62 | * Get an HTML string for a drop-down menu. 63 | * @param string $name The dropdown name value. 64 | * @param bool|int|string|null $selectedKey The key of the option to select. 65 | * @param array $selectOptions The options with which to populate the dropdown as a key => value lookup. 66 | * @param array $attrs The tag attributes as a name => value lookup. 67 | * @param int|null $options The tag options (one of {@see Form::SELF_CLOSING}). 68 | */ 69 | static function select(string $name, bool|int|string|null $selectedKey, array $selectOptions, array $attrs = [], ?int $options = null): string 70 | { 71 | $attrs['name'] = $name; 72 | $attrs['id'] = $name; 73 | 74 | /* generate