From 224b22a051051f6c2e494c3a2fb4adb42898e2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 14 Jan 2014 19:24:18 +0100 Subject: Update to MediaWiki 1.22.1 --- extensions/WikiEditor/.jshintignore | 2 - extensions/WikiEditor/.jshintrc | 32 +--- extensions/WikiEditor/WikiEditor.i18n.php | 175 ++++++++---------- .../WikiEditor/modules/ext.wikiEditor.dialogs.js | 7 +- .../WikiEditor/modules/ext.wikiEditor.highlight.js | 3 +- extensions/WikiEditor/modules/ext.wikiEditor.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.preview.js | 3 +- .../modules/ext.wikiEditor.previewDialog.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.publish.js | 3 +- .../modules/ext.wikiEditor.templateEditor.js | 19 +- .../WikiEditor/modules/ext.wikiEditor.templates.js | 19 +- .../modules/ext.wikiEditor.tests.toolbar.js | 16 +- .../WikiEditor/modules/ext.wikiEditor.toc.js | 3 +- .../modules/ext.wikiEditor.toolbar.hideSig.js | 4 +- .../WikiEditor/modules/ext.wikiEditor.toolbar.js | 3 +- .../WikiEditor/modules/jquery.wikiEditor.css | 3 + .../modules/jquery.wikiEditor.dialogs.config.js | 59 +++--- .../modules/jquery.wikiEditor.dialogs.js | 34 ++-- .../modules/jquery.wikiEditor.highlight.js | 41 ++--- .../WikiEditor/modules/jquery.wikiEditor.iframe.js | 202 ++++++++++----------- extensions/WikiEditor/modules/jquery.wikiEditor.js | 44 +++-- .../modules/jquery.wikiEditor.preview.js | 15 +- .../modules/jquery.wikiEditor.previewDialog.js | 15 +- .../modules/jquery.wikiEditor.publish.js | 13 +- .../modules/jquery.wikiEditor.templateEditor.js | 137 ++++++-------- .../modules/jquery.wikiEditor.templates.js | 51 +++--- .../WikiEditor/modules/jquery.wikiEditor.toc.js | 136 ++++++-------- .../modules/jquery.wikiEditor.toolbar.config.js | 5 +- .../modules/jquery.wikiEditor.toolbar.js | 53 +++--- 29 files changed, 477 insertions(+), 626 deletions(-) (limited to 'extensions/WikiEditor') diff --git a/extensions/WikiEditor/.jshintignore b/extensions/WikiEditor/.jshintignore index b97a47d3..66a218b5 100644 --- a/extensions/WikiEditor/.jshintignore +++ b/extensions/WikiEditor/.jshintignore @@ -1,4 +1,2 @@ # upstream lib from Google modules/contentCollector.js -# messy -modules/jquery.wikiEditor.iframe.js diff --git a/extensions/WikiEditor/.jshintrc b/extensions/WikiEditor/.jshintrc index 5d335e32..64cd5087 100644 --- a/extensions/WikiEditor/.jshintrc +++ b/extensions/WikiEditor/.jshintrc @@ -1,33 +1,9 @@ { - /* Common */ - - // Enforcing - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": "single", - "trailing": true, - "undef": true, - "unused": true, - // Legacy - "onevar": true, - - /* Local */ - - // Relaxing - "loopfunc": true, - "multistr": true, - // Environment - "browser": true, - "predef": [ "mediaWiki", "jQuery" - ] + ], + "browser": true, + "smarttabs": true, + "multistr": true } diff --git a/extensions/WikiEditor/WikiEditor.i18n.php b/extensions/WikiEditor/WikiEditor.i18n.php index 97cef8ff..26f1e2ca 100644 --- a/extensions/WikiEditor/WikiEditor.i18n.php +++ b/extensions/WikiEditor/WikiEditor.i18n.php @@ -334,7 +334,6 @@ I guess that "feature-providing modules" means the same as "modules providing fe {{Identical|Publish}}", 'wikieditor-publish-dialog-goback' => 'Button that closes the dialog that opens when the user clicks the Publish button. {{Identical|Go back}}', - 'wikieditor-template-editor-dialog-title' => '{{Identical|Edit template}}', 'wikieditor-template-editor-dialog-submit' => '{{Identical|Update}}', 'wikieditor-template-editor-dialog-cancel' => '{{Identical|Cancel}}', 'wikieditor-toc-preference' => "Option at [[Special:Preferences]], tab ''{{int:prefs-editing}}''", @@ -1282,7 +1281,6 @@ $1:Eixemplo.jpg|Piet_de_foto_2', /** Old English (Ænglisc) * @author Gott wisst - * @author Shirayuki * @author Wōdenhelm */ $messages['ang'] = array( @@ -4034,7 +4032,6 @@ $1:Cuntuh.jpg|Judul2', ); /** Bengali (বাংলা) - * @author Aftab1995 * @author Bellayet * @author Leemon2010 * @author Nasir8891 @@ -4152,8 +4149,8 @@ $messages['bn'] = array( 'wikieditor-toolbar-tool-subscript-example' => 'সাবস্ক্রিপ্ট লেখা', 'wikieditor-toolbar-group-insert' => 'যোগ করো', 'wikieditor-toolbar-tool-gallery' => 'ছবির গ্যালারী', - 'wikieditor-toolbar-tool-gallery-example' => '$1:উদাহরণ.jpg|ক্যাপশন১ -$1:উদাহরণ.jpg|ক্যাপশন২', + 'wikieditor-toolbar-tool-gallery-example' => '$1:Example.jpg|ক্যাপশন১ +$1:Example.jpg|ক্যাপশন২', 'wikieditor-toolbar-tool-newline' => 'নতুন লাইন', 'wikieditor-toolbar-tool-table' => 'ছক', 'wikieditor-toolbar-tool-table-example-old' => '- @@ -5285,27 +5282,27 @@ $messages['ce'] = array( 'wikieditor-toolbar' => 'Рéдоккху меттиг', 'wikieditor-toolbar-desc' => 'Рéдоккху меттиг гlоле лелорца', 'wikieditor-toolbar-preference' => 'Латайé гlоле йолу тадар', - 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажораг йуьллург, таблицан а кхин хӀумнашна а', + 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажориг йуьллург, таблийцан аъ кхин хlумнашна', # Fuzzy 'wikieditor-toolbar-loading' => 'Чуйолуш…', 'wikieditor-toolbar-tool-bold' => 'Дерстино', 'wikieditor-toolbar-tool-bold-example' => 'Дерстино до йоза', 'wikieditor-toolbar-tool-italic' => 'Сетта', 'wikieditor-toolbar-tool-italic-example' => 'Сеттан до йоза', - 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-tool-ilink-example' => 'Хьажориган коьрта могlа', 'wikieditor-toolbar-tool-xlink' => 'Арахьара хьажораг (йиц ма йе хӀотталушерг http://)', - 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажораг корта', - 'wikieditor-toolbar-tool-link' => 'Хьажораг', - 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажораг', + 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажориг корта', + 'wikieditor-toolbar-tool-link' => 'Хьажориг', + 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажориг', 'wikieditor-toolbar-tool-link-int' => 'Оцу вики агlон', 'wikieditor-toolbar-tool-link-int-target' => 'Хьажийна агlо йа URL:', 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Агlон цlе йа URL', 'wikieditor-toolbar-tool-link-int-text' => 'Гойтуш долу йоза:', 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Чудилла схьагайта дезаш долу йоза', 'wikieditor-toolbar-tool-link-ext' => 'Хьалхара агlон чохь', - 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажорагаш:', + 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажоригаш:', 'wikieditor-toolbar-tool-link-ext-text' => 'Хьажориган йоза:', - 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажораг', + 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажориг', 'wikieditor-toolbar-tool-link-cancel' => 'Цаоьшу', 'wikieditor-toolbar-tool-link-int-target-status-exists' => 'Ишта агlо йолш ю', 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'Ишта агlо яц', @@ -5313,10 +5310,10 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Арахьара хьажораг', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Агlо ю яц хьоьжуш…', 'wikieditor-toolbar-tool-link-int-invalid' => 'Гойтуш йолу цlе ца магайо.', - 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агӀонан хьажорагах тера ю. Лаьий хьуна и хьажораг чоьхьарчех я?', - 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агlонан хьажоригах тера ю. Лаьий хьуна и хьажориг чоьхьарчех я?', + 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Арахьара хьажораг', - 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажораг.', + 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажориг.', 'wikieditor-toolbar-tool-file' => 'Чохь йолу файл', 'wikieditor-toolbar-tool-file-example' => 'Example.jpg', 'wikieditor-toolbar-tool-file-title' => 'Файл чуйиллар', @@ -5334,7 +5331,7 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-reference-insert' => 'Чудилла', 'wikieditor-toolbar-tool-reference-text' => 'ТIетовжаран йоза', 'wikieditor-toolbar-tool-signature' => 'Куьгтаlор хан хlоттош', - 'wikieditor-toolbar-section-advanced' => 'Кхин тӀе', + 'wikieditor-toolbar-section-advanced' => 'Кхин тlе дукха', 'wikieditor-toolbar-tool-heading' => 'Корта', 'wikieditor-toolbar-tool-heading-1' => 'Локхалла 1', 'wikieditor-toolbar-tool-heading-2' => 'Локхалла 2', @@ -5408,11 +5405,11 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-tool-replace-success' => 'Балийна хийцам: $1.', # Fuzzy 'wikieditor-toolbar-tool-replace-emptysearch' => 'Ахьа ца гайтна хlу лаха деза.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Ахьа язйина цlе юх-юха нийса яц: $1', - 'wikieditor-toolbar-section-characters' => 'Леррина символаш', + 'wikieditor-toolbar-section-characters' => 'Саболу куьцаш', 'wikieditor-toolbar-characters-page-latin' => 'Латинан', 'wikieditor-toolbar-characters-page-latinextended' => 'Латинан алсам', 'wikieditor-toolbar-characters-page-ipa' => 'ДАЭ (IPA)', - 'wikieditor-toolbar-characters-page-symbols' => 'Символаш', + 'wikieditor-toolbar-characters-page-symbols' => 'Саболурш', 'wikieditor-toolbar-characters-page-greek' => 'Гlайрхойн', 'wikieditor-toolbar-characters-page-cyrillic' => 'Кирилан', 'wikieditor-toolbar-characters-page-arabic' => 'Ӏарбийн', @@ -5432,7 +5429,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-heading-syntax' => 'Хlу йуьллу ахьа', 'wikieditor-toolbar-help-heading-result' => 'Хlу хуьлу хьуна', 'wikieditor-toolbar-help-page-format' => 'Бáрамхlоттор', - 'wikieditor-toolbar-help-page-link' => 'Хьажорагаш', + 'wikieditor-toolbar-help-page-link' => 'Хьажоригаш', 'wikieditor-toolbar-help-page-heading' => 'Коьрта могlнаш', 'wikieditor-toolbar-help-page-list' => 'Могlамаш', 'wikieditor-toolbar-help-page-file' => 'Файлаш', @@ -5447,7 +5444,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-bolditalic-description' => 'Дерстино курсеттан', 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Дерстино курсеттан'''''", 'wikieditor-toolbar-help-content-bolditalic-result' => 'Дерстино курсеттан', - 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-help-content-ilink-syntax' => '[[Агlонан коьрта могlа|Хьажориган йоза]]
[[Агlонан коьрта могlа]]', 'wikieditor-toolbar-help-content-ilink-result' => "Хьажориган йоза
Агlонан коьрта могlа", 'wikieditor-toolbar-help-content-xlink-description' => 'Арахьара хьажораг', @@ -5479,7 +5476,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-reference-description' => 'Билгалдаккхар', 'wikieditor-toolbar-help-content-reference-syntax' => 'Агlонан йоза.<ref name="test">[http://www.example.org Хьажориган йоза], кхин тlе дузуш йоза.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Агlонан йоза.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тӀе лело изза хьажораг', + 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тlе лело изза хьажориг', 'wikieditor-toolbar-help-content-rereference-result' => "Агlонан йоза[1].", 'wikieditor-toolbar-help-content-showreferences-description' => 'Гайта билгалдаккхар', 'wikieditor-toolbar-help-content-showreferences-result' => "
  1. ^ Хьажориган йоза, кхин тlе дузуш йоза.
", @@ -6134,7 +6131,7 @@ $messages['cy'] = array( 'wikieditor-toolbar' => 'Bar offer golygu', 'wikieditor-toolbar-desc' => 'Bar offer y dudalen olygu gyda gwelliannau defnyddioldeb', 'wikieditor-toolbar-preference' => "Defnyddio'r bar offer golygu estynedig", - 'wikieditor-toolbar-dialogs-preference' => "Galluogi'r dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", + 'wikieditor-toolbar-dialogs-preference' => "Galluoger y dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", 'wikieditor-toolbar-hidesig' => "Cuddio'r botwm llofnodi rhag y tudalennau yn y prif barth", 'wikieditor-toolbar-loading' => "Wrthi'n llwytho...", 'wikieditor-toolbar-tool-bold' => 'Praff', @@ -6895,7 +6892,6 @@ Möchten Sie daraus einen internen Link machen?', /** Zazaki (Zazaki) * @author Erdemaslancan * @author Gorizon - * @author Marmase * @author Mirzali * @author Xoser */ @@ -6978,10 +6974,10 @@ $messages['diq'] = array( 'wikieditor-toolbar-file-format-none' => 'çıniyo', 'wikieditor-toolbar-tool-file-insert' => 'Têare ker', 'wikieditor-toolbar-tool-file-cancel' => 'Bıterkne', - 'wikieditor-toolbar-tool-reference' => 'Referans', + 'wikieditor-toolbar-tool-reference' => 'çıme', 'wikieditor-toolbar-tool-reference-example' => 'metnê notê bınini tiya kerê', 'wikieditor-toolbar-tool-reference-cancel' => 'Bıtexelne', - 'wikieditor-toolbar-tool-reference-title' => 'Referans dek', + 'wikieditor-toolbar-tool-reference-title' => 'Referance de bike', 'wikieditor-toolbar-tool-reference-insert' => 'de bike', 'wikieditor-toolbar-tool-reference-text' => 'Nusteyê Referansi', 'wikieditor-toolbar-tool-signature' => 'tamğayê imza ve zamani', @@ -6996,7 +6992,7 @@ $messages['diq'] = array( 'wikieditor-toolbar-group-format' => 'Format', 'wikieditor-toolbar-tool-ulist' => 'listeya maddeya işaretıni', 'wikieditor-toolbar-tool-ulist-example' => 'unsuro listeya maddeya işaretıni', - 'wikieditor-toolbar-tool-olist' => 'Listeya nımreyın', + 'wikieditor-toolbar-tool-olist' => 'listeya numreyıni', 'wikieditor-toolbar-tool-olist-example' => 'unsuro listeya numreyıni', 'wikieditor-toolbar-tool-indent' => 'Paragraf', 'wikieditor-toolbar-tool-indent-example' => 'Rêza paragrafi', @@ -7082,7 +7078,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-characters-endash' => 'tira kılme', 'wikieditor-toolbar-characters-emdash' => 'tira derge', 'wikieditor-toolbar-characters-minus' => 'işaretê kemiye', - 'wikieditor-toolbar-section-help' => 'Desteg', + 'wikieditor-toolbar-section-help' => 'Peşti', 'wikieditor-toolbar-help-heading-description' => 'Şınasnayış', 'wikieditor-toolbar-help-heading-syntax' => 'o yo ke şıma nuşt', 'wikieditor-toolbar-help-heading-result' => 'o yo ke şıma gırewt', @@ -7092,7 +7088,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-page-list' => 'Listey', 'wikieditor-toolbar-help-page-file' => 'dosyayi', 'wikieditor-toolbar-help-page-reference' => 'Çımey', - 'wikieditor-toolbar-help-page-discussion' => 'Vaten', + 'wikieditor-toolbar-help-page-discussion' => 'werê-ameyiş/munaqeşa', 'wikieditor-toolbar-help-content-italic-description' => 'italik', 'wikieditor-toolbar-help-content-italic-syntax' => "''metno italik''", 'wikieditor-toolbar-help-content-italic-result' => 'metno italik', @@ -7123,13 +7119,13 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-content-ulist-description' => 'listeya işareti ya maddeyın', 'wikieditor-toolbar-help-content-ulist-syntax' => '* unsurê listeyi
* unsurê listeyi', 'wikieditor-toolbar-help-content-ulist-result' => '', - 'wikieditor-toolbar-help-content-olist-description' => 'Listeya nımreyın', + 'wikieditor-toolbar-help-content-olist-description' => 'listeya numreyın', 'wikieditor-toolbar-help-content-olist-syntax' => '# unsurê listeyi
# unsurê listeyi', 'wikieditor-toolbar-help-content-olist-result' => '
  1. unsurê listeyi
  2. unsurê listeyi
