Changeset 791
- Timestamp:
- 03/19/07 16:27:42 (6 years ago)
- Location:
- branches/ray
- Files:
-
- 9 modified
-
XinhaCore.js (modified) (1 diff)
-
XinhaLoader.js (modified) (1 diff)
-
examples/testbed.html (modified) (2 diffs)
-
modules/ColorPicker/ColorPicker.js (modified) (1 diff)
-
modules/Dialogs/XinhaDialog.js (modified) (15 diffs)
-
modules/InsertImage/InsertImage.js (modified) (1 diff)
-
plugins/CharacterMap/character-map.js (modified) (1 diff)
-
plugins/ExtendedFileManager/images.php (modified) (3 diffs)
-
plugins/Stylist/stylist.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ray/XinhaCore.js
r786 r791 5742 5742 document.body.appendChild(loading_message); 5743 5743 5744 Xinha.freeLater(loading_message); 5745 Xinha.freeLater(loading_main); 5746 Xinha.freeLater(loading_sub); 5747 5744 5748 return loading_sub; 5745 5749 }; -
branches/ray/XinhaLoader.js
r782 r791 22 22 Xinha.createLoadingMessages(xinha_editors); 23 23 var loadingMessages = Xinha.loadingMessages; 24 Xinha._loadback(_editor_url + "XinhaCore.js",function () { 24 Xinha._loadback(_editor_url + "XinhaCore.js",function () { 25 25 Xinha.removeLoadingMessages(xinha_editors); 26 26 Xinha.createLoadingMessages(xinha_editors); -
branches/ray/examples/testbed.html
r786 r791 63 63 [ 64 64 'CharacterMap', 65 'Linker',66 'Stylist',67 'SmartReplace'65 // 'Linker', 66 // 'Stylist', 67 // 'SmartReplace' 68 68 ]; 69 69 // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) … … 87 87 // xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 88 88 89 xinha_config.CharacterMap.mode = 'panel';90 xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css'));89 //xinha_config.CharacterMap.mode = 'panel'; 90 //xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 91 91 92 92 /* -
branches/ray/modules/ColorPicker/ColorPicker.js
r786 r791 892 892 colPicker.open("",chooser, input.value ); 893 893 } 894 Xinha.freeLater(this,"chooser"); 894 895 } 895 896 Xinha.colorPicker.InputBinding.prototype.setColor = function (color) -
branches/ray/modules/Dialogs/XinhaDialog.js
r786 r791 37 37 this.editor = editor; 38 38 this.document = document; 39 this.size = size; 39 40 this.modal = (options && options.modal === false) ? false : true; 40 41 this.closable = (options && options.closable === false) ? false : true; 41 42 this.layer = (options && options.layer) ? options.layer : 0; 42 43 43 if ( !this.background ) 44 { 45 this.background = []; 46 47 if (Xinha.is_ie) 48 { // IE6 needs the iframe to hide select boxes 49 var backG = document.createElement("iframe"); 50 backG.src = "about:blank"; 51 } 52 else 53 { // Mozilla (<FF3) can't have the iframe, because it hides the caret in text fields 54 // see https://bugzilla.mozilla.org/show_bug.cgi?id=226933 55 // unfortunately https://bugzilla.mozilla.org/show_bug.cgi?id=230701 indicates that this is an issue with pos fixed div, too 56 var backG = document.createElement("div"); 57 } 58 backG.className = "xinha_dialog_background"; 59 with (backG.style) 60 { 61 position = "absolute";//(Xinha.is_ie) ? "absolute" : "fixed"; 62 top = 0; 63 left = 0; 64 border = 'none'; 65 overflow = "hidden"; 66 display = "none"; 67 zIndex = (this.modal ? 1025 : 1001 ) + this.layer; 68 } 69 document.body.appendChild(backG); 70 this.background.push(backG); 71 72 backG = document.createElement("div"); 73 with (backG.style) 74 { 75 position = "absolute"; 76 top = 0; 77 left = 0; 78 overflow = "hidden"; 79 display = "none"; 80 zIndex = (this.modal ? 1026 : 1002 ) + this.layer; 81 } 82 document.body.appendChild(backG); 83 this.background.push(backG); 84 backG = null; 85 Xinha.freeLater(this.background); 86 } 44 45 if (Xinha.is_ie) 46 { // IE6 needs the iframe to hide select boxes 47 var backG = document.createElement("iframe"); 48 backG.src = "about:blank"; 49 backG.onreadystatechange = function () 50 { 51 var doc = window.event.srcElement.contentWindow.document; 52 if (doc && doc.body) 53 { 54 doc.body.style.backgroundColor = "#666666"; 55 } 56 } 57 } 58 else 59 { // Mozilla (<FF3) can't have the iframe, because it hides the caret in text fields 60 // see https://bugzilla.mozilla.org/show_bug.cgi?id=226933 61 var backG = document.createElement("div"); 62 } 63 backG.className = "xinha_dialog_background"; 64 with (backG.style) 65 { 66 position = "absolute"; 67 top = 0; 68 left = 0; 69 border = 'none'; 70 overflow = "hidden"; 71 display = "none"; 72 zIndex = (this.modal ? 1025 : 1001 ) + this.layer; 73 } 74 document.body.appendChild(backG); 75 this.background = backG; 76 77 backG = null; 78 Xinha.freeLater(this, "background"); 79 87 80 var rootElem = document.createElement('div'); 88 81 //I've got the feeling dragging is much slower in IE7 w/ pos:fixed, besides the strange fact that it only works in Strict mode … … 106 99 107 100 rootElem.style.paddingBottom = "10px"; 108 rootElem.style.width = size.width + 'px'; 109 110 111 this.size = size; 101 rootElem.style.width = size.width ? size.width + 'px' : ''; 102 112 103 if (size.height) 113 104 { … … 122 113 } 123 114 124 if(typeof localizer == 'function') 125 { 126 this._lc = localizer; 127 } 128 else if(localizer) 129 { 130 this._lc = function(string) 131 { 132 return Xinha._lc(string,localizer); 133 }; 134 } 135 else 136 { 137 this._lc = function(string) 138 { 139 return string; 140 }; 141 } 142 143 html = this.translateHtml(html) 115 html = this.translateHtml(html,localizer) 144 116 145 117 var main = document.createElement('div'); … … 154 126 captionBar.style.MozUserSelect = "none"; 155 127 156 var closer = null; 128 this.buttons = document.createElement('div'); 129 with (this.buttons.style) 130 { 131 position = "absolute"; 132 top = "0"; 133 right = "2px"; 134 } 135 rootElem.appendChild(this.buttons); 136 137 this.closer = null; 157 138 if ( this.closable ) 158 139 { 159 var closer = document.createElement('div'); 160 closer.className= 'closeButton'; 161 162 closer.onmousedown = function(ev) { this.className = "closeButton buttonClick"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 163 closer.onmouseout = function(ev) { this.className = "closeButton"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 164 closer.onmouseup = function() { this.className = "closeButton"; dialog.hide(); return false;}; 165 captionBar.appendChild(closer); 140 this.closer = document.createElement('div'); 141 this.closer.className= 'closeButton'; 142 143 this.closer.onmousedown = function(ev) { this.className = "closeButton buttonClick"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 144 this.closer.onmouseout = function(ev) { this.className = "closeButton"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 145 this.closer.onmouseup = function() { this.className = "closeButton"; dialog.hide(); return false;}; 146 147 this.buttons.appendChild(this.closer); 166 148 167 149 var butX = document.createElement('span'); … … 170 152 butX.style.top = '-3px'; 171 153 172 butX.appendChild(document.createTextNode('\u00D7')); 173 closer.appendChild(butX); 154 butX.appendChild(document.createTextNode('\u00D7')); // cross 155 //butX.appendChild(document.createTextNode('\u25AC')); //bar 156 //butX.appendChild(document.createTextNode('\u25BA')); //triangle right 157 //butX.appendChild(document.createTextNode('\u25B2')); //triangle up 158 //butX.appendChild(document.createTextNode('\u25BC')); //triangle down 159 this.closer.appendChild(butX); 174 160 butX = null; 175 161 } 176 162 177 var icon = document.createElement('img'); 178 icon.className = 'icon'; 179 icon.src = _editor_url + 'images/xinha-small-icon.gif'; 180 icon.style.position = 'absolute'; 181 icon.style.top = '3px'; 182 icon.style.left = '2px'; 163 this.icon = document.createElement('img'); 164 with (this.icon) 165 { 166 className = 'icon'; 167 src = _editor_url + 'images/xinha-small-icon.gif'; 168 style.position = 'absolute'; 169 style.top = '3px'; 170 style.left = '2px'; 171 } 183 172 captionBar.style.paddingLeft = '22px'; 184 captionBar.appendChild(icon); 185 173 rootElem.appendChild(this.icon); 186 174 187 175 var all = rootElem.getElementsByTagName("*"); … … 201 189 } 202 190 203 var resizeHandle= document.createElement('div');204 resizeHandle.className = "resizeHandle";205 with ( resizeHandle.style)191 this.resizer = document.createElement('div'); 192 this.resizer.className = "resizeHandle"; 193 with (this.resizer.style) 206 194 { 207 195 position = "absolute"; … … 209 197 right= "0px"; 210 198 } 211 resizeHandle.onmousedown = function(ev) { dialog._resizeStart(ev); };212 rootElem.appendChild( resizeHandle);199 this.resizer.onmousedown = function(ev) { dialog._resizeStart(ev); }; 200 rootElem.appendChild(this.resizer); 213 201 214 202 this.rootElem = rootElem; 215 203 this.captionBar = captionBar; 216 204 this.main = main; 217 this.closer = closer; 218 this.icon = icon; 219 this.resizer = resizeHandle; 220 221 captionBar = 222 rootElem = 223 rootElem = 224 main = 225 closer = 226 icon = 205 206 captionBar = null; 207 rootElem = null; 208 main = null; 227 209 resizeHandle = null; 228 210 229 Xinha.freeLater(this,'rootElem'); 211 Xinha.freeLater(this,"rootElem"); 212 Xinha.freeLater(this,"captionBar"); 213 Xinha.freeLater(this,"main"); 214 Xinha.freeLater(this, "buttons"); 215 Xinha.freeLater(this, "closer"); 216 Xinha.freeLater(this, "icon"); 217 Xinha.freeLater(this, "resizer"); 218 Xinha.freeLater(this, "document"); 230 219 231 220 // for caching size & position after dragging & resizing … … 233 222 234 223 }; 235 236 Xinha.Dialog.activateModeless = function(dialog)237 {238 var zIndex;239 if (Xinha.Dialog.activeModeless == dialog || dialog.attached )240 {241 return;242 }243 244 if (Xinha.Dialog.activeModeless )245 {246 Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) -10;247 }248 Xinha.Dialog.activeModeless = dialog;249 250 Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) + 10;251 }252 253 Xinha.Dialog.prototype.sizeBackground = function()254 {255 var pageSize = Xinha.pageSize();256 257 if ( this.modal )258 {259 this.resizeBackground({width: pageSize.x + 'px', height: pageSize.y + 'px'});260 }261 //window.scroll(this.scrollPos.x, this.scrollPos.y);262 }263 224 264 225 Xinha.Dialog.prototype.onresize = function() … … 291 252 { 292 253 dialog.saveSelection = function() { dialog._lastRange = dialog.editor.saveSelection();}; 293 Xinha._addEvent(this.editor._doc .body,'mouseup', dialog.saveSelection);254 Xinha._addEvent(this.editor._doc,'mouseup', dialog.saveSelection); 294 255 } 295 256 … … 304 265 } 305 266 306 if ( !this.attached )267 if ( !this.attached ) 307 268 { 308 269 this.showBackground(); 309 270 var viewport = Xinha.viewportSize(); 310 this.sizeBackground(); 271 if ( modal ) 272 { 273 var pageSize = Xinha.pageSize(); 274 this.resizeBackground({width:pageSize.x + "px",height:pageSize.y + "px"}); 275 } 311 276 var viewportHeight = viewport.y; 312 277 var viewportWidth = viewport.x; … … 382 347 if (!modal) 383 348 { 384 this. sizeBackground({width: dialogWidth + 'px', height: dialogHeight + 'px' });349 this.resizeBackground({width: dialogWidth + 'px', height: dialogHeight + 'px' }); 385 350 this.posBackground({top: rootElemStyle.top, left: rootElemStyle.left}); 386 351 } … … 419 384 if (Xinha.is_ie && !this.modal) 420 385 { 421 Xinha._removeEvent(this.editor._doc .body,'mouseup', dialog.saveSelection);386 Xinha._removeEvent(this.editor._doc,'mouseup', dialog.saveSelection); 422 387 } 423 388 … … 688 653 Xinha.Dialog.prototype.hideBackground = function() 689 654 { 690 this.background[0].style.display = 'none'; 691 this.background[1].style.display = 'none'; 655 this.background.style.display = 'none'; 692 656 } 693 657 Xinha.Dialog.prototype.showBackground = function() 694 658 { 695 this.background[0].style.display = ''; 696 this.background[1].style.display = ''; 659 this.background.style.display = ''; 697 660 } 698 661 Xinha.Dialog.prototype.posBackground = function(pos) 699 662 { 700 this.background[0].style.top = pos.top; 701 this.background[0].style.left = pos.left; 702 this.background[1].style.top = pos.top; 703 this.background[1].style.left = pos.left; 663 this.background.style.top = pos.top; 664 this.background.style.left = pos.left; 704 665 } 705 666 Xinha.Dialog.prototype.resizeBackground = function(size) 706 667 { 707 this.background[0].style.width = size.width; 708 this.background[0].style.height = size.height; 709 this.background[1].style.width = size.width; 710 this.background[1].style.height = size.height; 668 this.background.style.width = size.width; 669 this.background.style.height = size.height; 711 670 } 712 671 Xinha.Dialog.prototype.posDialog = function(pos) … … 916 875 }; 917 876 918 Xinha.Dialog.prototype.translateHtml = function(html) 919 { 920 var dialog = this; 877 Xinha.Dialog.prototype.translateHtml = function(html,localizer) 878 { 879 var dialog = this; 880 if(typeof localizer == 'function') 881 { 882 dialog._lc = localizer; 883 } 884 else if(localizer) 885 { 886 this._lc = function(string) 887 { 888 return Xinha._lc(string,localizer); 889 }; 890 } 891 else 892 { 893 this._lc = function(string) 894 { 895 return string; 896 }; 897 } 898 921 899 html = html.replace(/\[([a-z0-9_]+)\]/ig, 922 900 function(fullString, id) … … 943 921 } 944 922 923 924 Xinha.Dialog.activateModeless = function(dialog) 925 { 926 var zIndex; 927 if (Xinha.Dialog.activeModeless == dialog || dialog.attached ) 928 { 929 return; 930 } 931 932 if (Xinha.Dialog.activeModeless ) 933 { 934 Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) -10; 935 } 936 Xinha.Dialog.activeModeless = dialog; 937 938 Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) + 10; 939 } -
branches/ray/modules/InsertImage/InsertImage.js
r762 r791 101 101 this.dialog.onresize = function () 102 102 { 103 this.getElementById("ipreview").style.height = 103 104 105 var newHeightForPreview = 104 106 parseInt(this.height,10) 105 107 - this.getElementById('h1').offsetHeight 106 108 - this.getElementById('buttons').offsetHeight 107 109 - this.getElementById('inputs').offsetHeight 108 - parseInt(this.rootElem.style.paddingBottom,10) // we have a padding at the bottom, gotta take this into acount 109 + 'px'; // don't forget this ;) 110 - parseInt(this.rootElem.style.paddingBottom,10); // we have a padding at the bottom, gotta take this into acount 110 111 111 this.getElementById("ipreview").style.width =(this.width - 2) + 'px'; // and the width 112 113 this.getElementById("ipreview").style.height = ((newHeightForPreview > 0) ? newHeightForPreview : 0) + "px"; // no-go beyond 0 114 115 this.getElementById("ipreview").style.width = this.width - 2 + 'px'; // and the width 112 116 113 117 } -
branches/ray/plugins/CharacterMap/character-map.js
r786 r791 59 59 return false; 60 60 }; 61 this.dialog. rootElem.appendChild( a );61 this.dialog.main.appendChild( a ); 62 62 a = null; 63 63 }; -
branches/ray/plugins/ExtendedFileManager/images.php
r761 r791 27 27 28 28 //process paste 29 if (isset($_GET['paste'])) 30 $pasteStatus = $manager->processPaste(); 31 32 if ($manager->deleteFiles()) 33 $refreshFile = true; 29 $pasteStatus = (isset($_GET['paste'])) ? $manager->processPaste() : false; 30 31 $refreshFile = ($manager->deleteFiles()) ? true : false; 34 32 35 33 $refreshDir = false; … … 51 49 } 52 50 53 54 $afruViewType=""; 55 if(isset($_REQUEST['viewtype'])) 56 { 57 $afruViewType=$_REQUEST['viewtype']; 58 } 51 $afruViewType = (isset($_REQUEST['viewtype'])) ? $afruViewType=$_REQUEST['viewtype'] : ''; 52 59 53 if($afruViewType!="thumbview" && $afruViewType!="listview") 60 61 $afruViewType=$IMConfig['view_type'];62 54 { 55 $afruViewType=$IMConfig['view_type']; 56 } 63 57 //get the list of files and directories 64 58 $list = $manager->getFiles($relative); … … 139 133 <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> 140 134 <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> 141 <?php $thisFileNameLength -= 6;} ?>135 <?php } ?> 142 136 </td> 143 137 </tr> -
branches/ray/plugins/Stylist/stylist.js
r786 r791 782 782 this.dialog = new Xinha.Dialog(editor, html, 'Stylist',{width:200},{modal:false,closable:false}); 783 783 Xinha._addClass( this.dialog.rootElem, 'Stylist' ); 784 this.dialog.attachToPanel('right');784 //this.dialog.attachToPanel('right'); 785 785 this.dialog.show(); 786 786
