summaryrefslogtreecommitdiff
path: root/addons/website/static/lib/ckeditor/plugins/a11yhelp
diff options
context:
space:
mode:
authorParamjit Singh Sahota <psa@tinyerp.com>2013-12-24 11:01:25 +0530
committerParamjit Singh Sahota <psa@tinyerp.com>2013-12-24 11:01:25 +0530
commit18d8368ee11eef0a74bacdb8f293414331bfa8da (patch)
treefc21df70cbd2901396c2bcf2fee0b52d750abd43 /addons/website/static/lib/ckeditor/plugins/a11yhelp
parent5900672160c2bd5ae1d9257f20dbb5c51a193996 (diff)
parent123185757f51ee7e146d7295864556999d2a6938 (diff)
[MERGE] Merged lp:~openerp-dev/openobject-addons/trunk-website-al
bzr revid: psa@tinyerp.com-20131224053125-3lrogsrgd3ccp0i6
Diffstat (limited to 'addons/website/static/lib/ckeditor/plugins/a11yhelp')
-rw-r--r--addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js217
-rw-r--r--addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/lang/en.js106
-rw-r--r--addons/website/static/lib/ckeditor/plugins/a11yhelp/plugin.js45
3 files changed, 0 insertions, 368 deletions
diff --git a/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js b/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js
deleted file mode 100644
index 770ea36c604..00000000000
--- a/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or http://ckeditor.com/license
- */
-
-CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {
- var lang = editor.lang.a11yhelp,
- id = CKEDITOR.tools.getNextId();
-
- // CharCode <-> KeyChar.
- var keyMap = {
- 8: "BACKSPACE",
- 9: "TAB",
- 13: "ENTER",
- 16: "SHIFT",
- 17: "CTRL",
- 18: "ALT",
- 19: "PAUSE",
- 20: "CAPSLOCK",
- 27: "ESCAPE",
- 33: "PAGE UP",
- 34: "PAGE DOWN",
- 35: "END",
- 36: "HOME",
- 37: "LEFT ARROW",
- 38: "UP ARROW",
- 39: "RIGHT ARROW",
- 40: "DOWN ARROW",
- 45: "INSERT",
- 46: "DELETE",
- 91: "LEFT WINDOW KEY",
- 92: "RIGHT WINDOW KEY",
- 93: "SELECT KEY",
- 96: "NUMPAD 0",
- 97: "NUMPAD 1",
- 98: "NUMPAD 2",
- 99: "NUMPAD 3",
- 100: "NUMPAD 4",
- 101: "NUMPAD 5",
- 102: "NUMPAD 6",
- 103: "NUMPAD 7",
- 104: "NUMPAD 8",
- 105: "NUMPAD 9",
- 106: "MULTIPLY",
- 107: "ADD",
- 109: "SUBTRACT",
- 110: "DECIMAL POINT",
- 111: "DIVIDE",
- 112: "F1",
- 113: "F2",
- 114: "F3",
- 115: "F4",
- 116: "F5",
- 117: "F6",
- 118: "F7",
- 119: "F8",
- 120: "F9",
- 121: "F10",
- 122: "F11",
- 123: "F12",
- 144: "NUM LOCK",
- 145: "SCROLL LOCK",
- 186: "SEMI-COLON",
- 187: "EQUAL SIGN",
- 188: "COMMA",
- 189: "DASH",
- 190: "PERIOD",
- 191: "FORWARD SLASH",
- 192: "GRAVE ACCENT",
- 219: "OPEN BRACKET",
- 220: "BACK SLASH",
- 221: "CLOSE BRAKET",
- 222: "SINGLE QUOTE"
- };
-
- // Modifier keys override.
- keyMap[ CKEDITOR.ALT ] = 'ALT';
- keyMap[ CKEDITOR.SHIFT ] = 'SHIFT';
- keyMap[ CKEDITOR.CTRL ] = 'CTRL';
-
- // Sort in desc.
- var modifiers = [ CKEDITOR.ALT, CKEDITOR.SHIFT, CKEDITOR.CTRL ];
-
- function representKeyStroke( keystroke ) {
- var quotient, modifier,
- presentation = [];
-
- for ( var i = 0; i < modifiers.length; i++ ) {
- modifier = modifiers[ i ];
- quotient = keystroke / modifiers[ i ];
- if ( quotient > 1 && quotient <= 2 ) {
- keystroke -= modifier;
- presentation.push( keyMap[ modifier ] );
- }
- }
-
- presentation.push( keyMap[ keystroke ] || String.fromCharCode( keystroke ) );
-
- return presentation.join( '+' );
- }
-
- var variablesPattern = /\$\{(.*?)\}/g;
-
- var replaceVariables = (function() {
- // Swaps keystrokes with their commands in object literal.
- // This makes searching keystrokes by command much easier.
- var keystrokesByCode = editor.keystrokeHandler.keystrokes,
- keystrokesByName = {};
-
- for ( var i in keystrokesByCode )
- keystrokesByName[ keystrokesByCode[ i ] ] = i;
-
- return function( match, name ) {
- // Return the keystroke representation or leave match untouched
- // if there's no keystroke for such command.
- return keystrokesByName[ name ] ? representKeyStroke( keystrokesByName[ name ] ) : match;
- };
- })();
-
- // Create the help list directly from lang file entries.
- function buildHelpContents() {
- var pageTpl = '<div class="cke_accessibility_legend" role="document" aria-labelledby="' + id + '_arialbl" tabIndex="-1">%1</div>' +
- '<span id="' + id + '_arialbl" class="cke_voice_label">' + lang.contents + ' </span>',
- sectionTpl = '<h1>%1</h1><dl>%2</dl>',
- itemTpl = '<dt>%1</dt><dd>%2</dd>';
-
- var pageHtml = [],
- sections = lang.legend,
- sectionLength = sections.length;
-
- for ( var i = 0; i < sectionLength; i++ ) {
- var section = sections[ i ],
- sectionHtml = [],
- items = section.items,
- itemsLength = items.length;
-
- for ( var j = 0; j < itemsLength; j++ ) {
- var item = items[ j ],
- itemLegend = item.legend.replace( variablesPattern, replaceVariables );
-
- // (#9765) If some commands haven't been replaced in the legend,
- // most likely their keystrokes are unavailable and we shouldn't include
- // them in our help list.
- if ( itemLegend.match( variablesPattern ) )
- continue;
-
- sectionHtml.push( itemTpl.replace( '%1', item.name ).replace( '%2', itemLegend ) );
- }
-
- pageHtml.push( sectionTpl.replace( '%1', section.name ).replace( '%2', sectionHtml.join( '' ) ) );
- }
-
- return pageTpl.replace( '%1', pageHtml.join( '' ) );
- }
-
- return {
- title: lang.title,
- minWidth: 600,
- minHeight: 400,
- contents: [
- {
- id: 'info',
- label: editor.lang.common.generalTab,
- expand: true,
- elements: [
- {
- type: 'html',
- id: 'legends',
- style: 'white-space:normal;',
- focus: function() { this.getElement().focus(); },
- html: buildHelpContents() + '<style type="text/css">' +
- '.cke_accessibility_legend' +
- '{' +
- 'width:600px;' +
- 'height:400px;' +
- 'padding-right:5px;' +
- 'overflow-y:auto;' +
- 'overflow-x:hidden;' +
- '}' +
- // Some adjustments are to be done for IE6 and Quirks to work "properly" (#5757)
- '.cke_browser_quirks .cke_accessibility_legend,' +
- '.cke_browser_ie6 .cke_accessibility_legend' +
- '{' +
- 'height:390px' +
- '}' +
- // Override non-wrapping white-space rule in reset css.
- '.cke_accessibility_legend *' +
- '{' +
- 'white-space:normal;' +
- '}' +
- '.cke_accessibility_legend h1' +
- '{' +
- 'font-size: 20px;' +
- 'border-bottom: 1px solid #AAA;' +
- 'margin: 5px 0px 15px;' +
- '}' +
- '.cke_accessibility_legend dl' +
- '{' +
- 'margin-left: 5px;' +
- '}' +
- '.cke_accessibility_legend dt' +
- '{' +
- 'font-size: 13px;' +
- 'font-weight: bold;' +
- '}' +
- '.cke_accessibility_legend dd' +
- '{' +
- 'margin:10px' +
- '}' +
- '</style>'
- }
- ]
- }
- ],
- buttons: [ CKEDITOR.dialog.cancelButton ]
- };
-});
diff --git a/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/lang/en.js b/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/lang/en.js
deleted file mode 100644
index 1df642771b5..00000000000
--- a/addons/website/static/lib/ckeditor/plugins/a11yhelp/dialogs/lang/en.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or http://ckeditor.com/license
- */
-
-CKEDITOR.plugins.setLang( 'a11yhelp', 'en', {
- title: 'Accessibility Instructions',
- contents: 'Help Contents. To close this dialog press ESC.',
- legend: [
- {
- name: 'General',
- items: [
- {
- name: 'Editor Toolbar',
- legend: 'Press ${toolbarFocus} to navigate to the toolbar. ' +
- 'Move to the next and previous toolbar group with TAB and SHIFT-TAB. ' +
- 'Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. ' +
- 'Press SPACE or ENTER to activate the toolbar button.'
- },
-
- {
- name: 'Editor Dialog',
- legend: 'Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. ' +
- 'For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. ' +
- 'Then move to next tab with TAB OR RIGTH ARROW. ' +
- 'Move to previous tab with SHIFT + TAB or LEFT ARROW. ' +
- 'Press SPACE or ENTER to select the tab page.'
- },
-
- {
- name: 'Editor Context Menu',
- legend: 'Press ${contextMenu} or APPLICATION KEY to open context-menu. ' +
- 'Then move to next menu option with TAB or DOWN ARROW. ' +
- 'Move to previous option with SHIFT+TAB or UP ARROW. ' +
- 'Press SPACE or ENTER to select the menu option. ' +
- 'Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. ' +
- 'Go back to parent menu item with ESC or LEFT ARROW. ' +
- 'Close context menu with ESC.'
- },
-
- {
- name: 'Editor List Box',
- legend: 'Inside a list-box, move to next list item with TAB OR DOWN ARROW. ' +
- 'Move to previous list item with SHIFT + TAB or UP ARROW. ' +
- 'Press SPACE or ENTER to select the list option. ' +
- 'Press ESC to close the list-box.'
- },
-
- {
- name: 'Editor Element Path Bar',
- legend: 'Press ${elementsPathFocus} to navigate to the elements path bar. ' +
- 'Move to next element button with TAB or RIGHT ARROW. ' +
- 'Move to previous button with SHIFT+TAB or LEFT ARROW. ' +
- 'Press SPACE or ENTER to select the element in editor.'
- }
- ]
- },
- {
- name: 'Commands',
- items: [
- {
- name: ' Undo command',
- legend: 'Press ${undo}'
- },
- {
- name: ' Redo command',
- legend: 'Press ${redo}'
- },
- {
- name: ' Bold command',
- legend: 'Press ${bold}'
- },
- {
- name: ' Italic command',
- legend: 'Press ${italic}'
- },
- {
- name: ' Underline command',
- legend: 'Press ${underline}'
- },
- {
- name: ' Link command',
- legend: 'Press ${link}'
- },
- {
- name: ' Toolbar Collapse command',
- legend: 'Press ${toolbarCollapse}'
- },
- {
- name: ' Access previous focus space command',
- legend: 'Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, ' +
- 'for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.'
- },
- {
- name: ' Access next focus space command',
- legend: 'Press ${accessNextSpace} to access the closest unreachable focus space after the caret, ' +
- 'for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.'
- },
- {
- name: ' Accessibility Help',
- legend: 'Press ${a11yHelp}'
- }
- ]
- }
- ]
-});
diff --git a/addons/website/static/lib/ckeditor/plugins/a11yhelp/plugin.js b/addons/website/static/lib/ckeditor/plugins/a11yhelp/plugin.js
deleted file mode 100644
index 556c9672bcc..00000000000
--- a/addons/website/static/lib/ckeditor/plugins/a11yhelp/plugin.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or http://ckeditor.com/license
- */
-
-/**
- * @fileOverview Plugin definition for the a11yhelp, which provides a dialog
- * with accessibility related help.
- */
-
-(function() {
- var pluginName = 'a11yhelp',
- commandName = 'a11yHelp';
-
- CKEDITOR.plugins.add( pluginName, {
- requires: 'dialog',
-
- // List of available localizations.
- availableLangs: { ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,'fr-ca':1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,'pt-br':1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,'sr-latn':1,sv:1,th:1,tr:1,ug:1,uk:1,vi:1,'zh-cn':1 },
-
- init: function( editor ) {
- var plugin = this;
- editor.addCommand( commandName, {
- exec: function() {
- var langCode = editor.langCode;
- langCode =
- plugin.availableLangs[ langCode ] ? langCode :
- plugin.availableLangs[ langCode.replace( /-.*/, '' ) ] ? langCode.replace( /-.*/, '' ) :
- 'en';
-
- CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( plugin.path + 'dialogs/lang/' + langCode + '.js' ), function() {
- editor.lang.a11yhelp = plugin.langEntries[ langCode ];
- editor.openDialog( commandName );
- });
- },
- modes: { wysiwyg:1,source:1 },
- readOnly: 1,
- canUndo: false
- });
-
- editor.setKeystroke( CKEDITOR.ALT + 48 /*0*/, 'a11yHelp' );
- CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );
- }
- });
-})();