CKEditor.
The error came from some script in Application.js
This commit is contained in:
1 parent
964440fa86
commit
0969f6b6cc
660 files changed
+119303
-30
No files matched your search
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
CKEDITOR.dialog.add( 'specialchar', function( editor )
|
||||
{
|
||||
/**
|
||||
* Simulate "this" of a dialog for non-dialog events.
|
||||
* @type {CKEDITOR.dialog}
|
||||
*/
|
||||
var dialog,
|
||||
lang = editor.lang.specialChar;
|
||||
|
||||
var onChoice = function( evt )
|
||||
{
|
||||
var target, value;
|
||||
if ( evt.data )
|
||||
target = evt.data.getTarget();
|
||||
else
|
||||
target = new CKEDITOR.dom.element( evt );
|
||||
|
||||
if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) )
|
||||
{
|
||||
target.removeClass( "cke_light_background" );
|
||||
dialog.hide();
|
||||
|
||||
// We must use "insertText" here to keep text styled.
|
||||
var span = editor.document.createElement( 'span' );
|
||||
span.setHtml( value );
|
||||
editor.insertText( span.getText() );
|
||||
}
|
||||
};
|
||||
|
||||
var onClick = CKEDITOR.tools.addFunction( onChoice );
|
||||
|
||||
var focusedNode;
|
||||
|
||||
var onFocus = function( evt, target )
|
||||
{
|
||||
var value;
|
||||
target = target || evt.data.getTarget();
|
||||
|
||||
if ( target.getName() == 'span' )
|
||||
target = target.getParent();
|
||||
|
||||
if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) )
|
||||
{
|
||||
// Trigger blur manually if there is focused node.
|
||||
if ( focusedNode )
|
||||
onBlur( null, focusedNode );
|
||||
|
||||
var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
|
||||
|
||||
dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value );
|
||||
htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
|
||||
target.getParent().addClass( "cke_light_background" );
|
||||
|
||||
// Memorize focused node.
|
||||
focusedNode = target;
|
||||
}
|
||||
};
|
||||
|
||||
var onBlur = function( evt, target )
|
||||
{
|
||||
target = target || evt.data.getTarget();
|
||||
|
||||
if ( target.getName() == 'span' )
|
||||
target = target.getParent();
|
||||
|
||||
if ( target.getName() == 'a' )
|
||||
{
|
||||
dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( ' ' );
|
||||
dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( ' ' );
|
||||
target.getParent().removeClass( "cke_light_background" );
|
||||
|
||||
focusedNode = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
var onKeydown = CKEDITOR.tools.addFunction( function( ev )
|
||||
{
|
||||
ev = new CKEDITOR.dom.event( ev );
|
||||
|
||||
// Get an Anchor element.
|
||||
var element = ev.getTarget();
|
||||
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();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
}
|
||||
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.type == 1 )
|
||||
{
|
||||
nodeToMove.focus();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
}
|
||||
}
|
||||
ev.preventDefault();
|
||||
break;
|
||||
// SPACE
|
||||
// ENTER is already handled as onClick
|
||||
case 32 :
|
||||
onChoice( { data: ev } );
|
||||
ev.preventDefault();
|
||||
break;
|
||||
|
||||
// RIGHT-ARROW
|
||||
case rtl ? 37 : 39 :
|
||||
// TAB
|
||||
case 9 :
|
||||
// relative is TD
|
||||
if ( ( relative = element.getParent().getNext() ) )
|
||||
{
|
||||
nodeToMove = relative.getChild( 0 );
|
||||
if ( nodeToMove.type == 1 )
|
||||
{
|
||||
nodeToMove.focus();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
ev.preventDefault( true );
|
||||
}
|
||||
else
|
||||
onBlur( null, element );
|
||||
}
|
||||
// relative is TR
|
||||
else if ( ( relative = element.getParent().getParent().getNext() ) )
|
||||
{
|
||||
nodeToMove = relative.getChild( [ 0, 0 ] );
|
||||
if ( nodeToMove && nodeToMove.type == 1 )
|
||||
{
|
||||
nodeToMove.focus();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
ev.preventDefault( true );
|
||||
}
|
||||
else
|
||||
onBlur( null, element );
|
||||
}
|
||||
break;
|
||||
|
||||
// LEFT-ARROW
|
||||
case rtl ? 39 : 37 :
|
||||
// SHIFT + TAB
|
||||
case CKEDITOR.SHIFT + 9 :
|
||||
// relative is TD
|
||||
if ( ( relative = element.getParent().getPrevious() ) )
|
||||
{
|
||||
nodeToMove = relative.getChild( 0 );
|
||||
nodeToMove.focus();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
ev.preventDefault( true );
|
||||
}
|
||||
// relative is TR
|
||||
else if ( ( relative = element.getParent().getParent().getPrevious() ) )
|
||||
{
|
||||
nodeToMove = relative.getLast().getChild( 0 );
|
||||
nodeToMove.focus();
|
||||
onBlur( null, element );
|
||||
onFocus( null, nodeToMove );
|
||||
ev.preventDefault( true );
|
||||
}
|
||||
else
|
||||
onBlur( null, element );
|
||||
break;
|
||||
default :
|
||||
// Do not stop not handled events.
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
title : lang.title,
|
||||
minWidth : 430,
|
||||
minHeight : 280,
|
||||
buttons : [ CKEDITOR.dialog.cancelButton ],
|
||||
charColumns : 17,
|
||||
onLoad : function()
|
||||
{
|
||||
var columns = this.definition.charColumns,
|
||||
extraChars = editor.config.extraSpecialChars,
|
||||
chars = editor.config.specialChars;
|
||||
|
||||
var charsTableLabel = CKEDITOR.tools.getNextId() + '_specialchar_table_label';
|
||||
var html = [ '<table role="listbox" aria-labelledby="' + charsTableLabel + '"' +
|
||||
' style="width: 320px; height: 100%; border-collapse: separate;"' +
|
||||
' align="center" cellspacing="2" cellpadding="2" border="0">' ];
|
||||
|
||||
var i = 0,
|
||||
size = chars.length,
|
||||
character,
|
||||
charDesc;
|
||||
|
||||
while ( i < size )
|
||||
{
|
||||
html.push( '<tr>' ) ;
|
||||
|
||||
for ( var j = 0 ; j < columns ; j++, i++ )
|
||||
{
|
||||
if ( ( character = chars[ i ] ) )
|
||||
{
|
||||
charDesc = '';
|
||||
|
||||
if ( character instanceof Array )
|
||||
{
|
||||
charDesc = character[ 1 ];
|
||||
character = character[ 0 ];
|
||||
}
|
||||
else
|
||||
{
|
||||
var _tmpName = character.toLowerCase().replace( '&', '' ).replace( ';', '' ).replace( '#', '' );
|
||||
|
||||
// Use character in case description unavailable.
|
||||
charDesc = lang[ _tmpName ] || character;
|
||||
}
|
||||
|
||||
var charLabelId = 'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber();
|
||||
|
||||
html.push(
|
||||
'<td class="cke_dark_background" style="cursor: default" role="presentation">' +
|
||||
'<a href="javascript: void(0);" role="option"' +
|
||||
' aria-posinset="' + ( i +1 ) + '"',
|
||||
' aria-setsize="' + size + '"',
|
||||
' aria-labelledby="' + charLabelId + '"',
|
||||
' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="', CKEDITOR.tools.htmlEncode( charDesc ), '"' +
|
||||
' onkeydown="CKEDITOR.tools.callFunction( ' + onKeydown + ', event, this )"' +
|
||||
' onclick="CKEDITOR.tools.callFunction(' + onClick + ', this); return false;"' +
|
||||
' tabindex="-1">' +
|
||||
'<span style="margin: 0 auto;cursor: inherit">' +
|
||||
character +
|
||||
'</span>' +
|
||||
'<span class="cke_voice_label" id="' + charLabelId + '">' +
|
||||
charDesc +
|
||||
'</span></a>');
|
||||
}
|
||||
else
|
||||
html.push( '<td class="cke_dark_background"> ' );
|
||||
|
||||
html.push( '</td>' );
|
||||
}
|
||||
html.push( '</tr>' );
|
||||
}
|
||||
|
||||
html.push( '</tbody></table>', '<span id="' + charsTableLabel + '" class="cke_voice_label">' + lang.options +'</span>' );
|
||||
|
||||
this.getContentElement( 'info', 'charContainer' ).getElement().setHtml( html.join( '' ) );
|
||||
},
|
||||
contents : [
|
||||
{
|
||||
id : 'info',
|
||||
label : editor.lang.common.generalTab,
|
||||
title : editor.lang.common.generalTab,
|
||||
padding : 0,
|
||||
align : 'top',
|
||||
elements : [
|
||||
{
|
||||
type : 'hbox',
|
||||
align : 'top',
|
||||
widths : [ '320px', '90px' ],
|
||||
children :
|
||||
[
|
||||
{
|
||||
type : 'html',
|
||||
id : 'charContainer',
|
||||
html : '',
|
||||
onMouseover : onFocus,
|
||||
onMouseout : onBlur,
|
||||
focus : function()
|
||||
{
|
||||
var firstChar = this.getElement().getElementsByTag( 'a' ).getItem( 0 );
|
||||
setTimeout( function()
|
||||
{
|
||||
firstChar.focus();
|
||||
onFocus( null, firstChar );
|
||||
}, 0 );
|
||||
},
|
||||
onShow : function()
|
||||
{
|
||||
var firstChar = this.getElement().getChild( [ 0, 0, 0, 0, 0 ] );
|
||||
setTimeout( function()
|
||||
{
|
||||
firstChar.focus();
|
||||
onFocus( null, firstChar );
|
||||
}, 0 );
|
||||
},
|
||||
onLoad : function( event )
|
||||
{
|
||||
dialog = event.sender;
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'hbox',
|
||||
align : 'top',
|
||||
widths : [ '100%' ],
|
||||
children :
|
||||
[
|
||||
{
|
||||
type : 'vbox',
|
||||
align : 'top',
|
||||
children :
|
||||
[
|
||||
{
|
||||
type : 'html',
|
||||
html : '<div></div>'
|
||||
},
|
||||
{
|
||||
type : 'html',
|
||||
id : 'charPreview',
|
||||
className : 'cke_dark_background',
|
||||
style : 'border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
|
||||
html : '<div> </div>'
|
||||
},
|
||||
{
|
||||
type : 'html',
|
||||
id : 'htmlPreview',
|
||||
className : 'cke_dark_background',
|
||||
style : 'border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
|
||||
html : '<div> </div>'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
} );
|
||||
@@ -0,0 +1,89 @@
|
||||
|
||||
CKEDITOR.plugins.setLang( 'specialchar', 'en',
|
||||
{
|
||||
euro: "Euro sign",
|
||||
lsquo: "Left single quotation mark",
|
||||
rsquo: "Right single quotation mark",
|
||||
ldquo: "Left double quotation mark",
|
||||
rdquo: "Right double quotation mark",
|
||||
ndash: "En dash",
|
||||
mdash: "Em dash",
|
||||
iexcl: "Inverted exclamation mark",
|
||||
cent: "Cent sign",
|
||||
pound: "Pound sign",
|
||||
curren: "Currency sign",
|
||||
yen: "Yen sign",
|
||||
brvbar: "Broken bar",
|
||||
sect: "Section sign",
|
||||
uml: "Diaeresis",
|
||||
copy: "Copyright sign",
|
||||
ordf: "Feminine ordinal indicator",
|
||||
laquo: "Left-pointing double angle quotation mark",
|
||||
not: "Not sign",
|
||||
reg: "Registered sign",
|
||||
macr: "Macron",
|
||||
deg: "Degree sign",
|
||||
sup2: "Superscript two",
|
||||
sup3: "Superscript three",
|
||||
acute: "Acute accent",
|
||||
micro: "Micro sign",
|
||||
para: "Pilcrow sign",
|
||||
middot: "Middle dot",
|
||||
cedil: "Cedilla",
|
||||
sup1: "Superscript one",
|
||||
ordm: "Masculine ordinal indicator",
|
||||
frac14: "Vulgar fraction one quarter",
|
||||
frac12: "Vulgar fraction one half",
|
||||
frac34: "Vulgar fraction three quarters",
|
||||
iquest: "Inverted question mark",
|
||||
agrave: "Latin small letter a with grave",
|
||||
aacute: "Latin small letter a with acute",
|
||||
acirc: "Latin small letter a with circumflex",
|
||||
atilde: "Latin small letter a with tilde",
|
||||
auml: "Latin small letter a with diaeresis",
|
||||
aring: "Latin small letter a with ring above",
|
||||
aelig: "Latin small letter ae",
|
||||
ccedil: "Latin small letter c with cedilla",
|
||||
egrave: "Latin small letter e with grave",
|
||||
eacute: "Latin small letter e with acute",
|
||||
ecirc: "Latin small letter e with circumflex",
|
||||
euml: "Latin small letter e with diaeresis",
|
||||
igrave: "Latin small letter i with grave",
|
||||
iacute: "Latin small letter i with acute",
|
||||
icirc: "Latin small letter i with circumflex",
|
||||
iuml: "Latin small letter i with diaeresis",
|
||||
eth: "Latin small letter eth",
|
||||
ntilde: "Latin small letter n with tilde",
|
||||
ograve: "Latin small letter o with grave",
|
||||
oacute: "Latin small letter o with acute",
|
||||
ocirc: "Latin small letter o with circumflex",
|
||||
otilde: "Latin small letter o with tilde",
|
||||
ouml: "Latin small letter o with diaeresis",
|
||||
times: "Multiplication sign",
|
||||
oslash: "Latin small letter o with stroke",
|
||||
ugrave: "Latin small letter u with grave",
|
||||
uacute: "Latin small letter u with acute",
|
||||
ucirc: "Latin small letter u with circumflex",
|
||||
uuml: "Latin small letter u with diaeresis",
|
||||
yacute: "Latin small letter y with acute",
|
||||
thorn: "Latin small letter thorn",
|
||||
szlig: "Latin small letter sharp s",
|
||||
divide: "Division sign",
|
||||
yuml: "Latin small letter y with diaeresis",
|
||||
oelig: "Latin small ligature oe",
|
||||
'372': "Latin capital letter w with circumflex",
|
||||
'374': "Latin capital letter y with circumflex",
|
||||
'373': "Latin small letter w with circumflex",
|
||||
'375': "Latin small letter y with circumflex",
|
||||
8219: "Single high-reversed-9 quotation mark",
|
||||
bdquo: "Double low-9 quotation mark",
|
||||
hellip: "Horizontal ellipsis",
|
||||
trade: "Trade mark sign",
|
||||
'9658': "Black right-pointing pointer",
|
||||
bull: "Bullet",
|
||||
rarr: "Rightwards double arrow",
|
||||
harr: "Left right double arrow",
|
||||
diams: "Black diamond suit",
|
||||
asymp: "Almost equal to",
|
||||
sbquo: "Single low-9 quotation mark"
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file Special Character plugin
|
||||
*/
|
||||
|
||||
CKEDITOR.plugins.add( 'specialchar',
|
||||
{
|
||||
// List of available localizations.
|
||||
availableLangs : { en:1 },
|
||||
|
||||
init : function( editor )
|
||||
{
|
||||
var pluginName = 'specialchar',
|
||||
plugin = this;
|
||||
|
||||
// Register the dialog.
|
||||
CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
|
||||
|
||||
editor.addCommand( pluginName,
|
||||
{
|
||||
exec : function()
|
||||
{
|
||||
var langCode = editor.langCode;
|
||||
langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
|
||||
|
||||
CKEDITOR.scriptLoader.load(
|
||||
CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
|
||||
function()
|
||||
{
|
||||
CKEDITOR.tools.extend( editor.lang.specialChar, plugin.langEntries[ langCode ] );
|
||||
editor.openDialog( pluginName );
|
||||
});
|
||||
},
|
||||
modes : { wysiwyg:1 },
|
||||
canUndo : false
|
||||
});
|
||||
|
||||
// Register the toolbar button.
|
||||
editor.ui.addButton( 'SpecialChar',
|
||||
{
|
||||
label : editor.lang.specialChar.toolbar,
|
||||
command : pluginName
|
||||
});
|
||||
}
|
||||
} );
|
||||
|
||||
/**
|
||||
* The list of special characters visible in Special Character dialog.
|
||||
* @type Array
|
||||
* @example
|
||||
* config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ];
|
||||
* config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
|
||||
*/
|
||||
CKEDITOR.config.specialChars =
|
||||
[
|
||||
'!','"','#','$','%','&',"'",'(',')','*','+','-','.','/',
|
||||
'0','1','2','3','4','5','6','7','8','9',':',';',
|
||||
'<','=','>','?','@',
|
||||
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
|
||||
'P','Q','R','S','T','U','V','W','X','Y','Z',
|
||||
'[',']','^','_','`',
|
||||
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
|
||||
'q','r','s','t','u','v','w','x','y','z',
|
||||
'{','|','}','~',
|
||||
"€", "‘", "’", "“", "”", "–", "—", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "®", "¯", "°", "&", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "&", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ü", "ý", "þ", "ÿ", "Œ", "œ", "Ŵ", "Ŷ", "ŵ", "ŷ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈"
|
||||
];
|
||||
Reference in new issue
Block a user