r58541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58540‎ | r58541 | r58542 >
Date:14:12, 4 November 2009
Author:catrope
Status:deferred
Tags:
Comment:
usability: Update acaifix branch with acaifix revs. Remove ClickTracking so I can re-add it at the latest version
Modified paths:
  • /branches/usability/acaifix/ClickTracking (deleted) (history)
  • /branches/usability/acaifix/CollapsibleTabs (added) (history)
  • /branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.js (replaced) (history)
  • /branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.php (replaced) (history)
  • /branches/usability/acaifix/EditToolbar/EditToolbar.hooks.php (modified) (history)
  • /branches/usability/acaifix/EditToolbar/EditToolbar.i18n.php (modified) (history)
  • /branches/usability/acaifix/EditToolbar/EditToolbar.js (modified) (history)
  • /branches/usability/acaifix/EditToolbar/EditToolbar.php (modified) (history)
  • /branches/usability/acaifix/Makefile (modified) (history)
  • /branches/usability/acaifix/NavigableTOC/NavigableTOC.php (modified) (history)
  • /branches/usability/acaifix/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/usability/acaifix/css/combined.css (modified) (history)
  • /branches/usability/acaifix/css/combined.min.css (modified) (history)
  • /branches/usability/acaifix/css/wikiEditor.toc.css (modified) (history)
  • /branches/usability/acaifix/css/wikiEditor.toolbar.css (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-big.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-bold.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-indent.png (added) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-italic.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-small.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-subscript.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/format-superscript.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/indent.png (deleted) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-big.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-bold.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-italic.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-small.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-subscript.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-superscript.png (modified) (history)
  • /branches/usability/acaifix/images/wikiEditor/toolbar/png24/insert-newline.png (modified) (history)
  • /branches/usability/acaifix/js/plugins.combined.js (modified) (history)
  • /branches/usability/acaifix/js/plugins.combined.min.js (modified) (history)
  • /branches/usability/acaifix/js/plugins/jquery.autoEllipse.js (modified) (history)
  • /branches/usability/acaifix/js/plugins/jquery.collapsibleTabs.js (added) (history)
  • /branches/usability/acaifix/js/plugins/jquery.suggestions.js (modified) (history)
  • /branches/usability/acaifix/js/plugins/jquery.textSelection.js (modified) (history)
  • /branches/usability/acaifix/js/plugins/jquery.wikiEditor.editor.js (added) (history)
  • /branches/usability/acaifix/js/plugins/jquery.wikiEditor.toc.js (modified) (history)
  • /branches/usability/acaifix/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.php
@@ -0,0 +1,41 @@
 2+<?php
 3+/**
 4+ * Usability Initiative CollapsibleTabs extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ *
 9+ * This file contains the include file for the CollapsibleTabs portion of the
 10+ * UsabilityInitiative extension of MediaWiki.
 11+ *
 12+ * Usage: Include the following line in your LocalSettings.php
 13+ * require_once( "$IP/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.php" );
 14+ *
 15+ * @author Adam Miller <amiller@wikimedia.org>
 16+ * @license GPL v2 or later
 17+ * @version 0.0.7
 18+ */
 19+
 20+/* Configuration */
 21+// Bump the version number every time you change any of the .css/.js files
 22+$wgCollapsibleTabsStyleVersion = 8;
 23+
 24+/* Setup */
 25+
 26+// Credits
 27+$wgExtensionCredits['other'][] = array(
 28+ 'path' => __FILE__,
 29+ 'name' => 'CollapsibleTabs',
 30+ 'author' => 'Adam Miller',
 31+ 'version' => '0.0.7',
 32+ 'url' => 'http://www.mediawiki.org/wiki/Extension:CollapsibleTabs',
 33+ 'descriptionmsg' => 'collapsibletabs-desc',
 34+);
 35+// Includes parent extension
 36+require_once( dirname( dirname( __FILE__ ) ) . "/UsabilityInitiative.php" );
 37+
 38+// Adds Autoload Classes
 39+$wgAutoloadClasses['CollapsibleTabsHooks'] =
 40+ dirname( __FILE__ ) . '/CollapsibleTabs.hooks.php';
 41+
 42+$wgHooks['AjaxAddScript'][] = 'CollapsibleTabsHooks::initialize';
Property changes on: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.php
___________________________________________________________________
Added: svn:eol-style
143 + native
Index: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.hooks.php
@@ -0,0 +1,25 @@
 2+<?php
 3+/**
 4+ * Hooks for Usability Initiative Collapsing Tabs extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+class CollapsibleTabsHooks {
 11+
 12+ /* Static Functions */
 13+
 14+ /**
 15+ * intialize hook
 16+ */
 17+ public static function initialize( $out ) {
 18+ global $wgCollapsibleTabsStyleVersion;
 19+ UsabilityInitiativeHooks::initialize();
 20+ UsabilityInitiativeHooks::addScript(
 21+ 'CollapsibleTabs/CollapsibleTabs.js', $wgCollapsibleTabsStyleVersion
 22+ );
 23+ return true;
 24+ }
 25+
 26+}
Property changes on: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.hooks.php
___________________________________________________________________
Added: svn:eol-style
127 + native
Index: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.js
@@ -0,0 +1,72 @@
 2+js2AddOnloadHook( function() {
 3+
 4+ var rtl = $j( 'body.rtl' ).size() ? true : false;
 5+
 6+ //Overloading the moveToCollapsed function to animate the transition
 7+ $j.collapsibleTabs.moveToCollapsed = function( ele ) {
 8+ var $moving = $j(ele);
 9+ $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = true;
 10+ var data = $moving.data('collapsibleTabsSettings');
 11+ // Remove the element from where it's at and put it in the dropdown menu
 12+ var target = $moving.data('collapsibleTabsSettings').collapsedContainer;
 13+ $moving.css("position", "relative").css( ( rtl ? 'left' : 'right'), 0 );
 14+ $moving.animate({width: '1px'},"normal",function(){
 15+ $j(this).hide();
 16+ // add the placeholder
 17+ $j('<span class="placeholder" style="display:none;"></span>').insertAfter(this);
 18+ $j(this).remove().prependTo(target).data('collapsibleTabsSettings', data);
 19+ $j(this).attr('style', 'display:list-item;');
 20+ $j($j(ele).data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = false;
 21+ $j.collapsibleTabs.handleResize();
 22+ });
 23+ };
 24+
 25+ // Overloading the moveToExpanded function to animate the transition
 26+ $j.collapsibleTabs.moveToExpanded = function( ele ) {
 27+ var $moving = $j(ele);
 28+ $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = true;
 29+ var data = $moving.data('collapsibleTabsSettings');
 30+ // grab the next appearing placeholder so we can use it for replacing
 31+ var $target = $j($moving.data('collapsibleTabsSettings').expandedContainer).find('span.placeholder:first');
 32+ var expandedWidth = $moving.data('collapsibleTabsSettings').expandedWidth;
 33+ $moving.css("position", "relative").css( ( rtl ? 'right' : 'left'), 0 ).css('width','1px');
 34+ $target.replaceWith($moving.remove().css('width','1px').data('collapsibleTabsSettings', data)
 35+ .animate({width: expandedWidth+"px"}, "normal", function(){
 36+ $j(this).attr('style', 'display:block;');
 37+ $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = false;
 38+ $j.collapsibleTabs.handleResize();
 39+ }));
 40+ };
 41+
 42+ // Bind callback functions to animate our drop down menu in and out
 43+ // and then call the collapsibleTabs function on the menu
 44+ $j('#p-views ul').bind("beforeTabCollapse", function(){
 45+ if($j('#p-cactions').css('display')=='none')
 46+ $j("#p-cactions").addClass("filledPortlet").removeClass("emptyPortlet")
 47+ .find('h5').css('width','1px').animate({'width':'26px'}, 390);
 48+ }).bind("beforeTabExpand", function(){
 49+ if($j('#p-cactions li').length==1)
 50+ $j("#p-cactions h5").animate({'width':'1px'},370, function(){
 51+ $j(this).attr('style','').parent().addClass("emptyPortlet").removeClass("filledPortlet");
 52+ });
 53+ }).collapsibleTabs({
 54+ expandCondition: function(eleWidth) {
 55+ if( rtl ){
 56+ return ( $j('#right-navigation').position().left + $j('#right-navigation').width())
 57+ < ($j('#left-navigation').position().left - eleWidth);
 58+ } else {
 59+ return ( $j('#left-navigation').position().left + $j('#left-navigation').width())
 60+ < ($j('#right-navigation').position().left - eleWidth);
 61+ }
 62+ },
 63+ collapseCondition: function() {
 64+ if( rtl ){
 65+ return ( $j('#right-navigation').position().left + $j('#right-navigation').width())
 66+ > $j('#left-navigation').position().left;
 67+ } else {
 68+ return ( $j('#left-navigation').position().left + $j('#left-navigation').width())
 69+ > $j('#right-navigation').position().left;
 70+ }
 71+ }
 72+ });
 73+});
\ No newline at end of file
Property changes on: branches/usability/acaifix/CollapsibleTabs/CollapsibleTabs.js
___________________________________________________________________
Added: svn:eol-style
174 + native
Index: branches/usability/acaifix/UsabilityInitiative.hooks.php
@@ -20,17 +20,17 @@
2121 'raw' => array(
2222 array( 'src' => 'css/suggestions.css', 'version' => 6 ),
2323 array( 'src' => 'css/wikiEditor.css', 'version' => 4 ),
24 - array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 6 ),
 24+ array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 7 ),
2525 array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 2 ),
26 - array( 'src' => 'css/wikiEditor.toc.css', 'version' => 6 ),
 26+ array( 'src' => 'css/wikiEditor.toc.css', 'version' => 10 ),
2727 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
2828 ),
2929 'combined' => array(
30 - array( 'src' => 'css/combined.css', 'version' => 11 ),
 30+ array( 'src' => 'css/combined.css', 'version' => 16 ),
3131 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
3232 ),
3333 'minified' => array(
34 - array( 'src' => 'css/combined.min.css', 'version' => 11 ),
 34+ array( 'src' => 'css/combined.min.css', 'version' => 16 ),
3535 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
3636 ),
3737 )
@@ -58,23 +58,24 @@
5959 'base_sets' => array(
6060 'raw' => array(
6161 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
62 - array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 3 ),
 62+ array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 4 ),
6363 array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 3 ),
 64+ array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 5 ),
6465 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ),
6566 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
6667 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
67 - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 4 ),
68 - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 16 ),
 68+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ),
 69+ array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 17 ),
6970 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ),
70 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 12 ),
71 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 5 ),
72 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 20 ),
 71+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 18 ),
 72+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 8 ),
 73+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 27 ),
7374 ),
7475 'combined' => array(
75 - array( 'src' => 'js/plugins.combined.js', 'version' => 44 ),
 76+ array( 'src' => 'js/plugins.combined.js', 'version' => 60 ),
7677 ),
7778 'minified' => array(
78 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 44 ),
 79+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 60 ),
