Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape
sstoner wrote:A friend was kind enough to give me a little corner of her server space, so QuickTags can be downloaded here
sstoner wrote:Compatibility:
Coranto
QuickTags has been tested with Coranto v 1.23 and 1.24. It should also work with older versions of Coranto but has not been tested.
Other Addons
QuickTags is not compatible with the WebWriter or HTMLBuilder Addons.
sstoner wrote:Hi Tony -- glad you've found the addon to be useful and glad it's working for you in Opera. I tested using Opera 7.54 Build 3869 on Win XP machine and it did not work correctly (inserts the tags at the end of the content). I'm not sure it would make a difference, but can you tell me what platform you're running? Maybe Opera supports inserting at the cursor position in platforms other than Windows?
suestoner wrote:It's no big deal, but I added a button for making a link as requested by a friend.
sstoner wrote:I tested using Opera 7.54 Build 3869 on Win XP machine and it did not work correctly (inserts the tags at the end of the content)
edButtons[edButtons.length] = new edButton('ed_link'
,'Link'
,''
,'</a>'
); // special case
// added image tag
// the end tag value is empty on purpose
edButtons[edButtons.length] = new edButton('ed_img'
,'IMG'
,'' // start tag
,'' // end tag
); // special case
else if (button.id == 'ed_link') {
document.write('<input type="button" id="' + button.id + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');
}
// added for image tag
else if (button.id == 'ed_img') {
document.write('<input type="button" id="' + button.id + '" class="ed_button" onclick="edInsertImg(edCanvas, ' + i + ');" value="' + button.display + '" />');
}
function edInsertLink(myField, i, defaultValue) {
if (!defaultValue) {
defaultValue = 'http://';
}
if (!edCheckOpenTags(i)) {
var link = prompt('Enter a website address' ,defaultValue);
if (link) {
edButtons[i].tagStart = '<a href="' + link + '">';
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}
// added for image tag
// make sure that the function name is unique
function edInsertImg(myField, i, defaultValue) {
if (!defaultValue) {
// change the default to fit your needs, for example you image directory
// full url - http://www.yoursite.com/pics/ or relative url /pics/
defaultValue = 'http://';
}
if (!edCheckOpenTags(i)) {
var link = prompt('Enter the url for your image' ,defaultValue);
if (link) {
edButtons[i].tagStart = '<img src="' + link + '" alt="">';
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}
// this defines the structure of each button
function edButton(id, display, tagStart, tagEnd, open) {
this.id = id; // used to name the toolbar button
this.display = display; // label on button
this.tagStart = tagStart; // open tag
this.tagEnd = tagEnd; // close tag
this.open = open; // set to -1 if tag does not need to be closed
}
// this is the button for the strong tag
edButtons[edButtons.length] = new edButton('ed_bold'
,'Bold' // button label
,'<strong>' // start tag
,'</strong>' // end tag
);
edButtons[edButtons.length] = new edButton('ed_lnk'
,'URL' // button label
,'<a href="">' // start tag
,'</a>' // end tag
);
$QuickTags_ModifyFormHook = <<'END_CODE';
if ($fn eq 'Text') {
$fcode =~ s/<textarea name="Text" rows="\d+" cols="\d+" wrap="VIRTUAL">.+<\/textarea>/<script type="text\/javascript">edToolbar();<\/script>\n<textarea id="canvas" name="Text" rows="$fieldDB{$fn}->{'FieldRows'}" cols="$fieldDB{$fn}->{'FieldCols'}" wrap="VIRTUAL">$$fn<\/textarea>\n<script type="text\/javascript">var edCanvas = document.getElementById('canvas');<\/script>/is;
}
END_CODE
$QuickTags_ModifyFormHook = <<'END_CODE';
if ($fn eq 'Text') {
$fcode =~ s/<textarea name="Text" rows="\d+" cols="\d+" wrap="VIRTUAL">.*?<\/textarea>/<script type="text\/javascript">edToolbar();<\/script>\n<textarea id="canvas" name="Text" rows="$fieldDB{$fn}->{'FieldRows'}" cols="$fieldDB{$fn}->{'FieldCols'}" wrap="VIRTUAL">$$fn<\/textarea>\n<script type="text\/javascript">var edCanvas = document.getElementById('canvas');<\/script>/is;
}
END_CODE
Return to Addon Release and Support
Users browsing this forum: No registered users and 1 guest