@@ -230,11 +230,7 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
230230 sValue = oOption . getValue ( ) ;
231231
232232 oOption . remove ( ) ;
233-
234- // alert(sText+ " / "+ sValue);
235- // var result = re.exec(sText);
236233 sText = sText . replace ( re , "IMG_" + iFinalIndex ) ;
237- // alert(sText);
238234 oOption = addOption ( combo , sText , sValue , ( ! documentObject ) ? null : documentObject , iFinalIndex ) ;
239235 setSelectedIndex ( combo , iFinalIndex ) ;
240236
@@ -409,7 +405,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
409405 combo . setValue ( value [ 2 ] ) ;
410406 combo = dialog . getContentElement ( 'slideshowinfoid' , 'imgpreviewid' ) ;
411407 combo = getSelect ( combo ) ;
412- //console.log( "VALUE IMG -> " + value[iSelectedIndex] );
413408 var imgHtml = '<div style="text-align:center;"> <img src="' + value [ 0 ] +
414409 '" title="' + value [ 1 ] +
415410 '" alt="' + value [ 2 ] +
@@ -477,7 +472,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
477472 preview . removeListener ( 'load' , onImgLoadEvent ) ;
478473 preview . removeListener ( 'error' , onImgLoadErrorEvent ) ;
479474 preview . removeListener ( 'abort' , onImgLoadErrorEvent ) ;
480- //console.log( "previewImage -> " + preview );
481475 updateImgList ( this ) ;
482476 } ;
483477
@@ -499,15 +493,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
499493 editeSelected ( dialog ) ;
500494 }
501495
502- function uploadImage ( a , b , dialog ) {
503- console . log ( editor ) ;
504- console . log ( CKEDITOR . editor . uploadRepository ) ;
505- if ( ! CKEDITOR . plugins . clipboard . isFileApiSupported ) {
506- return
507- }
508-
509- }
510-
511496 function previewSlideShow ( dialog ) {
512497 var previewCombo = dialog . getContentElement ( 'slideshowinfoid' , 'framepreviewid' ) ;
513498 var imgCombo = dialog . getContentElement ( 'slideshowinfoid' , 'imgparamsid' ) ;
@@ -826,7 +811,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
826811 str += "if(ititle!='')ititle='<big>'+ititle+'</big>';" ;
827812 str += "idesc=$(this).find(\"span\");" ;
828813 str += "if(idesc)idesc=idesc.text();" ;
829- // str += 'console.log("idesc:", idesc);';
830814 str += "if (idesc.indexOf('IMAGE_LINK_') >= 0) {" ;
831815 str += "idesc = '';" ;
832816 str += "}" ;
@@ -864,15 +848,8 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
864848 str += "ititle=$(this).find(\".ad-description-title\");" ;
865849 str += "if(ititle)ititle=ititle.text();" ;
866850 str += "idesc=$(this).find(\"span\");" ;
867- // str += "console.log('desc0', idesc);";
868851 str += "if(idesc)idesc=idesc.text();" ;
869852 str += "if(idesc!=''){" ;
870- // str += "console.log('desc1', idesc);";
871-
872- // str += "if (idesc.indexOf('LIEN:') == 0) {";
873- // str += "idesc = idesc.substring(5); }";
874- // str += "window.open(idesc);"
875- // str += " }";
876853 str += "var url=window.location.href.trim();" ;
877854 str += "if (idesc.indexOf('IMAGE_LINK_TAB:') >= 0) {" ;
878855 str += " idesc = idesc.substring(15).trim();" ;
@@ -953,21 +930,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
953930 return slideshowDOM ;
954931 }
955932
956- function getCookie ( name ) {
957- var cookieValue = null ;
958- if ( document . cookie && document . cookie !== '' ) {
959- var cookies = document . cookie . split ( ';' ) ;
960- for ( var i = 0 ; i < cookies . length ; i ++ ) {
961- var cookie = cookies [ i ] . trim ( ) ;
962- // Does this cookie string begin with the name we want?
963- if ( cookie . substring ( 0 , name . length + 1 ) === ( name + '=' ) ) {
964- cookieValue = decodeURIComponent ( cookie . substring ( name . length + 1 ) ) ;
965- break ;
966- }
967- }
968- }
969- return cookieValue ;
970- }
971933
972934 function uuidv4 ( ) {
973935 return ( [ 1e7 ] + - 1e3 + - 4e3 + - 8e3 + - 1e11 ) . replace ( / [ 0 1 8 ] / g, c =>
@@ -978,20 +940,17 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
978940
979941 function ClickOkBtn ( dialog ) {
980942 if ( dialog . imagesList && dialog . imagesList . length > 0 ) {
981- console . log ( dialog . imagesList ) ;
982943 var duration = parseInt ( dialog . params . getVal ( 'speedid' ) , 10 ) ;
983944 var height = parseInt ( dialog . params . getVal ( 'pictheightid' ) , 10 ) ;
984945 var width = parseInt ( dialog . params . getVal ( 'pictwidthid' ) , 10 )
985946 var diaporama = { timeline : [ ] }
986947 diaporama [ "timeline" ] = dialog . imagesList . map ( img => ( { image : img [ 0 ] , duration : duration } ) ) ;
987- var csrftoken = getCookie ( 'csrftoken' ) ;
988948 var formData = new FormData ( ) ;
989949 var fileName = `${ uuidv4 ( ) } .json` ;
990950 var file = new File ( [ JSON . stringify ( diaporama ) ] , fileName , { type : "application/json" } ) ;
991951 formData . append ( 'upload' , file , fileName ) ;
992952 var xhr = new XMLHttpRequest ( ) ;
993953 xhr . open ( "POST" , "/ckeditor/upload/" , true ) ;
994- xhr . setRequestHeader ( 'x-csrftoken' , csrftoken ) ;
995954 xhr . send ( formData ) ;
996955 xhr . onload = function ( ) {
997956 var data = JSON . parse ( this . responseText ) ;
@@ -1196,7 +1155,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
11961155 type : 'button' ,
11971156 id : 'removeselectedbtn' ,
11981157 style : 'margin-left:25px;' ,
1199- //style : 'display:none;',
12001158 label : lang . imgDelete ,
12011159 onClick : function ( ) {
12021160 removeSelected ( this . getDialog ( ) ) ;
@@ -1321,8 +1279,6 @@ CKEDITOR.dialog.add('slideshowDialog', function(editor) {
13211279 initImgListFromFresh ( this ) ;
13221280 // Invoke the commit methods of all dialog elements, so the dialog.params array get Updated.
13231281 this . commitContent ( this ) ;
1324- // console.log( "Params New -> " + this.params );
1325- // console.log( "Images New -> " + this.imagesList );
13261282 } else {
13271283 this . slideshowDOM = slideshowDOM ;
13281284 // Get the reference of the slideSjow Images Container
0 commit comments