7980 ),
8081 ),
8182 );
Index: branches/usability/acaifix/images/wikiEditor/toolbar/indent.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-subscript.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-bold.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-big.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-italic.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-small.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/insert-newline.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-subscript.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-bold.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/png24/format-superscript.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-indent.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/usability/acaifix/images/wikiEditor/toolbar/format-indent.png
___________________________________________________________________
Added: svn:mime-type
8283 + application/octet-stream
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-superscript.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-big.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-italic.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/images/wikiEditor/toolbar/format-small.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: branches/usability/acaifix/EditToolbar/EditToolbar.js
@@ -147,10 +147,12 @@
148148 'heading-2' : {
149149 labelMsg: 'edittoolbar-tool-heading-2',
150150 action: {
151 - type: 'encapsulate',
 151+ type: 'replace',
152152 options: {
153153 pre: "==",
154154 periMsg: 'edittoolbar-tool-heading-example',
 155+ periRegex: /^(={1,6})(.*?)\1\s*$/,
 156+ periRegexReplace: "\$2",
155157 post: "=="
156158 }
157159 }
@@ -158,9 +160,11 @@
159161 'heading-3' : {
160162 labelMsg: 'edittoolbar-tool-heading-3',
161163 action: {
162 - type: 'encapsulate',
 164+ type: 'replace',
163165 options: {
164 - pre: "===",
 166+ pre: "===",
 167+ periRegex: /^(={1,6})(.*?)\1\s*$/,
 168+ periRegexReplace: "\$2",
165169 periMsg: 'edittoolbar-tool-heading-example',
166170 post: "==="
167171 }
@@ -169,9 +173,11 @@
170174 'heading-4' : {
171175 labelMsg: 'edittoolbar-tool-heading-4',
172176 action: {
173 - type: 'encapsulate',
 177+ type: 'replace',
174178 options: {
175 - pre: "====",
 179+ pre: "====",
 180+ periRegex: /^(={1,6})(.*?)\1\s*$/,
 181+ periRegexReplace: "\$2",
176182 periMsg: 'edittoolbar-tool-heading-example',
177183 post: "===="
178184 }
@@ -180,9 +186,11 @@
181187 'heading-5' : {
182188 labelMsg: 'edittoolbar-tool-heading-5',
183189 action: {
184 - type: 'encapsulate',
 190+ type: 'replace',
185191 options: {
186 - pre: "=====",
 192+ pre: "=====",
 193+ periRegex: /^(={1,6})(.*?)\1\s*$/,
 194+ periRegexReplace: "\$2",
187195 periMsg: 'edittoolbar-tool-heading-example',
188196 post: "====="
189197 }
@@ -222,6 +230,19 @@
223231 ownline: true
224232 }
225233 }
 234+ },
 235+ 'indent': {
 236+ labelMsg: 'edittoolbar-tool-indent',
 237+ type: 'button',
 238+ icon: 'format-indent.png',
 239+ action: {
 240+ type: 'encapsulate',
 241+ options: {
 242+ pre: ":",
 243+ post: "",
 244+ ownline: true
 245+ }
 246+ }
226247 }
227248 }
228249 },
@@ -820,14 +841,17 @@
821842 'format': 'json'
822843 },
823844 success: function( data ) {
824 - // TODO: What happens if data.query.pageids is undefined?
825 - var page = data.query.pages[data.query.pageids[0]];
826 - var status = 'exists';
827 - if ( typeof page.missing != 'undefined' )
828 - status = 'notexists';
829 - else if ( typeof page.invalid != 'undefined' )
 845+ var status;
 846+ if ( typeof data.query == 'undefined' ) {
830847 status = 'invalid';
831 -
 848+ } else {
 849+ var page = data.query.pages[data.query.pageids[0]];
 850+ status = 'exists';
 851+ if ( typeof page.missing != 'undefined' )
 852+ status = 'notexists';
 853+ else if ( typeof page.invalid != 'undefined' )
 854+ status = 'invalid';
 855+ }
832856 cache[target] = status;
833857 updateWidget( status );
834858 }
@@ -1190,12 +1214,12 @@
11911215 <div id="edittoolbar-replace-emptysearch" rel="edittoolbar-tool-replace-emptysearch"></div>\
11921216 <div id="edittoolbar-replace-invalidregex"></div>\
11931217 </div>\
1194 - <fieldset><table><tr>\
 1218+ <fieldset><table style="width: 100%;"><tr>\
11951219 <td><label for="edittoolbar-replace-search" rel="edittoolbar-tool-replace-search"></label></td>\
1196 - <td><input type="text" id="edittoolbar-replace-search" /></td>\
 1220+ <td><input type="text" id="edittoolbar-replace-search" style="width: 100%;" /></td>\
11971221 </tr><tr>\
11981222 <td><label for="edittoolbar-replace-replace" rel="edittoolbar-tool-replace-replace"></label></td>\
1199 - <td><input type="text" id="edittoolbar-replace-replace" /></td>\
 1223+ <td><input type="text" id="edittoolbar-replace-replace" style="width: 100%;" /></td>\
12001224 </tr></table><table><tr>\
12011225 <td><input type="checkbox" id="edittoolbar-replace-case" /></td>\
12021226 <td><label for="edittoolbar-replace-case" rel="edittoolbar-tool-replace-case"></label></td>\
@@ -1226,7 +1250,7 @@
12271251 return;
12281252 }
12291253 var replaceStr = $j( '#edittoolbar-replace-replace' ).val();
1230 - var flags = '';
 1254+ var flags = 'm';
12311255 var matchCase = $j( '#edittoolbar-replace-case' ).is( ':checked' );
12321256 var isRegex = $j( '#edittoolbar-replace-regex' ).is( ':checked' );
12331257 if ( !matchCase ) {
@@ -1318,8 +1342,8 @@
13191343 $j(this).data( 'offset', 0 );
13201344 $j( '#edittoolbar-replace-search' ).focus();
13211345 $j( '#edittoolbar-replace-nomatch, #edittoolbar-replace-success, #edittoolbar-replace-emptysearch, #edittoolbar-replace-invalidregex' ).hide();
1322 - if ( !( $j(this).data( 'dialogkeypressset' ) ) ) {
1323 - $j(this).data( 'dialogkeypressset', true );
 1346+ if ( !( $j(this).data( 'onetimeonlystuff' ) ) ) {
 1347+ $j(this).data( 'onetimeonlystuff', true );
13241348 // Execute the action associated with the first button
13251349 // when the user presses Enter
13261350 $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
@@ -1328,6 +1352,11 @@
13291353 e.preventDefault();
13301354 }
13311355 });
 1356+ // Make tabbing to a button and pressing
 1357+ // Enter do what people expect
 1358+ $j(this).closest( '.ui-dialog' ).find( 'button' ).focus( function() {
 1359+ $j(this).closest( '.ui-dialog' ).data( 'dialogaction', this );
 1360+ });
