Changeset 1044
- Timestamp:
- 10/02/08 12:07:26 (2 months ago)
- Location:
- trunk
- Files:
-
- 18 added
- 4 removed
- 27 modified
-
Xinha.css (modified) (6 diffs)
-
XinhaCore.js (modified) (18 diffs)
-
modules/ColorPicker/ColorPicker.js (modified) (1 diff)
-
modules/CreateLink/dialog.html (added)
-
modules/CreateLink/link.js (modified) (4 diffs)
-
modules/CreateLink/pluginMethods.js (added)
-
modules/Dialogs/XinhaDialog.js (added)
-
modules/Dialogs/inline-dialog.js (deleted)
-
modules/Gecko/Gecko.js (modified) (3 diffs)
-
modules/InlineStyler (added)
-
modules/InlineStyler/InlineStyler.js (added)
-
modules/InsertImage/dialog.html (added)
-
modules/InsertImage/insert_image.js (modified) (3 diffs)
-
modules/InsertImage/pluginMethods.js (added)
-
modules/InsertTable/dialog.html (added)
-
modules/InsertTable/insert_table.js (modified) (2 diffs)
-
modules/InsertTable/pluginMethods.js (added)
-
modules/InternetExplorer/InternetExplorer.js (modified) (5 diffs)
-
modules/Opera/Opera.js (modified) (2 diffs)
-
modules/WebKit/WebKit.js (modified) (3 diffs)
-
plugins/Abbreviation/abbreviation.js (modified) (2 diffs)
-
plugins/Abbreviation/dialog.html (added)
-
plugins/Abbreviation/popups (deleted)
-
plugins/BackgroundImage/background-image.js (modified) (1 diff)
-
plugins/BackgroundImage/dialog.html (added)
-
plugins/BackgroundImage/popups (deleted)
-
plugins/CharacterMap/CharacterMap.css (modified) (1 diff)
-
plugins/CharacterMap/character-map.js (modified) (3 diffs)
-
plugins/InsertAnchor/dialog.html (added)
-
plugins/InsertAnchor/insert-anchor.js (modified) (5 diffs)
-
plugins/Linker/linker.js (modified) (1 diff)
-
plugins/Linker/pluginMethods.js (added)
-
plugins/PasteText/lang/de.js (modified) (1 diff)
-
plugins/PasteText/paste-text.js (modified) (3 diffs)
-
plugins/PasteText/popups/paste_text.html (modified) (1 diff)
-
plugins/SmartReplace/dialog.html (modified) (1 diff)
-
plugins/SmartReplace/smart-replace.js (modified) (7 diffs)
-
plugins/Stylist/stylist.js (modified) (6 diffs)
-
plugins/SuperClean/dialog.html (modified) (1 diff)
-
plugins/SuperClean/lang/de.js (modified) (1 diff)
-
plugins/SuperClean/pluginMethods.js (added)
-
plugins/SuperClean/super-clean.js (modified) (6 diffs)
-
plugins/TableOperations/popups/dialogMergeCells.html (added)
-
plugins/TableOperations/popups/dialogRowCell.html (added)
-
plugins/TableOperations/popups/dialogTable.html (added)
-
plugins/TableOperations/table-operations.js (modified) (20 diffs)
-
plugins/UnFormat/dialog.html (added)
-
plugins/UnFormat/popups (deleted)
-
plugins/UnFormat/un-format.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xinha.css
r980 r1044 114 114 .dialog { 115 115 color: ButtonText; 116 background: ButtonFace; 117 } 118 116 background: ButtonFace; 117 border: 1px outset; 118 border-color: WindowFrame; 119 } 120 div.dialog { 121 padding-bottom:10px; 122 } 123 .xinha_dialog_background { 124 filter: alpha(opacity=0); 125 -moz-opacity: 0; 126 opacity: 0; 127 border:none; 128 } 129 .xinha_dialog_background.modal.greyout { 130 background-color:#666; 131 filter: alpha(opacity=70) !IMPORTANT; 132 -moz-opacity: 0.7; 133 opacity: 0.7; 134 } 135 .xinha_dialog_background.modal { 136 filter: alpha(opacity=0) !IMPORTANT; 137 -moz-opacity: 0; 138 opacity: 0; 139 border:none; 140 } 141 body.xinha_dialog_background.modal.greyout { 142 filter: alpha(opacity=100) !IMPORTANT; 143 } 144 body.xinha_dialog_background.modal { 145 filter: alpha(opacity=0); 146 } 119 147 .dialog .content { padding: 2px; } 120 148 … … 127 155 .dialog .title, .dialog h1 128 156 { 129 background: #008;130 color: #ff8;157 background: ActiveCaption; 158 color: CaptionText; 131 159 border-bottom: 1px solid #000; 132 160 padding: 1px 0px 2px 5px; … … 134 162 font-weight: bold; 135 163 cursor: default; 136 } 137 .dialog h1 { margin:0px;} 164 letter-spacing: 0.01em; 165 } 166 .dialog h1 { margin:0;} 138 167 .dialog .title .button { 139 168 float: right; … … 148 177 149 178 .dialog button { 150 width: 5 em;179 width: 5.5em; 151 180 padding: 0px; 152 181 } 153 182 .dialog .closeButton { 183 padding: 0px; 184 cursor: default; 185 border: 1px solid; 186 border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 187 height : 11px; 188 width : 11px; 189 vertical-align : top; 190 position : absolute; 191 top : 3px; 192 right : 2px; 193 background-color: ButtonFace; 194 color: ButtonText; 195 font-size: 13px; 196 font-family: Tahoma,Verdana,sans-serif; 197 text-align:center; 198 letter-spacing:0; 199 overflow:hidden; 200 } 154 201 .dialog .buttonColor { 155 202 width :1em; … … 179 226 .dialog .label { text-align: right; width: 6em; } 180 227 .dialog .value input { width: 100%; } 181 .dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }182 228 183 229 .dialog legend { font-weight: bold; } 184 230 .dialog fieldset table { margin: 2px 0px; } 185 231 232 .dialog .buttons { 233 234 padding: 1em; 235 text-align: center; 236 } 237 .dialog .resizeHandle { 238 -moz-appearance : resizer; 239 width: 12px; 240 height: 12px; 241 border-bottom: 2px solid #000; 242 border-right: 2px solid #000; 243 cursor : nw-resize; 244 } 186 245 .popupwin { 187 246 padding: 0px; … … 229 288 230 289 .htmlarea .panel h1 { 231 background: ButtonFace;232 border: 1px solid;233 border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;234 margin: 0px;235 padding: 0px;236 font-size:100%;237 font-weight:bold;238 padding: 2px;239 290 clear:left; 240 241 } 242 243 .htmlarea .panel { overflow:hidden; } 291 font-size:0.9em; 292 } 293 294 .htmlarea .panel { 295 overflow:hidden; 296 background-color:white; 297 padding-bottom:0 !IMPORTANT; 298 border: none !IMPORTANT; 299 } 244 300 .htmlarea .panels.left .panel { border-right:none; border-left:none; } 245 301 .htmlarea .panels.left h1 { border-right:none; } -
trunk/XinhaCore.js
r1032 r1044 977 977 "Formatted": "pre" 978 978 }; 979 980 this.dialogOptions = 981 { 982 'centered' : true, //true: dialog is shown in the center the screen, false dialog is shown near the clicked toolbar button 983 'greyout':true, //true: when showing modal dialogs, the page behind the dialoge is greyed-out 984 'closeOnEscape':true 985 }; 986 979 987 /** ?? 980 988 * Default: <code>{}</code> … … 1782 1790 function(ev) 1783 1791 { 1784 ev = Xinha.is_ie ? window.event : ev;1785 editor.btnClickEvent = ev;1792 ev = ev || window.event; 1793 editor.btnClickEvent = {clientX : ev.clientX, clientY : ev.clientY}; 1786 1794 if ( obj.enabled ) 1787 1795 { … … 2100 2108 } 2101 2109 2102 if ( typeof Xinha.Dialog == 'undefined' && !Xinha._loadback( _editor_url + 'modules/Dialogs/ inline-dialog.js' , this.generate, this ) )2110 if ( typeof Xinha.Dialog == 'undefined' && !Xinha._loadback( _editor_url + 'modules/Dialogs/XinhaDialog.js' , this.generate, this ) ) 2103 2111 { 2104 2112 return false; … … 2259 2267 fw.table.appendChild(fw.tbody); 2260 2268 2261 var xinha = this._framework.table;2269 var xinha = fw.table; 2262 2270 this._htmlArea = xinha; 2263 2271 Xinha.freeLater(this, '_htmlArea'); … … 2265 2273 2266 2274 // create the toolbar and put in the area 2267 this._framework.tb_cell.appendChild( this._createToolbar() );2275 fw.tb_cell.appendChild( this._createToolbar() ); 2268 2276 2269 2277 // create the IFRAME & add to container … … 2271 2279 iframe.src = this.popupURL(editor.config.URIs.blank); 2272 2280 iframe.id = "XinhaIFrame_" + this._textArea.id; 2273 this._framework.ed_cell.appendChild(iframe);2281 fw.ed_cell.appendChild(iframe); 2274 2282 this._iframe = iframe; 2275 2283 this._iframe.className = 'xinha_iframe'; … … 2278 2286 // creates & appends the status bar 2279 2287 var statusbar = this._createStatusBar(); 2280 this._framework.sb_cell.appendChild(statusbar);2288 fw.sb_cell.appendChild(statusbar); 2281 2289 2282 2290 // insert Xinha before the textarea. … … 2287 2295 // extract the textarea and insert it into the xinha framework 2288 2296 Xinha.removeFromParent(textarea); 2289 this._framework.ed_cell.appendChild(textarea);2297 fw.ed_cell.appendChild(textarea); 2290 2298 2291 2299 // if another editor is activated while this one is in text mode, toolbar is disabled … … 2469 2477 this._risizing = true; 2470 2478 2479 var framework = this._framework; 2480 2471 2481 this.notifyOf('before_resize', {width:width, height:height}); 2472 2482 this.firePluginEvent('onBeforeResize', width, height); … … 2580 2590 // } 2581 2591 2582 this._framework.tb_cell.colSpan = col_span;2583 this._framework.tp_cell.colSpan = col_span;2584 this._framework.bp_cell.colSpan = col_span;2585 this._framework.sb_cell.colSpan = col_span;2592 framework.tb_cell.colSpan = col_span; 2593 framework.tp_cell.colSpan = col_span; 2594 framework.bp_cell.colSpan = col_span; 2595 framework.sb_cell.colSpan = col_span; 2586 2596 2587 2597 // Put in the panel rows, top panel goes above editor row 2588 if ( ! this._framework.tp_row.childNodes.length )2589 { 2590 Xinha.removeFromParent( this._framework.tp_row);2598 if ( !framework.tp_row.childNodes.length ) 2599 { 2600 Xinha.removeFromParent(framework.tp_row); 2591 2601 } 2592 2602 else 2593 2603 { 2594 if ( !Xinha.hasParentNode( this._framework.tp_row) )2595 { 2596 this._framework.tbody.insertBefore(this._framework.tp_row, this._framework.ler_row);2604 if ( !Xinha.hasParentNode(framework.tp_row) ) 2605 { 2606 framework.tbody.insertBefore(framework.tp_row, framework.ler_row); 2597 2607 } 2598 2608 } 2599 2609 2600 2610 // bp goes after the editor 2601 if ( ! this._framework.bp_row.childNodes.length )2602 { 2603 Xinha.removeFromParent( this._framework.bp_row);2611 if ( !framework.bp_row.childNodes.length ) 2612 { 2613 Xinha.removeFromParent(framework.bp_row); 2604 2614 } 2605 2615 else 2606 2616 { 2607 if ( !Xinha.hasParentNode( this._framework.bp_row) )2608 { 2609 this._framework.tbody.insertBefore(this._framework.bp_row, this._framework.ler_row.nextSibling);2617 if ( !Xinha.hasParentNode(framework.bp_row) ) 2618 { 2619 framework.tbody.insertBefore(framework.bp_row, framework.ler_row.nextSibling); 2610 2620 } 2611 2621 } … … 2614 2624 if ( !this.config.statusBar ) 2615 2625 { 2616 Xinha.removeFromParent( this._framework.sb_row);2626 Xinha.removeFromParent(framework.sb_row); 2617 2627 } 2618 2628 else 2619 2629 { 2620 if ( !Xinha.hasParentNode( this._framework.sb_row) )2621 { 2622 this._framework.table.appendChild(this._framework.sb_row);2630 if ( !Xinha.hasParentNode(framework.sb_row) ) 2631 { 2632 framework.table.appendChild(framework.sb_row); 2623 2633 } 2624 2634 } 2625 2635 2626 2636 // Size and set colspans, link up the framework 2627 this._framework.lp_cell.style.width = this.config.panel_dimensions.left;2628 this._framework.rp_cell.style.width = this.config.panel_dimensions.right;2629 this._framework.tp_cell.style.height = this.config.panel_dimensions.top;2630 this._framework.bp_cell.style.height = this.config.panel_dimensions.bottom;2631 this._framework.tb_cell.style.height = this._toolBar.offsetHeight + 'px';2632 this._framework.sb_cell.style.height = this._statusBar.offsetHeight + 'px';2637 framework.lp_cell.style.width = this.config.panel_dimensions.left; 2638 framework.rp_cell.style.width = this.config.panel_dimensions.right; 2639 framework.tp_cell.style.height = this.config.panel_dimensions.top; 2640 framework.bp_cell.style.height = this.config.panel_dimensions.bottom; 2641 framework.tb_cell.style.height = this._toolBar.offsetHeight + 'px'; 2642 framework.sb_cell.style.height = this._statusBar.offsetHeight + 'px'; 2633 2643 2634 2644 var edcellheight = height - this._toolBar.offsetHeight - this._statusBar.offsetHeight; … … 3944 3954 Xinha.prototype.updateToolbar = function(noStatus) 3945 3955 { 3956 if (this.suspendUpdateToolbar) return; 3957 3946 3958 var doc = this._doc; 3947 3959 var text = (this._editMode == "textmode"); … … 4714 4726 } 4715 4727 } 4728 4729 /* If this.currentModal is not null, then there's a modal dialog 4730 /* on screen, and we kill the event. This eliminates the possibility 4731 /* of a user 'tabbing' out of a modal dialog and re-activating the editor. 4732 /* This fixes the bug reported in ticket #1259 4733 /* http://xinha.webfactional.com/ticket/1259 */ 4734 if (this.currentModal) 4735 { 4736 return false; 4737 } 4738 4716 4739 // update the toolbar state after some time 4717 4740 if ( editor._timerToolbar ) … … 4719 4742 clearTimeout(editor._timerToolbar); 4720 4743 } 4744 if (!this.suspendUpdateToolbar) 4745 { 4721 4746 editor._timerToolbar = setTimeout( 4722 4747 function() … … 4726 4751 }, 4727 4752 250); 4753 } 4728 4754 }; 4729 4755 … … 5485 5511 }; 5486 5512 5513 Xinha.getEvent = function(ev) 5514 { 5515 return ev || window.event; 5516 } 5487 5517 /** 5488 5518 * Prepares an element to receive more than one DOM-0 event handler … … 6179 6209 s += prop + ' = ' + o[prop] + '\n'; 6180 6210 } 6181 6182 6211 } 6183 6212 if (s) … … 6789 6818 scope = (scope) ? scope : window; 6790 6819 var x,y; 6791 if ( scope.pageYOffset) // all except Explorer6820 if (typeof scope.pageYOffset != 'undefined') // all except Explorer 6792 6821 { 6793 6822 x = scope.pageXOffset; 6794 6823 y = scope.pageYOffset; 6795 6824 } 6796 else if (scope.document.documentElement && document.documentElement.scrollTop)6825 else if (scope.document.documentElement && typeof document.documentElement.scrollTop != 'undefined') 6797 6826 // Explorer 6 Strict 6798 6827 { -
trunk/modules/ColorPicker/ColorPicker.js
r1024 r1044 372 372 this.table.style.position = 'fixed'; 373 373 } 374 top +=e.offsetTop - e.scrollTop;375 left +=e.offsetLeft - e.scrollLeft;374 top += e.offsetTop - e.scrollTop; 375 left += e.offsetLeft - e.scrollLeft; 376 376 377 377 e = e.offsetParent; -
trunk/modules/CreateLink/link.js
r1001 r1044 1 2 1 /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- 3 2 -- Xinha (is not htmlArea) - http://xinha.org … … 16 15 -- which provides the functionality to insert a hyperlink in the editor. 17 16 -- 18 -- he file is loaded as a special plugin by the Xinha Core when no alternative method (plugin) is loaded.17 -- The file is loaded as a special plugin by the Xinha Core when no alternative method (plugin) is loaded. 19 18 -- 20 19 -- … … 24 23 -- $LastChangedBy:ray $ 25 24 --------------------------------------------------------------------------*/ 25 26 function CreateLink(editor) { 27 this.editor = editor; 28 var cfg = editor.config; 29 var self = this; 30 31 editor.config.btnList.createlink[3] = function() { self.show(self._getSelectedAnchor()); } 32 } 33 26 34 CreateLink._pluginInfo = { 27 35 name : "CreateLink", 28 36 origin : "Xinha Core", 29 version : "$LastChangedRevision :990$".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'),37 version : "$LastChangedRevision$".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), 30 38 developer : "The Xinha Core Developer Team", 31 developer_url : "$HeadURL :http://svn.xinha.webfactional.com/trunk/modules/CreateLink/link.js$".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'),39 developer_url : "$HeadURL$".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), 32 40 sponsor : "", 33 41 sponsor_url : "", … … 35 43 }; 36 44 37 function CreateLink(editor) { 38 } 45 CreateLink.prototype._lc = function(string) { 46 return Xinha._lc(string, 'Xinha'); 47 }; 39 48 40 Xinha.prototype._createLink = function(link) 49 50 CreateLink.prototype.onGenerateOnce = function() 41 51 { 42 var editor = this; 43 var outparam = null; 44 if ( typeof link == "undefined" ) 45 { 46 link = this.getParentElement(); 47 if ( link ) 48 { 49 while (link && !/^a$/i.test(link.tagName)) 50 { 51 link = link.parentNode; 52 } 53 } 54 } 55 if ( !link ) 56 { 57 var sel = editor.getSelection(); 58 var range = editor.createRange(sel); 59 var compare = 0; 60 if ( Xinha.is_ie ) 61 { 62 if ( sel.type == "Control" ) 63 { 64 compare = range.length; 65 } 66 else 67 { 68 compare = range.compareEndPoints("StartToEnd", range); 69 } 70 } 71 else 72 { 73 compare = range.compareBoundaryPoints(range.START_TO_END, range); 74 } 75 if ( compare === 0 ) 76 { 77 alert(Xinha._lc("You need to select some text before creating a link")); 78 return; 79 } 80 outparam = 81 { 82 f_href : '', 83 f_title : '', 84 f_target : '', 85 f_usetarget : editor.config.makeLinkShowsTarget 86 }; 87 } 88 else 89 { 90 outparam = 91 { 92 f_href : Xinha.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"), 93 f_title : link.title, 94 f_target : link.target, 95 f_usetarget : editor.config.makeLinkShowsTarget 96 }; 97 } 98 Dialog( 99 editor.config.URIs.link, 100 function(param) 101 { 102 if ( !param ) 103 { 104 return false; 105 } 106 var a = link; 107 if ( !a ) 108 { 109 try 110 { 111 var tmp = Xinha.uniq('http://www.example.com/Link'); 112 editor._doc.execCommand('createlink', false, tmp); 52 CreateLink.loadAssets(); 53 }; 113 54 114 // Fix them up 115 var anchors = editor._doc.getElementsByTagName('a'); 116 for(var i = 0; i < anchors.length; i++) 117 { 118 var anchor = anchors[i]; 119 if(anchor.href == tmp) 120 { 121 // Found one. 122 if (!a) a = anchor; 123 anchor.href = param.f_href; 124 if (param.f_target) anchor.target = param.f_target; 125 if (param.f_title) anchor.title = param.f_title; 126 } 127 } 128 } catch(ex) {} 129 } 130 else 131 { 132 var href = param.f_href.trim(); 133 editor.selectNodeContents(a); 134 if ( href === '' ) 135 { 136 editor._doc.execCommand("unlink", false, null); 137 editor.updateToolbar(); 138 return false; 139 } 140 else 141 { 142 a.href = href; 143 } 144 } 145 if ( ! ( a && a.tagName.toLowerCase() == 'a' ) ) 146 { 147 return false; 148 } 149 a.target = param.f_target.trim(); 150 a.title = param.f_title.trim(); 151 editor.selectNodeContents(a); 152 editor.updateToolbar(); 153 }, 154 outparam); 55 CreateLink.loadAssets = function() 56 { 57 var self = CreateLink; 58 if (self.loading) return; 59 self.loading = true; 60 Xinha._getback(_editor_url + 'modules/CreateLink/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); 61 Xinha._getback(_editor_url + 'modules/CreateLink/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 62 } 63 64 CreateLink.prototype.onUpdateToolbar = function() 65 { 66 if (!(CreateLink.dialogReady && CreateLink.methodsReady)) 67 { 68 this.editor._toolbarObjects.createlink.state("enabled", false); 69 } 70 else this.onUpdateToolbar = null; 155 71 }; 72 73 CreateLink.prototype.prepareDialog = function() 74 { 75 var self = this; 76 var editor = this.editor; 77 78 var dialog = this.dialog = new Xinha.Dialog(editor, CreateLink.html, 'Xinha',{width:400}) 79 // Connect the OK and Cancel buttons 80 dialog.getElementById('ok').onclick = function() {self.apply();} 81 82 dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; 83 84 if (!editor.config.makeLinkShowsTarget) 85 { 86 dialog.getElementById("f_target_label").style.visibility = "hidden"; 87 dialog.getElementById("f_target").style.visibility = "hidden"; 88 dialog.getElementById("f_other_target").style.visibility = "hidden"; 89 } 90 91 dialog.getElementById('f_target').onchange= function() 92 { 93 var f = dialog.getElementById("f_other_target"); 94 if (this.value == "_other") { 95 f.style.visibility = "visible"; 96 f.select(); 97 f.focus(); 98 } else f.style.visibility = "hidden"; 99 }; 100 101 102 this.dialogReady = true; 103 }; -
trunk/modules/Gecko/Gecko.js
r1001 r1044 576 576 Xinha.prototype.restoreSelection = function(savedSelection) 577 577 { 578 try 579 { 578 580 var sel = this.getSelection(); 579 581 sel.removeAllRanges(); 580 582 sel.addRange(savedSelection); 583 } 584 catch (e) {} 581 585 } 582 586 /** … … 585 589 * 586 590 * @param node DomNode 587 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.588 */ 589 590 Xinha.prototype.selectNodeContents = function(node, pos)591 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. <
