diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/dev/mathjax.html b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dev/mathjax.html new file mode 100644 index 0000000000..2377f34f83 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dev/mathjax.html @@ -0,0 +1,121 @@ + + + + + + Widgets: MathJax — CKEditor Sample + + + + + + + + + + + + +

+ CKEditor Samples » Widgets: MathJax +

+ +

Classic (iframe-based) Sample

+ + + +

Inline Sample

+ +
+

Apollo 11

+ +
+

Apollo 11 was the spaceflight that landed the first humans, Americans Neil Armstrong and Buzz Aldrin \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\). Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.

+
+ +

Foo foo \(J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\) bar bar.

+ +

Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of NASA's Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .

+
+ +

Div Editing Area Sample

+ + + + + + + + diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.html b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.html new file mode 100644 index 0000000000..043ad1865a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.html @@ -0,0 +1,250 @@ + + + + + AsciiMath Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
Input      Preview
+ + + + + + +
+ + +
+
+ Based on ASCIIMathML by Peter Jipsen, +Chapman University
+ For more information on AsciiMathML visit this page: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
+
+ + diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.js new file mode 100644 index 0000000000..6b1b04b0b9 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/fck_asciimath.js @@ -0,0 +1,282 @@ +/* + * Chamilo LMS + * + * Copyright (c) 2009-2010 Ivan Tcholakov + * Copyright (c) 2009 Dokeos SPRL + * + * License: + * GNU Lesser General Public License, Version 3, 29 June 2007 + * by Free Software Foundation, Inc. (http://www.gnu.org/licenses/lgpl.html) + */ + +var dialog = window.parent ; +var oEditor = dialog.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKTools = oEditor.FCKTools ; +var FCKBrowserInfo = oEditor.FCKBrowserInfo ; +var FCKUndo = oEditor.FCKUndo ; +var FCKAsciiMath = oEditor.FCKAsciiMath ; + +// Set the language direction. +window.document.dir = FCKLang.Dir ; + +FCKLang["DlgAsciiIncompatibleBrowser"] = FCKLang["DlgAsciiIncompatibleBrowser"] ? FCKLang["DlgAsciiIncompatibleBrowser"] : 'Your browser is not able to show mathematical formulas. Please, use %s1 or Internet Explorer with %s2 plugin.' ; +FCKLang['DlgAsciiIncompatibleBrowser'] = FCKLang['DlgAsciiIncompatibleBrowser'].replace( '%s1', 'Mozilla Firefox 1.5+, Opera 9.5+' ) ; +FCKLang['DlgAsciiIncompatibleBrowser'] = FCKLang['DlgAsciiIncompatibleBrowser'].replace( '%s2', 'MathPlayer' ) ; + +FCKLang["DlgAsciiMathOldIE"] = FCKLang["DlgAsciiMathOldIE"] ? FCKLang["DlgAsciiMathOldIE"] : 'Your browser is not able to show mathematical formulas. You need to upgrade to Internet Explorer 6.0+. Then you need to install the MathPlayer 2 plugin for Internet Explorer. Please, see %s for more information.' ; +FCKLang['DlgAsciiMathOldIE'] = FCKLang['DlgAsciiMathOldIE'].replace( '%s', 'http://www.dessci.com/en/products/mathplayer/' ) ; + +FCKLang['DlgAsciiMathInstallMathPlayer'] = FCKLang['DlgAsciiMathInstallMathPlayer'] ? FCKLang['DlgAsciiMathInstallMathPlayer'] : 'Your browser is not able to show mathematical formulas. You need to install the MathPlayer 2 plugin for Internet Explorer. Please, see %s for more information.' ; +FCKLang['DlgAsciiMathInstallMathPlayer'] = FCKLang['DlgAsciiMathInstallMathPlayer'].replace( '%s', 'http://www.dessci.com/en/products/mathplayer/' ) ; + +FCKLang['DlgAsciiMathOldMathPlayer'] = FCKLang['DlgAsciiMathOldMathPlayer'] ? FCKLang['DlgAsciiMathOldMathPlayer'] : 'Your browser is not able to show mathematical formulas. You need to upgrade the MathPlayer plugin for Internet Explorer to version 2. Please, see %s for more information.' ; +FCKLang['DlgAsciiMathOldMathPlayer'] = FCKLang['DlgAsciiMathOldMathPlayer'].replace( '%s', 'http://www.dessci.com/en/products/mathplayer/' ) ; + +// Settings for ASCIIMathML.js +// Checking for native MathML support, it is always needed for this dialog. +var checkForMathML = true; +// Suppressing the built-in notification messages when the browser is incompatible. +var notifyIfNoMathML = false ; +var alertIfNoMathML = false ; +var notifyIfNoSVG = false ; +var alertIfNoSVG = false ; +// Formula translation will be called explicitly in this dialog after it loads. +var translateOnLoad = false ; +// Formula tooltips are hard-coded in this dialog, there is no need they to be generated. +var showasciiformulaonhover = false ; +// Font size of the formulas in this dialog. +var mathfontsize = "1.1em" ; + +// oSpanAM: The actual selected span element in the editor that contains the formula. +var oSpanAM = FCKAsciiMath.FindFormulaContainer( FCKAsciiMath.GetSearchElementFromSelection() ) ; +if ( oSpanAM ) +{ + FCK.Selection.SelectNode( oSpanAM ) ; +} + +function LoadSelection() +{ + GetE( 'inputText' ).value = FCKAsciiMath.GetFormula( oSpanAM ) ; + Preview() ; +} + +function Ok() +{ + if ( FCKBrowserInfo.IsIE ) + { + if ( oSpanAM ) + { + FCK.Selection.SelectNode( oSpanAM ) ; + // For IE: Before updating, we have to move the selection outside the formula + // in order to prevent "Unspecified error". + var span_target = FCK.EditorDocument.createElement( 'span' ) ; + span_target.innerHTML = ' ' ; + span_target = oSpanAM.parentNode.insertBefore( span_target, oSpanAM ) ; + FCK.Selection.SelectNode( span_target ) ; + } + } + + var formula = GetE( 'inputText' ).value ; + + if ( formula != '' ) + { + FCK.InsertHtml( '`' + formula + '`<\/span>' ) ; + } + else + { + FCK.Selection.Delete() ; + } + + if ( FCKBrowserInfo.IsIE ) + { + if ( oSpanAM ) + { + FCKUndo.SaveUndoStep() ; + oSpanAM.parentNode.removeChild( oSpanAM ) ; + } + } + + return true ; +} + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage( document ) ; + + // Initialization of the script ASCIIMathML.js. + init() ; + + // Load the selected element information (if any). + LoadSelection() ; + + dialog.SetAutoSize( true ) ; + + // When MathML is available show the button "Show MathML code". + if ( !noMathML ) { + GetE( 'show_mathml' ).style.display = '' ; + } + + // Activate the "OK" button. + dialog.SetOkButton( true ) ; + + var inputField = GetE( 'inputText' ) ; + inputField.focus() ; +} + +function Set( string ) +{ + var inputField = GetE( 'inputText' ) ; + inputField.value += string ; + Preview() ; + inputField.focus() ; + return false ; +} + +function Clear() +{ + var inputField = GetE( 'inputText' ) ; + inputField.value = '' ; + Preview() ; + inputField.focus() ; + return false ; +} + +function Delete() +{ + Clear(); + dialog.Ok(); +} + +function Preview() +{ + if ( GetE( 'inputText' ).value != '' ) + { + var str = GetE( 'inputText' ).value ; + var outnode = GetE( 'outputNode' ) ; + var newnode = createElementXHTML( 'div' ) ; + newnode.setAttribute( 'id', 'outputNode' ) ; + outnode.parentNode.replaceChild( newnode, outnode ) ; + outnode = GetE( 'outputNode' ) ; + var n = outnode.childNodes.length ; + for ( var i = 0; i < n; i++ ) + { + outnode.removeChild( outnode.firstChild ) ; + } + outnode.appendChild( document.createComment( '`' + str + '`' ) ) ; + AMprocessNode( outnode, true ) ; + if ( FCKLang['DlgAsciiMathShowMathML'] ) + { + GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathShowMathML'] ; + } + } + else + { + var outnode = GetE( 'outputNode' ) ; + var n = outnode.childNodes.length ; + for ( var i = 0; i < n; i++ ) + { + outnode.removeChild( outnode.firstChild ) ; + } + } +} + +function AMnode2string( inNode, indent ) +{ + // thanks to James Frazer for contributing an initial version of this function + var i, str = '' ; + if ( inNode.nodeType == 1 ) + { + var name = inNode.nodeName.toLowerCase() ; // (IE fix) + str = '\r' + indent + '<' + name ; + for ( i = 0; i < inNode.attributes.length; i++ ) + { + if ( inNode.attributes[i].nodeValue != 'italic' && + inNode.attributes[i].nodeValue != '' && //stop junk attributes + inNode.attributes[i].nodeValue != 'inherit' && // (mostly IE) + inNode.attributes[i].nodeValue != undefined && + inNode.attributes[i].nodeName[0] != '-' ) + { + str += ' ' + inNode.attributes[i].nodeName + '=' + '"' + inNode.attributes[i].nodeValue + '"' ; + } + } + if ( name == 'math' ) + { + str += ' xmlns="http://www.w3.org/1998/Math/MathML"' ; + } + str += '>' ; + for ( i = 0; i < inNode.childNodes.length; i++ ) + { + str += AMnode2string( inNode.childNodes[i], indent + ' ' ) ; + } + if ( name != 'mo' && name != 'mi' && name != 'mn' ) str += '\r' + indent ; + str += '' ; + } + else if( inNode.nodeType == 3 ) + { + var st = inNode.nodeValue ; + for ( i = 0; i < st.length; i++ ) + { + if ( st.charCodeAt( i ) < 32 || st.charCodeAt( i ) > 126 ) + { + str += '&#' + st.charCodeAt( i ) + ';' ; + } + else if ( st.charAt(i) == '<' && indent != ' ' ) str += '<' ; + else if ( st.charAt(i) == '>' && indent != ' ' ) str += '>' ; + else if ( st.charAt(i) == '&' && indent != ' ' ) str += '&' ; + else str += st.charAt( i ) ; + } + } + return str ; +} + +function ShowMathML() +{ + if ( GetE( 'inputText' ).value != '' ) + { + var math = GetE( 'outputNode' ).getElementsByTagName( 'math' )[0] ; + if ( math ) + { + var width ; + if ( GetE( 'outputNode' ).offsetWidth ) + { + width = GetE( 'outputNode' ).offsetWidth ; + } + + math.parentNode.innerHTML = '
' + FCKTools.HTMLEncode( AMnode2string( math, '' ) ) + '
' ; + + if ( width && FCKBrowserInfo.IsGecko ) + { + GetE( 'outputNode' ).style.width = width + 'px' ; + } + + if ( FCKLang['DlgAsciiMathFormulaPreview'] ) + { + GetE( 'show_mathml' ).value = FCKLang['DlgAsciiMathFormulaPreview'] ; + } + } + else + { + Preview() ; + } + } + else + { + Preview() ; + } +} + +// Highlighting formulas. + +function over(td) +{ + td.className = 'LightBackground Hand' ; +} + +function out(td) +{ + td.className = 'Hand' ; +} diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/mathjax.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/mathjax.js new file mode 100644 index 0000000000..90f07b83de --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/dialogs/mathjax.js @@ -0,0 +1,281 @@ +/** + * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +'use strict'; + +CKEDITOR.dialog.add( 'asciimath', function( editor ) { + + var preview, + lang = editor.lang.asciimath; + + var imagePath = CKEDITOR.basePath+'plugins/asciimath/images/'; + + return { + title: lang.title, + minWidth: 350, + minHeight: 100, + contents: [ + { + id: 'info', + elements: [ + { + id: 'equation', + type: 'textarea', + label: lang.dialogInput, + + onLoad: function( widget ) { + var that = this; + + if ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) { + this.getInputElement().on( 'keyup', function() { + // Add ` and ` for preview. + preview.setValue( '`' + that.getInputElement().getValue() + '`' ); + } ); + } + }, + + setup: function( widget ) { + // Remove ` and `. + this.setValue( CKEDITOR.plugins.asciimath.trim( widget.data.math ) ); + }, + + commit: function( widget ) { + // Add ` and ` to make ASCII be parsed by MathJax by default. + widget.setData( 'math', '`' + this.getValue() + '`' ); + } + }, + { + id: 'clickInput', + type: 'html', + html: + ''+ + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + }, + { + id: 'documentation', + type: 'html', + html: + '
' + + '' + + lang.docLabel + + '' + + '
' + }, + ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) && { + id: 'preview', + type: 'html', + html: + '
' + + '' + + '
', + + onLoad: function( widget ) { + var iFrame = CKEDITOR.document.getById( this.domId ).getChild( 0 ); + preview = new CKEDITOR.plugins.asciimath.frameWrapper( iFrame, editor ); + }, + + setup: function( widget ) { + preview.setValue( widget.data.math ); + } + } + ] + } + ] + }; +} ); + +// Highlighting formulas. + +function over(td) +{ + td.className = 'LightBackground Hand' ; +} + +function out(td) +{ + td.className = 'Hand' ; +} + +function Set( string ) +{ + var inputField = document.getElementsByTagName('textarea')[1]; + inputField.value += string ; + return false ; +} \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/asciimath.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/asciimath.png new file mode 100644 index 0000000000..d25081be99 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/asciimath.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/hidpi/asciimath.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/hidpi/asciimath.png new file mode 100644 index 0000000000..85b8e11df6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/icons/hidpi/asciimath.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/abcd.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/abcd.png new file mode 100644 index 0000000000..fb2d531d8d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/abcd.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/aleph.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/aleph.png new file mode 100644 index 0000000000..35f1b5c507 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/aleph.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/alpha.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/alpha.png new file mode 100644 index 0000000000..4e8044cb6a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/alpha.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/angle.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/angle.png new file mode 100644 index 0000000000..a8d5cb403b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/angle.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/approx.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/approx.png new file mode 100644 index 0000000000..aaffe26415 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/approx.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/backslash.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/backslash.png new file mode 100644 index 0000000000..a1117f8e14 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/backslash.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bara.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bara.png new file mode 100644 index 0000000000..b6ca058393 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bara.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bba.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bba.png new file mode 100644 index 0000000000..f856b216be Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bba.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bbba.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bbba.png new file mode 100644 index 0000000000..8bd3716260 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bbba.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/beta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/beta.png new file mode 100644 index 0000000000..e9e6a4c3f9 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/beta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcap.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcap.png new file mode 100644 index 0000000000..0d66391609 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcap.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcup.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcup.png new file mode 100644 index 0000000000..c24b07c8e5 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigcup.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigvee.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigvee.png new file mode 100644 index 0000000000..e307e21906 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigvee.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigwedge.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigwedge.png new file mode 100644 index 0000000000..af47c8269e Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bigwedge.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bot.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bot.png new file mode 100644 index 0000000000..b9a36a0b6d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/bot.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/braxcket.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/braxcket.png new file mode 100644 index 0000000000..43bcdd922b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/braxcket.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cap.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cap.png new file mode 100644 index 0000000000..ce032022b6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cap.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cc.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cc.png new file mode 100644 index 0000000000..221697aa4d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cc.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cca.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cca.png new file mode 100644 index 0000000000..2730afec7d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cca.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/chi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/chi.png new file mode 100644 index 0000000000..3bae522b19 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/chi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/circ.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/circ.png new file mode 100644 index 0000000000..d6000057bf Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/circ.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cong.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cong.png new file mode 100644 index 0000000000..7a5831c129 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cong.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cup.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cup.png new file mode 100644 index 0000000000..740a377492 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/cup.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/darr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/darr.png new file mode 100644 index 0000000000..28e905e087 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/darr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddelta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddelta.png new file mode 100644 index 0000000000..3e12832144 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddelta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddota.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddota.png new file mode 100644 index 0000000000..1dc2cb7f41 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ddota.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/delta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/delta.png new file mode 100644 index 0000000000..3a7e823c49 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/delta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/diamond.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/diamond.png new file mode 100644 index 0000000000..1b68aafde1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/diamond.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/div.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/div.png new file mode 100644 index 0000000000..0a97052c83 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/div.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dot.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dot.png new file mode 100644 index 0000000000..71b40b8dde Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dot.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dota.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dota.png new file mode 100644 index 0000000000..743dbfed9b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dota.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dydx.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dydx.png new file mode 100644 index 0000000000..a0048cfa41 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/dydx.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/emptyset.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/emptyset.png new file mode 100644 index 0000000000..da3eaeff72 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/emptyset.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/epsilon.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/epsilon.png new file mode 100644 index 0000000000..a7327d3f16 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/epsilon.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/equiv.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/equiv.png new file mode 100644 index 0000000000..93156f4083 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/equiv.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/eta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/eta.png new file mode 100644 index 0000000000..d518d6554f Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/eta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/exists.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/exists.png new file mode 100644 index 0000000000..0c32a36521 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/exists.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/forall.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/forall.png new file mode 100644 index 0000000000..f587549032 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/forall.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/fra.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/fra.png new file mode 100644 index 0000000000..484840c27e Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/fra.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/gamma.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/gamma.png new file mode 100644 index 0000000000..0f04f25497 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/gamma.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ge.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ge.png new file mode 100644 index 0000000000..efed372447 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ge.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ggamma.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ggamma.png new file mode 100644 index 0000000000..1df026deca Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ggamma.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/harr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/harr.png new file mode 100644 index 0000000000..25ce81ba1a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/harr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hata.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hata.png new file mode 100644 index 0000000000..d63b402c08 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hata.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hharr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hharr.png new file mode 100644 index 0000000000..9d2499876a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/hharr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/if.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/if.png new file mode 100644 index 0000000000..997fe95a29 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/if.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ifx.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ifx.png new file mode 100644 index 0000000000..2fed7803a6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ifx.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/in.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/in.png new file mode 100644 index 0000000000..e96c5e6302 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/in.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/index.html b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/index.html new file mode 100644 index 0000000000..8e464d8ce3 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/index.html @@ -0,0 +1,8 @@ + + + + + +
+ + \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/infty.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/infty.png new file mode 100644 index 0000000000..34a3f49591 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/infty.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/int.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/int.png new file mode 100644 index 0000000000..29e599c6dc Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/int.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/intab.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/intab.png new file mode 100644 index 0000000000..7af8dfe14a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/intab.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/iota.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/iota.png new file mode 100644 index 0000000000..48086c2445 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/iota.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/kappa.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/kappa.png new file mode 100644 index 0000000000..1d58a03995 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/kappa.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lambda.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lambda.png new file mode 100644 index 0000000000..862aad3831 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lambda.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/larr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/larr.png new file mode 100644 index 0000000000..30b93e039b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/larr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lceil.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lceil.png new file mode 100644 index 0000000000..7f589bb5db Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lceil.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/le.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/le.png new file mode 100644 index 0000000000..40d49e265a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/le.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/leftrightarrow.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/leftrightarrow.png new file mode 100644 index 0000000000..04193c1fe0 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/leftrightarrow.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lfloor.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lfloor.png new file mode 100644 index 0000000000..0510703ded Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lfloor.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lim.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lim.png new file mode 100644 index 0000000000..700248d9c1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/lim.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llambda.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llambda.png new file mode 100644 index 0000000000..01962a31f8 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llambda.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llarr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llarr.png new file mode 100644 index 0000000000..0e5c32bb3b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/llarr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/loader.gif b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/loader.gif new file mode 100644 index 0000000000..3ffb1811f7 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/loader.gif differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mapsto.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mapsto.png new file mode 100644 index 0000000000..78b6d6f4f3 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mapsto.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/models.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/models.png new file mode 100644 index 0000000000..bab64a5503 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/models.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mu.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mu.png new file mode 100644 index 0000000000..3f2ac4a8dd Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/mu.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nabla.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nabla.png new file mode 100644 index 0000000000..a61b85f209 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nabla.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ne.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ne.png new file mode 100644 index 0000000000..c95c1bd597 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ne.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nk.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nk.png new file mode 100644 index 0000000000..1e34f07139 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nk.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nn.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nn.png new file mode 100644 index 0000000000..6101f411b7 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nn.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/not.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/not.png new file mode 100644 index 0000000000..f4502c9bbf Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/not.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/notin.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/notin.png new file mode 100644 index 0000000000..99f9b829d6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/notin.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nu.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nu.png new file mode 100644 index 0000000000..466a40b988 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/nu.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/odot.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/odot.png new file mode 100644 index 0000000000..cb27cbe7f8 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/odot.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oint.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oint.png new file mode 100644 index 0000000000..021c814c91 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oint.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/omega.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/omega.png new file mode 100644 index 0000000000..dc9bc9e95b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/omega.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oomega.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oomega.png new file mode 100644 index 0000000000..bab460e765 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oomega.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oplus.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oplus.png new file mode 100644 index 0000000000..79619a53a1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/oplus.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/otimes.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/otimes.png new file mode 100644 index 0000000000..b135945050 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/otimes.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/partial.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/partial.png new file mode 100644 index 0000000000..c0e755be41 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/partial.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/phi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/phi.png new file mode 100644 index 0000000000..113460c663 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/phi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pi.png new file mode 100644 index 0000000000..58a9d3b316 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pm.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pm.png new file mode 100644 index 0000000000..d9083155aa Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pm.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pphi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pphi.png new file mode 100644 index 0000000000..1fb2970ce8 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/pphi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppi.png new file mode 100644 index 0000000000..96a54aea12 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppsi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppsi.png new file mode 100644 index 0000000000..0b53812507 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ppsi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prec.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prec.png new file mode 100644 index 0000000000..40c2a63d59 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prec.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prod.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prod.png new file mode 100644 index 0000000000..4a6bf25e69 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/prod.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/propto.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/propto.png new file mode 100644 index 0000000000..afdd2ee13d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/propto.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/psi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/psi.png new file mode 100644 index 0000000000..1270b438ea Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/psi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/qq.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/qq.png new file mode 100644 index 0000000000..e0af64cbe0 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/qq.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/quad.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/quad.png new file mode 100644 index 0000000000..88008c38f0 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/quad.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rarr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rarr.png new file mode 100644 index 0000000000..7bb5d862ce Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rarr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rceil.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rceil.png new file mode 100644 index 0000000000..0a988fe3bc Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rceil.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rfloor.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rfloor.png new file mode 100644 index 0000000000..cab03881b9 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rfloor.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rho.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rho.png new file mode 100644 index 0000000000..28a925f1f8 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rho.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rightarrow.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rightarrow.png new file mode 100644 index 0000000000..cfa85537e5 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rightarrow.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rootnx.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rootnx.png new file mode 100644 index 0000000000..f504d93912 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rootnx.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rr.png new file mode 100644 index 0000000000..5655df9585 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rrarr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rrarr.png new file mode 100644 index 0000000000..04970390b2 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/rrarr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sfa.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sfa.png new file mode 100644 index 0000000000..49747970d9 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sfa.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sigma.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sigma.png new file mode 100644 index 0000000000..dcb613929b Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sigma.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/slash.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/slash.png new file mode 100644 index 0000000000..5a1b29a760 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/slash.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/space.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/space.png new file mode 100644 index 0000000000..529f30cc86 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/space.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sqrtx.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sqrtx.png new file mode 100644 index 0000000000..e1fafc38a1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sqrtx.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/square.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/square.png new file mode 100644 index 0000000000..efd2d43a62 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/square.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ssigma.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ssigma.png new file mode 100644 index 0000000000..0922c4bbc6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ssigma.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/stackrel.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/stackrel.png new file mode 100644 index 0000000000..b61d32ff83 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/stackrel.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/star.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/star.png new file mode 100644 index 0000000000..5e5b8c9c2a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/star.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subset.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subset.png new file mode 100644 index 0000000000..d2a04ba216 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subset.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subseteq.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subseteq.png new file mode 100644 index 0000000000..e0c529feb5 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/subseteq.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/succ.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/succ.png new file mode 100644 index 0000000000..4d8a22bb15 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/succ.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sum.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sum.png new file mode 100644 index 0000000000..0ab6438543 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sum.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sumn.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sumn.png new file mode 100644 index 0000000000..7c9e77d041 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/sumn.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supset.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supset.png new file mode 100644 index 0000000000..7b28ef8a23 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supset.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supseteq.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supseteq.png new file mode 100644 index 0000000000..8e40f4d799 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/supseteq.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tau.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tau.png new file mode 100644 index 0000000000..dfda902ff9 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tau.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text.png new file mode 100644 index 0000000000..35477620bb Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_and.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_and.png new file mode 100644 index 0000000000..6db19c5171 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_and.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_or.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_or.png new file mode 100644 index 0000000000..63132b55c9 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/text_or.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/therefore.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/therefore.png new file mode 100644 index 0000000000..64f80c1c4e Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/therefore.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/theta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/theta.png new file mode 100644 index 0000000000..0c9c4ede78 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/theta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/times.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/times.png new file mode 100644 index 0000000000..931cb24e24 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/times.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/top.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/top.png new file mode 100644 index 0000000000..875a85ae52 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/top.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tta.png new file mode 100644 index 0000000000..5c6d652243 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/tta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ttheta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ttheta.png new file mode 100644 index 0000000000..32af7b8f16 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ttheta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/uarr.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/uarr.png new file mode 100644 index 0000000000..265bc27209 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/uarr.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ula.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ula.png new file mode 100644 index 0000000000..221b1f9893 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/ula.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/upsilon.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/upsilon.png new file mode 100644 index 0000000000..d0ef699d13 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/upsilon.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vdash.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vdash.png new file mode 100644 index 0000000000..36134708c3 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vdash.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/veca.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/veca.png new file mode 100644 index 0000000000..6b8c4cbb92 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/veca.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vee.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vee.png new file mode 100644 index 0000000000..dcea8cb262 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/vee.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/wedge.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/wedge.png new file mode 100644 index 0000000000..0b84484c14 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/wedge.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x1x1.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x1x1.png new file mode 100644 index 0000000000..747c8d5d22 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x1x1.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x_mn.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x_mn.png new file mode 100644 index 0000000000..d4af0895c7 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/x_mn.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xi.png new file mode 100644 index 0000000000..de34fe9cbd Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xmn.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xmn.png new file mode 100644 index 0000000000..9bad4316a5 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xmn.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xxi.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xxi.png new file mode 100644 index 0000000000..7b9b0ad5ef Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/xxi.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zeta.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zeta.png new file mode 100644 index 0000000000..0486e39375 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zeta.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zz.png b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zz.png new file mode 100644 index 0000000000..0e32c894c1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciimath/images/zz.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ar.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ar.js new file mode 100644 index 0000000000..dab9b987f4 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ar.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'ar', { + title: 'Mathematics in ASCII', // MISSING + button: 'Math', // MISSING + dialogInput: 'Write your ASCII here', // MISSING + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII documentation', // MISSING + loading: 'تحميل', + pathName: 'math' // MISSING +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ca.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ca.js new file mode 100644 index 0000000000..991bf53dd5 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ca.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'ca', { + title: 'Matemàtiques a ASCII', + button: 'Matemàtiques', + dialogInput: 'Escriu el ASCII aquí', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Documentació ASCII', + loading: 'carregant...', + pathName: 'matemàtiques' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cs.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cs.js new file mode 100644 index 0000000000..0a88e1969a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cs.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'cs', { + title: 'Matematika v ASCIIu', + button: 'Matematika', + dialogInput: 'Zde napište ASCIIový kód', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Dokumentace k ASCIIu', + loading: 'Nahrává se...', + pathName: 'Matematika' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cy.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cy.js new file mode 100644 index 0000000000..f04ccf901f --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/cy.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'cy', { + title: 'Mathemateg mewn ASCII', + button: 'Math', + dialogInput: 'Ysgrifennwch eich ASCII yma', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Dogfennaeth ASCII', + loading: 'llwytho...', + pathName: 'math' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/de.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/de.js new file mode 100644 index 0000000000..eaedb4dbef --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/de.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'de', { + title: 'Mathematik in ASCII', + button: 'Rechnung', + dialogInput: 'Schreiben Sie hier in ASCII', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII Dokumentation', + loading: 'lädt...', + pathName: 'rechnen' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/el.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/el.js new file mode 100644 index 0000000000..3f10e49463 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/el.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'el', { + title: 'Μαθηματικά με τη γλώσσα ASCII', + button: 'Μαθηματικά', + dialogInput: 'Γράψτε κώδικα ASCII εδώ', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Τεκμηρίωση ASCII', + loading: 'γίνεται φόρτωση...', + pathName: 'μαθηματικά' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en-gb.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en-gb.js new file mode 100644 index 0000000000..cd3ce61b61 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en-gb.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'en-gb', { + title: 'Mathematics in TeX', + button: 'Math', + dialogInput: 'Write you TeX here', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'TeX documentation', + loading: 'loading...', + pathName: 'math' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en.js new file mode 100644 index 0000000000..2a2f823e27 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/en.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'en', { + title: 'Mathematics in ASCII', + button: 'Math', + dialogInput: 'Write your ASCII here', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII documentation', + loading: 'loading...', + pathName: 'math' +} ); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/eo.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/eo.js new file mode 100644 index 0000000000..afb9794aae --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/eo.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'eo', { + title: 'Matematiko en ASCII', + button: 'Matematiko', + dialogInput: 'Skribu vian ASCII tien', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII dokumentado', + loading: 'estas ŝarganta', + pathName: 'matematiko' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/es.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/es.js new file mode 100644 index 0000000000..dbdfeb18de --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/es.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'es', { + title: 'Matemáticas en ASCII', + button: 'Matemáticas', + dialogInput: 'Escribe tu ASCII aquí', + docUrl: 'http://es.wikipedia.org/wiki/ASCII', + docLabel: 'Documentación de ASCII', + loading: 'cargando...', + pathName: 'matemáticas' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fa.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fa.js new file mode 100644 index 0000000000..756ddd8a5b --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fa.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'fa', { + title: 'ریاضیات در تک', + button: 'ریاضی', + dialogInput: 'فرمول خود را اینجا بنویسید', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'مستندسازی فرمول نویسی', + loading: 'بارگیری', + pathName: 'ریاضی' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fi.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fi.js new file mode 100644 index 0000000000..e38670a9b8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fi.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'fi', { + title: 'Matematiikkaa TeX:llä', + button: 'Matematiikka', + dialogInput: 'Kirjoita TeX:iä tähän', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'TeX dokumentaatio', + loading: 'lataa...', + pathName: 'matematiikka' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fr.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fr.js new file mode 100644 index 0000000000..1b55632124 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/fr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'fr', { + title: 'Mathématiques au format TeX', + button: 'Math', + dialogInput: 'Saisir la formule TeX ici', + docUrl: 'http://fr.wikibooks.org/wiki/LaTeX/Math%C3%A9matiques', + docLabel: 'Documentation du format TeX', + loading: 'chargement...', + pathName: 'math' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/gl.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/gl.js new file mode 100644 index 0000000000..427202098e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/gl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'gl', { + title: 'Matemáticas en ASCII', + button: 'Matemáticas', + dialogInput: 'Escriba o seu ASCII aquí', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Documentación de ASCII', + loading: 'cargando...', + pathName: 'matemáticas' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/he.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/he.js new file mode 100644 index 0000000000..7b1599ada4 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/he.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'he', { + title: 'מתמטיקה בASCII', + button: 'מתמטיקה', + dialogInput: 'כתוב את הASCII שלך כאן', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'תיעוד ASCII', + loading: 'טוען...', + pathName: 'מתמטיקה' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hr.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hr.js new file mode 100644 index 0000000000..d9b1a4cfdd --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'hr', { + title: 'Matematika u ASCIIu', + button: 'Matematika', + dialogInput: 'Napiši svoj ASCII ovdje', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII dokumentacija', + loading: 'učitavanje...', + pathName: 'matematika' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hu.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hu.js new file mode 100644 index 0000000000..049805d15f --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/hu.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'hu', { + title: 'Matematika a ASCII-ben', + button: 'Matek', + dialogInput: 'Írd a ASCII-ed ide', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII dokumentáció', + loading: 'töltés...', + pathName: 'matek' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/it.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/it.js new file mode 100644 index 0000000000..183eaa8043 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/it.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'it', { + title: 'Formule in ASCII', + button: 'Formule', + dialogInput: 'Scrivere qui il proprio ASCII', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Documentazione ASCII', + loading: 'caricamento…', + pathName: 'formula' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ja.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ja.js new file mode 100644 index 0000000000..7eb242dbee --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ja.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'ja', { + title: 'ASCII形式の数式', + button: '数式', + dialogInput: 'ASCII形式の数式を入力してください', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCIIの解説', + loading: '読み込み中…', + pathName: 'math' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/km.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/km.js new file mode 100644 index 0000000000..4420ad7abe --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/km.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'km', { + title: 'គណិត​វិទ្យា​ក្នុង ASCII', + button: 'គណិត', + dialogInput: 'សរសេរ ASCII របស់​អ្នក​នៅ​ទីនេះ', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ឯកសារ​អត្ថបទ​ពី ​ASCII', + loading: 'កំពុង​ផ្ទុក..', + pathName: 'គណិត' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nb.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nb.js new file mode 100644 index 0000000000..0c218d0931 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nb.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'nb', { + title: 'Matematikk i ASCII', + button: 'Matte', + dialogInput: 'Skriv ASCII-koden her', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII-dokumentasjon', + loading: 'laster...', + pathName: 'matte' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nl.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nl.js new file mode 100644 index 0000000000..0670f5085c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/nl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'nl', { + title: 'Wiskunde in TeX', + button: 'Wiskunde', + dialogInput: 'Typ hier uw TeX', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'TeX documentatie', + loading: 'laden...', + pathName: 'wiskunde' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/no.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/no.js new file mode 100644 index 0000000000..684cb45aee --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/no.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'no', { + title: 'Matematikk i TeX', + button: 'Matte', + dialogInput: 'Skriv TeX-koden her', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'TeX-dokumentasjon', + loading: 'laster...', + pathName: 'matte' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pl.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pl.js new file mode 100644 index 0000000000..41f1d801e1 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'pl', { + title: 'Wzory matematyczne w TeX', + button: 'Wzory matematyczne', + dialogInput: 'Wpisz wyrażenie w TeX', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'Dokumentacja TeX', + loading: 'ładowanie...', + pathName: 'matematyka' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt-br.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt-br.js new file mode 100644 index 0000000000..4a3feb6a80 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt-br.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'pt-br', { + title: 'Matemática em TeX', + button: 'Matemática', + dialogInput: 'Escreva seu TeX aqui', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'Documentação TeX', + loading: 'carregando...', + pathName: 'Matemática' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt.js new file mode 100644 index 0000000000..10f59a0030 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/pt.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'pt', { + title: 'Matemáticas em TeX', + button: 'Matemática', + dialogInput: 'Escreva aqui o seu Tex', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'Documentação TeX', + loading: 'a carregar ...', + pathName: 'matemática' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ro.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ro.js new file mode 100644 index 0000000000..ade00b1308 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ro.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'ro', { + title: 'Matematici in TeX', + button: 'Matematici', + dialogInput: 'Scrie TeX-ul aici', + docUrl: 'http://ro.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'Documentatie TeX', + loading: 'încarcă...', + pathName: 'matematici' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ru.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ru.js new file mode 100644 index 0000000000..abbfdf9138 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/ru.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'mathjax', 'ru', { + title: 'Математика в TeX-системе', + button: 'Математика', + dialogInput: 'Введите здесь TeX', + docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', + docLabel: 'TeX документация', + loading: 'загрузка...', + pathName: 'мат.' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sk.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sk.js new file mode 100644 index 0000000000..f0580eed1a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sk.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'sk', { + title: 'Matematika v ASCII', + button: 'Matika', + dialogInput: 'Napíšte svoj ASCII sem', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Dokumentácia ASCII', + loading: 'načítavanie...', + pathName: 'matika' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sl.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sl.js new file mode 100644 index 0000000000..0dee72995a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'sl', { + title: 'Matematika v ASCII', + button: 'Matematika', + dialogInput: 'Napišite svoj ASCII tukaj', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII dokumentacija', + loading: 'nalaganje...', + pathName: 'matematika' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sv.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sv.js new file mode 100644 index 0000000000..b9ee654030 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/sv.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'sv', { + title: 'Mattematik i ASCII', + button: 'Matte', + dialogInput: 'Skriv din ASCII här', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII dokumentation', + loading: 'laddar', + pathName: 'matte' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tr.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tr.js new file mode 100644 index 0000000000..8e0e69359d --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'tr', { + title: 'ASCII ile Matematik', + button: 'Matematik', + dialogInput: 'ASCII kodunuzu buraya yazın', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII yardım dökümanı', + loading: 'yükleniyor...', + pathName: 'matematik' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tt.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tt.js new file mode 100644 index 0000000000..2edafacb21 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/tt.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'tt', { + title: 'ASCII\'та математика', + button: 'Математика', + dialogInput: 'Биредә ASCII форматында аңлатмагызны языгыз', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII турыдна документлар', + loading: 'йөкләнә...', + pathName: 'математика' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/uk.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/uk.js new file mode 100644 index 0000000000..557a42c1af --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/uk.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'uk', { + title: 'Математика у ASCII', + button: 'Математика', + dialogInput: 'Наберіть тут на ASCII\'у', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Документація про ASCII', + loading: 'завантажується…', + pathName: 'математика' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/vi.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/vi.js new file mode 100644 index 0000000000..3a4f666456 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/vi.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'vi', { + title: 'Toán học bằng ASCII', + button: 'Toán', + dialogInput: 'Nhập mã ASCII ở đây', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'Tài liệu ASCII', + loading: 'đang nạp...', + pathName: 'toán' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh-cn.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh-cn.js new file mode 100644 index 0000000000..a2daef92d2 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh-cn.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'zh-cn', { + title: 'ASCII 语法的数学公式编辑器', + button: '数学公式', + dialogInput: '在此编写您的 ASCII 指令', + docUrl: 'http://zh.wikipedia.org/wiki/ASCII', + docLabel: 'ASCII 语法(可以参考维基百科自身关于数学公式显示方式的帮助)', + loading: '正在加载...', + pathName: '数字公式' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh.js new file mode 100644 index 0000000000..9069afc943 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/lang/zh.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'asciimath', 'zh', { + title: '以 ASCII 表示數學', + button: '數學', + dialogInput: '請輸入 ASCII', + docUrl: 'http://en.wikibooks.org/wiki/ASCII', + docLabel: 'ASCII 說明文件', + loading: '載入中…', + pathName: '數學' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/asciimath/plugin.js new file mode 100644 index 0000000000..7e84c66950 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/plugin.js @@ -0,0 +1,460 @@ +/** + * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @fileOverview [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin. + */ + +'use strict'; + +( function() { + + var cdn = 'http:\/\/cdn.mathjax.org\/mathjax\/2.4-latest\/MathJax.js?config=TeX-MML-AM_HTMLorMML-full'; + + CKEDITOR.plugins.add( 'asciimath', { + lang: 'ar,ca,cs,cy,de,el,en,en-gb,eo,es,fa,fi,fr,gl,he,hr,hu,it,ja,km,nb,nl,no,pl,pt,pt-br,ro,ru,sk,sl,sv,tr,tt,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + requires: 'widget,dialog', + icons: 'asciimath', + hidpi: true, // %REMOVE_LINE_CORE% + + init: function( editor ) { + var cls = editor.config.mathJaxClass || 'math-tex'; + + editor.widgets.add( 'asciimath', { + inline: true, + dialog: 'asciimath', + button: editor.lang.asciimath.button, + mask: true, + allowedContent: 'span(!' + cls + ')', + // Allow style classes only on spans having mathjax class. + styleToAllowedContentRules: function( style ) { + var classes = style.getClassesArray(); + if ( !classes ) + return null; + classes.push( '!' + cls ); + + return 'span(' + classes.join( ',' ) + ')'; + }, + pathName: editor.lang.asciimath.pathName, + + template: '', + + parts: { + span: 'span' + }, + + defaults: { + math: '\`f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n\`' + }, + + init: function() { + var iframe = this.parts.span.getChild( 0 ); + + // Check if span contains iframe and create it otherwise. + if ( !iframe || iframe.type != CKEDITOR.NODE_ELEMENT || !iframe.is( 'iframe' ) ) { + iframe = new CKEDITOR.dom.element( 'iframe' ); + iframe.setAttributes( { + style: 'border:0;width:0;height:0', + scrolling: 'no', + frameborder: 0, + allowTransparency: true, + src: CKEDITOR.plugins.asciimath.fixSrc + } ); + this.parts.span.append( iframe ); + } + + // Wait for ready because on some browsers iFrame will not + // have document element until it is put into document. + // This is a problem when you crate widget using dialog. + this.once( 'ready', function() { + // Src attribute must be recreated to fix custom domain error after undo + // (see iFrame.removeAttribute( 'src' ) in frameWrapper.load). + if ( CKEDITOR.env.ie ) + iframe.setAttribute( 'src', CKEDITOR.plugins.asciimath.fixSrc ); + + this.frameWrapper = new CKEDITOR.plugins.asciimath.frameWrapper( iframe, editor ); + this.frameWrapper.setValue( this.data.math ); + } ); + }, + + data: function() { + if ( this.frameWrapper ) + this.frameWrapper.setValue( this.data.math ); + }, + + upcast: function( el, data ) { + if ( !( el.name == 'span' && el.hasClass( cls ) ) ) + return; + + if ( el.children.length > 1 || el.children[ 0 ].type != CKEDITOR.NODE_TEXT ) + return; + + data.math = CKEDITOR.tools.htmlDecode( el.children[ 0 ].value ); + + // Add style display:inline-block to have proper height of widget wrapper and mask. + var attrs = el.attributes; + + if ( attrs.style ) + attrs.style += ';display:inline-block'; + else + attrs.style = 'display:inline-block'; + + // Add attribute to prevent deleting empty span in data processing. + attrs[ 'data-cke-survive' ] = 1; + + el.children[ 0 ].remove(); + + return el; + }, + + downcast: function( el ) { + el.children[ 0 ].replaceWith( new CKEDITOR.htmlParser.text( CKEDITOR.tools.htmlEncode( this.data.math ) ) ); + + // Remove style display:inline-block. + var attrs = el.attributes; + attrs.style = attrs.style.replace( /display:\s?inline-block;?\s?/, '' ); + if ( attrs.style === '' ) + delete attrs.style; + + return el; + } + } ); + + // Add dialog. + CKEDITOR.dialog.add( 'asciimath', this.path + 'dialogs/mathjax.js' ); + + // Add MathJax script to page preview. + editor.on( 'contentPreview', function( evt ) { + evt.data.dataValue = evt.data.dataValue.replace( /<\/head>/, + '' + + + // Load MathJax lib. + '' + + '' + + '' + + '' + + + // Render everything here and after that copy it to the preview. + '' + + '' + + '' ); + } + + // Run MathJax parsing ASCII. + function update() { + isRunning = true; + + value = newValue; + + editor.fire( 'lockSnapshot' ); + + buffer.setHtml( value ); + + // Set loading indicator. + preview.setHtml( ' + editor.lang.asciimath.loading + ' ); + + iFrame.setStyles( { + height: '16px', + width: '16px', + display: 'inline', + 'vertical-align': 'middle' + } ); + + editor.fire( 'unlockSnapshot' ); + + // Run MathJax. + doc.getWindow().$.update( value ); + } + + return { + /** + * Sets the ASCII value to be displayed in the `iframe` element inside + * the editor. This function will activate the MathJax + * library which interprets ASCII expressions and converts them into + * their representation that is displayed in the editor. + * + * @param {String} value ASCII string. + */ + setValue: function( value ) { + newValue = CKEDITOR.tools.htmlEncode( value ); + + if ( isInit && !isRunning ) + update(); + } + }; + }; + } else { + // In IE8 MathJax does not work stable so instead of using standard + // frame wrapper it is replaced by placeholder to show pure ASCII in iframe. + CKEDITOR.plugins.asciimath.frameWrapper = function( iFrame, editor ) { + iFrame.getFrameDocument().write( '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' ); + + return { + setValue: function( value ) { + var doc = iFrame.getFrameDocument(), + tex = doc.getById( 'tex' ); + + tex.setHtml( CKEDITOR.plugins.asciimath.trim( CKEDITOR.tools.htmlEncode( value ) ) ); + + CKEDITOR.plugins.asciimath.copyStyles( iFrame, tex ); + + editor.fire( 'lockSnapshot' ); + + iFrame.setStyles( { + width: Math.min( 250, tex.$.offsetWidth ) + 'px', + height: doc.$.body.offsetHeight + 'px', + display: 'inline', + 'vertical-align': 'middle' + } ); + + editor.fire( 'unlockSnapshot' ); + } + }; + }; + } +} )(); + +/** + * Sets the path to the MathJax library. It can be both a local + * resource and a location different than the default CDN. + * + * Please note that this must be a full or absolute path. + * + * config.mathJaxLib = 'http:\/\/example.com\/libs\/MathJax.js'; + * + * @cfg {String} [mathJaxLib='http:\/\/cdn.mathjax.org\/mathjax\/2.2-latest\/MathJax.js?config=TeX-AMS_HTML'] + * @member CKEDITOR.config + */ + +/** + * Sets the default class for `span` elements that will be + * converted into [Mathematical Formulas](http://ckeditor.com/addon/mathjax) + * widgets. + * + * If you set it to the following: + * + * config.mathJaxClass = 'my-math'; + * + * The code below will be recognized as a Mathematical Formulas widget. + * + * ` \sqrt{4} = 2 ` + * + * @cfg {String} [mathJaxClass='math-tex'] + * @member CKEDITOR.config + */ \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciimath/samples/mathjax.html b/main/inc/lib/javascript/ckeditor/plugins/asciimath/samples/mathjax.html new file mode 100644 index 0000000000..beb5e05181 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciimath/samples/mathjax.html @@ -0,0 +1,82 @@ + + + + + + Mathematical Formulas — CKEditor Sample + + + + + + + + + +

+ CKEditor Samples » Mathematical Formulas +

+ +
+

+ This sample shows the usage of the CKEditor mathematical plugin that introduces a MathJax widget. You can now use it to create or modify equations using TeX. +

+

+ TeX content will be automatically replaced by a widget when you put it in a <span class="math-tex"> element. You can also add new equations by using the Math toolbar button and entering TeX content in the plugin dialog window. After you click OK, a widget will be inserted into the editor content. +

+

+ The output of the editor will be plain TeX with MathJax delimiters: \( and \), as in the code below: +

+
+<span class="math-tex">\( \sqrt{1} + (1)^2 = 2 \)</span>
+
+

+ To transform TeX into a visual equation, a page must include the MathJax script. +

+

+ In order to use the new plugin, include it in the config.extraPlugins configuration setting. +

+
+CKEDITOR.replace( 'textarea_id', {
+	extraPlugins: 'mathjax'
+} );
+
+

+ Please note that this plugin is not compatible with Internet Explorer 8. +

+
+ + + + + + + diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/ASCIIsvgPI.js b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/ASCIIsvgPI.js new file mode 100644 index 0000000000..7270011dd1 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/ASCIIsvgPI.js @@ -0,0 +1,1433 @@ +/* ASCIIsvgPI.js +============== +This version contains modifications needed for ASCIIsvg to work with +tinyMCE editor plugins. Modifications made by David Lippman, (c) 2008 +Revised 8/14/09 + +JavaScript routines to dynamically generate Scalable Vector Graphics +using a mathematical xy-coordinate system (y increases upwards) and +very intuitive JavaScript commands (no programming experience required). +ASCIIsvg.js is good for learning math and illustrating online math texts. +Works with Internet Explorer+Adobe SVGviewer and SVG enabled Mozilla/Firefox. + +Ver 1.2.7 Oct 13, 2005 (c) Peter Jipsen http://www.chapman.edu/~jipsen +Latest version at http://www.chapman.edu/~jipsen/svg/ASCIIsvg.js +If you use it on a webpage, please send the URL to jipsen@chapman.edu + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License (at http://www.gnu.org/copyleft/gpl.html) +for more details.*/ + +var AScgiloc = 'http://www.imathas.com/imathas/filter/graph/svgimg.php'; +var ASnoSVG = false; +var checkIfSVGavailable = true; +var notifyIfNoSVG = false; +var alertIfNoSVG = false; +var xunitlength = 20; // pixels +var yunitlength = 20; // pixels +var origin = [0,0]; // in pixels (default is bottom left corner) +var defaultwidth = 300; defaultheight = 200; defaultborder = [0,0,0,0]; +var border = defaultborder; +var strokewidth, strokedasharray, stroke, fill; +var fontstyle, fontfamily, fontsize, fontweight, fontstroke, fontfill, fontbackground; +var markerstrokewidth = "1"; +var markerstroke = "black"; +var markerfill = "yellow"; +var marker = "none"; +var arrowfill = stroke; +var dotradius = 4; +var ticklength = 4; +var axesstroke = "black"; +var gridstroke = "grey"; +var pointerpos = null; +var coordinates = null; +var above = "above"; +var below = "below"; +var left = "left"; +var right = "right"; +var aboveleft = "aboveleft"; +var aboveright = "aboveright"; +var belowleft = "belowleft"; +var belowright = "belowright"; +var cpi = "\u03C0", ctheta = "\u03B8"; +var pi = Math.PI, ln = Math.log, e = Math.E; +var arcsin = Math.asin, arccos = Math.acos, arctan = Math.atan; +var sec = function(x) { return 1/Math.cos(x) }; +var csc = function(x) { return 1/Math.sin(x) }; +var cot = function(x) { return 1/Math.tan(x) }; +var xmin, xmax, ymin, ymax, xscl, yscl, + xgrid, ygrid, xtick, ytick, initialized; +var isIE = document.createElementNS==null; +var picture, svgpicture, doc, width, height, a, b, c, d, i, n, p, t, x, y; +var arcsec = function(x) { return arccos(1/x) }; +var arccsc = function(x) { return arcsin(1/x) }; +var arccot = function(x) { return arctan(1/x) }; +var sinh = function(x) { return (Math.exp(x)-Math.exp(-x))/2 }; +var cosh = function(x) { return (Math.exp(x)+Math.exp(-x))/2 }; +var tanh = + function(x) { return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)) }; +var sech = function(x) { return 1/cosh(x) }; +var csch = function(x) { return 1/sinh(x) }; +var coth = function(x) { return 1/tanh(x) }; +var arcsinh = function(x) { return ln(x+Math.sqrt(x*x+1)) }; +var arccosh = function(x) { return ln(x+Math.sqrt(x*x-1)) }; +var arctanh = function(x) { return ln((1+x)/(1-x))/2 }; +var sech = function(x) { return 1/cosh(x) }; +var csch = function(x) { return 1/sinh(x) }; +var coth = function(x) { return 1/tanh(x) }; +var arcsech = function(x) { return arccosh(1/x) }; +var arccsch = function(x) { return arcsinh(1/x) }; +var arccoth = function(x) { return arctanh(1/x) }; +var sign = function(x) { return (x==0?0:(x<0?-1:1)) }; +var logten = function(x) { return (Math.LOG10E*Math.log(x)) }; + + +function factorial(x,n) { + if (n==null) n=1; + for (var i=x-n; i>0; i-=n) x*=i; + return (x<0?NaN:(x==0?1:x)); +} + + +function C(x,k) { + var res=1; + for (var i=0; i524) { + // return null; + //} + return 1; + } +//Opera can do SVG, but not very pretty, so might want to skip it + if ((ver = navigator.userAgent.toLowerCase().match(/opera\/([\d\.]+)/))!=null) { + if (ver[1]>9.1) { + return null; + } + } + //Mozillas. + if (navigator.product && navigator.product=='Gecko') { + var rv = navigator.userAgent.toLowerCase().match(/rv:\s*([\d\.]+)/); + if (rv!=null) { + rv = rv[1].split('.'); + if (rv.length<3) { rv[2] = 0;} + if (rv.length<2) { rv[1] = 0;} + } + if (rv!=null && 10000*rv[0]+100*rv[1]+1*rv[2]>=10800) return null; + else return 1; + } + //IE + AdobeSVGviewer + if (navigator.appName.slice(0,9)=="Microsoft") + try { + var oSVG=eval("new ActiveXObject('Adobe.SVGCtl.3');"); + return null; + } catch (e) { + return 1; + } + else return 1; +*/ + + // Added by Ivan Tcholakov, 06-JAN-2011. + if (navigator.appName.slice(0, 8) == "Netscape") { // Gecko, Chrome, Safari + if (window['SVGElement']) { + return null; + } else { + return 1; + } + } else if (navigator.appName.slice(0, 9) == "Microsoft") { // IE + try { + var oSVG = eval("new ActiveXObject('Adobe.SVGCtl.3');"); + return null; + } catch (ex) { + return 1; + } + } else if (navigator.appName.slice(0, 5) == "Opera") { // Opera 9.50b1 or higher + return null; + } + return 1; + // +} + +function less(x,y) { return x < y } // used for scripts in XML files + // since IE does not handle CDATA well +function setText(st,id) { + var node = document.getElementById(id); + if (node!=null) + if (node.childNodes.length!=0) node.childNodes[0].nodeValue = st; + else node.appendChild(document.createTextNode(st)); +} + + +function myCreateElementSVG(t) { + if (isIE) return doc.createElement(t); + else return doc.createElementNS("http://www.w3.org/2000/svg",t); +} + + +function getX() { + return (doc.getElementById("pointerpos").getAttribute("cx")-origin[0])/xunitlength; +} + + +function getY() { + return (height-origin[1]-doc.getElementById("pointerpos").getAttribute("cy"))/yunitlength; +} + + +function mousemove_listener(evt) { + if (svgpicture.getAttribute("xbase")!=null) + pointerpos.cx.baseVal.value = evt.clientX-svgpicture.getAttribute("xbase"); + if (svgpicture.getAttribute("ybase")!=null) + pointerpos.cy.baseVal.value = evt.clientY-svgpicture.getAttribute("ybase"); +} + + +function top_listener(evt) { + svgpicture.setAttribute("ybase",evt.clientY); +} + + +function bottom_listener(evt) { + svgpicture.setAttribute("ybase",evt.clientY-height+1); +} + + +function left_listener(evt) { + svgpicture.setAttribute("xbase",evt.clientX); +} + + +function right_listener(evt) { + svgpicture.setAttribute("xbase",evt.clientX-width+1); +} + + +function switchTo(id) { +//alert(id); + picture = document.getElementById(id); + width = picture.getAttribute("width")-0; + height = picture.getAttribute("height")-0; + strokewidth = "1" // pixel + stroke = "black"; // default line color + fill = "none"; // default fill color + marker = "none"; + if ((picture.nodeName == "EMBED" || picture.nodeName == "embed") && isIE) { + svgpicture = picture.getSVGDocument().getElementById("root"); + doc = picture.getSVGDocument(); + } else { + picture.setAttribute("onmousemove","updateCoords"+(id.slice(id.length-1)-1)+"()"); +//alert(picture.getAttribute("onmousemove")+"***"); + svgpicture = picture; + doc = document; + } + xunitlength = svgpicture.getAttribute("xunitlength")-0; + yunitlength = svgpicture.getAttribute("yunitlength")-0; + xmin = svgpicture.getAttribute("xmin")-0; + xmax = svgpicture.getAttribute("xmax")-0; + ymin = svgpicture.getAttribute("ymin")-0; + ymax = svgpicture.getAttribute("ymax")-0; + origin = [svgpicture.getAttribute("ox")-0,svgpicture.getAttribute("oy")-0]; +} + + +function updatePicture(obj) { +//alert(typeof obj) + var src = document.getElementById((typeof obj=="string"? + obj:"picture"+(obj+1)+"input")).value; + xmin = null; xmax = null; ymin = null; ymax = null; + xscl = null; xgrid = null; yscl = null; ygrid = null; + initialized = false;console.log(src); + switchTo((typeof obj=="string"?obj.slice(0,8):"picture"+(obj+1))); + src = src.replace(/plot\(\x20*([^\"f\[][^\n\r]+?)\,/g,"plot\(\"$1\","); + src = src.replace(/plot\(\x20*([^\"f\[][^\n\r]+)\)/g,"plot(\"$1\")"); + src = src.replace(/([0-9])([a-zA-Z])/g,"$1*$2"); + src = src.replace(/\)([\(0-9a-zA-Z])/g,"\)*$1"); +//alert(src); + try { + with (Math) eval(src); + } catch(err) {alert(err+"\n"+src)} +} + + +function showHideCode(obj) { + var node = obj.nextSibling; + while (node != null && node.nodeName != "BUTTON" && + + node.nodeName != "button") node = node.nextSibling; + if (node.style.display == "none") node.style.display = ""; + else node.style.display = "none"; + while (node != null && node.nodeName != "TEXTAREA" && + node.nodeName != "textarea") node = node.previousSibling; + if (node.style.display == "none") node.style.display = ""; + else node.style.display = "none"; +// updatePicture(node.getAttribute("id")); +} + + +function hideCode() { //do nothing +} + + +function showcode() { //do nothing +} + + +function nobutton() { //do nothing +} + + +function setBorder(l,b,r,t) { + if (t==null) { + border = new Array(l,l,l,l); + } else { + border = new Array(l,b,r,t); + } +} + + +function initPicture(x_min,x_max,y_min,y_max) { + if (!initialized) { + strokewidth = "1"; // pixel + strokedasharray = null; + stroke = "black"; // default line color + fill = "none"; // default fill color + fontstyle = "italic"; // default shape for text labels + fontfamily = "times"; // default font + fontsize = "16"; // default size + fontweight = "normal"; + fontstroke = "black"; // default font outline color + fontfill = "black"; // default font color + fontbackground = "none"; + marker = "none"; + initialized = true; + if (x_min!=null) xmin = x_min; + if (x_max!=null) xmax = x_max; + if (y_min!=null) ymin = y_min; + if (y_max!=null) ymax = y_max; + if (xmin==null) xmin = -5; + if (xmax==null) xmax = 5; + if (typeof xmin != "number" || typeof xmax != "number" || xmin >= xmax) + alert("Picture requires at least two numbers: xmin < xmax"); + else if (y_max != null && (typeof y_min != "number" || + typeof y_max != "number" || y_min >= y_max)) + alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax"); + else { + //if (width==null) + width = picture.getAttribute("width"); + //else picture.setAttribute("width",width); + if (width==null || width=="") width=defaultwidth; + //if (height==null) + height = picture.getAttribute("height"); + //else picture.setAttribute("height",height); + if (height==null || height=="") height=defaultheight; + xunitlength = (width-border[0]-border[2])/(xmax-xmin); + yunitlength = xunitlength; +//alert(xmin+" "+xmax+" "+ymin+" "+ymax) + if (ymin==null) { + origin = [-xmin*xunitlength+border[0],height/2]; + ymin = -(height-border[1]-border[3])/(2*yunitlength); + ymax = -ymin; + } else { + if (ymax!=null) yunitlength = (height-border[1]-border[3])/(ymax-ymin); + else ymax = (height-border[1]-border[3])/yunitlength + ymin; + origin = [-xmin*xunitlength+border[0],-ymin*yunitlength+border[1]]; + } + winxmin = Math.max(border[0]-5,0); + winxmax = Math.min(width-border[2]+5,width); + winymin = Math.max(border[3]-5,0); + winymax = Math.min(height-border[1]+5,height); +// if (true ||picture.nodeName == "EMBED" || picture.nodeName == "embed") { + if (isIE) { + svgpicture = picture.getSVGDocument().getElementById("root"); + while (svgpicture.childNodes.length()>5) + svgpicture.removeChild(svgpicture.lastChild); + svgpicture.setAttribute("width",width); + svgpicture.setAttribute("height",height); + doc = picture.getSVGDocument(); + } else { + var qnode = document.createElementNS("http://www.w3.org/2000/svg","svg"); + qnode.setAttribute("id",picture.getAttribute("id")); + qnode.setAttribute("style","display:inline; "+picture.getAttribute("style")); + qnode.setAttribute("width",picture.getAttribute("width")); + qnode.setAttribute("height",picture.getAttribute("height")); + if (picture.parentNode!=null) + picture.parentNode.replaceChild(qnode,picture); + else + svgpicture.parentNode.replaceChild(qnode,svgpicture); + svgpicture = qnode; + doc = document; + pointerpos = doc.getElementById("pointerpos"); + if (pointerpos==null) { + pointerpos = myCreateElementSVG("circle"); + pointerpos.setAttribute("id","pointerpos"); + pointerpos.setAttribute("cx",0); + pointerpos.setAttribute("cy",0); + pointerpos.setAttribute("r",0.5); + pointerpos.setAttribute("fill","red"); + svgpicture.appendChild(pointerpos); + } + } +// } else { +// svgpicture = picture; +// doc = document; +// } + svgpicture.setAttribute("xunitlength",xunitlength); + svgpicture.setAttribute("yunitlength",yunitlength); + svgpicture.setAttribute("xmin",xmin); + svgpicture.setAttribute("xmax",xmax); + svgpicture.setAttribute("ymin",ymin); + svgpicture.setAttribute("ymax",ymax); + svgpicture.setAttribute("ox",origin[0]); + svgpicture.setAttribute("oy",origin[1]); + var node = myCreateElementSVG("rect"); + node.setAttribute("x","0"); + node.setAttribute("y","0"); + node.setAttribute("width",width); + node.setAttribute("height",height); + node.setAttribute("style","stroke-width:1;fill:white"); + svgpicture.appendChild(node); + if (!isIE && picture.getAttribute("onmousemove")!=null) { + svgpicture.addEventListener("mousemove", mousemove_listener, true); + var st = picture.getAttribute("onmousemove"); + svgpicture.addEventListener("mousemove", eval(st.slice(0,st.indexOf("("))), true); + node = myCreateElementSVG("polyline"); + node.setAttribute("points","0,0 "+width+",0"); + node.setAttribute("style","stroke:white; stroke-width:3"); + node.addEventListener("mousemove", top_listener, true); + svgpicture.appendChild(node); + node = myCreateElementSVG("polyline"); + node.setAttribute("points","0,"+height+" "+width+","+height); + node.setAttribute("style","stroke:white; stroke-width:3"); + node.addEventListener("mousemove", bottom_listener, true); + svgpicture.appendChild(node); + node = myCreateElementSVG("polyline"); + node.setAttribute("points","0,0 0,"+height); + node.setAttribute("style","stroke:white; stroke-width:3"); + node.addEventListener("mousemove", left_listener, true); + svgpicture.appendChild(node); + node = myCreateElementSVG("polyline"); + node.setAttribute("points",(width-1)+",0 "+(width-1)+","+height); + node.setAttribute("style","stroke:white; stroke-width:3"); + node.addEventListener("mousemove", right_listener, true); + svgpicture.appendChild(node); + } + border = defaultborder; + } + } +} + + +function line(p,q,id) { // segment connecting points p,q (coordinates in units) + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("d","M"+(p[0]*xunitlength+origin[0])+","+ + (height-p[1]*yunitlength-origin[1])+" "+ + (q[0]*xunitlength+origin[0])+","+(height-q[1]*yunitlength-origin[1])); + node.setAttribute("stroke-width", strokewidth); + if (strokedasharray!=null) + node.setAttribute("stroke-dasharray", strokedasharray); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + if (marker=="dot" || marker=="arrowdot") { + ASdot(p,4,markerstroke,markerfill); + if (marker=="arrowdot") arrowhead(p,q); + ASdot(q,4,markerstroke,markerfill); + } else if (marker=="arrow") arrowhead(p,q); +} + + +function path(plist,id,c) { + if (c==null) c=""; + var node, st, i; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + if (typeof plist == "string") st = plist; + else { + st = "M"; + st += (plist[0][0]*xunitlength+origin[0])+","+ + (height-plist[0][1]*yunitlength-origin[1])+" "+c; + for (i=1; i 0.00000001) { + u = [u[0]/d, u[1]/d]; + up = [-u[1],u[0]]; + var node = myCreateElementSVG("path"); + node.setAttribute("d","M "+(w[0]-15*u[0]-4*up[0])+" "+ + (w[1]-15*u[1]-4*up[1])+" L "+(w[0]-3*u[0])+" "+(w[1]-3*u[1])+" L "+ + (w[0]-15*u[0]+4*up[0])+" "+(w[1]-15*u[1]+4*up[1])+" z"); + node.setAttribute("stroke-width", markerstrokewidth); + node.setAttribute("stroke", stroke); /*was markerstroke*/ + node.setAttribute("fill", stroke); /*was arrowfill*/ + svgpicture.appendChild(node); + } +} + + +function chopZ(st) { + var k = st.indexOf("."); + if (k==-1) return st; + for (var i=st.length-1; i>k && st.charAt(i)=="0"; i--); + if (i==k) i--; + return st.slice(0,i+1); +} + + +function grid(dx,dy) { // for backward compatibility + axes(dx,dy,null,dx,dy) +} + + +function noaxes() { + if (!initialized) initPicture(); +} + + +function axes(dx,dy,labels,gdx,gdy,dox,doy) { +//xscl=x is equivalent to xtick=x; xgrid=x; labels=true; + var x, y, ldx, ldy, lx, ly, lxp, lyp, pnode, st; + if (!initialized) initPicture(); + if (typeof dx=="string") { labels = dx; dx = null; } + if (typeof dy=="string") { gdx = dy; dy = null; } + if (xscl!=null) {dx = xscl; gdx = xscl; labels = dx} + if (yscl!=null) {dy = yscl; gdy = yscl} + if (xtick!=null) {dx = xtick} + if (ytick!=null) {dy = ytick} + if (dox==null) {dox = true;} + if (doy==null) {doy = true;} + if (dox=="off" || dox==0) { dox = false;} else {dox = true;} + if (doy=="off" || doy==0) { doy = false;} else {doy = true;} +//alert(null) + dx = (dx==null?xunitlength:dx*xunitlength); + dy = (dy==null?dx:dy*yunitlength); + fontsize = Math.floor(Math.min(dx/1.5,dy/1.5,16));//alert(fontsize) + ticklength = fontsize/4; + if (xgrid!=null) gdx = xgrid; + if (ygrid!=null) gdy = ygrid; + if (gdx!=null) { + gdx = (typeof gdx=="string"?dx:gdx*xunitlength); + gdy = (gdy==null?dy:gdy*yunitlength); + pnode = myCreateElementSVG("path"); + st=""; + if (dox && gdx>0) { + for (x = origin[0]; x<=winxmax; x = x+gdx) + if (x>=winxmin) st += " M"+x+","+winymin+" "+x+","+winymax; + for (x = origin[0]-gdx; x>=winxmin; x = x-gdx) + if (x<=winxmax) st += " M"+x+","+winymin+" "+x+","+winymax; + } + if (doy && gdy>0) { + for (y = height-origin[1]; y<=winymax; y = y+gdy) + if (y>=winymin) st += " M"+winxmin+","+y+" "+winxmax+","+y; + for (y = height-origin[1]-gdy; y>=winymin; y = y-gdy) + if (y<=winymax) st += " M"+winxmin+","+y+" "+winxmax+","+y; + } + pnode.setAttribute("d",st); + pnode.setAttribute("stroke-width", .5); + pnode.setAttribute("stroke", gridstroke); + pnode.setAttribute("fill", fill); + svgpicture.appendChild(pnode); + } + pnode = myCreateElementSVG("path"); + if (dox) { + st="M"+winxmin+","+(height-origin[1])+" "+winxmax+","+ + (height-origin[1]); + } + if (doy) { + st += " M"+origin[0]+","+winymin+" "+origin[0]+","+winymax; + } + if (dox) { + for (x = origin[0]; x=winymin) st += " M"+x+","+(height-origin[1]+ticklength)+" "+x+","+ + (height-origin[1]-ticklength); + for (x = origin[0]-dx; x>winxmin; x = x-dx) + if (x<=winxmax) st += " M"+x+","+(height-origin[1]+ticklength)+" "+x+","+ + (height-origin[1]-ticklength); + } + if (doy) { + for (y = height-origin[1]; y=winymin) st += " M"+(origin[0]+ticklength)+","+y+" "+(origin[0]-ticklength)+","+y; + for (y = height-origin[1]-dy; y>winymin; y = y-dy) + if (y<=winymax) st += " M"+(origin[0]+ticklength)+","+y+" "+(origin[0]-ticklength)+","+y; + } + if (labels!=null) with (Math) { + ldx = dx/xunitlength; + ldy = dy/yunitlength; + lx = (xmin>0 || xmax<0?xmin:0); + ly = (ymin>0 || ymax<0?ymin:0); + lxp = (ly==0?"below":"above"); + lyp = (lx==0?"left":"right"); + var ddx = floor(1.1-log(ldx)/log(10))+1; + var ddy = floor(1.1-log(ldy)/log(10))+1; + if (ddy<0) { ddy = 0;} + if (ddx<0) { ddx = 0;} + if (dox) { + for (x = (doy?ldx:0); x<=xmax; x = x+ldx) + if (x>=xmin) text([x,ly],chopZ(x.toFixed(ddx)),lxp); + for (x = -ldx; xmin<=x; x = x-ldx) + if (x<=xmax) text([x,ly],chopZ(x.toFixed(ddx)),lxp); + } + if (doy) { + for (y = (dox?ldy:0); y<=ymax; y = y+ldy) + if (y>=ymin) text([lx,y],chopZ(y.toFixed(ddy)),lyp); + for (y = -ldy; ymin<=y; y = y-ldy) + if (y<=ymax) text([lx,y],chopZ(y.toFixed(ddy)),lyp); + } + } + pnode.setAttribute("d",st); + pnode.setAttribute("stroke-width", .5); + pnode.setAttribute("stroke", axesstroke); + pnode.setAttribute("fill", fill); + svgpicture.appendChild(pnode); +} + +function safepow(base,power) { + if (base<0 && Math.floor(power)!=power) { + for (var j=3; j<50; j+=2) { + if (Math.abs(Math.round(j*power)-(j*power))<.000001) { + if (Math.round(j*power)%2==0) { + return Math.pow(Math.abs(base),power); + } else { + return -1*Math.pow(Math.abs(base),power); + } + } + } + return sqrt(-1); + } else { + return Math.pow(base,power); + } +} + +function nthroot(n,base) { + return safepow(base,1/n); +} +function nthlogten(n,v) { + return ((Math.log(v))/(Math.log(n))); +} +function matchtolower(match) { + return match.toLowerCase(); +} + +function mathjs(st,varlist) { + //translate a math formula to js function notation + // a^b --> pow(a,b) + // na --> n*a + // (...)d --> (...)*d + // n! --> factorial(n) + // sin^-1 --> arcsin etc. + //while ^ in string, find term on left and right + //slice and concat new formula string + //parenthesizes the function variables + st = st.replace("[","("); + st = st.replace("]",")"); + st = st.replace(/arc(sin|cos|tan)/g,"a#r#c $1"); + if (varlist != null) { + var reg = new RegExp("(sqrt|ln|log|sin|cos|tan|sec|csc|cot|abs)[\(]","g"); + st = st.replace(reg,"$1#("); + var reg = new RegExp("("+varlist+")("+varlist+")$","g"); + st = st.replace(reg,"($1)($2)"); + var reg = new RegExp("("+varlist+")(a#|sqrt|ln|log|sin|cos|tan|sec|csc|cot|abs)","g"); + st = st.replace(reg,"($1)$2"); + var reg = new RegExp("("+varlist+")("+varlist+")([^a-df-zA-Z\(#])","g"); // 6/1/09 readded \( for f(350/x) + st = st.replace(reg,"($1)($2)$3"); //get xy3 + //var reg = new RegExp("("+varlist+")("+varlist+")(\w*[^\(#])","g"); + //st = st.replace(reg,"($1)($2)$3"); //get xysin + var reg = new RegExp("([^a-df-zA-Z#])("+varlist+")([^a-df-zA-Z#])","g"); + st = st.replace(reg,"$1($2)$3"); + var reg = new RegExp("^("+varlist+")([^a-df-zA-Z])","g"); + st = st.replace(reg,"($1)$2"); + var reg = new RegExp("([^a-df-zA-Z])("+varlist+")$","g"); + st = st.replace(reg,"$1($2)"); + } + st = st.replace(/#/g,""); + st = st.replace(/a#r#c\s+(sin|cos|tan)/g,"arc$1"); + st = st.replace(/\s/g,""); + st = st.replace(/(Sin|Cos|Tan|Sec|Csc|Cot|Arc|Abs|Log|Ln)/g, matchtolower); + st = st.replace(/log_(\d+)\(/,"nthlog($1,"); + st = st.replace(/log/g,"logten"); + + if (st.indexOf("^-1")!=-1) { + st = st.replace(/sin\^-1/g,"arcsin"); + st = st.replace(/cos\^-1/g,"arccos"); + st = st.replace(/tan\^-1/g,"arctan"); + st = st.replace(/sec\^-1/g,"arcsec"); + st = st.replace(/csc\^-1/g,"arccsc"); + st = st.replace(/cot\^-1/g,"arccot"); + st = st.replace(/sinh\^-1/g,"arcsinh"); + st = st.replace(/cosh\^-1/g,"arccosh"); + st = st.replace(/tanh\^-1/g,"arctanh"); + st = st.replace(/sech\^-1/g,"arcsech"); + st = st.replace(/csch\^-1/g,"arccsch"); + st = st.replace(/coth\^-1/g,"arccoth"); + } + + st = st.replace(/root\((\d+)\)\(/,"nthroot($1,"); + //st = st.replace(/E/g,"(EE)"); + st = st.replace(/([0-9])E([\-0-9])/g,"$1(EE)$2"); + + st = st.replace(/^e$/g,"(E)"); + st = st.replace(/pi/g,"(pi)"); + st = st.replace(/^e([^a-zA-Z])/g,"(E)$1"); + st = st.replace(/([^a-zA-Z])e$/g,"$1(E)"); + + st = st.replace(/([^a-zA-Z])e([^a-zA-Z])/g,"$1(E)$2"); + st = st.replace(/([0-9])([\(a-zA-Z])/g,"$1*$2"); + st = st.replace(/(!)([0-9\(])/g,"$1*$2"); + //want to keep scientific notation + st= st.replace(/([0-9])\*\(EE\)([\-0-9])/,"$1e$2"); + + + st = st.replace(/\)([\(0-9a-zA-Z])/g,"\)*$1"); + + var i,j,k, ch, nested; + while ((i=st.indexOf("^"))!=-1) { + + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + //find right argument + if (i==st.length-1) return "Error: missing argument"; + k = i+1; + ch = st.charAt(k); + nch = st.charAt(k+1); + if (ch>="0" && ch<="9" || (ch=="-" && nch!="(") || ch==".") {// look for signed (decimal) number + k++; + while (k="0" && ch<="9") k++; + if (ch==".") { + k++; + while (k="0" && ch<="9") k++; + } + } else if (ch=="(" || (ch=="-" && nch=="(")) {// look for matching closing bracket and function name + if (ch=="-") { k++;} + nested = 1; + k++; + while (k0) { + ch = st.charAt(k); + if (ch=="(") nested++; + else if (ch==")") nested--; + k++; + } + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + k++; + while (k="a" && ch<="z" || + ch>="A" && ch<="Z") k++; + if (ch=='(' && st.slice(i+1,k).match(/^(sin|cos|tan|sec|csc|cot|logten|log|ln|exp|arcsin|arccos|arctan|arcsec|arccsc|arccot|sinh|cosh|tanh|sech|csch|coth|arcsinh|arccosh|arctanh|arcsech|arccsch|arccoth|sqrt|abs|nthroot)$/)) { + nested = 1; + k++; + while (k0) { + ch = st.charAt(k); + if (ch=="(") nested++; + else if (ch==")") nested--; + k++; + } + } + } else { + return "Error: incorrect syntax in "+st+" at position "+k; + } + st = st.slice(0,j+1)+"safepow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+ + st.slice(k); + } + while ((i=st.indexOf("!"))!=-1) { + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1); + } + return st; +} + + +function slopefield(fun,dx,dy) { + var g = fun; + if (typeof fun=="string") + eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }"); + var gxy,x,y,u,v,dz; + if (dx==null) dx=1; + if (dy==null) dy=1; + dz = Math.sqrt(dx*dx+dy*dy)/6; + var x_min = Math.ceil(xmin/dx); + var y_min = Math.ceil(ymin/dy); + for (x = x_min; x <= xmax; x += dx) + for (y = y_min; y <= ymax; y += dy) { + gxy = g(x,y); + if (!isNaN(gxy)) { + if (Math.abs(gxy)=="Infinity") {u = 0; v = dz;} + else {u = dz/Math.sqrt(1+gxy*gxy); v = gxy*u;} + line([x-u,y-v],[x+u,y+v]); + } + } +} + + +//ASCIIsvgAddon.js dumped here +function drawPictures() { + drawPics() +} + +//ShortScript format: +//xmin,xmax,ymin,ymax,xscl,yscl,labels,xgscl,ygscl,width,height plotcommands(see blow) +//plotcommands: type,eq1,eq2,startmaker,endmarker,xmin,xmax,color,strokewidth,strokedash +function parseShortScript(sscript,gw,gh) { + + // Added by Ivan Tcholakov, 07-JAN-2011. + if (typeof picture == 'undefined') { + return; + } + // + + if (sscript == null) { + initialized = false; + sscript = picture.sscr; + } + + var sa= sscript.split(","); + + if (gw && gh) { + sa[9] = gw; + sa[10] = gh; + sscript = sa.join(","); + picture.setAttribute("sscr", sscript); + } + picture.setAttribute("width", sa[9]); + picture.setAttribute("height", sa[10]); + picture.style.width = sa[9] + "px"; + picture.style.height = sa[10] + "px"; + + if (sa.length > 10) { + commands = 'setBorder(5);'; + commands += 'width=' +sa[9] + '; height=' +sa[10] + ';'; + commands += 'initPicture(' + sa[0] +','+ sa[1] +','+ sa[2] +','+ sa[3] + ');'; + commands += 'axes(' + sa[4] +','+ sa[5] +','+ sa[6] +','+ sa[7] +','+ sa[8]+ ');'; + + var inx = 11; + var eqnlist = 'Graphs: '; + + while (sa.length > inx+9) { + commands += 'stroke="' + sa[inx+7] + '";'; + commands += 'strokewidth="' + sa[inx+8] + '";' + //commands += 'strokedasharray="' + sa[inx+9] + '";' + if (sa[inx+9] != "") { + commands += 'strokedasharray="' + sa[inx+9].replace(/\s+/g,',') + '";'; + } + if (sa[inx]=="slope") { + eqnlist += "dy/dx="+sa[inx+1] + "; "; + commands += 'slopefield("' + sa[inx+1] + '",' + sa[inx+2] + ',' + sa[inx+2] + ');'; + } else { + if (sa[inx]=="func") { + eqnlist += "y="+sa[inx+1] + "; "; + eqn = '"' + sa[inx+1] + '"'; + } else if (sa[inx] == "polar") { + eqnlist += "r="+sa[inx+1] + "; "; + eqn = '["cos(t)*(' + sa[inx+1] + ')","sin(t)*(' + sa[inx+1] + ')"]'; + } else if (sa[inx] == "param") { + eqnlist += "[x,y]=["+sa[inx+1] + "," + sa[inx+2] + "]; "; + eqn = '["' + sa[inx+1] + '","'+ sa[inx+2] + '"]'; + } + + + if (typeof eval(sa[inx+5]) == "number") { + // if ((sa[inx+5]!='null')&&(sa[inx+5].length>0)) { + //commands += 'myplot(' + eqn +',"' + sa[inx+3] + '","' + sa[inx+4]+'",' + sa[inx+5] + ',' + sa[inx+6] +');'; + commands += 'plot(' + eqn +',' + sa[inx+5] + ',' + sa[inx+6] +',null,null,' + sa[inx+3] + ',' + sa[inx+4] +');'; + + } else { + commands += 'plot(' + eqn +',null,null,null,null,' + sa[inx+3] + ',' + sa[inx+4]+');'; + } + } + inx += 10; + } + + try { + eval(commands); + } catch (e) { + setTimeout(function() {parseShortScript(sscript,gw,gh)},100); + //alert("Graph not ready"); + } + + picture.setAttribute("alt",eqnlist); + //picture.setAttribute("width", sa[9]); + //picture.setAttribute("height", sa[9]); + + return commands; + } +} + + + + +function drawPics() { + var index, nd; + pictures = document.getElementsByTagName("embed"); + // might be needed if setTimeout on parseShortScript isn't working + if (!ASnoSVG) { + try { + for (var i = 0; i < pictures.length; i++) { + if (pictures[i].getAttribute("sscr")!='' || pictures[i].getAttribute("script")!='') { + if (pictures[i].getSVGDocument().getElementById("root") == null) { + setTimeout(drawPics,100); + return; + } + } + } + } catch (e) { + setTimeout(drawPics,100); + return; + } + } + var len = pictures.length; + + + for (index = 0; index < len; index++) { + picture = ((!ASnoSVG && isIE) ? pictures[index] : pictures[0]); + // for (index = len-1; index >=0; index--) { + // picture = pictures[index]; + + if (!ASnoSVG) { + initialized = false; + var sscr = picture.getAttribute("sscr"); + if ((sscr != null) && (sscr != "")) { //sscr from editor + try { + parseShortScript(sscr); + } catch (e) {} + } else { + src = picture.getAttribute("script"); //script from showplot + if ((src!=null) && (src != "")) { + try { + with (Math) eval(src); + } catch(err) {alert(err+"\n"+src)} + } + } + } else { + if (picture.getAttribute("sscr")!='') { + n = document.createElement('img'); + n.setAttribute("style",picture.getAttribute("style")); + n.setAttribute("src",AScgiloc+'?sscr='+encodeURIComponent(picture.getAttribute("sscr"))); + pn = picture.parentNode; + pn.replaceChild(n,picture); + } + + } + + } +} + +//modified by David Lippman from original in AsciiSVG.js by Peter Jipsen +//added min/max type: 0:nothing, 1:arrow, 2:open dot, 3:closed dot +function plot(fun,x_min,x_max,points,id,min_type,max_type) { + var pth = []; + var f = function(x) { return x }, g = fun; + var name = null; + if (typeof fun=="string") + eval("g = function(x){ with(Math) return "+mathjs(fun)+" }"); + else if (typeof fun=="object") { + eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }"); + eval("g = function(t){ with(Math) return "+mathjs(fun[1])+" }"); + } + if (typeof x_min=="string") { name = x_min; x_min = xmin } + else name = id; + var min = (x_min==null?xmin:x_min); + var max = (x_max==null?xmax:x_max); + if (max <= min) { return null;} + //else { + var inc = max-min-0.000001*(max-min); + inc = (points==null?inc/200:inc/points); + var gt; +//alert(typeof g(min)) + for (var t = min; t <= max; t += inc) { + gt = g(t); + if (!(isNaN(gt)||Math.abs(gt)=="Infinity")) pth[pth.length] = [f(t), gt]; + } + path(pth,name); + if (min_type == 1) { + arrowhead(pth[1],pth[0]); + } else if (min_type == 2) { + dot(pth[0], "open"); + } else if (min_type == 3) { + dot(pth[0], "closed"); + } + if (max_type == 1) { + arrowhead(pth[pth.length-2],pth[pth.length-1]); + } else if (max_type == 2) { + dot(pth[pth.length-1], "open"); + } else if (max_type == 3) { + dot(pth[pth.length-1], "closed"); + } + + return p; + //} +} + +//end ASCIIsvgAddon.js dump + +function updateCoords(ind) { + switchTo("picture"+(ind+1)); + var gx=getX(), gy=getY(); + if ((xmax-gx)*xunitlength > 6*fontsize || (gy-ymin)*yunitlength > 2*fontsize) + text([xmax,ymin],"("+gx.toFixed(2)+", "+gy.toFixed(2)+")", + "aboveleft","AScoord"+ind,""); + else text([xmax,ymin]," ","aboveleft","AScoord"+ind,""); +} + + +function updateCoords0() {updateCoords(0)} +function updateCoords1() {updateCoords(1)} +function updateCoords2() {updateCoords(2)} +function updateCoords3() {updateCoords(3)} +function updateCoords4() {updateCoords(4)} +function updateCoords5() {updateCoords(5)} +function updateCoords6() {updateCoords(6)} +function updateCoords7() {updateCoords(7)} +function updateCoords8() {updateCoords(8)} +function updateCoords9() {updateCoords(9)} +ASfn = [function() {updatePicture(0)}, + function() {updatePicture(1)}, + function() {updatePicture(2)}, + function() {updatePicture(3)}, + function() {updatePicture(4)}, + function() {updatePicture(5)}, + function() {updatePicture(6)}, + function() {updatePicture(7)}, + + function() {updatePicture(8)}, + function() {updatePicture(9)}]; +ASupdateCoords = [function() {updateCoords(0)}, + function() {updateCoords(1)}, + function() {updateCoords(2)}, + function() {updateCoords(3)}, + function() {updateCoords(4)}, + function() {updateCoords(5)}, + function() {updateCoords(6)}, + function() {updateCoords(7)}, + function() {updateCoords(8)}, + function() {updateCoords(9)}]; + + +// GO1.1 Generic onload by Brothercake +// http://www.brothercake.com/ +//onload function +function generic() +{ + drawPictures(); +}; +//setup onload function +if(typeof window.addEventListener != 'undefined') +{ + //.. gecko, safari, konqueror and standard + window.addEventListener('load', generic, false); +} +else if(typeof document.addEventListener != 'undefined') +{ + //.. opera 7 + document.addEventListener('load', generic, false); +} +else if(typeof window.attachEvent != 'undefined') +{ + //.. win/ie + window.attachEvent('onload', generic); +} +//** remove this condition to degrade older browsers +else +{ + //.. mac/ie5 and anything else that gets this far + //if there's an existing onload function + if(typeof window.onload == 'function') + { + //store it + var existing = onload; + //add new onload handler + window.onload = function() + { + //call existing onload function + existing(); + //call generic onload function + generic(); + }; + } + else + { + //setup onload function + window.onload = generic; + } +} + + +if (checkIfSVGavailable) { + checkifSVGavailable = false; + nd = isSVGavailable(); + ASnoSVG = nd!=null; +} diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/d.svg b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/d.svg new file mode 100644 index 0000000000..540b548ed6 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/d.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/dialogs/mathjax.js b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/dialogs/mathjax.js new file mode 100644 index 0000000000..b92d80210c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/dialogs/mathjax.js @@ -0,0 +1,691 @@ +CKEDITOR.dialog.add( 'asciisvg', function( editor ) { + var lang = editor.lang.asciisvg; + + function getValues(dialog) { + var dialogContents = dialog.definition.contents[0]; + var pageId = dialogContents.id; + var dialogFieldValues = {}; + for (var i = 0; i < dialogContents.elements.length-1; i++) { + for (var j = 0; j < dialogContents.elements[i].children.length; j++) { + var fieldId = dialogContents.elements[i].children[j].id; + if (isNaN(dialog.getValueOf(pageId, fieldId))) { + dialogFieldValues[fieldId] = dialog.getValueOf(pageId, fieldId); + } else { + dialogFieldValues[fieldId] = Number(dialog.getValueOf(pageId, fieldId)); + } + } + } + stroke = dialogFieldValues.color; + strokewidth = dialogFieldValues.width; + strokedasharray = dialogFieldValues.line; + xmin = dialogFieldValues.xmin; + xmax = dialogFieldValues.xmax; + xscl = dialogFieldValues.xscl; + ymin = dialogFieldValues.ymin; + ymax = dialogFieldValues.ymax; + yscl = dialogFieldValues.yscl; + width = dialogFieldValues.resizeTo; + height = dialogFieldValues.by; + return dialogFieldValues; + } + + function updateFields(control) { + var dialog = control.getDialog(); + var pageId = (dialog.definition.contents[0]).id; + var equationTypeField = dialog.getContentElement(pageId, 'equationType'); + var equationField = dialog.getContentElement(pageId, 'equation'); + var extraField = dialog.getContentElement(pageId, 'extraField'); + var extraFieldIsVisible = extraField.getElement().isVisible(); + var value = control.getValue(); + if (value.indexOf(',') > -1) { + value = value.split(','); + } else { + value = [value]; + } + var found = false; + var i = 0; + while (found === false && i < equationTypeField.items.length) { + if (equationTypeField.items[i][1] === value[0]) { + found = true; + } else { + i++; + } + } + equationTypeField.getInputElement().$.selectedIndex = i; + switch (value[0]) { + case 'func': + if (extraFieldIsVisible === true) { + extraField.getElement().hide(); + } + equationField.setLabel(lang.FOfX); + dialog.setValueOf(pageId, 'equation', lang.SinOfX); + break; + case 'polar': + if (extraFieldIsVisible === true) { + extraField.getElement().hide(); + } + equationField.setLabel(lang.ROfT); + dialog.setValueOf(pageId, 'equation', lang.T); + break; + case 'param': + equationField.setLabel(lang.FOfT); + dialog.setValueOf(pageId, 'equation', lang.SinOfT); + extraField.setLabel(lang.GOfT); + dialog.setValueOf(pageId, 'extraField', lang.CosOfT); + if (extraFieldIsVisible === false) { + extraField.getElement().show(); + } + break; + case 'slope': + equationField.setLabel(lang.DySplitDxOfXAndY); + dialog.setValueOf(pageId, 'equation', lang.XByY); + extraField.setLabel(lang.Every); + dialog.setValueOf(pageId, 'extraField', '1'); + if (extraFieldIsVisible === false) { + extraField.getElement().show(); + } + break; + case 'label': + if (extraFieldIsVisible === true) { + extraField.getElement().hide(); + } + equationField.setLabel(lang.Label); + dialog.setValueOf(pageId, 'equation', lang.Text); + break; + } + var fromField = dialog.getContentElement(pageId, 'from'); + var toField = dialog.getContentElement(pageId, 'to'); + if (value[0] === 'label') { + fromField.setLabel(lang.XPosition); + toField.setLabel(lang.YPosition); + dialog.setValueOf(pageId, 'from', '0'); + dialog.setValueOf(pageId, 'to', '0'); + } else { + fromField.setLabel(lang.From); + toField.setLabel(lang.To); + dialog.setValueOf(pageId, 'from', '-7.5'); + dialog.setValueOf(pageId, 'to', '7.5'); + } + if (value.length > 1) { + dialog.setValueOf(pageId, 'startWith', value[3]); + dialog.setValueOf(pageId, 'endWith', value[4]); + dialog.setValueOf(pageId, 'from', value[5]); + dialog.setValueOf(pageId, 'to', value[6]); + dialog.setValueOf(pageId, 'color', value[7]); + dialog.setValueOf(pageId, 'width', value[8]); + dialog.setValueOf(pageId, 'line', value[9]); + } else { + var fieldsToDefault = ['color','width','line','startWith','endWith']; + for (var i = 0; i < fieldsToDefault.length; i++) { + dialog.setValueOf(pageId, fieldsToDefault[i], dialog.getContentElement(pageId, fieldsToDefault[i]).default); + } + } + } + + function addGraph(dialog) { + var pageId = (dialog.definition.contents[0]).id; + var equationTypeField = dialog.getContentElement(pageId, 'equationType'); + var selectedIndex = equationTypeField.getInputElement().$.selectedIndex; + var equationType = [equationTypeField.items[selectedIndex][0]]; + var equation = [dialog.getValueOf(pageId, 'equation')]; + var graphEquation = [[],[]]; + // Check if there is more than one equal sign (more than one equation type) + if (equationType[0].split('=').length - 1 > 1) { + equationType = equationType[0].split(','); + var extraField = dialog.getValueOf(pageId, 'extraField'); + equation = [equation[0], extraField]; + } + // Store left and right parts of the graph equations + for (var i = 0; i < equationType.length; i++) { + // Left part of the graph equations + if (equationType[0].indexOf('=') > -1) { + graphEquation[0][i] = equationType[i].substring(0, equationType[i].indexOf('=')); + } else { + graphEquation[0][i] = equationType[i]; + } + // Right part of the graph equations + graphEquation[1][i] = equation[i]; + } + // Convert graphEquation arrays to strings separated by commas + graphEquation[0] = graphEquation[0].join(); + graphEquation[1] = graphEquation[1].join(); + // Add square brackets if there is more than one equation type + if (equationType.length > 1) { + graphEquation = '['+graphEquation[0]+']=['+graphEquation[1]+']'; + } else { + graphEquation = graphEquation[0]+'='+graphEquation[1]; + equation = equation[0]; + } + var graphsField = dialog.getContentElement(pageId, 'graphs'); + // Add graph equation to graphs select + var values = getValues(dialog); + graphsField.items.push(graphEquation); + var sscr = values.equationType+','+values.equation+','+values.extraField+','+values.startWith+','+values.endWith+','+values.from+','+values.to+','+values.color+','+values.width+','+values.line; + graphsField.add(graphEquation, sscr); + sscr = xmin+','+xmax+','+ymin+','+ymax+','+xscl+','+yscl+','+(xscl||yscl)+','+xgrid+','+ygrid+','+width+','+height; + var graphsFieldLastIndex = graphsField.getInputElement().$.options.length-1; + graphsField.getInputElement().$.selectedIndex = graphsFieldLastIndex; + picture.sscr = sscr; + switch(values.equationType) { + case 'func': + var functionCall = values.equation; + plot(functionCall, values.from, values.to, null, null, values.startWith, values.endWith); + break; + case 'polar': + var functionCall = ["cos(t)*("+values.equation+")","sin(t)*("+values.equation+")"]; + plot(functionCall, values.from, values.to, null, null, values.startWith, values.endWith); + break; + case 'param': + var functionCall = [values.equation, values.extraField]; + plot(functionCall, values.from, values.to, null, null, values.startWith, values.endWith); + break; + case 'slope': + slopefield(values.equation, values.extraField, values.extraField); + plot(null, values.from, values.to, null, null, values.startWith, values.endWith); + break; + case 'label': + text([values.from, values.to], values.equation); + break; + } + } + + function removeSelectedGraph(dialog) { + var pageId = (dialog.definition.contents[0]).id; + var graphsField = dialog.getContentElement(pageId, 'graphs'); + var selectedIndex = graphsField.getInputElement().$.selectedIndex; + graphsField.items.splice(selectedIndex, 1); + graphsField.remove(selectedIndex); + } + + function updateGraphs(dialog) { + initialized = false; + var sscr = xmin+','+xmax+','+ymin+','+ymax+','+xscl+','+yscl+','+(xscl||yscl)+','+xgrid+','+ygrid; + picture.sscr = sscr; + parseShortScript(sscr, width, height); + var pageId = (dialog.definition.contents[0]).id; + var graphsField = dialog.getContentElement(pageId, 'graphs'); + for (var i = 0; i < graphsField.items.length; i++) { + var values = (graphsField.getInputElement().$.options[i].getAttribute('value')).split(','); + stroke = values[7]; + strokewidth = values[8]; + strokedasharray = values[9]; + for (var j = 0; j < values.length; j++) { + if (!isNaN(values[j])) { + values[j] = Number(values[j]); + } + } + switch(values[0]) { + case 'func': + var functionCall = values[1]; + plot(functionCall, values[5], values[6], null, null, values[3], values[4]); + break; + case 'polar': + var functionCall = ["cos(t)*("+values[1]+")","sin(t)*("+values[1]+")"]; + plot(functionCall, values[5], values[6], null, null, values[3], values[4]); + break; + case 'param': + var functionCall = [values[1], values[2]]; + plot(functionCall, values[5], values[6], null, null, values[3], values[4]); + break; + case 'slope': + slopefield(values[1], values[2], values[2]); + plot(null, values[5], values[6], null, null, values[3], values[4]); + break; + case 'label': + text([values[5], values[6]], values[1]); + break; + } + } + } + + return { + title: lang.GraphEditor, + minWidth: 350, + minHeight: 100, + contents: [ + { + id: 'info', + elements: [ + { + type: 'hbox', + widths: ['20%', '20%', '20%', '20%', '20%'], + children: [ + { + id: 'equationType', + type: 'select', + label: lang.EquationType, + items: [ + [lang.YEqualsFOfX, 'func'], + [lang.REqualsFOfT, 'polar'], + [lang.XEqualsFOfTCommaYEqualsGOfT, 'param'], + [lang.DySplitDxEqualsFOfXAndY, 'slope'], + [lang.Label, 'label'] + ], + default: 'func', + onChange: function (api) { + updateFields(this); + } + }, + { + id: 'equation', + type: 'text', + label: lang.FOfX, + default: lang.XSquared + }, + { + id: 'extraField', + type: 'text', + label: '', + default: '' + }, + { + id: 'from', + type: 'text', + label: lang.From, + default: '-7.5' + }, + { + id: 'to', + type: 'text', + label: lang.To, + default: '7.5' + } + ] + }, + { + type: 'hbox', + widths: ['20%', '20%', '20%', '20%', '20%'], + children: [ + { + id: 'color', + type: 'select', + label: lang.Color, + items: [ + [lang.Black, 'black'], + [lang.Red, 'red'], + [lang.Orange, 'orange'], + [lang.Yellow, 'yellow'], + [lang.Green, 'green'], + [lang.Blue, 'blue'], + [lang.Purple, 'purple'] + ], + default: 'black' + }, + { + id: 'width', + type: 'select', + label: lang.Width, + items: [ + ['1'], + ['2'], + ['3'], + ['4'] + ], + default: '1' + }, + { + id: 'line', + type: 'select', + label: lang.Line, + items: [ + [lang.Solid, '0'], + [lang.Dotted, '1'], + [lang.Dashed, '2'], + [lang.TightDash, '3'], + [lang.DashDot, '4'] + ], + default: '0' + }, + { + id: 'startWith', + type: 'select', + label: lang.StartWith, + items: [ + [lang.None, '0'], + [lang.Arrow, '1'], + [lang.OpenDot, '2'], + [lang.Dot, '3'] + ], + default: '0' + }, + { + id: 'endWith', + type: 'select', + label: lang.EndWith, + items: [ + [lang.None, '0'], + [lang.Arrow, '1'], + [lang.OpenDot, '2'], + [lang.Dot, '3'] + ], + default: '0' + } + ] + }, + { + type: 'hbox', + widths: ['17%', '17%', '16%', '17%', '17%', '16%'], + children: [ + { + id: 'xmin', + type: 'text', + label: lang.XMin, + default: '-7.5' + }, + { + id: 'xmax', + type: 'text', + label: lang.XMax, + default: '7.5' + }, + { + id: 'xscl', + type: 'text', + label: lang.XScl, + default: '1' + }, + { + id: 'ymin', + type: 'text', + label: lang.YMin, + default: '-5' + }, + { + id: 'ymax', + type: 'text', + label: lang.YMax, + default: '5' + }, + { + id: 'yscl', + type: 'text', + label: lang.YScl, + default: '1' + } + ] + }, + { + type: 'hbox', + widths: ['20%', '20%', '20%', '20%', '20%'], + children: [ + { + type: 'checkbox', + id: 'showAxisLabels', + label: lang.ShowAxisLabels, + default: 'checked', + onClick: function() { + if (this.getValue()) { + xscl = 1; + xtick = 1; + yscl = 1; + ytick = 1; + } else { + xscl = null; + xtick = null; + yscl = null; + ytick = null; + } + updateGraphs(this.getDialog()); + } + }, + { + type: 'checkbox', + id: 'showXYGrid', + label: lang.ShowXYGrid, + default: 'checked', + onClick: function() { + if (this.getValue()) { + xgrid = 1; + ygrid = 1; + } else { + xgrid = 0; + ygrid = 0; + } + updateGraphs(this.getDialog()); + } + }, + { + id: 'resizeTo', + type: 'text', + label: lang.ResizeTo, + default: defaultwidth + }, + { + id: 'by', + type: 'text', + label: lang.By, + default: defaultheight + }, + { + type: 'button', + id: 'update', + label: lang.Update, + title: lang.Update, + onClick: function() { + var dialog = this.getDialog(); + var pageId = (dialog.definition.contents[0]).id; + width = dialog.getValueOf(pageId, 'resizeTo'); + height = dialog.getValueOf(pageId, 'by'); + updateGraphs(dialog); + } + } + ] + }, + { + type: 'hbox', + widths: ['20%', '20%', '20%', '20%', '20%'], + children: [ + { + type: 'button', + id: 'addGraph', + label: lang.AddGraph, + title: lang.AddGraph, + onClick: function() { + addGraph(this.getDialog()); + } + }, + { + id: 'graphs', + type: 'select', + label: lang.Graphs, + items: [], + onChange: function (api) { + updateFields(this); + } + }, + { + type: 'button', + id: 'replaceSelectedGraph', + label: lang.ReplaceSelectedGraph, + title: lang.ReplaceSelectedGraph, + onClick: function() { + removeSelectedGraph(this.getDialog()); + updateGraphs(this.getDialog()); + addGraph(this.getDialog()); + } + }, + { + type: 'button', + id: 'remove', + label: lang.Remove, + title: lang.Remove, + onClick: function() { + removeSelectedGraph(this.getDialog()); + updateGraphs(this.getDialog()); + } + }, + { + id: 'position', + type: 'select', + label: lang.Position, + items: [ + [lang.Top, 'top'], + [lang.Middle, 'middle'], + [lang.Bottom, 'bottom'], + [lang.FloatLeft, 'floatLeft'], + [lang.FloatRight, 'floatRight'] + ], + default: 'middle', + onChange: function (api) { + var currentStyle = picture.attributes.style.value; + var regExpPattern = /vertical-align:\s?(\w|-)+/; + var verticalAlignValue = (regExpPattern.exec(currentStyle))[0]; + var regExpPattern = /float:\s?\w+/; + var floatValue = (regExpPattern.exec(currentStyle))[0]; + switch(this.getValue()) { + case 'top': + currentStyle = currentStyle.replace(verticalAlignValue, 'vertical-align: text-top'); + currentStyle = currentStyle.replace(floatValue, 'float: none'); + break; + case 'middle': + currentStyle = currentStyle.replace(verticalAlignValue, 'vertical-align: middle'); + currentStyle = currentStyle.replace(floatValue, 'float: none'); + break; + case 'bottom': + currentStyle = currentStyle.replace(verticalAlignValue, 'vertical-align: text-bottom'); + currentStyle = currentStyle.replace(floatValue, 'float: none'); + break; + case 'floatLeft': + currentStyle = currentStyle.replace(verticalAlignValue, 'vertical-align: middle'); + currentStyle = currentStyle.replace(floatValue, 'float: left'); + break; + case 'floatRight': + currentStyle = currentStyle.replace(verticalAlignValue, 'vertical-align: middle'); + currentStyle = currentStyle.replace(floatValue, 'float: right'); + break; + } + picture.attributes.style.value = currentStyle; + } + } + ] + }, + { + id: 'preview', + type: 'html', + html: '', + onShow: function( widget ) { + xmin = -7.5; + xmax = 7.5; + ymin = -5; + ymax = 5; + xscl = 1; + yscl = 1; + xgrid = 1; + ygrid = 1; + xtick = 1; + ytick = 1; + width = defaultwidth; + height = defaultheight; + drawPics(); + var dialog = this.getDialog(); + var pageId = (dialog.definition.contents[0]).id; + var fieldsToDefault = ['equationType','equation','color','width','line','startWith','endWith']; + for (var i = 0; i < fieldsToDefault.length; i++) { + dialog.setValueOf(pageId, fieldsToDefault[i], dialog.getContentElement(pageId, fieldsToDefault[i]).default); + } + var extraField = dialog.getContentElement(pageId,'extraField'); + extraField.getElement().hide(); + var graphsField = dialog.getContentElement(pageId, 'graphs'); + var graphData = null; + graphsField.clear(); + graphsField.items = []; + if (graphData !== editor.getSelection().getSelectedElement()) { + graphData = (editor.getSelection().getSelectedElement().$.attributes[0].value).split(','); + for (var i = 11; i < graphData.length; i+=10) { + var graphEquation = ''; + switch(graphData[i]) { + case 'func': + graphEquation = 'y='+graphData[i+1]; + break; + case 'polar': + graphEquation = 'r='+graphData[i+1]; + break; + case 'param': + graphEquation = '[x,y]=['+graphData[i+1]+','+graphData[i+2]+']'; + break; + case 'slope': + graphEquation = 'dx/dy='+graphData[i+1]; + break; + case 'label': + graphEquation = lang.Label+'='+graphData[i+1]; + break; + } + graphsField.items.push(graphEquation); + var sscr = graphData[i]+','+graphData[i+1]+','+graphData[i+2]+','+graphData[i+3]+','+graphData[i+4]+','+graphData[i+5]+','+graphData[i+6]+','+graphData[i+7]+','+graphData[i+8]+','+graphData[i+9]; + graphsField.add(graphEquation, sscr); + } + xmin = graphData[0]; + dialog.setValueOf(pageId, 'xmin', xmin); + xmax = graphData[1]; + dialog.setValueOf(pageId, 'xmax', xmax); + ymin = graphData[2]; + dialog.setValueOf(pageId, 'ymin', ymin); + ymax = graphData[3]; + dialog.setValueOf(pageId, 'ymax', ymax); + if (graphData[6] === 'null') { + dialog.setValueOf(pageId, 'showAxisLabels', null); + xscl = null; + xtick = null; + yscl = null; + ytick = null; + } else { + xscl = 1; + xtick = 1; + yscl = 1; + ytick = 1; + } + if ((graphData[7]||graphData[8]) === '0') { + dialog.setValueOf(pageId, 'showXYGrid', null); + xgrid = 0; + ygrid = 0; + } else { + xgrid = 1; + ygrid = 1; + } + width = graphData[9]; + dialog.setValueOf(pageId, 'resizeTo', width); + height = graphData[10]; + dialog.setValueOf(pageId, 'by', height); + updateGraphs(dialog); + } + else { + updateGraphs(dialog); + addGraph(dialog); + } + }, + commit : function(data) + { + var dialog = this.getDialog(); + var pageId = (dialog.definition.contents[0]).id; + var previewField = dialog.getContentElement(pageId,this.id); + var sscr = xmin+','+xmax+','+ymin+','+ymax+','+xscl+','+yscl+','+(xscl||yscl)+','+xgrid+','+ygrid+','+width+','+height; + var graphsField = dialog.getContentElement(pageId, 'graphs'); + for (var i = 0; i < graphsField.items.length; i++) { + sscr += ','+graphsField.getInputElement().$.options[i].getAttribute('value'); + } + picture.sscr = sscr; + data.preview = ''+previewField.getInputElement().$.innerHTML+''; + } + } + ] + } + ], + onOk: function( widget ) { + var data = {}; + this.commitContent(data); + var currentStyle = picture.attributes.style.value; + var regExpPattern = /vertical-align:\s?(\w|-)+/; + var verticalAlignValue = (regExpPattern.exec(currentStyle))[0]; + var regExpPattern = /float:\s?\w+/; + var floatValue = (regExpPattern.exec(currentStyle))[0]; + var imgElement = ''; + picture.sscr = '-7.5,7.5,-5,5,1,1,1,1,1,'+defaultwidth+','+defaultheight; + var element = CKEDITOR.dom.element.createFromHtml(imgElement); + editor.insertElement(element); + } + }; +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/asciisvg.png b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/asciisvg.png new file mode 100644 index 0000000000..3887d7dc89 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/asciisvg.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/hidpi/asciisvg.png b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/hidpi/asciisvg.png new file mode 100644 index 0000000000..3887d7dc89 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/icons/hidpi/asciisvg.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/en.js b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/en.js new file mode 100644 index 0000000000..3fe38a7e21 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/en.js @@ -0,0 +1,69 @@ +CKEDITOR.plugins.setLang( 'asciisvg', 'en', { + GraphEditor: 'Graph editor', + EquationType: 'Equation type', + YEqualsFOfX: 'y=f(x)', + REqualsFOfT: 'r=f(t)', + XEqualsFOfTCommaYEqualsGOfT: 'x=f(t),y=g(t)', + DySplitDxEqualsFOfXAndY: 'dy/dx=f(x,y)', + Label: 'Label', + FOfX: 'f(x)', + ROfT: 'r(t)', + FOfT: 'f(t)', + GOfT: 'g(t)', + DySplitDxOfXAndY: 'dy/dx(x,y)', + XSquared: 'x^2', + SinOfX: 'sin(x)', + T: 't', + SinOfT: 'sin(t)', + CosOfT: 'cos(t)', + XByY: 'x*y', + Every: 'Every', + Text: 'Text', + From: 'From', + To: 'To', + XPosition: 'X position', + YPosition: 'Y position', + Color: 'Color', + Black: 'Black', + Red: 'Red', + Orange: 'Orange', + Yellow: 'Yellow', + Green: 'Green', + Blue: 'Blue', + Purple: 'Purple', + Width: 'Width', + Line: 'Line', + Solid: 'Solid', + Dotted: 'Dotted', + Dashed: 'Dashed', + TightDash: 'Tight dash', + DashDot: 'Dash dot', + StartWith: 'Start with', + None: 'None', + Arrow: 'Arrow', + OpenDot: 'Open dot', + Dot: 'Dot', + EndWith: 'End with', + XMin: 'xmin', + XMax: 'xmax', + XScl: 'xscl', + YMin: 'ymin', + YMax: 'ymax', + YScl: 'yscl', + ShowAxisLabels: 'Show axis labels', + ShowXYGrid: 'Show XY grid', + ResizeTo: 'Resize to', + By: 'by', + Update: 'Update', + AddGraph: 'Add graph', + Graphs: 'Graphs', + YEqualsXSquared: 'y=x^2', + ReplaceSelectedGraph: 'Replace selected graph', + Remove: 'Remove', + Position: 'Position', + Top: 'Top', + Middle: 'Middle', + Bottom: 'Bottom', + FloatLeft: 'Float left', + FloatRight: 'Float right' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/es.js b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/es.js new file mode 100644 index 0000000000..96be892fa2 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/lang/es.js @@ -0,0 +1,69 @@ +CKEDITOR.plugins.setLang( 'asciisvg', 'es', { + GraphEditor: 'Editor de gráficos', + EquationType: 'Tipo de ecuación', + YEqualsFOfX: 'y=f(x)', + REqualsFOfT: 'r=f(t)', + XEqualsFOfTCommaYEqualsGOfT: 'x=f(t),y=g(t)', + DySplitDxEqualsFOfXAndY: 'dy/dx=f(x,y)', + Label: 'Etiqueta', + FOfX: 'f(x)', + ROfT: 'r(t)', + FOfT: 'f(t)', + GOfT: 'g(t)', + DySplitDxOfXAndY: 'dy/dx(x,y)', + XSquared: 'x^2', + SinOfX: 'sin(x)', + T: 't', + SinOfT: 'sin(t)', + CosOfT: 'cos(t)', + XByY: 'x*y', + Every: 'Cada', + Text: 'Texto', + From: 'De', + To: 'A', + XPosition: 'Posición en X', + YPosition: 'Posición en Y', + Color: 'Color', + Black: 'Negro', + Red: 'Rojo', + Orange: 'Naranja', + Yellow: 'Amarillo', + Green: 'Verde', + Blue: 'Azul', + Purple: 'Púrpura', + Width: 'Anchura', + Line: 'Línea', + Solid: 'Sólida', + Dotted: 'Punteada', + Dashed: 'Discontinua', + TightDash: 'Discontinua apretada', + DashDot: 'Discontinua punteada', + StartWith: 'Empezar con', + None: 'Nada', + Arrow: 'Flecha', + OpenDot: 'Punto abierto', + Dot: 'Punto', + EndWith: 'Terminar con', + XMin: 'xmin', + XMax: 'xmax', + XScl: 'xscl', + YMin: 'ymin', + YMax: 'ymax', + YScl: 'yscl', + ShowAxisLabels: 'Mostrar etiquetas ejes', + ShowXYGrid: 'Mostrar cuadrícula XY', + ResizeTo: 'Redimensionar a', + By: 'por', + Update: 'Actualizar', + AddGraph: 'Añadir gráfico', + Graphs: 'Gráficos', + YEqualsXSquared: 'y=x^2', + ReplaceSelectedGraph: 'Sustituir el gráfico seleccionado', + Remove: 'Eliminar', + Position: 'Posición', + Top: 'Superior', + Middle: 'Media', + Bottom: 'Inferior', + FloatLeft: 'Izquierda', + FloatRight: 'Derecha' +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/asciisvg/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/plugin.js new file mode 100644 index 0000000000..86f9148840 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/asciisvg/plugin.js @@ -0,0 +1,16 @@ +CKEDITOR.plugins.add('asciisvg', { + lang: 'en,es', + icons: 'asciisvg', + init: function(editor) { + $.getScript(this.path+"ASCIIsvgPI.js"); + var pluginName = 'asciisvg'; + CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/mathjax.js' ); + editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName)); + editor.ui.addButton('Asciisvg', + { + label: 'Asciisvg', + command: pluginName, + icon : this.path+'icons/'+pluginName+'.png' + }); + } +} ); diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/dialogs/audio.js b/main/inc/lib/javascript/ckeditor/plugins/audio/dialogs/audio.js new file mode 100644 index 0000000000..ca9f24b6c4 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/audio/dialogs/audio.js @@ -0,0 +1,287 @@ +CKEDITOR.dialog.add('audio', function(editor) +{ + var lang = editor.lang.audio; + + function commitValue(audioNode, extraStyles) { + var value = this.getValue(); + + if (!value && this.id == 'id') { + value = generateId(); + } + + if (this.id !== 'autoplay') { + audioNode.setAttribute(this.id, value); + + switch (this.id) { + case 'width': + audioNode.setAttribute('style', 'width:' + value + 'px;'); + break; + case 'height': + var styleAttr = audioNode.getAttribute('style'); + + audioNode.setAttribute('style', styleAttr + 'height:' + value + 'px;'); + break; + } + } else { + if (value === true) { + audioNode.setAttribute(this.id, ''); + } + } + + if (!value) { + return; + } + + switch (this.id) { + case 'width': + extraStyles.width = value + 'px'; + break; + case 'height': + extraStyles.height = value + 'px'; + break; + } + } + + function commitSrc(audioNode, extraStyles, audios) { + var match = this.id.match(/(\w+)(\d)/), + id = match[1], + number = parseInt(match[2], 10); + + var audio = audios[number] || (audios[number] = {}); + audio[id] = this.getValue(); + } + + function loadValue(audioNode) { + if (audioNode) { + this.setValue(audioNode.getAttribute(this.id)); + } else { + if (this.id == 'id') { + this.setValue(generateId()); + } + } + } + + function loadSrc(audioNode, audios) { + var match = this.id.match(/(\w+)(\d)/), + id = match[1], + number = parseInt(match[2], 10); + + var audio = audios[number]; + + if (!audio) { + return; + } + + this.setValue(audio[ id ]); + } + + function generateId() { + var now = new Date(); + return 'audio' + now.getFullYear() + now.getMonth() + now.getDate() + now.getHours() + now.getMinutes() + now.getSeconds(); + } + + return { + title: lang.dialogTitle, + minWidth: 400, + minHeight: 200, + onShow: function() { + // Clear previously saved elements. + this.fakeImage = this.audioNode = null; + + var fakeImage = this.getSelectedElement(); + + if (fakeImage && fakeImage.data('cke-real-element-type') && fakeImage.data('cke-real-element-type') == 'audio') { + this.fakeImage = fakeImage; + + var audioNode = editor.restoreRealElement(fakeImage), + audios = [], + sourceList = audioNode.getElementsByTag('source', ''); + + if (sourceList.count() == 0) { + sourceList = audioNode.getElementsByTag('source', 'cke'); + } + + for (var i = 0, length = sourceList.count(); i < length; i++) { + var item = sourceList.getItem(i); + audios.push({src: item.getAttribute('src'), type: item.getAttribute('type')}); + } + + this.audioNode = audioNode; + + this.setupContent(audioNode, audios); + } else { + this.setupContent(null, []); + } + }, + onOk: function() { + // If there's no selected element create one. Otherwise, reuse it + var audioNode = null; + + if (!this.fakeImage) { + audioNode = CKEDITOR.dom.element.createFromHtml('', editor.document); + audioNode.setAttributes({ + controls: 'controls' + }); + } else { + audioNode = this.audioNode; + } + + var extraStyles = {}, audios = []; + this.commitContent(audioNode, extraStyles, audios); + + var innerHtml = '', links = '', + link = lang.linkTemplate || '', + fallbackTemplate = lang.fallbackTemplate || ''; + + for (var i = 0; i < audios.length; i++) { + var audio = audios[i]; + + if (!audio || !audio.src) { + continue; + } + innerHtml += ''; + links += link.replace('%src%', audio.src).replace('%type%', audio.type); + } + + audioNode.setHtml(innerHtml + fallbackTemplate.replace('%links%', links)); + + // Refresh the fake image. + var newFakeImage = editor.createFakeElement(audioNode, 'cke_audio', 'audio', false); + newFakeImage.setStyles(extraStyles); + + if (this.fakeImage) { + newFakeImage.replace(this.fakeImage); + editor.getSelection().selectElement(newFakeImage); + } else { + // Insert it in a div + var div = new CKEDITOR.dom.element('DIV', editor.document); + editor.insertElement(div); + div.append(newFakeImage); + } + }, + contents: [ + { + id: 'info', + elements: [ + { + type: 'hbox', + widths: ['33%', '33%', '33%'], + children: [ + { + type: 'text', + id: 'width', + label: editor.lang.common.width, + 'default': 400, + validate: CKEDITOR.dialog.validate.notEmpty(lang.widthRequired), + commit: commitValue, + setup: loadValue + }, + { + type: 'text', + id: 'height', + label: editor.lang.common.height, + 'default': 300, + validate: CKEDITOR.dialog.validate.notEmpty(lang.heightRequired), + commit: commitValue, + setup: loadValue + }, + { + type: 'text', + id: 'id', + label: 'Id', + commit: commitValue, + setup: loadValue + } + ] + }, + { + type: 'hbox', + widths: ['', '100px', '75px'], + children: [ + { + type: 'text', + id: 'src0', + label: lang.sourceAudio, + commit: commitSrc, + setup: loadSrc + }, + { + type: 'button', + id: 'browse', + hidden: 'true', + style: 'display:inline-block;margin-top:10px;', + filebrowser: { + action: 'Browse', + target: 'info:src0', + url: editor.config.filebrowserAudioBrowseUrl || editor.config.filebrowserBrowseUrl + }, + label: editor.lang.common.browseServer + }, + { + id: 'type0', + label: lang.sourceType, + type: 'select', + 'default': 'audio/mp3', + items: [ + ['MP3', 'audio/mp3'], + ['OGG', 'audio/ogg'] + ], + commit: commitSrc, + setup: loadSrc + }] + }, + { + type: 'hbox', + widths: ['', '100px', '75px'], + children: [ + { + type: 'text', + id: 'src1', + label: lang.sourceAudio, + commit: commitSrc, + setup: loadSrc + }, + { + type: 'button', + id: 'browse', + hidden: 'true', + style: 'display:inline-block;margin-top:10px;', + filebrowser: { + action: 'Browse', + target: 'info:src1', + url: editor.config.filebrowserAudioBrowseUrl || editor.config.filebrowserBrowseUrl + }, + label: editor.lang.common.browseServer + }, + { + id: 'type1', + label: lang.sourceType, + type: 'select', + 'default': 'audio/webm', + items: [ + ['MP3', 'audio/mp3'], + ['OGG', 'audio/ogg'] + ], + commit: commitSrc, + setup: loadSrc + } + ] + }, + { + type: 'hbox', + width: ['100%'], + children: [ + { + id: 'autoplay', + type: 'checkbox', + label: lang.autoPlay, + 'default': true, + commit: commitValue + } + ] + } + ] + } + ] + }; +}); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/docs/install.html b/main/inc/lib/javascript/ckeditor/plugins/audio/docs/install.html new file mode 100644 index 0000000000..0dce4233c7 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/audio/docs/install.html @@ -0,0 +1,74 @@ + + + + +Audio plugin + + + + +

Audio Plugin for CKEditor

+ +

Introduction

+

This is a plugin to create HTML5 <audio> elements in CKEditor.

+ +

Author:

+

BeezNest Latino S.A.C

+

Version history:

+
    +
  1. 1.0: 14-November-2014. First version.
  2. +
+ +

Installation

+

1. Copying the files

+

Extract the contents of the zip in you plugins directory, so it ends up like + this
+

+
+ckeditor\
+	...
+	images\
+	lang\
+	plugins\
+		...
+		audio\
+			plugin.js
+			dialogs\
+				audio.js
+			docs\
+				install.html
+                                styles.css
+			images\
+				icon.png
+				placeholder.png
+		...
+	skins\
+	themes\
+
+

2. Adding it to CKEditor

+

Now add the plugin in your config.js or custom js configuration +file: +config.extraPlugins='audio'; +

+ +

3. Add it to your toolbar

+

In your toolbar configuration, add a new 'Audio' item in the place where you want the button to show up.

+ +

4. Configure server browser for video

+

You can use the config.filebrowserVideoBrowseUrl entry to specify a url so the file browser shows just audio elements (as long as your configure properly your file browser).

+ +

5. Use it

+

Now empty the cache of your browser and reload the editor, the new button should show up and you can add <audio> elements into the content.

+ +

Final notes

+

This plugin has been coded for CKEditor 4.4.5. It might be possible to backport it for older versions, but I don't think that it's worth the effort as sooner +or later those installs will (or should) be upgraded to the current version.

+

Please, note that only newer browsers support the Audio element, in older ones a simple text linking to the source videos is provided, you might want to +use some javascript or css to customize the final behavior of these elements.

+ + +

Disclaimers

+

CKEditor is © CKSource.com

+ + diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/docs/styles.css b/main/inc/lib/javascript/ckeditor/plugins/audio/docs/styles.css new file mode 100644 index 0000000000..a17c2c9725 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/audio/docs/styles.css @@ -0,0 +1,67 @@ +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 90%; +} +h1 { + text-align:center; + font-size:180%; +} +h2 { + border-bottom:2px solid #CCC; + margin:1em 0 0.4em 0; +} +h3 { + margin-bottom:0.4em; +} +p { + margin:0 0 1em 1em; + text-align:justify; +} +ol { + margin:0 0 1.2em 1em; + padding:0; + list-style-type:none; +} +ol li { + margin:0.2em 0; +} +pre { + font-size:100%; + font-family:"Courier New", Courier, mono; + background-color: #CCCCCC; + border:1px solid #999; + padding:0.2em 1em; + margin: 0.4em 0; + display:block; + white-space: pre; + overflow: auto; +} +code { + font-size:100%; + font-family:"Courier New", Courier, mono; + background-color: #CCCCCC; + border:1px solid #999; + padding:0.2em; + white-space: pre; +} +form { + margin:0 0 0 1em; +} +span.key { + color: #006600; +} +#install { + display:none +} +#languages ul { + display:inline; + list-style-type:none; + margin:0; + padding:0; +} +#languages li { + display:inline; + margin:0; + padding:0; + vertical-align:bottom; +} \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/images/icon.png b/main/inc/lib/javascript/ckeditor/plugins/audio/images/icon.png new file mode 100644 index 0000000000..694acf7cc4 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/audio/images/icon.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/images/placeholder.png b/main/inc/lib/javascript/ckeditor/plugins/audio/images/placeholder.png new file mode 100644 index 0000000000..d995d4f6e2 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/audio/images/placeholder.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/audio/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/audio/plugin.js new file mode 100644 index 0000000000..a18417fcc7 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/audio/plugin.js @@ -0,0 +1,185 @@ +/* + * @file Audio plugin for CKEditor - fork from the Video plugin for CKEditor + * Copyright (C) 2014 BeezNest Latino S.A.C + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + */ +(function() { + + CKEDITOR.plugins.add('audio', { + // Translations, available at the end of this file, without extra requests + lang: ['en', 'es'], + getPlaceholderCss: function() { + return 'img.cke_audio' + + '{' + + 'background-image: url(' + CKEDITOR.getUrl(this.path + 'images/placeholder.png') + ');' + + 'background-position: center center;' + + 'background-repeat: no-repeat;' + + 'background-color:gray;' + + 'border: 1px solid #a9a9a9;' + + 'width: 80px;' + + 'height: 80px;' + + '}'; + }, + onLoad: function() { + // v4 + if (CKEDITOR.addCss) + CKEDITOR.addCss(this.getPlaceholderCss()); + }, + init: function(editor) { + var lang = editor.lang.audio; + + // Check for CKEditor 3.5 + if (typeof editor.element.data == 'undefined') { + alert('The "audio" plugin requires CKEditor 3.5 or newer'); + return; + } + + CKEDITOR.dialog.add('audio', this.path + 'dialogs/audio.js'); + + editor.addCommand('Audio', new CKEDITOR.dialogCommand('audio')); + editor.ui.addButton('Audio', { + label: lang.toolbar, + command: 'Audio', + icon: this.path + 'images/icon.png' + }); + + // v3 + if (editor.addCss) { + editor.addCss(this.getPlaceholderCss()); + } + + // If the "menu" plugin is loaded, register the menu items. + if (editor.addMenuItems) { + editor.addMenuItems({ + audio: { + label: lang.properties, + command: 'Audio', + group: 'flash' + } + }); + } + + editor.on('doubleclick', function(evt) { + var element = evt.data.element; + + if (element.is('img') && element.data('cke-real-element-type') == 'audio') { + evt.data.dialog = 'audio'; + } + }); + + // If the "contextmenu" plugin is loaded, register the listeners. + if (editor.contextMenu) { + editor.contextMenu.addListener(function(element, selection) { + if (element && element.is('img') && !element.isReadOnly() + && element.data('cke-real-element-type') == 'audio') { + return {audio: CKEDITOR.TRISTATE_OFF}; + } + }); + } + + // Add special handling for these items + CKEDITOR.dtd.$empty['cke:source'] = 1; + CKEDITOR.dtd.$empty['source'] = 1; + + editor.lang.fakeobjects.audio = lang.fakeObject; + }, //Init + + afterInit: function(editor) { + var dataProcessor = editor.dataProcessor, + htmlFilter = dataProcessor && dataProcessor.htmlFilter, + dataFilter = dataProcessor && dataProcessor.dataFilter; + + // dataFilter : conversion from html input to internal data + dataFilter.addRules({ + elements: { + $: function(realElement) { + if (realElement.name == 'audio') { + realElement.name = 'cke:audio'; + + for (var i = 0; i < realElement.children.length; i++) { + if (realElement.children[ i ].name == 'source') { + realElement.children[ i ].name = 'cke:source'; + } + } + + var fakeElement = editor.createFakeParserElement(realElement, 'cke_video', 'audio', false), + fakeStyle = fakeElement.attributes.style || ''; + + var width = realElement.attributes.width, + height = realElement.attributes.height; + + if (typeof width != 'undefined') { + fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + CKEDITOR.tools.cssLength(width) + ';'; + } + + if (typeof height != 'undefined') { + fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + CKEDITOR.tools.cssLength(height) + ';'; + } + + return fakeElement; + } + } + } + + }); + + } // afterInit + + }); // plugins.add + + var en = { + toolbar: 'Audio', + dialogTitle: 'Audio properties', + fakeObject: 'Audio', + properties: 'Edit audio', + widthRequired: 'Width field cannot be empty', + heightRequired: 'Height field cannot be empty', + sourceAudio: 'Source audio', + sourceType: 'Audio type', + linkTemplate: '%type% ', + fallbackTemplate: 'Your browser doesn\'t support audio.
Please download the file: %links%', + autoPlay: 'Auto play' + }; + + var es = { + toolbar: 'Audio', + dialogTitle: 'Propiedades de audio', + fakeObject: 'Audio', + properties: 'Editar el audio', + widthRequired: 'La anchura no se puede dejar en blanco', + heightRequired: 'La altura no se puede dejar en blanco', + sourceAudio: 'Archivo de audio', + sourceType: 'Tipo', + linkTemplate: '%type% ', + fallbackTemplate: 'Su navegador no soporta AUDIO.
Por favor, descargue el fichero: %links%', + autoPlay: 'Reproducir automáticamente' + }; + + // v3 + if (CKEDITOR.skins) { + en = {audio: en}; + es = {audio: es}; + } + +// Translations + CKEDITOR.plugins.setLang('audio', 'en', en); + + CKEDITOR.plugins.setLang('audio', 'es', es); + +})(); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/dialogui/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/dialogui/plugin.js new file mode 100644 index 0000000000..414a92261c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/dialogui/plugin.js @@ -0,0 +1,1426 @@ +/** + * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @fileOverview The Dialog User Interface plugin. + */ + +CKEDITOR.plugins.add( 'dialogui', { + onLoad: function() { + + var initPrivateObject = function( elementDefinition ) { + this._ || ( this._ = {} ); + this._[ 'default' ] = this._.initValue = elementDefinition[ 'default' ] || ''; + this._.required = elementDefinition[ 'required' ] || false; + var args = [ this._ ]; + for ( var i = 1; i < arguments.length; i++ ) + args.push( arguments[ i ] ); + args.push( true ); + CKEDITOR.tools.extend.apply( CKEDITOR.tools, args ); + return this._; + }, + textBuilder = { + build: function( dialog, elementDefinition, output ) { + return new CKEDITOR.ui.dialog.textInput( dialog, elementDefinition, output ); + } + }, + commonBuilder = { + build: function( dialog, elementDefinition, output ) { + return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, elementDefinition, output ); + } + }, + containerBuilder = { + build: function( dialog, elementDefinition, output ) { + var children = elementDefinition.children, + child, + childHtmlList = [], + childObjList = []; + for ( var i = 0; + ( i < children.length && ( child = children[ i ] ) ); i++ ) { + var childHtml = []; + childHtmlList.push( childHtml ); + childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) ); + } + return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition ); + } + }, + commonPrototype = { + isChanged: function() { + return this.getValue() != this.getInitValue(); + }, + + reset: function( noChangeEvent ) { + this.setValue( this.getInitValue(), noChangeEvent ); + }, + + setInitValue: function() { + this._.initValue = this.getValue(); + }, + + resetInitValue: function() { + this._.initValue = this._[ 'default' ]; + }, + + getInitValue: function() { + return this._.initValue; + } + }, + commonEventProcessors = CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { + onChange: function( dialog, func ) { + if ( !this._.domOnChangeRegistered ) { + dialog.on( 'load', function() { + this.getInputElement().on( 'change', function() { + // Make sure 'onchange' doesn't get fired after dialog closed. (#5719) + if ( !dialog.parts.dialog.isVisible() ) + return; + + this.fire( 'change', { value: this.getValue() } ); + }, this ); + }, this ); + this._.domOnChangeRegistered = true; + } + + this.on( 'change', func ); + } + }, true ), + eventRegex = /^on([A-Z]\w+)/, + cleanInnerDefinition = function( def ) { + // An inner UI element should not have the parent's type, title or events. + for ( var i in def ) { + if ( eventRegex.test( i ) || i == 'title' || i == 'type' ) + delete def[ i ]; + } + return def; + }; + + CKEDITOR.tools.extend( CKEDITOR.ui.dialog, { + /** + * Base class for all dialog window elements with a textual label on the left. + * + * @class CKEDITOR.ui.dialog.labeledElement + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a labeledElement class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `label` (Required) The label string. + * * `labelLayout` (Optional) Put 'horizontal' here if the + * label element is to be laid out horizontally. Otherwise a vertical + * layout will be used. + * * `widths` (Optional) This applies only to horizontal + * layouts — a two-element array of lengths to specify the widths of the + * label and the content element. + * * `role` (Optional) Value for the `role` attribute. + * * `includeLabel` (Optional) If set to `true`, the `aria-labelledby` attribute + * will be included. + * + * @param {Array} htmlList The list of HTML code to output to. + * @param {Function} contentHtml + * A function returning the HTML code string to be added inside the content + * cell. + */ + labeledElement: function( dialog, elementDefinition, htmlList, contentHtml ) { + if ( arguments.length < 4 ) + return; + + var _ = initPrivateObject.call( this, elementDefinition ); + _.labelId = CKEDITOR.tools.getNextId() + '_label'; + var children = this._.children = []; + + var innerHTML = function() { + var html = [], + requiredClass = elementDefinition.required ? ' cke_required' : ''; + if ( elementDefinition.labelLayout != 'horizontal' ) { + html.push( + '', + '' ); + } else { + var hboxDefinition = { + type: 'hbox', + widths: elementDefinition.widths, + padding: 0, + children: [ + { + type: 'html', + html: '
' + }, + { + type: 'html', + html: '' + + contentHtml.call( this, dialog, elementDefinition ) + + '' + } + ] + }; + CKEDITOR.dialog._.uiElementBuilders.hbox.build( dialog, hboxDefinition, html ); + } + return html.join( '' ); + }; + var attributes = { role: elementDefinition.role || 'presentation' }; + + if ( elementDefinition.includeLabel ) + attributes[ 'aria-labelledby' ] = _.labelId; + + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, attributes, innerHTML ); + }, + + /** + * A text input with a label. This UI element class represents both the + * single-line text inputs and password inputs in dialog boxes. + * + * @class CKEDITOR.ui.dialog.textInput + * @extends CKEDITOR.ui.dialog.labeledElement + * @constructor Creates a textInput class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `default` (Optional) The default value. + * * `validate` (Optional) The validation function. + * * `maxLength` (Optional) The maximum length of text box contents. + * * `size` (Optional) The size of the text box. This is + * usually overridden by the size defined by the skin, though. + * + * @param {Array} htmlList List of HTML code to output to. + */ + textInput: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + initPrivateObject.call( this, elementDefinition ); + var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput', + attributes = { 'class': 'cke_dialog_ui_input_' + elementDefinition.type, id: domId, type: elementDefinition.type }, + i; + + // Set the validator, if any. + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + // Set the max length and size. + if ( elementDefinition.maxLength ) + attributes.maxlength = elementDefinition.maxLength; + if ( elementDefinition.size ) + attributes.size = elementDefinition.size; + + if ( elementDefinition.inputStyle ) + attributes.style = elementDefinition.inputStyle; + + // If user presses Enter in a text box, it implies clicking OK for the dialog. + var me = this, + keyPressedOnMe = false; + dialog.on( 'load', function() { + me.getInputElement().on( 'keydown', function( evt ) { + if ( evt.data.getKeystroke() == 13 ) + keyPressedOnMe = true; + } ); + + // Lower the priority this 'keyup' since 'ok' will close the dialog.(#3749) + me.getInputElement().on( 'keyup', function( evt ) { + if ( evt.data.getKeystroke() == 13 && keyPressedOnMe ) { + dialog.getButton( 'ok' ) && setTimeout( function() { + dialog.getButton( 'ok' ).click(); + }, 0 ); + keyPressedOnMe = false; + } + }, null, null, 1000 ); + } ); + + var innerHTML = function() { + // IE BUG: Text input fields in IE at 100% would exceed a or inline + // container's width, so need to wrap it inside a
. + var html = [ '' ); + return html.join( '' ); + }; + CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML ); + }, + + /** + * A text area with a label at the top or on the left. + * + * @class CKEDITOR.ui.dialog.textarea + * @extends CKEDITOR.ui.dialog.labeledElement + * @constructor Creates a textarea class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * + * The element definition. Accepted fields: + * + * * `rows` (Optional) The number of rows displayed. + * Defaults to 5 if not defined. + * * `cols` (Optional) The number of cols displayed. + * Defaults to 20 if not defined. Usually overridden by skins. + * * `default` (Optional) The default value. + * * `validate` (Optional) The validation function. + * + * @param {Array} htmlList List of HTML code to output to. + */ + textarea: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + initPrivateObject.call( this, elementDefinition ); + var me = this, + domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea', + attributes = {}; + + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + // Generates the essential attributes for the textarea tag. + attributes.rows = elementDefinition.rows || 5; + attributes.cols = elementDefinition.cols || 20; + + attributes[ 'class' ] = 'cke_dialog_ui_input_textarea ' + ( elementDefinition[ 'class' ] || '' ); + + if ( typeof elementDefinition.inputStyle != 'undefined' ) + attributes.style = elementDefinition.inputStyle; + + if ( elementDefinition.dir ) + attributes.dir = elementDefinition.dir; + + var innerHTML = function() { + attributes[ 'aria-labelledby' ] = this._.labelId; + this._.required && ( attributes[ 'aria-required' ] = this._.required ); + var html = [ '' ); + return html.join( '' ); + }; + CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML ); + }, + + /** + * A single checkbox with a label on the right. + * + * @class CKEDITOR.ui.dialog.checkbox + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a checkbox class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `checked` (Optional) Whether the checkbox is checked + * on instantiation. Defaults to `false`. + * * `validate` (Optional) The validation function. + * * `label` (Optional) The checkbox label. + * + * @param {Array} htmlList List of HTML code to output to. + */ + checkbox: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + var _ = initPrivateObject.call( this, elementDefinition, { 'default': !!elementDefinition[ 'default' ] } ); + + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + var innerHTML = function() { + var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition, { + id: elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextId() + '_checkbox' + }, true ), + html = []; + + var labelId = CKEDITOR.tools.getNextId() + '_label'; + var attributes = { 'class': 'cke_dialog_ui_checkbox_input', type: 'checkbox', 'aria-labelledby': labelId }; + cleanInnerDefinition( myDefinition ); + if ( elementDefinition[ 'default' ] ) + attributes.checked = 'checked'; + + if ( typeof myDefinition.inputStyle != 'undefined' ) + myDefinition.style = myDefinition.inputStyle; + + _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes ); + html.push( ' ' ); + return html.join( '' ); + }; + + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, innerHTML ); + }, + + /** + * A group of radio buttons. + * + * @class CKEDITOR.ui.dialog.radio + * @extends CKEDITOR.ui.dialog.labeledElement + * @constructor Creates a radio class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `default` (Required) The default value. + * * `validate` (Optional) The validation function. + * * `items` (Required) An array of options. Each option + * is a one- or two-item array of format `[ 'Description', 'Value' ]`. If `'Value'` + * is missing, then the value would be assumed to be the same as the description. + * + * @param {Array} htmlList List of HTML code to output to. + */ + radio: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + initPrivateObject.call( this, elementDefinition ); + + if ( !this._[ 'default' ] ) + this._[ 'default' ] = this._.initValue = elementDefinition.items[ 0 ][ 1 ]; + + if ( elementDefinition.validate ) + this.validate = elementDefinition.valdiate; + + var children = [], + me = this; + + var innerHTML = function() { + var inputHtmlList = [], + html = [], + commonName = ( elementDefinition.id ? elementDefinition.id : CKEDITOR.tools.getNextId() ) + '_radio'; + + for ( var i = 0; i < elementDefinition.items.length; i++ ) { + var item = elementDefinition.items[ i ], + title = item[ 2 ] !== undefined ? item[ 2 ] : item[ 0 ], + value = item[ 1 ] !== undefined ? item[ 1 ] : item[ 0 ], + inputId = CKEDITOR.tools.getNextId() + '_radio_input', + labelId = inputId + '_label', + + inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition, { + id: inputId, + title: null, + type: null + }, true ), + + labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition, { + title: title + }, true ), + + inputAttributes = { + type: 'radio', + 'class': 'cke_dialog_ui_radio_input', + name: commonName, + value: value, + 'aria-labelledby': labelId + }, + + inputHtml = []; + + if ( me._[ 'default' ] == value ) + inputAttributes.checked = 'checked'; + + cleanInnerDefinition( inputDefinition ); + cleanInnerDefinition( labelDefinition ); + + if ( typeof inputDefinition.inputStyle != 'undefined' ) + inputDefinition.style = inputDefinition.inputStyle; + + // Make inputs of radio type focusable (#10866). + inputDefinition.keyboardFocusable = true; + + children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) ); + + inputHtml.push( ' ' ); + + new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtml, 'label', null, { + id: labelId, + 'for': inputAttributes.id + }, item[ 0 ] ); + + inputHtmlList.push( inputHtml.join( '' ) ); + } + + new CKEDITOR.ui.dialog.hbox( dialog, children, inputHtmlList, html ); + + return html.join( '' ); + }; + + // Adding a role="radiogroup" to definition used for wrapper. + elementDefinition.role = 'radiogroup'; + elementDefinition.includeLabel = true; + + CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML ); + this._.children = children; + }, + + /** + * A button with a label inside. + * + * @class CKEDITOR.ui.dialog.button + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a button class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `label` (Required) The button label. + * * `disabled` (Optional) Set to `true` if you want the + * button to appear in the disabled state. + * + * @param {Array} htmlList List of HTML code to output to. + */ + button: function( dialog, elementDefinition, htmlList ) { + if ( !arguments.length ) + return; + + if ( typeof elementDefinition == 'function' ) + elementDefinition = elementDefinition( dialog.getParentEditor() ); + + initPrivateObject.call( this, elementDefinition, { disabled: elementDefinition.disabled || false } ); + + // Add OnClick event to this input. + CKEDITOR.event.implementOn( this ); + + var me = this; + + // Register an event handler for processing button clicks. + dialog.on( 'load', function( eventInfo ) { + var element = this.getElement(); + + ( function() { + element.on( 'click', function( evt ) { + me.click(); + // #9958 + evt.data.preventDefault(); + } ); + + element.on( 'keydown', function( evt ) { + if ( evt.data.getKeystroke() in { 32: 1 } ) { + me.click(); + evt.data.preventDefault(); + } + } ); + } )(); + + element.unselectable(); + }, this ); + + var outerDefinition = CKEDITOR.tools.extend( {}, elementDefinition ); + delete outerDefinition.style; + + var labelId = CKEDITOR.tools.getNextId() + '_label'; + CKEDITOR.ui.dialog.uiElement.call( this, dialog, outerDefinition, htmlList, 'a', null, { + style: elementDefinition.style, + href: 'javascript:void(0)', + title: elementDefinition.label, + hidefocus: 'true', + 'class': elementDefinition[ 'class' ], + role: 'button', + 'aria-labelledby': labelId + }, '' + + CKEDITOR.tools.htmlEncode( elementDefinition.label ) + + '' ); + }, + + /** + * A select box. + * + * @class CKEDITOR.ui.dialog.select + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a button class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `default` (Required) The default value. + * * `validate` (Optional) The validation function. + * * `items` (Required) An array of options. Each option + * is a one- or two-item array of format `[ 'Description', 'Value' ]`. If `'Value'` + * is missing, then the value would be assumed to be the same as the + * description. + * * `multiple` (Optional) Set this to `true` if you would like + * to have a multiple-choice select box. + * * `size` (Optional) The number of items to display in + * the select box. + * + * @param {Array} htmlList List of HTML code to output to. + */ + select: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + var _ = initPrivateObject.call( this, elementDefinition ); + + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + _.inputId = CKEDITOR.tools.getNextId() + '_select'; + + var innerHTML = function() { + var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition, { + id: elementDefinition.id ? elementDefinition.id + '_select' : CKEDITOR.tools.getNextId() + '_select' + }, true ), + html = [], + innerHTML = [], + attributes = { 'id': _.inputId, 'class': 'cke_dialog_ui_input_select', 'aria-labelledby': this._.labelId }; + + html.push( '' ); + + return html.join( '' ); + }; + + CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML ); + }, + + /** + * A file upload input. + * + * @class CKEDITOR.ui.dialog.file + * @extends CKEDITOR.ui.dialog.labeledElement + * @constructor Creates a file class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `validate` (Optional) The validation function. + * + * @param {Array} htmlList List of HTML code to output to. + */ + file: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + if ( elementDefinition[ 'default' ] === undefined ) + elementDefinition[ 'default' ] = ''; + + var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition: elementDefinition, buttons: [] } ); + + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + /** @ignore */ + var innerHTML = function() { + _.frameId = CKEDITOR.tools.getNextId() + '_fileInput'; + + var html = [ + '' + + '' ); + + return html.join( '' ); + }; + + // IE BUG: Parent container does not resize to contain the iframe automatically. + dialog.on( 'load', function() { + var iframe = CKEDITOR.document.getById( _.frameId ), + contentDiv = iframe.getParent(); + contentDiv.addClass( 'cke_dialog_ui_input_file' ); + } ); + + CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML ); + }, + + /** + * A button for submitting the file in a file upload input. + * + * @class CKEDITOR.ui.dialog.fileButton + * @extends CKEDITOR.ui.dialog.button + * @constructor Creates a fileButton class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `for` (Required) The file input's page and element ID + * to associate with, in a two-item array format: `[ 'page_id', 'element_id' ]`. + * * `validate` (Optional) The validation function. + * + * @param {Array} htmlList List of HTML code to output to. + */ + fileButton: function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + var _ = initPrivateObject.call( this, elementDefinition ), + me = this; + + if ( elementDefinition.validate ) + this.validate = elementDefinition.validate; + + var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition ); + var onClick = myDefinition.onClick; + myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button'; + myDefinition.onClick = function( evt ) { + var target = elementDefinition[ 'for' ]; // [ pageId, elementId ] + if ( !onClick || onClick.call( this, evt ) !== false ) { + dialog.getContentElement( target[ 0 ], target[ 1 ] ).submit(); + this.disable(); + } + }; + + dialog.on( 'load', function() { + dialog.getContentElement( elementDefinition[ 'for' ][ 0 ], elementDefinition[ 'for' ][ 1 ] )._.buttons.push( me ); + } ); + + CKEDITOR.ui.dialog.button.call( this, dialog, myDefinition, htmlList ); + }, + + html: ( function() { + var myHtmlRe = /^\s*<[\w:]+\s+([^>]*)?>/, + theirHtmlRe = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, + emptyTagRe = /\/$/; + /** + * A dialog window element made from raw HTML code. + * + * @class CKEDITOR.ui.dialog.html + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a html class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition Element definition. + * Accepted fields: + * + * * `html` (Required) HTML code of this element. + * + * @param {Array} htmlList List of HTML code to be added to the dialog's content area. + */ + return function( dialog, elementDefinition, htmlList ) { + if ( arguments.length < 3 ) + return; + + var myHtmlList = [], + myHtml, + theirHtml = elementDefinition.html, + myMatch, theirMatch; + + // If the HTML input doesn't contain any tags at the beginning, add a tag around it. + if ( theirHtml.charAt( 0 ) != '<' ) + theirHtml = '' + theirHtml + ''; + + // Look for focus function in definition. + var focus = elementDefinition.focus; + if ( focus ) { + var oldFocus = this.focus; + this.focus = function() { + ( typeof focus == 'function' ? focus : oldFocus ).call( this ); + this.fire( 'focus' ); + }; + if ( elementDefinition.isFocusable ) { + var oldIsFocusable = this.isFocusable; + this.isFocusable = oldIsFocusable; + } + this.keyboardFocusable = true; + } + + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' ); + + // Append the attributes created by the uiElement call to the real HTML. + myHtml = myHtmlList.join( '' ); + myMatch = myHtml.match( myHtmlRe ); + theirMatch = theirHtml.match( theirHtmlRe ) || [ '', '', '' ]; + + if ( emptyTagRe.test( theirMatch[ 1 ] ) ) { + theirMatch[ 1 ] = theirMatch[ 1 ].slice( 0, -1 ); + theirMatch[ 2 ] = '/' + theirMatch[ 2 ]; + } + + htmlList.push( [ theirMatch[ 1 ], ' ', myMatch[ 1 ] || '', theirMatch[ 2 ] ].join( '' ) ); + }; + } )(), + + /** + * Form fieldset for grouping dialog UI elements. + * + * @class CKEDITOR.ui.dialog.fieldset + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a fieldset class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog window object. + * @param {Array} childObjList + * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container. + * @param {Array} childHtmlList Array of HTML code that corresponds to the HTML output of all the + * objects in childObjList. + * @param {Array} htmlList Array of HTML code that this element will output to. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `label` (Optional) The legend of the this fieldset. + * * `children` (Required) An array of dialog window field definitions which will be grouped inside this fieldset. + * + */ + fieldset: function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { + var legendLabel = elementDefinition.label; + /** @ignore */ + var innerHTML = function() { + var html = []; + legendLabel && html.push( '' + legendLabel + '' ); + for ( var i = 0; i < childHtmlList.length; i++ ) + html.push( childHtmlList[ i ] ); + return html.join( '' ); + }; + + this._ = { children: childObjList }; + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'fieldset', null, null, innerHTML ); + } + + }, true ); + + CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement; + + /** @class CKEDITOR.ui.dialog.labeledElement */ + CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement, { + /** + * Sets the label text of the element. + * + * @param {String} label The new label text. + * @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element. + */ + setLabel: function( label ) { + var node = CKEDITOR.document.getById( this._.labelId ); + if ( node.getChildCount() < 1 ) + ( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node ); + else + node.getChild( 0 ).$.nodeValue = label; + return this; + }, + + /** + * Retrieves the current label text of the elment. + * + * @returns {String} The current label text. + */ + getLabel: function() { + var node = CKEDITOR.document.getById( this._.labelId ); + if ( !node || node.getChildCount() < 1 ) + return ''; + else + return node.getChild( 0 ).getText(); + }, + + /** + * Defines the `onChange` event for UI element definitions. + * @property {Object} + */ + eventProcessors: commonEventProcessors + }, true ); + + /** @class CKEDITOR.ui.dialog.button */ + CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement, { + /** + * Simulates a click to the button. + * + * @returns {Object} Return value of the `click` event. + */ + click: function() { + if ( !this._.disabled ) + return this.fire( 'click', { dialog: this._.dialog } ); + return false; + }, + + /** + * Enables the button. + */ + enable: function() { + this._.disabled = false; + var element = this.getElement(); + element && element.removeClass( 'cke_disabled' ); + }, + + /** + * Disables the button. + */ + disable: function() { + this._.disabled = true; + this.getElement().addClass( 'cke_disabled' ); + }, + + /** + * Checks whether a field is visible. + * + * @returns {Boolean} + */ + isVisible: function() { + return this.getElement().getFirst().isVisible(); + }, + + /** + * Checks whether a field is enabled. Fields can be disabled by using the + * {@link #disable} method and enabled by using the {@link #enable} method. + * + * @returns {Boolean} + */ + isEnabled: function() { + return !this._.disabled; + }, + + /** + * Defines the `onChange` event and `onClick` for button element definitions. + * + * @property {Object} + */ + eventProcessors: CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { + onClick: function( dialog, func ) { + this.on( 'click', function() { + func.apply( this, arguments ); + } ); + } + }, true ), + + /** + * Handler for the element's access key up event. Simulates a click to + * the button. + */ + accessKeyUp: function() { + this.click(); + }, + + /** + * Handler for the element's access key down event. Simulates a mouse + * down to the button. + */ + accessKeyDown: function() { + this.focus(); + }, + + keyboardFocusable: true + }, true ); + + /** @class CKEDITOR.ui.dialog.textInput */ + CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement, { + /** + * Gets the text input DOM element under this UI object. + * + * @returns {CKEDITOR.dom.element} The DOM element of the text input. + */ + getInputElement: function() { + return CKEDITOR.document.getById( this._.inputId ); + }, + + /** + * Puts focus into the text input. + */ + focus: function() { + var me = this.selectParentTab(); + + // GECKO BUG: setTimeout() is needed to workaround invisible selections. + setTimeout( function() { + var element = me.getInputElement(); + element && element.$.focus(); + }, 0 ); + }, + + /** + * Selects all the text in the text input. + */ + select: function() { + var me = this.selectParentTab(); + + // GECKO BUG: setTimeout() is needed to workaround invisible selections. + setTimeout( function() { + var e = me.getInputElement(); + if ( e ) { + e.$.focus(); + e.$.select(); + } + }, 0 ); + }, + + /** + * Handler for the text input's access key up event. Makes a `select()` + * call to the text input. + */ + accessKeyUp: function() { + this.select(); + }, + + /** + * Sets the value of this text input object. + * + * uiElement.setValue( 'Blamo' ); + * + * @param {Object} value The new value. + * @returns {CKEDITOR.ui.dialog.textInput} The current UI element. + */ + setValue: function( value ) { + !value && ( value = '' ); + return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments ); + }, + + keyboardFocusable: true + }, commonPrototype, true ); + + CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput(); + + /** @class CKEDITOR.ui.dialog.select */ + CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement, { + /** + * Gets the DOM element of the select box. + * + * @returns {CKEDITOR.dom.element} The `` element of this file input. + * + * @returns {CKEDITOR.dom.element} The file input element. + */ + getInputElement: function() { + var frameDocument = CKEDITOR.document.getById( this._.frameId ).getFrameDocument(); + return frameDocument.$.forms.length > 0 ? new CKEDITOR.dom.element( frameDocument.$.forms[ 0 ].elements[ 0 ] ) : this.getElement(); + }, + + /** + * Uploads the file in the file input. + * + * @returns {CKEDITOR.ui.dialog.file} This object. + */ + submit: function() { + this.getInputElement().getParent().$.submit(); + return this; + }, + + /** + * Gets the action assigned to the form. + * + * @returns {String} The value of the action. + */ + getAction: function() { + return this.getInputElement().getParent().$.action; + }, + + /** + * The events must be applied to the inner input element, and + * this must be done when the iframe and form have been loaded. + */ + registerEvents: function( definition ) { + var regex = /^on([A-Z]\w+)/, + match; + + var registerDomEvent = function( uiElement, dialog, eventName, func ) { + uiElement.on( 'formLoaded', function() { + uiElement.getInputElement().on( eventName, func, uiElement ); + } ); + }; + + for ( var i in definition ) { + if ( !( match = i.match( regex ) ) ) + continue; + + if ( this.eventProcessors[ i ] ) + this.eventProcessors[ i ].call( this, this._.dialog, definition[ i ] ); + else + registerDomEvent( this, this._.dialog, match[ 1 ].toLowerCase(), definition[ i ] ); + } + + return this; + }, + + /** + * Redraws the file input and resets the file path in the file input. + * The redrawing logic is necessary because non-IE browsers tend to clear + * the `' : false; + } + } + }), + //Photo + new $.fn.oembed.OEmbedProvider("deviantart", "photo", ["deviantart.com/.+", "fav.me/.+", "deviantart.com/.+"], "http://backend.deviantart.com/oembed", { format: 'jsonp' }), + new $.fn.oembed.OEmbedProvider("skitch", "photo", ["skitch.com/.+"], null, + { + yql: { + xpath: "json", + from: 'json', + url: function(externalurl) { return 'http://skitch.com/oembed/?format=json&url=' + externalurl; }, + datareturn: function(data) { return $.fn.oembed.getPhotoCode(data.json.url, data.json); } + } + }), + new $.fn.oembed.OEmbedProvider("mobypicture", "photo", ["mobypicture.com/user/.+/view/.+", "moby.to/.+"], "http://api.mobypicture.com/oEmbed"), + new $.fn.oembed.OEmbedProvider("flickr", "photo", ["flickr\\.com/photos/.+"], "http://flickr.com/services/oembed", { callbackparameter: 'jsoncallback' }), + new $.fn.oembed.OEmbedProvider("photobucket", "photo", ["photobucket\\.com/(albums|groups)/.+"], checkProtocol() + "photobucket.com/oembed/"), + new $.fn.oembed.OEmbedProvider("instagram", "photo", ["instagr\\.?am(\\.com)?/.+"], checkProtocol() + "api.instagram.com/oembed"), + //new $.fn.oembed.OEmbedProvider("yfrog", "photo", ["yfrog\\.(com|ru|com\\.tr|it|fr|co\\.il|co\\.uk|com\\.pl|pl|eu|us)/.+"], checkProtocol() + "www.yfrog.com/api/oembed",{useYQL:"json"}), + new $.fn.oembed.OEmbedProvider("SmugMug", "photo", ["smugmug.com/[-.\\w@]+/.+"], "http://api.smugmug.com/services/oembed/"), + new $.fn.oembed.OEmbedProvider("dribbble", "photo", ["dribbble.com/shots/.+"], "http://api.dribbble.com/shots/$1?callback=?", + { + templateRegex: /.*shots\/([\d]+).*/, + templateData: function(data) { + if (!data.image_teaser_url) { + return false; + } + return ''; + } + }), + new $.fn.oembed.OEmbedProvider("chart.ly", "photo", ["chart\\.ly/[a-z0-9]{6,8}"], "http://chart.ly/uploads/large_$1.png", + { templateRegex: /.*ly\/([^\/]+).*/, embedtag: { tag: 'img' }, nocache: 1 }), + //new $.fn.oembed.OEmbedProvider("stocktwits.com", "photo", ["stocktwits\\.com/message/.+"], "http://charts.stocktwits.com/production/original_$1.png?", + // { templateRegex: /.*message\/([^\/]+).*/, embedtag: { tag: 'img'},nocache:1 }), + new $.fn.oembed.OEmbedProvider("circuitlab", "photo", ["circuitlab.com/circuit/.+"], "https://www.circuitlab.com/circuit/$1/screenshot/540x405/", + { templateRegex: /.*circuit\/([^\/]+).*/, embedtag: { tag: 'img' }, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("23hq", "photo", ["23hq.com/[-.\\w@]+/photo/.+"], "http://www.23hq.com/23/oembed", { useYQL: "json" }), + new $.fn.oembed.OEmbedProvider("img.ly", "photo", ["img\\.ly/.+"], "http://img.ly/show/thumb/$1", + { + templateRegex: /.*ly\/([^\/]+).*/, + embedtag: { tag: 'img' }, + nocache: 1 + }), + new $.fn.oembed.OEmbedProvider("twitgoo.com", "photo", ["twitgoo\\.com/.+"], "http://twitgoo.com/show/thumb/$1", + { templateRegex: /.*com\/([^\/]+).*/, embedtag: { tag: 'img' }, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("imgur.com", "photo", ["imgur\\.com/gallery/.+"], checkProtocol() + "imgur.com/$1l.jpg", + { templateRegex: /.*gallery\/([^\/]+).*/, embedtag: { tag: 'img' }, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("visual.ly", "rich", ["visual\\.ly/.+"], null, + { + yql: { xpath: "//a[@id=\\'gc_article_graphic_image\\']/img", from: 'htmlstring' } + }), + new $.fn.oembed.OEmbedProvider("gravtar", "photo", ["mailto:.+"], null, + { + templateRegex: /mailto:([^\/]+).*/, + template: function(wm, email) { + return 'on Gravtar'; + } + }), + //Rich + new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"), + new $.fn.oembed.OEmbedProvider("gmep", "rich", ["gmep.imeducate.com/.*", "gmep.org/.*"], "http://gmep.org/oembed.json"), + new $.fn.oembed.OEmbedProvider("urtak", "rich", ["urtak.com/(u|clr)/.+"], "http://oembed.urtak.com/1/oembed"), + new $.fn.oembed.OEmbedProvider("cacoo", "rich", ["cacoo.com/.+"], "http://cacoo.com/oembed.json"), + new $.fn.oembed.OEmbedProvider("dailymile", "rich", ["dailymile.com/people/.*/entries/.*"], "http://api.dailymile.com/oembed"), + new $.fn.oembed.OEmbedProvider("dipity", "rich", ["dipity.com/timeline/.+"], 'http://www.dipity.com/oembed/timeline/', { useYQL: 'json' }), + new $.fn.oembed.OEmbedProvider("sketchfab", "rich", ["sketchfab.com/show/.+"], 'http://sketchfab.com/oembed', { useYQL: 'json' }), + new $.fn.oembed.OEmbedProvider("speakerdeck", "rich", ["speakerdeck.com/.+"], 'http://speakerdeck.com/oembed.json', { useYQL: 'json' }), + new $.fn.oembed.OEmbedProvider("popplet", "rich", ["popplet.com/app/.*"], "http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1", + { templateRegex: /.*#\/([^\/]+).*/, embedtag: { width: 460, height: 460 } }), + new $.fn.oembed.OEmbedProvider("pearltrees", "rich", ["pearltrees.com/.*"], "http://cdn.pearltrees.com/s/embed/getApp?", + { + templateRegex: /.*N-f=1_(\d+).*N-p=(\d+).*/, + embedtag: { + width: 460, + height: 460, + flashvars: "lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF" + } + }), + new $.fn.oembed.OEmbedProvider("prezi", "rich", ["prezi.com/.*"], "http://prezi.com/bin/preziloader.swf?", + { + templateRegex: /.*com\/([^\/]+)\/.*/, + embedtag: { + width: 550, + height: 400, + flashvars: "prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0" + } + }), + new $.fn.oembed.OEmbedProvider("tourwrist", "rich", ["tourwrist.com/tours/.+"], null, + { + templateRegex: /.*tours.([\d]+).*/, + template: function(wm, tourid) { + setTimeout(function() { + if (loadEmbeds) { + loadEmbeds(); + } + }, 2000); + return "
"; + } + }), + new $.fn.oembed.OEmbedProvider("meetup", "rich", ["meetup\\.(com|ps)/.+"], checkProtocol() + "api.meetup.com/oembed"), + new $.fn.oembed.OEmbedProvider("ebay", "rich", ["ebay\\.*"], checkProtocol() + "togo.ebay.com/togo/togo.swf?2008013100", + { + templateRegex: /.*\/([^\/]+)\/(\d{10,13}).*/, + embedtag: { + width: 355, + height: 300, + flashvars: "base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1" + } + }), + new $.fn.oembed.OEmbedProvider("wikipedia", "rich", ["wikipedia.org/wiki/.+"], "http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json§ion=0&callback=?", { + templateRegex: /.*\/\/([\w]+).*\/wiki\/([^\/]+).*/, + templateData: function(data) { + if (!data.parse) { + return false; + } + var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki'); + return ''; + } + }), + new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?", + { + templateRegex: /.*\/title\/([^\/]+).*/, + templateData: function(data) { + if (!data.Title) { + return false; + } + return '

' + data.Title + ' (' + data.Year + ')

Starring: ' + data.Actors + '

' + data.Title + '
' + data.Plot + '
'; + } + }), + new $.fn.oembed.OEmbedProvider("livejournal", "rich", ["livejournal.com/"], "http://ljpic.seacrow.com/json/$2$4?jsonp=?", { + templateRegex: /(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/, + templateData: function(data) { + return !!data.username && '
[info]' + data.username + '
' + data.name + '
'; + } + }), + new $.fn.oembed.OEmbedProvider("circuitbee", "rich", ["circuitbee\\.com/circuit/view/.+"], "http://c.circuitbee.com/build/r/schematic-embed.html?id=$1", + { + templateRegex: /.*circuit\/view\/(\d+).*/, + embedtag: { tag: 'iframe', width: '500', height: '350' } + }), + new $.fn.oembed.OEmbedProvider("googlecalendar", "rich", ["www.google.com/calendar/embed?.+"], "$1", + { + templateRegex: /(.*)/, + embedtag: { tag: 'iframe', width: '800', height: '600' } + }), + new $.fn.oembed.OEmbedProvider("jsfiddle", "rich", ["jsfiddle.net/[^/]+/?"], "http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?", + { + templateRegex: /.*net\/([^\/]+).*/, + embedtag: { tag: 'iframe', width: '100%', height: '300' } + }), + new $.fn.oembed.OEmbedProvider("jsbin", "rich", ["jsbin.com/.+"], "http://jsbin.com/$1/?", + { + templateRegex: /.*com\/([^\/]+).*/, + embedtag: { tag: 'iframe', width: '100%', height: '300' } + }), + new $.fn.oembed.OEmbedProvider("jotform", "rich", ["form.jotform.co/form/.+"], "$1?", + { + templateRegex: /(.*)/, + embedtag: { tag: 'iframe', width: '100%', height: '507' } + }), + new $.fn.oembed.OEmbedProvider("reelapp", "rich", ["reelapp\\.com/.+"], "http://www.reelapp.com/$1/embed", + { + templateRegex: /.*com\/(\S{6}).*/, + embedtag: { tag: 'iframe', width: '400', height: '338' } + }), + new $.fn.oembed.OEmbedProvider("linkedin", "rich", ["linkedin.com/pub/.+"], "https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true", + { + templateRegex: /(.*)/, + embedtag: { tag: 'iframe', width: '368px', height: 'auto' } + }), + new $.fn.oembed.OEmbedProvider("timetoast", "rich", ["timetoast.com/timelines/[0-9]+"], "http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1", + { + templateRegex: /.*timelines\/([0-9]*)/, + embedtag: { width: 550, height: 400, nocache: 1 } + }), + new $.fn.oembed.OEmbedProvider("pastebin", "rich", ["pastebin\\.com/[\\S]{8}"], "http://pastebin.com/embed_iframe.php?i=$1", + { + templateRegex: /.*\/(\S{8}).*/, + embedtag: { tag: 'iframe', width: '100%', height: 'auto' } + }), + new $.fn.oembed.OEmbedProvider("mixlr", "rich", ["mixlr.com/.+"], "http://mixlr.com/embed/$1?autoplay=ae", + { + templateRegex: /.*com\/([^\/]+).*/, + embedtag: { tag: 'iframe', width: '100%', height: 'auto' } + }), + new $.fn.oembed.OEmbedProvider("pastie", "rich", ["pastie\\.org/pastes/.+"], null, { yql: { xpath: '//pre[@class="textmate-source"]' } }), + new $.fn.oembed.OEmbedProvider("github", "rich", ["gist.github.com/.+"], "https://github.com/api/oembed"), + new $.fn.oembed.OEmbedProvider("github", "rich", ["github.com/[-.\\w@]+/[-.\\w@]+"], "https://api.github.com/repos/$1/$2?callback=?", { + templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, + templateData: function(data) { + if (!data.data.html_url) { + return false; + } + return '

' + data.data.name + '

' + data.data.description + '

' + + '

Last updated: ' + data.data.pushed_at + '

'; + } + }), + new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?", { + templateRegex: /.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/, + templateData: function(data) { + if (!data.id) { + return false; + } + var out = '
facebook '; + if (data.from) { + out += '' + data.from.name + ''; + } else if (data.link) { + out += '' + data.name + ''; + } else if (data.username) { + out += '' + data.name + ''; + } else { + out += '' + data.name + ''; + } + out += '
'; + if (data.picture) { + out += ''; + } else { + out += ''; + } + if (data.from) { + out += '' + data.name + ''; + } + if (data.founded) { + out += 'Founded: ' + data.founded + '
'; + } + if (data.category) { + out += 'Category: ' + data.category + '
'; + } + if (data.website) { + out += 'Website: ' + data.website + '
'; + } + if (data.gender) { + out += 'Gender: ' + data.gender + '
'; + } + if (data.description) { + out += data.description + '
'; + } + out += '
'; + return out; + } + }), + new $.fn.oembed.OEmbedProvider("stackoverflow", "rich", ["stackoverflow.com/questions/[\\d]+"], "http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?", { + templateRegex: /.*questions\/([\d]+).*/, + templateData: function(data) { + if (!data.questions) { + return false; + } + var q = data.questions[0]; + var body = $(q.body).text(); + var out = '
' + + '' + (q.up_vote_count - q.down_vote_count) + '
vote(s)
' + + '
' + q.answer_count + 'answer
' + q.view_count + ' view(s)
' + + '

' + q.title + '

' + + '
' + body.substring(0, 100) + '...
'; + for (i in q.tags) + out += ''; + out += '
'; + return out; + } + }), + new $.fn.oembed.OEmbedProvider("wordpress", "rich", ["wordpress\\.com/.+", "blogs\\.cnn\\.com/.+", "techcrunch\\.com/.+", "wp\\.me/.+"], "http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"), + new $.fn.oembed.OEmbedProvider("screenr", "rich", ["screenr\.com"], "http://www.screenr.com/embed/$1", + { + templateRegex: /.*\/([^\/]+).*/, + embedtag: { tag: 'iframe', width: '650', height: 396 } + }), + new $.fn.oembed.OEmbedProvider("gigpans", "rich", ["gigapan\\.org/[-.\\w@]+/\\d+"], "http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html", + { + templateRegex: /.*\/(\d+)\/?.*/, + embedtag: { tag: 'iframe', width: '100%', height: 400 } + }), + new $.fn.oembed.OEmbedProvider("scribd", "rich", ["scribd\\.com/.+"], checkProtocol() + "www.scribd.com/embeds/$1/content?start_page=1&view_mode=list", + { + templateRegex: /.*doc\/([^\/]+).*/, + embedtag: { tag: 'iframe', width: '100%', height: 600 } + }), + new $.fn.oembed.OEmbedProvider("kickstarter", "rich", ["kickstarter\\.com/projects/.+"], "$1/widget/card.html", + { + templateRegex: /([^\?]+).*/, + embedtag: { tag: 'iframe', width: '220', height: 380 } + }), + new $.fn.oembed.OEmbedProvider("amazon", "rich", ["amzn.com/B+", "amazon.com.*/(B\\S+)($|\\/.*)"], checkProtocol() + "rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr", { + apikey: true, + templateRegex: /.*\/(B[0-9A-Z]+)($|\/.*)/, + embedtag: { tag: 'iframe', width: '120px', height: '240px' } + }), + new $.fn.oembed.OEmbedProvider("slideshare", "rich", ["slideshare\.net"], checkProtocol() + "www.slideshare.net/api/oembed/2", { format: 'jsonp' }), + new $.fn.oembed.OEmbedProvider("roomsharejp", "rich", ["roomshare\\.jp/(en/)?post/.*"], "http://roomshare.jp/oembed.json"), + new $.fn.oembed.OEmbedProvider("lanyard", "rich", ["lanyrd.com/\\d+/.+"], null, + { + yql: { + xpath: '(//div[@class="primary"])[1]', + from: 'htmlstring', + datareturn: function(results) { + if (!results.result) { + return false; + } + return '
' + results.result + '
'; + } + } + }), + new $.fn.oembed.OEmbedProvider("asciiartfarts", "rich", ["asciiartfarts.com/\\d+.html"], null, + { + yql: { + xpath: '//pre/font', + from: 'htmlstring', + datareturn: function(results) { + if (!results.result) { + return false; + } + return '
' + results.result + '
'; + } + } + }), + //Use Open Graph Where applicable + new $.fn.oembed.OEmbedProvider("opengraph", "rich", [".*"], null, + { + yql: { + xpath: "//meta|//title|//link", + from: 'html', + datareturn: function(results) { + if (!results['og:title'] && results['title'] && results['description']) { + results['og:title'] = results['title']; + } + if (!results['og:title'] && !results['title']) { + return false; + } + var code = $('

'); + if (results['og:video']) { + var embed = $(''); + embed + .attr('type', results['og:video:type'] || "application/x-shockwave-flash") + .css('max-height', settings.maxHeight || 'auto') + .css('max-width', settings.maxWidth || 'auto'); + if (results['og:video:width']) { + embed.attr('width', results['og:video:width']); + } + if (results['og:video:height']) { + embed.attr('height', results['og:video:height']); + } + code.append(embed); + } else if (results['og:image']) { + var img = $(''); + img.css('max-height', settings.maxHeight || 'auto').css('max-width', settings.maxWidth || 'auto'); + if (results['og:image:width']) { + img.attr('width', results['og:image:width']); + } + if (results['og:image:height']) { + img.attr('height', results['og:image:height']); + } + code.append(img); + } + if (results['og:title']) { + code.append('' + results['og:title'] + '
'); + } + if (results['og:description']) { + code.append(results['og:description'] + '
'); + } else if (results['description']) { + code.append(results['description'] + '
'); + } + return code; + } + } + }) + ]; +})(jQuery); + +//This is needed for gravatar :( +String.prototype.md5 = function() { + var a = function(a, b) { + var c = (a & 65535) + (b & 65535); + var d = (a >> 16) + (b >> 16) + (c >> 16); + return d << 16 | c & 65535; + }; + var b = function(a, b) { return a << b | a >>> 32 - b; }; + var c = function(c, d, e, f, g, h) { return a(b(a(a(d, c), a(f, h)), g), e); }; + var d = function(a, b, d, e, f, g, h) { return c(b & d | ~b & e, a, b, f, g, h); }; + var e = function(a, b, d, e, f, g, h) { return c(b & e | d & ~e, a, b, f, g, h); }; + var f = function(a, b, d, e, f, g, h) { return c(b ^ d ^ e, a, b, f, g, h); }; + var g = function(a, b, d, e, f, g, h) { return c(d ^ (b | ~e), a, b, f, g, h); }; + var h = function(b) { + var c, h, i, j, k, l = b.length; + var m = 1732584193; + var n = -271733879; + var o = -1732584194; + var p = 271733878; + for (k = 0; k < l; k += 16) { + c = m; + h = n; + i = o; + j = p; + m = d(m, n, o, p, b[k + 0], 7, -680876936); + p = d(p, m, n, o, b[k + 1], 12, -389564586); + o = d(o, p, m, n, b[k + 2], 17, 606105819); + n = d(n, o, p, m, b[k + 3], 22, -1044525330); + m = d(m, n, o, p, b[k + 4], 7, -176418897); + p = d(p, m, n, o, b[k + 5], 12, 1200080426); + o = d(o, p, m, n, b[k + 6], 17, -1473231341); + n = d(n, o, p, m, b[k + 7], 22, -45705983); + m = d(m, n, o, p, b[k + 8], 7, 1770035416); + p = d(p, m, n, o, b[k + 9], 12, -1958414417); + o = d(o, p, m, n, b[k + 10], 17, -42063); + n = d(n, o, p, m, b[k + 11], 22, -1990404162); + m = d(m, n, o, p, b[k + 12], 7, 1804603682); + p = d(p, m, n, o, b[k + 13], 12, -40341101); + o = d(o, p, m, n, b[k + 14], 17, -1502002290); + n = d(n, o, p, m, b[k + 15], 22, 1236535329); + m = e(m, n, o, p, b[k + 1], 5, -165796510); + p = e(p, m, n, o, b[k + 6], 9, -1069501632); + o = e(o, p, m, n, b[k + 11], 14, 643717713); + n = e(n, o, p, m, b[k + 0], 20, -373897302); + m = e(m, n, o, p, b[k + 5], 5, -701558691); + p = e(p, m, n, o, b[k + 10], 9, 38016083); + o = e(o, p, m, n, b[k + 15], 14, -660478335); + n = e(n, o, p, m, b[k + 4], 20, -405537848); + m = e(m, n, o, p, b[k + 9], 5, 568446438); + p = e(p, m, n, o, b[k + 14], 9, -1019803690); + o = e(o, p, m, n, b[k + 3], 14, -187363961); + n = e(n, o, p, m, b[k + 8], 20, 1163531501); + m = e(m, n, o, p, b[k + 13], 5, -1444681467); + p = e(p, m, n, o, b[k + 2], 9, -51403784); + o = e(o, p, m, n, b[k + 7], 14, 1735328473); + n = e(n, o, p, m, b[k + 12], 20, -1926607734); + m = f(m, n, o, p, b[k + 5], 4, -378558); + p = f(p, m, n, o, b[k + 8], 11, -2022574463); + o = f(o, p, m, n, b[k + 11], 16, 1839030562); + n = f(n, o, p, m, b[k + 14], 23, -35309556); + m = f(m, n, o, p, b[k + 1], 4, -1530992060); + p = f(p, m, n, o, b[k + 4], 11, 1272893353); + o = f(o, p, m, n, b[k + 7], 16, -155497632); + n = f(n, o, p, m, b[k + 10], 23, -1094730640); + m = f(m, n, o, p, b[k + 13], 4, 681279174); + p = f(p, m, n, o, b[k + 0], 11, -358537222); + o = f(o, p, m, n, b[k + 3], 16, -722521979); + n = f(n, o, p, m, b[k + 6], 23, 76029189); + m = f(m, n, o, p, b[k + 9], 4, -640364487); + p = f(p, m, n, o, b[k + 12], 11, -421815835); + o = f(o, p, m, n, b[k + 15], 16, 530742520); + n = f(n, o, p, m, b[k + 2], 23, -995338651); + m = g(m, n, o, p, b[k + 0], 6, -198630844); + p = g(p, m, n, o, b[k + 7], 10, 1126891415); + o = g(o, p, m, n, b[k + 14], 15, -1416354905); + n = g(n, o, p, m, b[k + 5], 21, -57434055); + m = g(m, n, o, p, b[k + 12], 6, 1700485571); + p = g(p, m, n, o, b[k + 3], 10, -1894986606); + o = g(o, p, m, n, b[k + 10], 15, -1051523); + n = g(n, o, p, m, b[k + 1], 21, -2054922799); + m = g(m, n, o, p, b[k + 8], 6, 1873313359); + p = g(p, m, n, o, b[k + 15], 10, -30611744); + o = g(o, p, m, n, b[k + 6], 15, -1560198380); + n = g(n, o, p, m, b[k + 13], 21, 1309151649); + m = g(m, n, o, p, b[k + 4], 6, -145523070); + p = g(p, m, n, o, b[k + 11], 10, -1120210379); + o = g(o, p, m, n, b[k + 2], 15, 718787259); + n = g(n, o, p, m, b[k + 9], 21, -343485551); + m = a(m, c); + n = a(n, h); + o = a(o, i); + p = a(p, j); + } + return [m, n, o, p]; + }; + var i = function(a) { + var b = "0123456789abcdef", c = "", d, e = a.length * 4; + for (d = 0; d < e; d++) { + c += b.charAt(a[d >> 2] >> d % 4 * 8 + 4 & 15) + b.charAt(a[d >> 2] >> d % 4 * 8 & 15); + } + return c; + }; + var j = function(a) { + var b = (a.length + 8 >> 6) + 1; + var c = [], d, e = b * 16, f, g = a.length; + for (d = 0; d < e; d++) { + c.push(0); + } + for (f = 0; f < g; f++) { + c[f >> 2] |= (a.charCodeAt(f) & 255) << f % 4 * 8; + } + c[f >> 2] |= 128 << f % 4 * 8; + c[b * 16 - 2] = g * 8; + return c; + }; + return i(h(j(this))); +}; diff --git a/main/inc/lib/javascript/ckeditor/plugins/oembed/libs/jquery.oembed.min.js b/main/inc/lib/javascript/ckeditor/plugins/oembed/libs/jquery.oembed.min.js new file mode 100644 index 0000000000..b65c737ce5 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/oembed/libs/jquery.oembed.min.js @@ -0,0 +1,11 @@ +/*! + * jquery oembed plugin + * + * Copyright (c) 2009 Richard Chamorro + * Licensed under the MIT license + * + * Orignal Author: Richard Chamorro + * Forked by Andrew Mee to Provide a slightly diffent kind of embedding + * experience + */ +(function(n){function r(){var n=window.location.protocol;return n==="file:"?"http://":"//"}function f(n,t){return t=t?t:"",n?f(--n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(Math.random()*60))+t):t}function s(n,t){var i=n.apiendpoint,u="",r;i+=i.indexOf("?")<=0?"?":"&",i=i.replace("#","%23"),n.maxWidth!==null&&(typeof n.params.maxwidth=="undefined"||n.params.maxwidth===null)&&(n.params.maxwidth=n.maxWidth),n.maxHeight!==null&&(typeof n.params.maxheight=="undefined"||n.params.maxheight===null)&&(n.params.maxheight=n.maxHeight);for(r in n.params)r!=n.callbackparameter&&n.params[r]!==null&&(u+="&"+escape(r)+"="+n.params[r]);return i+="format="+n.format+"&url="+escape(t)+u,n.dataType!="json"&&(i+="&"+n.callbackparameter+"=?"),i}function u(i,r,u){n("#jqoembeddata").data(r,i.code),t.beforeEmbed.call(u,i),t.onEmbed.call(u,i),t.afterEmbed.call(u,i)}function e(i,e,o){var p,l,tt,a;if(n("#jqoembeddata").data(e)!=undefined&&o.embedtag.tag!="iframe")l={code:n("#jqoembeddata").data(e)},u(l,e,i);else if(o.yql){var w=o.yql.from||"htmlstring",g=o.yql.url?o.yql.url(e):e,nt="SELECT * FROM "+w+' WHERE url="'+g+'" and '+(/html/.test(w)?"xpath":"itemPath")+"='"+(o.yql.xpath||"/")+"'";w=="html"&&(nt+=" and compat='html5'"),a=n.extend({url:r()+"query.yahooapis.com/v1/public/yql",dataType:"jsonp",data:{q:nt,format:"json",env:"store://datatables.org/alltableswithkeys",callback:"?"},success:function(t){var s,f,c,r,h,l;if(o.yql.xpath&&o.yql.xpath=="//meta|//title|//link"){for(f={},t.query.results==null&&(t.query.results={meta:[]}),r=0,h=t.query.results.meta.length;rt.maxWidth&&(v=t.maxWidth/h,k=t.maxWidth,d=c*v,c=c*v,h=h*v),c>t.maxHeight&&(v=t.maxHeight/c,d=t.maxHeight,k=h*v,h=h*v),c=d,h=k}else c=t.maxHeight,h=t.maxWidth;p=n("<"+b+"/>").attr("src",y).attr("width",h).attr("height",c).attr("allowfullscreen",o.embedtag.allowfullscreen||"true").attr("allowscriptaccess",o.embedtag.allowfullscreen||"always").css("max-height",t.maxHeight||"auto").css("max-width",t.maxWidth||"auto"),b=="embed"&&p.attr("type",o.embedtag.type||"application/x-shockwave-flash").attr("flashvars",e.replace(o.templateRegex,it)),b=="iframe"&&p.attr("scrolling",o.embedtag.scrolling||"no").attr("frameborder",o.embedtag.frameborder||"0"),l={code:p},u(l,e,i)}else o.apiendpoint?(o.apikey&&(o.apiendpoint=o.apiendpoint.replace("_APIKEY_",t.apikeys[o.name])),a=n.extend({url:e.replace(o.templateRegex,o.apiendpoint),dataType:"jsonp",success:function(t){var r=n.extend({},t);r.code=o.templateData(t),u(r,e,i)},error:function(){t.onError.call(i,e,o)}},t.ajaxOptions||{}),n.ajax(a)):(l={code:e.replace(o.templateRegex,o.template)},u(l,e,i));else tt=s(o,e),a=n.extend({url:tt,dataType:o.dataType||"jsonp",success:function(t){var r=n.extend({},t);switch(r.type){case"file":case"photo":r.code=n.fn.oembed.getPhotoCode(e,r);break;case"video":case"rich":r.code=n.fn.oembed.getRichCode(e,r);break;default:r.code=n.fn.oembed.getGenericCode(e,r)}u(r,e,i)},error:function(){t.onError.call(i,e,o)}},t.ajaxOptions||{}),n.ajax(a)}function o(n){if(n===null)return null;var t,i={};for(t in n)t!==null&&(i[t.toLowerCase()]=n[t]);return i}n.fn.oembed=function(i,r,u){t=n.extend(!0,n.fn.oembed.defaults,r);var f=["0rz.tw","1link.in","1url.com","2.gp","2big.at","2tu.us","3.ly","307.to","4ms.me","4sq.com","4url.cc","6url.com","7.ly","a.gg","a.nf","aa.cx","abcurl.net","ad.vu","adf.ly","adjix.com","afx.cc","all.fuseurl.com","alturl.com","amzn.to","ar.gy","arst.ch","atu.ca","azc.cc","b23.ru","b2l.me","bacn.me","bcool.bz","binged.it","bit.ly","bizj.us","bloat.me","bravo.ly","bsa.ly","budurl.com","canurl.com","chilp.it","chzb.gr","cl.lk","cl.ly","clck.ru","cli.gs","cliccami.info","clickthru.ca","clop.in","conta.cc","cort.as","cot.ag","crks.me","ctvr.us","cutt.us","dai.ly","decenturl.com","dfl8.me","digbig.com","http://digg.com/[^/]+$","disq.us","dld.bz","dlvr.it","do.my","doiop.com","dopen.us","easyuri.com","easyurl.net","eepurl.com","eweri.com","fa.by","fav.me","fb.me","fbshare.me","ff.im","fff.to","fire.to","firsturl.de","firsturl.net","flic.kr","flq.us","fly2.ws","fon.gs","freak.to","fuseurl.com","fuzzy.to","fwd4.me","fwib.net","g.ro.lt","gizmo.do","gl.am","go.9nl.com","go.ign.com","go.usa.gov","goo.gl","goshrink.com","gurl.es","hex.io","hiderefer.com","hmm.ph","href.in","hsblinks.com","htxt.it","huff.to","hulu.com","hurl.me","hurl.ws","icanhaz.com","idek.net","ilix.in","is.gd","its.my","ix.lt","j.mp","jijr.com","kl.am","klck.me","korta.nu","krunchd.com","l9k.net","lat.ms","liip.to","liltext.com","linkbee.com","linkbun.ch","liurl.cn","ln-s.net","ln-s.ru","lnk.gd","lnk.ms","lnkd.in","lnkurl.com","lru.jp","lt.tl","lurl.no","macte.ch","mash.to","merky.de","migre.me","miniurl.com","minurl.fr","mke.me","moby.to","moourl.com","mrte.ch","myloc.me","myurl.in","n.pr","nbc.co","nblo.gs","nn.nf","not.my","notlong.com","nsfw.in","nutshellurl.com","nxy.in","nyti.ms","o-x.fr","oc1.us","om.ly","omf.gd","omoikane.net","on.cnn.com","on.mktw.net","onforb.es","orz.se","ow.ly","ping.fm","pli.gs","pnt.me","politi.co","post.ly","pp.gg","profile.to","ptiturl.com","pub.vitrue.com","qlnk.net","qte.me","qu.tc","qy.fi","r.ebay.com","r.im","rb6.me","read.bi","readthis.ca","reallytinyurl.com","redir.ec","redirects.ca","redirx.com","retwt.me","ri.ms","rickroll.it","riz.gd","rt.nu","ru.ly","rubyurl.com","rurl.org","rww.tw","s4c.in","s7y.us","safe.mn","sameurl.com","sdut.us","shar.es","shink.de","shorl.com","short.ie","short.to","shortlinks.co.uk","shorturl.com","shout.to","show.my","shrinkify.com","shrinkr.com","shrt.fr","shrt.st","shrten.com","shrunkin.com","simurl.com","slate.me","smallr.com","smsh.me","smurl.name","sn.im","snipr.com","snipurl.com","snurl.com","sp2.ro","spedr.com","srnk.net","srs.li","starturl.com","stks.co","su.pr","surl.co.uk","surl.hu","t.cn","t.co","t.lh.com","ta.gd","tbd.ly","tcrn.ch","tgr.me","tgr.ph","tighturl.com","tiniuri.com","tiny.cc","tiny.ly","tiny.pl","tinylink.in","tinyuri.ca","tinyurl.com","tk.","tl.gd","tmi.me","tnij.org","tnw.to","tny.com","to.ly","togoto.us","totc.us","toysr.us","tpm.ly","tr.im","tra.kz","trunc.it","twhub.com","twirl.at","twitclicks.com","twitterurl.net","twitterurl.org","twiturl.de","twurl.cc","twurl.nl","u.mavrev.com","u.nu","u76.org","ub0.cc","ulu.lu","updating.me","ur1.ca","url.az","url.co.uk","url.ie","url360.me","url4.eu","urlborg.com","urlbrief.com","urlcover.com","urlcut.com","urlenco.de","urli.nl","urls.im","urlshorteningservicefortwitter.com","urlx.ie","urlzen.com","usat.ly","use.my","vb.ly","vevo.ly","vgn.am","vl.am","vm.lc","w55.de","wapo.st","wapurl.co.uk","wipi.es","wp.me","x.vu","xr.com","xrl.in","xrl.us","xurl.es","xurl.jp","y.ahoo.it","yatuc.com","ye.pe","yep.it","yfrog.com","yhoo.it","yiyd.com","youtu.be","yuarel.com","z0p.de","zi.ma","zi.mu","zipmyurl.com","zud.me","zurl.ws","zz.gd","zzang.kr","›.ws","✩.ws","✿.ws","❥.ws","➔.ws","➞.ws","➡.ws","➨.ws","➯.ws","➹.ws","➽.ws"];return n("#jqoembeddata").length===0&&n('<\/span>').appendTo("body"),this.each(function(){var h=n(this),s=i&&(!i.indexOf("http://")||!i.indexOf("https://"))?i:h.attr("href"),r,c,l,a,v;if(u?t.onEmbed=u:t.onEmbed||(t.onEmbed=function(i){n.fn.oembed.insertCode(this,t.embedMethod,i)}),s!==null&&s!==undefined){for(c=0,l=f.length;c<\/div>');var f=i.parent();t.includeHandle&&n('↓<\/span>').insertBefore(i).click(function(){var t=encodeURIComponent(n(this).text());n(this).html(t=="%E2%86%91"?"↓":"↑"),n(this).parent().children().last().toggle()}),f.append("
");try{u.code.clone().appendTo(f)}catch(e){f.append(u.code)}}}},n.fn.oembed.getPhotoCode=function(n,t){var i,r=t.title?t.title:"",u;return r+=t.author_name?" - "+t.author_name:"",r+=t.provider_name?" - "+t.provider_name:"",t.url?i='

'+r+'<\/a><\/div>':t.thumbnail_url?(u=t.thumbnail_url.replace("_s","_b"),i='
'+r+'<\/a><\/div>'):i="
Error loading this picture<\/div>",t.html&&(i+="
"+t.html+"<\/div>"),i},n.fn.oembed.getRichCode=function(n,t){return t.html},n.fn.oembed.getGenericCode=function(n,t){var r=t.title!==null?t.title:n,i=''+r+"<\/a>";return t.html&&(i+="
"+t.html+"<\/div>"),i},n.fn.oembed.getOEmbedProvider=function(t){for(var r,u,f,i=0;i$/,"$1")||""}}:{from:"json",apiendpoint:this.apiendpoint,url:function(n){return this.apiendpoint+"?format=json&url="+n},datareturn:function(i){var f,o,s;if(i.json.type!="video"&&(i.json.url||i.json.thumbnail_url))return'';if(i.json.html.indexOf("iframe")){i.json.html.indexOf("allowfullscreen>")&&(i.json.html=i.json.html.replace("allowfullscreen>",'allowfullscreen="false">'));var e=n.parseHTML(i.json.html),r=e[0].width,u=e[0].height;return t.maxHeight&&t.maxWidth&&(t.useResponsiveResize?(o=r,s=u,r>t.maxWidth&&(f=t.maxWidth/r,o=t.maxWidth,s=u*f,u=u*f,r=r*f),u>t.maxHeight&&(f=t.maxHeight/u,s=t.maxHeight,o=r*f),u=s,r=o):(u=t.maxHeight,r=t.maxWidth)),e[0].width=r,e[0].height=u,e[0].outerHTML}return i.json.html||""}},this.apiendpoint=null);for(var o in e)this[o]=e[o];this.format=this.format||"json",this.callbackparameter=this.callbackparameter||"callback",this.embedtag=this.embedtag||{tag:""}},n.fn.updateOEmbedProvider=function(t,i,r,u,f){for(var o,e=0;e<\/iframe>':!1}}}),new n.fn.oembed.OEmbedProvider("deviantart","photo",["deviantart.com/.+","fav.me/.+","deviantart.com/.+"],"http://backend.deviantart.com/oembed",{format:"jsonp"}),new n.fn.oembed.OEmbedProvider("skitch","photo",["skitch.com/.+"],null,{yql:{xpath:"json",from:"json",url:function(n){return"http://skitch.com/oembed/?format=json&url="+n},datareturn:function(t){return n.fn.oembed.getPhotoCode(t.json.url,t.json)}}}),new n.fn.oembed.OEmbedProvider("mobypicture","photo",["mobypicture.com/user/.+/view/.+","moby.to/.+"],"http://api.mobypicture.com/oEmbed"),new n.fn.oembed.OEmbedProvider("flickr","photo",["flickr\\.com/photos/.+"],"http://flickr.com/services/oembed",{callbackparameter:"jsoncallback"}),new n.fn.oembed.OEmbedProvider("photobucket","photo",["photobucket\\.com/(albums|groups)/.+"],r()+"photobucket.com/oembed/"),new n.fn.oembed.OEmbedProvider("instagram","photo",["instagr\\.?am(\\.com)?/.+"],r()+"api.instagram.com/oembed"),new n.fn.oembed.OEmbedProvider("SmugMug","photo",["smugmug.com/[-.\\w@]+/.+"],"http://api.smugmug.com/services/oembed/"),new n.fn.oembed.OEmbedProvider("dribbble","photo",["dribbble.com/shots/.+"],"http://api.dribbble.com/shots/$1?callback=?",{templateRegex:/.*shots\/([\d]+).*/,templateData:function(n){return n.image_teaser_url?'':!1}}),new n.fn.oembed.OEmbedProvider("chart.ly","photo",["chart\\.ly/[a-z0-9]{6,8}"],"http://chart.ly/uploads/large_$1.png",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new n.fn.oembed.OEmbedProvider("circuitlab","photo",["circuitlab.com/circuit/.+"],"https://www.circuitlab.com/circuit/$1/screenshot/540x405/",{templateRegex:/.*circuit\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new n.fn.oembed.OEmbedProvider("23hq","photo",["23hq.com/[-.\\w@]+/photo/.+"],"http://www.23hq.com/23/oembed",{useYQL:"json"}),new n.fn.oembed.OEmbedProvider("img.ly","photo",["img\\.ly/.+"],"http://img.ly/show/thumb/$1",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new n.fn.oembed.OEmbedProvider("twitgoo.com","photo",["twitgoo\\.com/.+"],"http://twitgoo.com/show/thumb/$1",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new n.fn.oembed.OEmbedProvider("imgur.com","photo",["imgur\\.com/gallery/.+"],r()+"imgur.com/$1l.jpg",{templateRegex:/.*gallery\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new n.fn.oembed.OEmbedProvider("visual.ly","rich",["visual\\.ly/.+"],null,{yql:{xpath:"//a[@id=\\'gc_article_graphic_image\\']/img",from:"htmlstring"}}),new n.fn.oembed.OEmbedProvider("gravtar","photo",["mailto:.+"],null,{templateRegex:/mailto:([^\/]+).*/,template:function(n,t){return'on Gravtar'}}),new n.fn.oembed.OEmbedProvider("twitter","rich",["twitter.com/.+"],"https://api.twitter.com/1/statuses/oembed.json"),new n.fn.oembed.OEmbedProvider("gmep","rich",["gmep.imeducate.com/.*","gmep.org/.*"],"http://gmep.org/oembed.json"),new n.fn.oembed.OEmbedProvider("urtak","rich",["urtak.com/(u|clr)/.+"],"http://oembed.urtak.com/1/oembed"),new n.fn.oembed.OEmbedProvider("cacoo","rich",["cacoo.com/.+"],"http://cacoo.com/oembed.json"),new n.fn.oembed.OEmbedProvider("dailymile","rich",["dailymile.com/people/.*/entries/.*"],"http://api.dailymile.com/oembed"),new n.fn.oembed.OEmbedProvider("dipity","rich",["dipity.com/timeline/.+"],"http://www.dipity.com/oembed/timeline/",{useYQL:"json"}),new n.fn.oembed.OEmbedProvider("sketchfab","rich",["sketchfab.com/show/.+"],"http://sketchfab.com/oembed",{useYQL:"json"}),new n.fn.oembed.OEmbedProvider("speakerdeck","rich",["speakerdeck.com/.+"],"http://speakerdeck.com/oembed.json",{useYQL:"json"}),new n.fn.oembed.OEmbedProvider("popplet","rich",["popplet.com/app/.*"],"http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1",{templateRegex:/.*#\/([^\/]+).*/,embedtag:{width:460,height:460}}),new n.fn.oembed.OEmbedProvider("pearltrees","rich",["pearltrees.com/.*"],"http://cdn.pearltrees.com/s/embed/getApp?",{templateRegex:/.*N-f=1_(\d+).*N-p=(\d+).*/,embedtag:{width:460,height:460,flashvars:"lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF"}}),new n.fn.oembed.OEmbedProvider("prezi","rich",["prezi.com/.*"],"http://prezi.com/bin/preziloader.swf?",{templateRegex:/.*com\/([^\/]+)\/.*/,embedtag:{width:550,height:400,flashvars:"prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0"}}),new n.fn.oembed.OEmbedProvider("tourwrist","rich",["tourwrist.com/tours/.+"],null,{templateRegex:/.*tours.([\d]+).*/,template:function(n,t){return setTimeout(function(){loadEmbeds&&loadEmbeds()},2e3),"
<\/div> + + + +

+ CKEditor Samples » Toolbar Configuration +

+
+

+ This sample page demonstrates editor with loaded full toolbar (all registered buttons) and, if + current editor's configuration modifies default settings, also editor with modified toolbar. +

+ +

Since CKEditor 4 there are two ways to configure toolbar buttons.

+ +

By config.toolbar

+ +

+ You can explicitly define which buttons are displayed in which groups and in which order. + This is the more precise setting, but less flexible. If newly added plugin adds its + own button you'll have to add it manually to your config.toolbar setting as well. +

+ +

To add a CKEditor instance with custom toolbar setting, insert the following JavaScript call to your code:

+ +
+CKEDITOR.replace( 'textarea_id', {
+	toolbar: [
+		{ name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] },	// Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
+		[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],			// Defines toolbar group without name.
+		'/',																					// Line break - next group will be placed in new line.
+		{ name: 'basicstyles', items: [ 'Bold', 'Italic' ] }
+	]
+});
+ +

By config.toolbarGroups

+ +

+ You can define which groups of buttons (like e.g. basicstyles, clipboard + and forms) are displayed and in which order. Registered buttons are associated + with toolbar groups by toolbar property in their definition. + This setting's advantage is that you don't have to modify toolbar configuration + when adding/removing plugins which register their own buttons. +

+ +

To add a CKEditor instance with custom toolbar groups setting, insert the following JavaScript call to your code:

+ +
+CKEDITOR.replace( 'textarea_id', {
+	toolbarGroups: [
+		{ name: 'document',	   groups: [ 'mode', 'document' ] },			// Displays document group with its two subgroups.
+ 		{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },			// Group's name will be used to create voice label.
+ 		'/',																// Line break - next group will be placed in new line.
+ 		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+ 		{ name: 'links' }
+	]
+
+	// NOTE: Remember to leave 'toolbar' property with the default value (null).
+});
+
+ + + +
+

Full toolbar configuration

+

Below you can see editor with full toolbar, generated automatically by the editor.

+

+ Note: To create editor instance with full toolbar you don't have to set anything. + Just leave toolbar and toolbarGroups with the default, null values. +

+ +

+	
+ + + + + + diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/hidpi/toolbarswitch.png b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/hidpi/toolbarswitch.png new file mode 100644 index 0000000000..1d1ed4559d Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/hidpi/toolbarswitch.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/toolbarswitch.png b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/toolbarswitch.png new file mode 100644 index 0000000000..db01908b8a Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/icons/toolbarswitch.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/af.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/af.js new file mode 100644 index 0000000000..45e7e96e54 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/af.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'af', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ar.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ar.js new file mode 100644 index 0000000000..22198f5af9 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ar.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ar', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bg.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bg.js new file mode 100644 index 0000000000..59252cdf21 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bg.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'bg', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bn.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bn.js new file mode 100644 index 0000000000..d0e90852d5 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bn.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'bn', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bs.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bs.js new file mode 100644 index 0000000000..0e4ccc8a5e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/bs.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'bs', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ca.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ca.js new file mode 100644 index 0000000000..583ecfa75d --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ca.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ca', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cs.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cs.js new file mode 100644 index 0000000000..d1c9196fc9 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cs.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'cs', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cy.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cy.js new file mode 100644 index 0000000000..26106f9c9e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/cy.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'cy', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/da.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/da.js new file mode 100644 index 0000000000..119caa0ad8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/da.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'da', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/de.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/de.js new file mode 100644 index 0000000000..d5ea577f33 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/de.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'de', { + toolbarswitch: 'Symbolleiste ändern' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/el.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/el.js new file mode 100644 index 0000000000..3e8fa3f19c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/el.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'el', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-au.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-au.js new file mode 100644 index 0000000000..1e00918583 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-au.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'en-au', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-ca.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-ca.js new file mode 100644 index 0000000000..e68c705636 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-ca.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'en-ca', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-gb.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-gb.js new file mode 100644 index 0000000000..d51642164e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en-gb.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'en-gb', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en.js new file mode 100644 index 0000000000..ca4da40c0e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/en.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'en', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eo.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eo.js new file mode 100644 index 0000000000..c79c2004f2 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eo.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'eo', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/es.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/es.js new file mode 100644 index 0000000000..aaf9f2e33f --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/es.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'es', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/et.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/et.js new file mode 100644 index 0000000000..4331936c31 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/et.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'et', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eu.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eu.js new file mode 100644 index 0000000000..7178decac5 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/eu.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'eu', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fa.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fa.js new file mode 100644 index 0000000000..722dba6e4d --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fa.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'fa', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fi.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fi.js new file mode 100644 index 0000000000..1aeb954e55 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fi.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'fi', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fo.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fo.js new file mode 100644 index 0000000000..bd69136b86 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fo.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'fo', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr-ca.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr-ca.js new file mode 100644 index 0000000000..3c41d49ff1 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr-ca.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'fr', { + toolbarswitch: 'Toolbar commutateur' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr.js new file mode 100644 index 0000000000..3c41d49ff1 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/fr.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'fr', { + toolbarswitch: 'Toolbar commutateur' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gl.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gl.js new file mode 100644 index 0000000000..ad2248b7eb --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gl.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'gl', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gu.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gu.js new file mode 100644 index 0000000000..4434a099f8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/gu.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'gu', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/he.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/he.js new file mode 100644 index 0000000000..fc2b52f1d8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/he.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'he', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hi.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hi.js new file mode 100644 index 0000000000..9644c45aaa --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hi.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'hi', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hr.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hr.js new file mode 100644 index 0000000000..6a4775fa72 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hr.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'hr', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hu.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hu.js new file mode 100644 index 0000000000..e0fa0a7de2 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/hu.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'hu', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/id.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/id.js new file mode 100644 index 0000000000..20c924d56a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/id.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'id', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/is.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/is.js new file mode 100644 index 0000000000..0f26407ae0 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/is.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'is', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/it.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/it.js new file mode 100644 index 0000000000..096e524186 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/it.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'it', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ja.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ja.js new file mode 100644 index 0000000000..697b8793d8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ja.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ja', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ka.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ka.js new file mode 100644 index 0000000000..f8ad5832b3 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ka.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ka', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/km.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/km.js new file mode 100644 index 0000000000..5015b30154 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/km.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'km', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ko.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ko.js new file mode 100644 index 0000000000..830b72aad3 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ko.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ko', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ku.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ku.js new file mode 100644 index 0000000000..7cb4a96dc0 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ku.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ku', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lt.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lt.js new file mode 100644 index 0000000000..5be3429b2e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lt.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'lt', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lv.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lv.js new file mode 100644 index 0000000000..d1e48fc440 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/lv.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'lv', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mk.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mk.js new file mode 100644 index 0000000000..578f79f63c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mk.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'mk', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mn.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mn.js new file mode 100644 index 0000000000..b10818abaf --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/mn.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'mn', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ms.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ms.js new file mode 100644 index 0000000000..0f4008c147 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ms.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ms', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nb.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nb.js new file mode 100644 index 0000000000..73666eceec --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nb.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'nb', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nl.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nl.js new file mode 100644 index 0000000000..aceb5af8ca --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/nl.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'nl', { + toolbarswitch: 'Toolbar verwisselen' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/no.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/no.js new file mode 100644 index 0000000000..c916d4d080 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/no.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'no', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pl.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pl.js new file mode 100644 index 0000000000..293e4144ae --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pl.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'pl', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt-br.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt-br.js new file mode 100644 index 0000000000..92754f6b34 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt-br.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'pt-br', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt.js new file mode 100644 index 0000000000..65f48ffa44 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/pt.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'pt', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ro.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ro.js new file mode 100644 index 0000000000..4c1758341a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ro.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ro', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ru.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ru.js new file mode 100644 index 0000000000..ad397a36fb --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ru.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ru', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/si.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/si.js new file mode 100644 index 0000000000..3e79d3ba39 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/si.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'si', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sk.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sk.js new file mode 100644 index 0000000000..f96b243bdb --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sk.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sk', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sl.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sl.js new file mode 100644 index 0000000000..b1c59d366b --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sl.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sl', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sq.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sq.js new file mode 100644 index 0000000000..f053a4850d --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sq.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sq', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr-latn.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr-latn.js new file mode 100644 index 0000000000..d3b62d039f --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr-latn.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sr-latn', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr.js new file mode 100644 index 0000000000..1f0666f6f1 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sr.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sr', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sv.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sv.js new file mode 100644 index 0000000000..a994f04bec --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/sv.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'sv', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/th.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/th.js new file mode 100644 index 0000000000..9ff5bad62c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/th.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'th', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/tr.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/tr.js new file mode 100644 index 0000000000..6a2dbaa995 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/tr.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'tr', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ug.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ug.js new file mode 100644 index 0000000000..94e4b3da3a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/ug.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'ug', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/uk.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/uk.js new file mode 100644 index 0000000000..c5e066bb2b --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/uk.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'uk', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/vi.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/vi.js new file mode 100644 index 0000000000..13ac9ce510 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/vi.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'vi', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh-cn.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh-cn.js new file mode 100644 index 0000000000..29e749c5ee --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh-cn.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'zh-cn', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh.js new file mode 100644 index 0000000000..da6ce39bd8 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/lang/zh.js @@ -0,0 +1,7 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'toolbarswitch', 'zh', { + toolbarswitch: 'Switch toolbar' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/plugin.js new file mode 100644 index 0000000000..456ea9a5f9 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/toolbarswitch/plugin.js @@ -0,0 +1,112 @@ +/** + * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.html or http://ckeditor.com/license + */ + +/** + * @fileOverview Plugin that changes the toolbar and maximizes the editor + * for the big toolbar. + * + * You need a custom config to define the small and big toolbars. + * Also the maximize plug-in is needed but not the maximize button. + * For this plugin you should use the 'Toolbarswitch' button instead. + * + * CKEDITOR.replace('sometextcomponentname', { + * customConfig: '/...custom_ckeditor_config.js' + * toolbar: 'yoursmalltoolbarname', + * smallToolbar: 'yoursmalltoolbarname', + * maximizedToolbar: 'yourbigtoolbarname' }); + * + * Requires: + * - Maximize plugin. But not the button that goes with it. + * - All toolbars used in the ckeditor instance have to use the 'Toolbarswitch' button instead. + * - A custom config to define the small and big toolbars. + * - function CKeditor_OnComplete(ckEditorInstance){ ... your own custom code or leave empty... } + * This was added to the plugin for those that wrap the ckeditor in other java script to shield + * the rest of their code from ckeditor version particularities. + * - jQuery + */ + + +function switchMe(editor, callback) { + + var origCustomConfig = editor.config.customConfig; + var origContentCss = editor.config.contentsCss; + var origExtraPlugins = editor.config.extraPlugins; + + var origToolbar = editor.config.toolbar; + var origSmallToolbar = editor.config.smallToolbar; + var origMaximizedToolbar = editor.config.maximizedToolbar; + var newToolbar; + if (origToolbar == origSmallToolbar) { + newToolbar = origMaximizedToolbar; + } else { + newToolbar = origSmallToolbar; + } + + // Copy data to original text element before getting rid of the old editor + var data = editor.getData(); + var domTextElement = editor.element.$; + jQuery(domTextElement).val(data); + + // Remove old editor and the DOM elements, else you get two editors + var id = domTextElement.id; + editor.destroy(true); + + CKEDITOR.replace(id, { + customConfig : origCustomConfig, + contentsCss : origContentCss, + toolbar : newToolbar, + smallToolbar: origSmallToolbar, + maximizedToolbar: origMaximizedToolbar, + extraPlugins : origExtraPlugins, + on: { + instanceReady: function(e) { + CKeditor_OnComplete(e.editor); + if (callback) { + callback.call(null, e); + } + } + } + }); +} + +CKEDITOR.plugins.add('toolbarswitch', { + requires: [ 'button', 'toolbar', 'maximize' ], + 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: 'toolbarswitch', // %REMOVE_LINE_CORE% + hidpi: true, // %REMOVE_LINE_CORE% + init: function (editor) { + var lang = editor.lang; + var commandFunction = { + exec: function( editor ) { + if ( editor.config.toolbar == editor.config.maximizedToolbar ) { + // For switching to the small toolbar first minimize + editor.commands.maximize.exec(); + switchMe(editor, function(e){ + var newEditor = e.editor; + newEditor.fire('triggerResize'); + }); + } else { + switchMe(editor, function(e){ + var newEditor = e.editor; + newEditor.commands.maximize.exec(); + newEditor.fire('triggerResize'); + }); + } + } + } + + var command = editor.addCommand( 'toolbarswitch', commandFunction ); + command.modes = { wysiwyg:1,source:1 }; + command.canUndo = false; + command.readOnly = 1; + + editor.ui.addButton && editor.ui.addButton( 'Toolbarswitch', { + label: lang.toolbarswitch.toolbarswitch, + command: 'toolbarswitch', + toolbar: 'tools,10' + }); + } +}); + diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/dialogs/video.js b/main/inc/lib/javascript/ckeditor/plugins/video/dialogs/video.js new file mode 100644 index 0000000000..df06bfbd9c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/video/dialogs/video.js @@ -0,0 +1,350 @@ +CKEDITOR.dialog.add( 'video', function ( editor ) +{ + var lang = editor.lang.video; + + function commitValue( videoNode, extraStyles ) + { + var value=this.getValue(); + + if ( !value && this.id=='id' ) + value = generateId(); + + videoNode.setAttribute( this.id, value); + + if ( !value ) + return; + switch( this.id ) + { + case 'poster': + extraStyles.backgroundImage = 'url(' + value + ')'; + break; + case 'width': + extraStyles.width = value + 'px'; + break; + case 'height': + extraStyles.height = value + 'px'; + break; + } + } + + function commitSrc( videoNode, extraStyles, videos ) + { + var match = this.id.match(/(\w+)(\d)/), + id = match[1], + number = parseInt(match[2], 10); + + var video = videos[number] || (videos[number]={}); + video[id] = this.getValue(); + } + + function loadValue( videoNode ) + { + if ( videoNode ) + this.setValue( videoNode.getAttribute( this.id ) ); + else + { + if ( this.id == 'id') + this.setValue( generateId() ); + } + } + + function loadSrc( videoNode, videos ) + { + var match = this.id.match(/(\w+)(\d)/), + id = match[1], + number = parseInt(match[2], 10); + + var video = videos[number]; + if (!video) + return; + this.setValue( video[ id ] ); + } + + function generateId() + { + var now = new Date(); + return 'video' + now.getFullYear() + now.getMonth() + now.getDate() + now.getHours() + now.getMinutes() + now.getSeconds(); + } + + // To automatically get the dimensions of the poster image + var onImgLoadEvent = function() + { + // Image is ready. + var preview = this.previewImage; + preview.removeListener( 'load', onImgLoadEvent ); + preview.removeListener( 'error', onImgLoadErrorEvent ); + preview.removeListener( 'abort', onImgLoadErrorEvent ); + + this.setValueOf( 'info', 'width', preview.$.width ); + this.setValueOf( 'info', 'height', preview.$.height ); + }; + + var onImgLoadErrorEvent = function() + { + // Error. Image is not loaded. + var preview = this.previewImage; + preview.removeListener( 'load', onImgLoadEvent ); + preview.removeListener( 'error', onImgLoadErrorEvent ); + preview.removeListener( 'abort', onImgLoadErrorEvent ); + }; + + return { + title : lang.dialogTitle, + minWidth : 400, + minHeight : 200, + + onShow : function() + { + // Clear previously saved elements. + this.fakeImage = this.videoNode = null; + // To get dimensions of poster image + this.previewImage = editor.document.createElement( 'img' ); + + var fakeImage = this.getSelectedElement(); + if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'video' ) + { + this.fakeImage = fakeImage; + + var videoNode = editor.restoreRealElement( fakeImage ), + videos = [], + sourceList = videoNode.getElementsByTag( 'source', '' ); + if (sourceList.count()==0) + sourceList = videoNode.getElementsByTag( 'source', 'cke' ); + + for ( var i = 0, length = sourceList.count() ; i < length ; i++ ) + { + var item = sourceList.getItem( i ); + videos.push( {src : item.getAttribute( 'src' ), type: item.getAttribute( 'type' )} ); + } + + this.videoNode = videoNode; + + this.setupContent( videoNode, videos ); + } + else + this.setupContent( null, [] ); + }, + + onOk : function() + { + // If there's no selected element create one. Otherwise, reuse it + var videoNode = null; + if ( !this.fakeImage ) + { + videoNode = CKEDITOR.dom.element.createFromHtml( '', editor.document ); + videoNode.setAttributes( + { + controls : 'controls' + } ); + } + else + { + videoNode = this.videoNode; + } + + var extraStyles = {}, videos = []; + this.commitContent( videoNode, extraStyles, videos ); + + var innerHtml = '', links = '', + link = lang.linkTemplate || '', + fallbackTemplate = lang.fallbackTemplate || ''; + for(var i=0; i'; + links += link.replace('%src%', video.src).replace('%type%', video.type); + } + videoNode.setHtml( innerHtml + fallbackTemplate.replace( '%links%', links ) ); + + // Refresh the fake image. + var newFakeImage = editor.createFakeElement( videoNode, 'cke_video', 'video', false ); + newFakeImage.setStyles( extraStyles ); + if ( this.fakeImage ) + { + newFakeImage.replace( this.fakeImage ); + editor.getSelection().selectElement( newFakeImage ); + } + else + { + // Insert it in a div + var div = new CKEDITOR.dom.element( 'DIV', editor.document ); + editor.insertElement( div ); + div.append( newFakeImage ); + } + }, + onHide : function() + { + if ( this.previewImage ) + { + this.previewImage.removeListener( 'load', onImgLoadEvent ); + this.previewImage.removeListener( 'error', onImgLoadErrorEvent ); + this.previewImage.removeListener( 'abort', onImgLoadErrorEvent ); + this.previewImage.remove(); + this.previewImage = null; // Dialog is closed. + } + }, + + contents : + [ + { + id : 'info', + elements : + [ + { + type : 'hbox', + widths: [ '', '100px'], + children : [ + { + type : 'text', + id : 'poster', + label : lang.poster, + commit : commitValue, + setup : loadValue, + onChange : function() + { + var dialog = this.getDialog(), + newUrl = this.getValue(); + + //Update preview image + if ( newUrl.length > 0 ) //Prevent from load before onShow + { + dialog = this.getDialog(); + var preview = dialog.previewImage; + + preview.on( 'load', onImgLoadEvent, dialog ); + preview.on( 'error', onImgLoadErrorEvent, dialog ); + preview.on( 'abort', onImgLoadErrorEvent, dialog ); + preview.setAttribute( 'src', newUrl ); + } + } + }, + { + type : 'button', + id : 'browse', + hidden : 'true', + style : 'display:inline-block;margin-top:10px;', + filebrowser : + { + action : 'Browse', + target: 'info:poster', + url: editor.config.filebrowserImageBrowseUrl || editor.config.filebrowserBrowseUrl + }, + label : editor.lang.common.browseServer + }] + }, + { + type : 'hbox', + widths: [ '33%', '33%', '33%'], + children : [ + { + type : 'text', + id : 'width', + label : editor.lang.common.width, + 'default' : 400, + validate : CKEDITOR.dialog.validate.notEmpty( lang.widthRequired ), + commit : commitValue, + setup : loadValue + }, + { + type : 'text', + id : 'height', + label : editor.lang.common.height, + 'default' : 300, + validate : CKEDITOR.dialog.validate.notEmpty(lang.heightRequired ), + commit : commitValue, + setup : loadValue + }, + { + type : 'text', + id : 'id', + label : 'Id', + commit : commitValue, + setup : loadValue + } + ] + }, + { + type : 'hbox', + widths: [ '', '100px', '75px'], + children : [ + { + type : 'text', + id : 'src0', + label : lang.sourceVideo, + commit : commitSrc, + setup : loadSrc + }, + { + type : 'button', + id : 'browse', + hidden : 'true', + style : 'display:inline-block;margin-top:10px;', + filebrowser : + { + action : 'Browse', + target: 'info:src0', + url: editor.config.filebrowserVideoBrowseUrl || editor.config.filebrowserBrowseUrl + }, + label : editor.lang.common.browseServer + }, + { + id : 'type0', + label : lang.sourceType, + type : 'select', + 'default' : 'video/mp4', + items : + [ + [ 'MP4', 'video/mp4' ], + [ 'WebM', 'video/webm' ] + ], + commit : commitSrc, + setup : loadSrc + }] + }, + + { + type : 'hbox', + widths: [ '', '100px', '75px'], + children : [ + { + type : 'text', + id : 'src1', + label : lang.sourceVideo, + commit : commitSrc, + setup : loadSrc + }, + { + type : 'button', + id : 'browse', + hidden : 'true', + style : 'display:inline-block;margin-top:10px;', + filebrowser : + { + action : 'Browse', + target: 'info:src1', + url: editor.config.filebrowserVideoBrowseUrl || editor.config.filebrowserBrowseUrl + }, + label : editor.lang.common.browseServer + }, + { + id : 'type1', + label : lang.sourceType, + type : 'select', + 'default':'video/webm', + items : + [ + [ 'MP4', 'video/mp4' ], + [ 'WebM', 'video/webm' ] + ], + commit : commitSrc, + setup : loadSrc + }] + } + ] + } + + ] + }; +} ); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/docs/install.html b/main/inc/lib/javascript/ckeditor/plugins/video/docs/install.html new file mode 100644 index 0000000000..e60502efe3 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/video/docs/install.html @@ -0,0 +1,79 @@ + + + + +Video plugin + + + + +

Video Plugin for CKEditor

+ +

Introduction

+

This is a plugin to create HTML5 <video> elements in CKEditor.

+ +

Author:

+

Alfonso Martínez de Lizarrondo

+

Sponsored by:

+

DM logic

+

Version history:

+
    +
  1. 1.0: 19-January-2011. First version.
  2. +
  3. 1.1: 21-January-2011. Several bug fixes. Detect poster image dimensions. Complete localization.
  4. +
  5. 1.2: 24-January-2011. Better dialog layout, specific filebrowserVideoBrowseUrl entry.
  6. +
+

Check for latest version and other CKEditor plugins

+ +

Installation

+

1. Copying the files

+

Extract the contents of the zip in you plugins directory, so it ends up like + this
+ +

+
+ckeditor\
+	...
+	images\
+	lang\
+	plugins\
+		...
+		video\
+			plugin.js
+			dialogs\
+				video.js
+			docs\
+				install.html
+			images\
+				icon.png
+				placeholder.png
+		...
+	skins\
+	themes\
+
+

2. Adding it to CKEditor

+

Now add the plugin in your config.js or custom js configuration +file: +config.extraPlugins='video'; +

+ +

3. Add it to your toolbar

+

In your toolbar configuration, add a new 'Video' item in the place where you want the button to show up.

+ +

4. Configure server browser for video

+

You can use the config.filebrowserVideoBrowseUrl entry to specify a url so the file browser shows just video elements (as long as your configure properly your file browser).

+ +

5. Use it

+

Now empty the cache of your browser and reload the editor, the new button should show up and you can add <video> elements into the content. Here's a short video of the plugin in action.

+ +

Final notes

+

This plugin has been coded for CKEditor 3.5. It might be possible to backport it for older versions, but I don't think that it's worth the effort as sooner +or later those installs will (or should) be upgraded to the current version.

+

Please, note that only newer browsers support the Video element, in older ones a simple text linking to the source videos is provided, you might want to +use some javascript or css to customize the final behavior of these elements.

+ + +

Disclaimers

+

CKEditor is © CKSource.com

+ + diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/docs/styles.css b/main/inc/lib/javascript/ckeditor/plugins/video/docs/styles.css new file mode 100644 index 0000000000..a17c2c9725 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/video/docs/styles.css @@ -0,0 +1,67 @@ +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 90%; +} +h1 { + text-align:center; + font-size:180%; +} +h2 { + border-bottom:2px solid #CCC; + margin:1em 0 0.4em 0; +} +h3 { + margin-bottom:0.4em; +} +p { + margin:0 0 1em 1em; + text-align:justify; +} +ol { + margin:0 0 1.2em 1em; + padding:0; + list-style-type:none; +} +ol li { + margin:0.2em 0; +} +pre { + font-size:100%; + font-family:"Courier New", Courier, mono; + background-color: #CCCCCC; + border:1px solid #999; + padding:0.2em 1em; + margin: 0.4em 0; + display:block; + white-space: pre; + overflow: auto; +} +code { + font-size:100%; + font-family:"Courier New", Courier, mono; + background-color: #CCCCCC; + border:1px solid #999; + padding:0.2em; + white-space: pre; +} +form { + margin:0 0 0 1em; +} +span.key { + color: #006600; +} +#install { + display:none +} +#languages ul { + display:inline; + list-style-type:none; + margin:0; + padding:0; +} +#languages li { + display:inline; + margin:0; + padding:0; + vertical-align:bottom; +} \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/images/icon.png b/main/inc/lib/javascript/ckeditor/plugins/video/images/icon.png new file mode 100644 index 0000000000..d59bd6de46 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/video/images/icon.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/images/placeholder.png b/main/inc/lib/javascript/ckeditor/plugins/video/images/placeholder.png new file mode 100644 index 0000000000..767b51acac Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/video/images/placeholder.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/video/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/video/plugin.js new file mode 100644 index 0000000000..09fca62cdb --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/video/plugin.js @@ -0,0 +1,211 @@ +/* + * @file Video plugin for CKEditor + * Copyright (C) 2011 Alfonso Martínez de Lizarrondo + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + */ + +( function() { + +CKEDITOR.plugins.add( 'video', +{ + // Translations, available at the end of this file, without extra requests + lang : [ 'en', 'es' ], + + getPlaceholderCss : function() + { + return 'img.cke_video' + + '{' + + 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/placeholder.png' ) + ');' + + 'background-position: center center;' + + 'background-repeat: no-repeat;' + + 'background-color:gray;'+ + 'border: 1px solid #a9a9a9;' + + 'width: 80px;' + + 'height: 80px;' + + '}'; + }, + + onLoad : function() + { + // v4 + if (CKEDITOR.addCss) + CKEDITOR.addCss( this.getPlaceholderCss() ); + + }, + + init : function( editor ) + { + var lang = editor.lang.video; + + // Check for CKEditor 3.5 + if (typeof editor.element.data == 'undefined') + { + alert('The "video" plugin requires CKEditor 3.5 or newer'); + return; + } + + CKEDITOR.dialog.add( 'video', this.path + 'dialogs/video.js' ); + + editor.addCommand( 'Video', new CKEDITOR.dialogCommand( 'video' ) ); + editor.ui.addButton( 'Video', + { + label : lang.toolbar, + command : 'Video', + icon : this.path + 'images/icon.png' + } ); + + // v3 + if (editor.addCss) + editor.addCss( this.getPlaceholderCss() ); + + + // If the "menu" plugin is loaded, register the menu items. + if ( editor.addMenuItems ) + { + editor.addMenuItems( + { + video : + { + label : lang.properties, + command : 'Video', + group : 'flash' + } + }); + } + + editor.on( 'doubleclick', function( evt ) + { + var element = evt.data.element; + + if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'video' ) + evt.data.dialog = 'video'; + }); + + // If the "contextmenu" plugin is loaded, register the listeners. + if ( editor.contextMenu ) + { + editor.contextMenu.addListener( function( element, selection ) + { + if ( element && element.is( 'img' ) && !element.isReadOnly() + && element.data( 'cke-real-element-type' ) == 'video' ) + return { video : CKEDITOR.TRISTATE_OFF }; + }); + } + + // Add special handling for these items + CKEDITOR.dtd.$empty['cke:source']=1; + CKEDITOR.dtd.$empty['source']=1; + + editor.lang.fakeobjects.video = lang.fakeObject; + + + }, //Init + + afterInit: function( editor ) + { + var dataProcessor = editor.dataProcessor, + htmlFilter = dataProcessor && dataProcessor.htmlFilter, + dataFilter = dataProcessor && dataProcessor.dataFilter; + + // dataFilter : conversion from html input to internal data + dataFilter.addRules( + { + + elements : { + $ : function( realElement ) + { + if ( realElement.name == 'video' ) + { + realElement.name = 'cke:video'; + for( var i=0; i < realElement.children.length; i++) + { + if ( realElement.children[ i ].name == 'source' ) + realElement.children[ i ].name = 'cke:source' + } + + var fakeElement = editor.createFakeParserElement( realElement, 'cke_video', 'video', false ), + fakeStyle = fakeElement.attributes.style || ''; + + var width = realElement.attributes.width, + height = realElement.attributes.height, + poster = realElement.attributes.poster; + + if ( typeof width != 'undefined' ) + fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + CKEDITOR.tools.cssLength( width ) + ';'; + + if ( typeof height != 'undefined' ) + fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + CKEDITOR.tools.cssLength( height ) + ';'; + + if ( poster ) + fakeStyle = fakeElement.attributes.style = fakeStyle + 'background-image:url(' + poster + ');'; + + return fakeElement; + } + } + } + + } + ); + + } // afterInit + +} ); // plugins.add + + +var en = { + toolbar : 'Video', + dialogTitle : 'Video properties', + fakeObject : 'Video', + properties : 'Edit video', + widthRequired : 'Width field cannot be empty', + heightRequired : 'Height field cannot be empty', + poster: 'Poster image', + sourceVideo: 'Source video', + sourceType : 'Video type', + linkTemplate : '%type% ', + fallbackTemplate : 'Your browser doesn\'t support video.
Please download the file: %links%' + }; + +var es = { + toolbar : 'Video', + dialogTitle : 'Propiedades de video', + fakeObject : 'Video', + properties : 'Editar el video', + widthRequired : 'La anchura no se puede dejar en blanco', + heightRequired : 'La altura no se puede dejar en blanco', + poster: 'Imagen de presentación', + sourceVideo: 'Archivo de video', + sourceType : 'Tipo', + linkTemplate : '%type% ', + fallbackTemplate : 'Su navegador no soporta VIDEO.
Por favor, descargue el fichero: %links%' + }; + + // v3 + if (CKEDITOR.skins) + { + en = { video : en} ; + es = { video : es} ; + } + +// Translations +CKEDITOR.plugins.setLang( 'video', 'en', en ); + +CKEDITOR.plugins.setLang( 'video', 'es', es ); + +})(); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/wikilink/dialogs/wikilink.js b/main/inc/lib/javascript/ckeditor/plugins/wikilink/dialogs/wikilink.js new file mode 100644 index 0000000000..59468029b9 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wikilink/dialogs/wikilink.js @@ -0,0 +1,43 @@ +( function(){ + + var wikilinkDialog = function(editor){ + return { + title : "Wikilink", + minWidth : 100, + minHeight : 50, + buttons:[CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton], + onOk: function() + { + var data = {}; + this.commitContent(data); + editor.insertText('[['+data.wikiLinkText+']]'); + }, + contents: + [ + { + id : 'general', + label : 'Settings', + elements : + [ + { + type : 'text', + id : 'wikiLinkText', + label : 'TIP: You can also create a wiki link placing between double brackets [[]] a word', + validate : CKEDITOR.dialog.validate.notEmpty( 'The wikilink field cannot be empty.' ), + required : true, + commit : function(data) + { + data.wikiLinkText = this.getValue(); + } + } + ] + } + ] + } + } + + CKEDITOR.dialog.add('wikilink', function(editor) { + return wikilinkDialog(editor); + }); + +})(); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/wikilink/images/wikilink.gif b/main/inc/lib/javascript/ckeditor/plugins/wikilink/images/wikilink.gif new file mode 100644 index 0000000000..c6fdb178d1 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/wikilink/images/wikilink.gif differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/wikilink/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/wikilink/plugin.js new file mode 100644 index 0000000000..ab19a72d0a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wikilink/plugin.js @@ -0,0 +1,15 @@ +CKEDITOR.plugins.add('wikilink', +{ + init: function(editor) + { + var pluginName = 'wikilink'; + CKEDITOR.dialog.add(pluginName, 'plugins/wikilink/dialogs/wikilink.js'); + editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName)); + editor.ui.addButton('Wikilink', + { + label: 'Wikilink', + command: pluginName, + icon : this.path + 'images/wikilink.gif' + }); + } +}); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/css/wordcount.css b/main/inc/lib/javascript/ckeditor/plugins/wordcount/css/wordcount.css new file mode 100644 index 0000000000..7154b35977 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/css/wordcount.css @@ -0,0 +1,3 @@ +.cke_wordcount {display:block;float:right;margin-top:-2px;margin-right:3px;color:black;} + +.cke_wordcountLimitReached span {color:red! important} \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ca.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ca.js new file mode 100644 index 0000000000..80f8fb7226 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ca.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'ca', { + WordCount: 'Paraules:', + CharCount: 'Caràcters:', + CharCountWithHTML: 'Caràcters (including HTML):', + limit: 'Límit:', + title: 'Estadístiques' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/de.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/de.js new file mode 100644 index 0000000000..6bcf6b5f6c --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/de.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'de', { + WordCount: 'Wörter:', + CharCount: 'Zeichen:', + CharCountWithHTML: 'Zeichen (inkl. HTML):', + limit: 'Limit:', + title: 'Statistik' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/en.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/en.js new file mode 100644 index 0000000000..51c8523797 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/en.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'en', { + WordCount: 'Words:', + CharCount: 'Characters:', + CharCountWithHTML: 'Characters (including HTML):', + limit: 'Limit:', + title: 'Statistics' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/es.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/es.js new file mode 100644 index 0000000000..980e9aaf28 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/es.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'es', { + WordCount: 'Palabras:', + CharCount: 'Caràcteres:', + CharCountWithHTML: 'Caràcteres (con HTML):', + limit: 'Límite:', + title: 'Estadísticas' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/fr.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/fr.js new file mode 100644 index 0000000000..d55f54bb4d --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/fr.js @@ -0,0 +1,9 @@ +// French Translation by Nicolas M. + +CKEDITOR.plugins.setLang('wordcount', 'fr', { + WordCount: 'Mots:', + CharCount: 'Caractères:', + CharCountWithHTML: 'Caractères (including HTML):', + limit: 'Limite:', + title: 'Statistiques' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/it.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/it.js new file mode 100644 index 0000000000..c15370a522 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/it.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +@author translation: Davide Montorio +*/ +CKEDITOR.plugins.setLang('wordcount', 'it', { + WordCount: 'Parole:', + CharCount: 'Caratteri:', + CharCountWithHTML: 'Caratteri (HTML incluso):', + limit: 'Limite:', + title: 'Statistiche' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/jp.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/jp.js new file mode 100644 index 0000000000..300e55b16b --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/jp.js @@ -0,0 +1,10 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'jp', { + WordCount: '単語数:', + CharCount: '文字数:', + limit: '上限:', + title: 'ワードカウント' +}); \ No newline at end of file diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/no.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/no.js new file mode 100644 index 0000000000..0615d90c22 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/no.js @@ -0,0 +1,8 @@ +// Norwegian translation by Vegard S. +CKEDITOR.plugins.setLang('wordcount', 'no', { + WordCount: 'Ord:', + CharCount: 'Tegn:', + CharCountWithHTML: 'Tegn (including HTML):', + limit: 'Grense:', + title: 'Statistikk' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pl.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pl.js new file mode 100644 index 0000000000..8a2703fcec --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pl.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'pl', { + WordCount: 'Słów:', + CharCount: 'Znaków:', + CharCountWithHTML: 'Znaków (wraz z kodem HTML):', + limit: 'Limit:', + title: 'Statystyka' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pt-BR.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pt-BR.js new file mode 100644 index 0000000000..89ea1cc92f --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/pt-BR.js @@ -0,0 +1,10 @@ +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'pt-BR', { + WordCount: 'Contagem de palavras:', + CharCount: 'Contagem de caracteres:', + limit: 'Limit:', + title: 'Estatísticas' + }); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ru.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ru.js new file mode 100644 index 0000000000..d1520c5b12 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/lang/ru.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang('wordcount', 'ru', { + WordCount: 'Слов:', + CharCount: 'Символов:', + CharCountWithHTML: 'Символов (включая HTML):', + limit: 'Лимит:', + title: 'Статистика' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/wordcount/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/wordcount/plugin.js new file mode 100644 index 0000000000..e22fbb73e3 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/wordcount/plugin.js @@ -0,0 +1,211 @@ +/** + * @license Copyright (c) CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.html or http://ckeditor.com/license + */ + +CKEDITOR.plugins.add('wordcount', { + lang: ['ca', 'de', 'en', 'es', 'fr', 'it', 'jp', 'no', 'pl', 'pt-BR'], + version : 1.08, + init: function (editor) { + if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) { + return; + } + + var defaultFormat = '', + intervalId, + lastWordCount, + lastCharCount = 0, + limitReachedNotified = false, + limitRestoredNotified = false; + + // Default Config + var defaultConfig = { + showWordCount: true, + showCharCount: false, + charLimit: 'unlimited', + wordLimit: 'unlimited', + countHTML: false + }; + + // Get Config & Lang + var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true); + + if (config.showCharCount) { + var charLabel = editor.lang.wordcount[config.countHTML ? 'CharCountWithHTML' : 'CharCount']; + + defaultFormat += charLabel + ' %charCount%'; + + if (config.charLimit != 'unlimited') { + defaultFormat += ' (' + editor.lang.wordcount.limit + ' ' + config.charLimit + ')'; + } + } + + if (config.showCharCount && config.showWordCount) { + defaultFormat += ', '; + } + + if (config.showWordCount) { + defaultFormat += editor.lang.wordcount.WordCount + ' %wordCount%'; + + if (config.wordLimit != 'unlimited') { + defaultFormat += ' (' + editor.lang.wordcount.limit + ' ' + config.wordLimit + ')'; + } + } + + defaultFormat += ''; + + var format = defaultFormat; + + CKEDITOR.document.appendStyleSheet(this.path + 'css/wordcount.css'); + + function counterId(editorInstance) { + return 'cke_wordcount_' + editorInstance.name; + } + + function counterElement(editorInstance) { + return document.getElementById(counterId(editorInstance)); + } + + function strip(html) { + var tmp = document.createElement("div"); + tmp.innerHTML = html; + + if (tmp.textContent == '' && typeof tmp.innerText == 'undefined') { + return '0'; + } + return tmp.textContent || tmp.innerText; + } + + function updateCounter(editorInstance) { + var wordCount = 0, + charCount = 0, + normalizedText, + text; + + if (text = editorInstance.getData()) { + if (config.showCharCount) { + if (config.countHTML) { + charCount = text.length; + } else { + normalizedText = text. + replace(/(\r\n|\n|\r)/gm, ""). + replace(/^\s+|\s+$/g, ""). + replace(" ", ""). + replace(" ", ""); + normalizedText = strip(normalizedText); + + charCount = normalizedText.length; + } + } + + if (config.showWordCount) { + normalizedText = text. + replace(/(\r\n|\n|\r)/gm, " "). + replace(/^\s+|\s+$/g, ""). + replace(" ", " "); + + normalizedText = strip(normalizedText); + + wordCount = normalizedText.split(/\s+/).length; + } + } + + var html = format.replace('%wordCount%', wordCount).replace('%charCount%', charCount); + + counterElement(editorInstance).innerHTML = html; + + if (charCount == lastCharCount) { + return true; + } + + lastWordCount = wordCount; + lastCharCount = charCount; + + // Check for word limit + if (config.showWordCount && wordCount > config.wordLimit) { + limitReached(editor, limitReachedNotified); + } else if (config.showWordCount && wordCount == config.wordLimit) { + // create snapshot to make sure only the content after the limit gets deleted + editorInstance.fire('saveSnapshot'); + } else if (!limitRestoredNotified && wordCount < config.wordLimit) { + limitRestored(editor); + } + + // Check for char limit + if (config.showCharCount && charCount > config.charLimit) { + limitReached(editor, limitReachedNotified); + } else if (config.showCharCount && charCount == config.charLimit) { + // create snapshot to make sure only the content after the limit gets deleted + editorInstance.fire('saveSnapshot'); + } else if (!limitRestoredNotified && charCount < config.charLimit) { + limitRestored(editor); + } + + return true; + } + + function limitReached(editorInstance, notify) { + limitReachedNotified = true; + limitRestoredNotified = false; + + editorInstance.execCommand('undo'); + + if (!notify) { + //counterElement(editorInstance).className = "cke_wordcount cke_wordcountLimitReached"; + + editorInstance.fire('limitReached', {}, editor); + } + + // lock editor + editorInstance.config.Locked = 1; + } + + function limitRestored(editorInstance) { + + limitRestoredNotified = true; + limitReachedNotified = false; + editorInstance.config.Locked = 0; + + counterElement(editorInstance).className = "cke_wordcount"; + } + + editor.on('key', function (event) { + + updateCounter(event.editor); + }, editor, null, 100); + + editor.on('uiSpace', function (event) { + if (event.data.space == 'bottom') { + event.data.html += '
 
'; + } + }, editor, null, 100); + editor.on('dataReady', function (event) { + updateCounter(event.editor); + }, editor, null, 100); + /*editor.on('change', function (event) { + + updateCounter(event.editor); + }, editor, null, 100);*/ + + editor.on('afterPaste', function (event) { + updateCounter(event.editor); + }, editor, null, 100); + /*editor.on('focus', function (event) { + editorHasFocus = true; + intervalId = window.setInterval(function () { + updateCounter(editor); + }, 300, event.editor); + }, editor, null, 300);*/ + editor.on('blur', function () { + if (intervalId) { + window.clearInterval(intervalId); + } + }, editor, null, 300); + + if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g, ''); + }; + } + } +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/images/icon.png b/main/inc/lib/javascript/ckeditor/plugins/youtube/images/icon.png new file mode 100644 index 0000000000..b1cf6deda6 Binary files /dev/null and b/main/inc/lib/javascript/ckeditor/plugins/youtube/images/icon.png differ diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ar.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ar.js new file mode 100644 index 0000000000..5eaaac299a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ar.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'ar', { + button : 'شيفرة تضمين اليوتيوب', + title : 'شيفرة تضمين اليوتيوب', + txtEmbed : 'الصق شيفرة التضمين هنا', + txtUrl : 'الصق رابط فيديو اليوتيوب', + txtWidth : 'العرض', + txtHeight : 'الطول', + chkRelated : 'اظهر الفيديوهات المقترحة في نهاية الفيديو', + txtStartAt : 'ابدأ عند (ss او mm:ss او hh:mm:ss)', + chkPrivacy : 'تفعيل وضع تحسين الخصوصية', + chkOlderCode : 'استخدم شيفرة التضمين القديمة', + chkAutoplay : 'Autoplay', + noCode : 'يجب عليك ادخال شيفرة التضمين او الرابط', + invalidEmbed : 'شيفرة التضمين التي قمت بإدخالها تبدو غير صحيحة', + invalidUrl : 'الرابط الذي قمت بإدخاله يبدو غير صحيح', + or : 'او', + noWidth : 'يجب عليك ادخال العرض', + invalidWidth : 'يجب عليك ادخال عرض صحيح', + noHeight : 'يجب عليك ادخال الطول', + invalidHeight : 'يجب عليك ادخال طول صحيح', + invalidTime : 'يجب عليك ادخال وقت بداية صحيح', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/de.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/de.js new file mode 100644 index 0000000000..34f8d2badb --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/de.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'de', { + button : 'YouTube Video einbinden', + title : 'YouTube Video einbinden', + txtEmbed : 'Embed Code hier einfügen', + txtUrl : 'YouTube Video URL hier einfügen', + txtWidth : 'Breite', + txtHeight : 'Höhe', + chkRelated : 'Vorschläge am Ende des Videos einblenden', + txtStartAt : 'Start bei Position (ss oder mm:ss oder hh:mm:ss)', + chkPrivacy : 'Erweiterten Datenschutzmodus aktivieren', + chkOlderCode : 'Benutze alten Embed Code', + chkAutoplay : 'Autoplay', + noCode : 'Sie müssen einen Embed Code oder URL angeben', + invalidEmbed : 'Der angegebene Embed Code scheint nicht gültig zu sein.', + invalidUrl : 'Die angegebene URL scheint nicht gültig zu sein.', + or : 'oder', + noWidth : 'Geben Sie eine Breite an', + invalidWidth : 'Geben Sie eine gültige Breite an', + noHeight : 'Geben Sie eine Höhe an', + invalidHeight : 'Geben Sie eine gültige Höhe an', + invalidTime : 'Geben Sie eine gültige Startzeit an', + txtResponsive : 'Automatische Größe (ignoriert Breite und Höhe)' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/el.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/el.js new file mode 100644 index 0000000000..bc0ebc17d6 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/el.js @@ -0,0 +1,22 @@ +CKEDITOR.plugins.setLang('youtube', 'el', { + button: 'Ενσωμάτωση Youtube βίντεο', + title: 'Ενσωμάτωση Youtube βίντεο', + txtEmbed: 'Επικόλλησε τον κώδικα ενσωμάτωσης', + txtUrl: 'Επικόλλησε το URL του βίντεο', + txtWidth: 'Πλάτος', + txtHeight: 'Ύψος', + chkRelated: 'Εμφάνιση προτεινόμενων βίντεο μόλις ολοκληρωθεί', + txtStartAt: 'Χρόνος εκκίνησης (ss or mm:ss or hh:mm:ss)', + chkPrivacy: 'Ενεργοποίηση λειτουργίας ενισχυμένου απορρήτου', + chkOlderCode: 'Χρήση παλαιού κώδικα ενσωμάτωσης', + chkAutoplay: 'Αυτόματη εκκίνηση', + noCode: 'Χρειάζεται κώδικας ενσωμάτωσης ή URL', + invalidEmbed: 'Ο κώδικας ενσωμάτωσης που εισήγατε δεν μοιάζει σωστός', + invalidUrl: 'Το URL που εισήγατε δεν μοιάζει σωστό', + or: 'ή', + noWidth: 'Συμπληρώστε το πλάτος', + invalidWidth: 'Λανθασμένο πλάτος', + noHeight: 'Συμπληρώστε το ύψος', + invalidHeight: 'Λανθασμένο ύψος', + invalidTime: 'Λανθασμένος χρόνος εκκίνησης' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/en.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/en.js new file mode 100644 index 0000000000..7e3954dd1e --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/en.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'en', { + button : 'Embed YouTube Video', + title : 'Embed YouTube Video', + txtEmbed : 'Paste Embed Code Here', + txtUrl : 'Paste YouTube Video URL', + txtWidth : 'Width', + txtHeight : 'Height', + chkRelated : 'Show suggested videos at the video\'s end', + txtStartAt : 'Start at (ss or mm:ss or hh:mm:ss)', + chkPrivacy : 'Enable privacy-enhanced mode', + chkOlderCode : 'Use old embed code', + chkAutoplay: 'Autoplay', + noCode : 'You must input an embed code or URL', + invalidEmbed : 'The embed code you\'ve entered doesn\'t appear to be valid', + invalidUrl : 'The URL you\'ve entered doesn\'t appear to be valid', + or : 'or', + noWidth : 'You must inform the width', + invalidWidth : 'Inform a valid width', + noHeight : 'You must inform the height', + invalidHeight : 'Inform a valid height', + invalidTime : 'Inform a valid start time', + txtResponsive : 'Make Responsive (ignore width and height, fit to width)' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/fr.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/fr.js new file mode 100644 index 0000000000..e4647f9c4a --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/fr.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'fr', { + button : 'Insérer une vidéo Youtube', + title : 'Insérer une vidéo youtube', + txtEmbed : 'Coller le code embed ici', + txtUrl : 'Coller l\'url de la vidéo ici', + txtWidth : 'Largeur', + txtHeight : 'Hauteur', + chkRelated : 'Montrer les suggestions de vidéo à la fin', + txtStartAt : 'Commencer à (ss ou mm:ss ou hh:mm:ss)', + chkPrivacy : 'Activer la protection de la vie privée', + chkOlderCode : 'Utiliser l\'ancien code embed', + chkAutoplay : 'Autoplay', + noCode : 'Vous devez entrer un code embed ou une url', + invalidEmbed : 'Le code embed est invalide', + invalidUrl : 'L\'url est invalide', + or : 'ou', + noWidth : 'Vous devez saisir une largeur', + invalidWidth : 'La largeur saisie est invalide', + noHeight : 'Vous devez saisir une hauteur', + invalidHeight : 'La hauteur saisie est invalide', + invalidTime : 'Le temps de départ de la vidéo est invalide', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/hu.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/hu.js new file mode 100644 index 0000000000..7282df72d2 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/hu.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'hu', { + button : 'Youtube videó beillesztése', + title : 'Youtube videó beillesztése', + txtEmbed : 'Illessze be a beágyazott kódot', + txtUrl : 'Illessze be a Youtube videó URL-jét', + txtWidth : 'Szélesség', + txtHeight : 'Magasság', + txtStartAt : 'Kezdő időpont (ss vagy mm:ss vagy hh:mm:ss)', + chkRelated : 'Ajánlott videók megjelenítése, amikor a videó befejeződik', + chkPrivacy : 'Fokozott adatvédelmi mód engedélyezése', + chkOlderCode : 'Régi beágyazott kód használata', + chkAutoplay : 'Automatikus lejátszás', + noCode : 'A beágyazott kód, vagy az URL megadása kötelező', + invalidEmbed : 'A beágyazott kód érvénytelen', + invalidUrl : 'A megadott URL érvénytelen', + or : 'vagy', + noWidth : 'A szélesség megadása kötelező', + invalidWidth : 'Érvényes szélességet adjon meg', + noHeight : 'A magasság megadása kötelező', + invalidHeight : 'Érvényes magasságot adjon meg', + invalidTime : 'Érvényes kezdő időpontot adjon meg', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/it.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/it.js new file mode 100644 index 0000000000..1f19940401 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/it.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'it', { + button : 'Incorpora video Youtube', + title : 'Incorpora video Youtube', + txtEmbed : 'Incolla qui il codice di incorporamento', + txtUrl : 'Incolla l\'URL del video Youtube', + txtWidth : 'Larghezza', + txtHeight : 'Altezza', + chkRelated : 'Mostra i video suggeriti dopo il video', + txtStartAt : 'Inizia a (ss o mm:ss o hh:mm:ss)', + chkPrivacy : 'Abilita la protezione della privacy', + chkOlderCode : 'Usa il vecchio codice di incorporamento', + chkAutoplay : 'Autoplay', + noCode : 'Devi inserire un codice di incorporamento o un URL', + invalidEmbed : 'Il codice di incorporamento inserito non sembra valido', + invalidUrl : 'L\'URL inserito non sembra valido', + or : 'o', + noWidth : 'Devi indicare la larghezza', + invalidWidth : 'Indica una larghezza valida', + noHeight : 'Devi indicare l\'altezza', + invalidHeight : 'Indica un\'altezza valida', + invalidTime : 'Indica un tempo di inizio valido', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ja.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ja.js new file mode 100644 index 0000000000..e9a0d77f85 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ja.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'ja', { + button : 'Youtube動画埋め込み', + title : 'Youtube動画埋め込み', + txtEmbed : '埋め込みコードを貼り付けてください', + txtUrl : 'URLを貼り付けてください', + txtWidth : '幅', + txtHeight : '高さ', + chkRelated : '動画が終わったら関連動画を表示する', + txtStartAt : 'Start at', + chkPrivacy : 'プライバシー強化モードを有効にする', + chkOlderCode : '以前の埋め込みコードを使用する', + chkAutoplay : '自動再生', + noCode : '埋め込みコードまたはURLを入力してください', + invalidEmbed : '不適切な埋め込みコードが入力されました', + invalidUrl : '不適切なURLが入力されました', + or : 'または', + noWidth : '幅を指定してください', + invalidWidth : '幅指定に誤りがあります', + noHeight : '高さを指定してください', + invalidHeight : '高さ指定に誤りがあります', + invalidTime : 'Inform a valid start time', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/nl.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/nl.js new file mode 100644 index 0000000000..cd7b950183 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/nl.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'nl', { + button : 'Youtube video insluiten', + title : 'Youtube video insluiten', + txtEmbed : 'Plak embedcode hier', + txtUrl : 'Plak video URL', + txtWidth : 'Breedte', + txtHeight : 'Hoogte', + chkRelated : 'Toon gesuggereerde video aan het einde van de video', + txtStartAt : 'Starten op (ss of mm:ss of hh:mm:ss)', + chkPrivacy : 'Privacy-enhanced mode inschakelen', + chkOlderCode : 'Gebruik oude embedcode', + chkAutoplay: 'Automatisch starten', + noCode : 'U moet een embedcode of url ingeven', + invalidEmbed : 'De ingegeven embedcode lijkt niet geldig', + invalidUrl : 'De ingegeven url lijkt niet geldig', + or : 'of', + noWidth : 'U moet een breedte ingeven', + invalidWidth : 'U moet een geldige breedte ingeven', + noHeight : 'U moet een hoogte ingeven', + invalidHeight : 'U moet een geldige starttijd ingeven', + invalidTime : 'Inform a valid start time', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pl.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pl.js new file mode 100644 index 0000000000..59d5537936 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pl.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'pl', { + button : 'Załącznik wideo z Youtube', + title : 'Załącznik wideo z Youtube', + txtEmbed : 'Wklej kod do umieszczenia', + txtUrl : 'Wklej link URL do wideo', + txtWidth : 'Szerokość', + txtHeight : 'Wysokość', + chkRelated : 'Pokaż sugerowane filmy po zakończeniu odtwarzania', + txtStartAt : 'Rozpocznij od (ss lub mm:ss lub gg:mm:ss)', + chkPrivacy : 'Włącz rozszerzony tryb prywatności', + chkOlderCode : 'Użyj starego kodu', + chkAutoplay: 'Autoodtwarzanie', + noCode : 'Musisz wprowadzić kod lub link URL', + invalidEmbed : 'Wprowadzony kod nie jest poprawny', + invalidUrl : 'Wprowadzony link URL nie jest poprawny', + or : 'lub', + noWidth : 'Musisz wpisać szerokość', + invalidWidth : 'Wprowadzona szerokość nie jest poprawna', + noHeight : 'Musisz wprowadzić wysokość', + invalidHeight : 'Wprowadzona wysokość nie jest poprawna', + invalidTime : 'Musisz wprowadzić poprawny czas rozpoczęcia', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pt.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pt.js new file mode 100644 index 0000000000..2cfcfddb59 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/pt.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'pt', { + button : 'Inserir Vídeo do Youtube', + title : 'Inserir Vídeo do Youtube', + txtEmbed : 'Cole aqui o código embed de um vídeo do Youtube', + txtUrl : 'Cole aqui uma URL de um vídeo do Youtube', + txtWidth : 'Largura', + txtHeight : 'Altura', + chkRelated : 'Mostrar vídeos sugeridos ao final do vídeo', + txtStartAt : 'Iniciar em (ss ou mm:ss ou hh:mm:ss)', + chkPrivacy : 'Ativar o modo de privacidade aprimorada', + chkOlderCode : 'Usar código de incorporação antigo', + chkAutoplay : 'Reproduzir automaticamente', + noCode : 'Você precisa informar um código embed ou uma URL', + invalidEmbed : 'O código informado não parece ser válido', + invalidUrl : 'A URL informada não parece ser válida', + or : 'ou', + noWidth : 'Você deve informar a largura do vídeo', + invalidWidth : 'Informe uma largura válida', + noHeight : 'Você deve informar a altura do vídeo', + invalidHeight : 'Informe uma altura válida', + invalidTime : 'O tempo informado é inválido', + txtResponsive : 'Vídeo responsivo' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ru.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ru.js new file mode 100644 index 0000000000..8964272db4 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/ru.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'ru', { + button : 'Вставить YouTube видео', + title : 'Вставить YouTube видео', + txtEmbed : 'Вставьте HTML-код сюда', + txtUrl : 'Вставьте адрес видео (URL)', + txtWidth : 'Ширина', + txtHeight : 'Высота', + chkRelated : 'Показать похожие видео после завершения просмотра', + txtStartAt : 'Начать с (сс или мм:сс или чч:мм:сс)', + chkPrivacy : 'Включить режим повышенной конфиденциальности', + chkOlderCode : 'Использовать старый код вставки', + chkAutoplay: 'Автозапуск', + noCode : 'Вы должны ввести HTML-код или адрес', + invalidEmbed : 'Ваш HTML-код не похож на правильный', + invalidUrl : 'Ваш адрес видео не похож на правильный', + or : 'или', + noWidth : 'Вы должны указать ширину', + invalidWidth : 'Укажите правильную ширину', + noHeight : 'Вы должны указать высоту', + invalidHeight : 'Укажите правильную высоту', + invalidTime : 'Укажите правильное время начала', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/tr.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/tr.js new file mode 100644 index 0000000000..66f6e37e3b --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/tr.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'tr', { + button : 'Youtube Video Gömün (Embed)', + title : 'Youtube Video', + txtEmbed : 'Youtube gömülü kodu (embed) buraya yapıştırınız', + txtUrl : 'Youtube linkinizi buraya yapıştırınız', + txtWidth : 'Genişlik', + txtHeight : 'Yükseklik', + chkRelated : 'Önerilen videoları video bitiminde göster', + txtStartAt : 'Video başlangıç anı (ss ya da dd:ss ya da ss:dd:ss)', + chkPrivacy : 'Gizlilik modunu etkinleştir', + chkOlderCode : 'Eski gömülü kodu (embed) kullan', + chkAutoplay: 'Otomatik', + noCode : 'Gömülü kod (embed) veya url yapıştırmak zorundasınız', + invalidEmbed : 'Verdiğiniz gömülü kod (embed) ile video bulunamadı', + invalidUrl : 'Verdiğiniz linkte video bulunamadı', + or : 'ya da', + noWidth : 'Genişliği belirtmek zorundasınız', + invalidWidth : 'Bir genişlik belirtin', + noHeight : 'Yükseliği belirtmek zorundasınız', + invalidHeight : 'Yükseklik belirtin', + invalidTime : 'Başlangıç anını doğru girin, örneğin: 13 (13. saniye) ya da 12:25 (12. dakika 25. saniye) ya da 01.25.33 (1 saat 25 dakika 33 saniye)', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/vi.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/vi.js new file mode 100644 index 0000000000..3b640d6173 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/vi.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'vi', { + button : 'Embed Youtube Video', + title : 'Nhúng Video Youtube', + txtEmbed : 'Dãn mã nhúng Embed vào đây', + txtUrl : 'Dãn đường dẫn video Youtube', + txtWidth : 'Rộng', + txtHeight : 'Cao', + chkRelated : 'Hiển thị các video được đề xuất khi video kết thúc', + txtStartAt : 'Bắt đầu (ss hoặc mm:ss hoặc hh:mm:ss)', + chkPrivacy : 'Kích hoạt chế độ bảo mật nâng cao', + chkOlderCode : 'Sử dụng mã nhúng cũ', + chkAutoplay: 'Tự động chạy video', + noCode : 'Bạn phải nhập mã nhúng hoặc URL', + invalidEmbed : 'Mã nhúng bạn đã nhập không đúng', + invalidUrl : 'URL bạn đã nhập không đúng', + or : 'hoặc', + noWidth : 'Bạn phải chiều rộng', + invalidWidth : 'Chiều rộng hợp lệ', + noHeight : 'Bạn phải chiều cao', + invalidHeight : 'Chiều cao hợp lệ', + invalidTime : 'Thời gian bắt đầu không đúng', + txtResponsive : 'Responsive video' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/zh.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/zh.js new file mode 100644 index 0000000000..19913ed442 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/lang/zh.js @@ -0,0 +1,23 @@ +CKEDITOR.plugins.setLang('youtube', 'zh', { + button: '嵌入 Youtube 影片', + title: '嵌入 Youtube 影片', + txtEmbed: '貼上嵌入碼', + txtUrl: '貼上 Youtube 影片 URL', + txtWidth: '寬', + txtHeight: '高', + txtResponsive: '使用自適應縮放模式 (忽略設定的長寬, 以寬為基準縮放)', + chkRelated: '影片結束時顯示建議影片', + txtStartAt: '開始時間 (ss or mm:ss or hh:mm:ss)', + chkPrivacy: '啟用加強隱私模式', + chkOlderCode: '使用舊的嵌入碼', + chkAutoplay: '自動播放', + noCode: '必須輸入嵌入碼', + invalidEmbed: '錯誤的嵌入碼', + invalidUrl: '錯誤的URL', + or: '或', + noWidth: '必須設定寬', + invalidWidth: '寬設定錯誤', + noHeight: '必須設定高', + invalidHeight: '高設定錯誤', + invalidTime: '開始時間設定錯誤' +}); diff --git a/main/inc/lib/javascript/ckeditor/plugins/youtube/plugin.js b/main/inc/lib/javascript/ckeditor/plugins/youtube/plugin.js new file mode 100644 index 0000000000..f57ae45622 --- /dev/null +++ b/main/inc/lib/javascript/ckeditor/plugins/youtube/plugin.js @@ -0,0 +1,388 @@ +/* +* Youtube Embed Plugin +* +* @author Jonnas Fonini +* @version 2.0.0 +*/ +( function() { + CKEDITOR.plugins.add( 'youtube', + { + lang: [ 'en', 'pt', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el'], + init: function( editor ) + { + editor.addCommand( 'youtube', new CKEDITOR.dialogCommand( 'youtube', { + allowedContent: 'iframe[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]' + })); + + editor.ui.addButton( 'Youtube', + { + label : editor.lang.youtube.button, + toolbar : 'insert', + command : 'youtube', + icon : this.path + 'images/icon.png' + }); + + CKEDITOR.dialog.add( 'youtube', function ( instance ) + { + var video; + + return { + title : editor.lang.youtube.title, + minWidth : 500, + minHeight : 200, + contents : + [{ + id : 'youtubePlugin', + expand : true, + elements : + [{ + id : 'txtEmbed', + type : 'textarea', + label : editor.lang.youtube.txtEmbed, + autofocus : 'autofocus', + onChange : function ( api ) + { + handleEmbedChange( this, api ); + }, + onKeyUp : function ( api ) + { + handleEmbedChange( this, api ); + }, + validate : function () + { + if ( this.isEnabled() ) + { + if ( !this.getValue() ) + { + alert( editor.lang.youtube.noCode ); + return false; + } + else + if ( this.getValue().length === 0 || this.getValue().indexOf( '//' ) === -1 ) + { + alert( editor.lang.youtube.invalidEmbed ); + return false; + } + } + } + }, + { + type : 'html', + html : editor.lang.youtube.or + '
' + }, + { + type : 'hbox', + widths : [ '70%', '15%', '15%' ], + children : + [ + { + id : 'txtUrl', + type : 'text', + label : editor.lang.youtube.txtUrl, + onChange : function ( api ) + { + handleLinkChange( this, api ); + }, + onKeyUp : function ( api ) + { + handleLinkChange( this, api ); + }, + validate : function () + { + if ( this.isEnabled() ) + { + if ( !this.getValue() ) + { + alert( editor.lang.youtube.noCode ); + return false; + } + else{ + video = ytVidId(this.getValue()); + + if ( this.getValue().length === 0 || video === false) + { + alert( editor.lang.youtube.invalidUrl ); + return false; + } + } + } + } + }, + { + type : 'text', + id : 'txtWidth', + width : '60px', + label : editor.lang.youtube.txtWidth, + 'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640', + validate : function () + { + if ( this.getValue() ) + { + var width = parseInt ( this.getValue() ) || 0; + + if ( width === 0 ) + { + alert( editor.lang.youtube.invalidWidth ); + return false; + } + } + else { + alert( editor.lang.youtube.noWidth ); + return false; + } + } + }, + { + type : 'text', + id : 'txtHeight', + width : '60px', + label : editor.lang.youtube.txtHeight, + 'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360', + validate : function () + { + if ( this.getValue() ) + { + var height = parseInt ( this.getValue() ) || 0; + + if ( height === 0 ) + { + alert( editor.lang.youtube.invalidHeight ); + return false; + } + } + else { + alert( editor.lang.youtube.noHeight ); + return false; + } + } + } + ] + }, + { + type : 'hbox', + widths : [ '100%' ], + children : + [ + { + id : 'chkResponsive', + type : 'checkbox', + label : editor.lang.youtube.txtResponsive, + 'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false + } + ] + }, + { + type : 'hbox', + widths : [ '55%', '45%' ], + children : + [ + { + id : 'chkRelated', + type : 'checkbox', + 'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true, + label : editor.lang.youtube.chkRelated + }, + { + id : 'chkOlderCode', + type : 'checkbox', + 'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false, + label : editor.lang.youtube.chkOlderCode + } + ] + }, + { + type : 'hbox', + widths : [ '55%', '45%' ], + children : + [ + { + id : 'chkPrivacy', + type : 'checkbox', + label : editor.lang.youtube.chkPrivacy, + 'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false + }, + { + id : 'chkAutoplay', + type : 'checkbox', + 'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false, + label : editor.lang.youtube.chkAutoplay + } + ] + }, + { + type : 'hbox', + widths : [ '55%', '45%'], + children : + [ + { + id : 'txtStartAt', + type : 'text', + label : editor.lang.youtube.txtStartAt, + validate : function () + { + if ( this.getValue() ) + { + var str = this.getValue(); + + if ( !/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test( str ) ) + { + alert( editor.lang.youtube.invalidTime ); + return false; + } + } + } + }, + { + id: 'empty', + type: 'html', + html: '' + } + ] + } + ] + } + ], + onOk: function() + { + var content = ''; + var responsiveStyle=''; + + if ( this.getContentElement( 'youtubePlugin', 'txtEmbed' ).isEnabled() ) + { + content = this.getValueOf( 'youtubePlugin', 'txtEmbed' ); + } + else { + var url = '//', params = [], startSecs; + var width = this.getValueOf( 'youtubePlugin', 'txtWidth' ); + var height = this.getValueOf( 'youtubePlugin', 'txtHeight' ); + + if ( this.getContentElement( 'youtubePlugin', 'chkPrivacy' ).getValue() === true ) + { + url += 'www.youtube-nocookie.com/'; + } + else { + url += 'www.youtube.com/'; + } + + url += 'embed/' + video; + + if ( this.getContentElement( 'youtubePlugin', 'chkRelated' ).getValue() === false ) + { + params.push('rel=0'); + } + + if ( this.getContentElement( 'youtubePlugin', 'chkAutoplay' ).getValue() === true ) + { + params.push('autoplay=1'); + } + + startSecs = this.getValueOf( 'youtubePlugin', 'txtStartAt' ); + if ( startSecs ){ + var seconds = hmsToSeconds( startSecs ); + + params.push('start=' + seconds); + } + + if ( params.length > 0 ) + { + url = url + '?' + params.join( '&' ); + } + + if ( this.getContentElement( 'youtubePlugin', 'chkResponsive').getValue() === true ) { + content += '
'; + responsiveStyle = 'style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;"'; + } + + if ( this.getContentElement( 'youtubePlugin', 'chkOlderCode' ).getValue() === true ) + { + url = url.replace('embed/', 'v/'); + url = url.replace(/&/g, '&'); + + if ( url.indexOf('?') === -1 ) + { + url += '?'; + } + else { + url += '&'; + } + url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&version=3'; + + content += ''; + content += ''; + content += ''; + content += ''; + content += ' 0 ) + { + el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).disable(); + } + else { + el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).enable(); + } +} + +function handleEmbedChange( el, api ) +{ + if ( el.getValue().length > 0 ) + { + el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).disable(); + } + else { + el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).enable(); + } +} + + +/** + * JavaScript function to match (and return) the video Id + * of any valid Youtube Url, given as input string. + * @author: Stephan Schmitz + * @url: http://stackoverflow.com/a/10315969/624466 + */ +function ytVidId( url ) +{ + var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; + return ( url.match( p ) ) ? RegExp.$1 : false; +} + +/** + * Converts time in hms format to seconds only + */ +function hmsToSeconds( time ) +{ + var arr = time.split(':'), s = 0, m = 1; + + while (arr.length > 0) + { + s += m * parseInt(arr.pop(), 10); + m *= 60; + } + + return s; +}