13321361 }
13331362 var dialog = $j(this).closest( '.ui-dialog' );
13341363 $j(this).data( 'context' ).$textarea.bind( 'keypress.srdialog', function( e ) {
Index: branches/usability/acaifix/EditToolbar/EditToolbar.i18n.php
@@ -42,6 +42,7 @@
4343 'edittoolbar-tool-link-int-target-status-loading' => 'Checking page existence...',
4444 'edittoolbar-tool-link-int-invalid' => 'The title you specified is invalid.',
4545 'edittoolbar-tool-link-ext-invalid' => 'The URL you specified is invalid.',
 46+ 'edittoolbar-tool-link-empty' => "You didn't enter anything to link to.",
4647 'edittoolbar-tool-file' => 'Embedded file',
4748 'edittoolbar-tool-file-pre' => '$1{{ns:file}}:',
4849 'edittoolbar-tool-file-example' => 'Example.jpg',
Index: branches/usability/acaifix/EditToolbar/EditToolbar.php
@@ -13,13 +13,13 @@
1414 *
1515 * @author Trevor Parscal <tparscal@wikimedia.org>, Roan Kattouw <roan.kattouw@gmail.com>
1616 * @license GPL v2 or later
17 - * @version 0.1.1
 17+ * @version 0.1.3
1818 */
1919
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditToolbarStyleVersion = 58;
 23+$wgEditToolbarStyleVersion = 72;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;
@@ -48,7 +48,7 @@
4949 'path' => __FILE__,
5050 'name' => 'EditToolbar',
5151 'author' => 'Trevor Parscal',
52 - 'version' => '0.1.1',
 52+ 'version' => '0.1.3',
5353 'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative',
5454 'descriptionmsg' => 'edittoolbar-desc',
5555 );
Index: branches/usability/acaifix/EditToolbar/EditToolbar.hooks.php
@@ -60,6 +60,7 @@
6161 'edittoolbar-tool-link-int-target-status-loading',
6262 'edittoolbar-tool-link-int-invalid',
6363 'edittoolbar-tool-link-ext-invalid',
 64+ 'edittoolbar-tool-link-empty',
6465 'edittoolbar-tool-file',
6566 'edittoolbar-tool-file-pre',
6667 'edittoolbar-tool-file-example',
Index: branches/usability/acaifix/js/plugins/jquery.suggestions.js
@@ -163,7 +163,7 @@
164164 * @param updateTextbox If true, put the suggestion in the textbox
165165 */
166166 highlight: function( context, result, updateTextbox ) {
167 - var selected = context.data.$container.find( '.suggestions-result-current' )
 167+ var selected = context.data.$container.find( '.suggestions-result-current' );
168168 if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
169169 if ( result == 'prev' ) {
170170 result = selected.prev();
@@ -232,6 +232,12 @@
233233 case 13:
234234 context.data.$container.hide();
235235 preventDefault = wasVisible;
 236+ if ( typeof context.config.result.select == 'function' ) {
 237+ context.config.result.select.call(
 238+ context.data.$container.find( '.suggestions-result-current' ),
 239+ context.data.$textbox
 240+ );
 241+ }
236242 break;
237243 default:
238244 $.suggestions.update( context, true );
Index: branches/usability/acaifix/js/plugins/jquery.textSelection.js
@@ -3,12 +3,17 @@
44 */
55 ( function( $ ) { $.fn.extend( {
66
 7+/**
 8+ * Get the currently selected text in this textarea. Will focus the textarea
 9+ * in some browsers (IE/Opera)
 10+ */
711 getSelection: function() {
812 var e = this.jquery ? this[0] : this;
913 var retval = '';
1014 if ( e.style.display == 'none' ) {
1115 // Do nothing
1216 } else if ( document.selection && document.selection.createRange ) {
 17+ e.focus();
1318 var range = document.selection.createRange();
1419 retval = range.text;
1520 } else if ( e.selectionStart || e.selectionStart == '0' ) {
Index: branches/usability/acaifix/js/plugins/jquery.wikiEditor.toolbar.js
@@ -222,6 +222,13 @@
223223 parts[part] = ( action.options[part] || '' )
224224 }
225225 }
 226+ if ( 'periRegex' in action.options && 'periRegexReplace' in action.options ) {
 227+ var selection = context.$textarea.getSelection();
 228+ if ( selection != '' ) {
 229+ parts.peri = selection.replace( action.options.periRegex,
 230+ action.options.periRegexReplace );
 231+ }
 232+ }
226233 context.$textarea.encapsulateSelection(
227234 parts.pre, parts.peri, parts.post, action.options.ownline, action.type == 'replace'
228235 );
@@ -326,25 +333,23 @@
327334 .text( label )
328335 .attr( 'rel', id )
329336 .data( 'context', context )
330 - .click(
331 - function() {
332 -
333 - $(this).parent().parent().find( '.page' ).hide();
334 - $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
335 - $(this).siblings().removeClass( 'current' );
336 - $(this).addClass( 'current' );
337 - var section = $(this).parent().parent().attr( 'rel' );
338 -
339 - //click tracking
340 - if($.trackAction != undefined){
341 - $.trackAction(section + '.' + $(this).attr('rel'));
342 - }
343 -
344 - $.cookie(
345 - 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
346 - $(this).attr( 'rel' )
347 - );
348 - } );
 337+ .bind( 'mousedown', function() {
 338+ $(this).parent().parent().find( '.page' ).hide();
 339+ $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
 340+ $(this).siblings().removeClass( 'current' );
 341+ $(this).addClass( 'current' );
 342+ var section = $(this).parent().parent().attr( 'rel' );
 343+
 344+ //click tracking
 345+ if($.trackAction != undefined){
 346+ $.trackAction(section + '.' + $(this).attr('rel'));
 347+ }
 348+
 349+ $.cookie(
 350+ 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
 351+ $(this).attr( 'rel' )
 352+ );
 353+ } );
349354 },
350355 buildPage : function( context, id, page ) {
351356 var $page = $( '<div />' ).attr( {
@@ -451,22 +456,34 @@
452457 .attr( 'href', '#' )
453458 .text( $.wikiEditor.autoMsg( section, 'label' ) )
454459 .data( 'context', context )
455 - .click( function() {
 460+ .bind( 'mouseup', function( e ) {
 461+ $(this).blur();
 462+ } )
 463+ .bind( 'mousedown', function( e ) {
 464+ // Only act when the primary mouse button was pressed
 465+ if ( e.button !== 0 ) {
 466+ return true;
 467+ }
456468 var $sections = $(this).data( 'context' ).$ui.find( '.sections' );
457469 var $section =
458470 $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) );
459 - $(this).blur();
460471 var show = $section.css( 'display' ) == 'none';
461472 $previousSections = $section.parent().find( '.section:visible' );
462473 $previousSections.css( 'position', 'absolute' );
463474 $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } );
464475 $(this).parent().parent().find( 'a' ).removeClass( 'current' );
 476+ $sections.css('overflow', 'hidden');
465477 if ( show ) {
466478 $section.fadeIn( 'fast' );
467 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
 479+ $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() {
 480+ $(this).css('overflow', 'visible').css('height', 'auto');
 481+ } );
468482 $(this).addClass( 'current' );
469483 } else {
470 - $sections.animate( { 'height': 0 } );
 484+ $sections.css('height', $section.outerHeight() )
 485+ .animate( { 'height': 0 }, $section.outerHeight() * 2, function() {
 486+ $(this).css('overflow', 'visible');
 487+ } );
471488 }
472489 // Click tracking
473490 if($.trackAction != undefined){
@@ -477,8 +494,8 @@
478495 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
479496 show ? $section.attr( 'rel' ) : null
480497 );
481 - return false;
482498 } )
 499+ .click( function() { return false; } )
483500 );
484501 },
485502 buildSection : function( context, id, section ) {
@@ -567,7 +584,7 @@
568585 s.$sections.append( $.wikiEditor.modules.toolbar.fn.buildSection( s.context, s.id, s.config ) );
569586 var $section = s.$sections.find( '.section:visible' );
570587 if ( $section.size() ) {
571 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
 588+ $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2 );
572589 }
573590 }
574591 } );
Index: branches/usability/acaifix/js/plugins/jquery.wikiEditor.toc.js
@@ -1,6 +1,4 @@
2 -/**
3 - * TOC Module for wikiEditor
4 - */
 2+/* TOC Module for wikiEditor */
53 ( function( $ ) { $.wikiEditor.modules.toc = {
64
75 /**
@@ -41,7 +39,7 @@
4240 // Add the TOC to the document
4341 $.wikiEditor.modules.toc.fn.build( context, config );
4442 context.$textarea
45 - .delayedBind( 1000, 'keyup encapsulateSelection change',
 43+ .delayedBind( 250, 'mouseup scrollToPosition focus keyup encapsulateSelection change',
4644 function( event ) {
4745 var context = $(this).data( 'wikiEditor-context' );
4846 $(this).eachAsync( {
@@ -53,25 +51,16 @@
5452 } );
5553 }
5654 )
57 - .bind( 'mouseup scrollToPosition focus keyup encapsulateSelection change',
58 - function( event ) {
59 - var context = $(this).data( 'wikiEditor-context' );
60 - $(this).eachAsync( {
61 - bulk: 0,
62 - loop: function() {
63 - $.wikiEditor.modules.toc.fn.update( context );
64 - }
65 - } );
66 - }
67 - )
6855 .blur( function() {
6956 var context = $(this).data( 'wikiEditor-context' );
 57+ context.$textarea.delayedBindCancel( 250,
 58+ 'mouseup scrollToPosition focus keyup encapsulateSelection change' );
7059 $.wikiEditor.modules.toc.fn.unhighlight( context );
7160 });
7261 },
7362
7463 unhighlight: function( context ) {
75 - context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' );
 64+ context.modules.$toc.find( 'div' ).removeClass( 'current' );
7665 },
7766 /**
7867 * Highlight the section the cursor is currently within
@@ -95,8 +84,8 @@
9685 }
9786 section = Math.max( 0, section );
9887 }
99 - var sectionLink = context.modules.$toc.find( 'a.section-' + section );
100 - sectionLink.addClass( 'currentSelection' );
 88+ var sectionLink = context.modules.$toc.find( 'div.section-' + section );
 89+ sectionLink.addClass( 'current' );
10190
10291 // Scroll the highlighted link into view if necessary
10392 var relTop = sectionLink.offset().top - context.modules.$toc.offset().top;
@@ -145,26 +134,26 @@
146135 * @param {Object} structure Structured outline
147136 */
148137 function buildList( structure ) {
149 - var list = $( '<ul />' );
 138+ var list = $( '<ul></ul>' );
150139 for ( i in structure ) {
151 - var item = $( '<li />' )
152 - .append(
153 - $( '<a />' )
154 - .attr( 'href', '#' )
155 - .addClass( 'section-' + structure[i].index )
156 - .data( 'textbox', context.$textarea )
157 - .data( 'position', structure[i].position )
158 - .click( function( event ) {
159 - $(this).data( 'textbox' )
160 - .focus()
161 - .setSelection( $(this).data( 'position' ) )
162 - .scrollToCaretPosition( true );
163 - if ( typeof $.trackAction != 'undefined' )
164 - $.trackAction( 'ntoc.heading' );
165 - event.preventDefault();
166 - } )
167 - .text( structure[i].text )
168 - );
 140+ var div = $( '<div></div>' )
 141+ .attr( 'href', '#' )
 142+ .addClass( 'section-' + structure[i].index )
 143+ .data( 'textbox', context.$textarea )
 144+ .data( 'position', structure[i].position )
 145+ .bind( 'mousedown', function( event ) {
 146+ $(this).data( 'textbox' )
 147+ .focus()
 148+ .setSelection( $(this).data( 'position' ) )
 149+ .scrollToCaretPosition( true );
 150+ if ( typeof $.trackAction != 'undefined' )
 151+ $.trackAction( 'ntoc.heading' );
 152+ event.preventDefault();
 153+ } )
 154+ .text( structure[i].text );
 155+ if ( structure[i].text == '' )
 156+ div.html( '&nbsp;' );
 157+ var item = $( '<li></li>' ).append( div );
169158 if ( structure[i].sections !== undefined ) {
170159 item.append( buildList( structure[i].sections ) );
171160 }
@@ -175,7 +164,7 @@
176165 // Build outline from wikitext
177166 var outline = [];
178167 var wikitext = $.wikiEditor.fixOperaBrokenness( context.$textarea.val() );
179 - var headings = wikitext.match( /^={1,6}.+={1,6}\s*$/gm );
 168+ var headings = wikitext.match( /^={1,6}[^=\n][^\n]*={1,6}\s*$/gm );
180169 var offset = 0;
181170 headings = $.makeArray( headings );
182171 for ( var h = 0; h < headings.length; h++ ) {
@@ -235,18 +224,11 @@
236225 // Recursively build the structure and add special item for
237226 // section 0, if needed
238227 var structure = buildStructure( outline );
239 - if ( $( 'input[name=wpSection]' ).val() == '' )
 228+ if ( $( 'input[name=wpSection]' ).val() == '' ) {
240229 structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 } );
 230+ }
241231 context.modules.$toc.html( buildList( structure ) );
242 -
243 - context.modules.$toc.find( 'ul' ).css( 'width', '10em' );
244 -
245 - var links = context.modules.$toc.find( 'ul a' );
246 - // Highlighted links are wider; autoEllipse links in
247 - // highlighted state
248 - links.addClass( 'currentSelection' );
249 - links.autoEllipse( { 'position': 'right', 'tooltip': true } );
250 - links.removeClass( 'currentSelection' );
 232+ context.modules.$toc.find( 'div' ).autoEllipse( { 'position': 'right', 'tooltip': true } );
251233 // Cache the outline for later use
252234 context.data.outline = outline;
253235 }
Index: branches/usability/acaifix/js/plugins/jquery.wikiEditor.editor.js
@@ -0,0 +1,202 @@
 2+/**
 3+ * TOC Module for wikiEditor
 4+ */
 5+( function( $ ) { $.wikiEditor.modules.$editor = {
 6+
 7+/**
 8+ * API accessible functions
 9+ */
 10+api: {
 11+ //
 12+},
 13+/**
 14+ *
 15+ */
 16+languages: {
 17+ csharp : 'C#',
 18+ css : 'CSS',
 19+ generic : 'Generic',
 20+ html : 'HTML',
 21+ java : 'Java',
 22+ javascript : 'JavaScript',
 23+ perl : 'Perl',
 24+ ruby : 'Ruby',
 25+ php : 'PHP',
 26+ text : 'Text',
 27+ sql : 'SQL',
 28+ vbscript : 'VBScript'
 29+},
 30+/**
 31+ * Internally used functions
 32+ */
 33+fn: {
 34+ create: function( context, config ) {
 35+ context.$textarea
 36+ .attr( 'disabled', true )
 37+ .css( 'overflow', 'hidden' );
 38+ context.modules.editor.$iframe = $( '<iframe></iframe>' )
 39+ .css( {
 40+ 'width': context.$textarea.css( 'width' ),
 41+ 'height': context.$textarea.css( 'height' ),
 42+ 'border': '1px solid gray',
 43+ 'visibility': 'hidden',
 44+ 'position': 'absolute'
 45+ });
 46+ .attr( 'frameborder', 0 )
 47+ context.$textarea
 48+ .css( 'overflow', 'auto' );
 49+
 50+
 51+ var self = document.createElement('iframe');
 52+
 53+ self.textarea = obj;
 54+ self.textarea.disabled = true;
 55+ self.textarea.style.overflow = 'hidden';
 56+
 57+ self.style.height = self.textarea.clientHeight +'px';
 58+ self.style.width = self.textarea.clientWidth +'px';
 59+ self.textarea.style.overflow = 'auto';
 60+
 61+ self.style.border = '1px solid gray';
 62+ self.frameBorder = 0; // remove IE internal iframe border
 63+ self.style.visibility = 'hidden';
 64+ self.style.position = 'absolute';
 65+
 66+
 67+ self.editor = self.contentWindow.CodePress;
 68+ self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
 69+ self.editor.setCode(self.textarea.value);
 70+ self.setOptions();
 71+ self.editor.syntaxHighlight('init');
 72+ self.textarea.style.display = 'none';
 73+ self.style.position = 'static';
 74+ self.style.visibility = 'visible';
 75+ self.style.display = 'inline';
 76+ },
 77+ language: function( context, language ) {
 78+ if ( language != undefined ) {
 79+ if(obj) self.textarea.value = document.getElementById(obj) ? document.getElementById(obj).value : obj;
 80+ if(!self.textarea.disabled) return;
 81+ self.language = language ? language : self.getLanguage();
 82+ self.src = CodePress.path+'codepress.html?language='+self.language+'&ts='+(new Date).getTime();
 83+ if(self.attachEvent) self.attachEvent('onload',self.initialize);
 84+ else self.addEventListener('load',self.initialize,false);
 85+
 86+ var config = { "language": "generic", "engine": null };
 87+ var language = "generic"; var engine = "older";
 88+ var ua = navigator.userAgent;
 89+ var ts = (new Date).getTime(); // timestamp to avoid cache
 90+ var lh = location.href;
 91+
 92+ if(ua.match('MSIE')) engine = 'msie';
 93+ else if(ua.match('KHTML')) engine = 'khtml';
 94+ else if(ua.match('Opera')) engine = 'opera';
 95+ else if(ua.match('Gecko')) engine = 'gecko';
 96+ if(lh.match('language=')) language = lh.replace(/.*language=(.*?)(&.*)?$/,'$1');
 97+
 98+ html = '\
 99+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>\
 100+<head><title>wikiEditor</title><meta name="description" content="wikiEditor" /><script type="text/javascript">\
 101+ <link type="text/css" href="codepress.css?ts='+ts+'" rel="stylesheet" />\
 102+ <link type="text/css" href="languages/'+language+'.css?ts='+ts+'" rel="stylesheet" id="cp-lang-style" />\
 103+ <script type="text/javascript" src="engines/'+engine+'.js?ts='+ts+'"></script>\
 104+ <script type="text/javascript" src="languages/'+language+'.js?ts='+ts+'"></script>\
 105+</head>\
 106+';
 107+
 108+<script type="text/javascript">
 109+if(engine == "msie" || engine == "gecko") document.write('<body><pre> </pre></body>');
 110+else if(engine == "opera") document.write('<body></body>');
 111+// else if(engine == "khtml") document.write('<body> </body>');
 112+</script>
 113+
 114+</html>
 115+
 116+
 117+ ';
 118+
 119+
 120+
 121+
 122+
 123+
 124+
 125+
 126+
 127+
 128+
 129+
 130+
 131+
 132+
 133+ } else {
 134+ for (language in CodePress.languages)
 135+ if(self.options.match('\\b'+language+'\\b'))
 136+ return CodePress.languages[language] ? language : 'generic';
 137+ }
 138+ },
 139+ options: function( context, options ) {
 140+ if ( options != undefined ) {
 141+ $.extend( context.modules.editor.options, options );
 142+ } else {
 143+ return context.modules.editor.options;
 144+ }
 145+ },
 146+ code: function( context, code ) {
 147+ if ( code !== undefined ) {
 148+ // Set
 149+ self.textarea.disabled ? self.editor.setCode(code) : self.textarea.value = code;
 150+ } else {
 151+ // Get
 152+ return self.textarea.disabled ? self.editor.getCode() : self.textarea.value;
 153+ }
 154+ },
 155+ // toggleReadOnly
 156+ lock: function( context ) {
 157+ self.textarea.readOnly = true;
 158+ if(self.style.display != 'none') // prevent exception on FF + iframe with display:none
 159+ self.editor.readOnly( true );
 160+ },
 161+ unlock: function( context ) {
 162+ self.textarea.readOnly = false;
 163+ if(self.style.display != 'none') // prevent exception on FF + iframe with display:none
 164+ self.editor.readOnly( false );
 165+ },
 166+ // toggleEditor
 167+ on: function( context ) {
 168+ self.textarea.disabled = true;
 169+ self.setCode(self.textarea.value);
 170+ self.editor.syntaxHighlight('init');
 171+ self.style.display = 'inline';
 172+ self.textarea.style.display = 'none';
 173+ }
 174+ off: function( context ) {
 175+ self.textarea.value = self.getCode();
 176+ self.textarea.disabled = false;
 177+ self.style.display = 'none';
 178+ self.textarea.style.display = 'inline';
 179+ }
 180+
 181+
 182+
 183+ CodePress.run = function() {
 184+ s = document.getElementsByTagName('script');
 185+ for(var i=0,n=s.length;i<n;i++) {
 186+ if(s[i].src.match('codepress.js')) {
 187+ CodePress.path = s[i].src.replace('codepress.js','');
 188+ }
 189+ }
 190+ t = document.getElementsByTagName('textarea');
 191+ for(var i=0,n=t.length;i<n;i++) {
 192+ if(t[i].className.match('codepress')) {
 193+ id = t[i].id;
 194+ t[i].id = id+'_cp';
 195+ eval(id+' = new CodePress(t[i])');
 196+ t[i].parentNode.insertBefore(eval(id), t[i]);
 197+ }
 198+ }
 199+ }
 200+
 201+}
 202+
 203+}; } ) ( jQuery );
\ No newline at end of file
Property changes on: branches/usability/acaifix/js/plugins/jquery.wikiEditor.editor.js
___________________________________________________________________
Added: svn:eol-style
1204 + native
Index: branches/usability/acaifix/js/plugins/jquery.collapsibleTabs.js
@@ -0,0 +1,94 @@
 2+( function( $ ) {
 3+
 4+$.fn.collapsibleTabs = function( $$options ) {
 5+ // return if the function is called on an empty jquery object
 6+ if( !this.length ) return this;
 7+ //merge options into the defaults
 8+ var $settings = $.extend( {}, $.collapsibleTabs.defaults, $$options );
 9+
 10+ this.each( function() {
 11+ var $this = $( this );
 12+ // add the element to our array of collapsible managers
 13+ $.collapsibleTabs.instances = ( $.collapsibleTabs.instances.length == 0 ? $this : $.collapsibleTabs.instances.add( $this ) );
 14+ // attach the settings to the elements
 15+ $this.data( 'collapsibleTabsSettings', $settings );
 16+ // attach data to our collapsible elements
 17+ $this.children( $settings.collapsible ).each(function() {
 18+ var $collapsible = $(this);
 19+ $collapsible.data('collapsibleTabsSettings', {
 20+ 'expandedContainer': $settings.expandedContainer,
 21+ 'collapsedContainer': $settings.collapsedContainer,
 22+ 'expandedWidth': $collapsible.width(),
 23+ 'prevElement': $collapsible.prev()
 24+ });
 25+ } );
 26+ } );
 27+
 28+ // if we haven't already bound our resize hanlder, bind it now
 29+ if(!$.collapsibleTabs.boundEvent) $(window).delayedBind('500','resize', function(){ $.collapsibleTabs.handleResize(); });
 30+ // call our resize handler to setup the page
 31+ $.collapsibleTabs.handleResize();
 32+ return this;
 33+};
 34+
 35+$.collapsibleTabs = {
 36+ instances: [],
 37+ boundEvent: null,
 38+ defaults: {
 39+ expandedContainer: '#p-views ul',
 40+ collapsedContainer: '#p-cactions ul',
 41+ collapsible: 'li.collapsible',
 42+ shifting: false,
 43+ expandCondition: function(eleWidth) {
 44+ return ( $('#left-navigation').position().left + $('#left-navigation').width())
 45+ < ($('#right-navigation').position().left - eleWidth);
 46+ },
 47+ collapseCondition: function() {
 48+ return ( $('#left-navigation').position().left + $('#left-navigation').width())
 49+ > $('#right-navigation').position().left;
 50+ }
 51+ },
 52+ handleResize: function(e){
 53+ $.collapsibleTabs.instances.each(function() {
 54+ var $this = $(this), data = $this.data('collapsibleTabsSettings');
 55+ if(data.shifting) return;
 56+
 57+ // if the two navigations are colliding
 58+ if( $this.children(data.collapsible).length > 0 && data.collapseCondition() ) {
 59+
 60+ $this.trigger("beforeTabCollapse");
 61+ // move the element to the dropdown menu
 62+ $.collapsibleTabs.moveToCollapsed($this.children(data.collapsible+':last'));
 63+ }
 64+
 65+ // if there are still moveable items in the dropdown menu,
 66+ // and there is sufficient space to place them in the tab container
 67+ if($(data.collapsedContainer + ' ' + data.collapsible ).length > 0
 68+ && data.expandCondition( $(data.collapsedContainer).children(
 69+ data.collapsible+":first").data('collapsibleTabsSettings').expandedWidth)) {
 70+ //move the element from the dropdown to the tab
 71+ $this.trigger("beforeTabExpand");
 72+ $.collapsibleTabs.moveToExpanded( data.collapsedContainer + " " + data.collapsible + ':first' );
 73+ }
 74+ });
 75+ },
 76+ moveToCollapsed: function( ele ) {
 77+ var $moving = $(ele);
 78+ var data = $moving.data('collapsibleTabsSettings');
 79+ $(data.expandedContainer).data('collapsibleTabsSettings').shifting = true;
 80+ $moving.remove().prependTo(data.collapsedContainer).data('collapsibleTabsSettings', data);
 81+ $(data.expandedContainer).data('collapsibleTabsSettings').shifting = false;
 82+ $.collapsibleTabs.handleResize();
 83+ },
 84+ moveToExpanded: function( ele ) {
 85+ var $moving = $(ele);
 86+ var data = $moving.data('collapsibleTabsSettings');
 87+ $(data.expandedContainer).data('collapsibleTabsSettings').shifting = true;
 88+ // remove this element from where it's at and put it in the dropdown menu
 89+ $moving.remove().insertAfter(data.prevElement).data('collapsibleTabsSettings', data);
 90+ $(data.expandedContainer).data('collapsibleTabsSettings').shifting = false;
 91+ $.collapsibleTabs.handleResize();
 92+ }
 93+};
 94+
 95+} )( jQuery );
\ No newline at end of file
Property changes on: branches/usability/acaifix/js/plugins/jquery.collapsibleTabs.js
___________________________________________________________________
Added: svn:eol-style
196 + native
Index: branches/usability/acaifix/js/plugins/jquery.autoEllipse.js
@@ -12,30 +12,28 @@
1313 var text = $(this).text();
1414 var $text = $( '<span />' ).text( text ).css( 'whiteSpace', 'nowrap' );
1515 $(this).empty().append( $text );
16 - if ( $text.outerWidth() > $(this).innerWidth() ) {
 16+ if ( $text.width() > $(this).width() ) {
1717 switch ( options.position ) {
1818 case 'right':
19 - // Use binary search-like technique for
20 - // efficiency
 19+ // Use binary search-like technique for efficiency
2120 var l = 0, r = text.length;
22 - var ow, iw;
2321 do {
2422 var m = Math.ceil( ( l + r ) / 2 );
2523 $text.text( text.substr( 0, m ) + '...' );
26 - ow = $text.outerWidth();
27 - iw = $(this).innerWidth();
28 - if ( ow > iw )
 24+ if ( $text.width() > $(this).width() ) {
2925 // Text is too long
3026 r = m - 1;
31 - else
 27+ } else {
3228 l = m;
 29+ }
3330 } while ( l < r );
 31+ $text.text( text.substr( 0, l ) + '...' );
3432 break;
3533 case 'center':
3634 // TODO: Use binary search like for 'right'
3735 var i = [Math.round( text.length / 2 ), Math.round( text.length / 2 )];
3836 var side = 1; // Begin with making the end shorter
39 - while ( $text.outerWidth() > ( $(this).innerWidth() ) && i[0] > 0 ) {
 37+ while ( $text.outerWidth() > ( $(this).width() ) && i[0] > 0 ) {
4038 $text.text( text.substr( 0, i[0] ) + '...' + text.substr( i[1] ) );
4139 // Alternate between trimming the end and begining
4240 if ( side == 0 ) {
@@ -52,7 +50,7 @@
5351 case 'left':
5452 // TODO: Use binary search like for 'right'
5553 var r = 0;
56 - while ( $text.outerWidth() > $(this).innerWidth() && r < text.length ) {
 54+ while ( $text.outerWidth() > $(this).width() && r < text.length ) {
5755 $text.text( '...' + text.substr( r ) );
5856 r++;
5957 }
Index: branches/usability/acaifix/js/plugins.combined.js
@@ -90,30 +90,28 @@
9191 var text = $(this).text();
9292 var $text = $( '<span />' ).text( text ).css( 'whiteSpace', 'nowrap' );
9393 $(this).empty().append( $text );
94 - if ( $text.outerWidth() > $(this).innerWidth() ) {
 94+ if ( $text.width() > $(this).width() ) {
9595 switch ( options.position ) {
9696 case 'right':
97 - // Use binary search-like technique for
98 - // efficiency
 97+ // Use binary search-like technique for efficiency
9998 var l = 0, r = text.length;
100 - var ow, iw;
10199 do {
102100 var m = Math.ceil( ( l + r ) / 2 );
103101 $text.text( text.substr( 0, m ) + '...' );
104 - ow = $text.outerWidth();
105 - iw = $(this).innerWidth();
106 - if ( ow > iw )
 102+ if ( $text.width() > $(this).width() ) {
107103 // Text is too long
108104 r = m - 1;
109 - else
 105+ } else {
110106 l = m;
 107+ }
111108 } while ( l < r );
 109+ $text.text( text.substr( 0, l ) + '...' );
112110 break;
113111 case 'center':
114112 // TODO: Use binary search like for 'right'
115113 var i = [Math.round( text.length / 2 ), Math.round( text.length / 2 )];
116114 var side = 1; // Begin with making the end shorter
117 - while ( $text.outerWidth() > ( $(this).innerWidth() ) && i[0] > 0 ) {
 115+ while ( $text.outerWidth() > ( $(this).width() ) && i[0] > 0 ) {
118116 $text.text( text.substr( 0, i[0] ) + '...' + text.substr( i[1] ) );
119117 // Alternate between trimming the end and begining
120118 if ( side == 0 ) {
@@ -130,7 +128,7 @@
131129 case 'left':
132130 // TODO: Use binary search like for 'right'
133131 var r = 0;
134 - while ( $text.outerWidth() > $(this).innerWidth() && r < text.length ) {
 132+ while ( $text.outerWidth() > $(this).width() && r < text.length ) {
135133 $text.text( '...' + text.substr( r ) );
136134 r++;
137135 }
@@ -574,7 +572,7 @@
575573 * @param updateTextbox If true, put the suggestion in the textbox
576574 */
577575 highlight: function( context, result, updateTextbox ) {
578 - var selected = context.data.$container.find( '.suggestions-result-current' )
 576+ var selected = context.data.$container.find( '.suggestions-result-current' );
579577 if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
580578 if ( result == 'prev' ) {
581579 result = selected.prev();
@@ -643,6 +641,12 @@
644642 case 13:
645643 context.data.$container.hide();
646644 preventDefault = wasVisible;
 645+ if ( typeof context.config.result.select == 'function' ) {
 646+ context.config.result.select.call(
 647+ context.data.$container.find( '.suggestions-result-current' ),
 648+ context.data.$textbox
 649+ );
 650+ }
647651 break;
648652 default:
649653 $.suggestions.update( context, true );
@@ -827,12 +831,17 @@
828832 */
829833 ( function( $ ) { $.fn.extend( {
830834
 835+/**
 836+ * Get the currently selected text in this textarea. Will focus the textarea
 837+ * in some browsers (IE/Opera)
 838+ */
831839 getSelection: function() {
832840 var e = this.jquery ? this[0] : this;
833841 var retval = '';
834842 if ( e.style.display == 'none' ) {
835843 // Do nothing
836844 } else if ( document.selection && document.selection.createRange ) {
 845+ e.focus();
837846 var range = document.selection.createRange();
838847 retval = range.text;
839848 } else if ( e.selectionStart || e.selectionStart == '0' ) {
@@ -1745,6 +1754,13 @@
17461755 parts[part] = ( action.options[part] || '' )
17471756 }
17481757 }
 1758+ if ( 'periRegex' in action.options && 'periRegexReplace' in action.options ) {
 1759+ var selection = context.$textarea.getSelection();
 1760+ if ( selection != '' ) {
 1761+ parts.peri = selection.replace( action.options.periRegex,
 1762+ action.options.periRegexReplace );
 1763+ }
 1764+ }
17491765 context.$textarea.encapsulateSelection(
17501766 parts.pre, parts.peri, parts.post, action.options.ownline, action.type == 'replace'
17511767 );
@@ -1849,25 +1865,23 @@
18501866 .text( label )
18511867 .attr( 'rel', id )
18521868 .data( 'context', context )
1853 - .click(
1854 - function() {
1855 -
1856 - $(this).parent().parent().find( '.page' ).hide();
1857 - $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
1858 - $(this).siblings().removeClass( 'current' );
1859 - $(this).addClass( 'current' );
1860 - var section = $(this).parent().parent().attr( 'rel' );
1861 -
1862 - //click tracking
1863 - if($.trackAction != undefined){
1864 - $.trackAction(section + '.' + $(this).attr('rel'));
1865 - }
1866 -
1867 - $.cookie(
1868 - 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
1869 - $(this).attr( 'rel' )
1870 - );
1871 - } );
 1869+ .bind( 'mousedown', function() {
 1870+ $(this).parent().parent().find( '.page' ).hide();
 1871+ $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show();
 1872+ $(this).siblings().removeClass( 'current' );
 1873+ $(this).addClass( 'current' );
 1874+ var section = $(this).parent().parent().attr( 'rel' );
 1875+
 1876+ //click tracking
 1877+ if($.trackAction != undefined){
 1878+ $.trackAction(section + '.' + $(this).attr('rel'));
 1879+ }
 1880+
 1881+ $.cookie(
 1882+ 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page',
 1883+ $(this).attr( 'rel' )
 1884+ );
 1885+ } );
18721886 },
18731887 buildPage : function( context, id, page ) {
18741888 var $page = $( '<div />' ).attr( {
@@ -1974,22 +1988,34 @@
19751989 .attr( 'href', '#' )
19761990 .text( $.wikiEditor.autoMsg( section, 'label' ) )
19771991 .data( 'context', context )
1978 - .click( function() {
 1992+ .bind( 'mouseup', function( e ) {
 1993+ $(this).blur();
 1994+ } )
 1995+ .bind( 'mousedown', function( e ) {
 1996+ // Only act when the primary mouse button was pressed
 1997+ if ( e.button !== 0 ) {
 1998+ return true;
 1999+ }
19792000 var $sections = $(this).data( 'context' ).$ui.find( '.sections' );
19802001 var $section =
19812002 $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) );
1982 - $(this).blur();
19832003 var show = $section.css( 'display' ) == 'none';
19842004 $previousSections = $section.parent().find( '.section:visible' );
19852005 $previousSections.css( 'position', 'absolute' );
19862006 $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } );
19872007 $(this).parent().parent().find( 'a' ).removeClass( 'current' );
 2008+ $sections.css('overflow', 'hidden');
19882009 if ( show ) {
19892010 $section.fadeIn( 'fast' );
1990 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
 2011+ $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() {
 2012+ $(this).css('overflow', 'visible').css('height', 'auto');
 2013+ } );
19912014 $(this).addClass( 'current' );
19922015 } else {
1993 - $sections.animate( { 'height': 0 } );
 2016+ $sections.css('height', $section.outerHeight() )
 2017+ .animate( { 'height': 0 }, $section.outerHeight() * 2, function() {
 2018+ $(this).css('overflow', 'visible');
 2019+ } );
19942020 }
19952021 // Click tracking
19962022 if($.trackAction != undefined){
@@ -2000,8 +2026,8 @@
20012027 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
20022028 show ? $section.attr( 'rel' ) : null
20032029 );
2004 - return false;
20052030 } )
 2031+ .click( function() { return false; } )
20062032 );
20072033 },
20082034 buildSection : function( context, id, section ) {
@@ -2090,7 +2116,7 @@
20912117 s.$sections.append( $.wikiEditor.modules.toolbar.fn.buildSection( s.context, s.id, s.config ) );
20922118 var $section = s.$sections.find( '.section:visible' );
20932119 if ( $section.size() ) {
2094 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
 2120+ $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2 );
20952121 }
20962122 }
20972123 } );
@@ -2098,9 +2124,7 @@
20992125 }
21002126
21012127 }; } )( jQuery );
2102 -/**
2103 - * TOC Module for wikiEditor
2104 - */
 2128+/* TOC Module for wikiEditor */
21052129 ( function( $ ) { $.wikiEditor.modules.toc = {
21062130
21072131 /**
@@ -2141,7 +2165,7 @@
21422166 // Add the TOC to the document
21432167 $.wikiEditor.modules.toc.fn.build( context, config );
21442168 context.$textarea
2145 - .delayedBind( 1000, 'keyup encapsulateSelection change',
 2169+ .delayedBind( 250, 'mouseup scrollToPosition focus keyup encapsulateSelection change',
21462170 function( event ) {
21472171 var context = $(this).data( 'wikiEditor-context' );
21482172 $(this).eachAsync( {
@@ -2153,25 +2177,16 @@
21542178 } );
21552179 }
21562180 )
2157 - .bind( 'mouseup scrollToPosition focus keyup encapsulateSelection change',
2158 - function( event ) {
2159 - var context = $(this).data( 'wikiEditor-context' );
2160 - $(this).eachAsync( {
2161 - bulk: 0,
2162 - loop: function() {
2163 - $.wikiEditor.modules.toc.fn.update( context );
2164 - }
2165 - } );
2166 - }
2167 - )
21682181 .blur( function() {
21692182 var context = $(this).data( 'wikiEditor-context' );
 2183+ context.$textarea.delayedBindCancel( 250,
 2184+ 'mouseup scrollToPosition focus keyup encapsulateSelection change' );
21702185 $.wikiEditor.modules.toc.fn.unhighlight( context );
21712186 });
21722187 },
21732188
21742189 unhighlight: function( context ) {
2175 - context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' );
 2190+ context.modules.$toc.find( 'div' ).removeClass( 'current' );
21762191 },
21772192 /**
21782193 * Highlight the section the cursor is currently within
@@ -2195,8 +2210,8 @@
21962211 }
21972212 section = Math.max( 0, section );
21982213 }
2199 - var sectionLink = context.modules.$toc.find( 'a.section-' + section );
2200 - sectionLink.addClass( 'currentSelection' );
 2214+ var sectionLink = context.modules.$toc.find( 'div.section-' + section );
 2215+ sectionLink.addClass( 'current' );
22012216
22022217 // Scroll the highlighted link into view if necessary
22032218 var relTop = sectionLink.offset().top - context.modules.$toc.offset().top;
@@ -2245,26 +2260,26 @@
22462261 * @param {Object} structure Structured outline
22472262 */
22482263 function buildList( structure ) {
2249 - var list = $( '<ul />' );
 2264+ var list = $( '<ul></ul>' );
22502265 for ( i in structure ) {
2251 - var item = $( '<li />' )
2252 - .append(
2253 - $( '<a />' )
2254 - .attr( 'href', '#' )
2255 - .addClass( 'section-' + structure[i].index )
2256 - .data( 'textbox', context.$textarea )
2257 - .data( 'position', structure[i].position )
2258 - .click( function( event ) {
2259 - $(this).data( 'textbox' )
2260 - .focus()
2261 - .setSelection( $(this).data( 'position' ) )
2262 - .scrollToCaretPosition( true );
2263 - if ( typeof $.trackAction != 'undefined' )
2264 - $.trackAction( 'ntoc.heading' );
2265 - event.preventDefault();
2266 - } )
2267 - .text( structure[i].text )
2268 - );
 2266+ var div = $( '<div></div>' )
 2267+ .attr( 'href', '#' )
 2268+ .addClass( 'section-' + structure[i].index )
 2269+ .data( 'textbox', context.$textarea )
 2270+ .data( 'position', structure[i].position )
 2271+ .bind( 'mousedown', function( event ) {
 2272+ $(this).data( 'textbox' )
 2273+ .focus()
 2274+ .setSelection( $(this).data( 'position' ) )
 2275+ .scrollToCaretPosition( true );
 2276+ if ( typeof $.trackAction != 'undefined' )
 2277+ $.trackAction( 'ntoc.heading' );
 2278+ event.preventDefault();
 2279+ } )
 2280+ .text( structure[i].text );
 2281+ if ( structure[i].text == '' )
 2282+ div.html( '&nbsp;' );
 2283+ var item = $( '<li></li>' ).append( div );
22692284 if ( structure[i].sections !== undefined ) {
22702285 item.append( buildList( structure[i].sections ) );
22712286 }
@@ -2275,7 +2290,7 @@
22762291 // Build outline from wikitext
22772292 var outline = [];
22782293 var wikitext = $.wikiEditor.fixOperaBrokenness( context.$textarea.val() );
2279 - var headings = wikitext.match( /^={1,6}.+={1,6}\s*$/gm );
 2294+ var headings = wikitext.match( /^={1,6}[^=\n][^\n]*={1,6}\s*$/gm );
22802295 var offset = 0;
22812296 headings = $.makeArray( headings );
22822297 for ( var h = 0; h < headings.length; h++ ) {
@@ -2335,18 +2350,11 @@
23362351 // Recursively build the structure and add special item for
23372352 // section 0, if needed
23382353 var structure = buildStructure( outline );
2339 - if ( $( 'input[name=wpSection]' ).val() == '' )
 2354+ if ( $( 'input[name=wpSection]' ).val() == '' ) {
23402355 structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 } );
 2356+ }
23412357 context.modules.$toc.html( buildList( structure ) );
2342 -
2343 - context.modules.$toc.find( 'ul' ).css( 'width', '10em' );
2344 -
2345 - var links = context.modules.$toc.find( 'ul a' );
2346 - // Highlighted links are wider; autoEllipse links in
2347 - // highlighted state
2348 - links.addClass( 'currentSelection' );
2349 - links.autoEllipse( { 'position': 'right', 'tooltip': true } );
2350 - links.removeClass( 'currentSelection' );
 2358+ context.modules.$toc.find( 'div' ).autoEllipse( { 'position': 'right', 'tooltip': true } );
23512359 // Cache the outline for later use
23522360 context.data.outline = outline;
23532361 }
Index: branches/usability/acaifix/js/plugins.combined.min.js
@@ -11,10 +11,8 @@
1212 {var i=0,l=array.length,loop=opts.loop||function(){};$.whileAsync($.extend(opts,{test:function(){return i<l;},loop:function()
1313 {var val=array[i];return loop.call(val,i++,val);}}));}
1414 $.fn.eachAsync=function(opts)
15 -{$.eachAsync(this,opts);return this;}})(jQuery);(function($){$.fn.autoEllipse=function(options){$(this).each(function(){options=$.extend({'position':'center','tooltip':false},options);var text=$(this).text();var $text=$('<span />').text(text).css('whiteSpace','nowrap');$(this).empty().append($text);if($text.outerWidth()>$(this).innerWidth()){switch(options.position){case'right':var l=0,r=text.length;var ow,iw;do{var m=Math.ceil((l+r)/2);$text.text(text.substr(0,m)+'...');ow=$text.outerWidth();iw=$(this).innerWidth();if(ow>iw)
16 -r=m-1;else
17 -l=m;}while(l<r);break;case'center':var i=[Math.round(text.length/2),Math.round(text.length/2)];var side=1;while($text.outerWidth()>($(this).innerWidth())&&i[0]>0){$text.text(text.substr(0,i[0])+'...'+text.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}}
18 -break;case'left':var r=0;while($text.outerWidth()>$(this).innerWidth()&&r<text.length){$text.text('...'+text.substr(r));r++;}
 15+{$.eachAsync(this,opts);return this;}})(jQuery);(function($){$.fn.autoEllipse=function(options){$(this).each(function(){options=$.extend({'position':'center','tooltip':false},options);var text=$(this).text();var $text=$('<span />').text(text).css('whiteSpace','nowrap');$(this).empty().append($text);if($text.width()>$(this).width()){switch(options.position){case'right':var l=0,r=text.length;do{var m=Math.ceil((l+r)/2);$text.text(text.substr(0,m)+'...');if($text.width()>$(this).width()){r=m-1;}else{l=m;}}while(l<r);$text.text(text.substr(0,l)+'...');break;case'center':var i=[Math.round(text.length/2),Math.round(text.length/2)];var side=1;while($text.outerWidth()>($(this).width())&&i[0]>0){$text.text(text.substr(0,i[0])+'...'+text.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}}
 16+break;case'left':var r=0;while($text.outerWidth()>$(this).width()&&r<text.length){$text.text('...'+text.substr(r));r++;}
1917 break;}
2018 if(options.tooltip)
2119 $text.attr('title',text);}});};})(jQuery);(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}
@@ -35,15 +33,15 @@
3634 if(context.data.timerID!=null){clearTimeout(context.data.timerID);}
3735 if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();}
3836 $.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(context.config.suggestions.length==0){context.data.$container.hide();}else{context.data.$container.show();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.text(context.config.suggestions[i]).autoEllipse();}}}}
39 -break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(12000,value));break;case'submitOnClick':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current')
40 -if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){result=selected.prev();}else if(result=='next'){if(selected.size()==0)
 37+break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(12000,value));break;case'submitOnClick':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){result=selected.prev();}else if(result=='next'){if(selected.size()==0)
4138 result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(result.size()==0)
4239 result=selected;}}
4340 selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');}
4441 if(updateTextbox){if(result.size()==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}}
4542 $.suggestions.special(context);},keypress:function(e,context,key){var wasVisible=context.data.$container.is(':visible');var preventDefault=false;switch(key){case 40:if(wasVisible){$.suggestions.highlight(context,'next',true);}else{$.suggestions.update(context,false);}
4643 context.data.$textbox.trigger('change');preventDefault=true;break;case 38:if(wasVisible){$.suggestions.highlight(context,'prev',true);}
47 -context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 13:context.data.$container.hide();preventDefault=wasVisible;break;default:$.suggestions.update(context,true);break;}
 44+context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 13:context.data.$container.hide();preventDefault=wasVisible;if(typeof context.config.result.select=='function'){context.config.result.select.call(context.data.$container.find('.suggestions-result-current'),context.data.$textbox);}
 45+break;default:$.suggestions.update(context,true);break;}
4846 if(preventDefault){e.preventDefault();e.stopImmediatePropagation();}}};$.fn.suggestions=function(){var returnValue=null;var args=arguments;$(this).each(function(){var context=$(this).data('suggestions-context');if(typeof context=='undefined'){context={config:{'fetch':function(){},'cancel':function(){},'special':{},'result':{},'$region':$(this),'suggestions':[],'maxRows':7,'delay':1200,'submitOnClick':false}};}
4947 if(args.length>0){if(typeof args[0]=='object'){for(key in args[0]){$.suggestions.configure(context,key,args[0][key]);}}else if(typeof args[0]=='string'){if(args.length>1){$.suggestions.configure(context,args[0],args[1]);}else if(returnValue==null){returnValue=(args[0]in context.config?undefined:context.config[args[0]]);}}}
5048 if(typeof context.data=='undefined'){context.data={'timerID':null,'prevText':null,'visibleResults':0,'mouseDownOn':$([]),'$textbox':$(this)};context.data.$container=$('<div />').css({'top':Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),'left':Math.round(context.data.$textbox.offset().left),'width':context.data.$textbox.outerWidth(),'display':'none'}).mouseover(function(e){$.suggestions.highlight(context,$(e.target).closest('.suggestions-results div'),false);}).addClass('suggestions').append($('<div />').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!=$other.get(0)){return;}
@@ -52,7 +50,7 @@
5351 context.data.$container.hide();if(typeof context.config.special.select=='function'){context.config.special.select.call($special,context.data.$textbox);}
5452 context.data.$textbox.focus();})).appendTo($('body'));$(this).attr('autocomplete','off').keydown(function(e){context.data.keypressed=(e.keyCode==undefined)?e.which:e.keyCode;context.data.keypressedCount=0;switch(context.data.keypressed){case 40:e.preventDefault();e.stopImmediatePropagation();break;case 38:case 27:case 13:if(context.data.$container.is(':visible')){e.preventDefault();e.stopImmediatePropagation();}}}).keypress(function(e){context.data.keypressedCount++;$.suggestions.keypress(e,context,context.data.keypressed);}).keyup(function(e){if(context.data.keypressedCount==0){$.suggestions.keypress(e,context,context.data.keypressed);}}).blur(function(){if(context.data.mouseDownOn.size()>0){return;}
5553 context.data.$container.hide();$.suggestions.cancel(context);});}
56 -$(this).data('suggestions-context',context);});return returnValue!==null?returnValue:$(this);};})(jQuery);(function($){$.fn.extend({getSelection:function(){var e=this.jquery?this[0]:this;var retval='';if(e.style.display=='none'){}else if(document.selection&&document.selection.createRange){var range=document.selection.createRange();retval=range.text;}else if(e.selectionStart||e.selectionStart=='0'){retval=e.value.substring(e.selectionStart,e.selectionEnd);}
 54+$(this).data('suggestions-context',context);});return returnValue!==null?returnValue:$(this);};})(jQuery);(function($){$.fn.extend({getSelection:function(){var e=this.jquery?this[0]:this;var retval='';if(e.style.display=='none'){}else if(document.selection&&document.selection.createRange){e.focus();var range=document.selection.createRange();retval=range.text;}else if(e.selectionStart||e.selectionStart=='0'){retval=e.value.substring(e.selectionStart,e.selectionEnd);}
5755 return retval;},encapsulateSelection:function(pre,peri,post,ownline,replace){return this.each(function(){function checkSelectedText(){if(!selText){selText=peri;isSample=true;}else if(replace){selText=peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);post+=' ';}}
5856 var selText=$(this).getSelection();var isSample=false;if(this.style.display=='none'){}else if(this.selectionStart||this.selectionStart=='0'){$(this).focus();var startPos=this.selectionStart;var endPos=this.selectionEnd;checkSelectedText();if(ownline){if(startPos!=0&&this.value.charAt(startPos-1)!="\n"){pre="\n"+pre;}
5957 if(this.value.charAt(endPos)!="\n"){post+="\n";}}
@@ -113,6 +111,7 @@
114112 step=step.parent();}
115113 rels.reverse();var id=rels.join('.');$.trackAction(id);}
116114 switch(action.type){case'replace':case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=gM(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}}
 115+if('periRegex'in action.options&&'periRegexReplace'in action.options){var selection=context.$textarea.getSelection();if(selection!=''){parts.peri=selection.replace(action.options.periRegex,action.options.periRegexReplace);}}
117116 context.$textarea.encapsulateSelection(parts.pre,parts.peri,parts.post,action.options.ownline,action.type=='replace');break;case'callback':if(typeof action.execute=='function'){action.execute(context);}
118117 break;case'dialog':context.$textarea.wikiEditor('openDialog',{'dialog':action.module});break;default:break;}},buildGroup:function(context,id,group){var $group=$('<div />').attr({'class':'group group-'+id,'rel':id});var label=$.wikiEditor.autoMsg(group,'label');if(label){$group.append('<div class="label">'+label+'</div>')}
119118 if('tools'in group){for(tool in group.tools){$group.append($.wikiEditor.modules.toolbar.fn.buildTool(context,tool,group.tools[tool]));}}
@@ -120,7 +119,7 @@
121120 var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=tool.icon;if(src.indexOf('http://')!==0&&src.indexOf('https://')!==0){src=$.wikiEditor.imgPath+'toolbar/'+src;}
122121 $button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});if('action'in tool){$button.data('action',tool.action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));return false;});}
123122 return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'}).click(function(){var $options=$(this).find('.options');$options.animate({'opacity':'toggle'},'fast');});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));}).text(optionLabel).addClass('option').attr('rel',option));}}
124 -$select.append($('<div />').addClass('menu').append($options));$select.append($('<div />').addClass('label').text(label));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).click(function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));}
 123+$select.append($('<div />').addClass('menu').append($options));$select.append($('<div />').addClass('label').text(label));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).bind('mousedown',function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));}
125124 $.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));});},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)}
126125 if('rows'in page){for(row in page.rows){html+=$.wikiEditor.modules.toolbar.fn.buildRow(context,page.rows[row])}}
127126 $page.html(html);break;case'characters':$page.addClass('page-characters');$characters=$('<div />').data('context',context).data('actions',{});var actions=$characters.data('actions');if('language'in page){$characters.attr('lang',page.language);}
@@ -132,28 +131,30 @@
133132 return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+
134133 $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';}
135134 html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};}
136 -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).click(function(){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));$(this).blur();var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},'fast');$(this).addClass('current');}else{$sections.animate({'height':0});}
 135+if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0){return true;}
 136+var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});}
137137 if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
138 -$.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}}
 138+$.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);}).click(function(){return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}}
139139 break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}}
140140 $section=$('<div />').attr({'class':'booklet section section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;}
141141 if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');}
142142 return $section;},updateBookletSelection:function(context,id,$pages,$index){var cookie='wikiEditor-'+context.instance+'-booklet-'+id+'-page';var selected=$.cookie(cookie);var $selectedIndex=$index.find('*[rel='+selected+']');if($selectedIndex.size()==0){selected=$index.children().eq(0).attr('rel');$.cookie(cookie,selected);}
143143 $pages.children().hide();$pages.find('*[rel='+selected+']').show();$index.children().removeClass('current');$selectedIndex.addClass('current');},build:function(context,config){var $tabs=$('<div />').addClass('tabs').appendTo(context.modules.$toolbar);var $sections=$('<div />').addClass('sections').appendTo(context.modules.$toolbar);context.modules.$toolbar.append($('<div />').css('clear','both'));var sectionQueue=[];for(section in config){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,config[section]));}else{sectionQueue.push({'$sections':$sections,'context':context,'id':section,'config':config[section]});$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,config[section]));}}
144 -$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},'fast');}}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},fn:{create:function(context,config){if('$toc'in context.modules){return;}
 144+$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2);}}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},fn:{create:function(context,config){if('$toc'in context.modules){return;}
145145 context.modules.$toc=$('<div />').addClass('wikiEditor-ui-toc').attr('id','wikiEditor-ui-toc');var height=context.$ui.find('.wikiEditor-ui-bottom').height()
146 -context.$ui.find('.wikiEditor-ui-bottom').append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-bottom').height());context.modules.$toc.css({'width':'12em','marginTop':-(height)});context.$ui.find('.wikiEditor-ui-text').css(($('body.rtl').size()?'marginLeft':'marginRight'),'12em');$.wikiEditor.modules.toc.fn.build(context,config);context.$textarea.delayedBind(1000,'keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).bind('mouseup scrollToPosition focus keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(){var context=$(this).data('wikiEditor-context');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('a').removeClass('currentSelection');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.getCaretPosition();var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;}
 146+context.$ui.find('.wikiEditor-ui-bottom').append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-bottom').height());context.modules.$toc.css({'width':'12em','marginTop':-(height)});context.$ui.find('.wikiEditor-ui-text').css(($('body.rtl').size()?'marginLeft':'marginRight'),'12em');$.wikiEditor.modules.toc.fn.build(context,config);context.$textarea.delayedBind(250,'mouseup scrollToPosition focus keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(){var context=$(this).data('wikiEditor-context');context.$textarea.delayedBindCancel(250,'mouseup scrollToPosition focus keyup encapsulateSelection change');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.getCaretPosition();var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;}
147147 section=Math.max(0,section);}
148 -var sectionLink=context.modules.$toc.find('a.section-'+section);sectionLink.addClass('currentSelection');var relTop=sectionLink.offset().top-context.modules.$toc.offset().top;var scrollTop=context.modules.$toc.scrollTop();var divHeight=context.modules.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0)
 148+var sectionLink=context.modules.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.$toc.offset().top;var scrollTop=context.modules.$toc.scrollTop();var divHeight=context.modules.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0)
