mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-15 12:00:05 +00:00
Adding quotes for the [rel=] stuff, since this broke one test.
Reported in bug 29106. Patch by Michael M.
This commit is contained in:
parent
3cae03cef5
commit
6f6e7d0565
Notes:
Derk-Jan Hartman
2011-07-02 09:17:01 +00:00
|
@ -40,7 +40,7 @@ api : {
|
||||||
if ( ! ( 'section' in data ) ) {
|
if ( ! ( 'section' in data ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var $section = context.modules.toolbar.$toolbar.find( 'div[rel=' + data.section + '].section' );
|
var $section = context.modules.toolbar.$toolbar.find( 'div[rel="' + data.section + '"].section' );
|
||||||
for ( var group in data[type] ) {
|
for ( var group in data[type] ) {
|
||||||
// Group
|
// Group
|
||||||
$section.append(
|
$section.append(
|
||||||
|
@ -54,7 +54,7 @@ api : {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var $group = context.modules.toolbar.$toolbar.find(
|
var $group = context.modules.toolbar.$toolbar.find(
|
||||||
'div[rel=' + data.section + '].section ' + 'div[rel=' + data.group + '].group'
|
'div[rel="' + data.section + '"].section ' + 'div[rel=' + data.group + '].group'
|
||||||
);
|
);
|
||||||
for ( var tool in data[type] ) {
|
for ( var tool in data[type] ) {
|
||||||
// Tool
|
// Tool
|
||||||
|
@ -70,10 +70,10 @@ api : {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var $pages = context.modules.toolbar.$toolbar.find(
|
var $pages = context.modules.toolbar.$toolbar.find(
|
||||||
'div[rel=' + data.section + '].section .pages'
|
'div[rel="' + data.section + '"].section .pages'
|
||||||
);
|
);
|
||||||
var $index = context.modules.toolbar.$toolbar.find(
|
var $index = context.modules.toolbar.$toolbar.find(
|
||||||
'div[rel=' + data.section + '].section .index'
|
'div[rel="' + data.section + '"].section .index'
|
||||||
);
|
);
|
||||||
for ( var page in data[type] ) {
|
for ( var page in data[type] ) {
|
||||||
// Page
|
// Page
|
||||||
|
@ -91,7 +91,7 @@ api : {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var $table = context.modules.toolbar.$toolbar.find(
|
var $table = context.modules.toolbar.$toolbar.find(
|
||||||
'div[rel=' + data.section + '].section ' + 'div[rel=' + data.page + '].page table'
|
'div[rel="' + data.section + '"].section ' + 'div[rel=' + data.page + '].page table'
|
||||||
);
|
);
|
||||||
for ( i = 0; i < data.rows.length; i++ ) {
|
for ( i = 0; i < data.rows.length; i++ ) {
|
||||||
// Row
|
// Row
|
||||||
|
@ -104,7 +104,7 @@ api : {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var $characters = context.modules.toolbar.$toolbar.find(
|
var $characters = context.modules.toolbar.$toolbar.find(
|
||||||
'div[rel=' + data.section + '].section ' + 'div[rel=' + data.page + '].page div'
|
'div[rel="' + data.section + '"].section ' + 'div[rel="' + data.page + '"].page div'
|
||||||
);
|
);
|
||||||
var actions = $characters.data( 'actions' );
|
var actions = $characters.data( 'actions' );
|
||||||
for ( i = 0; data.character.length; i++ ) {
|
for ( i = 0; data.character.length; i++ ) {
|
||||||
|
@ -147,25 +147,25 @@ api : {
|
||||||
removeFromToolbar : function( context, data ) {
|
removeFromToolbar : function( context, data ) {
|
||||||
if ( typeof data.section == 'string' ) {
|
if ( typeof data.section == 'string' ) {
|
||||||
// Section
|
// Section
|
||||||
var tab = 'div.tabs span[rel=' + data.section + '].tab';
|
var tab = 'div.tabs span[rel="' + data.section + '"].tab';
|
||||||
var target = 'div[rel=' + data.section + '].section';
|
var target = 'div[rel="' + data.section + '"].section';
|
||||||
var group = null;
|
var group = null;
|
||||||
if ( typeof data.group == 'string' ) {
|
if ( typeof data.group == 'string' ) {
|
||||||
// Toolbar group
|
// Toolbar group
|
||||||
target += ' div[rel=' + data.group + '].group';
|
target += ' div[rel="' + data.group + '"].group';
|
||||||
if ( typeof data.tool == 'string' ) {
|
if ( typeof data.tool == 'string' ) {
|
||||||
// Save for later checking if empty
|
// Save for later checking if empty
|
||||||
group = target;
|
group = target;
|
||||||
// Tool
|
// Tool
|
||||||
target += ' span[rel=' + data.tool + '].tool';
|
target += ' span[rel="' + data.tool + '"].tool';
|
||||||
}
|
}
|
||||||
} else if ( typeof data.page == 'string' ) {
|
} else if ( typeof data.page == 'string' ) {
|
||||||
// Booklet page
|
// Booklet page
|
||||||
var index = target + ' div.index div[rel=' + data.page + ']';
|
var index = target + ' div.index div[rel="' + data.page + '"]';
|
||||||
target += ' div.pages div[rel=' + data.page + '].page';
|
target += ' div.pages div[rel="' + data.page + '"].page';
|
||||||
if ( typeof data.character == 'string' ) {
|
if ( typeof data.character == 'string' ) {
|
||||||
// Character
|
// Character
|
||||||
target += ' span[rel=' + data.character + ']';
|
target += ' span[rel="' + data.character + '"]';
|
||||||
} else if ( typeof data.row == 'number' ) {
|
} else if ( typeof data.row == 'number' ) {
|
||||||
// Table row
|
// Table row
|
||||||
target += ' table tr:not(:has(th)):eq(' + data.row + ')';
|
target += ' table tr:not(:has(th)):eq(' + data.row + ')';
|
||||||
|
@ -719,14 +719,14 @@ fn: {
|
||||||
if ( selected != null ) {
|
if ( selected != null ) {
|
||||||
$.cookie( cookie, selected, { expires: 30, path: '/' } );
|
$.cookie( cookie, selected, { expires: 30, path: '/' } );
|
||||||
}
|
}
|
||||||
var $selectedIndex = $index.find( '*[rel=' + selected + ']' );
|
var $selectedIndex = $index.find( '*[rel="' + selected + '"]' );
|
||||||
if ( $selectedIndex.size() === 0 ) {
|
if ( $selectedIndex.size() === 0 ) {
|
||||||
$selectedIndex = $index.children().eq( 0 );
|
$selectedIndex = $index.children().eq( 0 );
|
||||||
selected = $selectedIndex.attr( 'rel' );
|
selected = $selectedIndex.attr( 'rel' );
|
||||||
$.cookie( cookie, selected, { expires: 30, path: '/' } );
|
$.cookie( cookie, selected, { expires: 30, path: '/' } );
|
||||||
}
|
}
|
||||||
$pages.children().hide();
|
$pages.children().hide();
|
||||||
$pages.find( '*[rel=' + selected + ']' ).show();
|
$pages.find( '*[rel="' + selected + '"]' ).show();
|
||||||
$index.children().removeClass( 'current' );
|
$index.children().removeClass( 'current' );
|
||||||
$selectedIndex.addClass( 'current' );
|
$selectedIndex.addClass( 'current' );
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue