Ticket #3673: 3673_7.patch
File 3673_7.patch, 17.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/image/dialogs/image.js
445 445 id : 'browse', 446 446 align : 'center', 447 447 label : editor.lang.common.browseServer, 448 onLoad : function() 449 { 450 var dialog = this.getDialog(); 451 if ( !dialog.getParentEditor().config.image_browseServer ) 452 dialog.getContentElement( 'info', 'browse' ).getElement().hide(); 453 }, 454 onClick : function() 455 { 456 457 } 448 hidden : true, 449 filebrowser : 'info:txtUrl' 458 450 } 459 451 ] 460 452 } … … 930 922 { 931 923 type : 'button', 932 924 id : 'browse', 925 filebrowser : 'Link:txtUrl', 933 926 style : 'float:right', 934 label : editor.lang.common.browseServer, 935 onClick : function() 936 { 937 } 927 hidden : true, 928 label : editor.lang.common.browseServer 938 929 }, 939 930 { 940 931 id : 'cmbTarget', … … 967 958 }, 968 959 { 969 960 id : 'Upload', 961 hidden : true, 962 filebrowser : 'uploadButton', 970 963 label : editor.lang.image.upload, 971 964 elements : 972 965 [ … … 974 967 type : 'file', 975 968 id : 'upload', 976 969 label : editor.lang.image.btnUpload, 977 action : editor.config.image_uploadAction,978 970 size : 38 979 971 }, 980 972 { 981 973 type : 'fileButton', 982 974 id : 'uploadButton', 975 filebrowser : 'info:txtUrl', 983 976 label : editor.lang.image.btnUpload, 984 977 'for' : [ 'Upload', 'upload' ] 985 978 } -
_source/plugins/image/plugin.js
54 54 } 55 55 } ); 56 56 57 /**58 * Show Browse Server button.59 * @type Boolean60 * @default true61 */62 CKEDITOR.config.image_browseServer = true;63 64 /**65 * Upload action attribute.66 * @type URL67 */68 CKEDITOR.config.image_uploadAction = 'nowhere.php';69 70 57 CKEDITOR.config.image_removeLinkByEmptyURL = true; -
_source/plugins/dialogui/plugin.js
654 654 this.validate = elementDefinition.validate; 655 655 656 656 var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition ); 657 var onClick = myDefinition.onClick; 657 658 myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button'; 658 659 myDefinition.onClick = function( evt ) 659 660 { 660 661 var target = elementDefinition[ 'for' ]; // [ pageId, elementId ] 661 dialog.getContentElement( target[0], target[1] ).submit(); 662 this.disable(); 662 if ( !onClick || onClick.call( this, evt ) !== false ) 663 { 664 dialog.getContentElement( target[0], target[1] ).submit(); 665 this.disable(); 666 } 663 667 }; 664 668 665 669 dialog.on( 'load', function() … … 1197 1201 }, 1198 1202 1199 1203 /** 1204 * Get the action assigned to the form. 1205 * @returns {String} The value of the action. 1206 * @example 1207 */ 1208 getAction : function( action ) 1209 { 1210 return this.getInputElement().getParent().$.action; 1211 }, 1212 1213 /** 1200 1214 * Redraws the file input and resets the file path in the file input. 1201 1215 * The redraw logic is necessary because non-IE browsers tend to clear 1202 1216 * the <iframe> containing the file input after closing the dialog. 1203 1217 * @example 1204 1218 */ 1205 reset : function( )1219 reset : function( action ) 1206 1220 { 1207 1221 var frameElement = CKEDITOR.document.getById( this._.frameId ), 1208 1222 frameDocument = frameElement.getFrameDocument(), … … 1219 1233 1220 1234 frameDocument.$.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', 1221 1235 '<form enctype="multipart/form-data" method="POST" action="', 1222 CKEDITOR.tools.htmlEncode( elementDefinition.action ),1236 CKEDITOR.tools.htmlEncode( action || elementDefinition.action ), 1223 1237 '">', 1224 1238 '<input type="file" name="', 1225 1239 CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ), -
_source/plugins/flash/dialogs/flash.js
181 181 title : editor.lang.flash.title, 182 182 minWidth : 420, 183 183 minHeight : 310, 184 onLoad : function()185 {186 if ( !editor.config.flashUploadTab )187 this.hidePage( 'Upload' ); // Hide Upload tab.188 189 if ( !editor.config.flashBrowseServer )190 this.getContentElement( 'info', 'browse' ).getElement().hide();191 },192 184 onShow : function() 193 185 { 194 186 // Clear previously saved elements. … … 347 339 { 348 340 type : 'button', 349 341 id : 'browse', 342 filebrowser : 'src', 343 hidden : true, 350 344 align : 'center', 351 345 label : editor.lang.common.browseServer 352 346 } … … 438 432 }, 439 433 { 440 434 id : 'Upload', 435 hidden : true, 436 filebrowser : 'uploadButton', 441 437 label : editor.lang.common.upload, 442 438 elements : 443 439 [ … … 445 441 type : 'file', 446 442 id : 'upload', 447 443 label : editor.lang.common.upload, 448 action : editor.config.image_uploadAction,449 444 size : 38 450 445 }, 451 446 { 452 447 type : 'fileButton', 453 448 id : 'uploadButton', 454 449 label : editor.lang.common.uploadSubmit, 450 filebrowser : 'src', 455 451 'for' : [ 'Upload', 'upload' ] 456 452 } 457 453 ] -
_source/plugins/flash/plugin.js
142 142 143 143 CKEDITOR.tools.extend( CKEDITOR.config, 144 144 { 145 flashUploadTab : true,146 flashUploadAction : 'nowhere.php',147 flashBrowseServer : true,148 149 145 /** 150 146 * Save as EMBED tag only. This tag is unrecommended. 151 147 * @type Boolean -
_source/plugins/link/dialogs/link.js
41 41 { 42 42 if ( editor.config.linkShowTargetTab ) 43 43 dialog.showPage( 'target' ); 44 if ( editor.config.linkUploadTab)44 if ( !dialog.isInitiallyHidden( 'upload' ) ) 45 45 dialog.showPage( 'upload' ); 46 46 } 47 47 else 48 48 { 49 49 dialog.hidePage( 'target' ); 50 dialog.hidePage( 'upload' ); 50 if ( !dialog.isInitiallyHidden( 'upload' ) ) 51 dialog.hidePage( 'upload' ); 51 52 } 52 53 53 54 for ( var i = 0 ; i < partIds.length ; i++ ) … … 388 389 { 389 390 type : 'button', 390 391 id : 'browse', 392 hidden : 'true', 393 filebrowser : 'url', 391 394 label : editor.lang.common.browseServer 392 395 } 393 396 ] … … 815 818 id : 'upload', 816 819 label : editor.lang.link.upload, 817 820 title : editor.lang.link.upload, 821 hidden : true, 822 filebrowser : 'uploadButton', 818 823 elements : 819 824 [ 820 825 { 821 826 type : 'file', 822 827 id : 'upload', 823 828 label : editor.lang.common.upload, 824 action : editor.config.linkUploadAction,825 829 size : 38 826 830 }, 827 831 { 828 832 type : 'fileButton', 829 833 id : 'uploadButton', 830 834 label : editor.lang.common.uploadSubmit, 835 filebrowser : 'url', 831 836 'for' : [ 'upload', 'upload' ] 832 837 } 833 838 ] … … 1039 1044 case 'url': 1040 1045 var protocol = ( data.url && data.url.protocol != undefined ) ? data.url.protocol : 'http://', 1041 1046 url = ( data.url && data.url.url ) || ''; 1042 attributes._cke_saved_href = protocol + url;1047 attributes._cke_saved_href = ( url.indexOf( '/' ) === 0 ) ? url : protocol + url; 1043 1048 break; 1044 1049 case 'anchor': 1045 1050 var name = ( data.anchor && data.anchor.name ), … … 1195 1200 }, 1196 1201 onLoad : function() 1197 1202 { 1198 if ( !editor.config.linkUploadTab )1199 this.hidePage( 'upload' ); //Hide Upload tab.1200 1201 1203 if ( !editor.config.linkShowAdvancedTab ) 1202 1204 this.hidePage( 'advanced' ); //Hide Advanded tab. 1203 1205 1204 if ( !editor.config.linkBrowseServer )1205 this.getContentElement( 'info', 'browse' ).getElement().hide();1206 1207 1206 if ( !editor.config.linkShowTargetTab ) 1208 1207 this.hidePage( 'target' ); //Hide Target tab. 1209 1208 -
_source/plugins/link/plugin.js
183 183 184 184 CKEDITOR.tools.extend( CKEDITOR.config, 185 185 { 186 linkUploadTab : true,187 linkBrowseServer : true,188 linkUploadAction : 'nowhere.php',189 186 linkShowAdvancedTab : true, 190 187 linkShowTargetTab : true 191 188 } ); -
_source/plugins/dialog/plugin.js
73 73 return null; 74 74 } 75 75 76 function deepCloneArray( list ) 77 { 78 var retval = []; 79 80 for ( var i = 0 ; i < list.length ; i++ ) 81 { 82 if ( typeof( list[ i ].pop ) == 'function' ) 83 retval.push( deepCloneArray( list[ i ] ) ); 84 else if ( typeof( list[ i ] ) == 'object' ) 85 retval.push( deepClone( list[ i ] ) ); 86 else 87 retval.push( list[ i ] ); 88 } 89 90 return retval; 91 } 92 93 function deepClone( obj ) 94 { 95 var retval = {}; 96 97 for ( var i in obj ) 98 { 99 var value = obj[ i ]; 100 if ( typeof( value.pop ) == 'function' ) 101 retval[ i ] = deepCloneArray( value ); 102 else if ( typeof( value ) == 'object' ) 103 retval[ i ] = deepClone( value ); 104 else 105 retval[ i ] = value; 106 } 107 108 return retval; 109 } 110 76 111 // Stores dialog related data from skin definitions. e.g. margin sizes. 77 112 var skinData = {}; 78 113 … … 96 131 } 97 132 98 133 // Completes the definition with the default values. 99 definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition);134 definition = deepClone( CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition ) ); 100 135 101 136 // Create a complex definition object, extending it with the API 102 137 // functions. … … 756 791 '<a class="cke_dialog_tab"', 757 792 ( this._.pageCount > 0 ? ' cke_last' : 'cke_first' ), 758 793 titleHtml, 794 ( !!contents.hidden ? ' style="display:none"' : '' ), 759 795 ' id="', contents.id + '_', CKEDITOR.tools.getNextNumber(), '"' + 760 796 ' href="javascript:void(0)"', 761 797 ' hidefocus="true">', … … 859 895 }, 860 896 861 897 /** 898 * Returns boolean variable indicating whether page was initially hidden. 899 * @param {String} id The page's Id. 900 * @returns {Boolean} true if hidden, false if not. 901 * @example 902 * dialog.isInitiallyHidden( 'upload' ); 903 */ 904 isInitiallyHidden : function( id ) 905 { 906 return !!this.definition.getContents( id ).hidden; 907 }, 908 909 /** 862 910 * Gets the root DOM element of the dialog. 863 911 * @returns {CKEDITOR.dom.element} The <span> element containing this dialog. 864 912 * @example … … 871 919 }, 872 920 873 921 /** 922 * Gets the name of the dialog. 923 * @returns {String} The name of this dialog. 924 * @example 925 * var dialogName = dialogObj.getName(); 926 */ 927 getName : function() 928 { 929 return this._.name; 930 }, 931 932 /** 874 933 * Gets a dialog UI element object from a dialog page. 875 934 * @param {String} pageId id of dialog page. 876 935 * @param {String} elementId id of UI element. … … 1786 1845 * generate the final widget.</li> 1787 1846 * <li><strong>title</strong> (Optional) The popup tooltip for the UI 1788 1847 * element.</li> 1848 * <li><strong>hidden</strong> (Optional) A flag that tells if the element 1849 * should be initially visible.</li> 1789 1850 * <li><strong>className</strong> (Optional) Additional CSS class names 1790 1851 * to add to the UI element. Separated by space.</li> 1791 1852 * <li><strong>style</strong> (Optional) Additional CSS inline styles … … 1859 1920 var styleStr = ( elementDefinition.style || '' ).split( ';' ); 1860 1921 for ( i in styles ) 1861 1922 styleStr.push( i + ':' + styles[i] ); 1923 if ( elementDefinition.hidden ) 1924 styleStr.push( 'display:none' ); 1862 1925 for ( i = styleStr.length - 1 ; i >= 0 ; i-- ) 1863 1926 { 1864 1927 if ( styleStr[i] === '' ) 1865 1928 styleStr.splice( i, 1 ); 1866 1929 } 1867 1930 if ( styleStr.length > 0 ) 1868 attributes.style = ( attributes.style ||'' ) + styleStr.join( '; ' );1931 attributes.style = ( attributes.style ? ( attributes.style + '; ' ) : '' ) + styleStr.join( '; ' ); 1869 1932 1870 1933 // Write the attributes. 1871 1934 for ( i in attributes ) … … 2183 2246 }, 2184 2247 2185 2248 /** 2249 * Gets the name of the parent tab of this element. 2250 * @returns {String} The name of selected tab. 2251 * @example 2252 * focus : function() 2253 * { 2254 * this.getParentTab(); 2255 * // do something else. 2256 * } 2257 */ 2258 getParentTab : function() 2259 { 2260 var element = this.getInputElement(), 2261 cursor = element, 2262 tabId; 2263 while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 ) 2264 { /*jsl:pass*/ } 2265 2266 tabId = cursor.getAttribute( 'name' ); 2267 2268 return tabId; 2269 }, 2270 2271 /** 2186 2272 * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page. 2187 2273 * @returns {CKEDITOR.dialog.uiElement} The current UI element. 2188 2274 * @example -
_source/core/config.js
149 149 * @example 150 150 * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea'; 151 151 */ 152 153 plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc', 154 152 plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,save,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc', 155 153 /** 156 154 * List of additional plugins to be loaded. This is a tool setting which 157 155 * makes it easier to add new plugins, whithout having to touch and -
ckeditor.pack
153 153 '_source/plugins/pagebreak/plugin.js', 154 154 '_source/plugins/pastefromword/plugin.js', 155 155 '_source/plugins/pastetext/plugin.js', 156 '_source/plugins/popup/plugin.js', 156 157 '_source/plugins/preview/plugin.js', 157 158 '_source/plugins/print/plugin.js', 158 159 '_source/plugins/removeformat/plugin.js', 159 160 '_source/plugins/resize/plugin.js', 160 161 '_source/plugins/save/plugin.js', 162 '_source/plugins/filebrowser/plugin.js', 161 163 '_source/plugins/scayt/plugin.js', 162 164 '_source/plugins/smiley/plugin.js', 163 165 '_source/plugins/showblocks/plugin.js', -
_samples/replacebycode.html
24 24 25 25 // Replace the <textarea id="editor"> with an CKEditor 26 26 // instance, using default configurations. 27 CKEDITOR.replace( 'editor1' ); 27 CKEDITOR.replace( 'editor1', 28 { 29 filebrowserBrowseUrl : '/external_ckfinder/ckfinder.html', 30 filebrowserImageBrowseUrl : '/external_ckfinder/ckfinder.html?Type=Images', 31 filebrowserFlashBrowseUrl : '/external_ckfinder/ckfinder.html?Type=Flash', 32 filebrowserUploadUrl : '/external_ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', 33 filebrowserImageUploadUrl : '/external_ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images', 34 filebrowserFlashUploadUrl : '/external_ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash' 35 } 36 ); 28 37 29 38 //]]> 30 39 </script> … … 42 51 43 52 // Replace the <textarea id="editor"> with an CKEditor 44 53 // instance, using default configurations. 45 CKEDITOR.replace( 'editor2' ); 54 CKEDITOR.replace( 'editor2', 55 { 56 /* 57 filebrowserBrowseUrl : '/external_ckfinder/ckfinder.html', 58 filebrowserUploadUrl : '/external_ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', 59 */ 60 } 61 ); 46 62 47 63 //]]> 48 64 </script>