', 'wikieditor-toolbar-help-content-file-description' => 'dosyaya weradaye/nımıte', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Nuşteyê resîmî]]', 'wikieditor-toolbar-help-content-file-result' => "
metnê resmi
", - 'wikieditor-toolbar-help-content-reference-description' => 'Referans', + 'wikieditor-toolbar-help-content-reference-description' => 'çıme/referans', 'wikieditor-toolbar-help-content-reference-syntax' => 'metnê peli.<ref name="tesel kerdış/cerebnayiş">[http://www.misal.org metnê gıreyi], zeylê metni.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "metnê peli.[1]", 'wikieditor-toolbar-help-content-rereference-description' => 'şuxulnayişê zeylê o çımeyi', @@ -8669,7 +8665,7 @@ $messages['fa'] = array( 'wikieditor' => 'رابط ویرایش پیشرفته ویکی‌متن', 'wikieditor-desc' => 'یک رابط ویرایش پیشرفته ویکی‌متن و چندین پودمان دارای قابلیت فراهم می‌کند', 'wikieditor-wikitext-tab' => 'ویکی‌متن', - 'wikieditor-loading' => 'در حال بارگیری...', + 'wikieditor-loading' => 'در حال بارگیری', 'wikieditor-preview-preference' => 'فعال‌سازی پیش‌نمایش کنار یک دیگر', 'wikieditor-preview-tab' => 'پیش‌نمایش', 'wikieditor-preview-changes-tab' => 'تغییرها', @@ -8918,7 +8914,6 @@ $1:مثال.jpg|عنوان ۲', * @author Nedergard * @author Nike * @author Olli - * @author Pxos * @author Silvonen * @author Str4nd * @author Stryn @@ -8985,7 +8980,6 @@ $messages['fi'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Virheellinen otsikko', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Ulkoinen linkki', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Tarkastetaan sivun olemassaolo…', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Täsmennyssivu', 'wikieditor-toolbar-tool-link-int-invalid' => 'Antamasi otsikko on virheellinen.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL-osoite, jonka annoit näyttää siltä kuin se olisi linkki toiselle wikisivulle. Haluatko tehdä siitä sisäisen linkin?', @@ -9737,7 +9731,6 @@ $messages['ga'] = array( /** Scottish Gaelic (Gàidhlig) * @author Akerbeltz - * @author Shirayuki */ $messages['gd'] = array( 'wikieditor' => 'Eadar-aghaidh deasachadh wikitext adhartach', @@ -9771,7 +9764,7 @@ $messages['gd'] = array( 'wikieditor-toolbar' => 'Am bàr-inneil deasachaidh', 'wikieditor-toolbar-desc' => 'Am bàr-inneil deasachaidh le comasan a bharrachd', 'wikieditor-toolbar-preference' => 'Cuir am bàr-inneil le comasan a bharrachd an comas', - 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na draoidhean airson ceanglaichean, clàran agus am foincsean airson lorg a dhèanamh no rudan a chur an àite rudan eile', + 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na còmhraidhean airson ceanglaichean, clàir is rudan eile a chur a-steach', # Fuzzy 'wikieditor-toolbar-loading' => "'Ga luchdadh...", 'wikieditor-toolbar-tool-bold' => 'Trom', 'wikieditor-toolbar-tool-bold-example' => 'Teacs trom', @@ -11524,7 +11517,6 @@ $messages['hif-latn'] = array( /** Croatian (hrvatski) * @author Bugoslav - * @author Eleassar * @author Ex13 * @author Excaliboor * @author MaGa @@ -11546,7 +11538,7 @@ $messages['hr'] = array( 'wikieditor-publish-preference' => 'Omogućiti korak-po-korak izdavanje', 'wikieditor-publish-button-publish' => 'Objaviti', 'wikieditor-publish-button-cancel' => 'Odustani', - 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Uredi sažetak (kratko opišite promjene koje ste učinili):', 'wikieditor-publish-dialog-minor' => 'Manja promjena', 'wikieditor-publish-dialog-watch' => 'Prati ovu stranicu', @@ -15321,7 +15313,7 @@ $1:Example.jpg|설명2', 'wikieditor-toolbar-tool-table-zero' => '행이나 열의 개수가 0인 표를 넣을 수 없습니다.', 'wikieditor-toolbar-tool-replace' => '찾아 바꾸기', 'wikieditor-toolbar-tool-replace-title' => '찾아 바꾸기', - 'wikieditor-toolbar-tool-replace-search' => '찾을 대상:', + 'wikieditor-toolbar-tool-replace-search' => '찾기:', 'wikieditor-toolbar-tool-replace-replace' => '바꾸기:', 'wikieditor-toolbar-tool-replace-case' => '대소문자를 구별', 'wikieditor-toolbar-tool-replace-regex' => '찾을 문자열에 정규 표현식을 적용', @@ -16476,8 +16468,6 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-characters-page-telugu' => 'Telugu', 'wikieditor-toolbar-section-help' => 'Adiutatum', 'wikieditor-toolbar-help-heading-description' => 'Descriptio', - 'wikieditor-toolbar-help-heading-syntax' => 'Quod scribis', - 'wikieditor-toolbar-help-heading-result' => 'Quod accipies', 'wikieditor-toolbar-help-page-format' => 'Formatio', 'wikieditor-toolbar-help-page-link' => 'Nexus', 'wikieditor-toolbar-help-page-heading' => 'Tituli', @@ -16500,31 +16490,11 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-help-content-xlink-description' => 'Nexus externus', 'wikieditor-toolbar-help-content-xlink-syntax' => '[http://www.example.org Titulus nexus]
[http://www.example.org]
http://www.example.org', 'wikieditor-toolbar-help-content-xlink-result' => "Titulus nexus
[1]
http://www.example.org", - 'wikieditor-toolbar-help-content-heading2-description' => 'Secundi ordinis titulus', - 'wikieditor-toolbar-help-content-heading2-syntax' => '== Textus tituli ==', - 'wikieditor-toolbar-help-content-heading2-result' => '

Textus tituli

', - 'wikieditor-toolbar-help-content-heading3-description' => 'Tertii ordinis titulus', - 'wikieditor-toolbar-help-content-heading3-syntax' => '=== Textus tituli ===', - 'wikieditor-toolbar-help-content-heading3-result' => '

Textus tituli

', - 'wikieditor-toolbar-help-content-heading4-description' => 'Quarti ordinis titulus', - 'wikieditor-toolbar-help-content-heading4-syntax' => '==== Textus tituli ====', - 'wikieditor-toolbar-help-content-heading4-result' => '

Textus tituli

', - 'wikieditor-toolbar-help-content-heading5-description' => 'Quinti ordinis titulus', - 'wikieditor-toolbar-help-content-heading5-syntax' => '===== Textus tituli =====', - 'wikieditor-toolbar-help-content-heading5-result' => '
Textus tituli
', - 'wikieditor-toolbar-help-content-ulist-description' => 'Index globosus', - 'wikieditor-toolbar-help-content-ulist-syntax' => '* Res indicata
* Res indicata', - 'wikieditor-toolbar-help-content-ulist-result' => '', 'wikieditor-toolbar-help-content-file-description' => 'Fasciculus in pagina impositus', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Exemplum.png|thumb|Descriptio fasciculi]]', # Fuzzy 'wikieditor-toolbar-help-content-file-result' => "
Descriptio fasciculi
", 'wikieditor-toolbar-help-content-reference-description' => 'Referentia bibliographica', - 'wikieditor-toolbar-help-content-reference-syntax' => 'Textus paginae.<ref name="test">[http://www.example.org Textus nexus], textus additus.</ref>', - 'wikieditor-toolbar-help-content-reference-result' => "Textus paginae.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Eiusdem referentiae usus additus', - 'wikieditor-toolbar-help-content-rereference-result' => "Textus paginae.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'Referentias bibliographicas monstrare', - 'wikieditor-toolbar-help-content-showreferences-result' => "
  1. ^ Textus nexus, textus additus.
", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Subscriptio tua cum indicatione temporis', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Nomen usoris (disputatio) 15:54, 10 Iunii 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'Subscriptio', @@ -16567,7 +16537,7 @@ $messages['lb'] = array( 'wikieditor-toolbar' => 'Toolbar änneren', 'wikieditor-toolbar-desc' => 'Toolbar vun de Säitenännerunge mat erweiderter Benotzerfrëndlechkeet', 'wikieditor-toolbar-preference' => 'Déi erweidert Ännerungs-Toolbar aktivéieren', - 'wikieditor-toolbar-dialogs-preference' => "Assistente fir d'Drasetze vu Linken, Tabellen genee sou wéi d'Funktioun 'sichen an ersetzen' aschalten", + 'wikieditor-toolbar-dialogs-preference' => "Assistene fir d'Drasetze vu Linken, Tabellen genee esou wéi d'Funktioun 'sichen an ersetzen' aschalten", 'wikieditor-toolbar-hidesig' => 'Den Ënnerschrëftsknäppchen op Säiten am Haaptnummraum verstoppen', 'wikieditor-toolbar-loading' => 'Lueden...', 'wikieditor-toolbar-tool-bold' => 'Fettgedréckt', @@ -18633,22 +18603,22 @@ $messages['mr'] = array( 'wikieditor' => 'विकिमजकूर संपादनाची विकसित सुविधा', 'wikieditor-desc' => 'विस्तारणीय विकिमजकुर संपादन आंतरपृष्ठ (इंटरफेस) आणि बर्‍याच वैशिष्ट्यपूर्ण निश्चयिका (मॊड्यूल्स) पुरवते', 'wikieditor-wikitext-tab' => 'विकिमजकूर', - 'wikieditor-loading' => 'प्रभारण करीत आहे', + 'wikieditor-loading' => 'चढवत आहे…', 'wikieditor-preview-preference' => 'सोबतच आजु-बाजूस दिसणारी झलक शक्य करा.', 'wikieditor-preview-tab' => 'झलक', 'wikieditor-preview-changes-tab' => 'बदल', - 'wikieditor-preview-loading' => 'प्रभारण करीत आहे', + 'wikieditor-preview-loading' => 'चढवत आहे…', 'wikieditor-previewDialog-preference' => '"झलक पहा" चौकट सक्षम करा', 'wikieditor-previewDialog-tab' => 'झलक पहा', - 'wikieditor-previewDialog-loading' => 'प्रभारण करीत आहे', + 'wikieditor-previewDialog-loading' => 'चढवत आहे…', 'wikieditor-publish-preference' => 'टप्प्या-टप्प्याने प्रकाशन शक्य करा', 'wikieditor-publish-button-publish' => 'प्रकाशित करा दाखवा', 'wikieditor-publish-button-cancel' => 'रद्द करा', 'wikieditor-publish-dialog-title' => '{{संकेतस्थळनाव}} येथे प्रदर्शित करा', - 'wikieditor-publish-dialog-summary' => 'बदलांचा सारांश :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा):', + 'wikieditor-publish-dialog-summary' => 'बदलांचा आढावा :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा.)', 'wikieditor-publish-dialog-minor' => 'छोटा बदल', - 'wikieditor-publish-dialog-watch' => 'पान निरीक्षणांतर्गत ठेवा', + 'wikieditor-publish-dialog-watch' => 'या पानावर बदलांसाठी लक्ष ठेवा', 'wikieditor-publish-dialog-publish' => 'प्रकाशित करा', 'wikieditor-publish-dialog-goback' => 'मागे जा', 'wikieditor-template-editor-preference' => 'विकि साच्यांची नमुना संपादन सक्षम करा', @@ -18665,11 +18635,11 @@ $messages['mr'] = array( 'wikieditor-toolbar-preference' => 'वर्धित संपादन साधनपट्टी सक्षम करा', 'wikieditor-toolbar-dialogs-preference' => 'दुवे, सारण्या (टेबल) आणि इतर भरण्याकरिता dialogs सक्षम करा', # Fuzzy 'wikieditor-toolbar-hidesig' => 'मुख्य नामविश्वातील पानांपासून स्वाक्षरीची कळ लपवा', - 'wikieditor-toolbar-loading' => 'प्रभारण करीत आहे', + 'wikieditor-toolbar-loading' => 'चढवत आहे…', 'wikieditor-toolbar-tool-bold' => 'ठळक', 'wikieditor-toolbar-tool-bold-example' => 'ठळक मजकूर', 'wikieditor-toolbar-tool-italic' => 'तिरपी मुद्राक्षरे', - 'wikieditor-toolbar-tool-italic-example' => 'तिरप्या मुद्राक्षरातील मजकूर', + 'wikieditor-toolbar-tool-italic-example' => 'तिरपी मुद्राक्षरे', 'wikieditor-toolbar-tool-ilink' => 'अंतर्गत दुवा', 'wikieditor-toolbar-tool-ilink-example' => 'शीर्षकास दुवा द्या', 'wikieditor-toolbar-tool-xlink' => 'बाह्य दुव्यात (http:// हा उपसर्ग विसरू नका)', @@ -18690,7 +18660,7 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'पान अस्तित्वात नाही', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'अग्राह्य शीर्षक', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'बाह्य दुवा', - 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पान अस्तित्व आहे काय ते तपासत आहे...', + 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पानाचे अस्तित्व तपासत आहे...', 'wikieditor-toolbar-tool-link-int-invalid' => 'तुम्ही नमूद केलेले शीर्षक अग्राह्य आहे.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'तुम्ही नमूद केलेली यूआरएल इतर विकिपानास जोडावयाची आहे असे दिसते. तुम्हाला अंतर्गत दुवा बनवायचा आहे काय ?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'अंतर्गत दुवा', @@ -18700,13 +18670,13 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-file-example' => 'उदाहरण.jpg', 'wikieditor-toolbar-tool-file-title' => 'चित्र टाका', 'wikieditor-toolbar-file-target' => 'संचिकेचे नाव:', - 'wikieditor-toolbar-file-caption' => 'मथळा:', + 'wikieditor-toolbar-file-caption' => 'वर्णन:', 'wikieditor-toolbar-file-size' => 'आकार:', 'wikieditor-toolbar-file-float' => 'समास:', - 'wikieditor-toolbar-file-format' => 'प्रारुप:', + 'wikieditor-toolbar-file-format' => 'प्रकार', 'wikieditor-toolbar-file-format-none' => 'काहीही नाही', 'wikieditor-toolbar-tool-file-insert' => 'समाविष्ट करा', - 'wikieditor-toolbar-tool-file-cancel' => 'रद्द करा', + 'wikieditor-toolbar-tool-file-cancel' => 'रद्द', 'wikieditor-toolbar-tool-reference' => 'संदर्भ', 'wikieditor-toolbar-tool-reference-example' => 'तळटीप मजकूर येथे भरा', 'wikieditor-toolbar-tool-reference-cancel' => 'रद्द करा', @@ -18722,10 +18692,10 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-heading-4' => 'स्तर ४', 'wikieditor-toolbar-tool-heading-5' => 'स्तर ५', 'wikieditor-toolbar-tool-heading-example' => 'अग्रशीर्ष मजकूर', - 'wikieditor-toolbar-group-format' => 'प्रारुप', + 'wikieditor-toolbar-group-format' => 'आराखडा', 'wikieditor-toolbar-tool-ulist' => 'बिंदी क्रमांकन', 'wikieditor-toolbar-tool-ulist-example' => 'बिंदी क्रमांकन घटक', - 'wikieditor-toolbar-tool-olist' => 'अनुक्रमित यादी', + 'wikieditor-toolbar-tool-olist' => 'अनुक्रम यादी', 'wikieditor-toolbar-tool-olist-example' => 'अनुक्रम यादी घटक', 'wikieditor-toolbar-tool-indent' => 'समासांतर', 'wikieditor-toolbar-tool-indent-example' => 'समासांतर ओळ', @@ -18763,7 +18733,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-tool-table-title' => 'सारणी समाविष्ट करा', 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ओळी', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'रकाना', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'शीर्ष ओळ जोडा', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'मथळा ओळ जोडा', 'wikieditor-toolbar-tool-table-wikitable' => 'काठासहीत शैली', 'wikieditor-toolbar-tool-table-sortable' => 'सारणी क्रमानुसारी करण्याजोगी करा', 'wikieditor-toolbar-tool-table-example' => 'उदाहरण', @@ -18806,7 +18776,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-characters-page-devanagari' => 'देवनागरी', 'wikieditor-toolbar-characters-page-thai' => 'थाई भाषा', 'wikieditor-toolbar-characters-page-lao' => 'लाऒ भाषा', - 'wikieditor-toolbar-characters-page-khmer' => 'ख्मेर', + 'wikieditor-toolbar-characters-page-khmer' => 'खमेर', 'wikieditor-toolbar-characters-minus' => 'ॠण चिन्ह', 'wikieditor-toolbar-section-help' => 'साहाय्य', 'wikieditor-toolbar-help-heading-description' => 'वर्णन', @@ -18849,7 +18819,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-ulist-description' => 'बिंदीक्रमांकीत यादी', 'wikieditor-toolbar-help-content-ulist-syntax' => '* यादी कलम
* यादी कलम', 'wikieditor-toolbar-help-content-ulist-result' => '', - 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रमित यादी', + 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रम यादी', 'wikieditor-toolbar-help-content-olist-syntax' => '# यादी घटक
# यादी घटक', 'wikieditor-toolbar-help-content-olist-result' => '
  1. यादी घटक
  2. यादी घटक
', 'wikieditor-toolbar-help-content-file-description' => 'संलग्न संचिका', @@ -18863,7 +18833,8 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-rereference-result' => "पान मजकूर.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'संदर्भ दर्शवा', 'wikieditor-toolbar-help-content-showreferences-result' => "
  1. ^ Link text, additional text.
", - 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'सही आणि वेळठसा', + 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'वेळेसह तुमची सही +तुमची सही व वेळ', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "सदस्यनाव (चर्चा) 15:54, 10 June 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'सही', 'wikieditor-toolbar-help-content-signature-result' => "सदस्यनाव (चर्चा)", @@ -20641,7 +20612,6 @@ $messages['nso'] = array( ); /** Occitan (occitan) - * @author Beta16 * @author Boulaur * @author Cedric31 * @author Jfblanc @@ -20676,7 +20646,7 @@ $messages['oc'] = array( 'wikieditor-toc-preference' => "Activar l'ensenhador navigable", 'wikieditor-toc-show' => 'Afichar lo contengut', 'wikieditor-toc-hide' => 'Amagar lo contengut', - 'wikieditor-toolbar' => 'Barra d’aisinas de modificacion', + 'wikieditor-toolbar' => 'Modificacion de la barra d’espleches', 'wikieditor-toolbar-desc' => "Modificacion de la barra d'aisinas amb l'utilizabilitat melhorada", 'wikieditor-toolbar-preference' => "Activar la barra d'aisinas melhorada", 'wikieditor-toolbar-dialogs-preference' => 'Activar las bóstias de dialòg per apondre de ligams, de tablèus e mai encara', # Fuzzy @@ -20716,7 +20686,7 @@ $messages['oc'] = array( 'wikieditor-toolbar-tool-file-example' => 'Exemple.jpg', 'wikieditor-toolbar-tool-file-title' => 'Importar un fichièr', 'wikieditor-toolbar-file-target' => 'Nom de fichièr :', - 'wikieditor-toolbar-file-caption' => 'Legenda:', + 'wikieditor-toolbar-file-caption' => 'Legenda :', 'wikieditor-toolbar-file-size' => 'Talha :', 'wikieditor-toolbar-file-float' => 'Alinhament :', 'wikieditor-toolbar-file-default' => '(per defaut)', @@ -21987,7 +21957,7 @@ $messages['pms'] = array( 'wikieditor-toolbar' => "Bara d'utiss ëd modìfica", 'wikieditor-toolbar-desc' => "Bara d'utiss ëd modìfica con dovrabilità ameliorà", 'wikieditor-toolbar-preference' => "Ativé la bara d'utiss ameliorà", - 'wikieditor-toolbar-dialogs-preference' => "Ativé j'assistent për gionté dle anliure, dle tàule e ëdcò la fonsion d'arserca e rampiass", + 'wikieditor-toolbar-dialogs-preference' => "Ativé ij quàder ëd diàlogh për anserì anliure, tàule e d'àutr", # Fuzzy 'wikieditor-toolbar-hidesig' => 'Stërmé ël boton ëd firma ant le pàgine ëd lë spassi nominal prinsipal', 'wikieditor-toolbar-loading' => 'Cariament...', 'wikieditor-toolbar-tool-bold' => 'Grassèt', @@ -22015,7 +21985,6 @@ $messages['pms'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Tìtol nen vàlid', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Anliura esterna', 'wikieditor-toolbar-tool-link-int-target-status-loading' => "Verìfica ëd l'esistensa dla pàgina...", - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => "Pàgina d'omonimìa", 'wikieditor-toolbar-tool-link-int-invalid' => "Ël tìtol ch'a l'ha spessificà a va pa bin.", 'wikieditor-toolbar-tool-link-lookslikeinternal' => "L'URL ch'a l'ha spessificà a smijërìa n'anliura a n'àutra pàgina wiki. Veul-lo fene n'anliura anterna?", 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Anliura anterna', @@ -22557,8 +22526,8 @@ $messages['ps'] = array( 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ليکې', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'ستنې', 'wikieditor-toolbar-tool-table-wikitable' => 'ډول او پولې', - 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال اوډون وړ گرځول', - 'wikieditor-toolbar-tool-table-example' => 'بېلگه', + 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال د اوډون وړ گرځول', + 'wikieditor-toolbar-tool-table-example' => 'بېلګه', 'wikieditor-toolbar-tool-table-preview' => 'مخليدنه', 'wikieditor-toolbar-tool-table-insert' => 'ورټومبل', 'wikieditor-toolbar-tool-table-cancel' => 'ناگارل', @@ -23982,7 +23951,6 @@ $messages['ru'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Недопустимое название', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Внешняя ссылка', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Проверка существования страницы…', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Страницы разрешения неоднозначностей', 'wikieditor-toolbar-tool-link-int-invalid' => 'Указанное название недопустимо.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Указанный вами URL похож на ссылку на другую вики-страницу. Вы хотите сделать данную ссылку внутренней?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Внутренняя ссылка', @@ -24102,7 +24070,6 @@ $1:Example.jpg|Описание2', 'wikieditor-toolbar-characters-page-thai' => 'Тайские', 'wikieditor-toolbar-characters-page-lao' => 'Лаосские', 'wikieditor-toolbar-characters-page-khmer' => 'Кхмерские', - 'wikieditor-toolbar-characters-endash' => 'среднее тире', 'wikieditor-toolbar-characters-emdash' => 'длинное тире', 'wikieditor-toolbar-characters-minus' => 'знак минус', 'wikieditor-toolbar-section-help' => 'Справка', @@ -25850,7 +25817,7 @@ $messages['sl'] = array( 'wikieditor-publish-preference' => 'Omogoči objavljanje korak-po-koraku', 'wikieditor-publish-button-publish' => 'Objavi', 'wikieditor-publish-button-cancel' => 'Prekliči', - 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Povzetek urejanja (na kratko opišite narejene spremembe):', 'wikieditor-publish-dialog-minor' => 'Manjše urejanje', 'wikieditor-publish-dialog-watch' => 'Opazuj stran', @@ -27045,7 +27012,7 @@ $messages['sv'] = array( 'wikieditor-previewDialog-preference' => 'Aktivera förhandsgranska', 'wikieditor-previewDialog-tab' => 'Förhandsgranska', 'wikieditor-previewDialog-loading' => 'Laddar...', - 'wikieditor-publish-preference' => 'Aktivera steg-för-steg-publicering', + 'wikieditor-publish-preference' => 'Aktivera steg-efter-steg-publicering', 'wikieditor-publish-button-publish' => 'Publicera', 'wikieditor-publish-button-cancel' => 'Avbryt', 'wikieditor-publish-dialog-title' => 'Publicera i {{SITENAME}}', @@ -27346,15 +27313,15 @@ $messages['sw'] = array( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Kiungo cha ndani', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Kiungo cha nje', 'wikieditor-toolbar-tool-link-empty' => 'Hukuandika kitu cha kuunganisha naye.', - 'wikieditor-toolbar-tool-file' => 'Ingiza faili', + 'wikieditor-toolbar-tool-file' => 'Faili futike', 'wikieditor-toolbar-tool-file-example' => 'Mfano.jpg', 'wikieditor-toolbar-tool-file-title' => 'Ingiza faili', 'wikieditor-toolbar-file-target' => 'Jina la faili:', 'wikieditor-toolbar-file-size' => 'Ukubwa:', 'wikieditor-toolbar-tool-file-insert' => 'Ingiza', 'wikieditor-toolbar-tool-file-cancel' => 'Ghairi', - 'wikieditor-toolbar-tool-reference' => 'Marejeo', - 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya marejeo hapa', + 'wikieditor-toolbar-tool-reference' => 'Tiniwayo', + 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya tiniwayo hapa', 'wikieditor-toolbar-tool-reference-cancel' => 'Batilisha', 'wikieditor-toolbar-tool-reference-title' => 'Ingiza marejeo', 'wikieditor-toolbar-tool-reference-insert' => 'Ingiza', @@ -27462,7 +27429,7 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-page-heading' => 'Vichwa', 'wikieditor-toolbar-help-page-list' => 'Orodha', 'wikieditor-toolbar-help-page-file' => 'Mafaili', - 'wikieditor-toolbar-help-page-reference' => 'Marejeo', + 'wikieditor-toolbar-help-page-reference' => 'Tiniwayo', 'wikieditor-toolbar-help-page-discussion' => 'Majadiliano', 'wikieditor-toolbar-help-content-italic-description' => 'Italiki', 'wikieditor-toolbar-help-content-italic-syntax' => "''Maandishi ya italiki''", @@ -27497,15 +27464,15 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-content-olist-description' => 'Orodha zenye namba', 'wikieditor-toolbar-help-content-olist-syntax' => '# Aya
# Aya', 'wikieditor-toolbar-help-content-olist-result' => '
  1. Aya
  2. Aya
', - 'wikieditor-toolbar-help-content-file-description' => 'Ingiza faili', + 'wikieditor-toolbar-help-content-file-description' => 'Faili futike', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Maelezo mafupi]]', 'wikieditor-toolbar-help-content-file-result' => "
Maelezo mafupi
", - 'wikieditor-toolbar-help-content-reference-description' => 'Marejeo', + 'wikieditor-toolbar-help-content-reference-description' => 'Tiniwayo', 'wikieditor-toolbar-help-content-reference-syntax' => 'Maandishi ya ukurasa.<ref name="mfano">[http://www.example.org Maandishi ya kiungo], maandishi mengine.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia marejeo fulani kwa mara nyingine', + 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia tiniwayo fulani kwa mara nyingine', 'wikieditor-toolbar-help-content-rereference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha marejeo', + 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha tiniwayo', 'wikieditor-toolbar-help-content-showreferences-result' => "
  1. ^ Maandishi ya kiungo, maandishi mengine.
", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Sahihi pamoja na stempu ya saa', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Jina la mtumiaji (majadiliano) 15:54, 10 June 2009 (UTC)", @@ -30658,7 +30625,7 @@ $messages['vo'] = array( 'wikieditor-toolbar-tool-link-int-target' => 'Tiäd pada:', 'wikieditor-toolbar-tool-link-int-text' => 'Vödem yüma', 'wikieditor-toolbar-tool-link-cancel' => 'Nosükön', - 'wikieditor-toolbar-group-format' => 'Fomät', + 'wikieditor-toolbar-group-format' => 'Lised', # Fuzzy 'wikieditor-toolbar-tool-big' => 'Gretik', 'wikieditor-toolbar-tool-big-example' => 'Vödem gretik', 'wikieditor-toolbar-tool-table' => 'Taib', @@ -31559,9 +31526,9 @@ $messages['zh-hans'] = array( 'wikieditor-toc-show' => '显示内容', 'wikieditor-toc-hide' => '隐藏内容', 'wikieditor-toolbar' => '编辑工具栏', - 'wikieditor-toolbar-desc' => '有增强的使用性能的页面编辑工具栏', - 'wikieditor-toolbar-preference' => '启用增强的编辑工具栏', - 'wikieditor-toolbar-dialogs-preference' => '启用插入链接表格向导及查找和替换功能', + 'wikieditor-toolbar-desc' => '具有增强可用性的页面编辑工具', + 'wikieditor-toolbar-preference' => '启用增强编辑工具栏', + 'wikieditor-toolbar-dialogs-preference' => '启用对话框插入链接、表格以及搜索和替换功能', 'wikieditor-toolbar-hidesig' => '在主名字空间中隐藏签名按钮', 'wikieditor-toolbar-loading' => '正在载入', 'wikieditor-toolbar-tool-bold' => '粗体', @@ -31600,7 +31567,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-title' => '插入文件', 'wikieditor-toolbar-file-target' => '文件名:', 'wikieditor-toolbar-file-caption' => '标题:', - 'wikieditor-toolbar-file-size' => '尺寸:', + 'wikieditor-toolbar-file-size' => '大小:', 'wikieditor-toolbar-file-float' => '对齐:', 'wikieditor-toolbar-file-default' => '(默认)', 'wikieditor-toolbar-file-format' => '格式:', @@ -31608,7 +31575,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-insert' => '插入', 'wikieditor-toolbar-tool-file-cancel' => '取消', 'wikieditor-toolbar-tool-reference' => '参考', - 'wikieditor-toolbar-tool-reference-example' => '请在这里插入注释文字', + 'wikieditor-toolbar-tool-reference-example' => '在此处插入注释文字', 'wikieditor-toolbar-tool-reference-cancel' => '取消', 'wikieditor-toolbar-tool-reference-title' => '插入注释内容', 'wikieditor-toolbar-tool-reference-insert' => '插入', @@ -31630,7 +31597,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-indent' => '缩进', 'wikieditor-toolbar-tool-indent-example' => '已缩进行', 'wikieditor-toolbar-tool-nowiki' => '非维基格式文字', - 'wikieditor-toolbar-tool-nowiki-example' => '请在这里插入非格式化文字', + 'wikieditor-toolbar-tool-nowiki-example' => '在此处插入非维基格式文字', 'wikieditor-toolbar-tool-redirect' => '重定向', 'wikieditor-toolbar-tool-redirect-example' => '目标页名称', 'wikieditor-toolbar-tool-big' => '大号', diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js index c6d327f8..0e0dd090 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js @@ -1,14 +1,15 @@ /* * JavaScript for WikiEditor Dialogs */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.dialogs ) ) { return; } - + // Replace icons $.wikiEditor.modules.dialogs.config.replaceIcons( $( '#wpTextbox1' ) ); - + // Add dialogs module $( '#wpTextbox1' ).wikiEditor( 'addModule', $.wikiEditor.modules.dialogs.config.getDefaultConfig() ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js index 92515cfd..a6b43851 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Highlighting */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add highlight module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'highlight' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.js index 46087989..6056e63b 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Initialize wikiEditor $( '#wpTextbox1' ).wikiEditor(); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js index cdc00f7b..3fbca82d 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Preview module */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'preview' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js index 3b1acd7c..67f97e00 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Preview Dialog */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'previewDialog' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js index 423766d2..d874478c 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Publish module */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add publish module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'publish' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js index 660a14fb..8879d10d 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js @@ -1,13 +1,12 @@ /* * JavaScript for WikiEditor Template Editor */ -( function ( mw, $ ) { - $( document ).ready( function () { - // Disable in template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add template editor module - $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); - } ); -}( mediaWiki, jQuery ) ); + +$( document ).ready( function () { + // Disable in template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add template editor module + $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); +}); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js index fec51866..6eae6de5 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js @@ -1,13 +1,12 @@ /* * JavaScript for WikiEditor Templates */ -( function ( mw, $ ) { - $( document ).ready( function () { - // Disable for template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add templates module - $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); - } ); -}( mediaWiki, jQuery ) ); + +$( document ).ready( function () { + // Disable for template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add templates module + $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); +} ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js index 7ed765e9..d4ffe5ae 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js @@ -4,7 +4,7 @@ var textareaId = '#wpTextbox1'; var wikiEditorTests = { // Add emoticons section - 'add_sections_toolbar': { + add_sections_toolbar: { call: 'addToToolbar', data: { 'sections': { @@ -159,8 +159,8 @@ var wikiEditorTests = { data: { section: 'info', page: 'removeme' - }, - test: '*[rel=info].section *[rel=removeme].page', + }, + test: '*[rel=info].section *[rel=removeme].page', pre: 1, post: 0 }, @@ -171,8 +171,8 @@ var wikiEditorTests = { section: 'info', page: 'emoticons', 'character': ':))' - }, - test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', + }, + test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', pre: 1, post: 0 }, @@ -211,7 +211,7 @@ jQuery(document).ready( function ( $ ) { return false; } - var test, pre, post, i, + var test, pre, post, messages = [ 'Running tests for wikiEditor API' ], $target = $( textareaId ), $ui = $target.data( 'wikiEditor-context' ).$ui, @@ -234,13 +234,13 @@ jQuery(document).ready( function ( $ ) { } if ( window.console ) { - for ( i = 0; i < messages.length; i++ ) { + for ( var i = 0; i < messages.length; i++ ) { window.console.log( messages[i] ); } } $(this) - .attr( 'title', messages.join( ' | ' ) ) + .attr( 'title', messages.join( " | " ) ) .text( passes + ' / ' + tests + ' were successful' ) .css( 'backgroundColor', passes < tests ? 'red' : 'green' ) .data( 'testDone', 'true' ) diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js index 1fc542c5..264e9f86 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Table of Contents */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add table of contents module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'toc' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js index 48d30274..3bc0f0b4 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js @@ -1,7 +1,7 @@ /* * Remove the signature button if the main namespace is edited. */ -jQuery( document ).ready( function ( $ ) { +$( document ).ready( function() { // This module is designed not to depend on ext.wikiEditor or jquery.wikiEditor. // Removing this dependency fixed various bugs, but it does mean that we have to // account for the situation where $.wikiEditor is not present @@ -11,4 +11,4 @@ jQuery( document ).ready( function ( $ ) { if ( $( 'body' ).hasClass( 'ns-0' ) ) { $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } ); } -} ); +}); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js index 3f30c0c4..5cdeae57 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Toolbar */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { $( '.wikiEditor-oldToolbar' ).show(); return; diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.css b/extensions/WikiEditor/modules/jquery.wikiEditor.css index 6e05ff03..d8e331cc 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.css +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.css @@ -18,6 +18,9 @@ } .wikiEditor-ui textarea:focus { outline: none; +} +.wikiEditor-ui .wikiEditor-ui-bottom { + } .wikiEditor-ui .wikiEditor-ui-text { line-height: 0; diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js index f37d004e..0d769164 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js @@ -1,8 +1,6 @@ /** * Configuration of Dialog module for wikiEditor */ -/*jshint curly:false, noarg:false, quotmark:false, onevar:false */ -/*global alert */ ( function ( $, mw ) { $.wikiEditor.modules.dialogs.config = { @@ -228,7 +226,7 @@ $.wikiEditor.modules.dialogs.config = { ); } $( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' ).click( function () { - if ( $( '#wikieditor-toolbar-link-type-ext' ).prop( 'checked' ) ) { + if ( $( '#wikieditor-toolbar-link-type-ext' ).is( ':checked' ) ) { // Abort previous request var request = $( '#wikieditor-toolbar-link-int-target-status' ).data( 'request' ); if ( request ) { @@ -236,9 +234,8 @@ $.wikiEditor.modules.dialogs.config = { } updateWidget( 'external' ); } - if ( $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked' ) ) { + if ( $( '#wikieditor-toolbar-link-type-int' ).is( ':checked' ) ) updateExistence( true ); - } }); // Set labels of tabs based on rel values $(this).find( '[rel]' ).each( function () { @@ -253,12 +250,12 @@ $.wikiEditor.modules.dialogs.config = { .data( 'tooltip', mw.msg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) ); $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' ) .each( function () { - if ( $( this ).val() === '' ) { + var tooltip = mw.msg( $( this ).attr( 'id' ) + '-tooltip' ); + if ( $( this ).val() === '' ) $( this ) .addClass( 'wikieditor-toolbar-dialog-hint' ) .val( $( this ).data( 'tooltip' ) ) .data( 'tooltip-mode', true ); - } } ) .focus( function () { if ( $( this ).val() === $( this ).data( 'tooltip' ) ) { @@ -298,30 +295,26 @@ $.wikiEditor.modules.dialogs.config = { $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked', true ); updateExistence(); } - /*jshint eqeqeq:false */ - if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) { + if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) if ( $( '#wikieditor-toolbar-link-int-target' ).val() == - $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) - ) { - $( '#wikieditor-toolbar-link-int-text' ) - .addClass( 'wikieditor-toolbar-dialog-hint' ) - .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) - .change(); - } else { - $( '#wikieditor-toolbar-link-int-text' ) - .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) - .change(); - } - } + $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) { + $( '#wikieditor-toolbar-link-int-text' ) + .addClass( 'wikieditor-toolbar-dialog-hint' ) + .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) + .change(); + } else { + $( '#wikieditor-toolbar-link-int-text' ) + .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) + .change(); + } }, 0 ); }); $( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function () { var oldVal = $(this).val(); var that = this; setTimeout( function () { - if ( $(that).val() !== oldVal ) { + if ( $(that).val() !== oldVal ) $(that).data( 'untouched', false ); - } }, 0 ); }); // Add images to the page existence widget, which will be shown mutually exclusively to communicate if @@ -386,7 +379,7 @@ $.wikiEditor.modules.dialogs.config = { // Title suggestions $( '#wikieditor-toolbar-link-int-target' ).data( 'suggcache', {} ).suggestions( { - fetch: function () { + fetch: function ( query ) { var that = this; var title = $(this).val(); @@ -615,7 +608,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -713,7 +706,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $( this ).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $( this ).data( 'dialogaction' ) || $( this ).find( 'button:first' ); button.click(); e.preventDefault(); @@ -985,7 +978,7 @@ $.wikiEditor.modules.dialogs.config = { var hiddenHTML = $( '.wikieditor-toolbar-table-preview-hidden' ).html(); $( '.wikieditor-toolbar-table-preview-header' ).html( hiddenHTML ); $( '.wikieditor-toolbar-table-preview-hidden' ).html( headerHTML ); - if ( typeof jQuery.fn.tablesorter === 'function' ) { + if ( typeof jQuery.fn.tablesorter == 'function' ) { $( '#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2' ) .filter( '.sortable' ) .tablesorter(); @@ -1077,7 +1070,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1209,7 +1202,7 @@ $.wikiEditor.modules.dialogs.config = { if ( !match ) { $( '#wikieditor-toolbar-replace-nomatch' ).show(); - } else if ( mode === 'replaceAll' ) { + } else if ( mode == 'replaceAll' ) { // Instead of using repetitive .match() calls, we use one .match() call with /g // and indexOf() followed by substr() to find the offsets. This is actually // faster because our indexOf+substr loop is faster than a match loop, and the @@ -1244,7 +1237,7 @@ $.wikiEditor.modules.dialogs.config = { $(this).data( 'offset', 0 ); } else { - if ( mode === 'replace' ) { + if ( mode == 'replace' ) { var actualReplacement; if (isRegex) { @@ -1337,7 +1330,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1357,12 +1350,12 @@ $.wikiEditor.modules.dialogs.config = { $( textbox ) .bind( 'keypress.srdialog', function ( e ) { - if ( e.which === 13 ) { + if ( e.which == 13 ) { // Enter var button = dialog.data( 'dialogaction' ) || dialog.find( 'button:first' ); button.click(); e.preventDefault(); - } else if ( e.which === 27 ) { + } else if ( e.which == 27 ) { // Escape $(that).dialog( 'close' ); } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js index 6d92966f..f6d86d78 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js @@ -42,8 +42,8 @@ $.wikiEditor.modules.dialogs = { }, openDialog: function ( context, module ) { if ( module in $.wikiEditor.modules.dialogs.modules ) { - var mod = $.wikiEditor.modules.dialogs.modules[module], - $dialog = $( '#' + mod.id ); + var mod = $.wikiEditor.modules.dialogs.modules[module]; + var $dialog = $( '#' + mod.id ); if ( $dialog.length === 0 ) { $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod, module ); $dialog = $( '#' + mod.id ); @@ -82,7 +82,7 @@ $.wikiEditor.modules.dialogs = { module = config[mod]; // Only create the dialog if it's supported, isn't filtered and doesn't exist yet filtered = false; - if ( typeof module.filters !== 'undefined' ) { + if ( typeof module.filters != 'undefined' ) { for ( i = 0; i < module.filters.length; i++ ) { if ( $( module.filters[i] ).length === 0 ) { filtered = true; @@ -92,7 +92,7 @@ $.wikiEditor.modules.dialogs = { } // If the dialog already exists, but for another textarea, simply remove it $existingDialog = $( '#' + module.id ); - if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea !== context.$textarea ) { + if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { $existingDialog.remove(); } // Re-select from the DOM, we might have removed the dialog just now @@ -119,13 +119,13 @@ $.wikiEditor.modules.dialogs = { * @param {String} name Dialog name (key in $.wikiEditor.modules.dialogs.modules) */ reallyCreate: function ( context, module, name ) { - var msg, dialogDiv, + var msg, configuration = module.dialog; // Add some stuff to configuration configuration.bgiframe = true; configuration.autoOpen = false; // By default our dialogs are modal, unless explicitely defined in their specific configuration. - if( typeof configuration.modal === 'undefined' ) { + if( typeof configuration.modal == "undefined" ) { configuration.modal = true; } configuration.title = $.wikiEditor.autoMsg( module, 'title' ); @@ -138,7 +138,7 @@ $.wikiEditor.modules.dialogs = { } configuration.buttons = configuration.newButtons; // Create the dialog
- dialogDiv = $( '
' ) + var dialogDiv = $( '
' ) .attr( 'id', module.id ) .html( module.html ) .data( 'context', context ) @@ -171,28 +171,26 @@ $.wikiEditor.modules.dialogs = { * NOTE: This function assumes $.ui.dialog has already been loaded */ resize: function () { - var oldWS, thisWidth, wrapperWidth, - wrapper = $(this).closest( '.ui-dialog' ), - oldWidth = wrapper.width(), - // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show - // hidden elements. Work around jQuery bug where
inside a dialog is both - // :visible and :hidden - oldHidden = $(this).find( '*' ).not( ':visible' ); - + var wrapper = $(this).closest( '.ui-dialog' ); + var oldWidth = wrapper.width(); + // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show + // hidden elements. Work around jQuery bug where
inside a dialog is both + // :visible and :hidden + var oldHidden = $(this).find( '*' ).not( ':visible' ); // Save the style attributes of the hidden elements to restore them later. Calling hide() after show() messes up // for elements hidden with a class oldHidden.each( function () { $(this).data( 'oldstyle', $(this).attr( 'style' ) ); }); oldHidden.show(); - oldWS = $(this).css( 'white-space' ); + var oldWS = $(this).css( 'white-space' ); $(this).css( 'white-space', 'nowrap' ); if ( wrapper.width() <= $(this).get(0).scrollWidth ) { - thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; + var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; thisWidth = Math.max( $(this).get(0).width, thisWidth ); $(this).width( thisWidth ); $(this).data( 'thisWidth', thisWidth ); - wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; + var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); wrapper.width( wrapperWidth ); $(this).data( 'wrapperWidth', wrapperWidth ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js index f646e456..9d964fa7 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js @@ -20,21 +20,13 @@ $.wikiEditor.modules.highlight = { * Internally used event handlers */ evt: { - /** - * @param context - * @param event - */ delayedChange: function ( context, event ) { - if ( event.data.scope === 'realchange' ) { + if ( event.data.scope == 'realchange' ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, event.data.scope ); } }, - /** - * @param context - * @param event - */ - ready: function ( context ) { + ready: function ( context, event ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, 'ready' ); } @@ -47,22 +39,19 @@ $.wikiEditor.modules.highlight = { /** * Creates a highlight module within a wikiEditor * - * @param context * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { context.modules.highlight.markersStr = ''; }, /** * Scans text division for tokens * - * @param context * @param division */ - scan: function ( context ) { + scan: function ( context, division ) { var tokenArray, text, module, exp, - left, right, match, - regex, label, markAfter, offset; + left, right, match; /*jshint eqnull: true */ // Remove all existing tokens @@ -76,11 +65,11 @@ $.wikiEditor.modules.highlight = { if ( module in $.wikiEditor.modules && 'exp' in $.wikiEditor.modules[module] ) { for ( exp in $.wikiEditor.modules[module].exp ) { // Prepare configuration - regex = $.wikiEditor.modules[module].exp[exp].regex; - label = $.wikiEditor.modules[module].exp[exp].label; - markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; + var regex = $.wikiEditor.modules[module].exp[exp].regex; + var label = $.wikiEditor.modules[module].exp[exp].label; + var markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; // Search for tokens - offset = 0; + var offset = 0; while ( ( match = text.substr( offset ).match( regex ) ) != null ) { right = ( left = offset + match.index ) + match[0].length; tokenArray[tokenArray.length] = { @@ -106,19 +95,16 @@ $.wikiEditor.modules.highlight = { /** * Marks up text with HTML * - * @param context * @param division * @param tokens */ // FIXME: What do division and tokens do? // TODO: Document the scan() and mark() APIs somewhere - mark: function ( context, division ) { - /*jshint eqeqeq:false, onevar:false */ - var i, subtracted, oldLength, j, o, - markers; + mark: function ( context, division, tokens ) { + var i, subtracted, oldLength, j, o; // Reset markers - markers = []; + var markers = []; // Recycle markers that will be skipped in this run if ( context.modules.highlight.markers && division !== '' ) { @@ -367,9 +353,8 @@ $.wikiEditor.modules.highlight = { // Don't remove these either return true; } - if ( marker && typeof marker.beforeUnwrap === 'function' ) { + if ( marker && typeof marker.beforeUnwrap === 'function' ) marker.beforeUnwrap( this ); - } if ( ( marker && marker.anchor === 'tag' ) || $(this).is( 'p' ) ) { // Remove all classes $(this).removeAttr( 'class' ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js index 538fcb18..4d425012 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js @@ -1,6 +1,6 @@ /* IFrame extension for wikiEditor */ -/*jshint onevar:false, boss:true */ -( function ( $ ) { $.wikiEditor.extensions.iframe = function ( context ) { + +( function( $ ) { $.wikiEditor.extensions.iframe = function( context ) { /* * Event Handlers @@ -14,18 +14,18 @@ context.evt = $.extend( context.evt, { * function is to both classify the scope of changes as 'division' or 'character' and to prevent further * processing of events which did not actually change the content of the iframe. */ - keydown: function ( event ) { + 'keydown': function( event ) { switch ( event.which ) { case 90: // z case 89: // y - if ( event.which === 89 && !$.browser.msie ) { + if ( event.which == 89 && !$.browser.msie ) { // only handle y events for IE return true; } else if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { // HistoryPosition is a negative number between -1 and -context.history.length, in other words // it's the number of steps backwards from the latest state. var newPosition; - if ( event.shiftKey || event.which === 89 ) { + if ( event.shiftKey || event.which == 89 ) { // Redo newPosition = context.historyPosition + 1; } else { @@ -35,7 +35,7 @@ context.evt = $.extend( context.evt, { // Only act if we are switching to a valid state if ( newPosition >= ( context.history.length * -1 ) && newPosition < 0 ) { // Make sure we run the history storing code before we make this change - context.fn.updateHistory( context.oldDelayedHTML !== context.$content.html() ); + context.fn.updateHistory( context.oldDelayedHTML != context.$content.html() ); context.oldDelayedHistoryPosition = context.historyPosition; context.historyPosition = newPosition; // Change state @@ -65,8 +65,8 @@ context.evt = $.extend( context.evt, { var $tabindexList = $( '[tabindex]:visible' ).sort( function( a, b ) { return a.tabIndex - b.tabIndex; } ); - for ( var i=0; i < $tabindexList.length; i++ ) { - if ( $tabindexList.eq( i ).attr( 'id' ) === context.$iframe.attr( 'id' ) ) { + for( var i=0; i < $tabindexList.length; i++ ) { + if( $tabindexList.eq( i ).attr( 'id' ) == context.$iframe.attr( 'id' ) ) { $tabindexList.get( i + 1 ).focus(); break; } @@ -74,48 +74,48 @@ context.evt = $.extend( context.evt, { return false; } break; - case 86: //v - if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { - //paste, intercepted for IE - context.evt.paste( event ); - } - break; + case 86: //v + if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { + //paste, intercepted for IE + context.evt.paste( event ); + } + break; } return true; }, - change: function ( event ) { + 'change': function( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldHTML !== newHTML ) { + if ( context.oldHTML != newHTML ) { context.fn.purgeOffsets(); context.oldHTML = newHTML; event.data.scope = 'realchange'; } // Never let the body be totally empty - if ( context.$content.children().length === 0 ) { + if ( context.$content.children().length == 0 ) { context.$content.append( '

' ); } return true; }, - delayedChange: function ( event ) { + 'delayedChange': function( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldDelayedHTML !== newHTML ) { + if ( context.oldDelayedHTML != newHTML ) { context.oldDelayedHTML = newHTML; event.data.scope = 'realchange'; // Surround by

if it does not already have it var cursorPos = context.fn.getCaretPosition(); var t = context.fn.getOffset( cursorPos[0] ); - if ( ! $.browser.msie && t && t.node.nodeName === '#text' && t.node.parentNode.nodeName.toLowerCase() === 'body' ) { - $( t.node ).wrap( '

' ); + if ( ! $.browser.msie && t && t.node.nodeName == '#text' && t.node.parentNode.nodeName.toLowerCase() == 'body' ) { + $( t.node ).wrap( "

" ); context.fn.purgeOffsets(); context.fn.setSelection( { start: cursorPos[0], end: cursorPos[1] } ); } } - context.fn.updateHistory( event.data.scope === 'realchange' ); + context.fn.updateHistory( event.data.scope == 'realchange' ); return true; }, - cut: function ( event ) { + 'cut': function( event ) { setTimeout( function() { context.$content.find( 'br' ).each( function() { if ( $(this).parent().is( 'body' ) ) { @@ -125,7 +125,7 @@ context.evt = $.extend( context.evt, { }, 100 ); return true; }, - paste: function ( event ) { + 'paste': function( event ) { // Save the cursor position to restore it after all this voodoo var cursorPos = context.fn.getCaretPosition(); var oldLength = context.fn.getContents().length; @@ -138,7 +138,6 @@ context.evt = $.extend( context.evt, { } setTimeout( function() { - /*jshint eqnull:true */ // Kill stuff we know we don't want context.$content.find( 'script,style,img,input,select,textarea,hr,button,link,meta' ).remove(); var nodeToDelete = []; @@ -153,31 +152,30 @@ context.evt = $.extend( context.evt, { } if ( elementAtCursor == null || elementAtCursor.node == null ) { context.$content.prepend( '

' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } else { firstDirtyNode = elementAtCursor.node; } - // This is ugly but seems like the best way to handle the case where we select and replace all editor contents + //this is ugly but seems like the best way to handle the case where we select and replace all editor contents try { - /*jshint expr:true */ firstDirtyNode.parentNode; } catch ( err ) { context.$content.prepend( '

' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } while ( firstDirtyNode != null ) { //we're going to replace the contents of the entire parent node. - while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName !== 'BODY' && - !$( firstDirtyNode ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName != 'BODY' + && ! $( firstDirtyNode ).hasClass( 'wikiEditor' ) + ) { firstDirtyNode = firstDirtyNode.parentNode; } //go back till we find the first pasted node - while ( firstDirtyNode.previousSibling != null && - !$( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.previousSibling != null + && ! $( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) + ) { if ( $( firstDirtyNode.previousSibling ).hasClass( '#comment' ) ) { $( firstDirtyNode ).remove(); @@ -187,9 +185,9 @@ context.evt = $.extend( context.evt, { } if ( firstDirtyNode.previousSibling != null ) { - $lastDirtyNode = $( firstDirtyNode.previousSibling ); + $lastDirtyNode = $( firstDirtyNode.previousSibling ); } else { - $lastDirtyNode = $( firstDirtyNode ); + $lastDirtyNode = $( firstDirtyNode ); } var cc = makeContentCollector( $.browser, null ); @@ -220,7 +218,7 @@ context.evt = $.extend( context.evt, { } - if ( !pastedPretty && $.browser.msie && i === 0 ) { + if( !pastedPretty && $.browser.msie && i == 0 ) { continue; } $newElement = $( '

' ); @@ -243,7 +241,7 @@ context.evt = $.extend( context.evt, { //anything without wikiEditor class was pasted. $selection = context.$content.find( ':not(.wikiEditor)' ); - if ( $selection.length === 0 ) { + if ( $selection.length == 0 ) { break; } else { firstDirtyNode = $selection.eq( 0 )[0]; @@ -262,7 +260,7 @@ context.evt = $.extend( context.evt, { }, 0 ); return true; }, - ready: function ( event ) { + 'ready': function( event ) { // Initialize our history queue if ( context.$content ) { context.history.push( { 'html': context.$content.html(), 'sel': context.fn.getCaretPosition() } ); @@ -277,11 +275,7 @@ context.evt = $.extend( context.evt, { * Internally used functions */ context.fn = $.extend( context.fn, { - /** - * @param {jQuery} $element - * @param mode - */ - highlightLine: function ( $element ) { + 'highlightLine': function( $element, mode ) { if ( !$element.is( 'p' ) ) { $element = $element.closest( 'p' ); } @@ -289,7 +283,7 @@ context.fn = $.extend( context.fn, { setTimeout( function() { $element.animate( { 'backgroundColor': 'white' }, 'slow' ); }, 100 ); setTimeout( function() { $element.css( 'backgroundColor', 'white' ); }, 1000 ); }, - htmlToText: function ( html ) { + 'htmlToText': function( html ) { // This function is slow for large inputs, so aggressively cache input/output pairs if ( html in context.htmlToTextMap ) { return context.htmlToTextMap[html]; @@ -300,15 +294,15 @@ context.fn = $.extend( context.fn, { // IE does overzealous whitespace collapsing for $( '
' ).html( html );
 		// We also do 
and easy cases for

conversion here, complicated cases are handled later html = html - .replace( /\r?\n/g, '' ) // IE7 inserts newlines before block elements - .replace( / /g, ' ' ) // We inserted these to prevent IE from collapsing spaces - .replace( /]*\><\/p\>/gi, '

' ) // Remove trailing
from

- .replace( /<\/p\>\s*]*\>/gi, '\n' ) // Easy case for

conversion - .replace( /]*\>/gi, '\n' ) //
conversion - .replace( /<\/p\>(\n*)]*\>/gi, '$1\n' ) + .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements + .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces + .replace( /\]*\>\<\/p\>/gi, '

