From f0d910a1821c7d76f973a0bfdef40fe6d8275ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Tue, 29 Jul 2014 17:40:34 +0200 Subject: [PATCH 1/8] Made ckeditor.js's src regexp testable and added support for URL params separation by semicolon. --- ckeditor.js | 5 +- core/ckeditor_base.js | 9 +-- core/loader.js | 2 +- .../{basepath.html => basepathglobal.html} | 0 .../{basepath.js => basepathglobal.js} | 0 tests/core/ckeditor/basepathproperty.html | 2 + tests/core/ckeditor/basepathproperty.js | 67 +++++++++++++++++++ 7 files changed, 79 insertions(+), 6 deletions(-) rename tests/core/ckeditor/{basepath.html => basepathglobal.html} (100%) rename tests/core/ckeditor/{basepath.js => basepathglobal.js} (100%) create mode 100644 tests/core/ckeditor/basepathproperty.html create mode 100644 tests/core/ckeditor/basepathproperty.js diff --git a/ckeditor.js b/ckeditor.js index abb087d1565..3d28515e92c 100644 --- a/ckeditor.js +++ b/ckeditor.js @@ -5,7 +5,10 @@ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ -window.CKEDITOR||(window.CKEDITOR=function(){var b={timestamp:"",version:"%VERSION%",revision:"%REV%",rnd:Math.floor(900*Math.random())+100,_:{pending:[]},status:"unloaded",basePath:function(){var a=window.CKEDITOR_BASEPATH||"";if(!a)for(var b=document.getElementsByTagName("script"),c=0;c + \ No newline at end of file diff --git a/tests/core/ckeditor/basepathproperty.js b/tests/core/ckeditor/basepathproperty.js new file mode 100644 index 00000000000..4d7d8cf82e7 --- /dev/null +++ b/tests/core/ckeditor/basepathproperty.js @@ -0,0 +1,67 @@ +/* bender-tags: editor,unit */ + +( function() { + 'use strict'; + + bender.test( { + 'test CKEDITOR.basePath when used src="ckeditor.js?foo&bar"': function() { + var iframe = CKEDITOR.document.getById( 'iframe-default-params' ), + doc = iframe.getFrameDocument(), + defaultPath = CKEDITOR.basePath; + + iframe.on( 'load', function() { + resume( function() { + var iCKEDITOR = iframe.$.contentWindow.CKEDITOR; + + assert.areSame( CKEDITOR.basePath, CKEDITOR.basePath ); + } ); + } ); + + doc.$.open(); + doc.$.write( '