Changeset 471
- Timestamp:
- 03/13/06 11:02:45 (7 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
htmlarea.css (modified) (1 diff)
-
htmlarea.js (modified) (11 diffs)
-
lang/de.js (modified) (1 diff)
-
lang/fr.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htmlarea.css
r462 r471 232 232 .htmlarea .panels.left h1 { border-left:none; } 233 233 .htmlarea { border: 1px solid black; } 234 235 .loading 236 { 237 background-color:#666; 238 position:absolute; 239 z-index:998; 240 } 241 .loading_main 242 { 243 font-size:1.6em; 244 color:#ff6; 245 text-align:center; 246 } 247 .loading_sub 248 { 249 font-size:1.0em; 250 color:#fff; 251 text-align:center; 252 } -
trunk/htmlarea.js
r470 r471 99 99 h: textarea.style.height ? textarea.style.height : (textarea.offsetHeight ? (textarea.offsetHeight + 'px') : (textarea.rows+'em')) 100 100 }; 101 // Create the loading message elements 102 if (this.config.showLoading) 103 { 104 // Create and show the main loading message and the sub loading message for details of loading actions 105 // global element 106 var loading_message = document.createElement("div"); 107 loading_message.id = "loading_" + textarea.name; 108 loading_message.className = "loading"; 109 try 110 { 111 // how can i find the real width in pixels without % or em *and* with no visual errors ? 112 // for instance, a textarea with a style="width:100%" and the body padding > 0 result in a horizontal scrollingbar while loading 113 // A few lines above seems to indicate offsetWidth is not always set 114 loading_message.style.width = textarea.offsetWidth + 'px'; 115 } 116 catch (e) 117 { 118 // offsetWidth seems not set, so let's use this._initial_ta_size.w, but sometimes it may be too huge width 119 loading_message.style.width = this._initial_ta_size.w; 120 } 121 loading_message.style.left = HTMLArea.findPosX(textarea) + 'px'; 122 loading_message.style.top = (HTMLArea.findPosY(textarea) + parseInt(this._initial_ta_size.h) / 2) + 'px'; 123 // main static message 124 var loading_main = document.createElement("div"); 125 loading_main.className = "loading_main"; 126 loading_main.id = "loading_main_" + textarea.name; 127 loading_main.appendChild(document.createTextNode(HTMLArea._lc("Loading in progress. Please wait !"))); 128 // sub dynamic message 129 var loading_sub = document.createElement("div"); 130 loading_sub.className = "loading_sub"; 131 loading_sub.id = "loading_sub_" + textarea.name; 132 loading_sub.appendChild(document.createTextNode(HTMLArea._lc("Constructing main object"))); 133 loading_message.appendChild(loading_main); 134 loading_message.appendChild(loading_sub); 135 document.body.appendChild(loading_message); 136 this.setLoadingMessage("Constructing object"); 137 } 101 138 102 139 this._editMode = "wysiwyg"; … … 297 334 298 335 this.flowToolbars = true; 336 337 // set to true if you want the loading panel to show at startup 338 this.showLoading = false; 299 339 300 340 /** CUSTOMIZING THE TOOLBAR … … 535 575 { 536 576 if(!side) side = 'right'; 577 this.setLoadingMessage('Register panel ' + side); 537 578 var panel = this.addPanel(side); 538 579 if(object) … … 716 757 // Creates the toolbar and appends it to the _htmlarea 717 758 HTMLArea.prototype._createToolbar = function () { 759 this.setLoadingMessage('Create Toolbar'); 718 760 var editor = this; // to access this in nested functions 719 761 … … 1144 1186 1145 1187 HTMLArea.prototype._createStatusBar = function() { 1188 this.setLoadingMessage('Create StatusBar'); 1146 1189 var statusbar = document.createElement("div"); 1147 1190 statusbar.className = "statusBar"; … … 1177 1220 HTMLArea.prototype.generate = function () 1178 1221 { 1222 this.setLoadingMessage('Generate Xinha object'); 1179 1223 var editor = this; // we'll need "this" in some nested functions 1180 1224 … … 1427 1471 HTMLArea.prototype.initSize = function() 1428 1472 { 1473 this.setLoadingMessage('Init editor size'); 1429 1474 var editor = this; 1430 1475 … … 1842 1887 HTMLArea.prototype.initIframe = function() 1843 1888 { 1889 this.setLoadingMessage('Init IFrame'); 1844 1890 this.disableToolbar(); 1845 1891 var doc = null; … … 2052 2098 editor._onGenerate(); 2053 2099 } 2100 editor.removeLoadingMessage(); 2054 2101 } 2055 2102 ); … … 5605 5652 for(var i = 0; i < plugin_names.length; i++) 5606 5653 { 5654 this.setLoadingMessage('Register plugin $plugin', 'HTMLArea', {'plugin': plugin_names[i]}); 5607 5655 this.registerPlugin(eval(plugin_names[i])); 5608 5656 } … … 5718 5766 } 5719 5767 5768 // find X position of an element 5769 HTMLArea.findPosX = function(obj) 5770 { 5771 var curleft = 0; 5772 if (obj.offsetParent) 5773 { 5774 while (obj.offsetParent) 5775 { 5776 curleft += obj.offsetLeft 5777 obj = obj.offsetParent; 5778 } 5779 } 5780 else if (obj.x) 5781 { 5782 curleft += obj.x; 5783 } 5784 return curleft; 5785 }; 5786 5787 // find Y position of an element 5788 HTMLArea.findPosY = function(obj) 5789 { 5790 var curtop = 0; 5791 if (obj.offsetParent) 5792 { 5793 while (obj.offsetParent) 5794 { 5795 curtop += obj.offsetTop 5796 obj = obj.offsetParent; 5797 } 5798 } 5799 else if (obj.y) 5800 { 5801 curtop += obj.y; 5802 } 5803 return curtop; 5804 }; 5805 5806 HTMLArea.prototype.setLoadingMessage = function(string, context, replace) 5807 { 5808 if (!this.config.showLoading || !document.getElementById("loading_sub_" + this._textArea.name)) { return ; } 5809 var elt = document.getElementById("loading_sub_" + this._textArea.name); 5810 elt.innerHTML = HTMLArea._lc(string, context, replace); 5811 }; 5812 5813 HTMLArea.prototype.removeLoadingMessage = function() 5814 { 5815 if (!this.config.showLoading || !document.getElementById("loading_" + this._textArea.name)) { return ; } 5816 document.body.removeChild(document.getElementById("loading_" + this._textArea.name)); 5817 }; 5818 5720 5819 HTMLArea.toFree = [ ]; 5721 5820 HTMLArea.freeLater = function(obj,prop) -
trunk/lang/de.js
r383 r471 145 145 "Clean content pasted from Word": "Von Word eingefÃŒgter Text bereinigen", 146 146 "Headings": "Ãberschrift Typ 1 bis 6", 147 "Close": "SchlieÃen" 147 "Close": "SchlieÃen", 148 149 // Loading messages 150 "Loading in progress. Please wait !": "Editor wird geladen. Bitte warten !", 151 "Constructing main object": "Hauptteil wird erzeugt", 152 "Create Toolbar": "Bearbeitungswerkzeuge werden angelegt", 153 "Register panel right": "Erzeugt rechte Leiste", 154 "Register panel left": "Erzeugt linke Leiste", 155 "Register panel top": "Erzeugt obere Leiste", 156 "Register panel bottom": "Erzeugt untere Leiste" 148 157 }; -
trunk/lang/fr.js
r465 r471 149 149 "Clean content pasted from Word": "Nettoyage du contenu copié depuis Word", 150 150 "Headings": "Titres", 151 "Close": "Fermer" 151 "Close": "Fermer", 152 153 // Loading messages 154 "Loading in progress. Please wait !": "Chargement en cours. Veuillez patienter !", 155 "Constructing main object": "Construction de l'objet principal", 156 "Constructing object": "Construction de l'objet", 157 "Register panel right": "Enregistrement du panneau droit", 158 "Register panel left": "Enregistrement du panneau gauche", 159 "Register panel top": "Enregistrement du panneau supérieur", 160 "Register panel bottom": "Enregistrement du panneau inférieur", 161 "Create Toolbar": "Construction de la barre d'icones", 162 "Create StatusBar": "Construction de la barre de status", 163 "Generate Xinha object": "Génération de l'objet Xinha", 164 "Init editor size": "Initialisation de la taille d'édition", 165 "Init IFrame": "Initialisation de l'iframe", 166 "Register plugin $plugin": "Enregistrement du plugin $plugin" 152 167 };
