Some of the booklet related toolbar-API-functions don't work in a $j( document ).ready-function: Inserting an empty booklet (if you want to build things up step by step), adding pages to the two existing booklets (adding pages to an own booklet works), removing pages and removing characters.
To test it, put this into your personal vector.js:
function atT_booklet() { $j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'sections': { 'emoticons': { 'type': 'booklet', 'label': 'Emoticons' } } } ); } function atT_chars() { $j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'characters', 'pages': { 'emoticons': { 'layout': 'characters', 'label': 'Emoticons', 'characters': [ ':)', ':))', ':(', '<3', ';)' ] } } } ); } function atT_table() { $j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'help', 'pages': { 'colors': { 'layout': 'table', 'label': 'Colors', 'headings': [ { text: 'Name' }, // or use textMsg for localization, see also above { text: 'Temperature' }, { text: 'Swatch' } ], 'rows': [ { 'name': { text: 'Red' }, 'temp': { text: 'Warm' }, 'swatch': { html: '<div style="width:10px;height:10px;background-color:red;">' } }, { 'name': { text: 'Blue' }, 'temp': { text: 'Cold' }, 'swatch': { html: '<div style="width:10px;height:10px;background-color:blue;">' } }, { 'name': { text: 'Silver' }, 'temp': { text: 'Neutral' }, 'swatch': { html: '<div style="width:10px;height:10px;background-color:silver;">' } } ] } } } ); } function rfT_page() { $j( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'help', 'page': 'format' } ); } function rfT_char() { $j( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'characters', 'page': 'latin', 'character': 'Á' } ); } if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) { // Execute on load $j( document ).ready( function() { atT_booklet(); //atT_chars(); //atT_table(); //rfT_page(); //rfT_char(); });}
Expectet behaviour: The thing not commented out should appear/disappear.
Actual behaviour: Nothing happens, atT_booklet fails with "page is not defined", the others fail silently.
The interesting thing: All functions work via javascript:atT_booklet(); in the browser's navigation bar or if you put them in some onclick-thing or in a window.setTimeout.
Version: unspecified
Severity: normal