149149 context.modules.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight)
150150 context.modules.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;}
151151 sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}}
152152 return sections;}
153 -function buildList(structure){var list=$('<ul />');for(i in structure){var item=$('<li />').append($('<a />').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).click(function(event){$(this).data('textbox').focus().setSelection($(this).data('position')).scrollToCaretPosition(true);if(typeof $.trackAction!='undefined')
154 -$.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text));if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));}
 153+function buildList(structure){var list=$('<ul></ul>');for(i in structure){var div=$('<div></div>').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).bind('mousedown',function(event){$(this).data('textbox').focus().setSelection($(this).data('position')).scrollToCaretPosition(true);if(typeof $.trackAction!='undefined')
 154+$.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text);if(structure[i].text=='')
 155+div.html('&nbsp;');var item=$('<li></li>').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));}
155156 list.append(item);}
156157 return list;}
157 -var outline=[];var wikitext=$.wikiEditor.fixOperaBrokenness(context.$textarea.val());var headings=wikitext.match(/^={1,6}.+={1,6}\s*$/gm);var offset=0;headings=$.makeArray(headings);for(var h=0;h<headings.length;h++){text=$.trim(headings[h]);var position=wikitext.indexOf(text,offset);if(position>=offset){offset=position+text.length;}else if(position==-1){continue;}
 158+var outline=[];var wikitext=$.wikiEditor.fixOperaBrokenness(context.$textarea.val());var headings=wikitext.match(/^={1,6}[^=\n][^\n]*={1,6}\s*$/gm);var offset=0;headings=$.makeArray(headings);for(var h=0;h<headings.length;h++){text=$.trim(headings[h]);var position=wikitext.indexOf(text,offset);if(position>=offset){offset=position+text.length;}else if(position==-1){continue;}
158159 var startLevel=0;for(var c=0;c<text.length;c++){if(text.charAt(c)=='='){startLevel++;}else{break;}}
159160 var endLevel=0;for(var c=text.length-1;c>=0;c--){if(text.charAt(c)=='='){endLevel++;}else{break;}}
160161 var level=Math.min(startLevel,endLevel);text=$.trim(text.substr(level,text.length-(level*2)));outline[h]={'text':text,'position':position,'level':level,'index':h+1};}
@@ -161,5 +162,5 @@
162163 else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);}
163164 if(nLevel<=0){nLevel=1;}
164165 outline[i].nLevel=nLevel;lastLevel=outline[i].level;}
165 -var structure=buildStructure(outline);if($('input[name=wpSection]').val()=='')
166 -structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0,'position':0});context.modules.$toc.html(buildList(structure));context.modules.$toc.find('ul').css('width','10em');var links=context.modules.$toc.find('ul a');links.addClass('currentSelection');links.autoEllipse({'position':'right','tooltip':true});links.removeClass('currentSelection');context.data.outline=outline;}}};})(jQuery);
\ No newline at end of file
 166+var structure=buildStructure(outline);if($('input[name=wpSection]').val()==''){structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0,'position':0});}
 167+context.modules.$toc.html(buildList(structure));context.modules.$toc.find('div').autoEllipse({'position':'right','tooltip':true});context.data.outline=outline;}}};})(jQuery);
