[MediaWiki-commits] [Gerrit] ApiParse: Forbig section=new when using page, pageid, or oldid - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/199798 Change subject: ApiParse: Forbig section=new when using page, pageid, or oldid .. ApiParse: Forbig section=new when using page, pageid, or oldid Change-Id: I45ce0fe2083587e429143aa3d8d832aa884e1ad7 --- M includes/api/ApiParse.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/98/199798/1 diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 20592ca..b621861 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -88,6 +88,9 @@ $result = $this-getResult(); if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) { + if ( $this-section === 'new' ) { + $this-dieUsage( 'section=new cannot be combined with oldid, pageid or page parameters. Please use text', 'params' ); + } if ( !is_null( $oldid ) ) { // Don't use the parser cache $rev = Revision::newFromId( $oldid ); -- To view, visit https://gerrit.wikimedia.org/r/199798 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45ce0fe2083587e429143aa3d8d832aa884e1ad7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use wgExtensionFunctions instead of SetupAfterCache hook - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/198486 Change subject: Use wgExtensionFunctions instead of SetupAfterCache hook .. Use wgExtensionFunctions instead of SetupAfterCache hook Bug: T90282 Change-Id: I43ddd97def38e2aab3b89ea4f190dec4e6f3df95 --- M TimedMediaHandler.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/86/198486/1 diff --git a/TimedMediaHandler.php b/TimedMediaHandler.php index ac3cf28..ec45d18 100644 --- a/TimedMediaHandler.php +++ b/TimedMediaHandler.php @@ -251,10 +251,10 @@ $wgAutoloadClasses['SpecialTimedMediaHandler'] = $timedMediaDir/SpecialTimedMediaHandler.php; $wgAutoloadClasses['SpecialOrphanedTimedText'] = $timedMediaDir/SpecialOrphanedTimedText.php; -// Register all Timed Media Handler hooks right after the cache check. +// Register all Timed Media Handler hooks right after initial setup // This way if you set a variable like $wgTimedTextNS in LocalSettings.php after you include TimedMediaHandler // we can still read the variable values -$wgHooks['SetupAfterCache'][] = 'TimedMediaHandlerHooks::register'; +$wgExtensionFunctions[] = 'TimedMediaHandlerHooks::register'; # add Special pages $wgSpecialPages['OrphanedTimedText'] = 'SpecialOrphanedTimedText'; -- To view, visit https://gerrit.wikimedia.org/r/198486 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43ddd97def38e2aab3b89ea4f190dec4e6f3df95 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] API: Pass pageId as intval to avoid error in XML output - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/198522 Change subject: API: Pass pageId as intval to avoid error in XML output .. API: Pass pageId as intval to avoid error in XML output T57743 reported something similar, leading me to find this problem. Change-Id: I012d68301cb928ff746fd9fc0d50d03041021750 --- M ApiQueryVideoInfo.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/22/198522/1 diff --git a/ApiQueryVideoInfo.php b/ApiQueryVideoInfo.php index cf67321..c9ddc8f 100644 --- a/ApiQueryVideoInfo.php +++ b/ApiQueryVideoInfo.php @@ -215,7 +215,7 @@ foreach ( $pages as $pageid = $arr ) { if ( !isset( $arr['imagerepository'] ) ) { $result-addValue( - array( 'query', 'pages', $pageid ), + array( 'query', 'pages', intval( $pageid ) ), 'imagerepository', '' ); } -- To view, visit https://gerrit.wikimedia.org/r/198522 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I012d68301cb928ff746fd9fc0d50d03041021750 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TimedText: Remove unneeded dependency on jquery.ui.dialog - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/198525 Change subject: TimedText: Remove unneeded dependency on jquery.ui.dialog .. TimedText: Remove unneeded dependency on jquery.ui.dialog Bug: T57615 Change-Id: If9902604f6f1d44e78df86e13f25d0f34e6e1d2f --- M MwEmbedModules/TimedText/TimedText.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/25/198525/1 diff --git a/MwEmbedModules/TimedText/TimedText.php b/MwEmbedModules/TimedText/TimedText.php index 0b93e8b..57f5004 100644 --- a/MwEmbedModules/TimedText/TimedText.php +++ b/MwEmbedModules/TimedText/TimedText.php @@ -7,7 +7,6 @@ 'styles' = resources/mw.style.TimedText.css, 'dependencies' = array( 'mw.EmbedPlayer', - 'jquery.ui.dialog', 'mw.TextSource' ), 'messageDir' = 'i18n', -- To view, visit https://gerrit.wikimedia.org/r/198525 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9902604f6f1d44e78df86e13f25d0f34e6e1d2f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ApiParse: Fix parse of new section title - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/198092 Change subject: ApiParse: Fix parse of new section title .. ApiParse: Fix parse of new section title Mirror how EditPage transforms a new sectiontitle to be gray, have the arrow etc... Bug: T84877 Change-Id: If4d8fd11386c87a5b6d51b6afbeae737b3a829a5 --- M includes/api/ApiParse.php 1 file changed, 16 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/198092/1 diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 20592ca..2acf7a9 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -230,10 +230,7 @@ } if ( !is_null( $params['summary'] ) ) { $result_array['parsedsummary'] = array(); - ApiResult::setContent( - $result_array['parsedsummary'], - Linker::formatComment( $params['summary'], $titleObj ) - ); + ApiResult::setContent( $result_array['parsedsummary'], $this-formatSummary( $params['summary'], $titleObj ) ); } $result-addValue( null, $this-getModuleName(), $result_array ); @@ -272,10 +269,7 @@ if ( !is_null( $params['summary'] ) ) { $result_array['parsedsummary'] = array(); - ApiResult::setContent( - $result_array['parsedsummary'], - Linker::formatComment( $params['summary'], $titleObj ) - ); + ApiResult::setContent( $result_array['parsedsummary'], $this-formatSummary( $params['summary'], $titleObj ) ); } if ( isset( $prop['langlinks'] ) ) { @@ -499,6 +493,20 @@ return $section; } + /** +* @param String $summary to parse +* @param Title $title of the page being parsed +* @return Content|bool +*/ + private function formatSummary( $summary, $title ) { + global $wgParser; + if ( $this-section === 'new' ) { + $summary = wfMessage( 'newsectionsummary' )-rawParams( $wgParser-stripSectionName( $summary ) ) + -inContentLanguage()-text(); + } + return Linker::formatComment( $summary, $titleObj, $this-section === 'new' ); + } + private function formatLangLinks( $links ) { $result = array(); foreach ( $links as $link ) { -- To view, visit https://gerrit.wikimedia.org/r/198092 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4d8fd11386c87a5b6d51b6afbeae737b3a829a5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Live preview: Disable if there is no wpTextbox1 - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/198107 Change subject: Live preview: Disable if there is no wpTextbox1 .. Live preview: Disable if there is no wpTextbox1 ProofreadPage has custom editforms for Index pages, which are not supported by the API. These editforms have no wpTextbox1, so disable live preview in that case. Bug: T78709 Change-Id: I90cba79e5a4a756454741c4070ebdf620520ab55 --- M resources/src/mediawiki.action/mediawiki.action.edit.preview.js 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/198107/1 diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js index 3bf8e32..84bde7d 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js @@ -205,7 +205,8 @@ $( function () { // Do not enable on user .js/.css pages, as there's no sane way of previewing // the scripts or styles without reloading the page. - if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length ) { + // Do not enable for ProofreadPage Index page editors, which have no textbox + if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length || $( '#wpTextbox1' ).length === 0 ) { return; } -- To view, visit https://gerrit.wikimedia.org/r/198107 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90cba79e5a4a756454741c4070ebdf620520ab55 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Pass context to FormatMetadata class on ImagePage - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/197211 Change subject: Pass context to FormatMetadata class on ImagePage .. Pass context to FormatMetadata class on ImagePage Follow up to: I92774e1a88f03d44967d1797c6c2b8a31c1b10fc Change-Id: I3b2982c956969a182269d2196c556d3922c8333f --- M handlers/OggHandler/OggHandler.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/11/197211/1 diff --git a/handlers/OggHandler/OggHandler.php b/handlers/OggHandler/OggHandler.php index 31d4f3d..167ae7c 100644 --- a/handlers/OggHandler/OggHandler.php +++ b/handlers/OggHandler/OggHandler.php @@ -56,9 +56,10 @@ * with comments from all the streams combined * * @param File $file +* @param bool|IContextSource $context Context to use (optional) * @return array|bool */ - public function formatMetadata( $file ) { + public function formatMetadata( $file, $context = false ) { $meta = $this-getCommonMetaArray( $file ); if ( count( $meta ) === 0 ) { return false; -- To view, visit https://gerrit.wikimedia.org/r/197211 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b2982c956969a182269d2196c556d3922c8333f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add JSHint to CategoryTree - change (mediawiki...CategoryTree)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/196876 Change subject: Add JSHint to CategoryTree .. Add JSHint to CategoryTree Bug: T65112 Change-Id: Ib10f4b043fab5b3163f6e343ae5ff926300b60c8 --- A .jscsrc D .jshintignore A .jshintrc M modules/ext.categoryTree.js 4 files changed, 34 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTree refs/changes/76/196876/1 diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 000..98b81db --- /dev/null +++ b/.jscsrc @@ -0,0 +1,7 @@ +{ + preset: wikimedia, + + disallowQuotedKeysInObjects: null, + requireSpacesInsideParentheses: null, + requireSpacesInsideArrayBrackets: null +} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 5f65288..000 --- a/.jshintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Someone should make this pass... -modules/ext.categoryTree.js diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..92c8c43 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,26 @@ +{ + // Enforcing + bitwise: true, + eqeqeq: true, + es3: true, + freeze: true, + latedef: true, + noarg: true, + nonew: true, + undef: true, + unused: true, + strict: false, + + // Relaxing + laxbreak: true, + multistr: true, + + // Environment + browser: true, + + globals: { + mediaWiki: true, + jQuery: false, + QUnit: false + } +} diff --git a/modules/ext.categoryTree.js b/modules/ext.categoryTree.js index 10521d6..8f28cc7 100644 --- a/modules/ext.categoryTree.js +++ b/modules/ext.categoryTree.js @@ -25,7 +25,7 @@ * @context {Element} CategoryTreeToggle * @param e {jQuery.Event} */ - function handleNode( e ) { + function handleNode( /*e*/ ) { var $link = $( this ); if ( $link.data( 'ct-state' ) === 'collapsed' ) { expandNode( $link ); -- To view, visit https://gerrit.wikimedia.org/r/196876 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib10f4b043fab5b3163f6e343ae5ff926300b60c8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CategoryTree Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve TMH styling - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/196883 Change subject: Improve TMH styling .. Improve TMH styling * Add a new RL module for styling media containers when there is no JS. This makes sure that media inside category pages are correctly align for instance. * Remove some overly specific CSS for play-btn-large Change-Id: I44b7443c48193c16f725ff9d9364b0b76c902fef --- M MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js M TimedMediaHandler.hooks.php M TimedMediaHandler_body.php M TimedMediaTransformOutput.php M resources/PopUpThumbVideo.css A resources/ext.tmh.thumbnail.css 6 files changed, 16 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/83/196883/1 diff --git a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js index 0fa24bc..cc2507e 100644 --- a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js +++ b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js @@ -370,7 +370,6 @@ getPlayButtonPosition: function() { var _this = this; return { - 'position' : 'absolute', 'left' : '50%', 'top' : '50%', 'margin-left' : - .5 * this.getComponentWidth( 'playButtonLarge' ), diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 9be9fc9..aefa973 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -62,6 +62,9 @@ // Add the PopUpMediaTransform module ( specific to timedMedia handler ( no support in mwEmbed modules ) $wgResourceModules+= array( + 'ext.tmh.thumbnail.styles' = $baseExtensionResource + array( + 'styles' = 'resources/ext.tmh.thumbnail.css', + ), 'mw.PopUpMediaTransform' = $baseExtensionResource + array( 'scripts' = 'resources/mw.PopUpThumbVideo.js', 'styles' = 'resources/PopUpThumbVideo.css', @@ -170,6 +173,7 @@ public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { $handler = $imagePage-getDisplayedFile()-getHandler(); if ( $handler !== false $handler instanceof TimedMediaHandler ) { + $out-addModuleStyles( 'ext.tmh.thumbnail.styles' ); $out-addModules( array( 'mw.TimedText.loader', 'mw.MediaWikiPlayer.loader', @@ -409,6 +413,7 @@ } if ( $addModules ) { + $out-addModuleStyles( 'ext.tmh.thumbnail.styles' ); $out-addModules( array( 'mw.TimedText.loader', 'mw.MediaWikiPlayer.loader', diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php index 6af6b51..e2e0486 100644 --- a/TimedMediaHandler_body.php +++ b/TimedMediaHandler_body.php @@ -201,6 +201,7 @@ return ; } $parserOutput-hasTimedMediaTransform = true; + $parserOutput-addModuleStyles( 'ext.tmh.thumbnail.styles' ); $parserOutput-addModules( array( 'mw.TimedText.loader', 'mw.MediaWikiPlayer.loader', diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php index 3653209..e743aa1 100644 --- a/TimedMediaTransformOutput.php +++ b/TimedMediaTransformOutput.php @@ -321,7 +321,7 @@ // Build the video tag output: $s = Xml::tags( 'div' , array( 'class' = 'mediaContainer', - 'style' = 'position:relative;display:block;width:'. $width + 'style' = 'width:'. $width ), Html::rawElement( $this-getTagName(), $this-getMediaAttr( $sizeOverride, $autoPlay ), // The set of media sources: diff --git a/resources/PopUpThumbVideo.css b/resources/PopUpThumbVideo.css index 3ba0572..f6bc34b 100644 --- a/resources/PopUpThumbVideo.css +++ b/resources/PopUpThumbVideo.css @@ -1,5 +1,4 @@ .PopUpMediaTransform a .play-btn-large{ - position : absolute; top: 50%; left : 50%; width: 70px; @@ -13,17 +12,9 @@ /* @embed */ background-image:url('player_big_play_button_hover.png'); } -.PopUpMediaTransform { - position : relative; - display: inline-block; -} /* Should hopefully be only visible to screen readers */ .mw-tmh-playtext {
[MediaWiki-commits] [Gerrit] Remove jscsrc since it's not so useful here - change (mediawiki...CategoryTree)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/196891 Change subject: Remove jscsrc since it's not so useful here .. Remove jscsrc since it's not so useful here Also rm Qunit as a global, since this doens't have qunit tests Change-Id: Ie30e11e7a26da05f5aa0e8a10e979d89d4178953 --- D .jscsrc M .jshintrc 2 files changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTree refs/changes/91/196891/1 diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 98b81db..000 --- a/.jscsrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - preset: wikimedia, - - disallowQuotedKeysInObjects: null, - requireSpacesInsideParentheses: null, - requireSpacesInsideArrayBrackets: null -} diff --git a/.jshintrc b/.jshintrc index 92c8c43..4e65392 100644 --- a/.jshintrc +++ b/.jshintrc @@ -21,6 +21,5 @@ globals: { mediaWiki: true, jQuery: false, - QUnit: false } } -- To view, visit https://gerrit.wikimedia.org/r/196891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie30e11e7a26da05f5aa0e8a10e979d89d4178953 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CategoryTree Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Insert link: trim whitespace from the external link - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/196966 Change subject: Insert link: trim whitespace from the external link .. Insert link: trim whitespace from the external link Bug: T25499 Change-Id: I2392ade17d3d4428784c40dabf9ae5e216fbab47 --- M modules/jquery.wikiEditor.dialogs.config.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/66/196966/1 diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 7b54353..ac2be49 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -471,6 +471,7 @@ else insertText = '[[' + target + '|' + escapeInternalText( text ) + ']]'; } else { + target = $.trim( target ); // Prepend http:// if there is no protocol if ( !target.match( /^[a-z]+:\/\/./ ) ) target = 'http://' + target; -- To view, visit https://gerrit.wikimedia.org/r/196966 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2392ade17d3d4428784c40dabf9ae5e216fbab47 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] LivePreview: Support section=new for preview - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/196443 Change subject: LivePreview: Support section=new for preview .. LivePreview: Support section=new for preview Reproduce the new section behavior for the full submit preview. Diffing will require a bit more additional work in Api. Bug: T84877 Change-Id: Iec71fdc7ba09f91683214f3d65472ea2f72a06b1 --- M resources/src/mediawiki.action/mediawiki.action.edit.preview.js 1 file changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/43/196443/1 diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js index 7e7fe91..516e8a1 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js @@ -65,6 +65,14 @@ summary: $editform.find( '#wpSummary' ).textSelection( 'getContents' ) }; + if ( section !== '' ) { + postData.sectionpreview = ''; + postData.section = section; + if ( section === 'new' ) { + postData.sectiontitle = postData.summary; + } + } + if ( isDiff ) { $wikiPreview.hide(); @@ -104,9 +112,6 @@ prop: 'text|displaytitle|modules|categorieshtml|templates|langlinks|limitreporthtml', disableeditsection: true } ); - if ( section !== '' ) { - postData.sectionpreview = ''; - } request = api.post( postData ); request.done( function ( response ) { var li, newList, $content, $parent, $list; @@ -179,8 +184,7 @@ } ); } request.done( function ( response ) { - if ( response.parse.parsedsummary ) { - // TODO implement special behavior for section === 'new' + if ( response.parse.parsedsummary section !== 'new' ) { $editform.find( '.mw-summary-preview' ) .empty() .append( @@ -244,6 +248,11 @@ ); } + // Show changes for a new section is not yet supported + if( $( '#editform [name=wpSection]' ).val() === 'new' ) { + $( '#wpDiff' ).prop( 'disabled', true ); + } + // This should be moved down to '#editform', but is kept on the body for now // because the LiquidThreads extension is re-using this module with only half // the EditPage (doesn't include #editform presumably, bug 55463). -- To view, visit https://gerrit.wikimedia.org/r/196443 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec71fdc7ba09f91683214f3d65472ea2f72a06b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ApiParse: Support previewing section=new - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/195695 Change subject: ApiParse: Support previewing section=new .. ApiParse: Support previewing section=new When live previewing a 'new' section, we want to automatically add the edit summary/sectiontitle as an H2 element, as the Edit Page and API do as well. Bug: T91167 Change-Id: I40925c16284bb97a4d491e12a8e7878b9d1b4810 --- M includes/api/ApiParse.php 1 file changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/95/195695/1 diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 83d2cbc..982a045 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -36,6 +36,9 @@ /** @var Content $pstContent */ private $pstContent = null; + /** @var string $summary */ + private $summary = null; + public function execute() { // The data is hot but user-dependent, like page views, so we set vary cookies $this-getMain()-setCacheMode( 'anon-public-user-private' ); @@ -70,8 +73,17 @@ if ( isset( $params['section'] ) ) { $this-section = $params['section']; + if ( !preg_match( '/^((T-)?\d+|new)$/', $this-section ) ) { + $this-dieUsage( The section parameter must be a valid section id or 'new', invalidsection ); + } } else { $this-section = false; + } + + if ( isset( $params['summary'] ) ) { + $this-summary = $params['summary']; + } else { + $this-summary = false; } // The parser needs $wgTitle to be set, apparently the @@ -468,8 +480,18 @@ * @return Content|bool */ private function getSectionContent( Content $content, $what ) { - // Not cached (save or load) - $section = $content-getSection( $this-section ); + if ( $this-section == 'new' ) { + if ( $this-summary !== '' ) { + // Insert the section title above the content. + $section = $content-addSectionHeader( $this-summary ); + } else { + $this-dieUsage( A new section requires a summary ); + $section = false; + } + } else { + // Not cached (save or load) + $section = $content-getSection( $this-section ); + } if ( $section === false ) { $this-dieUsage( There is no section {$this-section} in . $what, 'nosuchsection' ); } -- To view, visit https://gerrit.wikimedia.org/r/195695 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40925c16284bb97a4d491e12a8e7878b9d1b4810 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] AUTHORS: Add my own name - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/195771 Change subject: AUTHORS: Add my own name .. AUTHORS: Add my own name Change-Id: I357a4417114fb5bf0d39e7d9fc00fc72f9fdaef8 --- M AUTHORS.txt 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/71/195771/1 diff --git a/AUTHORS.txt b/AUTHORS.txt index 1a7353d..f32faba 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -13,6 +13,7 @@ Alex Monk kren...@wikimedia.org Amir E. Aharoni aahar...@wikimedia.org Antoine Musso has...@free.fr +Derk-Jan Hartman hartman.w...@gmail.com eranroz eranro...@gmail.com Erik Moeller e...@wikimedia.org Erick Guan fantasticfe...@gmail.com -- To view, visit https://gerrit.wikimedia.org/r/195771 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I357a4417114fb5bf0d39e7d9fc00fc72f9fdaef8 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VE: Apply overflow fix on header - change (mediawiki...MobileFrontend)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/193984 Change subject: VE: Apply overflow fix on header .. VE: Apply overflow fix on header Without this, the bottom border can cross over any floating content, which be ugly. Change-Id: Ia2ab31acb4f4b89c3550254a064e484def087fda --- M less/modules/editor/VisualEditorOverlay.less 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/84/193984/1 diff --git a/less/modules/editor/VisualEditorOverlay.less b/less/modules/editor/VisualEditorOverlay.less index 19bab58..c4e9e53 100644 --- a/less/modules/editor/VisualEditorOverlay.less +++ b/less/modules/editor/VisualEditorOverlay.less @@ -7,6 +7,7 @@ h1, h2 { margin-bottom: .5em; border-bottom: solid 1px @sectionBorderColor; + overflow: hidden; } // Styling for images (as output by Parsiod) -- To view, visit https://gerrit.wikimedia.org/r/193984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2ab31acb4f4b89c3550254a064e484def087fda Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bring back hatnotes - change (mediawiki...MobileFrontend)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/193560 Change subject: Bring back hatnotes .. Bring back hatnotes Undo I6b972be and I559281d dablink and rellink classes were partly replaced by .hatnote. But If you want to hide content, hide by semantic class, not by a multipurpose styling class. If templates don't give you a semantic class, ask for the template to add one. Remember that these things are also used in sections a LOT. Especially hiding Main and See also is very annoying. Bug: T91160 Change-Id: I358cf69270e2a9dcdf4af999a5a9df03d966044e --- M less/content/hacks.less 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/60/193560/1 diff --git a/less/content/hacks.less b/less/content/hacks.less index 1481544..c4dbec8 100644 --- a/less/content/hacks.less +++ b/less/content/hacks.less @@ -63,8 +63,6 @@ } } -// Hat notes take up too much room in mobile interface -.hatnote, // FIXME: Remove when filetoc is stripped from file pages a la table of contents (toc) #filetoc, // FIXME: remove when SkinMobile::doEditSectionLink present in cached pages @@ -103,6 +101,7 @@ background-color: #ddeeff; } +.hatnote, .dablink, .rellink { // Use bottom padding instead of bottom margin so that it doesn't affect the @@ -117,14 +116,6 @@ .quotebox { margin: 0 0 0.8em !important; width: auto !important; -} - -@media all and (min-width: @wgMFDeviceWidthTablet) { - - // Show hatnotes when there is room. - .hatnote { - display: block; - } } // Hacks to render galleries better on mobile -- To view, visit https://gerrit.wikimedia.org/r/193560 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I358cf69270e2a9dcdf4af999a5a9df03d966044e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] LivePreview: Notifiy user about errors - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/193578 Change subject: LivePreview: Notifiy user about errors .. LivePreview: Notifiy user about errors Bug: T90490 Change-Id: Ic52311839c175a213065eec442e50b4de0463822 --- M languages/i18n/en.json M languages/i18n/qqq.json M resources/Resources.php M resources/src/mediawiki.action/mediawiki.action.edit.preview.js 4 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/193578/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 31c766f..be2f52c 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -597,6 +597,7 @@ missingcommentheader: strongReminder:/strong You have not provided a subject/headline for this comment.\nIf you click \{{int:savearticle}}\ again, your edit will be saved without one., summary-preview: Summary preview:, subject-preview: Subject/headline preview:, + previewerrortext: An error occurred while attempting to preview your changes., blockedtitle: User is blocked, blockedtext: strongYour username or IP address has been blocked./strong\n\nThe block was made by $1.\nThe reason given is em$2/em.\n\n* Start of block: $8\n* Expiry of block: $6\n* Intended blockee: $7\n\nYou can contact $1 or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the block.\nYou cannot use the \email this user\ feature unless a valid email address is specified in your [[Special:Preferences|account preferences]] and you have not been blocked from using it.\nYour current IP address is $3, and the block ID is #$5.\nPlease include all above details in any queries you make., autoblockedtext: Your IP address has been automatically blocked because it was used by another user, who was blocked by $1.\nThe reason given is:\n\n:em$2/em\n\n* Start of block: $8\n* Expiry of block: $6\n* Intended blockee: $7\n\nYou may contact $1 or one of the other [[{{MediaWiki:Grouppage-sysop}}|administrators]] to discuss the block.\n\nNote that you may not use the \email this user\ feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]] and you have not been blocked from using it.\n\nYour current IP address is $3, and the block ID is #$5.\nPlease include all above details in any queries you make., diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 6253fc9..12e6820 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -761,6 +761,7 @@ missingcommentheader: Edit summary that is shown if you enable \Prompt me when entering a blank summary\ and add a new section without headline to a talk page.\n\nSee also:\n* {{msg-mw|Missingsummary}}\n* {{msg-mw|Savearticle}}, summary-preview: Preview of the edit summary, shown under the edit summary itself.\nShould match: {{msg-mw|summary}}., subject-preview: Should match {{msg-mw|subject}}, + previewerrortext: When a user has the editing preference LivePreview enabled, clicked the Preview or Show Changes button in the edit page and the action did not succeed., blockedtitle: Used as title displayed for blocked users. The corresponding message body is one of the following messages:\n* {{msg-mw|Blockedtext|notext=1}}\n* {{msg-mw|Autoblockedtext|notext=1}}, blockedtext: Text displayed to blocked users.\n\n\email this user\ should be consistent with {{msg-mw|Emailuser}}.\n\nParameters:\n* $1 - the blocking sysop (with a link to his/her userpage)\n* $2 - the reason for the block\n* $3 - the current IP address of the blocked user\n* $4 - (Unused) the blocking sysop's username (plain text, without the link)\n* $5 - the unique numeric identifier of the applied autoblock\n* $6 - the expiry of the block\n* $7 - the intended target of the block (what the blocking user specified in the blocking form)\n* $8 - the timestamp when the block started\nSee also:\n* {{msg-mw|Grouppage-sysop}}\n* {{msg-mw|Autoblockedtext}}, autoblockedtext: Text displayed to automatically blocked users.\n\n\email this user\ should be consistent with {{msg-mw|Emailuser}}.\n\nParameters:\n* $1 - the blocking sysop (with a link to his/her userpage)\n* $2 - the reason for the block (in case of autoblocks: {{msg-mw|autoblocker}})\n* $3 - the current IP address of the blocked user\n* $4 - (Unused) the blocking sysop's username (plain text, without the link). Use it for GENDER.\n* $5 - the unique numeric identifier of the applied autoblock\n* $6 - the expiry of the block\n* $7 - the intended target of the block (what the blocking user specified in the blocking form)\n* $8 - the timestamp when the block started\nSee also:\n* {{msg-mw|Grouppage-sysop}}\n* {{msg-mw|Blockedtext}}, diff --git a/resources/Resources.php b/resources/Resources.php index
[MediaWiki-commits] [Gerrit] LivePreview: Use setTimeout to delay rendering of MathJax - change (mediawiki...Math)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/193270 Change subject: LivePreview: Use setTimeout to delay rendering of MathJax .. LivePreview: Use setTimeout to delay rendering of MathJax wikipage.content hook is fired before the new content is attached, but MathJax cannot deal with that. Use setTimeout to delay execution until next execution run. Bug: T90808 Change-Id: I02178bfd61d34dff49435f3a17a0ce385b37d14d --- M modules/ext.math.mathjax.enabler.js 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/70/193270/1 diff --git a/modules/ext.math.mathjax.enabler.js b/modules/ext.math.mathjax.enabler.js index 47cdf8a..5e3b1d6 100644 --- a/modules/ext.math.mathjax.enabler.js +++ b/modules/ext.math.mathjax.enabler.js @@ -225,7 +225,8 @@ } if ( MathJax.isReady ) { - render(); + // Call render asynchronous because live preview fires the hook with detached $content. + setTimeout( render ); } else { mw.loader.using( 'ext.math.mathjax.mathjax', function () { MathJax.Hub.Startup.signal.MessageHook( 'End', render ); -- To view, visit https://gerrit.wikimedia.org/r/193270 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02178bfd61d34dff49435f3a17a0ce385b37d14d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ComboBox: Use combobox role - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/192186 Change subject: ComboBox: Use combobox role .. ComboBox: Use combobox role This let's screenreaders know that this is actually a combobox that when activate will present a drowdown list. Change-Id: I788d0f35fb0a974e290141ef0079699de842a64d --- M src/widgets/ComboBoxWidget.js 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/86/192186/1 diff --git a/src/widgets/ComboBoxWidget.js b/src/widgets/ComboBoxWidget.js index e82b72e..770d7e8 100644 --- a/src/widgets/ComboBoxWidget.js +++ b/src/widgets/ComboBoxWidget.js @@ -34,6 +34,10 @@ }, config.input ) ); + this.input.$input.eq(0).attr( { + role: 'combobox', + 'aria-autocomplete': 'list' + } ); this.menu = new OO.ui.TextInputMenuSelectWidget( this.input, $.extend( { widget: this, -- To view, visit https://gerrit.wikimedia.org/r/192186 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I788d0f35fb0a974e290141ef0079699de842a64d Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Check MwEmbed dependency only before it is needed - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/191997 Change subject: Check MwEmbed dependency only before it is needed .. Check MwEmbed dependency only before it is needed Fix dependency check to not depend on loadorder, depend on 'late setup' instead. We should probably migrate this setup function to a $wgExtensionFunctions, instead of abusing SetupAfterCache hook. That is T90282 Bug: T88729 Change-Id: I77b18639f6ff0419f8f59974d0333591fde6 --- M TimedMediaHandler.hooks.php M TimedMediaHandler.php 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/97/191997/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index fadb396..4d3c091 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -24,6 +24,11 @@ } } + if( !class_exists( 'MwEmbedResourceManager' ) ) { + echo TimedMediaHandler requires the MwEmbedSupport extension.\n; + exit( 1 ); + } + // Register the Timed Media Handler javascript resources ( MwEmbed modules ) MwEmbedResourceManager::register( 'extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer' ); MwEmbedResourceManager::register( 'extensions/TimedMediaHandler/MwEmbedModules/TimedText' ); diff --git a/TimedMediaHandler.php b/TimedMediaHandler.php index b1e0025..ac3cf28 100644 --- a/TimedMediaHandler.php +++ b/TimedMediaHandler.php @@ -5,11 +5,6 @@ exit( 1 ); } -if( !class_exists( 'MwEmbedResourceManager' ) ) { - echo TimedMediaHandler requires the MwEmbedSupport extension.\n; - exit( 1 ); -} - // Set up the timed media handler dir: $timedMediaDir = __DIR__; // Include WebVideoTranscode (prior to config so that its defined transcode keys can be used in configuration) -- To view, visit https://gerrit.wikimedia.org/r/191997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77b18639f6ff0419f8f59974d0333591fde6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Preferences: Use mediawiki.confirmCloseWindow module - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/191490 Change subject: Preferences: Use mediawiki.confirmCloseWindow module .. Preferences: Use mediawiki.confirmCloseWindow module This logic was duplicated into the preferences page module before we had refactored it into a separate module. Bug: T89819 Change-Id: I67a25ff8758f009123526d5194929bfcd7c3039b --- M resources/Resources.php M resources/src/mediawiki.special/mediawiki.special.preferences.js 2 files changed, 10 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/191490/1 diff --git a/resources/Resources.php b/resources/Resources.php index 233485c..bcfbdca 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1360,6 +1360,7 @@ ), 'dependencies' = array( 'mediawiki.language', + 'mediawiki.confirmCloseWindow', ), ), 'mediawiki.special.recentchanges' = array( diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js b/resources/src/mediawiki.special/mediawiki.special.preferences.js index a3eedd6..19af6cf 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js @@ -5,7 +5,7 @@ var $preftoc, $preferences, $fieldsets, $legends, hash, labelFunc, $tzSelect, $tzTextbox, $localtimeHolder, servertime, - $checkBoxes, savedWindowOnBeforeUnload; + $checkBoxes, allowCloseWindowFn; labelFunc = function () { return this.id.replace( /^mw-prefsection/g, 'preftab' ); @@ -267,39 +267,14 @@ // Set up a message to notify users if they try to leave the page without // saving. $( '#mw-prefs-form' ).data( 'origdata', $( '#mw-prefs-form' ).serialize() ); - $( window ) - .on( 'beforeunload.prefswarning', function () { - var retval; + allowCloseWindowFn = mw.confirmCloseWindow( { + test: function() { + return $( '#mw-prefs-form' ).serialize() !== $( '#mw-prefs-form' ).data( 'origdata' ); + }, - // Check if anything changed - if ( $( '#mw-prefs-form' ).serialize() !== $( '#mw-prefs-form' ).data( 'origdata' ) ) { - // Return our message - retval = mediaWiki.msg( 'prefswarning-warning', mediaWiki.msg( 'saveprefs' ) ); - } - - // Unset the onbeforeunload handler so we don't break page caching in Firefox - savedWindowOnBeforeUnload = window.onbeforeunload; - window.onbeforeunload = null; - if ( retval !== undefined ) { - // ...but if the user chooses not to leave the page, we need to rebind it - setTimeout( function () { - window.onbeforeunload = savedWindowOnBeforeUnload; - }, 1 ); - return retval; - } - } ) - .on( 'pageshow.prefswarning', function () { - // Re-add onbeforeunload handler - if ( !window.onbeforeunload ) { - window.onbeforeunload = savedWindowOnBeforeUnload; - } - } ); - $( '#mw-prefs-form' ).submit( function () { - // Unbind our beforeunload handler - $( window ).off( '.prefswarning' ); + message: mediaWiki.msg( 'prefswarning-warning', mediaWiki.msg( 'saveprefs' ) ), + namespace: 'prefswarning' } ); - $( '#mw-prefs-restoreprefs' ).click( function () { - // Unbind our beforeunload handler - $( window ).off( '.prefswarning' ); - } ); + $( '#mw-prefs-form' ).submit( allowCloseWindowFn ); + $( '#mw-prefs-restoreprefs' ).click( allowCloseWindowFn ); } ); -- To view, visit https://gerrit.wikimedia.org/r/191490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67a25ff8758f009123526d5194929bfcd7c3039b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] SelectWidget: listbox wrapper role, state on contents - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187655 Change subject: SelectWidget: listbox wrapper role, state on contents .. SelectWidget: listbox wrapper role, state on contents SelectWidgets contains OptionWidgets with the role option, as such the wrapper should sport the role of listbox. The individual options should also reflect their state, so that the listbox knows which of the options is the currently selected one. Bug: T88091 Change-Id: I5de49b3aca6c874e30213d2f6bb7c8ca7bbf1e09 --- M src/widgets/OptionWidget.js M src/widgets/SelectWidget.js 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/55/187655/1 diff --git a/src/widgets/OptionWidget.js b/src/widgets/OptionWidget.js index 9f08fd0..b4bed0a 100644 --- a/src/widgets/OptionWidget.js +++ b/src/widgets/OptionWidget.js @@ -116,7 +116,8 @@ OO.ui.OptionWidget.prototype.setSelected = function ( state ) { if ( this.constructor.static.selectable ) { this.selected = !!state; - this.$element.toggleClass( 'oo-ui-optionWidget-selected', state ); + this.$element.toggleClass( 'oo-ui-optionWidget-selected', state ) + .attr( 'aria-selected', state.toString() ); if ( state this.constructor.static.scrollIntoViewOnSelect ) { this.scrollElementIntoView(); } diff --git a/src/widgets/SelectWidget.js b/src/widgets/SelectWidget.js index 7a79a65..97c8747 100644 --- a/src/widgets/SelectWidget.js +++ b/src/widgets/SelectWidget.js @@ -38,7 +38,8 @@ } ); // Initialization - this.$element.addClass( 'oo-ui-selectWidget oo-ui-selectWidget-depressed' ); + this.$element.addClass( 'oo-ui-selectWidget oo-ui-selectWidget-depressed' ) + .attr( 'role', 'listbox' ); if ( $.isArray( config.items ) ) { this.addItems( config.items ); } -- To view, visit https://gerrit.wikimedia.org/r/187655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5de49b3aca6c874e30213d2f6bb7c8ca7bbf1e09 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ButtonOptionWidget: Add the TabIndexedElement mixin - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187652 Change subject: ButtonOptionWidget: Add the TabIndexedElement mixin .. ButtonOptionWidget: Add the TabIndexedElement mixin This element should be keyboard navigable. It was before, probably got lost in the TabIndexedElement rewrite. Bug: T88085 Change-Id: Ic4d4f490661f32fbb731799bec836ff6870281cb --- M src/widgets/ButtonOptionWidget.js 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/52/187652/1 diff --git a/src/widgets/ButtonOptionWidget.js b/src/widgets/ButtonOptionWidget.js index 207e044..18b5b9f 100644 --- a/src/widgets/ButtonOptionWidget.js +++ b/src/widgets/ButtonOptionWidget.js @@ -16,6 +16,7 @@ // Mixin constructors OO.ui.ButtonElement.call( this, config ); + OO.ui.TabIndexedElement.call( this, $.extend( {}, config, { $tabIndexed: this.$button } ) ); // Initialization this.$element.addClass( 'oo-ui-buttonOptionWidget' ); @@ -27,6 +28,7 @@ OO.inheritClass( OO.ui.ButtonOptionWidget, OO.ui.DecoratedOptionWidget ); OO.mixinClass( OO.ui.ButtonOptionWidget, OO.ui.ButtonElement ); +OO.mixinClass( OO.ui.ButtonOptionWidget, OO.ui.TabIndexedElement ); /* Static Properties */ -- To view, visit https://gerrit.wikimedia.org/r/187652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4d4f490661f32fbb731799bec836ff6870281cb Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove superfluos role=text from TextInputWidget - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187298 Change subject: Remove superfluos role=text from TextInputWidget .. Remove superfluos role=text from TextInputWidget The wrapped input and textarea already have native text roles, so no additional role is required here Bug: T87830 Change-Id: I710297d38d9b7546c58089db8aa5e39183841843 --- M src/widgets/TextInputWidget.js 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/98/187298/1 diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js index 116a354..7f8a501 100644 --- a/src/widgets/TextInputWidget.js +++ b/src/widgets/TextInputWidget.js @@ -73,7 +73,6 @@ if ( config.autofocus ) { this.$input.attr( 'autofocus', 'autofocus' ); } - this.$element.attr( 'role', 'textbox' ); }; /* Setup */ -- To view, visit https://gerrit.wikimedia.org/r/187298 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I710297d38d9b7546c58089db8aa5e39183841843 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove disabled buttons from keyboard navigation flow - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187274 Change subject: Remove disabled buttons from keyboard navigation flow .. Remove disabled buttons from keyboard navigation flow Disabled buttons or elements pretending to be a button will receive -1 as their tabindex. This removes them from the keyboard navigation flow. Additionally we set aria-disabled, because chromevox and nvda do not seem to inherit this from their parent elements. Bug: T87690 Change-Id: I767d92a26515f403dc3c8b7843dce836ae751847 --- M src/elements/ButtonElement.js 1 file changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/74/187274/1 diff --git a/src/elements/ButtonElement.js b/src/elements/ButtonElement.js index 2d463dc..cfed75b 100644 --- a/src/elements/ButtonElement.js +++ b/src/elements/ButtonElement.js @@ -34,6 +34,8 @@ this.setTabIndex( config.tabIndex || 0 ); this.setAccessKey( config.accessKey ); this.setButtonElement( config.$button || this.$( 'a' ) ); + this.on( 'disable', this.updateDisabled.bind( this ) ); + }; /* Setup */ @@ -70,7 +72,12 @@ this.$button = $button .addClass( 'oo-ui-buttonElement-button' ) - .attr( { role: 'button', accesskey: this.accessKey, tabindex: this.tabIndex } ) + .attr( { + role: 'button', + accesskey: this.accessKey, + tabindex: this.isDisabled() ? -1 : this.tabIndex, + 'aria-disabled': this.isDisabled() + } ) .on( 'mousedown', this.onMouseDownHandler ); }; @@ -195,3 +202,19 @@ this.$element.toggleClass( 'oo-ui-buttonElement-active', !!value ); return this; }; + +/** + * Consistently apply additional markup changes when changing disabled state + * + * @param {boolean} disabled or not + * @chainable + */ +OO.ui.ButtonElement.prototype.updateDisabled = function ( accessKey ) { + if ( this.$button ) { + this.$button.attr( { + tabindex: this.isDisabled() ? -1 : this.tabIndex, + 'aria-disabled': this.isDisabled() + } ); + } + return this; +}; -- To view, visit https://gerrit.wikimedia.org/r/187274 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I767d92a26515f403dc3c8b7843dce836ae751847 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add aria-pressed to ToggleButtonWidget - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187315 Change subject: Add aria-pressed to ToggleButtonWidget .. Add aria-pressed to ToggleButtonWidget The pressed active state needs to be represented by the Button widget to communicate this state information to screenreaders. This is not done in ButtonElement, because different kinds of widgets might need different kind of aria states to represent 'active'. Bug: T87696 Change-Id: Ic1fccb4439f213ae6ba30810d8999784cd0d082b --- M src/widgets/ToggleButtonWidget.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/15/187315/1 diff --git a/src/widgets/ToggleButtonWidget.js b/src/widgets/ToggleButtonWidget.js index 31c941e..7508f2e 100644 --- a/src/widgets/ToggleButtonWidget.js +++ b/src/widgets/ToggleButtonWidget.js @@ -48,6 +48,7 @@ OO.ui.ToggleButtonWidget.prototype.setValue = function ( value ) { value = !!value; if ( value !== this.value ) { + this.$button.attr( 'aria-pressed', ( value ).toString() ); this.setActive( value ); } -- To view, visit https://gerrit.wikimedia.org/r/187315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1fccb4439f213ae6ba30810d8999784cd0d082b Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set aria-disabled on the Widget - change (oojs/ui)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/187163 Change subject: Set aria-disabled on the Widget .. Set aria-disabled on the Widget This is to fix accessibility for those screenreaders that support this, but it does not fix accessibility for keyboard navigability. aria-disabled can be set on any base markup element and applies to all subelements. http://www.w3.org/TR/wai-aria/states_and_properties#aria-disabled Bug: T87690 Change-Id: I4136a1196bab6d8e00e7f2282a805092f3a1e92c --- M src/Widget.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/63/187163/1 diff --git a/src/Widget.js b/src/Widget.js index b7f4e71..b25a519 100644 --- a/src/Widget.js +++ b/src/Widget.js @@ -83,6 +83,7 @@ if ( isDisabled !== this.wasDisabled ) { this.$element.toggleClass( 'oo-ui-widget-disabled', isDisabled ); this.$element.toggleClass( 'oo-ui-widget-enabled', !isDisabled ); + this.$element.attr( 'aria-disabled', isDisabled ); this.emit( 'disable', isDisabled ); this.updateThemeClasses(); } -- To view, visit https://gerrit.wikimedia.org/r/187163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4136a1196bab6d8e00e7f2282a805092f3a1e92c Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Toolbar: Reset lineheight for character cells - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/183051 Change subject: Toolbar: Reset lineheight for character cells .. Toolbar: Reset lineheight for character cells Bug: T78354 Change-Id: I2f004a29b19d5629ba78a94b4cd26bb91d5a8747 --- M modules/jquery.wikiEditor.toolbar.css 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/51/183051/1 diff --git a/modules/jquery.wikiEditor.toolbar.css b/modules/jquery.wikiEditor.toolbar.css index 84470c3..68f8c20 100644 --- a/modules/jquery.wikiEditor.toolbar.css +++ b/modules/jquery.wikiEditor.toolbar.css @@ -282,6 +282,7 @@ cursor: pointer; font-family: monospace, Courier New; font-size: 1.25em; + line-height: 1; } .wikiEditor-ui-toolbar .page-characters div[dir=rtl] span { /* @noflip */ direction: rtl; -- To view, visit https://gerrit.wikimedia.org/r/183051 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f004a29b19d5629ba78a94b4cd26bb91d5a8747 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.feedback: improve error handling - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/178178 Change subject: mediawiki.feedback: improve error handling .. mediawiki.feedback: improve error handling Some loose ends with the rewrite to promises, add some logging in case of errors, so it's a bit easier to figure out why something was failing Bug: T51636 Change-Id: I081c58378566baef273b76c1a25c3b2d8ba0e19e --- M resources/src/mediawiki/mediawiki.feedback.js 1 file changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/178178/1 diff --git a/resources/src/mediawiki/mediawiki.feedback.js b/resources/src/mediawiki/mediawiki.feedback.js index 6bcb87f..587f5b9 100644 --- a/resources/src/mediawiki/mediawiki.feedback.js +++ b/resources/src/mediawiki/mediawiki.feedback.js @@ -260,21 +260,22 @@ { redirect: true } ) .done( function ( result ) { - if ( result.edit !== undefined ) { - if ( result.edit.result === 'Success' ) { - fb.displayThanks(); - } else { - // unknown API result - fb.displayError( 'feedback-error1' ); - } + if ( result.edit.result === 'Success' ) { + fb.displayThanks(); } else { - // edit failed - fb.displayError( 'feedback-error2' ); + // unknown API result + fb.displayError( 'feedback-error1' ); } } ) - .fail( function () { - // ajax request failed - fb.displayError( 'feedback-error3' ); + .fail( function ( code, result ) { + if ( code === 'http' ) { + // ajax request failed + fb.displayError( 'feedback-error3' ); + mw.log.warn( 'Feedback report failed with HTTP error: ' + result.textStatus ); + } else { + fb.displayError( 'feedback-error2' ); + mw.log.warn( 'Feedback report failed with API error: ' + code ); + } } ); }, -- To view, visit https://gerrit.wikimedia.org/r/178178 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I081c58378566baef273b76c1a25c3b2d8ba0e19e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Toolbar help: Make magic word from help string a param - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/178180 Change subject: Toolbar help: Make magic word from help string a param .. Toolbar help: Make magic word from help string a param Instead of having this magic word in the translation message, make it a parameter of the translation message and retrieve it from wgWikiEditorMagicWords. Bug: T40831 Change-Id: Id3155221aa61bc86da2d9dedab36cbe9dd96 --- M i18n/en.json M i18n/qqq.json M modules/jquery.wikiEditor.toolbar.config.js 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/80/178180/1 diff --git a/i18n/en.json b/i18n/en.json index 221bde5..56cf9ed 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -206,7 +206,7 @@ wikieditor-toolbar-help-content-olist-syntax: # List itembr /# List item, wikieditor-toolbar-help-content-olist-result: olliList item/liliList item/li/ol, wikieditor-toolbar-help-content-file-description: Embedded file, -wikieditor-toolbar-help-content-file-syntax: [[$1:Example.png|thumb|Caption text]], +wikieditor-toolbar-help-content-file-syntax: [[$1:Example.png|$2|Caption text]], wikieditor-toolbar-help-content-file-result: div style='width:104px;' class='thumbinner'a title='Caption text' class='image' href='#'img height='50' width='100' border='0' class='thumbimage' src='$2/WikiEditor/modules/images/toolbar/example-image.png' alt=''//adiv class='thumbcaption'div class='magnify'a title='Enlarge' class='internal' href='#'img height='11' width='15' alt='' src='$1/common/images/magnify-clip.png'//a/divCaption text/div/div, wikieditor-toolbar-help-content-reference-description: Reference, wikieditor-toolbar-help-content-reference-syntax: Page text.lt;ref name=\test\gt;[http://www.example.org Link text], additional text.lt;/refgt;, diff --git a/i18n/qqq.json b/i18n/qqq.json index bb4beec..e9cd8e2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -174,7 +174,7 @@ wikieditor-toolbar-help-content-ulist-description: {{Identical|Bulleted list}}, wikieditor-toolbar-help-content-olist-description: {{Identical|Numbered list}}, wikieditor-toolbar-help-content-file-description: {{Identical|Embedded file}}, - wikieditor-toolbar-help-content-file-syntax: {{doc-important|''thumb'' is a magic word. Leave it untranslated!}}\nParameters:\n* $1 - \File\ namespace name, + wikieditor-toolbar-help-content-file-syntax: Parameters:\n* $1 - \File\ namespace name\n $2 - the image syntax parameter for a thumbnail, wikieditor-toolbar-help-content-file-result: {{doc-important|Do not translate anything except \Caption text\ (twice) and \Enlarge\ (to \{{int:thumbnail-more}}\).}}\nParameters:\n* $1 - style path. e.g. \/w/skins\\n* $2 - extension assets path. e.g. \/w/extensions\, wikieditor-toolbar-help-content-reference-description: {{Identical|Reference}}, wikieditor-toolbar-help-content-reference-syntax: I suggest leaving the codename=\test\/code string in English\n\nwww.example.org is not a real website, but it has been reserved to use in software documentation. If you translate the word example and try to go to that web address then you might get a message that it doesn't exist. But somebody may have created a commercial web page for that address, such as www.Beispiel.org, using the German word for example. It is therefore recommended that you do not translate http://www.example.org at all. If you do wish to translate it you should first check where the translated link takes you., diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index 17a219a..ba3a75a 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -1369,7 +1369,7 @@ 'rows': [ { 'description': { 'htmlMsg': 'wikieditor-toolbar-help-content-file-description' }, - 'syntax': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-syntax', fileNamespace ] }, + 'syntax': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-syntax', fileNamespace, mw.config.get( 'wgWikiEditorMagicWords' ).img_thumbnail ] }, 'result': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-result', mw.config.get( 'stylepath' ), mw.config.get( 'wgExtensionAssetsPath' ) ] } } ] -- To view, visit https://gerrit.wikimedia.org/r/178180 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange
[MediaWiki-commits] [Gerrit] [WIP] Only return CORS headers in the response as required - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/177545 Change subject: [WIP] Only return CORS headers in the response as required .. [WIP] Only return CORS headers in the response as required - Really, totally, Untested. - Split out responses of preflight and actual CORS requests - If the request is not CORS valid, don't set the CORS response headers Note that invalid CORS requests should not actually throw error responses, the client should simply not handle the response because the response does not have the right headers (it's a client side policy error not an http error). We do throw a 403 for a mismatch with the queryparam, but since that is 'outside' of the spec, that might be appropriate. Bug: T76701 Change-Id: Ib296c68babe5c0b380268ee7793b3d6d35b9c3e3 --- M includes/api/ApiMain.php 1 file changed, 17 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/45/177545/1 diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 3d04f95..d038fb2 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -498,12 +498,28 @@ $request = $this-getRequest(); $response = $request-response(); + // Origin: header is a space-separated list of origins, check all of them $originHeader = $request-getHeader( 'Origin' ); if ( $originHeader === false ) { - $origins = array(); + // Origin header is required for any CORS headers on the response + return true; } else { $origins = explode( ' ', $originHeader ); + } + + $requestedMethod = $request-getHeader( 'Access-Control-Request-Method' ); + if ( $request-getMethod() === 'OPTIONS' $requestedMethod !== false ) { + // This is a CORS preflight request + if ( $requestedMethod === 'POST' || $requestedMethod === 'GET' ) { + // We only allow the actual request to be GET or POST + $response-header( 'Access-Control-Allow-Methods: POST, GET' ); + + // We allow the actual request to send the following headers + $response-header( 'Access-Control-Allow-Headers: Api-User-Agent' ); + } else { + return true; + } } if ( !in_array( $originParam, $origins ) ) { @@ -527,7 +543,6 @@ if ( $matchOrigin ) { $response-header( Access-Control-Allow-Origin: $originParam ); $response-header( 'Access-Control-Allow-Credentials: true' ); - $response-header( 'Access-Control-Allow-Headers: Api-User-Agent' ); $this-getOutput()-addVaryHeader( 'Origin' ); } -- To view, visit https://gerrit.wikimedia.org/r/177545 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib296c68babe5c0b380268ee7793b3d6d35b9c3e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove previewDialog - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/176512 Change subject: Remove previewDialog .. Remove previewDialog This was never launched, and is no longer working either. Change-Id: Ic49e84b8a91da701673949a8d441c788a4feaa22 --- M WikiEditor.hooks.php M WikiEditor.php M i18n/en.json M i18n/qqq.json D modules/ext.wikiEditor.previewDialog.js D modules/jquery.wikiEditor.previewDialog.css D modules/jquery.wikiEditor.previewDialog.js 7 files changed, 0 insertions(+), 220 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/12/176512/1 diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php index 9226baa..71ffdaa 100644 --- a/WikiEditor.hooks.php +++ b/WikiEditor.hooks.php @@ -84,21 +84,6 @@ 'ext.wikiEditor.preview', ), ), - 'previewDialog' = array( - 'preferences' = array( - 'wikieditor-previewDialog' = array( - 'type' = 'toggle', - 'label-message' = 'wikieditor-previewDialog-preference', - 'section' = 'editing/labs', - ), - ), - 'requirements' = array( - 'wikieditor-previewDialog' = true, - ), - 'modules' = array( - 'ext.wikiEditor.previewDialog', - ), - ), 'publish' = array( 'preferences' = array( 'wikieditor-publish' = array( diff --git a/WikiEditor.php b/WikiEditor.php index df36911..4d3afc9 100644 --- a/WikiEditor.php +++ b/WikiEditor.php @@ -30,8 +30,6 @@ // Adds a tab for previewing in-line 'preview' = array( 'global' = false, 'user' = true ), - // Adds a button for previewing in a dialog - 'previewDialog' = array( 'global' = false, 'user' = false ), // Adds a button and dialog for step-by-step publishing 'publish' = array( 'global' = false, 'user' = true ), ); @@ -118,14 +116,6 @@ 'scripts' = 'jquery.wikiEditor.preview.js', 'styles' = 'jquery.wikiEditor.preview.css', 'dependencies' = 'jquery.wikiEditor', - ), - 'jquery.wikiEditor.previewDialog' = $wikiEditorTpl + array( - 'scripts' = 'jquery.wikiEditor.previewDialog.js', - 'styles' = 'jquery.wikiEditor.previewDialog.css', - 'dependencies' = array( - 'jquery.wikiEditor', - 'jquery.wikiEditor.dialogs', - ), ), 'jquery.wikiEditor.publish' = $wikiEditorTpl + array( 'scripts' = 'jquery.wikiEditor.publish.js', @@ -382,18 +372,6 @@ 'wikieditor-preview-tab', 'wikieditor-preview-changes-tab', 'wikieditor-preview-loading', - ), - ), - 'ext.wikiEditor.previewDialog' = $wikiEditorTpl + array( - 'scripts' = 'ext.wikiEditor.previewDialog.js', - 'dependencies' = array( - 'ext.wikiEditor', - 'jquery.wikiEditor.previewDialog', - ), - 'messages' = array( - 'wikieditor-previewDialog-preference', - 'wikieditor-previewDialog-tab', - 'wikieditor-previewDialog-loading', ), ), 'ext.wikiEditor.publish' = $wikiEditorTpl + array( diff --git a/i18n/en.json b/i18n/en.json index 5d4ae47..221bde5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,9 +12,6 @@ wikieditor-preview-tab: Preview, wikieditor-preview-changes-tab: Changes, wikieditor-preview-loading: Loading..., -wikieditor-previewDialog-preference: Enable preview dialog, -wikieditor-previewDialog-tab: Preview, -wikieditor-previewDialog-loading: Loading..., wikieditor-publish-preference: Enable step-by-step publishing, wikieditor-publish-button-publish: Publish, wikieditor-publish-button-cancel: Cancel, diff --git a/i18n/qqq.json b/i18n/qqq.json index 0451dee..bb4beec 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -30,8 +30,6 @@ wikieditor-preview-tab: Caption of the tab containing the preview\n\n{{Identical|Preview}}, wikieditor-preview-changes-tab: Caption of the tab containing a diff of the user's changes, Ă la ''{{int:Showdiff}}'' ({{msg-mw|Showdiff|notext=1}}).\n\n{{Identical|Change}}, wikieditor-preview-loading: Alt text for spinner displayed while preview is being loaded\n{{Identical|Loading}}, - wikieditor-previewDialog-tab:
[MediaWiki-commits] [Gerrit] (bug 39643) Allow 0 as the content of syntaxhighlight - change (mediawiki...SyntaxHighlight_GeSHi)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/176479 Change subject: (bug 39643) Allow 0 as the content of syntaxhighlight .. (bug 39643) Allow 0 as the content of syntaxhighlight The empty() function considers 0 to be empty. Makes empty() useless for strings. (cherry picked from commit 8d8fb22ebb508950d122474ccbbf3b18ddba8409) Change-Id: If0e647e3be269edcb23748d246bc564483aff0d2 --- M geshi/geshi.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi refs/changes/79/176479/1 diff --git a/geshi/geshi.php b/geshi/geshi.php index 405ff16..145be2f 100644 --- a/geshi/geshi.php +++ b/geshi/geshi.php @@ -595,10 +595,10 @@ * @since 1.0.0 */ function GeSHi($source = '', $language = '', $path = '') { -if (!empty($source)) { +if ($source !== '') { $this-set_source($source); } -if (!empty($language)) { +if ($language !== '') { $this-set_language($language); } $this-set_language_path($path); -- To view, visit https://gerrit.wikimedia.org/r/176479 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0e647e3be269edcb23748d246bc564483aff0d2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add setContents to textSelection impl of CodeEditor - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/176480 Change subject: Add setContents to textSelection impl of CodeEditor .. Add setContents to textSelection impl of CodeEditor Change-Id: I0a5434b9d40d8945b6b801e2aa2b4b23466ea71c --- M modules/jquery.codeEditor.js 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/80/176480/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index a0cac77..e0c4803 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -559,6 +559,10 @@ return context.codeEditor.getSession().getValue(); }, + 'setContents': function ( newContents ) { + context.codeEditor.getSession().setValue( newContents ); + }, + /** * Gets the currently selected text in the content * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead -- To view, visit https://gerrit.wikimedia.org/r/176480 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a5434b9d40d8945b6b801e2aa2b4b23466ea71c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add error dialog handler on wikipage.content hook - change (mediawiki...Scribunto)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/174665 Change subject: Add error dialog handler on wikipage.content hook .. Add error dialog handler on wikipage.content hook Bug: 73618 Change-Id: Ic5fe43df28fded2936add68a172b264ee22ce89c --- M modules/ext.scribunto.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto refs/changes/65/174665/1 diff --git a/modules/ext.scribunto.js b/modules/ext.scribunto.js index 8cb9646..f227214 100644 --- a/modules/ext.scribunto.js +++ b/modules/ext.scribunto.js @@ -41,7 +41,7 @@ } }; - $( mw.scribunto.init ); + mw.hook( 'wikipage.content' ).add( mw.scribunto.init ); } ) ( jQuery, mediaWiki ); -- To view, visit https://gerrit.wikimedia.org/r/174665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5fe43df28fded2936add68a172b264ee22ce89c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Scribunto Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix undefined error on end of play of native audio - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/174407 Change subject: Fix undefined error on end of play of native audio .. Fix undefined error on end of play of native audio Untested Bug: 56353 Change-Id: I0a8fa8da9bd84fc548d5c3049fb266e785829975 --- M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/07/174407/1 diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js index 11e20aa..8c514f7 100644 --- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js +++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js @@ -469,6 +469,11 @@ callback = null; } } + if( !vid ) { + callbackHandler(); + _this.currentSeekTargetTime = seekTime.toFixed( 2 ); + return; + } // Check if player is ready for seek: if( vid.readyState 1 ){ // Try to seek for 4 seconds: -- To view, visit https://gerrit.wikimedia.org/r/174407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a8fa8da9bd84fc548d5c3049fb266e785829975 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove superfluous parseInt() - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/174097 Change subject: Remove superfluous parseInt() .. Remove superfluous parseInt() Requires testing. If this was for rounding, we should use Math.round or floor/ceil instead (and probably for the other corresponding dimension as well. Change-Id: I7ff3e85fcdb7646f9ebe62bdd7d928d46db6bac3 --- M resources/mw.MediaWikiPlayerSupport.js 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/97/174097/1 diff --git a/resources/mw.MediaWikiPlayerSupport.js b/resources/mw.MediaWikiPlayerSupport.js index 65247dd..8d50d65 100644 --- a/resources/mw.MediaWikiPlayerSupport.js +++ b/resources/mw.MediaWikiPlayerSupport.js @@ -91,7 +91,7 @@ // Set the width height // Make sure we have an accurate aspect ratio if ( imageinfo.height != 0 imageinfo.width != 0 ) { - embedPlayer.height = parseInt( embedPlayer.width * ( imageinfo.height / imageinfo.width ) ); + embedPlayer.height = embedPlayer.width * ( imageinfo.height / imageinfo.width ); } // Update the css for the player interface @@ -176,7 +176,7 @@ imgSize.height = imgSize.width = ( embedPlayer.controlBuilder.getOverlayWidth() 250 ) ? 45 : 80; } else { imgSize.width = ( embedPlayer.controlBuilder.getOverlayWidth() 250 ) ? 45 : 120; - imgSize.height = parseInt( imgSize.width * ( embedPlayer.getHeight() / embedPlayer.getWidth() ) ); + imgSize.height = imgSize.width * ( embedPlayer.getHeight() / embedPlayer.getWidth() ); } return $( 'div/' ).addClass( 'creditline' ) .append( -- To view, visit https://gerrit.wikimedia.org/r/174097 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ff3e85fcdb7646f9ebe62bdd7d928d46db6bac3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Dependency fix - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/174300 Change subject: Dependency fix .. Dependency fix Change-Id: Id6d15f0110032c7c31f909d072529a9c56908942 --- M TimedMediaHandler.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/00/174300/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index a403e05..516f7f8 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -72,7 +72,7 @@ 'ext.tmh.transcodetable' = $baseExtensionResource + array( 'scripts' = 'resources/ext.tmh.transcodetable.js', 'styles' = 'resources/transcodeTable.css', - 'dependencies' = 'mw.api.edit', + 'dependencies' = 'mediawiki.api.edit', 'messages'= array( 'mwe-ok', 'mwe-cancel', -- To view, visit https://gerrit.wikimedia.org/r/174300 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6d15f0110032c7c31f909d072529a9c56908942 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Support WebM Vorbis files in the player - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/174325 Change subject: Support WebM Vorbis files in the player .. Support WebM Vorbis files in the player Bug: 72996 Change-Id: I905b076378a428e0b7ad038df9f28de83852ef11 --- M MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js M MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js M TimedMediaHandler.hooks.php M handlers/WebMHandler/WebMHandler.php 4 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/25/174325/1 diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js index 3749f80..6665080 100644 --- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js +++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js @@ -63,7 +63,9 @@ var webmNativePlayer = new mw.MediaPlayer( 'webmNative', [ 'video/webm', 'video/webm; codecs=vp8', - 'video/webm; codecs=vp8, vorbis' + 'video/webm; codecs=vp8, vorbis', + 'audio/webm', + 'audio/webm; codecs=vorbis' ], 'Native' ); // Image Overlay player ( extends native ) diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js b/MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js index 19e7fde..2080056 100644 --- a/MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js +++ b/MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js @@ -34,6 +34,7 @@ this.defaultPlayers['application/vnd.apple.mpegurl'] = ['Native']; this.defaultPlayers['video/ogg'] = ['Native', 'Vlc', 'Java', 'Generic', 'VLCApp']; + this.defaultPlayers['audio/webm'] = ['Native', 'Vlc', 'VLCApp']; this.defaultPlayers['video/webm'] = ['Native', 'Vlc', 'VLCApp']; this.defaultPlayers['application/ogg'] = ['Native', 'Vlc', 'Java', 'Generic', 'VLCApp']; this.defaultPlayers['audio/ogg'] = ['Native', 'Vlc', 'Java', 'VLCApp']; diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index a403e05..1597c0f 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -37,6 +37,7 @@ // Setup media Handlers: $wgMediaHandlers['application/ogg'] = 'OggHandlerTMH'; + $wgMediaHandlers['audio/webm'] = 'WebMHandler'; $wgMediaHandlers['video/webm'] = 'WebMHandler'; $wgMediaHandlers['video/mp4'] = 'Mp4Handler'; $wgMediaHandlers['audio/x-flac'] = 'FLACHandler'; diff --git a/handlers/WebMHandler/WebMHandler.php b/handlers/WebMHandler/WebMHandler.php index e0dec3c..3e89cef 100644 --- a/handlers/WebMHandler/WebMHandler.php +++ b/handlers/WebMHandler/WebMHandler.php @@ -89,14 +89,16 @@ * @return String */ function getWebType( $file ) { + $baseType = ( $file-getWidth() == 0 $file-getHeight() == 0 )? 'audio' : 'video'; + $streams = $this-getStreamTypes( $file ); if ( count( $streams ) === 0 ) { - return 'video/webm'; + return $baseType . '/webm'; } $codecs = strtolower( implode( ', ', $streams ) ); - return 'video/webm; codecs=' . $codecs . ''; + return $baseType . '/webm; codecs=' . $codecs . ''; } /** -- To view, visit https://gerrit.wikimedia.org/r/174325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I905b076378a428e0b7ad038df9f28de83852ef11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Missing , in variables declaration - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173820 Change subject: Missing , in variables declaration .. Missing , in variables declaration Follow up to Change: Ia6b22c951e33e4f1fdfbf57cd5562f125dc5f656 Change-Id: I0b1142e2f7b220a32eb6c254f44fec87939e1640 --- M resources/mw.MediaWikiPlayerSupport.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/20/173820/1 diff --git a/resources/mw.MediaWikiPlayerSupport.js b/resources/mw.MediaWikiPlayerSupport.js index 727def4..65247dd 100644 --- a/resources/mw.MediaWikiPlayerSupport.js +++ b/resources/mw.MediaWikiPlayerSupport.js @@ -109,7 +109,7 @@ * @param {String} resourceHTML Resource wiki text page contents */ function doCreditLine( resourceHTML, articleUrl ) { - var authUrl, $page, $author, $links, $date, $authorLink + var authUrl, $page, $author, $links, $date, $authorLink, imgSize = { }, // Get the title string ( again a Title like js object could help out here. ) titleStr = embedPlayer.apiTitleKey.replace( /_/g, ' ' ), -- To view, visit https://gerrit.wikimedia.org/r/173820 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b1142e2f7b220a32eb6c254f44fec87939e1640 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] JSCS cleanup for timed media handler - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173509 Change subject: JSCS cleanup for timed media handler .. JSCS cleanup for timed media handler Change-Id: Ia6b22c951e33e4f1fdfbf57cd5562f125dc5f656 --- M resources/ext.tmh.transcodetable.js M resources/mw.MediaWikiPlayer.loader.js M resources/mw.MediaWikiPlayerSupport.js M resources/mw.PopUpThumbVideo.js 4 files changed, 175 insertions(+), 174 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/09/173509/1 diff --git a/resources/ext.tmh.transcodetable.js b/resources/ext.tmh.transcodetable.js index 5b1e443..ed0e901 100644 --- a/resources/ext.tmh.transcodetable.js +++ b/resources/ext.tmh.transcodetable.js @@ -1,23 +1,23 @@ /** * Javascript to support transcode table on image page */ -$(document).ready(function(){ +$( document ).ready( function () { var errorPopup, $errorLink; errorPopup = function () { // pop up dialog - mw.addDialog({ - 'width' : '640', - 'height' : '480', - 'title' : $(this).attr('title'), - 'content' : $('textarea /') - .css({ + mw.addDialog( { + 'width': '640', + 'height': '480', + 'title': $(this).attr( 'title' ), + 'content': $('textarea /') + .css( { 'width':'99%', 'height':'99%' - }) + } ) .text( $(this).attr('data-error') ) - }) - .css('overflow', 'hidden'); + } ) + .css( 'overflow', 'hidden' ); return false; } @@ -25,32 +25,32 @@ $( '.mw-filepage-transcodestatus .errorlink' ).click( errorPopup ); // New version. $errorLink = $( '.mw-filepage-transcodestatus .mw-tmh-pseudo-error-link' ); - $errorLink.wrapInner( function() { - var $this = $(this); + $errorLink.wrapInner( function () { + var $this = $( this ); return $( 'a /' ).attr( { href: '#', title: $this.text(), - 'data-error': $this.attr('data-error') + 'data-error': $this.attr( 'data-error' ) } ).click( errorPopup ); } ); // Reset transcode action: - $('.mw-filepage-transcodereset a').click( function(){ - var tKey = $(this).attr('data-transcodekey'); + $( '.mw-filepage-transcodereset a' ).click( function () { + var tKey = $( this ).attr( 'data-transcodekey' ); var buttons = {}; - buttons[ mw.msg('mwe-ok') ] = function(){ + buttons[ mw.msg( 'mwe-ok' ) ] = function () { var _thisDialog = this; // Only show cancel button while loading: var cancelBtn = {}; - cancelBtn[ mw.msg('mwe-cancel') ] = function() { - $(this).dialog(close); + cancelBtn[ mw.msg( 'mwe-cancel' ) ] = function () { + $(this).dialog( 'close' ); } - $( _thisDialog ).dialog( option, buttons, cancelBtn ); + $( _thisDialog ).dialog( 'option', 'buttons', cancelBtn ); $( this ).loadingSpinner(); - var apiUrl = mw.config.get('wgServer') + mw.config.get( 'wgScriptPath' ) + '/api.php'; + var apiUrl = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php'; // Do an api post action: $.post( apiUrl, { 'action' : 'transcodereset', @@ -58,7 +58,7 @@ 'title' : mw.config.get('wgPageName'), 'token' : mw.user.tokens.get('editToken'), 'format' : 'json' - }, function( data ){ + }, function ( data ) { if( data data['success'] ){ // refresh the page window.location.reload(); @@ -69,23 +69,23 @@ $( _thisDialog ).text( mw.msg( 'timedmedia-reset-error' ) ); } var okBtn = {}; - okBtn[ mw.msg('mwe-ok') ] = function() {
[MediaWiki-commits] [Gerrit] Make the private modules of TMH pass jshint - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173513 Change subject: Make the private modules of TMH pass jshint .. Make the private modules of TMH pass jshint Change-Id: I41cf1bf6a1a2406d2d4731492747bb9a6b8d9803 --- A .jshintignore A .jshintrc M resources/ext.tmh.transcodetable.js M resources/mw.MediaWikiPlayerSupport.js M resources/mw.PopUpThumbVideo.js M resources/mw.TMHGalleryHook.js 6 files changed, 161 insertions(+), 115 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/13/173513/1 diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 000..a56a7ef --- /dev/null +++ b/.jshintignore @@ -0,0 +1,2 @@ +node_modules + diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..ef9af3d --- /dev/null +++ b/.jshintrc @@ -0,0 +1,39 @@ +{ + /* 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 */ + + // Enforcing + bitwise: true, + es3: true, + // Relaxing + laxbreak: true, + smarttabs: true, + multistr: true, + // Environment + browser: true, + // Legacy + nomen: true, + + predef: [ + mediaWiki, + jQuery + ] +} diff --git a/resources/ext.tmh.transcodetable.js b/resources/ext.tmh.transcodetable.js index ed0e901..8539015 100644 --- a/resources/ext.tmh.transcodetable.js +++ b/resources/ext.tmh.transcodetable.js @@ -1,91 +1,95 @@ /** * Javascript to support transcode table on image page */ -$( document ).ready( function () { - var errorPopup, $errorLink; +( function ( mw, $ ) { + $( document ).ready( function () { + var errorPopup, $errorLink; - errorPopup = function () { - // pop up dialog - mw.addDialog( { - 'width': '640', - 'height': '480', - 'title': $(this).attr( 'title' ), - 'content': $('textarea /') - .css( { - 'width':'99%', - 'height':'99%' - } ) - .text( $(this).attr('data-error') ) - } ) - .css( 'overflow', 'hidden' ); - return false; - } - - // Old version. Need to keep for a little while in case of cached pages. - $( '.mw-filepage-transcodestatus .errorlink' ).click( errorPopup ); - // New version. - $errorLink = $( '.mw-filepage-transcodestatus .mw-tmh-pseudo-error-link' ); - $errorLink.wrapInner( function () { - var $this = $( this ); - return $( 'a /' ).attr( { - href: '#', - title: $this.text(), - 'data-error': $this.attr( 'data-error' ) - } ).click( errorPopup ); - } ); - - // Reset transcode action: - $( '.mw-filepage-transcodereset a' ).click( function () { - var tKey = $( this ).attr( 'data-transcodekey' ); - var buttons = {}; - buttons[ mw.msg( 'mwe-ok' ) ] = function () { - var _thisDialog = this; - - // Only show cancel button while loading: - var cancelBtn = {}; - cancelBtn[ mw.msg( 'mwe-cancel' ) ] = function () { - $(this).dialog( 'close' ); - } - $( _thisDialog ).dialog( 'option', 'buttons', cancelBtn ); - - $( this ).loadingSpinner(); - - var apiUrl = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php'; - // Do an api post action: - $.post( apiUrl, { - 'action' : 'transcodereset', - 'transcodekey' : tKey, - 'title' : mw.config.get('wgPageName'), - 'token' : mw.user.tokens.get('editToken'), - 'format' : 'json' - }, function ( data ) { - if( data data['success'] ){ - // refresh the page - window.location.reload(); - } else { - if( data.error data.error.info ){ -
[MediaWiki-commits] [Gerrit] Use postWithEditToken to make the reset transcode request - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173537 Change subject: Use postWithEditToken to make the reset transcode request .. Use postWithEditToken to make the reset transcode request Change-Id: Ie1aef55e40150a91ddd24fa3121de1a6e8a8a86e --- M TimedMediaHandler.hooks.php M resources/ext.tmh.transcodetable.js 2 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/37/173537/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 7ab2230..a403e05 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -72,6 +72,7 @@ 'ext.tmh.transcodetable' = $baseExtensionResource + array( 'scripts' = 'resources/ext.tmh.transcodetable.js', 'styles' = 'resources/transcodeTable.css', + 'dependencies' = 'mw.api.edit', 'messages'= array( 'mwe-ok', 'mwe-cancel', diff --git a/resources/ext.tmh.transcodetable.js b/resources/ext.tmh.transcodetable.js index ed0e901..346c78f 100644 --- a/resources/ext.tmh.transcodetable.js +++ b/resources/ext.tmh.transcodetable.js @@ -50,15 +50,12 @@ $( this ).loadingSpinner(); - var apiUrl = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php'; - // Do an api post action: - $.post( apiUrl, { + var api = new mw.Api(); + api.postWithEditToken( { 'action' : 'transcodereset', 'transcodekey' : tKey, - 'title' : mw.config.get('wgPageName'), - 'token' : mw.user.tokens.get('editToken'), - 'format' : 'json' - }, function ( data ) { + 'title' : mw.config.get('wgPageName') + } ).done( function ( data ) { if( data data['success'] ){ // refresh the page window.location.reload(); @@ -72,7 +69,7 @@ okBtn[ mw.msg('mwe-ok') ] = function() { $(this).dialog( 'close' ); } $( _thisDialog ).dialog( 'option', 'buttons', okBtn ); } - }) + } ); }; buttons[ mw.msg( 'mwe-cancel' ) ] = function () { $( this ).dialog( 'close' ); -- To view, visit https://gerrit.wikimedia.org/r/173537 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1aef55e40150a91ddd24fa3121de1a6e8a8a86e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix an undeclared and an incorrect RL dependency - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173538 Change subject: Fix an undeclared and an incorrect RL dependency .. Fix an undeclared and an incorrect RL dependency Change-Id: Ib2bad1f0c35a13b72bda538c5ceb849fb65853af --- M TimedMediaHandler.hooks.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/38/173538/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 7ab2230..2791182 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -72,6 +72,9 @@ 'ext.tmh.transcodetable' = $baseExtensionResource + array( 'scripts' = 'resources/ext.tmh.transcodetable.js', 'styles' = 'resources/transcodeTable.css', + 'dependencies' = array( + 'mw.MwEmbedSupport', + ), 'messages'= array( 'mwe-ok', 'mwe-cancel', @@ -82,7 +85,7 @@ ), mw.MediaWikiPlayerSupport = $baseExtensionResource + array( 'scripts' = 'resources/mw.MediaWikiPlayerSupport.js', - 'dependencies'= 'mw.Api', + 'dependencies'= 'mediawiki.api', ), // adds support MediaWikiPlayerSupport player bindings mw.MediaWikiPlayer.loader = $baseExtensionResource + array( -- To view, visit https://gerrit.wikimedia.org/r/173538 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2bad1f0c35a13b72bda538c5ceb849fb65853af Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Lua comment blocks and string blocks. - change (mediawiki...SyntaxHighlight_GeSHi)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/173104 Change subject: Fix Lua comment blocks and string blocks. .. Fix Lua comment blocks and string blocks. - Match comments non-greedily instead of greedily - Re-add support for block strings (similar to heredoc) Bug: 73281 Change-Id: Ib7f6eeb2df17434740fb85cee955d76762b56fe5 --- M geshi/geshi/lua.php 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi refs/changes/04/173104/1 diff --git a/geshi/geshi/lua.php b/geshi/geshi/lua.php index f82ce3c..493c4bf 100644 --- a/geshi/geshi/lua.php +++ b/geshi/geshi/lua.php @@ -46,7 +46,13 @@ 'LANG_NAME' = 'Lua', 'COMMENT_SINGLE' = array(1 = --), 'COMMENT_MULTI' = array(), -'COMMENT_REGEXP' = array(1 = '/--\[(=*)\[.*\]\1\]/s'), +'COMMENT_REGEXP' = array( +// Multiline comments +2 = '/--\[(=*)\[.*?\]\1\]/s', +// Multi line literal strings (should not interpret escape sequences) +// Here because no STRING_REGEXP +3 = '/(?!--)\[(=*)\[.*?\]\1\]/s', +), 'CASE_KEYWORDS' = GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' = array(', ''), 'ESCAPE_CHAR' = '', @@ -127,8 +133,9 @@ ), 'COMMENTS' = array( 1 = 'color: #808080; font-style: italic;', -//2 = 'color: #ff;', -'MULTI' = 'color: #808080; font-style: italic;' +2 = 'color: #808080; font-style: italic;', +// Actually a string +3 = 'color: #ff;', ), 'ESCAPE_CHAR' = array( 0 = 'color: #99; font-weight: bold;', -- To view, visit https://gerrit.wikimedia.org/r/173104 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7f6eeb2df17434740fb85cee955d76762b56fe5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Turn MwEmbed loaderscripts into modules - change (mediawiki...MwEmbedSupport)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/172556 Change subject: [WIP] Turn MwEmbed loaderscripts into modules .. [WIP] Turn MwEmbed loaderscripts into modules Change-Id: Ib3360fa9271b9452cec5e86281c2859f7e0f464e --- M MwEmbedResourceManager.php 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MwEmbedSupport refs/changes/56/172556/1 diff --git a/MwEmbedResourceManager.php b/MwEmbedResourceManager.php index 0eb83aa..5c9fe3b 100644 --- a/MwEmbedResourceManager.php +++ b/MwEmbedResourceManager.php @@ -58,8 +58,9 @@ // Check for module loader: if ( is_file( $localResourcePath . '/' . $moduleName . '.loader.js' ) ) { - $resourceList[$moduleName . '.loader'] = array( - 'loaderScripts' = $moduleName . '.loader.js' + $resourceList['mw.' . $moduleName . '.loader'] = array( + 'scripts' = $moduleName . '.loader.js', + 'position' = 'top', ); } -- To view, visit https://gerrit.wikimedia.org/r/172556 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3360fa9271b9452cec5e86281c2859f7e0f464e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MwEmbedSupport Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Preview: Add content clears after side-by-side preview - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/172318 Change subject: Preview: Add content clears after side-by-side preview .. Preview: Add content clears after side-by-side preview Change-Id: Ib6147e38aa98a5498300513da3557ce74af1252d --- M modules/jquery.wikiEditor.preview.js 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/18/172318/1 diff --git a/modules/jquery.wikiEditor.preview.js b/modules/jquery.wikiEditor.preview.js index f066522..04a3831 100644 --- a/modules/jquery.wikiEditor.preview.js +++ b/modules/jquery.wikiEditor.preview.js @@ -74,6 +74,7 @@ context.modules.preview.$preview.find( '.wikiEditor-preview-loading' ).hide(); context.modules.preview.$preview.find( '.wikiEditor-preview-contents' ) .html( data.parse.text['*'] ) + .append( 'div class=visualClear/div' ) .find( 'a:not([href^=#])' ) .click( false ); @@ -140,7 +141,9 @@ var diff = data.query.pages[data.query.pageids[0]] .revisions[0].diff['*']; - context.$changesTab.find( 'table.diff tbody' ).html( diff ); + context.$changesTab.find( 'table.diff tbody' ) + .html( diff ) + .append( 'div class=visualClear/div' ); context.modules.preview.changesText = wikitext; } catch ( e ) { // data.blah is undefined error, ignore -- To view, visit https://gerrit.wikimedia.org/r/172318 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6147e38aa98a5498300513da3557ce74af1252d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Improve live loading - change (mediawiki...TimedMediaHandler)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/172421 Change subject: [WIP] Improve live loading .. [WIP] Improve live loading Needs more work on the loader scripts. Bug: 72675 Change-Id: I2768861e387013dd4411e7d1093f0fff9c9b7b6b --- M MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js M TimedMediaHandler.hooks.php M TimedMediaHandler_body.php 3 files changed, 21 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/21/172421/1 diff --git a/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js b/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js index c9fd516..71f4475 100644 --- a/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js +++ b/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js @@ -5,7 +5,7 @@ /** * Add a DOM ready check for player tags */ - $( function() { + var embedPlayerInit = function( $content ) { var $selected = $( mw.config.get( 'EmbedPlayer.RewriteSelector' ) ); if ( $selected.length ) { var inx = 0; @@ -23,7 +23,8 @@ checkSetDone(); } - } ); + } + mw.hook( 'wikipage.content' ).add( embedPlayerInit ); /** * Add the mwEmbed jQuery loader wrapper @@ -66,4 +67,4 @@ } ); } ); }; -} )( window.mediaWiki, window.jQuery ); \ No newline at end of file +} )( window.mediaWiki, window.jQuery ); diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 7ab2230..f796158 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -101,9 +101,6 @@ // When image page is deleted so that we remove transcode settings / files. $wgHooks['FileDeleteComplete'][] = 'TimedMediaHandlerHooks::onFileDeleteComplete'; - // Add parser hook - $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. // (Special:Upload, for example, when there is an existing file warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; @@ -161,7 +158,11 @@ public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { $handler = $imagePage-getDisplayedFile()-getHandler(); if ( $handler !== false $handler instanceof TimedMediaHandler ) { - TimedMediaHandler::outputHook( $out, null, null ); + $out-addModules( array( + 'mw.EmbedPlayer', + 'mw.PopUpMediaTransform', + 'mw.TMHGalleryHook.js', + ) ); } return true; } diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php index 9bd172a..9bf9ef0 100644 --- a/TimedMediaHandler_body.php +++ b/TimedMediaHandler_body.php @@ -188,6 +188,13 @@ } /** +* Parser output hook only adds the PopUpMediaTransform +* +* The core embedPlayer module is part of a loaderScript so it does not need to +* be registered here. +* +* TODO move core loader to on-page script as to not include it on all pages. +* * @param $parser Parser * @param $file File */ @@ -197,26 +204,11 @@ return ; } $parserOutput-hasTimedMediaTransform = true; - $parserOutput-addOutputHook( 'TimedMediaHandler' ); - } - - /** -* Parser output hook only adds the PopUpMediaTransform -* -* The core embedPlayer module is part of a loaderScript so it does not need to -* be registered here. -* -* TODO move core loader to on-page script as to not include it on all pages. -* -* @param $outputPage OutputPage -* @param $parserOutput -* @param $data -*/ - static function outputHook( $outputPage, $parserOutput, $data ) { - // Add the PopUpMediaTransform code - $outputPage-addModuleScripts( 'mw.PopUpMediaTransform' ); - $outputPage-addModuleStyles( 'mw.PopUpMediaTransform' ); - $outputPage-addModules( 'mw.TMHGalleryHook.js' ); + $parserOutput-addModules( array( + 'mw.EmbedPlayer', + 'mw.PopUpMediaTransform', + 'mw.TMHGalleryHook.js', + ) ); } /** -- To view, visit https://gerrit.wikimedia.org/r/172421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
[MediaWiki-commits] [Gerrit] Parser: Add bdi to the whitelist for TOC links - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/170589 Change subject: Parser: Add bdi to the whitelist for TOC links .. Parser: Add bdi to the whitelist for TOC links Bug: 72884 Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5 --- M includes/parser/Parser.php 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/89/170589/1 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index fe0c81f..c3711c3 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4544,14 +4544,15 @@ # * sup and sub (bug 8393) # * i (bug 26375) # * b (r105284) + # * bdi (bug 72884) # * span dir=rtl and span dir=ltr (bug 35167) # # We strip any parameter from accepted tags (second regex), except dir=rtl|ltr from span, # to allow setting directionality in toc items. $tocline = preg_replace( array( - '#(?!/?(span|sup|sub|i|b)(?: [^]*)?).*?' . '#', - '#(/?(?:span(?: dir=(?:rtl|ltr))?|sup|sub|i|b))(?: .*?)?' . '#' + '#(?!/?(span|sup|sub|bdi|i|b)(?: [^]*)?).*?' . '#', + '#(/?(?:span(?: dir=(?:rtl|ltr))?|sup|sub|bdi|i|b))(?: .*?)?' . '#' ), array( '', '$1' ), $safeHeadline -- To view, visit https://gerrit.wikimedia.org/r/170589 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert Add SVG versions of toolbar icons - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/168821 Change subject: Revert Add SVG versions of toolbar icons .. Revert Add SVG versions of toolbar icons There were issues with shadows, and the sprite creating weird offsetted buttons on Chrome. Subsequent attempts have been incomplete at solving these, so reverting this and hoping that the next person to attempt a conversion to SVG is more successful. This reverts commit e027051c58a8e76b1d254fde8ed62421f3740f32. Bug: 35342 Change-Id: Id296899a2c3746957c17068ab17ca8266f6ff0d3 --- D modules/images/toolbar/button-sprite.svg D modules/images/toolbar/format-big.svg D modules/images/toolbar/format-bold-A.svg D modules/images/toolbar/format-bold-B.svg D modules/images/toolbar/format-bold-F.svg D modules/images/toolbar/format-bold-G.svg D modules/images/toolbar/format-bold-N.svg D modules/images/toolbar/format-bold-P.svg D modules/images/toolbar/format-bold-V.svg D modules/images/toolbar/format-bold.svg D modules/images/toolbar/format-indent.svg D modules/images/toolbar/format-italic-A.svg D modules/images/toolbar/format-italic-C.svg D modules/images/toolbar/format-italic-K.svg D modules/images/toolbar/format-italic-i.svg D modules/images/toolbar/format-italic.svg D modules/images/toolbar/format-olist.svg D modules/images/toolbar/format-small.svg D modules/images/toolbar/format-subscript.svg D modules/images/toolbar/format-superscript.svg D modules/images/toolbar/format-ulist.svg D modules/images/toolbar/insert-file.svg D modules/images/toolbar/insert-gallery.svg D modules/images/toolbar/insert-ilink.svg D modules/images/toolbar/insert-link.svg D modules/images/toolbar/insert-newline.svg D modules/images/toolbar/insert-nowiki.svg D modules/images/toolbar/insert-redirect.svg D modules/images/toolbar/insert-reference.svg D modules/images/toolbar/insert-signature.svg D modules/images/toolbar/insert-table.svg D modules/images/toolbar/insert-xlink.svg D modules/images/toolbar/search-replace.svg M modules/jquery.wikiEditor.toolbar.css 34 files changed, 1 insertion(+), 7,798 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/21/168821/1 -- To view, visit https://gerrit.wikimedia.org/r/168821 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id296899a2c3746957c17068ab17ca8266f6ff0d3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Drafts: this time using indexeddb - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/159626 Change subject: Drafts: this time using indexeddb .. Drafts: this time using indexeddb Advantadges: - doesn't fill up storage - fully async Disadvantadge: - requires WebSQL based shim in order to support Safari and older IE. Other changes - Does 30 day expiry - No longer a max # of drafts - Seperate module - Added a preference for this Could also easily add a Special:Drafts page to manage these. Wondering if this thing should be renamed from drafts to 'backups' or something. Change-Id: I0ea580e4acc6ed539f4314ab3f5378f95a451c1c --- M includes/DefaultSettings.php M includes/EditPage.php M includes/Preferences.php M languages/i18n/en.json M resources/Resources.php A resources/src/mediawiki.action/mediawiki.action.edit.drafts.js M resources/src/mediawiki.action/mediawiki.action.edit.js 7 files changed, 192 insertions(+), 195 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/26/159626/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 26ce83c..1ce75fd 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4283,6 +4283,7 @@ 'wllimit' = 250, 'useeditwarning' = 1, 'prefershttps' = 1, + 'localdrafts' = 1, ); /** diff --git a/includes/EditPage.php b/includes/EditPage.php index a14191a..8c55dcb 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2066,6 +2066,10 @@ $wgOut-addModules( 'mediawiki.action.edit.editWarning' ); } + if ( $wgUser-getOption( 'localdrafts', false ) ) { + $wgOut-addModules( 'mediawiki.action.edit.drafts' ); + } + $wgOut-setRobotPolicy( 'noindex,nofollow' ); # Enabled article-related sidebar, toplinks, etc. diff --git a/includes/Preferences.php b/includes/Preferences.php index eb29e41..20adb40 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -834,6 +834,11 @@ 'section' = 'editing/editor', 'label-message' = 'tog-useeditwarning', ); + $defaultPreferences['localdrafts'] = array( + 'type' = 'toggle', + 'section' = 'editing/editor', + 'label-message' = 'tog-localdrafts', + ); $defaultPreferences['showtoolbar'] = array( 'type' = 'toggle', 'section' = 'editing/editor', diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 196b491..9ced786 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -42,6 +42,7 @@ tog-norollbackdiff: Omit diff after performing a rollback, tog-useeditwarning: Warn me when I leave an edit page with unsaved changes, tog-prefershttps: Always use a secure connection when logged in, + tog-localdrafts: Back-up unsaved changes using drafts on your computer, underline-always: Always, underline-never: Never, underline-default: Skin or browser default, diff --git a/resources/Resources.php b/resources/Resources.php index 7a3a011..b566216 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -991,19 +991,25 @@ 'mediawiki.action.edit.styles', 'jquery.textSelection', 'jquery.byteLimit', - 'mediawiki.notification', - 'jquery.throttle-debounce', ), 'position' = 'top', + ), + 'mediawiki.action.edit.styles' = array( + 'styles' = 'resources/src/mediawiki.action/mediawiki.action.edit.styles.css', + 'position' = 'top', + ), + 'mediawiki.action.edit.drafts' = array( + 'scripts' = 'resources/src/mediawiki.action/mediawiki.action.edit.drafts.js', + 'dependencies' = array( + 'mediawiki.notification', + 'jquery.throttle-debounce', + 'jquery.indexeddb', + ), 'messages' = array( 'textarea-draft-found', 'textarea-use-draft', 'textarea-use-current-version', ), - ), - 'mediawiki.action.edit.styles' = array( - 'styles' = 'resources/src/mediawiki.action/mediawiki.action.edit.styles.css', - 'position' = 'top', ), 'mediawiki.action.edit.collapsibleFooter' = array( 'scripts' = 'resources/src/mediawiki.action/mediawiki.action.edit.collapsibleFooter.js', diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.drafts.js
[MediaWiki-commits] [Gerrit] Flickr: The community does not consider UW uploads verified - change (mediawiki...UploadWizard)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158887 Change subject: Flickr: The community does not consider UW uploads verified .. Flickr: The community does not consider UW uploads verified Since JS can be manipulated, that means that Flickr verified status can easily be manipulated during upload. I have therefore created a new template commons:Template:FlickrByUploadWizard so that manual or Bot reviewers can verify. Change-Id: I4f64bdcffdc1aaa02aeebeead82097e51b82 --- M resources/mw.FlickrChecker.js 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/87/158887/1 diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js index e7a162b..e8a485a 100644 --- a/resources/mw.FlickrChecker.js +++ b/resources/mw.FlickrChecker.js @@ -33,14 +33,14 @@ // Live list at http://api.flickr.com/services/rest/?method=flickr.photos.licenses.getInfoapi_key=... licenseMaps: { 'All Rights Reserved': 'invalid', - 'Attribution License': '{{FlickrVerifiedByUploadWizard|cc-by-2.0}}{{cc-by-2.0}}', + 'Attribution License': '{{FlickrByUploadWizard|cc-by-2.0}}{{cc-by-2.0}}', 'Attribution-NoDerivs License': 'invalid', 'Attribution-NonCommercial-NoDerivs License': 'invalid', 'Attribution-NonCommercial License': 'invalid', 'Attribution-NonCommercial-ShareAlike License': 'invalid', - 'Attribution-ShareAlike License': '{{FlickrVerifiedByUploadWizard|cc-by-sa-2.0}}{{cc-by-sa-2.0}}', - 'No known copyright restrictions': '{{FlickrVerifiedByUploadWizard|Flickr-no known copyright restrictions}}{{Flickr-no known copyright restrictions}}', - 'United States Government Work': '{{FlickrVerifiedByUploadWizard|PD-USGov}}{{PD-USGov}}' + 'Attribution-ShareAlike License': '{{FlickrByUploadWizard|cc-by-sa-2.0}}{{cc-by-sa-2.0}}', + 'No known copyright restrictions': '{{FlickrByUploadWizard|Flickr-no known copyright restrictions}}{{Flickr-no known copyright restrictions}}', + 'United States Government Work': '{{FlickrByUploadWizard|PD-USGov}}{{PD-USGov}}' }, /** -- To view, visit https://gerrit.wikimedia.org/r/158887 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f64bdcffdc1aaa02aeebeead82097e51b82 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Feedback: Use a proper URL for the feedback page link - change (mediawiki...UploadWizard)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158896 Change subject: Feedback: Use a proper URL for the feedback page link .. Feedback: Use a proper URL for the feedback page link Change-Id: I14ad651f351dee226f749b21cce4893b2182f0b1 --- M resources/ui/uw.ui.Wizard.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/96/158896/1 diff --git a/resources/ui/uw.ui.Wizard.js b/resources/ui/uw.ui.Wizard.js index a288e33..41e4dfa 100644 --- a/resources/ui/uw.ui.Wizard.js +++ b/resources/ui/uw.ui.Wizard.js @@ -92,7 +92,7 @@ // Make it a link, and show the feedback page URL - we // cancel the event propagation anyway, so the user won't // see the actual page. - .prop( 'href', feedbackPage ) + .prop( 'href', mw.util.getUrl( feedbackPage ) ) .msg( 'mwe-upwiz-feedback-prompt' ) .click( function() { -- To view, visit https://gerrit.wikimedia.org/r/158896 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14ad651f351dee226f749b21cce4893b2182f0b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace deprecated wikiGetLink with mw.util.getUrl - change (mediawiki...WikiLove)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158656 Change subject: Replace deprecated wikiGetLink with mw.util.getUrl .. Replace deprecated wikiGetLink with mw.util.getUrl Change-Id: I55f747035bee75a8d5398d4aebde8ea7ddcc29cc --- M resources/ext.wikiLove.core.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/56/158656/1 diff --git a/resources/ext.wikiLove.core.js b/resources/ext.wikiLove.core.js index 229d2ac..77c2a16 100644 --- a/resources/ext.wikiLove.core.js +++ b/resources/ext.wikiLove.core.js @@ -719,7 +719,7 @@ if ( data.redirect !== undefined ) { wikiLoveNumberPosted++; if ( redirect ) { - var targetBaseUrl = mw.util.wikiGetlink( data.redirect.pageName ), + var targetBaseUrl = mw.util.getUrl( data.redirect.pageName ), // currentBaseUrl is the current URL minus the hash fragment currentBaseUrl = window.location.href.split(#)[0]; -- To view, visit https://gerrit.wikimedia.org/r/158656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55f747035bee75a8d5398d4aebde8ea7ddcc29cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLove Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rewrite to use mediawiki.api - change (mediawiki...WikiLove)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158664 Change subject: Rewrite to use mediawiki.api .. Rewrite to use mediawiki.api mediawiki.ap has edittoken retry, seems useful here. Change-Id: I4d611bb82d85891ebf1cc67e20552596eeda327d --- M WikiLove.php M resources/ext.wikiLove.core.js 2 files changed, 57 insertions(+), 93 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/64/158664/1 diff --git a/WikiLove.php b/WikiLove.php index 0d239e6..4f5fd95 100644 --- a/WikiLove.php +++ b/WikiLove.php @@ -279,6 +279,7 @@ 'wikilove-success-number', ), 'dependencies' = array( + 'mediawiki.api.edit', 'ext.wikiLove.defaultOptions', 'jquery.ui.dialog', 'mediawiki.ui.button', diff --git a/resources/ext.wikiLove.core.js b/resources/ext.wikiLove.core.js index 77c2a16..9b45737 100644 --- a/resources/ext.wikiLove.core.js +++ b/resources/ext.wikiLove.core.js @@ -11,7 +11,8 @@ redirect = true, // whether or not to redirect the user to the WikiLove message after it has been posted targets = [], // the recipients of the WikiLove maxRecipients = 10, // maximum number of simultaneous recipients - gallery = {}; + gallery = {}, + api = new mw.Api(); $.wikiLove = { /** @@ -314,20 +315,15 @@ $( '#mw-wikilove-image-preview-spinner' ).fadeIn( 200 ); var title = $.wikiLove.normalizeFilename( currentTypeOrSubtype.image ); var loadingType = currentTypeOrSubtype; - $.ajax({ - url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?', - data: { - 'action' : 'query', - 'format' : 'json', - 'prop': 'imageinfo', - 'iiprop' : 'mime|url', - 'titles' : title, - 'iiurlwidth' : 75, - 'iiurlheight' : 68 - }, - dataType: 'json', - type: 'POST', - success: function( data ) { + api.post( { + 'action' : 'query', + 'prop': 'imageinfo', + 'iiprop' : 'mime|url', + 'titles' : title, + 'iiurlwidth' : 75, + 'iiurlheight' : 68 + } ) + .done( function( data ) { if ( !data || !data.query || !data.query.pages ) { $( '#mw-wikilove-image-preview-spinner' ).fadeOut( 200 ); return; @@ -348,11 +344,10 @@ $( '#mw-wikilove-image-preview-content' ).append( $img ); } }); - }, - error: function() { + } ) + .fail( function() { $( '#mw-wikilove-image-preview-spinner' ).fadeOut( 200 ); - } - }); + } ); }, /** @@ -464,16 +459,12 @@ var imageTitle = $.wikiLove.normalizeFilename( $( '#mw-wikilove-image' ).val() ); $( '#mw-wikilove-preview-spinner' ).fadeIn( 200 ); - $.ajax( { - url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?', - data: { - 'action': 'query', - 'format': 'json', - 'titles': imageTitle, - 'prop': 'imageinfo' - }, - dataType: 'json', - success: function( data ) { + api.get( { + 'action': 'query', + 'titles': imageTitle, + 'prop': 'imageinfo' + } ) + .done( function( data ) {
[MediaWiki-commits] [Gerrit] Pass jshint - change (mediawiki...WikiLove)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158774 Change subject: Pass jshint .. Pass jshint Change-Id: I0278575038308f8cee03096a14253b9987bba727 --- A .jshintrc M resources/ext.wikiLove.core.js M resources/ext.wikiLove.defaultOptions.js M resources/ext.wikiLove.init.js 4 files changed, 47 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/74/158774/1 diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..eb031c3 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,26 @@ +{ +/* 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, +multistr: true, + +jquery: true, +browser: true, + +predef: [ + mediaWiki +] +} diff --git a/resources/ext.wikiLove.core.js b/resources/ext.wikiLove.core.js index 9b45737..e00d972 100644 --- a/resources/ext.wikiLove.core.js +++ b/resources/ext.wikiLove.core.js @@ -1,5 +1,5 @@ -/*global window:false */ -( function( $ ) { +/*global window:false, alert:false */ +( function( $, mw ) { varoptions = {}, // options modifiable by the user $dialog = null, // dialog jQuery object @@ -48,8 +48,8 @@ var $button = $( 'a href=# class=/a' ); if ( typeof type.icon === 'string' ) { - $button.append( 'img src=' - + mw.html.escape( type.icon ) + '/' ); + $button.append( 'img src=' + + mw.html.escape( type.icon ) + '/' ); } else { $button.addClass( 'mw-wikilove-no-icon' ); } @@ -392,8 +392,8 @@ // set the new text for the image textbox $( '#mw-wikilove-image' ).val( currentRememberData.image || currentTypeOrSubtype.image || '' ); - if( typeof currentTypeOrSubtype.gallery === 'object' -$.isArray( currentTypeOrSubtype.gallery.imageList ) + if( typeof currentTypeOrSubtype.gallery === 'object' + $.isArray( currentTypeOrSubtype.gallery.imageList ) ) { $( '#mw-wikilove-gallery, #mw-wikilove-gallery-label' ).show(); $.wikiLove.showGallery(); // build gallery from array of images @@ -500,7 +500,7 @@ */ submitPreview: function() { var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ); - $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + ==\n + text ); + $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + '==\n' + text ); }, showAddDetailsError: function( errmsg ) { @@ -547,7 +547,7 @@ */ normalizeFilename: function( filename ) { // If a URL is given, extract and decode the filename - var index = filename.lastIndexOf( / ) + 1; + var index = filename.lastIndexOf( '/' ) + 1; filename = filename.substr( index ); if ( index 0 ) { filename = decodeURI( filename ); @@ -639,8 +639,7 @@ 'header': $( '#mw-wikilove-header' ).val(), 'text': $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ), 'message': $( '#mw-wikilove-message' ).val(), - 'type': currentTypeId - + (currentSubtypeId !== null ? '-' + currentSubtypeId : '') + 'type': currentTypeId + (currentSubtypeId !== null ? '-' + currentSubtypeId : '') }; if ( $( '#mw-wikilove-notify-checkbox:checked' ).val() emailable ) { submitData.email = $.wikiLove.prepareMsg( currentTypeOrSubtype.email ); @@ -691,7 +690,7 @@ if ( redirect ) { var targetBaseUrl = mw.util.getUrl( data.redirect.pageName ), // currentBaseUrl is the current URL minus the hash fragment - currentBaseUrl = window.location.href.split(#)[0]; + currentBaseUrl = window.location.href.split('#')[0]; // Set window location to
[MediaWiki-commits] [Gerrit] wikilove passes jshint after I0278575 - change (integration/zuul-config)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158777 Change subject: wikilove passes jshint after I0278575 .. wikilove passes jshint after I0278575 Bug: 61645 Change-Id: I4cc662646f4a46bde6999a44653bc86c6db42c71 --- M layout.yaml 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/zuul-config refs/changes/77/158777/1 diff --git a/layout.yaml b/layout.yaml index dedb451..311b72d 100644 --- a/layout.yaml +++ b/layout.yaml @@ -508,8 +508,6 @@ voting: false - name: mwext-WebFonts-jslint # bug 61644 voting: false - - name: mwext-WikiLove-jslint # bug 61645 -voting: false - name: mwext-WikiObjectModel-jslint # bug 66193 abandoned? voting: false - name: mwext-Wikidata-jslint -- To view, visit https://gerrit.wikimedia.org/r/158777 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cc662646f4a46bde6999a44653bc86c6db42c71 Gerrit-PatchSet: 1 Gerrit-Project: integration/zuul-config Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set $wasPosted = true for recursive API access - change (mediawiki...WikiLove)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158785 Change subject: Set $wasPosted = true for recursive API access .. Set $wasPosted = true for recursive API access Having an API module instantiate a new ApiMain rather than doing things directly is usually the wrong thing to do. But if you're going to do it, you'll need to set $wasPosted on your DerivativeRequest. Bug: 70448 Change-Id: Ic48ce53f19b1d849c5b51e1f3a190638e246e8ec (cherry picked from commit 1be581df4728dc5f2310522bda06d3712c7b93af) --- M ApiWikiLove.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/85/158785/1 diff --git a/ApiWikiLove.php b/ApiWikiLove.php index 7878a9d..020c62e 100644 --- a/ApiWikiLove.php +++ b/ApiWikiLove.php @@ -54,7 +54,7 @@ new DerivativeRequest( $this-getRequest(), $apiParamArray, - false // was posted? + true // was posted? ), true // enable write? ); -- To view, visit https://gerrit.wikimedia.org/r/158785 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic48ce53f19b1d849c5b51e1f3a190638e246e8ec Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLove Gerrit-Branch: wmf/1.24wmf20 Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Anomie bjor...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set $wasPosted = true for recursive API access - change (mediawiki...WikiLove)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158786 Change subject: Set $wasPosted = true for recursive API access .. Set $wasPosted = true for recursive API access Having an API module instantiate a new ApiMain rather than doing things directly is usually the wrong thing to do. But if you're going to do it, you'll need to set $wasPosted on your DerivativeRequest. Bug: 70448 Change-Id: Ic48ce53f19b1d849c5b51e1f3a190638e246e8ec (cherry picked from commit 1be581df4728dc5f2310522bda06d3712c7b93af) --- M ApiWikiLove.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/86/158786/1 diff --git a/ApiWikiLove.php b/ApiWikiLove.php index 6888121..2bb7052 100644 --- a/ApiWikiLove.php +++ b/ApiWikiLove.php @@ -54,7 +54,7 @@ new DerivativeRequest( $this-getRequest(), $apiParamArray, - false // was posted? + true // was posted? ), true // enable write? ); -- To view, visit https://gerrit.wikimedia.org/r/158786 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic48ce53f19b1d849c5b51e1f3a190638e246e8ec Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLove Gerrit-Branch: wmf/1.24wmf19 Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Anomie bjor...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [Do not merge] HTML5: Use header element to wrap our headi... - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/158087 Change subject: [Do not merge] HTML5: Use header element to wrap our headings. .. [Do not merge] HTML5: Use header element to wrap our headings. I've some gripes about our headings currently wrapping the edit section element. It's bad for screenreaders, they show up in google etc.. This is an experiment to wrap them in the HTML5 element header. - fix the attributes (merge) on the heading element - Figure out how to do this without killing cache - Add section around the h2 content blocks. Not sure if i'll pick this up later, but wanted to have it in Gerrit at least. Related are bug 6104, bug 61615 and a few more Bug: 11555 Change-Id: I5350fecafc6a564842e839cc8b41eaa9b782a463 --- M includes/Linker.php M skins/common/commonElements.css 2 files changed, 31 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/87/158087/1 diff --git a/includes/Linker.php b/includes/Linker.php index f0b16ab..3f8266d 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1739,10 +1739,10 @@ public static function makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor = false ) { - $ret = h$level$attribs - . span class=\mw-headline\ id=\$anchor\$html/span - . $link - . /h$level; + $ret = header class=\mw-h$level\ id=\$anchor\$attribs + . h$level class=\mw-headline\$html/h$level + . . $link + . /header; if ( $legacyAnchor !== false ) { $ret = div id=\$legacyAnchor\/div$ret; } diff --git a/skins/common/commonElements.css b/skins/common/commonElements.css index 392a2a6..2e11dad 100644 --- a/skins/common/commonElements.css +++ b/skins/common/commonElements.css @@ -79,63 +79,67 @@ } /* Structural Elements */ +header { + border-bottom: 1px solid #aaa; + overflow: hidden; + color: black; + background: none; + font-weight: normal; + margin: 0; + padding-top: .5em; + padding-bottom: .17em; +} + h1, h2, h3, h4, h5, h6 { - color: black; - background: none; - font-weight: normal; - margin: 0; - overflow: hidden; - padding-top: .5em; - padding-bottom: .17em; - border-bottom: 1px solid #aaa; + display: inline; } -h1 { +header.mw-h1 { font-size: 188%; } -h2 { +header.mw-h2 { font-size: 150%; } -h3, -h4, -h5, -h6 { +header.mw-h3, +header.mw-h4, +header.mw-h5, +header.mw-h6 { border-bottom: none; font-weight: bold; } -h3 { +header.mw-h3 { font-size: 132%; } -h4 { +header.mw-h4 { font-size: 116%; } -h5 { +header.mw-h5 { font-size: 108%; } -h6 { +header.mw-h6 { font-size: 100%; } /* Some space under the headers in the content area */ -h1, -h2 { +header.mw-h1, +header.mw-h2 { margin-bottom: .6em; } -h3, -h4, -h5 { +header.mw-h3, +header.mw-h4, +header.mw-h5 { margin-bottom: .3em; } -- To view, visit https://gerrit.wikimedia.org/r/158087 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5350fecafc6a564842e839cc8b41eaa9b782a463 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a jQuery promise lib around indexedDB - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/157818 Change subject: Add a jQuery promise lib around indexedDB .. Add a jQuery promise lib around indexedDB Added ed5507cd49ee93fbdec449341306b81507db8f41 of https://github.com/axemclion/jquery-indexeddb Will use this to improve change: I38372e4ae38 Change-Id: I9b5ccc018ad19ae3abcc95e879e9c4a467533d71 --- M resources/Resources.php A resources/lib/jquery/jquery.indexeddb.js 2 files changed, 548 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/18/157818/1 diff --git a/resources/Resources.php b/resources/Resources.php index 3073152..827ef21 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -249,6 +249,9 @@ 'jquery.hoverIntent' = array( 'scripts' = 'resources/lib/jquery/jquery.hoverIntent.js', ), + 'jquery.indexeddb' = array( + 'scripts' = 'resources/lib/jquery/jquery.indexeddb.js', + }, 'jquery.json' = array( // @deprecated since 1.24: Use the 'json' module and global JSON object instead. 'scripts' = array( diff --git a/resources/lib/jquery/jquery.indexeddb.js b/resources/lib/jquery/jquery.indexeddb.js new file mode 100644 index 000..0001ed6 --- /dev/null +++ b/resources/lib/jquery/jquery.indexeddb.js @@ -0,0 +1,545 @@ +/* + * Copyright 2012 Parashuram N and other contributors + * http://nparashuram.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * Software), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +(function($, undefined) { + 'use strict'; + var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; + var IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange; + var IDBCursor = window.IDBCursor || window.webkitIDBCursor || {}; + if (typeof IDBCursor.PREV === undefined) { +IDBCursor.PREV = prev; +} + if (typeof IDBCursor.NEXT === undefined) { +IDBCursor.NEXT = next; +} + + /** +* Best to use the constant IDBTransaction since older version support numeric types while the latest spec +* supports strings +*/ + var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction; + + function getDefaultTransaction(mode) { + var result = null; + switch (mode) { + case 0: + case 1: + case readwrite: + case readonly: + result = mode; + break; + default: + result = IDBTransaction.READ_WRITE || readwrite; + } + return result; + } + + $.extend({ + /** +* The IndexedDB object used to open databases +* @param {Object} dbName - name of the database +* @param {Object} config - version, onupgradeneeded, onversionchange, schema +*/ + indexedDB: function(dbName, config) { + if (config) { + // Parse the config argument + if (typeof config === number) config = { + version: config + }; + + var version = config.version; + if (config.schema !version) { + var max = -1; + for (var key in config.schema) { + max = max key ? max : key; + } + version = config.version || max; + } +
[MediaWiki-commits] [Gerrit] Categories: Don't suggest empty or old categories - change (mediawiki...VisualEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/156250 Change subject: Categories: Don't suggest empty or old categories .. Categories: Don't suggest empty or old categories The categories table holds all categories that exist OR have at one point existed. This means it also contains a lot of vandalism and other inappropriate names that happily come up in the suggestions. This is undesirable. This changes the query to only list categories with at least 1 entry. Though technically it can be argued that an empty category with an existing page might 'exist' and should thus be listed, with this change they won't be. I don't think that is terribly incorrect to say that such would be a 'new category', but we could also consider renaming the label in the suggestion list to say: 'Currently unused category' or something similar. As far as I can tell there is no way to test for page existance OR generate a list based on allcategories with one API query. Bug: 70025 Change-Id: I0e195d3ce26e69d4710d6a505b9da7d1b7678d92 --- M modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/50/156250/1 diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js index e6c911a..4649695 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js @@ -57,6 +57,7 @@ return ve.init.target.constructor.static.apiRequest( { action: 'query', list: 'allcategories', + acmin: 1, acprefix: this.value, acprop: 'hidden', redirects: '' -- To view, visit https://gerrit.wikimedia.org/r/156250 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e195d3ce26e69d4710d6a505b9da7d1b7678d92 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TemplateParser: Fix whitespace trim - change (mediawiki...CommonsMetadata)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/155901 Change subject: TemplateParser: Fix whitespace trim .. TemplateParser: Fix whitespace trim Bug: 57458 Change-Id: Id916ec3070ef49ea7b2e4d602805596593adcca4 --- M TemplateParser.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommonsMetadata refs/changes/01/155901/1 diff --git a/TemplateParser.php b/TemplateParser.php index 5f70dac..5e0c6c0 100755 --- a/TemplateParser.php +++ b/TemplateParser.php @@ -61,7 +61,7 @@ * @var array */ protected static $cleanupPatterns = array( - '/^\s+(.*)\s+$/' = '\1', // trim whitespace + '/^\s+|\s+$/' = '', // trim leading or trailing whitespace '/^p(.*)\/p$/' = '\1', // clean paragraph with no styling - usually generated by MediaWiki ); -- To view, visit https://gerrit.wikimedia.org/r/155901 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id916ec3070ef49ea7b2e4d602805596593adcca4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CommonsMetadata Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Compactlinks: Use an actual button to build a button - change (mediawiki...UniversalLanguageSelector)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/154041 Change subject: Compactlinks: Use an actual button to build a button .. Compactlinks: Use an actual button to build a button Change-Id: Id9c72975df7b3dc9a38aca2a9d6165275bb39731 --- M resources/js/ext.uls.compactlinks.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/41/154041/1 diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index bebaf14..871f076 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -285,7 +285,7 @@ addTrigger: function () { var $trigger, $triggerLabel; - $trigger = $( 'div' ) + $trigger = $( 'button' ) .addClass( 'mw-interlanguage-selector mw-ui-button active' ) .html( '#8230' ); // 'âŠ' -- To view, visit https://gerrit.wikimedia.org/r/154041 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9c72975df7b3dc9a38aca2a9d6165275bb39731 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Dialogs: Reset values of file insertion dialog properly - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/154123 Change subject: Dialogs: Reset values of file insertion dialog properly .. Dialogs: Reset values of file insertion dialog properly Bug: 67111 Change-Id: I63a5cac9108cf9e6966964347407cc63fc0fb9b5 --- M modules/jquery.wikiEditor.dialogs.config.js 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/23/154123/1 diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 3ec2641..bcb1ea9 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -799,7 +799,8 @@ 'wikieditor-toolbar-tool-file-insert': function () { var fileName, caption, fileFloat, fileFormat, fileSize, fileTitle, options, fileUse, - hasPxRgx = /.+px$/; + hasPxRgx = /.+px$/, + magicWordsI18N = mw.config.get( 'wgWikiEditorMagicWords' ); fileName = $( '#wikieditor-toolbar-file-target' ).val(); caption = $( '#wikieditor-toolbar-file-caption' ).val(); fileFloat = $( '#wikieditor-toolbar-file-float' ).val(); @@ -844,10 +845,10 @@ // Restore form state $( ['#wikieditor-toolbar-file-target', '#wikieditor-toolbar-file-caption', - '#wikieditor-toolbar-file-size', - '#wikieditor-toolbar-file-float', - '#wikieditor-toolbar-file-format'].join( ',' ) + '#wikieditor-toolbar-file-size'].join( ',' ) ).val( '' ); + $( '#wikieditor-toolbar-file-float' ).val( 'default' ); + $( '#wikieditor-toolbar-file-format' ).val( magicWordsI18N['img_thumbnail'] ); }, 'wikieditor-toolbar-tool-file-cancel': function () { $( this ).dialog( 'close' ); -- To view, visit https://gerrit.wikimedia.org/r/154123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63a5cac9108cf9e6966964347407cc63fc0fb9b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Undefined function mw.log.error - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/154128 Change subject: Undefined function mw.log.error .. Undefined function mw.log.error Bug: 68557 Change-Id: Ib9e8b291711f3d582ab70cab25ace6f61500f5af --- M modules/jquery.codeEditor.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/28/154128/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index c7f46df..40fe8b9 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -152,7 +152,7 @@ optionname: 'usecodeeditor', optionvalue: prefValue ? 1 : 0 } ).fail( function ( code, result ) { - mw.log.error( 'Failed to set code editor preference: ' + code + '\n' + result.error ); + mw.log.warn( 'Failed to set code editor preference: ' + code + '\n' + result.error ); } ); }, /** -- To view, visit https://gerrit.wikimedia.org/r/154128 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9e8b291711f3d582ab70cab25ace6f61500f5af Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.tablesorter: Only look at th's for headers - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/152225 Change subject: jquery.tablesorter: Only look at th's for headers .. jquery.tablesorter: Only look at th's for headers If there would be td cells inside the thead, then these would be counted too for longest header row. This was not possible in wikitext, but was possible in MediaWiki tables. And $.unique sets fields to undefined instead of deleting them, which causes a nasty tough to spot counting mistake (which was even known due to a testcase having a comment confirming that the count was off) Bug: 53527 Change-Id: Ie551cd62275dd80560643131d68435166732d367 --- M resources/src/jquery/jquery.tablesorter.js M tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js 2 files changed, 25 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/25/152225/1 diff --git a/resources/src/jquery/jquery.tablesorter.js b/resources/src/jquery/jquery.tablesorter.js index 5b1e2a7..5483d6c 100644 --- a/resources/src/jquery/jquery.tablesorter.js +++ b/resources/src/jquery/jquery.tablesorter.js @@ -331,14 +331,14 @@ } ); // We want to find the row that has the most columns (ignoring colspan) $.each( exploded, function ( index, cellArray ) { - headerCount = $.unique( $( cellArray ) ).length; + headerCount = $( uniqueElements( cellArray) ).filter( 'th' ).length; if ( headerCount = maxSeen ) { maxSeen = headerCount; longestTR = index; } } ); // We cannot use $.unique() here because it sorts into dom order, which is undesirable - $tableHeaders = $( uniqueElements( exploded[longestTR] ) ); + $tableHeaders = $( uniqueElements( exploded[longestTR] ) ).filter( 'th' ); } // as each header can span over multiple columns (using colspan=N), diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js index 2fd3ce9..98c5a6e 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js @@ -1161,11 +1161,32 @@ ); $table.tablesorter(); assert.equal( $table.find( '#A2' ).prop( 'headerIndex' ), - 0, + undefined, 'A2 should not be a sort header' ); assert.equal( $table.find( '#C1' ).prop( 'headerIndex' ), - 1, + 2, + 'C1 should be a sort header, but will sort the wrong column' + ); + } ); + + // bug 53527 + QUnit.test( 'td cells in thead should not be taken into account for longest row calculation', 2, function ( assert ) { + var $table = $( + 'table class=sortable' + + 'thead' + + 'trth id=A1A1/ththB1/thtd id=C1C1/td/tr' + + 'trth id=A2A2/ththB2/thth id=C2C2/th/tr' + + '/thead' + + '/table' + ); + $table.tablesorter(); + assert.equal( $table.find( '#C2' ).prop( 'headerIndex' ), + 2, + 'C2 should be a sort header' + ); + assert.equal( $table.find( '#C1' ).prop( 'headerIndex' ), + undefined, 'C1 should be a sort header, but will sort the wrong column' ); } ); -- To view, visit https://gerrit.wikimedia.org/r/152225 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie551cd62275dd80560643131d68435166732d367 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.tablesorter: Limit the scope of two variables - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/152774 Change subject: jquery.tablesorter: Limit the scope of two variables .. jquery.tablesorter: Limit the scope of two variables No functional change, but improves readability of the code Change-Id: If858d198c9ca0e2feb4930f9f94425262f8afbdc --- M resources/src/jquery/jquery.tablesorter.js 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/74/152774/1 diff --git a/resources/src/jquery/jquery.tablesorter.js b/resources/src/jquery/jquery.tablesorter.js index 5b1e2a7..b46ab37 100644 --- a/resources/src/jquery/jquery.tablesorter.js +++ b/resources/src/jquery/jquery.tablesorter.js @@ -296,8 +296,6 @@ colspan, headerCount, longestTR, - matrixRowIndex, - matrixColumnIndex, exploded, $tableHeaders = $( [] ), $tableRows = $( 'thead:eq(0) tr', table ); @@ -309,6 +307,9 @@ // Loop through all the dom cells of the thead $tableRows.each( function ( rowIndex, row ) { $.each( row.cells, function ( columnIndex, cell ) { + var matrixRowIndex, + matrixColumnIndex; + rowspan = Number( cell.rowSpan ); colspan = Number( cell.colSpan ); -- To view, visit https://gerrit.wikimedia.org/r/152774 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If858d198c9ca0e2feb4930f9f94425262f8afbdc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] QUnit: fix swapped expected/actual fields - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/152121 Change subject: QUnit: fix swapped expected/actual fields .. QUnit: fix swapped expected/actual fields Change-Id: I55db7e3ef4e155fb9e1152cbf777189d04eec951 --- M tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/152121/1 diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js index 9216ac9..6d84a37 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js @@ -1160,12 +1160,12 @@ '/table' ); $table.tablesorter(); - assert.equal( 0, - $table.find( '#A2' ).prop( 'headerIndex' ), - 'A2 should be a sort header' + assert.equal( $table.find( '#A2' ).prop( 'headerIndex' ), + undefined, + 'A2 should not be a sort header' ); - assert.equal( 1, // should be 2 - $table.find( '#C1' ).prop( 'headerIndex' ), + assert.equal( $table.find( '#C1' ).prop( 'headerIndex' ), + 2, 'C1 should be a sort header, but will sort the wrong column' ); } ); @@ -1197,7 +1197,9 @@ '/tbody/table' ); $table.tablesorter(); - assert.equal( 2, $table.find( 'tr:eq(1) th:eq(1)').prop('headerIndex'), 'Incorrect index of sort header' ); + assert.equal( $table.find( 'tr:eq(1) th:eq(1)').prop('headerIndex'), + 2, + 'Incorrect index of sort header' ); } ); -- To view, visit https://gerrit.wikimedia.org/r/152121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55db7e3ef4e155fb9e1152cbf777189d04eec951 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.textSelection: re-add iframe check due to regression - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/150009 Change subject: jquery.textSelection: re-add iframe check due to regression .. jquery.textSelection: re-add iframe check due to regression This is to fix a regression due to change Ibe011b2b of bug 29328. The replacement jquery.textSelection of CodeEditor was no longer able to be disable don the fly. This is because the code of textSelection and WikiEditor is still too much intertwined. I'm making a new patchset to strip them further apart. Bug: 68556 Change-Id: I7c4c43ba2cde6f7c869e41ed4c5a51783cd32f82 --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/09/150009/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index e5444eb..289cd22 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -553,7 +553,7 @@ } context = $( this ).data( 'wikiEditor-context' ); - hasWikiEditorSurface = ( context !== undefined ); + hasWikiEditorSurface = ( context !== undefined context.$iframe !== undefined ); // IE selection restore voodoo needSave = false; -- To view, visit https://gerrit.wikimedia.org/r/150009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c4c43ba2cde6f7c869e41ed4c5a51783cd32f82 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.textSelection: register an alt implementation - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/150032 Change subject: jquery.textSelection: register an alt implementation .. jquery.textSelection: register an alt implementation At times we replace the textarea with a different implementation, for instance in the former iframe code of WikiEditor and now in CodeEditor. Obviously only one implementation of this API can be in control at a time, but in order to disable/enable which one exactly is currently determined by the existence of function in the core WikiEditor context. This is a remnant of when this code was still in WikiEditor. I added two commands, register and unregister that can take an object that has alternative function implementations for the commands. This also requires changes in the CodeEditor plugin. Bug: 29328 Change-Id: I14492572f7eb9bbd1af68872dbfef5159126f107 --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/32/150032/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index e5444eb..e9185bf 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -24,8 +24,9 @@ $.fn.textSelection = function ( command, options ) { var fn, + alternateFn, context, - hasWikiEditorSurface, // The alt edit surface needs to implement the WikiEditor API + hasWikiEditor, needSave, retval; @@ -507,6 +508,8 @@ } }; + alternateFn = $( this ).data( 'jquery.textSelection' ); + // Apply defaults switch ( command ) { //case 'getContents': // no params @@ -550,19 +553,28 @@ force: false // Force a scroll even if the caret position is already visible }, options ); break; + case 'register': + if ( alternateFn ) { + throw new Error( 'jquery.textSelection: Another implementation of the textSelection API is already in use' ); + } + $( this ).data( 'jquery.textSelection', options ); + return; + case 'unregister': + $( this ).removeData( 'jquery.textSelection' ); + return; } context = $( this ).data( 'wikiEditor-context' ); - hasWikiEditorSurface = ( context !== undefined ); + hasWikiEditor = ( context !== undefined ); // IE selection restore voodoo needSave = false; - if ( hasWikiEditorSurface context.savedSelection !== null ) { + if ( hasWikiEditor context.savedSelection !== null ) { context.fn.restoreSelection(); needSave = true; } - retval = ( hasWikiEditorSurface context.fn[command] !== undefined ? context.fn : fn )[command].call( this, options ); - if ( hasWikiEditorSurface needSave ) { + retval = ( alternateFn !== undefined alternateFn[command] !== undefined ? alternateFn : fn )[command].call( this, options ); + if ( hasWikiEditor needSave ) { context.fn.saveSelection(); } -- To view, visit https://gerrit.wikimedia.org/r/150032 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14492572f7eb9bbd1af68872dbfef5159126f107 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Split jquery.textSelection and WikiEditor api overrides - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/150037 Change subject: Split jquery.textSelection and WikiEditor api overrides .. Split jquery.textSelection and WikiEditor api overrides This depends on MediaWiki core change I14492572 Bug: 29328 Change-Id: I57bc7791dc61b7edcf258e6c16445d5a4a8783cf --- M modules/jquery.codeEditor.js 1 file changed, 25 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/37/150037/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index c7f46df..9cf7f70 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -39,7 +39,8 @@ }; $.wikiEditor.extensions.codeEditor = function ( context ) { - var saveAndExtend; + var saveAndExtend, + textSelectionFn; /* * Event Handlers @@ -189,6 +190,7 @@ // Load the editor now context.codeEditor = ace.edit( editdiv[0] ); context.codeEditor.getSession().setValue( box.val() ); + box.textSelection( 'register', textSelectionFn ); // Disable some annoying commands context.codeEditor.commands.removeCommand( 'replace' ); // ctrl+R @@ -203,16 +205,6 @@ enableSnippets: true } ); - // fakeout for bug 29328 - context.$iframe = [ - { - contentWindow: { - focus: function () { - context.codeEditor.focus(); - } - } - } - ]; box.closest( 'form' ).submit( context.evt.codeEditorSubmit ); session = context.codeEditor.getSession(); @@ -265,7 +257,8 @@ $( mw ).unbind( 'LivePreviewPrepare', context.evt.codeEditorSubmit ); // deprecated // Save contents - context.$textarea.val( context.fn.getContents() ); + context.$textarea.textSelection( 'unregister' ); + context.$textarea.val( textSelectionFn.getContents() ); // @todo fetch cursor, scroll position @@ -273,7 +266,6 @@ context.fn.removeStatusBar(); context.$codeEditorContainer.remove(); context.$codeEditorContainer = undefined; - context.$iframe = undefined; context.codeEditor = undefined; // Restore textarea @@ -535,18 +527,26 @@ mw.log( 'codeEditor stub function restoreSelection called' ); }, + /** +* Scroll an element to the top of the iframe +* +* @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 () { + mw.log( 'codeEditor stub function scrollToTop called' ); + } + } ); + + /** +* Compatibility with the $.textSelection jQuery plug-in. When the iframe is in use, these functions provide +* equivalant functionality to the otherwise textarea-based functionality. +*/ + textSelectionFn = { + /* Needed for search/replace */ 'getContents': function () { return context.codeEditor.getSession().getValue(); - }, - - /** -* Compatibility with the $.textSelection jQuery plug-in. When the iframe is in use, these functions provide -* equivilant functionality to the otherwise textarea-based functionality. -*/ - -
[MediaWiki-commits] [Gerrit] jquery.textSelection: Add setContents function - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/149529 Change subject: jquery.textSelection: Add setContents function .. jquery.textSelection: Add setContents function This function is specified in the commands handler below, but did not have an implementation for the plain textarea case. Better we make this work. A user wanted this api call so his JS cleanup script could work consistently on both plain textarea and the CodeEditor Change-Id: Ib3afc505037a5b12269e55b4b130a38a3fac7823 --- M resources/src/jquery/jquery.textSelection.js M tests/qunit/suites/resources/jquery/jquery.textSelection.test.js 2 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/29/149529/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 0573f66..e5444eb 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -63,6 +63,12 @@ return this.val(); }, /** +* Set the contents of the textarea, replacing anything that was there before +*/ + setContents: function ( content ) { + this.val( content ); + }, + /** * Get the currently selected text in this textarea. Will focus the textarea * in some browsers (IE/Opera) */ diff --git a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js index 2191c3b..56b0fa9 100644 --- a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js @@ -43,11 +43,7 @@ $( '#qunit-fixture' ).append( $textarea ); - // This method is actually missing atm... - //$textarea.textSelection( 'setContents', opt.before.text); - - // Won't work with the WikiEditor iframe? - $textarea.val( opt.before.text ); + $textarea.textSelection( 'setContents', opt.before.text ); start = opt.before.start; end = opt.before.end; -- To view, visit https://gerrit.wikimedia.org/r/149529 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3afc505037a5b12269e55b4b130a38a3fac7823 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] user settings api - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/146784 Change subject: [WIP] user settings api .. [WIP] user settings api OK, this is totally not finished, not tested, broken etc. but I wanted to capture the idea. Small lib to handle user settings for JS functionality. I feel that we are writing this code too often for various modules and often leave out too many possibilities (we use cookies too often even if not required). Allows you to make a Setting object, that you can simply set and get to persist and or retrieve a value, no matter what kind of user you are. Change-Id: I68a5d5a8f750bae195bdbcdb141faafc673f64d4 --- A resources/src/mediawiki/mediawiki.setting.js 1 file changed, 111 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/84/146784/1 diff --git a/resources/src/mediawiki/mediawiki.setting.js b/resources/src/mediawiki/mediawiki.setting.js new file mode 100644 index 000..672ede4 --- /dev/null +++ b/resources/src/mediawiki/mediawiki.setting.js @@ -0,0 +1,111 @@ +/*! + * @author Derk-Jan Hartman 2014 + * @since 1.24 + */ + ( function ( mw, $ ) { + + /** +* @class mw.Setting +* +* Object that wraps the various ways that we can set and get settings for users. +* The order of preference is: +* User preferences, localStorage, cookie, a sitewide config provided value and the constructor provided default value. +* +* @constructor +* @param {string|Object} names Names of the keys that correspond to the preference. +* @param {string} [names.preferenceKey] The name of a key in the preferences. Only works for logged in users and does not usually expire unless renamed. +* @param {string} [names.localStorageKey] The name of a localStorage Key. LocalStorage values are lossy, but do not have an expiration date. +* @param {string} [names.cookieName] The name of a mw.cookie that has this value +* @param {string} [names.configKey] The name of mw.config key that can be used as a fallback value +* @param {defaultValue} [defaultValue] If given, will used as default value if setting is not present +* @param {Object} [options] Object with settings to control behavior of the setting. Migration strategies, cookie timeouts etc. +* @param {string} [options.prefix=wgCookiePrefix] The prefix of the key +* @param {string} [options.domain=wgCookieDomain] The domain attribute of the cookie +* @param {string} [options.path=wgCookiePath] The path attribute of the cookie +* @param {boolean} [options.secure=false] Whether or not to include the secure attribute. +*/ + function Setting( names, defaultValue, options ) { + this.api = new Api(); + this.defaultValue = defaultValue || undefined; + this.options = options || {} ; + + if (typeof names === 'string' ) { + this.preferenceKey = names; + this.localStorageKey = names; + this.cookieName = names; + this.configKey = names; + } else if ( typeof names === 'object' ) { + if ( 'preferenceKey' in names ) { + this.preferenceKey = names.preferenceKey; + } + if ( 'localStorageKey' in names ) { + this.localStorageKey = names.localStorageKey; + } + if ( 'cookieName' in names ) { + this.cookieName = names.cookieName; + } + if ( 'configKey' in names ) { + this.configKey = names.configKey; + this.defaultValue = mw.config.get( this.configKey ); + } + } + + return this; + } + + var localStorageSupported = ( 'localStorage' in window localStorage !== null ), + getPrefix = function( options ) { + if ( typeof options.prefix !== 'undefined' ) { + return options.prefix; + } + return mw.config.get( 'wgCookiePrefix' ); + } + + /* Public members */ + Setting.prototype = { + constructor: Setting, + + // TODO, add expire param ? + set: function ( value ) { + var apiDeferred = $.Deferred(); + + if ( mw.config.get( 'wgUserId' ) !== null typeof this.preferenceKey !== 'undefined' ) { + this.api.postWithToken( 'options', { + 'action': 'options', + } ) + .fail(
[MediaWiki-commits] [Gerrit] Allow on the fly loading of language modes - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/145327 Change subject: Allow on the fly loading of language modes .. Allow on the fly loading of language modes Change-Id: Ie04138677dead4c23b1bcfef4e1f7a2cd6e8826e --- M modules/jquery.codeEditor.js 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/27/145327/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index 42a7979..c7f46df 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -228,8 +228,10 @@ // updated right away to actually use the new style. $( mw ).bind( 'LivePreviewPrepare', context.evt.codeEditorSubmit ); - AceLangMode = require( 'ace/mode/' + lang ).Mode; - session.setMode( new AceLangMode() ); + ace.config.loadModule( 'ace/mode/' + lang, function() { + AceLangMode = require( 'ace/mode/' + lang ).Mode; + session.setMode( new AceLangMode() ); + }); // Force the box to resize horizontally to match in future :D resize = function () { -- To view, visit https://gerrit.wikimedia.org/r/145327 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie04138677dead4c23b1bcfef4e1f7a2cd6e8826e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ace: Update to 08-07-2014 - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/144780 Change subject: Ace: Update to 08-07-2014 .. Ace: Update to 08-07-2014 Updated to https://github.com/ajaxorg/ace/commit/d3ddd74fe71307d2c05e0759715e39704aeb9ba3 Includes fixes for drag delay (bug 60432) and chrome useragent detection: Github issue https://github.com/ajaxorg/ace/issues/1950 Bug: 60432 Change-Id: I5ac67a812f09ac43e73475613afc9a3f1ddc9a75 --- M modules/ace/ace.js M modules/ace/ext-beautify.js M modules/ace/ext-chromevox.js M modules/ace/ext-elastic_tabstops_lite.js M modules/ace/ext-emmet.js M modules/ace/ext-error_marker.js M modules/ace/ext-keybinding_menu.js M modules/ace/ext-language_tools.js A modules/ace/ext-linking.js M modules/ace/ext-modelist.js M modules/ace/ext-old_ie.js M modules/ace/ext-searchbox.js M modules/ace/ext-settings_menu.js M modules/ace/ext-spellcheck.js M modules/ace/ext-split.js M modules/ace/ext-static_highlight.js M modules/ace/ext-statusbar.js M modules/ace/ext-textarea.js M modules/ace/ext-themelist.js M modules/ace/ext-whitespace.js M modules/ace/keybinding-emacs.js M modules/ace/keybinding-vim.js M modules/ace/mode-abap.js M modules/ace/mode-actionscript.js M modules/ace/mode-ada.js M modules/ace/mode-apache_conf.js A modules/ace/mode-applescript.js M modules/ace/mode-asciidoc.js M modules/ace/mode-assembly_x86.js M modules/ace/mode-autohotkey.js M modules/ace/mode-batchfile.js M modules/ace/mode-c9search.js M modules/ace/mode-c_cpp.js M modules/ace/mode-cirru.js M modules/ace/mode-clojure.js M modules/ace/mode-cobol.js M modules/ace/mode-coffee.js M modules/ace/mode-coldfusion.js M modules/ace/mode-csharp.js M modules/ace/mode-css.js M modules/ace/mode-curly.js M modules/ace/mode-d.js M modules/ace/mode-dart.js M modules/ace/mode-diff.js M modules/ace/mode-django.js M modules/ace/mode-dockerfile.js M modules/ace/mode-dot.js M modules/ace/mode-ejs.js M modules/ace/mode-erlang.js M modules/ace/mode-forth.js M modules/ace/mode-ftl.js M modules/ace/mode-gherkin.js A modules/ace/mode-gitignore.js M modules/ace/mode-glsl.js M modules/ace/mode-golang.js M modules/ace/mode-groovy.js M modules/ace/mode-haml.js M modules/ace/mode-handlebars.js M modules/ace/mode-haskell.js M modules/ace/mode-haxe.js M modules/ace/mode-html.js M modules/ace/mode-html_ruby.js M modules/ace/mode-ini.js M modules/ace/mode-jack.js M modules/ace/mode-jade.js M modules/ace/mode-java.js M modules/ace/mode-javascript.js M modules/ace/mode-json.js M modules/ace/mode-jsoniq.js M modules/ace/mode-jsp.js M modules/ace/mode-jsx.js M modules/ace/mode-julia.js M modules/ace/mode-latex.js M modules/ace/mode-less.js M modules/ace/mode-liquid.js M modules/ace/mode-lisp.js M modules/ace/mode-livescript.js M modules/ace/mode-logiql.js M modules/ace/mode-lsl.js M modules/ace/mode-lua.js M modules/ace/mode-luapage.js M modules/ace/mode-lucene.js M modules/ace/mode-makefile.js M modules/ace/mode-markdown.js M modules/ace/mode-matlab.js M modules/ace/mode-mel.js M modules/ace/mode-mushcode.js M modules/ace/mode-mysql.js M modules/ace/mode-nix.js M modules/ace/mode-objectivec.js M modules/ace/mode-ocaml.js M modules/ace/mode-pascal.js M modules/ace/mode-perl.js M modules/ace/mode-pgsql.js M modules/ace/mode-php.js M modules/ace/mode-plain_text.js M modules/ace/mode-powershell.js M modules/ace/mode-prolog.js M modules/ace/mode-properties.js M modules/ace/mode-protobuf.js M modules/ace/mode-python.js M modules/ace/mode-r.js M modules/ace/mode-rdoc.js M modules/ace/mode-rhtml.js M modules/ace/mode-ruby.js M modules/ace/mode-rust.js M modules/ace/mode-sass.js M modules/ace/mode-scad.js M modules/ace/mode-scala.js M modules/ace/mode-scheme.js M modules/ace/mode-scss.js M modules/ace/mode-sh.js M modules/ace/mode-sjs.js M modules/ace/mode-smarty.js M modules/ace/mode-snippets.js M modules/ace/mode-soy_template.js M modules/ace/mode-space.js M modules/ace/mode-sql.js M modules/ace/mode-stylus.js M modules/ace/mode-svg.js M modules/ace/mode-tcl.js M modules/ace/mode-tex.js M modules/ace/mode-text.js M modules/ace/mode-textile.js M modules/ace/mode-toml.js M modules/ace/mode-twig.js M modules/ace/mode-typescript.js A modules/ace/mode-vala.js M modules/ace/mode-vbscript.js M modules/ace/mode-velocity.js M modules/ace/mode-verilog.js M modules/ace/mode-vhdl.js M modules/ace/mode-xml.js M modules/ace/mode-xquery.js M modules/ace/mode-yaml.js M modules/ace/snippets/abap.js M modules/ace/snippets/actionscript.js M modules/ace/snippets/ada.js M modules/ace/snippets/apache_conf.js A modules/ace/snippets/applescript.js M modules/ace/snippets/asciidoc.js M modules/ace/snippets/assembly_x86.js M modules/ace/snippets/autohotkey.js M modules/ace/snippets/batchfile.js M modules/ace/snippets/c9search.js M modules/ace/snippets/c_cpp.js M modules/ace/snippets/cirru.js M modules/ace/snippets/clojure.js M modules/ace/snippets/cobol.js M modules/ace/snippets/coffee.js M
[MediaWiki-commits] [Gerrit] ToC: float left should also clear other left floats - change (mediawiki...MobileFrontend)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/141754 Change subject: ToC: float left should also clear other left floats .. ToC: float left should also clear other left floats Change-Id: I130705b9884d4b36d15ba131b2445bf4ef88fbb1 --- M less/modules/toc/toc.less 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/54/141754/1 diff --git a/less/modules/toc/toc.less b/less/modules/toc/toc.less index ffd5bb1..4dceac3 100644 --- a/less/modules/toc/toc.less +++ b/less/modules/toc/toc.less @@ -13,6 +13,7 @@ border: solid 1px @grayLightest; font-size: 1.3em; float: left; + clear: left; margin: 1em 0; h2 { -- To view, visit https://gerrit.wikimedia.org/r/141754 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I130705b9884d4b36d15ba131b2445bf4ef88fbb1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Disable CodeEditor on mobile - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/141385 Change subject: Disable CodeEditor on mobile .. Disable CodeEditor on mobile Disabled on our known android/iphone/ipod UAs, because of Bug 55345. Change-Id: I8c5377889c349df14d43803fecaab09d7554e97a --- M modules/jquery.codeEditor.js 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/85/141385/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index 42a7979..d8c164c 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -10,7 +10,10 @@ * Compatability map */ browsers: { - msie: [['=', 8]] + msie: [['=', 8]], + ipod: false, + iphone: false, + android: false }, /** * Configuration -- To view, visit https://gerrit.wikimedia.org/r/141385 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c5377889c349df14d43803fecaab09d7554e97a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Toolbar: Only show on WikiText pages - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/141293 Change subject: Toolbar: Only show on WikiText pages .. Toolbar: Only show on WikiText pages The toolbar is highly specific to Wikitext anyway. It was already not added to JS and CSS subpages, but still visible on site css/js pages and on Lua pages. This was inconsistent. Ideally at some point, we might want a 'toolbar api' where you can configure a 'toolbar' per content model, but let's first make it consistent and then iterate from there when required. Bug: 29908 Change-Id: If0853e9faf640f93b7030c4937137149d3f08cf5 --- M includes/EditPage.php 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/93/141293/1 diff --git a/includes/EditPage.php b/includes/EditPage.php index 98e0ec4..1a6a9e5 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2531,7 +2531,9 @@ $wgOut-addHTML( $this-editFormTextBeforeContent ); - if ( !$this-isCssJsSubpage $showToolbar $wgUser-getOption( 'showtoolbar' ) ) { + if ( $this-contentModel === 'CONTENT_MODEL_WIKITEXT' +$showToolbar $wgUser-getOption( 'showtoolbar' ) ) + { $wgOut-addHTML( EditPage::getEditToolbar() ); } -- To view, visit https://gerrit.wikimedia.org/r/141293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0853e9faf640f93b7030c4937137149d3f08cf5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only add WikiEditor for content model WikiText - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/141296 Change subject: Only add WikiEditor for content model WikiText .. Only add WikiEditor for content model WikiText Together with solving bug 29908, this makes the presence of the toolbar consistent. It is added to pages handling wikitext. Note that we provide the CodeEditor on all JS/CSS/Lua pages. Bug: 24713 Bug: 24041 Change-Id: Iaa6b9a6c511380ed1669d8b95cba4a3ddc6f9ab6 --- M WikiEditor.hooks.php 1 file changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/96/141296/1 diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php index 660f5e5..8c6800c 100644 --- a/WikiEditor.hooks.php +++ b/WikiEditor.hooks.php @@ -155,11 +155,14 @@ * * Adds the modules to the edit form * -* @param $toolbar array list of toolbar items +* @param $editPage EditPage the current EditPage object. +* @param $output OutputPage object. * @return bool */ - public static function editPageShowEditFormInitial( $toolbar ) { - global $wgOut; + public static function editPageShowEditFormInitial( $editPage, $outputPage ) { + if ( $editPage-contentModel !== CONTENT_MODEL_WIKITEXT ) { + return true; + } // Add modules for enabled features foreach ( self::$features as $name = $feature ) { @@ -167,10 +170,10 @@ continue; } if ( isset( $feature['stylemodules'] ) ) { - $wgOut-addModuleStyles( $feature['stylemodules'] ); + $outputPage-addModuleStyles( $feature['stylemodules'] ); } if ( isset( $feature['modules'] ) ) { - $wgOut-addModules( $feature['modules'] ); + $outputPage-addModules( $feature['modules'] ); } } return true; -- To view, visit https://gerrit.wikimedia.org/r/141296 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa6b9a6c511380ed1669d8b95cba4a3ddc6f9ab6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Link dialog: do basic URI validation - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/141367 Change subject: Link dialog: do basic URI validation .. Link dialog: do basic URI validation This isn't very sophisticated, but it will handle the basics. Also reworked the switch between internal and external links and moved all state calculation into a single function instead of having it spread troughout.. Bug: 28789 Change-Id: I243106901939b4baef6d9d04a4e0e428f2a6b79e --- M WikiEditor.php M i18n/en.json M i18n/qqq.json M modules/jquery.wikiEditor.dialogs.config.css M modules/jquery.wikiEditor.dialogs.config.js 5 files changed, 35 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/67/141367/1 diff --git a/WikiEditor.php b/WikiEditor.php index 723c4bf..848e7b0 100644 --- a/WikiEditor.php +++ b/WikiEditor.php @@ -99,6 +99,7 @@ 'jquery.wikiEditor.toolbar.i18n', 'jquery.suggestions', 'mediawiki.Title', + 'mediawiki.Uri', 'mediawiki.jqueryMsg', ), 'messages' = array( @@ -181,6 +182,7 @@ 'wikieditor-toolbar-tool-link-int-target-status-exists', 'wikieditor-toolbar-tool-link-int-target-status-notexists', 'wikieditor-toolbar-tool-link-int-target-status-invalid', + 'wikieditor-toolbar-tool-link-int-target-status-invalidurl', 'wikieditor-toolbar-tool-link-int-target-status-external', 'wikieditor-toolbar-tool-link-int-target-status-loading', 'wikieditor-toolbar-tool-link-int-target-status-disambig', diff --git a/i18n/en.json b/i18n/en.json index 5d4ae47..ecd4208 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -53,6 +53,7 @@ wikieditor-toolbar-tool-link-int-target-status-exists: Page exists, wikieditor-toolbar-tool-link-int-target-status-notexists: Page does not exist, wikieditor-toolbar-tool-link-int-target-status-invalid: Invalid title, +wikieditor-toolbar-tool-link-int-target-status-invalidurl: Invalid URL, wikieditor-toolbar-tool-link-int-target-status-external: External link, wikieditor-toolbar-tool-link-int-target-status-loading: Checking page existence..., wikieditor-toolbar-tool-link-int-target-status-disambig: Disambiguation page, diff --git a/i18n/qqq.json b/i18n/qqq.json index 22bb04f..34a3ed9 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -60,6 +60,7 @@ wikieditor-toolbar-tool-link-int-target-status-exists: Text shown when the title the user entered exists, wikieditor-toolbar-tool-link-int-target-status-notexists: Text shown when the title the user entered does not exist, wikieditor-toolbar-tool-link-int-target-status-invalid: Text shown when the title the user entered is invalid.\n{{Identical|Invalid title}}, + wikieditor-toolbar-tool-link-int-target-status-invalid: Text shown when the external URL the user entered is invalid., wikieditor-toolbar-tool-link-int-target-status-external: Text shown when the link target the user entered points to an external web site\n{{Identical|External link}}, wikieditor-toolbar-tool-link-int-target-status-loading: alt text and title text for the image shown while the title the user entered is being checked for existence, wikieditor-toolbar-tool-link-int-target-status-disambig: Text shown when the link target the user entered points to a disambiguation page.\n{{Identical|Disambiguation page}}, diff --git a/modules/jquery.wikiEditor.dialogs.config.css b/modules/jquery.wikiEditor.dialogs.config.css index 1cc9f5a..a9fa7b1 100644 --- a/modules/jquery.wikiEditor.dialogs.config.css +++ b/modules/jquery.wikiEditor.dialogs.config.css @@ -55,6 +55,7 @@ #wikieditor-toolbar-link-int-target-status-exists, #wikieditor-toolbar-link-int-target-status-notexists, #wikieditor-toolbar-link-int-target-status-invalid, +#wikieditor-toolbar-link-int-target-status-invalidurl, #wikieditor-toolbar-link-int-target-status-external, #wikieditor-toolbar-link-int-target-status-disambig { padding-left: 30px; @@ -71,7 +72,8 @@ background-image: url(images/dialogs/insert-link-notexists.png); background-position: left; } -#wikieditor-toolbar-link-int-target-status-invalid { +#wikieditor-toolbar-link-int-target-status-invalid, +#wikieditor-toolbar-link-int-target-status-invalidurl { /* @embed */ background-image: url(images/dialogs/insert-link-invalid.png); background-position: left; diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 3ec2641..75df58c 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++
[MediaWiki-commits] [Gerrit] Migrate VE icon from VE extension - change (mediawiki...Math)
TheDJ has submitted this change and it was merged. Change subject: Migrate VE icon from VE extension .. Migrate VE icon from VE extension Removed from VE with Ic8074be2. Change-Id: I33cdb6204b4abc44398ecedd65f7d9251e73e9b0 --- M Math.php A modules/VisualEditor/math.svg A modules/VisualEditor/ve.ui.MWMathIcons.css 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: Catrope: Looks good to me, approved Physikerwelt: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/Math.php b/Math.php index 8acff0e..c3d244b 100644 --- a/Math.php +++ b/Math.php @@ -483,6 +483,9 @@ 'VisualEditor/ve.ui.MWMathInspector.js', 'VisualEditor/ve.ui.MWMathInspectorTool.js', ), + 'styles' = array( + 'VisualEditor/ve.ui.MWMathIcons.css', + ), 'dependencies' = array( 'ext.visualEditor.mwcore', ), diff --git a/modules/VisualEditor/math.svg b/modules/VisualEditor/math.svg new file mode 100644 index 000..c5ac601 --- /dev/null +++ b/modules/VisualEditor/math.svg @@ -0,0 +1,8 @@ +?xml version=1.0 encoding=iso-8859-1? +!DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; +svg version=1.1 xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; x=0px y=0px width=24px +height=24px viewBox=0 0 24 24 style=enable-background:new 0 0 24 24; xml:space=preserve +g id=math style=opacity:0.75 + path id=sigma d=M 13.609,11.391 10.004,16.004 16,16 l 0,-1 1,0 0,3 -10,0 5,-6 -5,-6 10,0 0,3 -1,0 0,-2 -6,0 3.609,4.391 / +/g +/svg diff --git a/modules/VisualEditor/ve.ui.MWMathIcons.css b/modules/VisualEditor/ve.ui.MWMathIcons.css new file mode 100644 index 000..5b75dba --- /dev/null +++ b/modules/VisualEditor/ve.ui.MWMathIcons.css @@ -0,0 +1,4 @@ +.oo-ui-icon-math { + /* @embed */ + background-image: url(math.svg); +} -- To view, visit https://gerrit.wikimedia.org/r/140693 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33cdb6204b4abc44398ecedd65f7d9251e73e9b0 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de Gerrit-Reviewer: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace jQuery.browser with jquery.client - change (mediawiki...LiquidThreads)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/140205 Change subject: Replace jQuery.browser with jquery.client .. Replace jQuery.browser with jquery.client Bug: 65679 Change-Id: I93f6adaf4ad9a3b3822c9a7459464bf705e9275b --- M LiquidThreads.php M lqt.js 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/05/140205/1 diff --git a/LiquidThreads.php b/LiquidThreads.php index 68813bb..6d7f1d5 100644 --- a/LiquidThreads.php +++ b/LiquidThreads.php @@ -87,6 +87,7 @@ 'mediawiki.action.edit.preview', 'mediawiki.api.watch', 'user.tokens', + 'jquery.client', 'mediawiki.api', 'mediawiki.util', ), diff --git a/lqt.js b/lqt.js index 4597c17..7f798ef 100644 --- a/lqt.js +++ b/lqt.js @@ -140,7 +140,8 @@ liquidThreads.cancelEdit( container ); - var isIE7 = $.browser.msie $.browser.version.substr( 0, 1 ) === '7'; + var isIE7 = $.client.test( { 'msie': [['=', 7], ['', 8]] }, + $.client.profile(), true ); var loadSpinner = $( 'div class=mw-ajax-loader lqt-loader/' ); $( container ).before( loadSpinner ); -- To view, visit https://gerrit.wikimedia.org/r/140205 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93f6adaf4ad9a3b3822c9a7459464bf705e9275b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace obsolete live() with $( document ).on() - change (mediawiki...LiquidThreads)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/140221 Change subject: Replace obsolete live() with $( document ).on() .. Replace obsolete live() with $( document ).on() Bug: 65666 Change-Id: I9efdea82603c1646d68db19e513fd0ce08fd469a --- M lqt.js 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/21/140221/1 diff --git a/lqt.js b/lqt.js index 7f798ef..af3aa5d 100644 --- a/lqt.js +++ b/lqt.js @@ -1593,27 +1593,27 @@ } ); // Live bind for unwatch/watch stuff. - $( '.lqt-command-watch' ).live( 'click', liquidThreads.asyncWatch ); - $( '.lqt-command-unwatch' ).live( 'click', liquidThreads.asyncWatch ); + $( document ).on( 'click', '.lqt-command-watch', liquidThreads.asyncWatch ); + $( document ).on( 'click', '.lqt-command-unwatch', liquidThreads.asyncWatch ); // Live bind for link window - $( '.lqt-command-link' ).live( 'click', liquidThreads.showThreadLinkWindow ); + $( document ).on( 'click', '.lqt-command-link', liquidThreads.showThreadLinkWindow ); // Live bind for summary links - $( '.lqt-summary-link' ).live( 'click', liquidThreads.showSummaryLinkWindow ); + $( document ).on( 'click', '.lqt-summary-link', liquidThreads.showSummaryLinkWindow ); // For show replies - $( 'a.lqt-show-replies' ).live( 'click', liquidThreads.showReplies ); + $( document ).on( 'click', 'a.lqt-show-replies', liquidThreads.showReplies ); // Show more posts link - $( 'a.lqt-show-more-posts' ).live( 'click', liquidThreads.showMore ); + $( document ).on( 'click', 'a.lqt-show-more-posts', liquidThreads.showMore ); // Edit link handler - $( '.lqt-command-edit a' ).live( 'click', liquidThreads.handleEditLink ); + $( document ).on( 'click', '.lqt-command-edit a', liquidThreads.handleEditLink ); // Save handlers - $( '#wpSave' ).live( 'click', liquidThreads.handleAJAXSave ); - $( '#wpTextbox1' ).live( 'keyup', liquidThreads.onTextboxKeyUp ); + $( document ).on( 'click', '#wpSave', liquidThreads.handleAJAXSave ); + $( document ).on( 'keyup', '#wpTextbox1', liquidThreads.onTextboxKeyUp ); // Hide menus when a click happens outside them $( document ).click( liquidThreads.handleDocumentClick ); -- To view, visit https://gerrit.wikimedia.org/r/140221 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9efdea82603c1646d68db19e513fd0ce08fd469a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CPB: Make LQT messages show up in CPB. - change (mediawiki...VectorBeta)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/140248 Change subject: CPB: Make LQT messages show up in CPB. .. CPB: Make LQT messages show up in CPB. I was missing these notification too often on mediawiki.org Change-Id: I75d47503ca0ed3dfd68a66b60f0aaede0e96ebef --- M resources/compactPersonalBar/compactPersonalBar.js M resources/compactPersonalBar/compactPersonalBar.less 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VectorBeta refs/changes/48/140248/1 diff --git a/resources/compactPersonalBar/compactPersonalBar.js b/resources/compactPersonalBar/compactPersonalBar.js index b882f64..7c12398 100644 --- a/resources/compactPersonalBar/compactPersonalBar.js +++ b/resources/compactPersonalBar/compactPersonalBar.js @@ -121,6 +121,7 @@ count: $( '#pt-notifications' ).text(), href: $( '#pt-notifications' ).find( 'a' ).attr( 'href' ) } ) ). + addItem( 'interactions', 'newmessages', $( '#pt-newmessages' ).clone().attr( 'id', 'pt-newmessages-flyout' ) ). addItem( 'interactions', 'talk', $( '#pt-mytalk' ).clone().attr( 'id', 'pt-mytalk-flyout' ) ). addItem( 'interactions', 'watchlist', $( '#pt-watchlist' ).clone().attr( 'id', 'pt-watchlist-flyout' ) ). addItem( 'preferences', 'preferences', $( '#pt-preferences' ) ). @@ -137,6 +138,7 @@ bar. addItem( 'main', 'language', $( '#pt-uls' ) ). + addItem( 'main', 'newmessages', $( '#pt-newmessages' ) ). addItem( 'main', 'watchlist', $( '#pt-watchlist' ) ). addItem( 'main', 'talk', $( '#pt-mytalk' ) ). addItem( 'main', 'notifications', $( '#pt-notifications' ) ). diff --git a/resources/compactPersonalBar/compactPersonalBar.less b/resources/compactPersonalBar/compactPersonalBar.less index bb3bfda..1bab10f 100644 --- a/resources/compactPersonalBar/compactPersonalBar.less +++ b/resources/compactPersonalBar/compactPersonalBar.less @@ -158,6 +158,7 @@ .background-icon(notifications); } +#pt-newmessages-flyout a, #pt-mytalk-flyout a { .background-icon(talk); } -- To view, visit https://gerrit.wikimedia.org/r/140248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75d47503ca0ed3dfd68a66b60f0aaede0e96ebef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VectorBeta Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] textSelection: Remove references to iframe - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/139690 Change subject: textSelection: Remove references to iframe .. textSelection: Remove references to iframe Another attempt to solve the references to WikiEditor's 'iframe' code. Renamed to a more suited name. The implementation still depends on WikiEditor. Long term, we should probably move part of the WikiEditor API into core. Bug: 29328 Change-Id: Ibe011b2b8d045b4dace3106b8ae718a11387501e --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 6 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/139690/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 042db91..dd190d6 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -25,7 +25,7 @@ $.fn.textSelection = function ( command, options ) { var fn, context, - hasIframe, + hasWikiEditorSurface, // The alt edit surface needs to implement the WikiEditor API needSave, retval; @@ -531,18 +531,11 @@ // Position to start selection at start: undefined, // Position to end selection at. Defaults to start - end: undefined, - // Element to start selection in (iframe only) - startContainer: undefined, - // Element to end selection in (iframe only). Defaults to startContainer - endContainer: undefined + end: undefined }, options ); if ( options.end === undefined ) { options.end = options.start; - } - if ( options.endContainer === undefined ) { - options.endContainer = options.startContainer; } // FIXME: We may not need character position-based functions if we insert markers in the right places break; @@ -554,16 +547,16 @@ } context = $( this ).data( 'wikiEditor-context' ); - hasIframe = context !== undefined context context.$iframe !== undefined; + hasWikiEditorSurface = context !== undefined context; // IE selection restore voodoo needSave = false; - if ( hasIframe context.savedSelection !== null ) { + if ( hasWikiEditorSurface context.savedSelection !== null ) { context.fn.restoreSelection(); needSave = true; } - retval = ( hasIframe ? context.fn : fn )[command].call( this, options ); - if ( hasIframe needSave ) { + retval = ( hasAltEditSurface context.fn[command] !== undefined ? context.fn : fn )[command].call( this, options ); + if ( hasWikiEditorSurface needSave ) { context.fn.saveSelection(); } -- To view, visit https://gerrit.wikimedia.org/r/139690 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe011b2b8d045b4dace3106b8ae718a11387501e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Toolbar: Fix dependencies of WikiEditor toolbar - change (mediawiki...WikiEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/139759 Change subject: Toolbar: Fix dependencies of WikiEditor toolbar .. Toolbar: Fix dependencies of WikiEditor toolbar These modules are actually used from the toolbar module and not the toolbar.config module. An alternative toolbar configuration would run into a problem because of this. Change-Id: I91e9daa230f7c831eff1694e6685a7a650858f8a --- M WikiEditor.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/59/139759/1 diff --git a/WikiEditor.php b/WikiEditor.php index e61304c..723c4bf 100644 --- a/WikiEditor.php +++ b/WikiEditor.php @@ -140,6 +140,8 @@ 'dependencies' = array( 'jquery.wikiEditor', 'jquery.wikiEditor.toolbar.i18n', + 'jquery.cookie', + 'jquery.async', ), ), 'jquery.wikiEditor.toolbar.config' = $wikiEditorTpl + array( @@ -148,8 +150,6 @@ 'jquery.wikiEditor', 'jquery.wikiEditor.toolbar.i18n', 'jquery.wikiEditor.toolbar', - 'jquery.cookie', - 'jquery.async', ) ), 'jquery.wikiEditor.toolbar.i18n' = $wikiEditorTpl + array( -- To view, visit https://gerrit.wikimedia.org/r/139759 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91e9daa230f7c831eff1694e6685a7a650858f8a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Try to split out wikiEditor vs codeEditor toolbar - change (mediawiki...CodeEditor)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/139760 Change subject: [WIP] Try to split out wikiEditor vs codeEditor toolbar .. [WIP] Try to split out wikiEditor vs codeEditor toolbar This is far from done, will return to this later. Bug: 45850 Change-Id: I166570a296b9612e9f0abac7eef69857840d11a2 --- M CodeEditor.hooks.php M CodeEditor.php A modules/ext.codeEditor.toolbar.js A modules/jquery.codeEditor.toolbar.config.js 4 files changed, 73 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/60/139760/1 diff --git a/CodeEditor.hooks.php b/CodeEditor.hooks.php index d367be2..296cbd2 100644 --- a/CodeEditor.hooks.php +++ b/CodeEditor.hooks.php @@ -35,8 +35,13 @@ public static function editPageShowEditFormInitial( $editpage, $output ) { $lang = self::getPageLanguage( $editpage-getContextTitle() ); - if ( $lang $output-getUser()-getOption( 'usebetatoolbar' ) ) { - $output-addModules( 'ext.codeEditor' ); + if ( $lang ) { + $output-addModuleStyles( 'ext.wikiEditor.toolbar.styles' ); + if ( $output-getUser()-getOption( 'usebetatoolbar' ) ) { + $output-addModules( 'ext.codeEditor.WikiEditorToolbar' ); + } else { + $output-addModules( 'ext.codeEditor' ); + } } return true; } diff --git a/CodeEditor.php b/CodeEditor.php index 4b38fc4..12deb72 100644 --- a/CodeEditor.php +++ b/CodeEditor.php @@ -36,13 +36,25 @@ ); $wgResourceModules['ext.codeEditor'] = array( - 'scripts' = 'ext.codeEditor.js', + 'scripts' = array( + 'jquery.codeEditor.toolbar.config.js', + 'ext.codeEditor.toolbar.js', + 'ext.codeEditor.js', + ), 'dependencies' = array( - 'ext.wikiEditor.toolbar', - 'jquery.codeEditor' + 'jquery.codeEditor', + 'jquery.wikiEditor.toolbar', ), ) + $tpl; +$wgResourceModules['ext.codeEditor.wikiEditorToolbar'] = array( + 'dependencies' = array( + 'ext.wikiEditor.toolbar', + 'jquery.codeEditor', + ), +) + $tpl; + + $wgResourceModules['jquery.codeEditor'] = array( 'scripts' = 'jquery.codeEditor.js', 'styles' = 'jquery.codeEditor.css', diff --git a/modules/ext.codeEditor.toolbar.js b/modules/ext.codeEditor.toolbar.js new file mode 100644 index 000..3f30c0c --- /dev/null +++ b/modules/ext.codeEditor.toolbar.js @@ -0,0 +1,16 @@ +/* + * JavaScript for WikiEditor Toolbar + */ +jQuery( document ).ready( function ( $ ) { + if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { + $( '.wikiEditor-oldToolbar' ).show(); + return; + } + // The old toolbar is still in place and needs to be removed so there aren't two toolbars + $( '#toolbar' ).remove(); + // Add toolbar module + // TODO: Implement .wikiEditor( 'remove' ) + $( '#wpTextbox1' ).wikiEditor( + 'addModule', $.wikiEditor.modules.toolbar.config.getDefaultConfig() + ); +} ); diff --git a/modules/jquery.codeEditor.toolbar.config.js b/modules/jquery.codeEditor.toolbar.config.js new file mode 100644 index 000..1284804 --- /dev/null +++ b/modules/jquery.codeEditor.toolbar.config.js @@ -0,0 +1,35 @@ +/** + * Configuration of Toolbar module for CodeEditor + */ + /*jshint camelcase:false, quotmark:false */ +( function ( $, mw ) { + var callback = function() { + window.alert( 'Test' ); + }; +$.wikiEditor.modules.toolbar.config = { + getDefaultConfig: function () { + return { 'toolbar': { + // Main section + 'main': { + 'type': 'toolbar', + 'groups': { + 'format': { + 'tools': { + 'codeEditor': { + 'labelMsg': 'codeeditor-toolbar-toggle', + 'type': 'button', + 'icon': 'format-bold.png', + // 'icon': context.fn.codeEditorToolbarIcon(), + 'action': { + 'type': 'callback', + 'execute': callback +
[MediaWiki-commits] [Gerrit] Popups: Fix popups for extiw links - change (mediawiki...Popups)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134265 Change subject: Popups: Fix popups for extiw links .. Popups: Fix popups for extiw links These links were not ignored due to a typo. This also threw an error, because these links produced query.interwiki and not in query.pages. Change-Id: I3b5c5b900209323e3e72b41e3b02e90f1f53b4eb --- M resources/ext.popups.core.js M resources/ext.popups.renderer.article.js 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/65/134265/1 diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index 5af44d8..a209cc2 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -29,7 +29,7 @@ * @property {Array} IGNORE_CLASSES */ mw.popups.IGNORE_CLASSES = [ - '.exitw', + '.extiw', '.image', '.new', '.internal' diff --git a/resources/ext.popups.renderer.article.js b/resources/ext.popups.renderer.article.js index 4638ca0..f68a959 100644 --- a/resources/ext.popups.renderer.article.js +++ b/resources/ext.popups.renderer.article.js @@ -56,6 +56,7 @@ mw.popups.render.currentRequest = undefined; if ( + !re.query.pages || !re.query.pages[ re.query.pageids[ 0 ] ].extract || re.query.pages[ re.query.pageids[ 0 ] ].extract === '' ) { -- To view, visit https://gerrit.wikimedia.org/r/134265 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b5c5b900209323e3e72b41e3b02e90f1f53b4eb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Popups: Only run the selector for the a elements once - change (mediawiki...Popups)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134266 Change subject: Popups: Only run the selector for the a elements once .. Popups: Only run the selector for the a elements once It's a complicated query, we should not repeat it if not necessary Change-Id: I71d47de088afa7dab0a6eaed214c61db699fcd0c --- M resources/ext.popups.core.js 1 file changed, 14 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/66/134266/1 diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index a209cc2..873ec2e 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -89,9 +89,8 @@ * * @method removeTooltips */ - mw.popups.removeTooltips = function () { - var notSelector = ':not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')'; - mw.popups.$content.find( 'a' + notSelector + ':not([title=])' ) + mw.popups.removeTooltips = function ( $elements ) { + $elements .on( 'mouseenter focus', function () { $( this ) .data( 'title', $( this ).attr( 'title' ) ) @@ -123,10 +122,8 @@ * * @method setupTriggers */ - mw.popups.setupTriggers = function () { - var notSelector = ':not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')'; - - mw.popups.$content.find( 'a' + notSelector + ':not([title=])' ).on( 'mouseenter focus', function ( event ) { + mw.popups.setupTriggers = function ( $elements ) { + $elements.on( 'mouseenter focus', function ( event ) { var $this = $( this ), href = $this.attr( 'href' ); @@ -143,10 +140,18 @@ } ); }; + function selectPopupElements() { + var notSelector = ':not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')'; + + return mw.popups.$content.find( 'a' + notSelector + ':not([title=])' ); + } + mw.hook( 'wikipage.content').add( function ( $content ) { mw.popups.$content = $content; - mw.popups.removeTooltips(); - mw.popups.setupTriggers(); + + var $elements = selectPopupElements(); + mw.popups.removeTooltips( $elements ); + mw.popups.setupTriggers( $elements ); } ); $( function () { -- To view, visit https://gerrit.wikimedia.org/r/134266 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71d47de088afa7dab0a6eaed214c61db699fcd0c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Popups: The promise of the popups was not forwarding failures - change (mediawiki...Popups)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134267 Change subject: Popups: The promise of the popups was not forwarding failures .. Popups: The promise of the popups was not forwarding failures Change-Id: Icc1d5a175ccf9ef000dd198f94917912de3f --- M resources/ext.popups.renderer.article.js 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/67/134267/1 diff --git a/resources/ext.popups.renderer.article.js b/resources/ext.popups.renderer.article.js index f68a959..d308bd7 100644 --- a/resources/ext.popups.renderer.article.js +++ b/resources/ext.popups.renderer.article.js @@ -52,6 +52,7 @@ titles: title } ); + mw.popups.render.currentRequest.fail( deferred.reject ); mw.popups.render.currentRequest.done( function ( re ) { mw.popups.render.currentRequest = undefined; @@ -60,7 +61,8 @@ !re.query.pages[ re.query.pageids[ 0 ] ].extract || re.query.pages[ re.query.pageids[ 0 ] ].extract === '' ) { - return false; + deferred.reject(); + return; } mw.popups.render.cache[ href ] = {}; -- To view, visit https://gerrit.wikimedia.org/r/134267 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc1d5a175ccf9ef000dd198f94917912de3f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Popups: handle links with empty or no title attributes - change (mediawiki...Popups)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134268 Change subject: Popups: handle links with empty or no title attributes .. Popups: handle links with empty or no title attributes The script depends on a title being present in title attribute. So skip links without title attributes (which were getting empty attributes due to the implementation of removeTooltips) and bail on trying to open a preview for links without a title. Change-Id: I4cc744bea10af34741681f11e03d77b3d53e3a3b --- M resources/ext.popups.core.js M resources/ext.popups.renderer.article.js 2 files changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/68/134268/1 diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index 873ec2e..7e23758 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -143,7 +143,7 @@ function selectPopupElements() { var notSelector = ':not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')'; - return mw.popups.$content.find( 'a' + notSelector + ':not([title=])' ); + return mw.popups.$content.find( 'a[title]' + notSelector + ':not([title=])' ); } mw.hook( 'wikipage.content').add( function ( $content ) { diff --git a/resources/ext.popups.renderer.article.js b/resources/ext.popups.renderer.article.js index d308bd7..720c8d3 100644 --- a/resources/ext.popups.renderer.article.js +++ b/resources/ext.popups.renderer.article.js @@ -35,6 +35,11 @@ title = link.data( 'title' ), deferred = $.Deferred(); + if( !title ) { + deferred.reject(); + return deferred.promise(); + } + mw.popups.render.currentRequest = mw.popups.api.get( { action: 'query', prop: 'extracts|pageimages|revisions|info', -- To view, visit https://gerrit.wikimedia.org/r/134268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cc744bea10af34741681f11e03d77b3d53e3a3b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Popups: Some small cleanup. - change (mediawiki...Popups)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134269 Change subject: Popups: Some small cleanup. .. Popups: Some small cleanup. Bunch attr actions, add to dom as the last action, rm superflous lines and use strict. Change-Id: I3e0870b108e978d7fd4093a6e7201fb6260f2e88 --- M resources/ext.popups.core.js M resources/ext.popups.renderer.article.js 2 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/69/134269/1 diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index 7e23758..80e484d 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -1,4 +1,5 @@ ( function ( $, mw ) { + 'use strict'; /** * @class mw.popups @@ -48,7 +49,6 @@ $( 'div' ) .attr( 'id', 'mwe-popups-svg' ) - .appendTo( document.body ) .html( 'svg width=0 height=0' + 'defs' + @@ -64,10 +64,10 @@ 'clippath id=mwe-popups-landscape-mask-flip' + 'polygon points=0 0, 1000 0, 1000 243, 190 243, 182 250, 174 243, 0 243/' + '/clippath' + - '/defs' + '/svg' - ); + ) + .appendTo( document.body ); return true; }; @@ -78,9 +78,11 @@ */ mw.popups.createPopupElement = function () { mw.popups.$popup = $( 'div' ) - .attr( 'role', 'tooltip' ) - .attr( 'aria-hidden', 'true' ) - .addClass( 'mwe-popups' ) + .attr( { + 'class': 'mwe-popups', + 'role': 'tooltip', + 'aria-hidden': 'true' + } ) .appendTo( document.body ); }; diff --git a/resources/ext.popups.renderer.article.js b/resources/ext.popups.renderer.article.js index 720c8d3..0e847a1 100644 --- a/resources/ext.popups.renderer.article.js +++ b/resources/ext.popups.renderer.article.js @@ -1,4 +1,5 @@ ( function ( $, mw ) { + 'use strict'; /** * @class mw.popups.render.article @@ -395,7 +396,6 @@ if ( !svg flippedY !tall ) { $( '.mwe-popups-extract' ).css( 'margin-top', '206px' ); - } if ( flippedY ) { -- To view, visit https://gerrit.wikimedia.org/r/134269 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e0870b108e978d7fd4093a6e7201fb6260f2e88 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Inputbox: Some code conventions cleanup - change (mediawiki...InputBox)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133961 Change subject: Inputbox: Some code conventions cleanup .. Inputbox: Some code conventions cleanup Change-Id: I16fcd16d81a7eecc845b5d36fd8af8e14792eea1 --- M InputBox.classes.php M InputBox.hooks.php M InputBox.php 3 files changed, 28 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox refs/changes/61/133961/1 diff --git a/InputBox.classes.php b/InputBox.classes.php index ef2d0c6..f747e09 100644 --- a/InputBox.classes.php +++ b/InputBox.classes.php @@ -48,7 +48,7 @@ public function render() { // Handle various types - switch( $this-mType ) { + switch ( $this-mType ) { case 'create': case 'comment': return $this-getCreateForm(); @@ -118,7 +118,7 @@ ) ); - if( $this-mPrefix != '' ){ + if ( $this-mPrefix != '' ) { $htmlOut .= Xml::element( 'input', array( 'name' = 'prefix', @@ -148,9 +148,9 @@ } $mainMsg = wfMessage( 'inputbox-ns-main' )-inContentLanguage()-text(); - if( $userNS == 'Main' || $userNS == $mainMsg ) { + if ( $userNS == 'Main' || $userNS == $mainMsg ) { $i = 0; - } elseif( array_search( $userNS, $namespaces ) ) { + } elseif ( array_search( $userNS, $namespaces ) ) { $i = array_search( $userNS, $namespaces ); } elseif ( isset( $nsAliases[$userNS] ) ) { $i = $nsAliases[$userNS]; @@ -158,13 +158,13 @@ continue; # Namespace not recognized, skip } $showNamespaces[$i] = $userNS; - if( isset( $checkedNS[$userNS] ) $checkedNS[$userNS] ) { + if ( isset( $checkedNS[$userNS] ) $checkedNS[$userNS] ) { $checkedNS[$i] = true; } } # Show valid namespaces - foreach( $showNamespaces as $i = $name ) { + foreach ( $showNamespaces as $i = $name ) { $checked = array(); // Namespace flagged with ** or if it's the only one if ( ( isset( $checkedNS[$i] ) $checkedNS[$i] ) || count( $showNamespaces ) == 1 ) { @@ -200,7 +200,7 @@ // Line break $htmlOut .= $this-mBR; - } elseif( $type == 'search' ) { + } elseif ( $type == 'search' ) { // Go button $htmlOut .= Xml::element( 'input', array( @@ -224,7 +224,7 @@ ); // Hidden fulltext param for IE (bug 17161) - if( $type == 'fulltext' ) { + if ( $type == 'fulltext' ) { $htmlOut .= Html::hidden( 'fulltext', 'Search' ); } @@ -333,7 +333,7 @@ 'action' = $wgScript, 'method' = 'get' ); - if( $this-mID !== '' ) { + if ( $this-mID !== '' ) { $createBoxParams['id'] = Sanitizer::escapeId( $this-mID ); } $htmlOut .= Xml::openElement( 'form', $createBoxParams ); @@ -443,7 +443,7 @@ 'action' = $wgScript, 'method' = 'get' ); - if( $this-mID !== '' ) { + if ( $this-mID !== '' ) { $moveBoxParams['id'] = Sanitizer::escapeId( $this-mID ); } $htmlOut .= Xml::openElement( 'form', $moveBoxParams ); @@ -515,7 +515,7 @@ 'action' = $wgScript, 'method' = 'get' ); - if( $this-mID !== '' ) { + if ( $this-mID !== '' ) { $commentFormParams['id'] = Sanitizer::escapeId( $this-mID ); } $htmlOut .= Xml::openElement( 'form', $commentFormParams ); diff --git a/InputBox.hooks.php b/InputBox.hooks.php index 75fe679..624d250 100644 --- a/InputBox.hooks.php +++ b/InputBox.hooks.php @@ -22,7 +22,7 @@ $request = $special-getRequest();
[MediaWiki-commits] [Gerrit] InputBox: Cleanup usage of inline styles - change (mediawiki...InputBox)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133962 Change subject: InputBox: Cleanup usage of inline styles .. InputBox: Cleanup usage of inline styles Change-Id: I2e1384e1f46e8592ecba7bbfea81884804f0128a --- M InputBox.classes.php M InputBox.php A resources/ext.inputBox.styles.css 3 files changed, 40 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox refs/changes/62/133962/1 diff --git a/InputBox.classes.php b/InputBox.classes.php index ef2d0c6..f42ddcd 100644 --- a/InputBox.classes.php +++ b/InputBox.classes.php @@ -44,6 +44,7 @@ // Split caches by language, to make sure visitors do not see a cached // version in a random language (since labels are in the user language) $this-mParser-getOptions()-getUserLangObj(); + $this-mParser-getOutput()-addModuleStyles( 'ext.inputBox.styles' ); } public function render() { @@ -95,7 +96,8 @@ // Build HTML $htmlOut = Xml::openElement( 'div', array( - 'style' = 'margin-left: auto; margin-right: auto; text-align: center; background-color:' . $this-mBGColor + 'class' = 'mw-inputbox-centered', + 'style' = $this-bgColorStyle(), ) ); $htmlOut .= Xml::openElement( 'form', @@ -183,7 +185,7 @@ ); } else { // Checkbox - $htmlOut .= ' div class=inputbox-element style=display: inline; white-space: nowrap;'; + $htmlOut .= ' div class=inputbox-element'; $htmlOut .= Xml::element( 'input', array( 'type' = 'checkbox', @@ -256,16 +258,14 @@ array( 'name' = 'bodySearch' . $id, 'id' = 'bodySearch' . $id, - 'class' = 'bodySearch', + 'class' = 'bodySearch' . ( $this-mInline ? ' mw-inputbox-inline' : '' ), 'action' = SpecialPage::getTitleFor( 'Search' )-getLocalUrl(), - 'style' = $this-mInline ? 'display: inline;' : '' ) ); $htmlOut .= Xml::openElement( 'div', array( - 'class' = 'bodySearchWrap', - 'style' = 'background-color:' . $this-mBGColor . ';' . - $this-mInline ? 'display: inline;' : '' + 'class' = 'bodySearchWrap' . ( $this-mInline ? ' mw-inputbox-inline' : '' ), + 'style' = $this-bgColorStyle(), ) ); $htmlOut .= $htmlLabel; @@ -324,7 +324,8 @@ $htmlOut = Xml::openElement( 'div', array( - 'style' = 'margin-left: auto; margin-right: auto; text-align: center; background-color:' . $this-mBGColor + 'class' = 'mw-inputbox-centered', + 'style' = $this-bgColorStyle(), ) ); $createBoxParams = array( @@ -434,7 +435,8 @@ $htmlOut = Xml::openElement( 'div', array( - 'style' = 'margin-left: auto; margin-right: auto; text-align: center; background-color:' . $this-mBGColor + 'class' = 'mw-inputbox-centered', + 'style' = $this-bgColorStyle(), ) ); $moveBoxParams = array( @@ -506,7 +508,8 @@ $htmlOut = Xml::openElement( 'div', array( - 'style' = 'margin-left: auto; margin-right: auto; text-align: center; background-color:' . $this-mBGColor + 'class' = 'mw-inputbox-centered', + 'style' = $this-bgColorStyle(), ) ); $commentFormParams = array( @@ -664,4 +667,11 @@ REGEX; return (bool) preg_match( $regex, $color ); } + + private function bgColorStyle() { + if ( $this-mBGColor != 'transparent' ) { + return 'background-color: ' . $this-mBGColor . ';'; + } + return ''; + } } diff
[MediaWiki-commits] [Gerrit] InputBox: Don't append id to class - change (mediawiki...InputBox)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133963 Change subject: InputBox: Don't append id to class .. InputBox: Don't append id to class The search2 form type was adding the id to the classname. Probably a left over from a rewrite. Change-Id: I0f8c962a3fdadd7555c2b8add93e2b131aedece9 --- M InputBox.classes.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox refs/changes/63/133963/1 diff --git a/InputBox.classes.php b/InputBox.classes.php index ef2d0c6..fae28ec 100644 --- a/InputBox.classes.php +++ b/InputBox.classes.php @@ -283,7 +283,7 @@ 'type' = 'submit', 'name' = 'go', 'value' = $this-mButtonLabel, - 'class' = 'bodySearchBtnGo' . $id + 'class' = 'bodySearchBtnGo', ) ); -- To view, visit https://gerrit.wikimedia.org/r/133963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f8c962a3fdadd7555c2b8add93e2b131aedece9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/InputBox Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] tipsy: Merge some upstream changes - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133973 Change subject: tipsy: Merge some upstream changes .. tipsy: Merge some upstream changes 4b3e29f: Remove superfluous slash 23994f5: tipsy object proxy method tolerates null object 2d916c6: Always ensure native tooltip is restored Change-Id: Id87ba461265730a56a3212c003b8321bd53a6096 --- M resources/src/jquery.tipsy/jquery.tipsy.js 1 file changed, 15 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/73/133973/1 diff --git a/resources/src/jquery.tipsy/jquery.tipsy.js b/resources/src/jquery.tipsy/jquery.tipsy.js index f920e8b..985cd83 100644 --- a/resources/src/jquery.tipsy/jquery.tipsy.js +++ b/resources/src/jquery.tipsy/jquery.tipsy.js @@ -12,17 +12,11 @@ return (typeof thing == 'function') ? (thing.call(ctx)) : thing; } -function fixTitle($ele) { -if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') { -$ele.attr('original-title', $ele.attr('title') || '').removeAttr('title'); -} -} - function Tipsy(element, options) { this.$element = $(element); this.options = options; this.enabled = true; -fixTitle(this.$element); +this.fixTitle(); } Tipsy.prototype = { @@ -104,9 +98,17 @@ } }, + +fixTitle: function() { +var $e = this.$element; +if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { +$e.attr('original-title', $e.attr('title') || '').removeAttr('title'); +} +}, + getTitle: function() { var title, $e = this.$element, o = this.options; -fixTitle($e); +this.fixTitle(); if (typeof o.title == 'string') { title = $e.attr(o.title == 'title' ? 'original-title' : o.title); } else if (typeof o.title == 'function') { @@ -118,7 +120,7 @@ tip: function() { if (!this.$tip) { -this.$tip = $('div class=tipsy/div').html('div class=tipsy-arrow/divdiv class=tipsy-inner//div'); +this.$tip = $('div class=tipsy/div').html('div class=tipsy-arrow/divdiv class=tipsy-inner/div'); } return this.$tip; }, @@ -141,7 +143,9 @@ if (options === true) { return this.data('tipsy'); } else if (typeof options == 'string') { -return this.data('tipsy')[options](); +var tipsy = this.data('tipsy'); +if (tipsy) tipsy[options](); +return this; } options = $.extend({}, $.fn.tipsy.defaults, options); @@ -161,6 +165,7 @@ if (options.delayIn == 0) { tipsy.show(); } else { +tipsy.fixTitle(); setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); } }; -- To view, visit https://gerrit.wikimedia.org/r/133973 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id87ba461265730a56a3212c003b8321bd53a6096 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Tipsy: Added viewable region bounds checking to tipsy - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133975 Change subject: Tipsy: Added viewable region bounds checking to tipsy .. Tipsy: Added viewable region bounds checking to tipsy Merge of upstream: 5a8253f Bug: 44382 Change-Id: I984a99a18efbb9722e820e5e5828bc6289a9a673 --- M resources/src/jquery.tipsy/jquery.tipsy.js 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/75/133975/1 diff --git a/resources/src/jquery.tipsy/jquery.tipsy.js b/resources/src/jquery.tipsy/jquery.tipsy.js index 985cd83..58a99a5 100644 --- a/resources/src/jquery.tipsy/jquery.tipsy.js +++ b/resources/src/jquery.tipsy/jquery.tipsy.js @@ -225,4 +225,35 @@ return $(this).offset().left ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; }; +/** + * yields a closure of the supplied parameters, producing a function that takes + * no arguments and is suitable for use as an autogravity function like so: + * + * @param margin (int) - distance from the viewable region edge that an + *element should be before setting its tooltip's gravity to be away + *from that edge. + * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer + *if there are no viewable region edges effecting the tooltip's + *gravity. It will try to vary from this minimally, for example, + *if 'sw' is preferred and an element is near the right viewable + *region edge, but not the top edge, it will set the gravity for + *that element's tooltip to be 'se', preserving the southern + *component. + */ + $.fn.tipsy.autoBounds = function(margin, prefer) { +return function() { +var dir = {ns: prefer[0], ew: (prefer.length 1 ? prefer[1] : false)}, +boundTop = $(document).scrollTop() + margin, +boundLeft = $(document).scrollLeft() + margin, +$this = $(this); + +if ($this.offset().top boundTop) dir.ns = 'n'; +if ($this.offset().left boundLeft) dir.ew = 'w'; +if ($(window).width() + $(document).scrollLeft() - $this.offset().left margin) dir.ew = 'e'; +if ($(window).height() + $(document).scrollTop() - $this.offset().top margin) dir.ns = 's'; + +return dir.ns + (dir.ew ? dir.ew : ''); +} +}; + })(jQuery); -- To view, visit https://gerrit.wikimedia.org/r/133975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I984a99a18efbb9722e820e5e5828bc6289a9a673 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Tipsy: Improve accessibility slightly - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/134042 Change subject: Tipsy: Improve accessibility slightly .. Tipsy: Improve accessibility slightly - use role tooltip - use aria-hidden when element is hidden - use focus and blur in case of trigger:hover as well Change-Id: Ib7746458e11e068e43cdc3c168751e81f9d9876e --- M resources/src/jquery.tipsy/jquery.tipsy.js 1 file changed, 24 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/134042/1 diff --git a/resources/src/jquery.tipsy/jquery.tipsy.js b/resources/src/jquery.tipsy/jquery.tipsy.js index 58a99a5..15a405c 100644 --- a/resources/src/jquery.tipsy/jquery.tipsy.js +++ b/resources/src/jquery.tipsy/jquery.tipsy.js @@ -16,6 +16,7 @@ this.$element = $(element); this.options = options; this.enabled = true; +this.keyHandler = $.proxy( this.closeOnEsc, this ); this.fixTitle(); } @@ -30,7 +31,10 @@ if (this.options.className) { $tip.addClass(maybeCall(this.options.className, this.$element[0])); } -$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); +$tip.remove() +.css({top: 0, left: 0, visibility: 'hidden', display: 'block'}) +.attr( 'aria-hidden', 'false' ) +.appendTo(document.body); var pos = $.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth, @@ -82,15 +86,22 @@ } $tip.css(tp); +$( document ).on( 'keydown', this.keyHandler ); if (this.options.fade) { -$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}, 100); +$tip.stop() +.css({opacity: 0, display: 'block', visibility: 'visible'}) +.attr( 'aria-hidden', 'false' ) +.animate({opacity: this.options.opacity}, 100); } else { -$tip.css({visibility: 'visible', opacity: this.options.opacity}); +$tip +.css({visibility: 'visible', opacity: this.options.opacity}) +.attr( 'aria-hidden', 'false' ); } } }, hide: function() { +$( document ).off( 'keydown', this.keyHandler ); if (this.options.fade) { this.tip().stop().fadeOut(100, function() { $(this).remove(); }); } else { @@ -120,7 +131,7 @@ tip: function() { if (!this.$tip) { -this.$tip = $('div class=tipsy/div').html('div class=tipsy-arrow/divdiv class=tipsy-inner/div'); +this.$tip = $('div class=tipsy role=tooltip/div').html('div class=tipsy-arrow/divdiv class=tipsy-inner/div'); } return this.$tip; }, @@ -130,6 +141,13 @@ this.hide(); this.$element = null; this.options = null; +} +}, + +// $.proxy event handler +closeOnEsc: function ( e ) { +if ( e.keyCode === 27 ) { +this.hide(); } }, @@ -184,8 +202,8 @@ if (options.trigger != 'manual') { var binder = options.live ? 'live' : 'bind', -eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', -eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; +eventIn = options.trigger == 'hover' ? 'mouseenter focus' : 'focus', +eventOut = options.trigger == 'hover' ? 'mouseleave blur' : 'blur'; this[binder](eventIn, enter)[binder](eventOut, leave); } -- To view, visit https://gerrit.wikimedia.org/r/134042 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7746458e11e068e43cdc3c168751e81f9d9876e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.textSelection: Don't throw errors on empty collections - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/133942 Change subject: jquery.textSelection: Don't throw errors on empty collections .. jquery.textSelection: Don't throw errors on empty collections All jQuery functions just do nothing or return empty values when called on an empty collection (e.g. `$()`), the ones defined in this module should behave in the same way. This came to light when a change in WikiEditor combined with lousy coding caused this code path to be called, breaking various gadgets and extensions like SemanticForms. Bug: 64289 Change-Id: Ib97f47ef1d66420682bd429c9c12e66c3392e77d (cherry picked from commit 2828669dd40f63f60c2391b6d5ee30a3e255f3db) --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/133942/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 7262fe6..4540fb0 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -70,7 +70,7 @@ var retval, range, el = this.get( 0 ); - if ( $(el).is( ':hidden' ) ) { + if ( !el || $( el ).is( ':hidden' ) ) { retval = ''; } else if ( document.selection document.selection.createRange ) { activateElementOnIE( el ); @@ -279,7 +279,7 @@ // Range containing text after the selection postRange; - if ( document.selection document.selection.createRange ) { + if ( e document.selection document.selection.createRange ) { // IE doesn't properly report non-selected caret position through // the selection ranges when textarea isn't focused. This can // lead to saving a bogus empty selection, which then screws up @@ -349,7 +349,7 @@ } while ( ( !preFinished || !periFinished || !postFinished ) ); caretPos = rawPreText.replace( /\r\n/g, '\n' ).length; endPos = caretPos + rawPeriText.replace( /\r\n/g, '\n' ).length; - } else if ( e.selectionStart || e.selectionStart === 0 ) { + } else if ( e ( e.selectionStart || e.selectionStart === 0 ) ) { // Firefox support caretPos = e.selectionStart; endPos = e.selectionEnd; -- To view, visit https://gerrit.wikimedia.org/r/133942 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib97f47ef1d66420682bd429c9c12e66c3392e77d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_23 Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Bartosz DziewoĆski matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits