Changeset 962
- Timestamp:
- 02/04/08 00:43:21 (5 years ago)
- Location:
- trunk
- Files:
-
- 10 removed
- 13 modified
- 11 copied
-
XinhaCore.js (modified) (3 diffs)
-
XinhaLoader.js (modified) (1 diff)
-
examples/Extended.html (deleted)
-
examples/ExtendedDemo.html (copied) (copied from branches/0.95_stable/examples/ExtendedDemo.html)
-
examples/Newbie.html (modified) (1 diff)
-
examples/XinhaConfig.js (modified) (1 diff)
-
examples/custom.css (deleted)
-
examples/dynamic.css (deleted)
-
examples/ext_example-body.html (deleted)
-
examples/ext_example-dest.php (deleted)
-
examples/ext_example-menu.php (deleted)
-
examples/ext_example.html (deleted)
-
examples/files (copied) (copied from branches/0.95_stable/examples/files)
-
examples/files/Extended.html (copied) (copied from branches/0.95_stable/examples/files/Extended.html)
-
examples/files/custom.css (copied) (copied from branches/0.95_stable/examples/files/custom.css)
-
examples/files/dynamic.css (copied) (copied from branches/0.95_stable/examples/files/dynamic.css)
-
examples/files/ext_example-body.html (copied) (copied from branches/0.95_stable/examples/files/ext_example-body.html)
-
examples/files/ext_example-dest.php (copied) (copied from branches/0.95_stable/examples/files/ext_example-dest.php)
-
examples/files/ext_example-menu.php (copied) (copied from branches/0.95_stable/examples/files/ext_example-menu.php)
-
examples/files/full_example.css (copied) (copied from branches/0.95_stable/examples/files/full_example.css)
-
examples/files/stylist.css (copied) (copied from branches/0.95_stable/examples/files/stylist.css)
-
examples/full_example.css (deleted)
-
examples/full_example.js (deleted)
-
examples/simple_example.html (modified) (4 diffs)
-
examples/stylist.css (deleted)
-
examples/testbed.html (modified) (1 diff)
-
modules/Gecko/Gecko.js (modified) (4 diffs)
-
modules/InternetExplorer/InternetExplorer.js (modified) (3 diffs)
-
modules/WebKit/WebKit.js (modified) (9 diffs, 1 prop)
-
plugins/ExtendedFileManager/assets/manager.css (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/manager.js (modified) (3 diffs)
-
plugins/ExtendedFileManager/manager.php (modified) (1 diff)
-
plugins/GenericPlugin (copied) (copied from branches/0.95_stable/plugins/GenericPlugin)
-
plugins/GenericPlugin/generic-plugin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r961 r962 4444 4444 4445 4445 } catch (ex) {} 4446 }4446 } 4447 4447 4448 4448 var btn = editor._toolbarObjects[cmdID].element; … … 4595 4595 case 'justifyleft' : 4596 4596 case 'justifyright' : 4597 { 4597 4598 cmdID.match(/^justify(.*)$/); 4598 4599 var ae = this.activeElement(this.getSelection()); … … 4605 4606 this._doc.execCommand(cmdID, UI, param); 4606 4607 } 4608 } 4607 4609 break; 4608 4610 -
trunk/XinhaLoader.js
r961 r962 190 190 arguments.callee.done = true; 191 191 // kill the timer 192 193 192 if (Xinha.onloadTimer) clearInterval(Xinha.onloadTimer); 194 193 -
trunk/examples/Newbie.html
r917 r962 18 18 <form action=""> 19 19 <div> 20 <textarea id="myTextArea" name="myTextArea" rows=" 10" cols="50" style="width: 100%"></textarea>20 <textarea id="myTextArea" name="myTextArea" rows="25" cols="50" style="width: 100%"></textarea> 21 21 </div> 22 22 </form> -
trunk/examples/XinhaConfig.js
r937 r962 39 39 'CharacterMap', 40 40 'ContextMenu', 41 ' ListType',41 'SmartReplace', 42 42 'Stylist', 43 43 'Linker', -
trunk/examples/simple_example.html
r836 r962 5 5 <title>Simple example of Xinha</title> 6 6 <script type="text/javascript"> 7 /************************************************************************8 * Please refer to http://xinha.python-hosting.com/wiki/NewbieGuide9 ************************************************************************10 * You must set _editor_url to the URL (including trailing slash) where11 * where xinha is installed, it's highly recommended to use an absolute URL12 * eg: _editor_url = "/path/to/xinha/";13 * You may try a relative URL if you wish]14 * eg: _editor_url = "../";15 * in this example we do a little regular expression to find the absolute path.16 ************************************************************************/17 7 var _editor_url = document.location.href.replace(/examples\/simple_example\.html.*/, '') 18 // And the language we need to use in the editor. 8 19 9 var _editor_lang = "en"; 20 10 </script> … … 22 12 <script type="text/javascript" src="../XinhaCore.js"></script> 23 13 <script type="text/javascript"> 24 /************************************************************************ 25 * Plugins you will be using in the editors on this page. 26 * List all the plugins you will need, even if not all the editors will 27 * use all the plugins. 28 ************************************************************************ 29 * Please refer to http://xinha.python-hosting.com/wiki/Plugins for the 30 * list of availables plugins 31 ************************************************************************/ 14 32 15 var xinha_plugins = 33 16 [ 34 'CharacterMap', 35 'ContextMenu', 36 'ListType', 37 'SpellChecker', 38 'Stylist', 39 'SuperClean', 40 'TableOperations' 17 'Linker' 41 18 ]; 42 /************************************************************************43 * Names of the textareas you will be turning into editors44 ************************************************************************/45 19 var xinha_editors = 46 20 [ … … 48 22 'anotherOne' 49 23 ]; 50 /************************************************************************ 51 * Initialisation function 52 ************************************************************************/ 24 53 25 function xinha_init() 54 26 { 55 // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)56 27 if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; 57 /************************************************************************* 58 * We create a default configuration to be used by all the editors. 59 * If you wish to configure some of the editors differently this will be 60 * done later after editors are initiated. 61 ************************************************************************ 62 * Please refer to http://xinha.python-hosting.com/wiki/Documentation/Customise 63 * for the configuration parameters 64 ************************************************************************/ 28 65 29 var xinha_config = new Xinha.Config(); 66 /************************************************************************ 67 * We first create editors for the textareas. 68 * You can do this in two ways, either 69 * 70 * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); 71 * 72 * if you want all the editor objects to use the same set of plugins, OR; 73 * 74 * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); 75 * xinha_editors['myTextArea'].registerPlugins(['Stylist']); 76 * xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']); 77 * 78 * if you want to use a different set of plugins for one or more of the 79 * editors. 80 ************************************************************************/ 30 81 31 xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); 82 /************************************************************************ 83 * If you want to change the configuration variables of any of the 84 * editors, this is the place to do that, for example you might want to 85 * change the width and height of one of the editors, like this... 86 ************************************************************************/ 87 xinha_editors.myTextArea.config.width = '640px'; 88 xinha_editors.myTextArea.config.height = '480px'; 89 /************************************************************************ 90 * Or remove the statusbar on the other one, like this... 91 * For every possible configuration, please refer to 92 * http://xinha.python-hosting.com/wiki/Documentation/ConfigVariablesList 93 ************************************************************************/ 94 xinha_editors.anotherOne.config.statusBar = false; 95 /************************************************************************ 96 * Finally we "start" the editors, this turns the textareas into 97 * Xinha editors. 98 ************************************************************************/ 32 99 33 Xinha.startEditors(xinha_editors); 100 34 } 101 window.onload = xinha_init;35 Xinha.addOnloadHandler(xinha_init); 102 36 </script> 103 <link type="text/css" rel="stylesheet" title="blue-look" href="../skins/blue-look/skin.css"> 104 <link type="text/css" rel="alternate stylesheet" title="green-look" href="../skins/green-look/skin.css"> 105 <link type="text/css" rel="alternate stylesheet" title="xp-blue" href="../skins/xp-blue/skin.css"> 106 <link type="text/css" rel="alternate stylesheet" title="xp-green" href="../skins/xp-green/skin.css"> 107 <link type="text/css" rel="alternate stylesheet" title="inditreuse" href="../skins/inditreuse/skin.css"> 108 <link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="../skins/blue-metallic/skin.css"> 37 109 38 </head> 110 39 111 40 <body> 112 41 113 <form onsubmit="alert(this.myTextArea.value); alert(this.anotherOne.value);return false;">114 <textarea id="myTextArea" name="myTextArea" rows=" 10" cols="80" style="width:100%">42 <form onsubmit="alert(this.myTextArea.value); return false;"> 43 <textarea id="myTextArea" name="myTextArea" rows="25" cols="80"> 115 44 <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 116 45 Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis … … 121 50 Curabitur pharetra bibendum lectus.</p> 122 51 </textarea> 123 <textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%">124 <ul>125 <li> Phasellus et massa sed diam viverra semper. </li>126 <li> Mauris tincidunt felis in odio. </li>127 <li> Nulla placerat nunc ut pede. </li>128 <li> Vivamus ultrices mi sit amet urna. </li>129 <li> Quisque sed augue quis nunc laoreet volutpat.</li>130 <li> Nunc sit amet metus in tortor semper mattis. </li>131 </ul>132 </textarea>133 <input type="submit">134 </form>135 52 136 53 </body> -
trunk/examples/testbed.html
r897 r962 154 154 </head> 155 155 <body> 156 <img src=" http://xinha.python-hosting.com/trac/logo.jpg" usemap="#m1">156 <img src="../images/xinha_logo.gif" usemap="#m1"> 157 157 <map name="m1"> 158 158 <area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"> -
trunk/modules/Gecko/Gecko.js
r957 r962 189 189 /* This is now handled by a plugin 190 190 case 13: // ENTER 191 if( !ev.shiftKey && editor.config.mozParaHandler == 'dirty' ) 192 { 193 this.dom_checkInsertP(); 194 Xinha._stopEvent(ev); 195 } 191 196 192 break;*/ 197 193 … … 620 616 { 621 617 var sel = this.getSelection(); 618 if (sel.isCollapsed) return ''; 622 619 var range = this.createRange(sel); 623 620 return Xinha.getHTML(range.cloneContents(), false, this); … … 710 707 var after = ta.value.substring( index, ta.value.length ); 711 708 712 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body)709 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 713 710 { 714 711 var tagEnd = after.indexOf(">") + 1; … … 716 713 } 717 714 else ta.value = before + cc + after; 715 ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 718 716 ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 719 717 ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); -
trunk/modules/InternetExplorer/InternetExplorer.js
r943 r962 455 455 { 456 456 var sel = this.getSelection(); 457 if (this.selectionEmpty) return ''; 457 458 var range = this.createRange(sel); 458 459 … … 542 543 var after = ta.value.substring( index + cc.length , ta.value.length ); 543 544 544 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body)545 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 545 546 { 546 547 var tagEnd = after.indexOf(">") + 1; … … 548 549 } 549 550 else ta.value = before + cc + after; 551 ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 550 552 ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 551 553 ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); -
trunk/modules/WebKit/WebKit.js
- Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
r961 r962 14 14 -- 15 15 -- The file is loaded as a special plugin by the Xinha Core when 16 -- Xinha is being run under a Webkit based browser with the Midas 17 -- editing API. 16 -- Xinha is being run under a Webkit based browser such as Safari 18 17 -- 19 18 -- It provides implementation and specialisation for various methods … … 26 25 -- that way. 27 26 -- 28 -- $HeadURL : http://svn.xinha.webfactional.com/trunk/modules/Gecko/Gecko.js$29 -- $LastChangedDate : 2007-10-12 12:00:47 +0200 (Fr, 12 Okt 2007)$30 -- $LastChangedRevision : 901$31 -- $LastChangedBy : ray$27 -- $HeadURL$ 28 -- $LastChangedDate$ 29 -- $LastChangedRevision$ 30 -- $LastChangedBy$ 32 31 --------------------------------------------------------------------------*/ 33 32 … … 35 34 name : "WebKit", 36 35 origin : "Xinha Core", 37 version : "$LastChangedRevision : 901$".replace(/^[^:]*: (.*) \$$/, '$1'),36 version : "$LastChangedRevision$".replace(/^[^:]*: (.*) \$$/, '$1'), 38 37 developer : "The Xinha Core Developer Team", 39 developer_url : "$HeadURL : http://svn.xinha.webfactional.com/trunk/modules/Gecko/Gecko.js$".replace(/^[^:]*: (.*) \$$/, '$1'),38 developer_url : "$HeadURL$".replace(/^[^:]*: (.*) \$$/, '$1'), 40 39 sponsor : "", 41 40 sponsor_url : "", … … 48 47 } 49 48 50 /** Allow Geckoto handle some key events in a special way.49 /** Allow Webkit to handle some key events in a special way. 51 50 */ 52 51 … … 568 567 { 569 568 var sel = this.getSelection(); 569 if (sel.isCollapsed) return ''; 570 570 var range = this.createRange(sel); 571 571 … … 651 651 }; 652 652 653 //Control character for retaining edit location when switching modes 654 Xinha.prototype.cc = String.fromCharCode(173); 653 Xinha.prototype.cc = String.fromCharCode(8286); 655 654 656 655 Xinha.prototype.setCC = function ( target ) … … 666 665 var after = ta.value.substring( index, ta.value.length ); 667 666 668 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body)667 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, enities and inside the body) 669 668 { 670 669 var tagEnd = after.indexOf(">") + 1; … … 672 671 } 673 672 else ta.value = before + cc + after; 673 ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 674 674 ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 675 675 ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); … … 685 685 Xinha.prototype.findCC = function ( target ) 686 686 { 687 if (target == "textarea") 688 { // window.find() doesn't find text in textarea, neither does Safari's normal find feature 689 // hope they will fix this some time 690 // this mechanism to scroll into 691 var ta = this._textArea; 692 var val = ta.value; 693 ta.value =''; 694 var initialTaHeight = ta.scrollHeight; 695 var start = val.indexOf(this.cc); 696 var end = start + this.cc.length; 697 ta.value = val.substring( 0, start ); 698 var scrollTo = 0; 699 if ( ta.scrollHeight > initialTaHeight) 700 { 701 scrollTo = ta.scrollHeight; 702 } 703 ta.value += val.substring( end, val.length ); 704 ta.selectionStart = start; 705 ta.selectionEnd = start; 706 ta.scrollTop = scrollTo; 707 ta.focus(); 687 if ( target == 'textarea' ) 688 { 689 var ta = this._textArea; 690 var pos = ta.value.indexOf( this.cc ); 691 if ( pos == -1 ) return; 692 var end = pos + this.cc.length; 693 var before = ta.value.substring( 0, pos ); 694 var after = ta.value.substring( end, ta.value.length ); 695 ta.value = before ; 696 697 ta.scrollTop = ta.scrollHeight; 698 var scrollPos = ta.scrollTop; 699 700 ta.value += after; 701 ta.setSelectionRange(pos,pos); 702 703 ta.focus(); 704 705 ta.scrollTop = scrollPos; 706 708 707 } 709 708 else -
trunk/plugins/ExtendedFileManager/assets/manager.css
r937 r962 10 10 .dirs { padding: 1em; } 11 11 12 .imageFrame { overflow-x:hidden; width: 100%; height: 1 45px; margin:0px; background-color: #fff;}12 .imageFrame { overflow-x:hidden; width: 100%; height: 155px; margin:0px; background-color: #fff;} 13 13 .smallWidth{ width: 4em; } 14 14 .largelWidth{ width: 30em; } -
trunk/plugins/ExtendedFileManager/assets/manager.js
r957 r962 56 56 57 57 var w = 650; 58 var h = 200;58 var h = 600; 59 59 60 60 window.resizeTo(w,h); … … 234 234 } 235 235 }; 236 imgManager.location.replace( iframeUrl);236 imgManager.location.replace(iframeUrl); 237 237 238 238 if (manager_mode == 'image' && typeof Xinha.colorPicker != "undefined" && document.getElementById('f_backgroundColor') && document.getElementById('f_backgroundColor').type == 'text') { … … 249 249 new Xinha.colorPicker.InputBinding(document.getElementById('f_borderColor'),pickerConfig); 250 250 } 251 setTimeout(function() { addEvent(window, 'resize', resize); }, 500);251 setTimeout(function() { resize();addEvent(window, 'resize', resize); }, 500); 252 252 } 253 253 -
trunk/plugins/ExtendedFileManager/manager.php
r937 r962 104 104 echo 'var manager_mode="image";'; 105 105 } 106 //IE doesn't like a relative URL when changing a window's location 107 $iframe_url = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['backend_url']; 106 108 ?> 107 109 108 var iframeUrl = '<?php print $ IMConfig['backend_url'];?>__function=images&mode=<?php echo $insertMode;?>&viewtype=<?php echo $IMConfig['view_type'] ?>';110 var iframeUrl = '<?php print $iframe_url ?>__function=images&mode=<?php echo $insertMode;?>&viewtype=<?php echo $IMConfig['view_type'] ?>'; 109 111 110 112 /* ]]> */ -
trunk/plugins/GenericPlugin/generic-plugin.js
r960 r962 43 43 GenericPlugin.prototype.onExecCommand = function ( cmdID, UI, param ) 44 44 { 45 return false; 45 if (cmdID != 'removeformat') return false; 46 47 var editor = this.editor; 48 var sel = editor.getSelection(); 49 var range = editor.createRange(sel); 50 51 var els = editor._doc.getElementsByTagName('*'); 52 53 var start = ( range.startContainer.nodeType == 1 ) ? range.startContainer : range.startContainer.parentNode; 54 var end = ( range.endContainer.nodeType == 1 ) ? range.endContainer : range.endContainer.parentNode; 55 56 function clean(node) 57 { 58 node.removeAttribute('style'); 59 } 60 61 for (var i=0; i<els.length;i++) 62 { 63 if (els[i] == start) 64 { 65 console.log({el : els[i], 'cmp' : 'start'}); 66 } 67 else if (els[i] == end) 68 { 69 console.log({el : els[i], 'cmp' : 'end'}); 70 } 71 else 72 { 73 clean(els[i]); 74 console.log({el : els[i], 'cmp' : range.isPointInRange( els[i], 0 )}); 75 } 76 77 } 78 return true; 46 79 } 47 80
