htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Marquee-Mod?


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


mad
New User

Aug 2, 2004, 5:07 AM

Post #1 of 6 (6694 views)
Shortcut
Marquee-Mod? Can't Post

Hi there,

I saw an marquee mod for v2 of HTMLarea.

Does anyone have such a mod for v3? Unfortunately I haven't found one yet.

Thank your!


Ice^3
Novice

Aug 10, 2004, 2:27 PM

Post #2 of 6 (6664 views)
Shortcut
Re: [mad] Marquee-Mod? [In reply to] Can't Post

You could use surroundHTML() which is labeled as buggy, or just insertHTML(), and make a new function that tacks marquee tags on both ends of the input.


gocher
Novice

Oct 11, 2004, 8:48 AM

Post #3 of 6 (6530 views)
Shortcut
Re: [mad] Marquee-Mod? [In reply to] Can't Post

A realy small and simple version I've written for You!!!

HTMLArea.loadPlugin("InsertMarquee");
cfg.toolbar = [ .... "insertmarquee", ...]
editor.registerPlugin(InsertMarquee);

insert-marquee.js:
// Marquee plugin for HTMLArea
// Implementation by Udo Schmal based on HTMLArea 3.0
// Original Author - Udo Schmal, Schaffrath-NeueMedien
//
// (c) Udo Schmal.2004
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).

function InsertMarquee(editor) {
this.editor = editor;

var cfg = editor.config;
var toolbar = cfg.toolbar;
var self = this;
var i18n = InsertMarquee.I18N;


// register the toolbar buttons provided by this plugin
cfg.registerButton({
id : "insertmarquee",
tooltip : i18n["InsertMarqueeTooltip"],
image : editor.imgURL("ed_marquee.gif", "InsertMarquee"),
textMode : false,
action : function(editor) {
self.buttonPress(editor);
}
})

// toolbar.push("insertmarquee");

// for (var i = 0; i < toolbar.length; ++i) {
// cfg.toolbar[0].push(toolbar[i]);
// }
};

InsertMarquee._pluginInfo = {
name : "InsertMarquee",
version : "1.0",
developer : "Udo Schmal",
developer_url : "http://www.schaffrath-NeueMedien.de/",
c_owner : "Udo Schmal & Schaffrath NeueMedien",
license : "htmlArea"
};

InsertMarquee.prototype.buttonPress = function(editor) {
var outparam = null;
// var sel = editor._getSelection();
// var range = editor._createRange(sel);
// var compare = 0;
// if (HTMLArea.is_ie) {
// compare = range.compareEndPoints("StartToEnd", range);
// } else {
// compare = range.compareBoundaryPoints(range.START_TO_END, range);
// }
// if (compare != 0) {

// } else {
outparam = {
f_behavior : '',
f_direction : '',
f_text : ''
};
// }
editor._popupDialog( "plugin://InsertMarquee/insert_marquee", function( param )
{
if ( !param )
{ //user must have pressed Cancel
return false;
} else {
var text = '<marquee behavior="' + param["f_behavior"] + '" direction="' + param["f_direction"] + '">\n';
text = text + param["f_text"];
text = text + '</marquee>';
editor.insertHTML( text );
}
}, outparam);
}
popups\insert_marquee.html:
<html>
<head><title>Marquee Editor</title>
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
window.resizeTo(400, 200);

I18N = window.opener.HTMLArea.I18N.dialogs;

function i18n(str) {
return (I18N[str] || str);
};

function Init() {
__dlg_translate(I18N);
__dlg_init();
var param = window.dialogArguments;
if (param)
{ if ( typeof param["f_text"] != "undefined" ) {
document.getElementById("f_text").value = param["f_text"];
}
if ( typeof param["f_direction"] != "undefined" ) {
document.getElementById("f_direction").value = param["f_direction"];
}
if ( typeof param["f_behavior"] != "undefined" ) {
document.getElementById("f_behavior").value = param["f_behavior"];
}
}
};

function onOK() {
var fields = ["f_behavior", "f_direction", "f_text"];
var param = new Object();
for (var i in fields) {
var id = fields[i];
var el = document.getElementById(id);
param[id] = el.value;
}
__dlg_close(param);
return false;
}

function onCancel() {
__dlg_close(null);
return false;
};

</script>

<style type="text/css">
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
table .label { text-align: right; width: 8em; }

.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}

#buttons {
margin-top: 1em; border-top: 1px solid #999;
padding: 2px; text-align: right;
}
</style>

</head>
<body onload="Init()">
<div class="title">Marquee Editor</div>
<form>
<table border="0" style="width: 100%;">
<tr>
<td class="lable">Direction:</td>
<td><select id="f_direction" name="f_direction">
<option value="">Left
<option value="right">Right
</select>
</td>
</tr>
<tr>
<td class="lable">Behavoir:</td>
<td><select id="f_behavior" name="f_behavior">
<option value="">Continuous
<option value="slide">Slide
<option value="alternate">Alternate
</select>
</td>
</tr>
<tr>
<td class="lable">Marquee:</td>
<td><input type="text" id="f_text" name="f_text" value="" size="30"></td>
</tr>
</table>

<div id="buttons">
<button type="submit" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>
img/ed_marquee.gif:
lang/de.js:
// I18N constants

// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
// Author: Udo Schmal
//
// (c) Udo Schmal 2004
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).

InsertMarquee.I18N = {
"InsertMarqueeTooltip" : "Marquee einfügen",
"Cancel" : "Abbrechen"
};
lang/en.js
// I18N constants

// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Udo Schmal
//
// (c) Udo Schmal 2004
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).

InsertMarquee.I18N = {
"InsertMarqueeTooltip" : "Insert marquee",
"Cancel" : "Cancel"
};
Attachments: InsertMarquee.zip (4.31 KB)


Ecco
Novice

Oct 22, 2004, 2:54 AM

Post #4 of 6 (6461 views)
Shortcut
Re: [gocher] Marquee-Mod? [In reply to] Can't Post

Hi Gocher,

this is going to be my favorite plugin once I get it to work Smile

Could it be that you forgot to show us the changes in htmlarea itself ? It says it doesn't know an insert-marquee button.

Cheers,

Ecco


gocher
Novice

Oct 28, 2004, 6:14 AM

Post #5 of 6 (6417 views)
Shortcut
Re: [Ecco] Marquee-Mod? [In reply to] Can't Post

Hi Ecco,

you forgot to define your toolbar extern, look at the 2nd line:
HTMLArea.loadPlugin("InsertMarquee");
cfg.toolbar = [ ... "insertmarquee", ...]
editor.registerPlugin(InsertMarquee);

Or you can uncomment the following lines in insert-marquee.js:
toolbar.push("insertmarquee");
for (var i = 0; i < toolbar.length; ++i) {
cfg.toolbar[0].push(toolbar);
}


Ecco
Novice

Oct 30, 2004, 4:06 AM

Post #6 of 6 (6382 views)
Shortcut
Re: [gocher] Marquee-Mod? [In reply to] Can't Post

yyyyyyes! Got it working ! Thanks !

I also did not realise that the directories lang, img and popups are subdirectories of \plugins\InsertMarquee.

 
 
 


Search for (options)