Index: lams_central/web/includes/javascript/ckconfig_custom.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/ckconfig_custom.js,v diff -u -r1.29 -r1.30 --- lams_central/web/includes/javascript/ckconfig_custom.js 18 Sep 2015 23:26:48 -0000 1.29 +++ lams_central/web/includes/javascript/ckconfig_custom.js 23 Oct 2016 11:16:38 -0000 1.30 @@ -1,7 +1,7 @@ CKEDITOR.config.toolbar_Default = [ ['Source','-','Maximize', 'Preview','PasteFromWord','Undo','Redo','Bold','Italic','Underline', '-','Subscript','Superscript','NumberedList','BulletedList','-','Outdent','Indent','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','TextColor','BGColor','Jlatexmath','-'], ['Paint_Button','MoviePlayer','Kaltura','Image','Link','Iframe','Table','HorizontalRule','Smiley','SpecialChar','Templates','Format','Font','FontSize','About'] -]; +] ; // removing Video Recorder from default tool bar LDEV-2961 // To include it back, just add 'VideoRecorder' in between the MoviePlayer and Kaltura @@ -15,7 +15,7 @@ ['TextColor','BGColor'], ['Image','Table','HorizontalRule','Smiley','SpecialChar'], ['Format','Font','FontSize'] -]; +] ; CKEDITOR.config.toolbar_DefaultMonitor = [ ['Preview','PasteFromWord'], @@ -27,7 +27,7 @@ ['TextColor','BGColor'], ['Table','HorizontalRule','Smiley','SpecialChar'], ['Format','Font','FontSize'] -]; +] ; CKEDITOR.config.toolbar_CustomWiki = [ ['Source','-','Preview','PasteFromWord'], @@ -40,12 +40,12 @@ ['TextColor','BGColor'], ['Table','HorizontalRule','Smiley','SpecialChar'], ['Format','Font','FontSize'] -]; +] ; CKEDITOR.config.toolbar_CustomPedplanner = [ ['Source','-','Maximize','Preview','PasteFromWord','Bold','Italic','Underline', '-','NumberedList','BulletedList','-','Outdent','Indent','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','TextColor','BGColor','Jlatexmath'], ['Image','Link','Iframe','Table','Smiley','Font','FontSize'] -]; +] ; CKEDITOR.config.toolbar_LessonDescription = [ ['Bold','Italic','Underline', '-','Subscript','Superscript'], @@ -54,7 +54,7 @@ ['TextColor','BGColor'], ['Table','HorizontalRule','Smiley','SpecialChar'], ['Format','Font','FontSize'] -]; +] ; CKEDITOR.config.contentsCss = CKEDITOR.basePath + '../css/defaultHTML_learner.css'; @@ -65,7 +65,7 @@ CKEDITOR.config.format_tags = 'div;h1;h2;h3;h4;h5;h6;pre;address;p' ; CKEDITOR.config.enterMode = 'div'; CKEDITOR.plugins.addExternal('wikilink', CKEDITOR.basePath + '../tool/lawiki10/wikilink/', 'plugin.js'); -CKEDITOR.config.extraPlugins = 'kaltura,wikilink,jlatexmath,paint,movieplayer,iframe'; +CKEDITOR.config.extraPlugins = 'kaltura,wikilink,Jlatexmath,paint,movieplayer,iframe'; CKEDITOR.config.enterMode = CKEDITOR.ENTER_DIV; CKEDITOR.config.removePlugins = 'elementspath'; CKEDITOR.config.allowedContent = true; @@ -81,6 +81,24 @@ CKEDITOR.on('instanceReady', function(e){ e.editor.element.$.style.display = ''; + // if iframe src was substituted with NTU redirect page before + // put back the original URL + var tempDiv = document.createElement('div'); + tempDiv.innerHTML = e.editor.getData(); + + var iframes = tempDiv.getElementsByTagName('iframe'); + for (var i = 0; i < iframes.length; i++) { + var iframe = iframes[i], + index = iframe.src.indexOf(NTU_AUTH_PAGE); + if (index >= 0) { + // get the original URL and decode it + var url = iframe.src.substring(index + NTU_AUTH_PAGE.length); + iframe.src = decodeURIComponent(url); + } + } + + e.editor.setData(tempDiv.innerHTML); + // make all links open in new window e.editor.on('getData', function(f){ // create a DOM element for easier manipulation