\ No newline at end of file
Index: branches/usability/acaifix/Makefile
@@ -4,30 +4,34 @@
55 # For more info on JSMin, see: http://www.crockford.com/javascript/jsmin.html
66 #
77
8 -CSS := css/suggestions.css\
9 - css/wikiEditor.css\
10 - css/wikiEditor.dialogs.css\
11 - css/wikiEditor.toc.css\
12 - css/wikiEditor.toolbar.css
 8+CSS := \
 9+ css/suggestions.css\
 10+ css/wikiEditor.css\
 11+ css/wikiEditor.dialogs.css\
 12+ css/wikiEditor.toc.css\
 13+ css/wikiEditor.toolbar.css
1314
14 -JS2 := js/js2/jquery-1.3.2.js\
15 - js/js2/jquery-ui-1.7.2.js\
16 - js/js2/js2.js
 15+JS2 := \
 16+ js/js2/jquery-1.3.2.js\
 17+ js/js2/jquery-ui-1.7.2.js\
 18+ js/js2/js2.js
1719
18 -PLUGINS := js/plugins/jquery.async.js\
19 - js/plugins/jquery.autoEllipse.js\
20 - js/plugins/jquery.browser.js\
21 - js/plugins/jquery.cookie.js\
22 - js/plugins/jquery.delayedBind.js\
23 - js/plugins/jquery.namespaceSelect.js\
24 - js/plugins/jquery.suggestions.js\
25 - js/plugins/jquery.textSelection.js\
26 - js/plugins/jquery.wikiEditor.js\
27 - js/plugins/jquery.wikiEditor.dialogs.js\
28 - js/plugins/jquery.wikiEditor.toolbar.js\
29 - js/plugins/jquery.wikiEditor.toc.js
 20+PLUGINS := \
 21+ js/plugins/jquery.async.js\
 22+ js/plugins/jquery.autoEllipse.js\
 23+ js/plugins/jquery.browser.js\
 24+ js/plugins/jquery.cookie.js\
 25+ js/plugins/jquery.delayedBind.js\
 26+ js/plugins/jquery.namespaceSelect.js\
 27+ js/plugins/jquery.suggestions.js\
 28+ js/plugins/jquery.textSelection.js\
 29+ js/plugins/jquery.wikiEditor.js\
 30+ js/plugins/jquery.wikiEditor.dialogs.js\
 31+ js/plugins/jquery.wikiEditor.toolbar.js\
 32+ js/plugins/jquery.wikiEditor.toc.js
