diff options
| author | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
|---|---|---|
| committer | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
| commit | 18d8368ee11eef0a74bacdb8f293414331bfa8da (patch) | |
| tree | fc21df70cbd2901396c2bcf2fee0b52d750abd43 /addons/website/static/lib/ckeditor/plugins/smiley | |
| parent | 5900672160c2bd5ae1d9257f20dbb5c51a193996 (diff) | |
| parent | 123185757f51ee7e146d7295864556999d2a6938 (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/smiley')
| -rw-r--r-- | addons/website/static/lib/ckeditor/plugins/smiley/dialogs/smiley.js | 192 | ||||
| -rw-r--r-- | addons/website/static/lib/ckeditor/plugins/smiley/icons/hidpi/smiley.png | bin | 3073 -> 0 bytes | |||
| -rw-r--r-- | addons/website/static/lib/ckeditor/plugins/smiley/icons/smiley.png | bin | 916 -> 0 bytes | |||
| -rw-r--r-- | addons/website/static/lib/ckeditor/plugins/smiley/lang/en.js | 9 | ||||
| -rw-r--r-- | addons/website/static/lib/ckeditor/plugins/smiley/plugin.js | 95 |
5 files changed, 0 insertions, 296 deletions
diff --git a/addons/website/static/lib/ckeditor/plugins/smiley/dialogs/smiley.js b/addons/website/static/lib/ckeditor/plugins/smiley/dialogs/smiley.js deleted file mode 100644 index 2a0b05ab927..00000000000 --- a/addons/website/static/lib/ckeditor/plugins/smiley/dialogs/smiley.js +++ /dev/null @@ -1,192 +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( 'smiley', function( editor ) { - var config = editor.config, - lang = editor.lang.smiley, - images = config.smiley_images, - columns = config.smiley_columns || 8, - i; - - // Simulate "this" of a dialog for non-dialog events. - // @type {CKEDITOR.dialog} - var dialog; - var onClick = function( evt ) { - var target = evt.data.getTarget(), - targetName = target.getName(); - - if ( targetName == 'a' ) - target = target.getChild( 0 ); - else if ( targetName != 'img' ) - return; - - var src = target.getAttribute( 'cke_src' ), - title = target.getAttribute( 'title' ); - - var img = editor.document.createElement( 'img', { - attributes: { - src: src, - 'data-cke-saved-src': src, - title: title, - alt: title, - width: target.$.width, - height: target.$.height - } - }); - - editor.insertElement( img ); - - dialog.hide(); - evt.data.preventDefault(); - }; - - var onKeydown = CKEDITOR.tools.addFunction( function( ev, element ) { - ev = new CKEDITOR.dom.event( ev ); - element = new CKEDITOR.dom.element( element ); - var relative, nodeToMove; - - var keystroke = ev.getKeystroke(), - rtl = editor.lang.dir == 'rtl'; - switch ( keystroke ) { - // UP-ARROW - case 38: - // relative is TR - if ( ( relative = element.getParent().getParent().getPrevious() ) ) { - nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] ); - nodeToMove.focus(); - } - ev.preventDefault(); - break; - // DOWN-ARROW - case 40: - // relative is TR - if ( ( relative = element.getParent().getParent().getNext() ) ) { - nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] ); - if ( nodeToMove ) - nodeToMove.focus(); - } - ev.preventDefault(); - break; - // ENTER - // SPACE - case 32: - onClick({ data: ev } ); - ev.preventDefault(); - break; - - // RIGHT-ARROW - case rtl ? 37: - 39 : - // relative is TD - if ( ( relative = element.getParent().getNext() ) ) { - nodeToMove = relative.getChild( 0 ); - nodeToMove.focus(); - ev.preventDefault( true ); - } - // relative is TR - else if ( ( relative = element.getParent().getParent().getNext() ) ) { - nodeToMove = relative.getChild( [ 0, 0 ] ); - if ( nodeToMove ) - nodeToMove.focus(); - ev.preventDefault( true ); - } - break; - - // LEFT-ARROW - case rtl ? 39: - 37 : - // relative is TD - if ( ( relative = element.getParent().getPrevious() ) ) { - nodeToMove = relative.getChild( 0 ); - nodeToMove.focus(); - ev.preventDefault( true ); - } - // relative is TR - else if ( ( relative = element.getParent().getParent().getPrevious() ) ) { - nodeToMove = relative.getLast().getChild( 0 ); - nodeToMove.focus(); - ev.preventDefault( true ); - } - break; - default: - // Do not stop not handled events. - return; - } - }); - - // Build the HTML for the smiley images table. - var labelId = CKEDITOR.tools.getNextId() + '_smiley_emtions_label'; - var html = [ - '<div>' + - '<span id="' + labelId + '" class="cke_voice_label">' + lang.options + '</span>', - '<table role="listbox" aria-labelledby="' + labelId + '" style="width:100%;height:100%;border-collapse:separate;" cellspacing="2" cellpadding="2"', - CKEDITOR.env.ie && CKEDITOR.env.quirks ? ' style="position:absolute;"' : '', - '><tbody>' - ]; - - var size = images.length; - for ( i = 0; i < size; i++ ) { - if ( i % columns === 0 ) - html.push( '<tr role="presentation">' ); - - var smileyLabelId = 'cke_smile_label_' + i + '_' + CKEDITOR.tools.getNextNumber(); - html.push( '<td class="cke_dark_background cke_centered" style="vertical-align: middle;" role="presentation">' + - '<a href="javascript:void(0)" role="option"', ' aria-posinset="' + ( i + 1 ) + '"', ' aria-setsize="' + size + '"', ' aria-labelledby="' + smileyLabelId + '"', ' class="cke_smile cke_hand" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ', onKeydown, ', event, this );">', '<img class="cke_hand" title="', config.smiley_descriptions[ i ], '"' + - ' cke_src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '" alt="', config.smiley_descriptions[ i ], '"', ' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"', - // IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct. - ( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ), '>' + - '<span id="' + smileyLabelId + '" class="cke_voice_label">' + config.smiley_descriptions[ i ] + '</span>' + - '</a>', '</td>' ); - - if ( i % columns == columns - 1 ) - html.push( '</tr>' ); - } - - if ( i < columns - 1 ) { - for ( ; i < columns - 1; i++ ) - html.push( '<td></td>' ); - html.push( '</tr>' ); - } - - html.push( '</tbody></table></div>' ); - - var smileySelector = { - type: 'html', - id: 'smileySelector', - html: html.join( '' ), - onLoad: function( event ) { - dialog = event.sender; - }, - focus: function() { - var self = this; - // IE need a while to move the focus (#6539). - setTimeout( function() { - var firstSmile = self.getElement().getElementsByTag( 'a' ).getItem( 0 ); - firstSmile.focus(); - }, 0 ); - }, - onClick: onClick, - style: 'width: 100%; border-collapse: separate;' - }; - - return { - title: editor.lang.smiley.title, - minWidth: 270, - minHeight: 120, - contents: [ - { - id: 'tab1', - label: '', - title: '', - expand: true, - padding: 0, - elements: [ - smileySelector - ] - } - ], - buttons: [ CKEDITOR.dialog.cancelButton ] - }; -}); diff --git a/addons/website/static/lib/ckeditor/plugins/smiley/icons/hidpi/smiley.png b/addons/website/static/lib/ckeditor/plugins/smiley/icons/hidpi/smiley.png Binary files differdeleted file mode 100644 index bad62eed468..00000000000 --- a/addons/website/static/lib/ckeditor/plugins/smiley/icons/hidpi/smiley.png +++ /dev/null diff --git a/addons/website/static/lib/ckeditor/plugins/smiley/icons/smiley.png b/addons/website/static/lib/ckeditor/plugins/smiley/icons/smiley.png Binary files differdeleted file mode 100644 index 9fafa28a81a..00000000000 --- a/addons/website/static/lib/ckeditor/plugins/smiley/icons/smiley.png +++ /dev/null diff --git a/addons/website/static/lib/ckeditor/plugins/smiley/lang/en.js b/addons/website/static/lib/ckeditor/plugins/smiley/lang/en.js deleted file mode 100644 index 1f4b6489c20..00000000000 --- a/addons/website/static/lib/ckeditor/plugins/smiley/lang/en.js +++ /dev/null @@ -1,9 +0,0 @@ -/* -Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.md or http://ckeditor.com/license -*/ -CKEDITOR.plugins.setLang( 'smiley', 'en', { - options: 'Smiley Options', - title: 'Insert a Smiley', - toolbar: 'Smiley' -}); diff --git a/addons/website/static/lib/ckeditor/plugins/smiley/plugin.js b/addons/website/static/lib/ckeditor/plugins/smiley/plugin.js deleted file mode 100644 index 198523c0b40..00000000000 --- a/addons/website/static/lib/ckeditor/plugins/smiley/plugin.js +++ /dev/null @@ -1,95 +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.add( 'smiley', { - requires: 'dialog', - lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% - icons: 'smiley', // %REMOVE_LINE_CORE% - hidpi: true, // %REMOVE_LINE_CORE% - init: function( editor ) { - editor.config.smiley_path = editor.config.smiley_path || ( this.path + 'images/' ); - editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley', { - allowedContent: 'img[alt,height,!src,title,width]', - requiredContent: 'img' - } ) ); - editor.ui.addButton && editor.ui.addButton( 'Smiley', { - label: editor.lang.smiley.toolbar, - command: 'smiley', - toolbar: 'insert,50' - }); - CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' ); - } -}); - -/** - * The base path used to build the URL for the smiley images. It must end with a slash. - * - * config.smiley_path = 'http://www.example.com/images/smileys/'; - * - * config.smiley_path = '/images/smileys/'; - * - * @cfg {String} [smiley_path=CKEDITOR.basePath + 'plugins/smiley/images/'] - * @member CKEDITOR.config - */ - -/** - * The file names for the smileys to be displayed. These files must be - * contained inside the URL path defined with the {@link #smiley_path} setting. - * - * // This is actually the default value. - * config.smiley_images = [ - * 'regular_smile.png','sad_smile.png','wink_smile.png','teeth_smile.png','confused_smile.png','tongue_smile.png', - * 'embarrassed_smile.png','omg_smile.png','whatchutalkingabout_smile.png','angry_smile.png','angel_smile.png','shades_smile.png', - * 'devil_smile.png','cry_smile.png','lightbulb.png','thumbs_down.png','thumbs_up.png','heart.png', - * 'broken_heart.png','kiss.png','envelope.png' - * ]; - * - * @cfg - * @member CKEDITOR.config - */ -CKEDITOR.config.smiley_images = [ - 'regular_smile.png', 'sad_smile.png', 'wink_smile.png', 'teeth_smile.png', 'confused_smile.png', 'tongue_smile.png', - 'embarrassed_smile.png', 'omg_smile.png', 'whatchutalkingabout_smile.png', 'angry_smile.png', 'angel_smile.png', 'shades_smile.png', - 'devil_smile.png', 'cry_smile.png', 'lightbulb.png', 'thumbs_down.png', 'thumbs_up.png', 'heart.png', - 'broken_heart.png', 'kiss.png', 'envelope.png' ]; - -/** - * The description to be used for each of the smileys defined in the - * {@link CKEDITOR.config#smiley_images} setting. Each entry in this array list - * must match its relative pair in the {@link CKEDITOR.config#smiley_images} - * setting. - * - * // Default settings. - * config.smiley_descriptions = [ - * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', - * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', - * 'yes', 'heart', 'broken heart', 'kiss', 'mail' - * ]; - * - * // Use textual emoticons as description. - * config.smiley_descriptions = [ - * ':)', ':(', ';)', ':D', ':/', ':P', ':*)', ':-o', - * ':|', '>:(', 'o:)', '8-)', '>:-)', ';(', '', '', '', - * '', '', ':-*', '' - * ]; - * - * @cfg - * @member CKEDITOR.config - */ -CKEDITOR.config.smiley_descriptions = [ - 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', - 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', - 'yes', 'heart', 'broken heart', 'kiss', 'mail' -]; - -/** - * The number of columns to be generated by the smilies matrix. - * - * config.smiley_columns = 6; - * - * @since 3.3.2 - * @cfg {Number} [smiley_columns=8] - * @member CKEDITOR.config - */ |
