Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -49,16 +49,16 @@ |
50 | 50 | array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ), |
51 | 51 | array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 3 ), |
52 | 52 | array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ), |
53 | | - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 3 ), |
| 53 | + array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 4 ), |
54 | 54 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 4 ), |
55 | 55 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 5 ), |
56 | 56 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 4 ), |
57 | 57 | ), |
58 | 58 | 'combined' => array( |
59 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 5 ), |
| 59 | + array( 'src' => 'js/plugins.combined.js', 'version' => 6 ), |
60 | 60 | ), |
61 | 61 | 'minified' => array( |
62 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 5 ), |
| 62 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 6 ), |
63 | 63 | ), |
64 | 64 | ), |
65 | 65 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | post += ' ' |
29 | 29 | } |
30 | 30 | } |
31 | | - var e = this.jquery ? this[0] : this; |
| 31 | + var e = this.jquery ? this[0] : this; |
32 | 32 | var selText; |
33 | 33 | var isSample = false; |
34 | 34 | if ( document.selection && document.selection.createRange ) { |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | } |
77 | 77 | e.scrollTop = textScroll; |
78 | 78 | } |
79 | | - $(this).trigger( 'encapsulateSelection' ); |
| 79 | + $(this).trigger( 'encapsulateSelection', [ pre, peri, post ] ); |
80 | 80 | }, |
81 | 81 | /** |
82 | 82 | * Ported from Wikia's LinkSuggest extension |
Index: trunk/extensions/UsabilityInitiative/js/js2.combined.js |
— | — | @@ -1266,150 +1266,150 @@ |
1267 | 1267 | function num(elem, prop) { |
1268 | 1268 | return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; |
1269 | 1269 | } |
1270 | | -var expando = "jQuery" + now(), uuid = 0, windowData = {};
|
1271 | | -
|
1272 | | -jQuery.extend({
|
1273 | | - cache: {},
|
1274 | | -
|
1275 | | - data: function( elem, name, data ) {
|
1276 | | - elem = elem == window ?
|
1277 | | - windowData :
|
1278 | | - elem;
|
1279 | | -
|
1280 | | - var id = elem[ expando ];
|
1281 | | -
|
1282 | | - // Compute a unique ID for the element
|
1283 | | - if ( !id )
|
1284 | | - id = elem[ expando ] = ++uuid;
|
1285 | | -
|
1286 | | - // Only generate the data cache if we're
|
1287 | | - // trying to access or manipulate it
|
1288 | | - if ( name && !jQuery.cache[ id ] )
|
1289 | | - jQuery.cache[ id ] = {};
|
1290 | | -
|
1291 | | - // Prevent overriding the named cache with undefined values
|
1292 | | - if ( data !== undefined )
|
1293 | | - jQuery.cache[ id ][ name ] = data;
|
1294 | | -
|
1295 | | - // Return the named cache data, or the ID for the element
|
1296 | | - return name ?
|
1297 | | - jQuery.cache[ id ][ name ] :
|
1298 | | - id;
|
1299 | | - },
|
1300 | | -
|
1301 | | - removeData: function( elem, name ) {
|
1302 | | - elem = elem == window ?
|
1303 | | - windowData :
|
1304 | | - elem;
|
1305 | | -
|
1306 | | - var id = elem[ expando ];
|
1307 | | -
|
1308 | | - // If we want to remove a specific section of the element's data
|
1309 | | - if ( name ) {
|
1310 | | - if ( jQuery.cache[ id ] ) {
|
1311 | | - // Remove the section of cache data
|
1312 | | - delete jQuery.cache[ id ][ name ];
|
1313 | | -
|
1314 | | - // If we've removed all the data, remove the element's cache
|
1315 | | - name = "";
|
1316 | | -
|
1317 | | - for ( name in jQuery.cache[ id ] )
|
1318 | | - break;
|
1319 | | -
|
1320 | | - if ( !name )
|
1321 | | - jQuery.removeData( elem );
|
1322 | | - }
|
1323 | | -
|
1324 | | - // Otherwise, we want to remove all of the element's data
|
1325 | | - } else {
|
1326 | | - // Clean up the element expando
|
1327 | | - try {
|
1328 | | - delete elem[ expando ];
|
1329 | | - } catch(e){
|
1330 | | - // IE has trouble directly removing the expando
|
1331 | | - // but it's ok with using removeAttribute
|
1332 | | - if ( elem.removeAttribute )
|
1333 | | - elem.removeAttribute( expando );
|
1334 | | - }
|
1335 | | -
|
1336 | | - // Completely remove the data cache
|
1337 | | - delete jQuery.cache[ id ];
|
1338 | | - }
|
1339 | | - },
|
1340 | | - queue: function( elem, type, data ) {
|
1341 | | - if ( elem ){
|
1342 | | -
|
1343 | | - type = (type || "fx") + "queue";
|
1344 | | -
|
1345 | | - var q = jQuery.data( elem, type );
|
1346 | | -
|
1347 | | - if ( !q || jQuery.isArray(data) )
|
1348 | | - q = jQuery.data( elem, type, jQuery.makeArray(data) );
|
1349 | | - else if( data )
|
1350 | | - q.push( data );
|
1351 | | -
|
1352 | | - }
|
1353 | | - return q;
|
1354 | | - },
|
1355 | | -
|
1356 | | - dequeue: function( elem, type ){
|
1357 | | - var queue = jQuery.queue( elem, type ),
|
1358 | | - fn = queue.shift();
|
1359 | | -
|
1360 | | - if( !type || type === "fx" )
|
1361 | | - fn = queue[0];
|
1362 | | -
|
1363 | | - if( fn !== undefined )
|
1364 | | - fn.call(elem);
|
1365 | | - }
|
1366 | | -});
|
1367 | | -
|
1368 | | -jQuery.fn.extend({
|
1369 | | - data: function( key, value ){
|
1370 | | - var parts = key.split(".");
|
1371 | | - parts[1] = parts[1] ? "." + parts[1] : "";
|
1372 | | -
|
1373 | | - if ( value === undefined ) {
|
1374 | | - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
1375 | | -
|
1376 | | - if ( data === undefined && this.length )
|
1377 | | - data = jQuery.data( this[0], key );
|
1378 | | -
|
1379 | | - return data === undefined && parts[1] ?
|
1380 | | - this.data( parts[0] ) :
|
1381 | | - data;
|
1382 | | - } else
|
1383 | | - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
|
1384 | | - jQuery.data( this, key, value );
|
1385 | | - });
|
1386 | | - },
|
1387 | | -
|
1388 | | - removeData: function( key ){
|
1389 | | - return this.each(function(){
|
1390 | | - jQuery.removeData( this, key );
|
1391 | | - });
|
1392 | | - },
|
1393 | | - queue: function(type, data){
|
1394 | | - if ( typeof type !== "string" ) {
|
1395 | | - data = type;
|
1396 | | - type = "fx";
|
1397 | | - }
|
1398 | | -
|
1399 | | - if ( data === undefined )
|
1400 | | - return jQuery.queue( this[0], type );
|
1401 | | -
|
1402 | | - return this.each(function(){
|
1403 | | - var queue = jQuery.queue( this, type, data );
|
1404 | | -
|
1405 | | - if( type == "fx" && queue.length == 1 )
|
1406 | | - queue[0].call(this);
|
1407 | | - });
|
1408 | | - },
|
1409 | | - dequeue: function(type){
|
1410 | | - return this.each(function(){
|
1411 | | - jQuery.dequeue( this, type );
|
1412 | | - });
|
1413 | | - }
|
| 1270 | +var expando = "jQuery" + now(), uuid = 0, windowData = {}; |
| 1271 | + |
| 1272 | +jQuery.extend({ |
| 1273 | + cache: {}, |
| 1274 | + |
| 1275 | + data: function( elem, name, data ) { |
| 1276 | + elem = elem == window ? |
| 1277 | + windowData : |
| 1278 | + elem; |
| 1279 | + |
| 1280 | + var id = elem[ expando ]; |
| 1281 | + |
| 1282 | + // Compute a unique ID for the element |
| 1283 | + if ( !id ) |
| 1284 | + id = elem[ expando ] = ++uuid; |
| 1285 | + |
| 1286 | + // Only generate the data cache if we're |
| 1287 | + // trying to access or manipulate it |
| 1288 | + if ( name && !jQuery.cache[ id ] ) |
| 1289 | + jQuery.cache[ id ] = {}; |
| 1290 | + |
| 1291 | + // Prevent overriding the named cache with undefined values |
| 1292 | + if ( data !== undefined ) |
| 1293 | + jQuery.cache[ id ][ name ] = data; |
| 1294 | + |
| 1295 | + // Return the named cache data, or the ID for the element |
| 1296 | + return name ? |
| 1297 | + jQuery.cache[ id ][ name ] : |
| 1298 | + id; |
| 1299 | + }, |
| 1300 | + |
| 1301 | + removeData: function( elem, name ) { |
| 1302 | + elem = elem == window ? |
| 1303 | + windowData : |
| 1304 | + elem; |
| 1305 | + |
| 1306 | + var id = elem[ expando ]; |
| 1307 | + |
| 1308 | + // If we want to remove a specific section of the element's data |
| 1309 | + if ( name ) { |
| 1310 | + if ( jQuery.cache[ id ] ) { |
| 1311 | + // Remove the section of cache data |
| 1312 | + delete jQuery.cache[ id ][ name ]; |
| 1313 | + |
| 1314 | + // If we've removed all the data, remove the element's cache |
| 1315 | + name = ""; |
| 1316 | + |
| 1317 | + for ( name in jQuery.cache[ id ] ) |
| 1318 | + break; |
| 1319 | + |
| 1320 | + if ( !name ) |
| 1321 | + jQuery.removeData( elem ); |
| 1322 | + } |
| 1323 | + |
| 1324 | + // Otherwise, we want to remove all of the element's data |
| 1325 | + } else { |
| 1326 | + // Clean up the element expando |
| 1327 | + try { |
| 1328 | + delete elem[ expando ]; |
| 1329 | + } catch(e){ |
| 1330 | + // IE has trouble directly removing the expando |
| 1331 | + // but it's ok with using removeAttribute |
| 1332 | + if ( elem.removeAttribute ) |
| 1333 | + elem.removeAttribute( expando ); |
| 1334 | + } |
| 1335 | + |
| 1336 | + // Completely remove the data cache |
| 1337 | + delete jQuery.cache[ id ]; |
| 1338 | + } |
| 1339 | + }, |
| 1340 | + queue: function( elem, type, data ) { |
| 1341 | + if ( elem ){ |
| 1342 | + |
| 1343 | + type = (type || "fx") + "queue"; |
| 1344 | + |
| 1345 | + var q = jQuery.data( elem, type ); |
| 1346 | + |
| 1347 | + if ( !q || jQuery.isArray(data) ) |
| 1348 | + q = jQuery.data( elem, type, jQuery.makeArray(data) ); |
| 1349 | + else if( data ) |
| 1350 | + q.push( data ); |
| 1351 | + |
| 1352 | + } |
| 1353 | + return q; |
| 1354 | + }, |
| 1355 | + |
| 1356 | + dequeue: function( elem, type ){ |
| 1357 | + var queue = jQuery.queue( elem, type ), |
| 1358 | + fn = queue.shift(); |
| 1359 | + |
| 1360 | + if( !type || type === "fx" ) |
| 1361 | + fn = queue[0]; |
| 1362 | + |
| 1363 | + if( fn !== undefined ) |
| 1364 | + fn.call(elem); |
| 1365 | + } |
| 1366 | +}); |
| 1367 | + |
| 1368 | +jQuery.fn.extend({ |
| 1369 | + data: function( key, value ){ |
| 1370 | + var parts = key.split("."); |
| 1371 | + parts[1] = parts[1] ? "." + parts[1] : ""; |
| 1372 | + |
| 1373 | + if ( value === undefined ) { |
| 1374 | + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); |
| 1375 | + |
| 1376 | + if ( data === undefined && this.length ) |
| 1377 | + data = jQuery.data( this[0], key ); |
| 1378 | + |
| 1379 | + return data === undefined && parts[1] ? |
| 1380 | + this.data( parts[0] ) : |
| 1381 | + data; |
| 1382 | + } else |
| 1383 | + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ |
| 1384 | + jQuery.data( this, key, value ); |
| 1385 | + }); |
| 1386 | + }, |
| 1387 | + |
| 1388 | + removeData: function( key ){ |
| 1389 | + return this.each(function(){ |
| 1390 | + jQuery.removeData( this, key ); |
| 1391 | + }); |
| 1392 | + }, |
| 1393 | + queue: function(type, data){ |
| 1394 | + if ( typeof type !== "string" ) { |
| 1395 | + data = type; |
| 1396 | + type = "fx"; |
| 1397 | + } |
| 1398 | + |
| 1399 | + if ( data === undefined ) |
| 1400 | + return jQuery.queue( this[0], type ); |
| 1401 | + |
| 1402 | + return this.each(function(){ |
| 1403 | + var queue = jQuery.queue( this, type, data ); |
| 1404 | + |
| 1405 | + if( type == "fx" && queue.length == 1 ) |
| 1406 | + queue[0].call(this); |
| 1407 | + }); |
| 1408 | + }, |
| 1409 | + dequeue: function(type){ |
| 1410 | + return this.each(function(){ |
| 1411 | + jQuery.dequeue( this, type ); |
| 1412 | + }); |
| 1413 | + } |
1414 | 1414 | });/*! |
1415 | 1415 | * Sizzle CSS Selector Engine - v0.9.3 |
1416 | 1416 | * Copyright 2009, The Dojo Foundation |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -284,7 +284,7 @@ |
285 | 285 | post += ' ' |
286 | 286 | } |
287 | 287 | } |
288 | | - var e = this.jquery ? this[0] : this; |
| 288 | + var e = this.jquery ? this[0] : this; |
289 | 289 | var selText; |
290 | 290 | var isSample = false; |
291 | 291 | if ( document.selection && document.selection.createRange ) { |
— | — | @@ -332,7 +332,7 @@ |
333 | 333 | } |
334 | 334 | e.scrollTop = textScroll; |
335 | 335 | } |
336 | | - $(this).trigger( 'encapsulateSelection' ); |
| 336 | + $(this).trigger( 'encapsulateSelection', [ pre, peri, post ] ); |
337 | 337 | }, |
338 | 338 | /** |
339 | 339 | * Ported from Wikia's LinkSuggest extension |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | range.select();if(document.documentElement&&document.documentElement.scrollTop){document.documentElement.scrollTop=winScroll}else if(document.body){document.body.scrollTop=winScroll;}}else if(e.selectionStart||e.selectionStart=='0'){var textScroll=e.scrollTop;$(this).focus();var startPos=e.selectionStart;var endPos=e.selectionEnd;selText=e.value.substring(startPos,endPos);checkSelectedText();e.value=e.value.substring(0,startPos)+pre+selText+post+ |
27 | 27 | e.value.substring(endPos,e.value.length);if(isSample){e.selectionStart=startPos+pre.length;e.selectionEnd=startPos+pre.length+selText.length;}else{e.selectionStart=startPos+pre.length+selText.length+post.length;e.selectionEnd=e.selectionStart;} |
28 | 28 | e.scrollTop=textScroll;} |
29 | | -$(this).trigger('encapsulateSelection');},getCaretPosition:function(){function getCaret(e){var caretPos=0;if($.browser.msie){var postFinished=false;var periFinished=false;var postFinished=false;var preText,rawPreText,periText;var rawPeriText,postText,rawPostText;var periRange=document.selection.createRange().duplicate();var preRange=document.body.createTextRange();preRange.moveToElementText(e);preRange.setEndPoint("EndToStart",periRange);var postRange=document.body.createTextRange();postRange.moveToElementText(e);postRange.setEndPoint("StartToEnd",periRange);preText=rawPreText=preRange.text;periText=rawPeriText=periRange.text;postText=rawPostText=postRange.text;do{if(!postFinished){if(preRange.compareEndPoints("StartToEnd",preRange)==0){postFinished=true;}else{preRange.moveEnd("character",-1) |
| 29 | +$(this).trigger('encapsulateSelection',[pre,peri,post]);},getCaretPosition:function(){function getCaret(e){var caretPos=0;if($.browser.msie){var postFinished=false;var periFinished=false;var postFinished=false;var preText,rawPreText,periText;var rawPeriText,postText,rawPostText;var periRange=document.selection.createRange().duplicate();var preRange=document.body.createTextRange();preRange.moveToElementText(e);preRange.setEndPoint("EndToStart",periRange);var postRange=document.body.createTextRange();postRange.moveToElementText(e);postRange.setEndPoint("StartToEnd",periRange);preText=rawPreText=preRange.text;periText=rawPeriText=periRange.text;postText=rawPostText=postRange.text;do{if(!postFinished){if(preRange.compareEndPoints("StartToEnd",preRange)==0){postFinished=true;}else{preRange.moveEnd("character",-1) |
30 | 30 | if(preRange.text==preText){rawPreText+="\r\n";}else{postFinished=true;}}} |
31 | 31 | if(!periFinished){if(periRange.compareEndPoints("StartToEnd",periRange)==0){periFinished=true;}else{periRange.moveEnd("character",-1) |
32 | 32 | if(periRange.text==periText){rawPeriText+="\r\n";}else{periFinished=true;}}} |