3033
31 -all: css/combined.css\
 34+all: \
 35+ css/combined.css\
3236 css/combined.min.css\
3337 js/js2.combined.js\
3438 js/js2.combined.min.js\
@@ -43,17 +47,25 @@
4448 js/plugins.combined.js: $(PLUGINS)
4549 cat $(PLUGINS) > js/plugins.combined.js
4650
47 -js/js2.combined.min.js : js/js2.combined.js
48 - jsmin < js/js2.combined.js > js/js2.combined.min.js
 51+js/js2.combined.min.js : js/js2.combined.js jsmin
 52+ if [ -e ./jsmin ]; then ./jsmin < js/js2.combined.js > js/js2.combined.min.js;\
 53+ else jsmin < js/js2.combined.js > js/js2.combined.min.js; fi
4954
50 -js/plugins.combined.min.js : js/plugins.combined.js
51 - jsmin < js/plugins.combined.js > js/plugins.combined.min.js
 55+js/plugins.combined.min.js : js/plugins.combined.js jsmin
 56+ if [ -e ./jsmin ]; then ./jsmin < js/plugins.combined.js > js/plugins.combined.min.js;\
 57+ else jsmin < js/plugins.combined.js > js/plugins.combined.min.js; fi
5258
5359 css/combined.min.css : css/combined.css
54 - cat css/combined.css |\
55 - sed -e 's/^[ ]*//g; s/[ ]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d'\
 60+ cat css/combined.css | sed -e 's/^[ ]*//g; s/[ ]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d'\
