You are not logged in.
I probably still have commit access to svn (honestly I don't know) but I have no idea what the login and especially the password can be (and my computer doesn't remember either). So I am (of course) allowing anyone like you wymsy, gogo or anyone else able to, to do the necessary updates on the svn.
If this post (and my previous one) is not enough to let you update the files (the way you need them to be updated), please let me know and I'll do whatever is necessary to fix this issue.
Hello, sorry if the licencing of the character map and listType plugin is confusing. At the release time, I remember we had a discussion here about this specific issue. I will be happy to change the licence to anything that's suits the community, just let me know what I should do. In any case, I will even be happy to have my name removed from it and give any credits back to the community and gogo.
My mail is still mokhet@mokhet.com (thanks to wymsy for letting me know an issue was spotted here, since you may have noticed I'm not active at all here, I don't even use Xinha anymore)
editor.onGenerate = function() {};
no ?
The problem with the charcounter plugin is quite simple. Once there is too many characters to count, it's not usable anymore. The plugin as it is actually is good for low characters. To fix the issue, i have updated the plugin to make it calculate the number of chars/words/HTML when we click on a toolbar button and not in real time anymore.
There is now a config variable to let you choose between "standard", "notifier" and "button" mode
editor.config.CharCounter.mode = 'standard';This config let you use the plugin as it is actually, which means real time and the more chars to count, the slower it is.
editor.config.CharCounter.mode = 'notifier';This config is here to use notifiers ('keypress_event' and 'content_update') but you can't use it since thoses notifiers does not exists in the actual Xinha version (it is something I need to commit on my branch, but still no time to do it correctly). I should removed it, it is useless for you.
editor.config.CharCounter.mode = 'button';With this config mode, it will add a button (ed_charcounter.png) in the toolbar near the "createLink" button. So the calculation is not real time anymore, you calculating only when you click on the button.
Here is the version (based on 1.2, revision 563) i am using :
// Charcounter for HTMLArea-3.0
// (c) Udo Schmal & L.N.Schaffrath NeueMedien
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
function CharCounter(editor) {
this.editor = editor;
var e = this;
function updater(N, T)
{
e.charCount.innerHTML = e._lc("... in progress");
if ( e._timeoutID )
{
window.clearTimeout(e._timeoutID);
}
e._timeoutID = window.setTimeout(function() {e._updateCharCount();}, 1000);
}
switch ( editor.config.CharCounter.mode )
{
case 'notifier':
editor.notifyOn(['content_update', 'keypress_event'], updater);
break;
case 'button':
editor.config.registerButton(
{
id : 'countcharacter',
tooltip : HTMLArea._lc( 'Character counter', 'CharCounter' ),
image : editor.imgURL( 'ed_charcounter.png', 'CharCounter' ),
textMode : false,
action : updater
}
);
editor.config.addToolbarElement('countcharacter', 'createlink', -1);
break;
default:
this.onUpdateToolbar = updater;
break;
}
}
HTMLArea.Config.prototype.CharCounter =
{
'showChar': true, // show the characters count,
'showWord': true, // show the words count,
'showHtml': true, // show the exact html count
'separator': ' | ', // separator used to join informations
mode: 'button' // preferered method to update counters (standard, notifier, button)
};
CharCounter._pluginInfo = {
name : "CharCounter",
version : "1.2",
developer : "Udo Schmal",
developer_url : "http://www.schaffrath-neuemedien.de",
sponsor : "L.N.Schaffrath NeueMedien",
sponsor_url : "http://www.schaffrath-neuemedien.de",
c_owner : "Udo Schmal & L.N.Schaffrath NeueMedien",
license : "htmlArea"
};
CharCounter.prototype._lc = function(string) {
return HTMLArea._lc(string, "CharCounter");
};
CharCounter.prototype.onGenerate = function() {
var self = this;
if (this.charCount==null) {
var charCount = document.createElement("span");
charCount.style.padding = "2px 5px";
charCount.style[HTMLArea.is_ie ? 'styleFloat' : 'cssFloat'] = "right";
var brk = document.createElement('div');
brk.style.height =
brk.style.width =
brk.style.lineHeight =
brk.style.fontSize = '1px';
brk.style.clear = 'both';
this.editor._statusBarTree.style[HTMLArea.is_ie ? 'styleFloat' : 'cssFloat'] = "left";
this.editor._statusBar.appendChild(charCount);
this.editor._statusBar.appendChild(brk);
this.charCount = charCount;
}
};
CharCounter.prototype._updateCharCount = function() {
var editor = this.editor;
var cfg = editor.config;
var contents = editor.getHTML();
var string = [];
if (cfg.CharCounter.showHtml) {
string[string.length] = this._lc("HTML") + ": " + contents.length;
}
if (cfg.CharCounter.showWord || cfg.CharCounter.showChar) {
contents = contents.replace(/<\/?\s*!--[^-->]*-->/gi, "" );
contents = contents.replace(/<(.+?)>/g, '');//Don't count HTML tags
contents = contents.replace(/ /gi, ' ');
contents = contents.replace(/([\n\r\t])/g, ' ');//convert newlines and tabs into space
contents = contents.replace(/( +)/g, ' ');//count spaces only once
contents = contents.replace(/&(.*);/g, ' ');//Count htmlentities as one keystroke
contents = contents.replace(/^\s*|\s*$/g, '');//trim
}
if (cfg.CharCounter.showWord) {
var words=0;
for (var x=0;x<contents.length;x++)
{
if (contents.charAt(x) == " " ) {words++;}
}
if (words>=1) { words++; }
string[string.length] = this._lc("Words") + ": " + words;
}
if (cfg.CharCounter.showChar) {
string[string.length] = this._lc("Chars") + ": " + contents.length;
}
this.charCount.innerHTML = string.join(cfg.CharCounter.separator);
};
CharCounter.prototype.onMode = function (mode)
{
//Hide Chars in statusbar when switching into textmode
switch (mode)
{
case "textmode":
this.charCount.style.display = "none";
break;
case "wysiwyg":
this.charCount.style.display = "";
break;
default:
alert("Mode <" + mode + "> not defined!");
return false;
}
return true;
};Hope it helps.
I'm using this kind of approach but unfortunatly on some cases, as stated by Ray, you will find a false empty.
This will be considered empty ![]()
<p><a href="xxx"><img src="xxx"></a></p>Xinha, in its trunk version, is not able to be generated and be degenerated at will. Try the branch i'm working on, i've started it to answer this precise issue. Unfortunatly it's not finished yet, especially the plugins, i've not looked at them yet since I dont use any of the Xinha plugins for my actual project.
Demo generate/degenerate
~$ svn co http://svn.xinha.python-hosting.com/branches/mokhet/ xinhaTo generate, it is using the usual way, but before removing your form, you will have to dispose the editor.
editorReference.dispose();Humm, if you want only ImageManager's links to be relative instead of absolute, i dont know if there is a way. However, there is a configuration variable in Xinha to do it, but that's will affects *all* links on your document.
config.stripBaseHref = true;
config.baseHref = 'http://www.yourDomain.com';If you creating Xinha instances using the way explained in newbie guide, it will be something like this
xinha_config = new HTMLArea.Config();
xinha_config.stripBaseHref = true;
xinha_config.baseHref = 'http://www.yourDomain.com';Even better, this patch is saving the last used colors accross session by using a cookie
Index: color_picker.js
===================================================================
--- color_picker.js (revision 555)
+++ color_picker.js (working copy)
@@ -74,9 +74,15 @@
function colorPicker(params)
{
+ // if the savedColors is empty, try to read the savedColors from cookie
+ if ( colorPicker.savedColors.length == 0 )
+ {
+ colorPicker.loadColors();
+ }
var picker = this;
this.callback = params.callback?params.callback:function(color){alert('You picked ' + color )};
+ this.websafe = params.websafe?params.websafe:false;
this.cellsize = params.cellsize?params.cellsize:'10px';
this.side = params.granularity?params.granularity:18;
@@ -288,6 +294,11 @@
{
this.table.style.left = (left - (this.table.offsetWidth - element.offsetWidth)) + 'px';
}
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ this.iframe.style.top = this.table.style.top;
+ this.iframe.style.left = this.table.style.left;
+ @*/
};
/** Draw the color picker. */
@@ -338,7 +349,7 @@
picker.backSample.style.color = 'black';
}
}
- td.onclick = function() { picker.callback(this.colorCode); picker.close(); }
+ td.onclick = function() { colorPicker.remember(this.colorCode); picker.callback(this.colorCode); picker.close(); }
td.appendChild(document.createTextNode(' '));
td.style.cursor = 'pointer';
tr.appendChild(td);
@@ -413,7 +424,7 @@
picker.backSample.style.color = 'black';
}
}
- td.onclick = function() { picker.callback(this.colorCode); picker.close(); }
+ td.onclick = function() { colorPicker.remember(this.colorCode); picker.callback(this.colorCode); picker.close(); }
td.appendChild(document.createTextNode(' '));
td.style.cursor = 'pointer';
tr.appendChild(td);
@@ -429,6 +440,8 @@
td.colSpan = this.side + 3;
td.style.padding = '3px';
+ if ( this.websafe )
+ {
var div = document.createElement('div');
var label = document.createElement('label');
label.appendChild(document.createTextNode('Web Safe: '));
@@ -439,6 +452,7 @@
label.style.fontSize = 'x-small';
div.appendChild(label);
td.appendChild(div);
+ }
var div = document.createElement('div');
var label = document.createElement('label');
@@ -466,10 +480,59 @@
td.appendChild(sampleTable);
+ var savedColors = document.createElement('div');
+ savedColors.style.clear = 'both';
+ function createSavedColors(color)
+ {
+ var is_ie = false;
+ /*@cc_on is_ie = true; @*/
+ var div = document.createElement('div');
+ div.style.width = '13px';
+ div.style.height = '13px';
+ div.style.margin = '1px';
+ div.style.border = '1px solid black';
+ div.style.cursor = 'pointer';
+ div.style.backgroundColor = color;
+ div.style[ is_ie ? 'styleFloat' : 'cssFloat'] = 'left';
+ div.onclick = function() { picker.callback(color); picker.close(); };
+ div.onmouseover = function()
+ {
+ picker.chosenColor.value = color;
+ picker.backSample.style.backgroundColor = color;
+ picker.foreSample.style.color = color;
+ };
+ savedColors.appendChild(div);
+ }
+ for ( var savedCols = 0; savedCols < colorPicker.savedColors.length; savedCols++ )
+ {
+ createSavedColors(colorPicker.savedColors[savedCols]);
+ }
+ td.appendChild(savedColors);
+
this.tbody.appendChild(tr);
document.body.appendChild(this.table);
-
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ if ( !this.iframe )
+ {
+ this.iframe = document.createElement('iframe');
+ this.iframe.style.zIndex = 999;
+ this.table.style.zIndex = 1000;
+ this.iframe.style.position = 'absolute';
+ this.iframe.style.width = this.table.offsetWidth;
+ this.iframe.style.height = this.table.offsetHeight;
+ this.iframe.border = 0;
+ this.iframe.frameBorder = 0;
+ this.iframe.frameSpacing = 0;
+ this.iframe.marginWidth = 0;
+ this.iframe.marginHeight = 0;
+ this.iframe.hspace = 0;
+ this.iframe.vspace = 0;
+ document.body.appendChild(this.iframe);
+ }
+ this.iframe.style.display = '';
+ @*/
}
else
{
@@ -495,6 +558,50 @@
this.close = function()
{
this.table.style.display = 'none';
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ if ( this.iframe ) { this.iframe.style.display = 'none'; }
+ @*/
};
+ }
- }
\ No newline at end of file
+// array of the saved colors
+colorPicker.savedColors = [];
+
+// add the color to the savedColors
+colorPicker.remember = function(color)
+{
+ // check if this color is known
+ for ( var i = colorPicker.savedColors.length; i--; )
+ {
+ if ( colorPicker.savedColors[i] == color )
+ {
+ return false;
+ }
+ }
+ // insert the new color
+ colorPicker.savedColors.splice(0, 0, color);
+ // limit elements
+ colorPicker.savedColors = colorPicker.savedColors.slice(0, 21);
+ //[mokhet] probably some more parameters to send to the cookie definition
+ // like domain, secure and such, especially with https connection i presume
+ // save the cookie
+ var expdate = new Date();
+ expdate.setMonth(expdate.getMonth() + 1);
+
+ document.cookie = 'XinhaColorPicker=' + escape (colorPicker.savedColors.join('-')) + ';expires=' + expdate.toGMTString();
+ return true;
+};
+
+// try to read the colors from the cookie
+colorPicker.loadColors = function()
+{
+ var index = document.cookie.indexOf('XinhaColorPicker');
+ if ( index != -1 )
+ {
+ var begin = (document.cookie.indexOf('=', index) + 1);
+ var end = document.cookie.indexOf(';', index);
+ if ( end == -1 ) { end = document.cookie.length; }
+ colorPicker.savedColors = unescape(document.cookie.substring(begin, end)).split('-');
+ }
+};Once again, see ticket #85 for more informations.
Humm, probably because you are not escaping your datas to server. And so specials chars like ( &, spaces and such) and not correctly transmitted.
Instead of this :
// all my vars ready to be send in var 'data'
data = "mouchard=" + var1 + "&titre=" + var 2 + "&type_titre=" + var3 ....Try this :
data = "mouchard=" + encodeURIComponent(var1) + "&titre=" + encodeURIComponent(var2) + "&type_titre=" +(encodeURIComponent(var3)....Heya mharrisonline, what do you think of this patch ?
demo available here : http://mokhet.com/xinha/branch_events/e … demand.php
It has the IE fix (see ticket #85) to prevent windowed elements (<select>) to go above the colorpicker and it remembers the 20 last colors. The saved colors are not splitted between foreground and background, but that's can of course be done if everybody think it should remember colors separatly.
It also removes the "web safe" checkbox since this is TOTALLY useless in 2006. However, it's still in, it's a configuration variable (websafe) sent when creating the widget.
DEPRECATED - loose colors between session. see patch in next post for a better fix
Index: color_picker.js
===================================================================
--- color_picker.js (revision 554)
+++ color_picker.js (working copy)
@@ -77,6 +77,7 @@
var picker = this;
this.callback = params.callback?params.callback:function(color){alert('You picked ' + color )};
+ this.websafe = params.websafe?params.websafe:false;
this.cellsize = params.cellsize?params.cellsize:'10px';
this.side = params.granularity?params.granularity:18;
@@ -288,6 +289,11 @@
{
this.table.style.left = (left - (this.table.offsetWidth - element.offsetWidth)) + 'px';
}
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ this.iframe.style.top = this.table.style.top;
+ this.iframe.style.left = this.table.style.left;
+ @*/
};
/** Draw the color picker. */
@@ -338,7 +344,7 @@
picker.backSample.style.color = 'black';
}
}
- td.onclick = function() { picker.callback(this.colorCode); picker.close(); }
+ td.onclick = function() { colorPicker.remember(this.colorCode); picker.callback(this.colorCode); picker.close(); }
td.appendChild(document.createTextNode(' '));
td.style.cursor = 'pointer';
tr.appendChild(td);
@@ -413,7 +419,7 @@
picker.backSample.style.color = 'black';
}
}
- td.onclick = function() { picker.callback(this.colorCode); picker.close(); }
+ td.onclick = function() { colorPicker.remember(this.colorCode); picker.callback(this.colorCode); picker.close(); }
td.appendChild(document.createTextNode(' '));
td.style.cursor = 'pointer';
tr.appendChild(td);
@@ -429,6 +435,8 @@
td.colSpan = this.side + 3;
td.style.padding = '3px';
+ if ( this.websafe )
+ {
var div = document.createElement('div');
var label = document.createElement('label');
label.appendChild(document.createTextNode('Web Safe: '));
@@ -439,6 +447,7 @@
label.style.fontSize = 'x-small';
div.appendChild(label);
td.appendChild(div);
+ }
var div = document.createElement('div');
var label = document.createElement('label');
@@ -466,10 +475,60 @@
td.appendChild(sampleTable);
+ var savedColors = document.createElement('div');
+ savedColors.style.clear = 'both';
+ function createSavedColors(color)
+ {
+ var is_ie = false;
+ /*@cc_on is_ie = true; @*/
+ var div = document.createElement('div');
+ div.style.width = '13px';
+ div.style.height = '13px';
+ div.style.margin = '1px';
+ div.style.border = '1px solid black';
+ div.style.cursor = 'pointer';
+ div.style.backgroundColor = color;
+ div.style[ is_ie ? 'styleFloat' : 'cssFloat'] = 'left';
+ div.onclick = function() { picker.callback(color); picker.close(); };
+ div.onmouseover = function()
+ {
+ picker.chosenColor.value = color;
+ picker.backSample.style.backgroundColor = color;
+ picker.foreSample.style.color = color;
+ };
+ savedColors.appendChild(div);
+ }
+ for ( var savedCols = 0; savedCols < colorPicker.savedColors.length; savedCols++ )
+ {
+ createSavedColors(colorPicker.savedColors[savedCols]);
+ }
+
+ td.appendChild(savedColors);
+
this.tbody.appendChild(tr);
document.body.appendChild(this.table);
-
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ if ( !this.iframe )
+ {
+ this.iframe = document.createElement('iframe');
+ this.iframe.style.zIndex = 999;
+ this.table.style.zIndex = 1000;
+ this.iframe.style.position = 'absolute';
+ this.iframe.style.width = this.table.offsetWidth;
+ this.iframe.style.height = this.table.offsetHeight;
+ this.iframe.border = 0;
+ this.iframe.frameBorder = 0;
+ this.iframe.frameSpacing = 0;
+ this.iframe.marginWidth = 0;
+ this.iframe.marginHeight = 0;
+ this.iframe.hspace = 0;
+ this.iframe.vspace = 0;
+ document.body.appendChild(this.iframe);
+ }
+ this.iframe.style.display = '';
+ @*/
}
else
{
@@ -495,6 +554,28 @@
this.close = function()
{
this.table.style.display = 'none';
+ // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker
+ /*@cc_on
+ if ( this.iframe ) { this.iframe.style.display = 'none'; }
+ @*/
};
+ }
- }
\ No newline at end of file
+colorPicker.savedColors = [];
+/** add the color to the savedColors */
+colorPicker.remember = function(color)
+{
+ // check if this color is known
+ for ( var i = colorPicker.savedColors.length; i--; )
+ {
+ if ( colorPicker.savedColors[i] == color )
+ {
+ return false;
+ }
+ }
+ // insert the new color
+ colorPicker.savedColors.splice(0, 0, color);
+ // limit elements
+ colorPicker.savedColors = colorPicker.savedColors.slice(0, 21);
+ return true;
+};wymsy has also attached some files to update the color_picker on ticket #85, I dont have time to review them yet, but perhaps thoses updates are better than this patch. Need comments and review ![]()
I dont see what can be wrong with IE5.5 and this patch, but i dunno IE5.5 at all, what is the error ? But well, IE5.5 !!!
Concerning your layer/form problem, I guess you are talking about <select> in <form> elements that are NEVER hidden by any element beneath it, right ? If so, the IE solution (since this problem is an IE specific) is to add an iframe behind the elements to hide. But then, there's no solution before IE.5.5.
I have fixed the problem in the branch i'm working on.
http://mokhet.com/xinha/branch_events/e … demand.php
If it's ok for you, here is the patch to apply
Index: htmlarea.js
===================================================================
--- htmlarea.js (revision 553)
+++ htmlarea.js (working copy)
@@ -4253,7 +4253,17 @@
} catch (ex) {}
}
}
- var picker = new colorPicker({cellsize:editor.config.colorPickerGranularity,callback:function(color){editor._doc.execCommand(cmdID, false, color);}});
+ var cback = function(color) { editor._doc.execCommand(cmdID, false, color); };
+ if ( HTMLArea.is_ie )
+ {
+ var range = editor._createRange(editor._getSelection());
+ cback = function(color)
+ {
+ range.select();
+ editor._doc.execCommand(cmdID, false, color);
+ };
+ }
+ var picker = new colorPicker({cellsize:editor.config.colorPickerGranularity,callback:cback});
picker.open(editor.config.colorPickerPosition, btn);
};there is no way to control the css inside the editor content from the file htmlarea.css. You can give up to trying to make it work this way, you can't because it is two differents documents.
just try what i've told you, and as junkwarrior said, it is the body selector. I can make an example if you dont manage to make it work.
It's that simple :
- create you css file, let's name it /css/mystyle.css
- in this file, you write
body { background-color:black; color:white; }
- then, xinha_editors.myTextArea.config.pageStyleSheets = ['/css/mystyle.css'];
- where myTextArea is the name of your original textarea (or the id, can't remember right now)
And that's it, your background content is black
I can make you an example if you dont manage to do it.
the easiest imo is to create your css file, let's say /css/mystyle.css with all your css stuff (body background, default font, default margins, etc) then, when initializing Xinha, it just needs to play with the config.pageStyleSheets variable
I'm assuming here you are generating Xinha as stated in the newbie guide,
In step 5
xinha_editors.myTextArea..config.pageStyleSheets = ['/css/mystyle.css'];Yes, everything explained in ticket 825
Hello, there is a problem with this version, the HTMLArea.prototype.execCommand is totally recoded when only the case where cmdID == 'paste' is changed from original code.
I think you better should do something like this (cant tell if it's working, my computer is broken and so cant test ) :
1) save a reference to the core execCommand function in PlainText constructor
function PlainText(editor) {
this.editor = editor;
editor.config.htmlareaPaste = true;
PlainText.coreExecCommand = HTMLArea.prototype.execCommand;
}2) call the coreExecCommand reference when the cmdID is not 'paste'
// the execCommand function (intercepts some commands and replaces them with
// our own implementation)
HTMLArea.prototype.execCommand = function(cmdID, UI, param)
{
if ( cmdID == 'paste' )
{
try
{
//this._doc.execCommand(cmdID, UI, param);
var pastehtml=clipboardData.getData("Text"); //paste everything in IE as plain text!
this.insertHTML(pastehtml);
if ( this.config.killWordOnPaste )
{
this._wordClean();
}
}
catch (ex)
{
if ( HTMLArea.is_gecko )
{
this.pasteArea();
}
}
this.updateToolbar();
}
else
{
PlainText.coreExecCommand.call(this, cmdID, UI, param);
}
return false;
};What about caching mechanisms ? With this *trick*, users are forced to reload over and over the same (heavy) piece of javascript without any caching mechanisms available. Not very bandwitdh friendly.
actually, I really want to get it working in Opera 9 now it's in beta
http://mokhet.com/xinha/examples/full_example.html
This is my first attempt to make Xinha work under Opera9 beta 2, and i'm quite satisfy right now. Still a lot of issues but there is only a few lines to change to make it work
1) browser identification
(issue : this is a bad way to detect feature, we should check for objects instead of something not reliable like useragent, anyway ...)
HTMLArea.is_opera = (HTMLArea.agt.indexOf("opera") != -1);
// wrong way to find if it's opera9, but needed
// until we change the behavior of checkSupportedBrowser()
HTMLArea.is_opera9 = false;
if ( window.opera && (/Opera\s?\/([0-9])/.test(navigator.userAgent)) )
{
if ( parseInt(RegExp.$1, 10) >= 9 )
{
HTMLArea.is_opera9 = true;
}
}2) update checkSupportedBrowser()
(issue : still a bad way to detect stuff, we should give up on useragent detection)
// FIXME!!! this should return false for IE < 5.5
// @todo : this should check for objects existence and NOT on useragent strings
HTMLArea.checkSupportedBrowser = function()
{
if ( HTMLArea.is_gecko )
{
if ( navigator.productSub < 20021201 )
{
alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported.");
return false;
}
if ( navigator.productSub < 20030210 )
{
alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work.");
}
}
if ( HTMLArea.is_opera9 )
{
alert('Support for Opera 9 is still in beta stage and everything is still not totally supported');
}
return HTMLArea.is_gecko || HTMLArea.is_ie || HTMLArea.is_opera9;
};3) update HTMLArea.prototype.generate
(issue 1 : I cant manage to have HTMLArea._addEvent(this._frame, 'load', ... to work, so i changed it to this._iframe.onload)
(issue 2 : In actual changeset the event is set after the src, as a result the event is never started at least with opera, cant understand why it is working with others browsers, anyway, just setting the src after we have set (not before) the event and the issue is gone)
// create the IFRAME & add to container
var iframe = document.createElement("iframe");
// Add an event to initialize the iframe once loaded.
// MUST BE SET BEFORE THE IFRAME SRC ATTRIBUTE IS SET
editor._iframeLoadDone = false;
// @warn : cant make the _addEvent(iframe, 'load') work on Opera 9
// @todo : check if iframe.onload is enough for IE to start Xinha
iframe.onload = function(e)
{
if ( !editor._iframeLoadDone )
{
editor._iframeLoadDone = true;
editor.initIframe();
}
return true;
};
iframe.src = _editor_url + editor.config.URIs.blank;4) update HTMLArea.prototype.activateEditor and the same goes for HTMLArea.prototype.deactivateEditor
(issue : once again, we rely on useragent and not on objet detection)
HTMLArea.prototype.activateEditor = function()
{
// We only want ONE editor at a time to be active
if ( HTMLArea._currentlyActiveEditor )
{
if ( HTMLArea._currentlyActiveEditor == this )
{
return true;
}
HTMLArea._currentlyActiveEditor.deactivateEditor();
}
if ( ( HTMLArea.is_gecko || HTMLArea.is_opera9 ) && this._doc.designMode != 'on' )
{
try
{
// cannot set design mode if no display
if ( this._iframe.style.display == 'none' )
{
this._iframe.style.display = '';
this._doc.designMode = 'on';
this._iframe.style.display = 'none';
}
else
{
this._doc.designMode = 'on';
}
} catch (ex) {}
}
else if ( !HTMLArea.is_gecko && !HTMLArea.is_opera9 && this._doc.body.contentEditable !== true )
{
this._doc.body.contentEditable = true;
}
// We need to know that at least one editor on the page has been activated
// this is because we will not focus any editor until an editor has been activated
HTMLArea._someEditorHasBeenActivated = true;
HTMLArea._currentlyActiveEditor = this;
var editor = this;
this.enableToolbar();
return true;
};And that's it, the first beta version working on Opera9 beta 2
Despiste ALL the bugs all around
I hope you'll like this first attempt ![]()
patch commited in changeset :474
Wonder if I should commit this patch. Seems like something that's need to be in official release imo.
I think it might be ticket 364
Ah, thank for explaining what was "this"
I cant reproduce the issue with Firefox 1.5, but I of course see the problem with IE6.
Try this patch, it solves the problem on my side.
Index: htmlarea.js
===================================================================
--- htmlarea.js (revision 471)
+++ htmlarea.js (working copy)
@@ -1031,6 +1031,13 @@
}
});
+ // when we drag the icon, cancel the ondrag event
+ // IE only
+ if (HTMLArea.is_ie)
+ {
+ el.ondrag = function() { return false; };
+ }
+
var i_contain = HTMLArea.makeBtnImg(btn[1]);
var img = i_contain.firstChild;
el.appendChild(i_contain);Fix your HTML markup, in your example there's this :
<textarea id="Body" name="Body" rows="10" cols="50" style="width:100%> Test text here</textarea>
notice the missing quote in the style declaration and change it to
<textarea id="Body" name="Body" rows="10" cols="50" style="width:100%"> Test text here</textarea>
Lol, a cut and paste of your first post doesnt help to understand what you want to prevent happening.
So I ask again... What do you want to prevent ? Please dont cut/paste again.
In your question, try to not use the word "this", please explain !!!
Is there anyway I can prevent this from happening?
What is "this" ? What do you think should happen when you drag & drop an icon from the toolbar ? Why the hell would someone drag & drop thoses icons anyway. What do you want to be accomplished while drag & dropping ?
Your next message will be my last attempt to understand your problem. Please explain !