' ) // Remove trailing
from

+ .replace( /\<\/p\>\s*\]*\>/gi, "\n" ) // Easy case for

conversion + .replace( /\]*\>/gi, "\n" ) //
conversion + .replace( /\<\/p\>(\n*)\]*\>/gi, "$1\n" ) // Un-nest

tags - .replace( /]*\>]*\>/gi, '

' ) - .replace( /<\/p\><\/p\>/gi, '

' ); + .replace( /\]*\>]*\>/gi, '

' ) + .replace( /\<\/p\><\/p\>/gi, '

' ); // Save leading and trailing whitespace now and restore it later. IE eats it all, and even Firefox // won't leave everything alone var leading = html.match( /^\s*/ )[0]; @@ -317,8 +311,8 @@ context.fn = $.extend( context.fn, { var $pre = $( '
' + html + '
' ); $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } ); // Convert tabs,

s and
s back - $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( '\t' ); } ); - $pre.find( 'br' ).each( function() { $( this ).replaceWith( '\n' ); } ); + $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( "\t" ); } ); + $pre.find( 'br' ).each( function() { $( this ).replaceWith( "\n" ); } ); // Converting

s is wrong if there's nothing before them, so check that. // .find( '* + p' ) isn't good enough because textnodes aren't considered $pre.find( 'p' ).each( function() { @@ -329,21 +323,21 @@ context.fn = $.extend( context.fn, { // Check for preceding text var t = new context.fn.rawTraverser( this.firstChild, this, $pre.get( 0 ), true ).prev(); - while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { t = t.prev(); } if ( t ) { - text = '\n' + text; + text = "\n" + text; } // Check for following text t = new context.fn.rawTraverser( this.lastChild, this, $pre.get( 0 ), true ).next(); - while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { t = t.next(); } - if ( t && !t.inP && t.node.nodeName === '#text' && t.node.nodeValue.charAt( 0 ) !== '\n' && - t.node.nodeValue.charAt( 0 ) !== '\r' ) { - text += '\n'; + if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' + && t.node.nodeValue.charAt( 0 ) != '\r' ) { + text += "\n"; } $( this ).text( text ); } ); @@ -363,8 +357,8 @@ context.fn = $.extend( context.fn, { * @param strict If true, the element the selection starts in cannot match (default: false) * @return jQuery object or null if unknown */ - beforeSelection: function ( classname, strict ) { - if ( typeof classname === 'undefined' ) { + 'beforeSelection': function( classname, strict ) { + if ( typeof classname == 'undefined' ) { classname = ''; } var e = null, offset = null; @@ -387,7 +381,7 @@ context.fn = $.extend( context.fn, { // When the cursor is on an empty line, Opera gives us a bogus range object with // startContainer=endContainer=body and startOffset=endOffset=1 var body = context.$iframe[0].contentWindow.document.body; - if ( $.browser.opera && e === body && offset === 1 ) { + if ( $.browser.opera && e == body && offset == 1 ) { return null; } } @@ -406,14 +400,14 @@ context.fn = $.extend( context.fn, { return null; } var seekPos = context.fn.htmlToText( range2.htmlText ).length; - offset = context.fn.getOffset( seekPos ); + var offset = context.fn.getOffset( seekPos ); e = offset ? offset.node : null; offset = offset ? offset.offset : null; if ( !e ) { return null; } } - if ( e.nodeName !== '#text' ) { + if ( e.nodeName != '#text' ) { // The selection is not in a textnode, but between two non-text nodes // (usually inside the between two
s). Go to the rightmost // child of the node just before the selection @@ -431,7 +425,7 @@ context.fn = $.extend( context.fn, { // constructor thousands of times is very inefficient var classStr = ' ' + classname + ' '; while ( e ) { - if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) !== -1 ) ) { + if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) != -1 ) ) { return $( e ); } var next = e.previousSibling; @@ -446,7 +440,7 @@ context.fn = $.extend( context.fn, { /** * Object used by traverser(). Don't use this unless you know what you're doing */ - rawTraverser: function ( node, inP, ancestor, skipNoinclude ) { + 'rawTraverser': function( node, inP, ancestor, skipNoinclude ) { this.node = node; this.inP = inP; this.ancestor = ancestor; @@ -456,16 +450,16 @@ context.fn = $.extend( context.fn, { var nextInP = this.inP; while ( p && !p.nextSibling ) { p = p.parentNode; - if ( p === this.ancestor ) { + if ( p == this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { nextInP = null; } } p = p ? p.nextSibling : null; - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { nextInP = p; } do { @@ -473,13 +467,13 @@ context.fn = $.extend( context.fn, { // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop if ( this.skipNoinclude ) { - while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { + while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { p = p.nextSibling; } } if ( p && p.firstChild ) { p = p.firstChild; - if ( p.nodeName === 'P' ) { + if ( p.nodeName == "P" ) { nextInP = p; } } @@ -493,16 +487,16 @@ context.fn = $.extend( context.fn, { var prevInP = this.inP; while ( p && !p.previousSibling ) { p = p.parentNode; - if ( p === this.ancestor ) { + if ( p == this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { prevInP = null; } } p = p ? p.previousSibling : null; - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { prevInP = p; } do { @@ -516,7 +510,7 @@ context.fn = $.extend( context.fn, { } if ( p && p.lastChild ) { p = p.lastChild; - if ( p.nodeName == 'P' ) { + if ( p.nodeName == "P" ) { prevInP = p; } } @@ -534,28 +528,28 @@ context.fn = $.extend( context.fn, { * @return Traverser object, use .next() or .prev() to get a traverser object referring to the * previous/next node */ - traverser: function ( start ) { + 'traverser': function( start ) { // Find the leftmost leaf node in the tree var startNode = start.jquery ? start.get( 0 ) : start; var node = startNode; - var inP = node.nodeName === 'P' ? node : null; + var inP = node.nodeName == "P" ? node : null; do { // Filter nodes with the wikiEditor-noinclude class // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop - while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { + while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { node = node.nextSibling; } if ( node && node.firstChild ) { node = node.firstChild; - if ( node.nodeName === 'P' ) { + if ( node.nodeName == "P" ) { inP = node; } } } while ( node && node.firstChild ); return new context.fn.rawTraverser( node, inP, startNode, true ); }, - getOffset: function ( offset ) { + 'getOffset': function( offset ) { if ( !context.offsets ) { context.fn.refreshOffsets(); } @@ -584,21 +578,21 @@ context.fn = $.extend( context.fn, { 'lastTextNode': base.lastTextNode }; }, - purgeOffsets: function () { + 'purgeOffsets': function() { context.offsets = null; }, - refreshOffsets: function () { + 'refreshOffsets': function() { context.offsets = [ ]; var t = context.fn.traverser( context.$content ); var pos = 0, lastTextNode = null; while ( t ) { - if ( t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' ) { + if ( t.node.nodeName != '#text' && t.node.nodeName != 'BR' ) { t = t.next(); continue; } - var nextPos = t.node.nodeName === '#text' ? pos + t.node.nodeValue.length : pos + 1; + var nextPos = t.node.nodeName == '#text' ? pos + t.node.nodeValue.length : pos + 1; var nextT = t.next(); - var leavingP = t.node.nodeName === '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP !== t.inP ); + var leavingP = t.node.nodeName == '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP != t.inP ); context.offsets[pos] = { 'node': t.node, 'offset': 0, @@ -616,27 +610,27 @@ context.fn = $.extend( context.fn, { }; } pos = nextPos + ( leavingP ? 1 : 0 ); - if ( t.node.nodeName === '#text' ) { + if ( t.node.nodeName == '#text' ) { lastTextNode = t.node; } t = nextT; } }, - saveCursorAndScrollTop: function () { + 'saveCursorAndScrollTop': function() { // Stub out textarea behavior return; }, - restoreCursorAndScrollTop: function () { + 'restoreCursorAndScrollTop': function() { // Stub out textarea behavior return; }, - saveSelection: function () { + 'saveSelection': function() { if ( $.client.profile().name === 'msie' ) { context.$iframe[0].contentWindow.focus(); context.savedSelection = context.$iframe[0].contentWindow.document.selection.createRange(); } }, - restoreSelection: function () { + 'restoreSelection': function() { if ( $.client.profile().name === 'msie' && context.savedSelection !== null ) { context.$iframe[0].contentWindow.focus(); context.savedSelection.select(); @@ -646,10 +640,10 @@ context.fn = $.extend( context.fn, { /** * Update the history queue * - * @param htmlChange Pass true or false to inidicate if there was a text change that should potentially + * @param htmlChange pass true or false to inidicate if there was a text change that should potentially * be given a new history state. */ - updateHistory: function ( htmlChange ) { + 'updateHistory': function( htmlChange ) { var newHTML = context.$content.html(); var newSel = context.fn.getCaretPosition(); // Was text changed? Was it because of a REDO or UNDO action? @@ -681,7 +675,7 @@ context.fn = $.extend( context.fn, { /** * Sets up the iframe in place of the textarea to allow more advanced operations */ - setupIframe: function () { + 'setupIframe': function() { context.$iframe = $( '' ) .attr( { 'frameBorder': 0, @@ -840,7 +834,7 @@ context.fn = $.extend( context.fn, { * equivilant functionality to the otherwise textarea-based functionality. */ - getElementAtCursor: function () { + 'getElementAtCursor': function() { if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera var selection = context.$iframe[0].contentWindow.getSelection(); @@ -861,7 +855,7 @@ context.fn = $.extend( context.fn, { /** * Gets the complete contents of the iframe (in plain text, not HTML) */ - getContents: function () { + 'getContents': function() { // For

, .html() returns

 

in IE // This seems to convince IE while not affecting display if ( !context.$content ) { @@ -886,7 +880,7 @@ context.fn = $.extend( context.fn, { * Gets the currently selected text in the content * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - getSelection: function () { + 'getSelection': function() { var retval; if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera @@ -921,7 +915,7 @@ context.fn = $.extend( context.fn, { * selection is empty. * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - encapsulateSelection: function ( options ) { + 'encapsulateSelection': function( options ) { var selText = $(this).textSelection( 'getSelection' ); var selTextArr; var collapseToEnd = false; @@ -1133,7 +1127,7 @@ context.fn = $.extend( context.fn, { * Gets the position (in resolution of bytes not nessecarily characters) in a textarea * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - getCaretPosition: function ( options ) { + 'getCaretPosition': function( options ) { var startPos = null, endPos = null; if ( context.$iframe[0].contentWindow.getSelection ) { var selection = context.$iframe[0].contentWindow.getSelection(); @@ -1270,7 +1264,7 @@ context.fn = $.extend( context.fn, { * @param startContainer Element in iframe to start selection in. If not set, start is a character offset * @param endContainer Element in iframe to end selection in. If not set, end is a character offset */ - setSelection: function ( options ) { + 'setSelection': function( options ) { var sc = options.startContainer, ec = options.endContainer; sc = sc && sc.jquery ? sc[0] : sc; ec = ec && ec.jquery ? ec[0] : ec; @@ -1357,7 +1351,7 @@ context.fn = $.extend( context.fn, { * Scroll a textarea to the current cursor position. You can set the cursor position with setSelection() * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - scrollToCaretPosition: function ( options ) { + 'scrollToCaretPosition': function( options ) { context.fn.scrollToTop( context.fn.getElementAtCursor(), true ); }, /** @@ -1367,7 +1361,7 @@ context.fn = $.extend( context.fn, { * @param $element jQuery object containing an element in the iframe * @param force If true, scroll the element even if it's already visible */ - scrollToTop: function ( $element, force ) { + 'scrollToTop': function( $element, force ) { var html = context.$content.closest( 'html' ), body = context.$content.closest( 'body' ), parentHtml = $( 'html' ), diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.js index 460203ff..def8b69e 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.js @@ -8,8 +8,7 @@ * $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } ); * */ -/*jshint onevar:false, boss:true */ -( function ( $, mw ) { +( function ( $ ) { /** * Global static object for wikiEditor that provides generally useful functionality to all modules and contexts. @@ -114,7 +113,7 @@ $.wikiEditor = { isRequired: function ( module, requirement ) { if ( typeof module.req !== 'undefined' ) { for ( var req in module.req ) { - if ( module.req[req] === requirement ) { + if ( module.req[req] == requirement ) { return true; } } @@ -133,10 +132,9 @@ $.wikiEditor = { * with the key 'bar'. */ autoMsg: function ( object, property ) { - var i, p; // Accept array of possible properties, of which the first one found will be used - if ( typeof property === 'object' ) { - for ( i in property ) { + if ( typeof property == 'object' ) { + for ( var i in property ) { if ( property[i] in object || property[i] + 'Msg' in object ) { property = property[i]; break; @@ -146,11 +144,11 @@ $.wikiEditor = { if ( property in object ) { return object[property]; } else if ( property + 'Msg' in object ) { - p = object[property + 'Msg']; + var p = object[property + 'Msg']; if ( $.isArray( p ) && p.length >= 2 ) { - return mw.message.apply( mw.message, p ).plain(); + return mediaWiki.message.apply( mediaWiki.message, p ).plain(); } else { - return mw.message( p ).plain(); + return mediaWiki.message( p ).plain(); } } else { return ''; @@ -183,7 +181,7 @@ $.wikiEditor = { var src = $.wikiEditor.autoLang( icon, lang ); path = path || $.wikiEditor.imgPath; // Prepend path if src is not absolute - if ( src.substr( 0, 7 ) !== 'http://' && src.substr( 0, 8 ) !== 'https://' && src[0] !== '/' ) { + if ( src.substr( 0, 7 ) != 'http://' && src.substr( 0, 8 ) != 'https://' && src[0] != '/' ) { src = path + src; } return src + '?' + mw.loader.version( 'jquery.wikiEditor' ); @@ -199,9 +197,9 @@ $.wikiEditor = { */ autoIconOrOffset: function ( icon, offset, path, lang ) { lang = lang || mw.config.get( 'wgUserLanguage' ); - if ( typeof offset === 'object' && lang in offset ) { + if ( typeof offset == 'object' && lang in offset ) { return offset[lang]; - } else if ( typeof icon === 'object' && lang in icon ) { + } else if ( typeof icon == 'object' && lang in icon ) { return $.wikiEditor.autoIcon( icon, undefined, lang ); } else { return $.wikiEditor.autoLang( offset, lang ); @@ -225,7 +223,7 @@ if ( !$.wikiEditor.isSupported() ) { // where we left off var context = $(this).data( 'wikiEditor-context' ); // On first call, we need to set things up, but on all following calls we can skip right to the API handling -if ( !context || typeof context === 'undefined' ) { +if ( !context || typeof context == 'undefined' ) { // Star filling the context with useful data - any jQuery selections, as usual should be named with a preceding $ context = { @@ -278,14 +276,14 @@ if ( !context || typeof context === 'undefined' ) { 'addModule': function ( context, data ) { var module, call, modules = {}; - if ( typeof data === 'string' ) { + if ( typeof data == 'string' ) { modules[data] = {}; - } else if ( typeof data === 'object' ) { + } else if ( typeof data == 'object' ) { modules = data; } for ( module in modules ) { // Check for the existance of an available / supported module with a matching name and a create function - if ( typeof module === 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && + if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) ) { // Extend the context's core API with this module's own API calls @@ -328,11 +326,11 @@ if ( !context || typeof context === 'undefined' ) { */ trigger: function ( name, event ) { // Event is an optional argument, but from here on out, at least the type field should be dependable - if ( typeof event === 'undefined' ) { + if ( typeof event == 'undefined' ) { event = { 'type': 'custom' }; } // Ensure there's a place for extra information to live - if ( typeof event.data === 'undefined' ) { + if ( typeof event.data == 'undefined' ) { event.data = {}; } @@ -395,7 +393,7 @@ if ( !context || typeof context === 'undefined' ) { // Return the newly appended tab return $( '
' ) .attr( 'rel', 'wikiEditor-ui-view-' + options.name ) - .addClass( context.view === options.name ? 'current' : null ) + .addClass( context.view == options.name ? 'current' : null ) .append( $( '' ) .attr( 'href', '#' ) .mousedown( function () { @@ -408,7 +406,7 @@ if ( !context || typeof context === 'undefined' ) { context.$tabs.find( 'div' ).removeClass( 'current' ); $(this).parent().addClass( 'current' ); $(this).blur(); - if ( 'init' in options && typeof options.init === 'function' ) { + if ( 'init' in options && typeof options.init == 'function' ) { options.init( context ); } event.preventDefault(); @@ -541,9 +539,9 @@ if ( !context || typeof context === 'undefined' ) { var args = $.makeArray( arguments ); // Dynamically setup core extensions for modules that are required -if ( args[0] === 'addModule' && typeof args[1] !== 'undefined' ) { +if ( args[0] == 'addModule' && typeof args[1] !== 'undefined' ) { var modules = args[1]; - if ( typeof modules !== 'object' ) { + if ( typeof modules !== "object" ) { modules = {}; modules[args[1]] = ''; } @@ -579,4 +577,4 @@ return $(this).data( 'wikiEditor-context', context ); }; -}( jQuery, mediaWiki ) ); +}( jQuery ) ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js index 372d2e8e..39907364 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js @@ -1,6 +1,6 @@ /* Preview module for wikiEditor */ ( function ( $, mw ) { -/*jshint onevar:false */ + $.wikiEditor.modules.preview = { /** @@ -32,7 +32,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { if ( 'initialized' in context.modules.preview ) { return; } @@ -65,9 +65,9 @@ fn: { }, function ( data ) { if ( - typeof data.parse === 'undefined' || - typeof data.parse.text === 'undefined' || - typeof data.parse.text['*'] === 'undefined' + typeof data.parse == 'undefined' || + typeof data.parse.text == 'undefined' || + typeof data.parse.text['*'] == 'undefined' ) { return; } @@ -89,7 +89,7 @@ fn: { // Gets the latest copy of the wikitext var wikitext = context.$textarea.textSelection( 'getContents' ); // Aborts when nothing has changed since the last time - if ( context.modules.preview.changesText === wikitext ) { + if ( context.modules.preview.changesText == wikitext ) { return; } context.$changesTab.find( 'table.diff tbody' ).empty(); @@ -115,9 +115,8 @@ fn: { rvprop: '' }; var section = $( '[name="wpSection"]' ).val(); - if ( section !== '' ) { + if ( section !== '' ) postdata2.rvsection = section; - } $.post( mw.util.wikiScript( 'api' ), postdata2, function ( data ) { // Add diff CSS diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js index 5381e605..ca88c79a 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js @@ -1,6 +1,5 @@ /* Publish module for wikiEditor */ -/*jshint onevar:false */ -( function ( $, mw ) { $.wikiEditor.modules.previewDialog = { +( function( $ ) { $.wikiEditor.modules.previewDialog = { /** * Compatability map @@ -30,7 +29,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-preview-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -79,7 +78,7 @@ fn: { .css( 'top', '25px' ); // $dialog.dialog( 'option', 'width', $( 'body' ).width() - 300 ); // Aborts when nothing has changed since the last preview - if ( context.modules.preview.previewText === wikitext ) { + if ( context.modules.preview.previewText == wikitext ) { return; } @@ -97,9 +96,9 @@ fn: { }, function( data ) { if ( - typeof data.parse === 'undefined' || - typeof data.parse.text === 'undefined' || - typeof data.parse.text['*'] === 'undefined' + typeof data.parse == 'undefined' || + typeof data.parse.text == 'undefined' || + typeof data.parse.text['*'] == 'undefined' ) { return; } @@ -129,4 +128,4 @@ fn: { } } -}; } )( jQuery, mediaWiki ); +}; } )( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js index 058fa1b3..b61140dc 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js @@ -1,5 +1,4 @@ /* Publish module for wikiEditor */ -/*jshint onevar:false */ ( function ( $ ) { $.wikiEditor.modules.publish = { @@ -32,7 +31,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -90,18 +89,16 @@ fn: { ); /* END OF REALLY DIRTY HACK */ - if ( $( '#wpMinoredit' ).length === 0 ) { + if ( $( '#wpMinoredit' ).length === 0 ) $( '#wikiEditor-' + context.instance + '-dialog-minor' ).hide(); - } else if ( $( '#wpMinoredit' ).prop( 'checked' ) ) { + else if ( $( '#wpMinoredit' ).is( ':checked' ) ) $( '#wikiEditor-' + context.instance + '-dialog-minor' ) .prop( 'checked', true ); - } - if ( $( '#wpWatchthis' ).length === 0 ) { + if ( $( '#wpWatchthis' ).length === 0 ) $( '#wikiEditor-' + context.instance + '-dialog-watch' ).hide(); - } else if ( $( '#wpWatchthis' ).prop( 'checked' ) ) { + else if ( $( '#wpWatchthis' ).is( ':checked' ) ) $( '#wikiEditor-' + context.instance + '-dialog-watch' ) .prop( 'checked', true ); - } $(this).find( 'form' ).submit( function ( e ) { $(this).closest( '.ui-dialog' ).find( 'button:first' ).click(); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js index 3cbd5ba5..bd00325f 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js @@ -1,6 +1,5 @@ /* TemplateEditor module for wikiEditor */ -/*jshint quotmark:false, onevar:false */ -( function ( $ ) { $.wikiEditor.modules.templateEditor = { +( function( $ ) { $.wikiEditor.modules.templateEditor = { /** * Name mappings, dirty hack which will be removed once "TemplateInfo" extension is more fully supported */ @@ -38,13 +37,9 @@ */ evt: { - /** - * @param context - * @param event - */ - mark: function( context ) { + mark: function( context, event ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope === 'realchange' ) { + if ( context.modules.highlight.currentScope == 'realchange' ) { return; } @@ -52,9 +47,10 @@ evt: { var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; // Collect matching level 0 template call boundaries from the tokenArray + var level = 0; var tokenIndex = 0; while ( tokenIndex < tokenArray.length ){ - while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label !== 'TEMPLATE_BEGIN' ) { + while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label != 'TEMPLATE_BEGIN' ) { tokenIndex++; } //open template @@ -62,18 +58,19 @@ evt: { var beginIndex = tokenIndex; var endIndex = -1; //no match found var openTemplates = 1; - while ( tokenIndex < tokenArray.length - 1 && endIndex === -1 ) { + var templatesMatched = false; + while ( tokenIndex < tokenArray.length - 1 && endIndex == -1 ) { tokenIndex++; - if ( tokenArray[tokenIndex].label === 'TEMPLATE_BEGIN' ) { + if ( tokenArray[tokenIndex].label == 'TEMPLATE_BEGIN' ) { openTemplates++; - } else if ( tokenArray[tokenIndex].label === 'TEMPLATE_END' ) { + } else if ( tokenArray[tokenIndex].label == 'TEMPLATE_END' ) { openTemplates--; - if ( openTemplates === 0 ) { + if ( openTemplates == 0 ) { endIndex = tokenIndex; } //we can stop looping } }//while finding template ending - if ( endIndex !== -1 ) { + if ( endIndex != -1 ) { markers.push( { start: tokenArray[beginIndex].offset, end: tokenArray[endIndex].offset, @@ -95,7 +92,7 @@ evt: { } }, onSkip: function( node ) { - if ( $( node ).html() === $( node ).data( 'oldHTML' ) ) { + if ( $( node ).html() == $( node ).data( 'oldHTML' ) ) { // No change return; } @@ -107,7 +104,7 @@ evt: { if ( $( node ).parent().hasClass( 'wikiEditor-template' ) ) { var $label = $( node ).parent().find( '.wikiEditor-template-label' ); var displayName = $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ); - if ( $label.text() !== displayName ) { + if ( $label.text() != displayName ) { $label.text( displayName ); } } @@ -122,7 +119,7 @@ evt: { $.wikiEditor.modules.templateEditor.fn.bindTemplateEvents( $( node ) ); } }, - getAnchor: function( ca1 ) { + getAnchor: function( ca1, ca2 ) { return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ? ca1.parentNode : null; }, @@ -145,9 +142,7 @@ evt: { var $evtElem = event.jQueryNode; if ( $evtElem.hasClass( 'wikiEditor-template-label' ) ) { // Allow anything if the command or control key are depressed - if ( event.ctrlKey || event.metaKey ) { - return true; - } + if ( event.ctrlKey || event.metaKey ) return true; switch ( event.which ) { case 13: // Enter $evtElem.click(); @@ -182,22 +177,14 @@ evt: { } } }, - /** - * @param context - * @param event - */ - keyup: function( context ) { + keyup: function( context, event ) { // Rest our ignoreKeypress variable if it's set to true if ( context.$iframe.data( 'ignoreKeypress' ) ) { context.$iframe.data( 'ignoreKeypress', false ); } return true; }, - /** - * @param context - * @param event - */ - keypress: function( context ) { + keypress: function( context, event ) { // If this event is from a keydown event which we want to block, ignore it return ( context.$iframe.data( 'ignoreKeypress' ) ? false : true ); } @@ -223,7 +210,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { // Initialize module within the context context.modules.templateEditor = {}; }, @@ -233,7 +220,8 @@ fn: { */ wrapTemplate: function( $wrapper ) { var model = $wrapper.data( 'model' ); - $wrapper + var context = $wrapper.data( 'marker' ).context; + var $template = $wrapper .wrap( '' ) .addClass( 'wikiEditor-template-text wikiEditor-template-text-shrunken' ) .parent() @@ -261,7 +249,7 @@ fn: { bindTemplateEvents: function( $wrapper ) { var $template = $wrapper.parent( '.wikiEditor-template' ); - if ( typeof opera === 'undefined' ) { + if ( typeof ( opera ) == "undefined" ) { $template.parent().attr('contentEditable', 'false'); } @@ -286,7 +274,7 @@ fn: { * Toggle the visisbilty of the wikitext for a given template * @param $wrapper The origianl wrapper we want expand/collapse */ - toggleWikiTextEditor: function( $wrapper ) { + toggleWikiTextEditor: function( $wrapper ) { var context = $wrapper.data( 'marker' ).context; var $template = $wrapper.parent( '.wikiEditor-template' ); context.fn.purgeOffsets(); @@ -297,11 +285,11 @@ fn: { var $templateText = $template.find( '.wikiEditor-template-text' ); $templateText.toggleClass( 'wikiEditor-template-text-shrunken' ); $templateText.toggleClass( 'wikiEditor-template-text-visible' ); - if ( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ + if( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ //we just closed the template // Update the model if we need to - if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { var templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); //this is the only place the template name can be changed; keep the template name in sync @@ -362,7 +350,7 @@ fn: { var $templateText = $templateDiv.children( '.wikiEditor-template-text' ); var templateModel = $templateText.data( 'model' ); // Update the model if we need to - if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); } @@ -374,11 +362,11 @@ fn: { var $rows = $fields.find( '.wikiEditor-template-dialog-field-wrapper' ); for ( var paramIndex in params ) { var param = params[paramIndex]; - if ( typeof param.name === 'undefined' ) { + if ( typeof param.name == 'undefined' ) { // param is the template name, skip it continue; } - var paramText = typeof param === 'string' ? + var paramText = typeof param == 'string' ? param.name.replace( /[\_\-]/g, ' ' ) : param.name; var paramVal = templateModel.getValue( param.name ); @@ -409,13 +397,11 @@ fn: { .data( 'expanded', false ) .bind( 'cut paste keypress click change', function( e ) { // If this was fired by a tab keypress, let it go - if ( e.keyCode === 9 || e.keyCode === '9' ) { - return true; - } + if ( e.keyCode == '9' ) return true; var $this = $( this ); setTimeout( function() { var expanded = $this.data( 'expanded' ); - if ( $this.val().indexOf( '\n' ) !== -1 || $this.val().length > 24 ) { + if ( $this.val().indexOf( '\n' ) != -1 || $this.val().length > 24 ) { if ( !expanded ) { $this.animate( { 'height': '4.5em' }, 'fast' ); $this.data( 'expanded', true ); @@ -469,7 +455,7 @@ fn: { updateModel: function( $templateText, model ) { var context = $templateText.data( 'marker' ).context; var text; - if ( typeof model === 'undefined' ) { + if ( typeof model == 'undefined' ) { text = context.fn.htmlToText( $templateText.html() ); } else { text = model.getText(); @@ -478,7 +464,7 @@ fn: { $templateText.text( text ); $templateText.html( $templateText.html().replace( /\n/g, '
' ) ); $templateText.data( 'oldHTML', $templateText.html() ); - if ( typeof model === 'undefined' ) { + if ( typeof model == 'undefined' ) { model = new $.wikiEditor.modules.templateEditor.fn.model( text ); $templateText.data( 'model', model ); } @@ -490,9 +476,9 @@ fn: { */ getTemplateDisplayName: function ( model ) { var tName = model.getName(); - if( model.getValue( 'name' ) !== '' ) { + if( model.getValue( 'name' ) != '' ) { return tName + ': ' + model.getValue( 'name' ); - } else if( model.getValue( 'Name' ) !== '' ) { + } else if( model.getValue( 'Name' ) != '' ) { return tName + ': ' + model.getValue( 'Name' ); } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) { return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] ); @@ -555,28 +541,27 @@ fn: { var retVal; if ( isNaN( name ) ) { // It's a string! - if ( typeof paramsByName[name] === 'undefined' ) { + if ( typeof paramsByName[name] == 'undefined' ) { // Does not exist - return ''; + return ""; } rangeIndex = paramsByName[name]; } else { // It's a number! - rangeIndex = parseInt( name, 10 ); + rangeIndex = parseInt( name ); } - if ( typeof params[rangeIndex] === 'undefined' ) { + if ( typeof params[rangeIndex] == 'undefined' ) { // Does not exist - return ''; + return ""; } valueRange = ranges[params[rangeIndex].valueIndex]; - if ( typeof valueRange.newVal === 'undefined' || original ) { + if ( typeof valueRange.newVal == 'undefined' || original ) { // Value unchanged, return original wikitext retVal = wikitext.substring( valueRange.begin, valueRange.end ); } else { // New value exists, return new value retVal = valueRange.newVal; } - /*jshint eqnull:true */ if ( value != null ) { ranges[params[rangeIndex].valueIndex].newVal = value; } @@ -589,7 +574,7 @@ fn: { * Get template name */ this.getName = function() { - if( typeof ranges[templateNameIndex].newVal === 'undefined' ) { + if( typeof ranges[templateNameIndex].newVal == 'undefined' ) { return wikitext.substring( ranges[templateNameIndex].begin, ranges[templateNameIndex].end ); } else { return ranges[templateNameIndex].newVal; @@ -650,9 +635,9 @@ fn: { * Get modified template text */ this.getText = function() { - var newText = ""; - for ( var i = 0 ; i < ranges.length; i++ ) { - if( typeof ranges[i].newVal === 'undefined' ) { + newText = ""; + for ( i = 0 ; i < ranges.length; i++ ) { + if( typeof ranges[i].newVal == 'undefined' ) { newText += wikitext.substring( ranges[i].begin, ranges[i].end ); } else { newText += ranges[i].newVal; @@ -674,7 +659,7 @@ fn: { var adjustment = 0; for (var i = 0 ; i < ranges.length; i++ ) { ranges[i].begin += adjustment; - if ( typeof ranges[i].adjust !== 'undefined' ) { + if( typeof ranges[i].adjust != 'undefined' ) { adjustment += ranges[i].adjust(); // NOTE: adjust should be a function that has the information necessary to calculate the length of // this 'segment' @@ -695,16 +680,15 @@ fn: { // Get rid of first {{ with whitespace var sanatizedStr = wikitext.replace( /{{/, " " ); // Replace end - var endBraces = sanatizedStr.match( /}}\s*$/ ); + endBraces = sanatizedStr.match( /}}\s*$/ ); if ( endBraces ) { sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " + sanatizedStr.substring( endBraces.index + 2 ); } - var startIndex, endIndex, sanatizedSegment, openBraces, brace; //treat HTML comments like whitespace - while ( sanatizedStr.indexOf( '') + 3; if( endIndex < 3 ){ @@ -716,26 +700,26 @@ fn: { } // Match the open braces we just found with equivalent closing braces note, works for any level of braces - while ( sanatizedStr.indexOf( '{{' ) !== -1 ) { + while ( sanatizedStr.indexOf( '{{' ) != -1 ) { startIndex = sanatizedStr.indexOf( '{{' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - brace = sanatizedStr[++endIndex]; - openBraces += brace === '}' ? -1 : brace === '{' ? 1 : 0; + var brace = sanatizedStr[++endIndex]; + openBraces += brace == '}' ? -1 : brace == '{' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[{}|=]/g , 'X' ); sanatizedStr = sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); } //links, images, etc, which also can nest - while ( sanatizedStr.indexOf( '[[' ) !== -1 ) { + while ( sanatizedStr.indexOf( '[[' ) != -1 ) { startIndex = sanatizedStr.indexOf( '[[' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - brace = sanatizedStr[++endIndex]; - openBraces += brace === ']' ? -1 : brace === '[' ? 1 : 0; + var brace = sanatizedStr[++endIndex]; + openBraces += brace == ']' ? -1 : brace == '[' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[\[\]|=]/g , 'X' ); sanatizedStr = @@ -749,16 +733,14 @@ fn: { var params = []; var templateNameIndex = 0; var doneParsing = false; - var oldDivider = 0; - var divider = sanatizedStr.indexOf( '|', oldDivider ); - if ( divider === -1 ) { + oldDivider = 0; + divider = sanatizedStr.indexOf( '|', oldDivider ); + if ( divider == -1 ) { divider = sanatizedStr.length; doneParsing = true; collapsible = false; //zero params } - var nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); - var nameEndMatch; - /*jshint eqnull:true */ + nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); if ( nameMatch != null ) { ranges.push( new Range( 0 ,nameMatch.index ) ); //whitespace and squiggles upto the name nameEndMatch = sanatizedStr.substring( 0 , divider ).match( /[^\s]\s*$/ ); //last nonwhitespace character @@ -776,21 +758,18 @@ fn: { * Start looping over params */ var currentParamNumber = 0; - var currentField, currentValue, valueBeginIndex, valueBegin, valueEnd; - var nameIndex, equalsIndex, valueIndex; - var currentName, nameBegin, nameBeginIndex, nameEnd, nameEndIndex; var valueEndIndex = ranges[templateNameIndex].end; var paramsByName = []; while ( !doneParsing ) { currentParamNumber++; oldDivider = divider; divider = sanatizedStr.indexOf( '|', oldDivider + 1 ); - if ( divider === -1 ) { + if ( divider == -1 ) { divider = sanatizedStr.length; doneParsing = true; } currentField = sanatizedStr.substring( oldDivider+1, divider ); - if ( currentField.indexOf( '=' ) === -1 ) { + if ( currentField.indexOf( '=' ) == -1 ) { // anonymous field, gets a number //default values, since we'll allow empty values diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js index b0462563..b303e3fa 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js @@ -1,23 +1,22 @@ /* Templates Module for wikiEditor */ -/*jshint onevar:false */ -( function ( $ ) { $.wikiEditor.modules.templates = { +( function( $ ) { $.wikiEditor.modules.templates = { /** * Core Requirements */ -req: [ 'iframe' ], +'req': [ 'iframe' ], /** * Object Templates */ -tpl: { - marker: { - type: 'template', - anchor: 'wrap', - skipDivision: 'realchange', - afterWrap: function ( node ) { +'tpl': { + 'marker': { + 'type': 'template', + 'anchor': 'wrap', + 'skipDivision': 'realchange', + 'afterWrap': function( node ) { $( node ).addClass( 'wikiEditor-template' ); }, - getAnchor: function ( ca1 ) { + 'getAnchor': function( ca1, ca2 ) { return $( ca1.parentNode ).is( '.wikiEditor-template' ) ? ca1.parentNode : null; } } @@ -25,14 +24,10 @@ tpl: { /** * Event handlers */ -evt: { - /** - * @param context - * @param event - */ - mark: function ( context ) { +'evt': { + 'mark': function( context, event ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope === 'realchange' ) { + if ( context.modules.highlight.currentScope == 'realchange' ) { return; } // Get references to the markers and tokens from the current context @@ -41,14 +36,14 @@ evt: { // Use depth-tracking to extract top-level templates from tokens var depth = 0, bias, start; for ( var i in tokens ) { - depth += ( bias = tokens[i].label === 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label === 'TEMPLATE_END' ? -1 : 0 ) ); - if ( bias > 0 && depth === 1 ) { + depth += ( bias = tokens[i].label == 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label == 'TEMPLATE_END' ? -1 : 0 ) ); + if ( bias > 0 && depth == 1 ) { // Top-level opening - use offset as start start = tokens[i].offset; - } else if ( bias < 0 && depth === 0 ) { + } else if ( bias < 0 && depth == 0 ) { // Top-level closing - use offset as end markers[markers.length] = $.extend( - { context: context, start: start, end: tokens[i].offset }, + { 'context': context, 'start': start, 'end': tokens[i].offset }, $.wikiEditor.modules.templates.tpl.marker ); } @@ -58,19 +53,15 @@ evt: { } } }, -exp: [ - { regex: /{{/, label: 'TEMPLATE_BEGIN' }, - { regex: /}}/, label: 'TEMPLATE_END', markAfter: true } +'exp': [ + { 'regex': /{{/, 'label': "TEMPLATE_BEGIN" }, + { 'regex': /}}/, 'label': "TEMPLATE_END", 'markAfter': true } ], /** * Internally used functions */ -fn: { - /** - * @param context - * @param config - */ - create: function () { +'fn': { + 'create': function( context, config ) { // Do some stuff here... } } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js index 3f186db6..54b8a863 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js @@ -1,32 +1,31 @@ /* TOC Module for wikiEditor */ -/*jshint onevar:false */ -( function ( $, mw ) { $.wikiEditor.modules.toc = { +( function( $ ) { $.wikiEditor.modules.toc = { /** * Compatability map */ -browsers: { +'browsers': { // Left-to-right languages - ltr: { - msie: [['>=', 7]], - firefox: [['>=', 3]], - opera: [['>=', 10]], - safari: [['>=', 4]], - chrome: [['>=', 4]] + 'ltr': { + 'msie': [['>=', 7]], + 'firefox': [['>=', 3]], + 'opera': [['>=', 10]], + 'safari': [['>=', 4]], + 'chrome': [['>=', 4]] }, // Right-to-left languages - rtl: { - msie: [['>=', 8]], - firefox: [['>=', 3]], - opera: [['>=', 10]], - safari: [['>=', 4]], - chrome: [['>=', 4]] + 'rtl': { + 'msie': [['>=', 8]], + 'firefox': [['>=', 3]], + 'opera': [['>=', 10]], + 'safari': [['>=', 4]], + 'chrome': [['>=', 4]] } }, /** * Core Requirements */ -req: [ 'iframe' ], +'req': [ 'iframe' ], /** * Configuration */ @@ -52,18 +51,10 @@ api: { * Event handlers */ evt: { - /** - * @param context - * @param event - */ - change: function( context ) { + change: function( context, event ) { $.wikiEditor.modules.toc.fn.update( context ); }, - /** - * @param context - * @param event - */ - ready: function( context ) { + ready: function( context, event ) { // Add the TOC to the document $.wikiEditor.modules.toc.fn.build( context ); if ( !context.$content ) { @@ -77,32 +68,28 @@ evt: { $.wikiEditor.modules.toc.fn.improveUI(); $.wikiEditor.modules.toc.evt.resize( context ); }, - /** - * @param context - * @param event - */ - resize: function( context ) { + resize: function( context, event ) { var availableWidth = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ), totalMinWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); context.$ui.find( '.wikiEditor-ui-right' ) .resizable( 'option', 'maxWidth', availableWidth ); - if ( context.modules.toc.$toc.data( 'positionMode' ) !== 'disabled' && + if ( context.modules.toc.$toc.data( 'positionMode' ) != 'disabled' && context.$wikitext.width() < totalMinWidth ) { $.wikiEditor.modules.toc.fn.disable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'disabled' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'disabled' && context.$wikitext.width() > totalMinWidth ) { $.wikiEditor.modules.toc.fn.enable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' && context.$ui.find( '.wikiEditor-ui-right' ).width() > availableWidth ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' && context.modules.toc.$toc.data( 'previousWidth' ) < context.$wikitext.width() ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); } - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true, 'restoreText': true } ); @@ -118,18 +105,14 @@ evt: { // store the width of the view for comparison on next resize context.modules.toc.$toc.data( 'previousWidth', context.$wikitext.width() ); }, - /** - * @param context - * @param event - */ - mark: function( context ) { + mark: function( context, event ) { var hash = ''; var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; var outline = context.data.outline = []; var h = 0; for ( var i = 0; i < tokenArray.length; i++ ) { - if ( tokenArray[i].label !== 'TOC_HEADER' ) { + if ( tokenArray[i].label != 'TOC_HEADER' ) { continue; } h++; @@ -151,14 +134,14 @@ evt: { }, onSkip: function( node ) { var marker = $( node ).data( 'marker' ); - if ( $( node ).data( 'section' ) !== marker.index ) { + if ( $( node ).data( 'section' ) != marker.index ) { $( node ) .removeClass( 'wikiEditor-toc-section-' + $( node ).data( 'section' ) ) .addClass( 'wikiEditor-toc-section-' + marker.index ) .data( 'section', marker.index ); } }, - getAnchor: function( ca1 ) { + getAnchor: function( ca1, ca2 ) { return $( ca1.parentNode ).is( '.wikiEditor-toc-header' ) ? ca1.parentNode : null; } @@ -171,7 +154,7 @@ evt: { } ); } // Only update the TOC if it's been changed - we do this by comparing a hash of the headings this time to last - if ( typeof context.modules.toc.lastHash === 'undefined' || context.modules.toc.lastHash !== hash ) { + if ( typeof context.modules.toc.lastHash == 'undefined' || context.modules.toc.lastHash !== hash ) { $.wikiEditor.modules.toc.fn.build( context ); $.wikiEditor.modules.toc.fn.update( context ); // Remember the changed version @@ -192,13 +175,13 @@ fn: { * @param {Object} context Context object of editor to create module in * @param {Object} config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { if ( '$toc' in context.modules.toc ) { return; } $.wikiEditor.modules.toc.cfg.rtl = $( 'body' ).is( '.rtl' ); $.wikiEditor.modules.toc.cfg.flexProperty = $.wikiEditor.modules.toc.cfg.rtl ? 'marginLeft' : 'marginRight'; - context.$ui.find( '.wikiEditor-ui-left' ).height(); + var height = context.$ui.find( '.wikiEditor-ui-left' ).height(); context.modules.toc.$toc = $( '
' ) .addClass( 'wikiEditor-ui-toc' ) .data( 'context', context ) @@ -213,14 +196,14 @@ fn: { }, redraw: function( context, fixedWidth ) { fixedWidth = parseFloat( fixedWidth ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' ) { context.$ui.find( '.wikiEditor-ui-right' ) .css( 'width', fixedWidth + 'px' ); context.$ui.find( '.wikiEditor-ui-left' ) .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * fixedWidth ) + 'px' ) .children() .css( $.wikiEditor.modules.toc.cfg.flexProperty, fixedWidth + 'px' ); - } else if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + } else if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { context.$ui.find( '.wikiEditor-ui-left' ) .css( 'width', fixedWidth ); context.$ui.find( '.wikiEditor-ui-right' ) @@ -229,10 +212,10 @@ fn: { } }, switchLayout: function( context ) { - var width; - context.$ui.find( '.wikiEditor-ui-right' ).height(); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && - !context.modules.toc.$toc.data( 'collapsed' ) + var width, + height = context.$ui.find( '.wikiEditor-ui-right' ).height(); + if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' + && !context.modules.toc.$toc.data( 'collapsed' ) ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'goofy' ); @@ -254,7 +237,7 @@ fn: { 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } ); context.$wikitext .css( 'position', 'relative' ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'regular' ); // set width @@ -277,7 +260,7 @@ fn: { if ( context.modules.toc.$toc.data( 'collapsed' ) ) { context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); } else { - if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } context.$ui.find( '.wikiEditor-ui-right' ).hide(); @@ -313,7 +296,7 @@ fn: { * * @param {Object} context */ - update: function () { + update: function( context ) { //temporarily commenting this out because it is causing all kinds of cursor //and text jumping issues in IE. WIll get back to this --pdhanda /* @@ -350,10 +333,10 @@ fn: { * * @param {Object} event Event object with context as data */ - collapse: function () { + collapse: function( event ) { var $this = $( this ), context = $this.data( 'context' ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } var pT = $this.parent().position().top - 1; @@ -383,7 +366,7 @@ fn: { // Let the UI know things have moved around context.fn.trigger( 'tocCollapse' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 0 ); return false; @@ -394,19 +377,15 @@ fn: { * * @param {Object} event Event object with context as data */ - expand: function () { + expand: function( event ) { var $this = $( this ), context = $this.data( 'context' ), openWidth = parseFloat( context.modules.toc.$toc.data( 'openWidth' ) ), availableSpace = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); - if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) { - return false; - } + if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) return false; context.modules.toc.$toc.data( 'collapsed', false ); // check if we've got enough room to open to our stored width - if ( availableSpace < openWidth ) { - openWidth = availableSpace; - } + if ( availableSpace < openWidth ) openWidth = availableSpace; context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); var leftParam = {}, leftChildParam = {}; leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = parseFloat( openWidth ) * -1; @@ -428,7 +407,7 @@ fn: { 'top': 'auto' } ); context.fn.trigger( 'tocExpand' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.toc.$toc.data( 'openWidth' ) ); return false; @@ -453,7 +432,7 @@ fn: { } var sections = []; for ( var i = offset; i < outline.length; i++ ) { - if ( outline[i].nLevel === level ) { + if ( outline[i].nLevel == level ) { var sub = buildStructure( outline, i + 1, level + 1 ); if ( sub.length ) { outline[i].sections = sub; @@ -483,9 +462,8 @@ fn: { .click( function( event ) { var wrapper = context.$content.find( '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); - if ( wrapper.length === 0 ) { + if ( wrapper.length === 0 ) wrapper = context.$content; - } context.fn.scrollToTop( wrapper, true ); context.$textarea.textSelection( 'setSelection', { 'start': 0, @@ -503,9 +481,8 @@ fn: { event.preventDefault(); } ) .text( structure[i].text ); - if ( structure[i].text === '' ) { + if ( structure[i].text === '' ) div.html( ' ' ); - } var item = $( '
  • ' ).append( div ); if ( structure[i].sections !== undefined ) { item.append( buildList( structure[i].sections ) ); @@ -569,7 +546,7 @@ fn: { .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' ) ) .resizable( { handles: 'w,e', preventPositionLeftChange: true, minWidth: parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ), - start: function () { + start: function( e, ui ) { var $this = $( this ); // Toss a transparent cover over our iframe $( '
    ' ) @@ -585,7 +562,7 @@ fn: { .appendTo( context.$ui.find( '.wikiEditor-ui-left' ) ); $this.resizable( 'option', 'maxWidth', $this.parent().width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ) ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if(context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } }, @@ -619,7 +596,7 @@ fn: { var handle = $.wikiEditor.modules.toc.cfg.rtl ? 'w' : 'e'; context.$ui.find( '.ui-resizable-' + handle ) .removeClass( 'ui-resizable-' + handle ) - .addClass( 'ui-resizable-' + ( handle === 'w' ? 'e' : 'w' ) ) + .addClass( 'ui-resizable-' + ( handle == 'w' ? 'e' : 'w' ) ) .addClass( 'wikiEditor-ui-toc-resize-grip' ); // Bind collapse and expand event handlers to the TOC context.modules.toc.$toc @@ -627,13 +604,12 @@ fn: { .bind( 'expand.wikiEditor-toc', $.wikiEditor.modules.toc.fn.expand ); context.modules.toc.$toc.data( 'openWidth', $.wikiEditor.modules.toc.cfg.defaultWidth ); // If the toc-width cookie is set, reset the widths based upon that - if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) === 0 ) { + if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) == 0 ) { context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc', { data: context } ); } else if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) > 0 ) { var initialWidth = $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ); - if ( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) { + if( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) initialWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + 1; - } context.modules.toc.$toc.data( 'openWidth', initialWidth + 'px' ); $.wikiEditor.modules.toc.fn.redraw( context, initialWidth ); } @@ -688,7 +664,7 @@ fn: { * Extending resizable to allow west resizing without altering the left position attribute */ $.ui.plugin.add( 'resizable', 'preventPositionLeftChange', { - resize: function () { + resize: function( event, ui ) { $( this ).data( 'resizable' ).position.left = 0; } } ); @@ -697,4 +673,4 @@ fn: { }; -} )( jQuery, mediaWiki ); +} ) ( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js index 780eb2c3..d3f7a9d5 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js @@ -1,8 +1,7 @@ /** * Configuration of Toolbar module for wikiEditor */ -/*jshint camelcase:false, quotmark:false */ -( function ( $, mw ) { $.wikiEditor.modules.toolbar.config = { +( function( $ ) { $.wikiEditor.modules.toolbar.config = { getDefaultConfig: function() { var fileNamespace = mw.config.get( 'wgFormattedNamespaces' )[6]; @@ -1453,4 +1452,4 @@ getDefaultConfig: function() { } }; } -}; } ) ( jQuery, mediaWiki ); +}; } ) ( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js index 71592b53..e1bc6f15 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js @@ -1,7 +1,6 @@ /** * Toolbar module for wikiEditor */ -/*jshint onevar:false */ ( function ( mw, $ ) { $.wikiEditor.modules.toolbar = { /** @@ -18,7 +17,7 @@ api : { var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ), $tabs = context.modules.toolbar.$toolbar.find( 'div.tabs' ); for ( var section in data[type] ) { - if ( section === 'main' ) { + if ( section == 'main' ) { // Section context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( @@ -146,28 +145,28 @@ api : { } }, removeFromToolbar : function( context, data ) { - if ( typeof data.section === 'string' ) { + if ( typeof data.section == 'string' ) { // Section var tab = 'div.tabs span[rel="' + data.section + '"].tab'; var target = 'div[rel="' + data.section + '"].section'; var group = null; - if ( typeof data.group === 'string' ) { + if ( typeof data.group == 'string' ) { // Toolbar group target += ' div[rel="' + data.group + '"].group'; - if ( typeof data.tool === 'string' ) { + if ( typeof data.tool == 'string' ) { // Save for later checking if empty group = target; // Tool target += ' a[rel="' + data.tool + '"].tool'; } - } else if ( typeof data.page === 'string' ) { + } else if ( typeof data.page == 'string' ) { // Booklet page var index = target + ' div.index div[rel="' + data.page + '"]'; target += ' div.pages div[rel="' + data.page + '"].page'; - if ( typeof data.character === 'string' ) { + if ( typeof data.character == 'string' ) { // Character target += ' span[rel="' + data.character + '"]'; - } else if ( typeof data.row === 'number' ) { + } else if ( typeof data.row == 'number' ) { // Table row target += ' table tr:not(:has(th)):eq(' + data.row + ')'; } else { @@ -199,11 +198,7 @@ api : { * Event handlers */ evt: { - /** - * @param context - * @param event - */ - resize: function( context ) { + resize: function( context, event ) { context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section-visible' ).outerHeight() ); }, tocCollapse: function( context, event ) { @@ -240,7 +235,7 @@ fn: { * @param {Object} action * @param {Object} source */ - doAction : function( context, action ) { + doAction : function( context, action, source ) { switch ( action.type ) { case 'replace': case 'encapsulate': @@ -249,7 +244,7 @@ fn: { 'peri' : $.wikiEditor.autoMsg( action.options, 'peri' ), 'post' : $.wikiEditor.autoMsg( action.options, 'post' ) }; - var replace = action.type === 'replace'; + var replace = action.type == 'replace'; if ( 'regex' in action.options && 'regexReplace' in action.options ) { var selection = context.$textarea.textSelection( 'getSelection' ); if ( selection !== '' && selection.match( action.options.regex ) ) { @@ -268,7 +263,7 @@ fn: { } break; case 'callback': - if ( typeof action.execute === 'function' ) { + if ( typeof action.execute == 'function' ) { action.execute( context ); } break; @@ -292,7 +287,7 @@ fn: { if ( tool ) { // Consider a group with only hidden tools empty as well // .is( ':visible' ) always returns false because tool is not attached to the DOM yet - empty = empty && tool.css( 'display' ) === 'none'; + empty = empty && tool.css( 'display' ) == 'none'; $group.append( tool ); } } @@ -452,7 +447,7 @@ fn: { } ); }, buildPage : function( context, id, page ) { - var html, i; + var html; var $page = $( '
    ' ).attr( { 'class' : 'page page-' + id, 'rel' : id @@ -466,7 +461,7 @@ fn: { html += $.wikiEditor.modules.toolbar.fn.buildHeading( context, page.headings ); } if ( 'rows' in page ) { - for ( i = 0; i < page.rows.length; i++ ) { + for ( var i = 0; i < page.rows.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildRow( context, page.rows[i] ); } } @@ -489,7 +484,7 @@ fn: { } if ( 'characters' in page ) { html = ''; - for ( i = 0; i < page.characters.length; i++ ) { + for ( var i = 0; i < page.characters.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildCharacter( page.characters[i], actions ); } $characters @@ -532,7 +527,7 @@ fn: { return html + ''; }, buildCharacter : function( character, actions ) { - if ( typeof character === 'string' ) { + if ( typeof character == 'string' ) { character = { 'label' : character, 'action' : { @@ -569,9 +564,8 @@ fn: { return mw.html.element( 'span', { 'rel': character.label }, character.label ); } } - mw.log( 'A character for the toolbar was undefined. This is not supposed to happen. Double check the config.' ); - // bug 31673; also an additional fix for bug 24208... - return ''; + mw.log( "A character for the toolbar was undefined. This is not supposed to happen. Double check the config." ); + return ""; // bug 31673; also an additional fix for bug 24208... }, buildTab : function( context, id, section ) { var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); @@ -581,7 +575,7 @@ fn: { } var $link = $( '' ) - .addClass( selected === id ? 'current' : null ) + .addClass( selected == id ? 'current' : null ) .attr( { href: '#', role: 'button', @@ -590,7 +584,7 @@ fn: { } ) .text( $.wikiEditor.autoMsg( section, 'label' ) ) .data( 'context', context ) - .mouseup( function () { + .mouseup( function( e ) { $(this).blur(); } ) .mousedown( function( e ) { @@ -610,7 +604,7 @@ fn: { var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); var $section = $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); - var show = $section.css( 'display' ) === 'none'; + var show = $section.css( 'display' ) == 'none'; $section.parent().find( '.section-visible' ) .css( 'position', 'absolute' ) .attr( 'aria-expanded', 'false' ) @@ -674,7 +668,7 @@ fn: { id: 'wikiEditor-section-' + id } ); var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); - var show = selected === id; + var show = selected == id; if ( section.deferLoad !== undefined && section.deferLoad && id !== 'main' && !show ) { // This class shows the spinner and serves as a marker for the click handler in buildTab() @@ -730,7 +724,6 @@ fn: { } }, updateBookletSelection : function( context, id, $pages, $index ) { - /*jshint eqnull:true */ var cookie = 'wikiEditor-' + context.instance + '-booklet-' + id + '-page'; var selected = $.cookie( cookie ); // Re-save cookie @@ -754,7 +747,7 @@ fn: { context.modules.toolbar.$toolbar.append( $( '
    ' ).css( 'clear', 'both' ) ); var sectionQueue = []; for ( var section in config ) { - if ( section === 'main' ) { + if ( section == 'main' ) { context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( context, section, config[section] ) ); -- cgit v1.2.3-54-g00ecf