5661 > css/combined.min.css
5762
 63+jsmin:
 64+ type -P jsmin &>/dev/null || ( wget http://www.crockford.com/javascript/jsmin.c; gcc jsmin.c -o jsmin )
 65+
 66+distclean: clean
 67+ rm -rf jsmin
 68+ rm -rf jsmin.c
 69+
5870 clean:
5971 rm -f js/js2.combined.*
6072 rm -f js/plugins.combined.*
Index: branches/usability/acaifix/css/wikiEditor.toolbar.css
@@ -11,7 +11,6 @@
1212 width: 100%;
1313 clear: both;
1414 height: 0;
15 - overflow: hidden;
1615 }
1716 body.rtl .wikiEditor-ui-toolbar .sections {
1817 float: right;
Index: branches/usability/acaifix/css/wikiEditor.toc.css
@@ -21,33 +21,55 @@
2222 }
2323 .wikiEditor-ui-toc ul {
2424 padding: 0;
25 - margin: 0.5em 1em;
 25+ margin: 0;
2626 list-style: none;
2727 /* IE needs to be told in great detail how to act, or it misbehaves */
2828 list-style-image: none;
2929 list-style-position: outside;
3030 list-style-type: none;
 31+ width: 100%;
3132 }
 33+.wikiEditor-ui-toc li {
 34+ padding: 0;
 35+ margin: 0;
 36+}
3237 .wikiEditor-ui-toc ul ul {
3338 padding: 0;
3439 margin: 0;
35 - margin-left: 0.75em;
3640 margin-bottom: 0 !important;
3741 margin-top: 0 !important;
3842 list-style: none;
3943 }
40 -body.rtl .wikiEditor-ui-toc ul ul {
41 - margin-left: 0;
42 - margin-right: 0.75em;
43 -}
44 -.wikiEditor-ui-toc ul li a {
 44+.wikiEditor-ui-toc ul li div {
4545 display: block;
4646 font-size: 0.9em;
 47+ padding: 0.125em;
 48+ padding-left: 1em;
 49+ cursor: pointer;
 50+ color: #0645ad;
4751 }
48 -.wikiEditor-ui-toc ul li a.currentSelection {
49 - font-weight: bold;
 52+.wikiEditor-ui-toc ul ul li div {
 53+ padding-left: 2em;
5054 }
51 -.wikiEditor-ui-toc ul li a.section-0 {
 55+.wikiEditor-ui-toc ul ul ul li div {
 56+ padding-left: 3em;
 57+}
 58+.wikiEditor-ui-toc ul ul ul ul li div {
 59+ padding-left: 4em;
 60+}
 61+.wikiEditor-ui-toc ul ul ul ul ul li div {
 62+ padding-left: 5em;
 63+}
 64+.wikiEditor-ui-toc ul ul ul ul ul ul li div {
 65+ padding-left: 6em;
 66+}
 67+.wikiEditor-ui-toc ul li div.current {
 68+ background-color: #FAFAFA;
 69+ color: #333333;
 70+}
 71+.wikiEditor-ui-toc ul li div.section-0 {
5272 font-size: 1em;
 73+ padding-top: 0.5em;
 74+ padding-bottom: 0.5em;
5375 border-bottom: solid 1px #DDDDDD;
54 -}
\ No newline at end of file
 76+}
Index: branches/usability/acaifix/css/combined.css
@@ -126,36 +126,59 @@
127127 }
128128 .wikiEditor-ui-toc ul {
129129 padding: 0;
130 - margin: 0.5em 1em;
 130+ margin: 0;
131131 list-style: none;
132132 /* IE needs to be told in great detail how to act, or it misbehaves */
133133 list-style-image: none;
134134 list-style-position: outside;
135135 list-style-type: none;
 136+ width: 100%;
136137 }
 138+.wikiEditor-ui-toc li {
 139+ padding: 0;
 140+ margin: 0;
 141+}
137142 .wikiEditor-ui-toc ul ul {
138143 padding: 0;
139144 margin: 0;
140 - margin-left: 0.75em;
141145 margin-bottom: 0 !important;
142146 margin-top: 0 !important;
143147 list-style: none;
144148 }
145 -body.rtl .wikiEditor-ui-toc ul ul {
146 - margin-left: 0;
147 - margin-right: 0.75em;
148 -}
149 -.wikiEditor-ui-toc ul li a {
 149+.wikiEditor-ui-toc ul li div {
150150 display: block;
151151 font-size: 0.9em;
 152+ padding: 0.125em;
 153+ padding-left: 1em;
 154+ cursor: pointer;
 155+ color: #0645ad;
152156 }
153 -.wikiEditor-ui-toc ul li a.currentSelection {
154 - font-weight: bold;
 157+.wikiEditor-ui-toc ul ul li div {
 158+ padding-left: 2em;
155159 }
156 -.wikiEditor-ui-toc ul li a.section-0 {
 160+.wikiEditor-ui-toc ul ul ul li div {
 161+ padding-left: 3em;
 162+}
 163+.wikiEditor-ui-toc ul ul ul ul li div {
 164+ padding-left: 4em;
 165+}
 166+.wikiEditor-ui-toc ul ul ul ul ul li div {
 167+ padding-left: 5em;
 168+}
 169+.wikiEditor-ui-toc ul ul ul ul ul ul li div {
 170+ padding-left: 6em;
 171+}
 172+.wikiEditor-ui-toc ul li div.current {
 173+ background-color: #FAFAFA;
 174+ color: #333333;
 175+}
 176+.wikiEditor-ui-toc ul li div.section-0 {
157177 font-size: 1em;
 178+ padding-top: 0.5em;
 179+ padding-bottom: 0.5em;
158180 border-bottom: solid 1px #DDDDDD;
159 -}/* wikiEditor toolbar module */
 181+}
 182+/* wikiEditor toolbar module */
160183
161184 .wikiEditor-ui-toolbar {
162185 position: relative;
@@ -168,7 +191,6 @@
169192 width: 100%;
170193 clear: both;
171194 height: 0;
172 - overflow: hidden;
173195 }
174196 body.rtl .wikiEditor-ui-toolbar .sections {
175197 float: right;
Index: branches/usability/acaifix/css/combined.min.css
@@ -114,33 +114,55 @@
115115 }
116116 .wikiEditor-ui-toc ul{
117117 padding:0;
118 -margin:0.5em 1em;
 118+margin:0;
119119 list-style:none;
120120 list-style-image:none;
121121 list-style-position:outside;
122122 list-style-type:none;
 123+width:100%;
123124 }
 125+.wikiEditor-ui-toc li{
 126+padding:0;
 127+margin:0;
 128+}
124129 .wikiEditor-ui-toc ul ul{
125130 padding:0;
126131 margin:0;
127 -margin-left:0.75em;
128132 margin-bottom:0 !important;
129133 margin-top:0 !important;
130134 list-style:none;
131135 }
132 -body.rtl .wikiEditor-ui-toc ul ul{
133 -margin-left:0;
134 -margin-right:0.75em;
135 -}
136 -.wikiEditor-ui-toc ul li a{
 136+.wikiEditor-ui-toc ul li div{
137137 display:block;
138138 font-size:0.9em;
 139+padding:0.125em;
 140+padding-left:1em;
 141+cursor:pointer;
 142+color:#0645ad;
139143 }
140 -.wikiEditor-ui-toc ul li a.currentSelection{
141 -font-weight:bold;
 144+.wikiEditor-ui-toc ul ul li div{
 145+padding-left:2em;
142146 }
143 -.wikiEditor-ui-toc ul li a.section-0{
 147+.wikiEditor-ui-toc ul ul ul li div{
 148+padding-left:3em;
 149+}
 150+.wikiEditor-ui-toc ul ul ul ul li div{
 151+padding-left:4em;
 152+}
 153+.wikiEditor-ui-toc ul ul ul ul ul li div{
 154+padding-left:5em;
 155+}
 156+.wikiEditor-ui-toc ul ul ul ul ul ul li div{
 157+padding-left:6em;
 158+}
 159+.wikiEditor-ui-toc ul li div.current{
 160+background-color:#FAFAFA;
 161+color:#333333;
 162+}
 163+.wikiEditor-ui-toc ul li div.section-0{
144164 font-size:1em;
 165+padding-top:0.5em;
 166+padding-bottom:0.5em;
145167 border-bottom:solid 1px #DDDDDD;
146168 }
147169 .wikiEditor-ui-toolbar{
@@ -152,7 +174,6 @@
153175 width:100%;
154176 clear:both;
155177 height:0;
156 -overflow:hidden;
157178 }
158179 body.rtl .wikiEditor-ui-toolbar .sections{
159180 float:right;
@@ -459,4 +480,4 @@
460481 background-color:white;
461482 text-decoration:none;
462483 border-color:#a8d7f9;
463 -}
 484+}
\ No newline at end of file
Index: branches/usability/acaifix/NavigableTOC/NavigableTOC.php
@@ -27,7 +27,7 @@
2828 $wgNavigableTOCUserEnable = true;
2929
3030 // Bump the version number every time you change any of the .css/.js files
31 -$wgNavigableTOCStyleVersion = 3;
 31+$wgNavigableTOCStyleVersion = 6;
3232
3333 /* Setup */
3434

Status & tagging log