The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I'd like to add a button that when clicked adds the [ spoiler][ /spoiler] Tags to the message area. I want to use this as a way of Tagging a post with keywords by placing keywords inside the spoiler tags.
I have the icon set up....
Const strIconEditorTags = "icon_editor_tag.gif|23|22"
...but the rest eludes me.
<
I have the icon set up....
Const strIconEditorTags = "icon_editor_tag.gif|23|22"
...but the rest eludes me.
<
نوشته شده در
In inc_post_buttons.asp look for and add the part in red:
Then below that add:
Then in inc_func_common.asp look for:
Below that add (Notice the three green spots. Remove the space in them for your code - I had to but them there for them to show up here.):
<
Code:
"<a href=""Javascript:list();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorList,"Insert List","align=""top""") & "</a>" & vbNewLine & _Code:
"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Spoiler","align=""top""") & "</a>" & vbNewLineCode:
function strike() {
var text = getText();
if (helpstat) {
alert("Strike-Through Tag Makes the enclosed text have a line through it.\n\nUSE: This is some stricken text");
} else if (basic) {
AddTxt="[s]" + text + "[ /s]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be stricken.",text);
} else {
txt=prompt("Text to be stricken.","Text");
}
if (txt!=null) {
AddTxt="[s]"+txt+"[ /s]";
AddText(AddTxt);
}
}
}Below that add (Notice the three green spots. Remove the space in them for your code - I had to but them there for them to show up here.):
Code:
function spoiler() {
var text = getText();
if (helpstat) {
alert("The Spoiler Tag makes the enclosed text HIDDEN.\n\nUSE: [spoiler]This is some hidden text[ /spoiler]");
} else if (basic) {
AddTxt="[spoiler]" + text + "[ /spoiler]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be made hidden.",text);
} else {
txt=prompt("Text to be made hidden.","Text");
}
if (txt!=null) {
AddTxt="[spoiler]"+txt+"[/ spoiler]";
AddText(AddTxt);
}
}
}
آخرین ویرایش توسط
نوشته شده در
Originally posted by leatherlips
In inc_post_buttons.asp look for and add the part in red:
Then in inc_func_common.asp look for:Code:function strike() {
var text = getText();
if (helpstat) {
alert("Strike-Through Tag Makes the enclosed text have a line through it.\n\nUSE:This is some stricken text");
} else if (basic) {
AddTxt="[s]" + text + "[ /s]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be stricken.",text);
} else {
txt=prompt("Text to be stricken.","Text");
}
if (txt!=null) {
AddTxt="[s]"+txt+"[ /s]";
AddText(AddTxt);
}
}
}
If you do not find this bit of code in "inc_func_common.asp", look in the javascript folder (js\) for a file titled "inc_code.js". Then just copy/paste where it belongs in that file instead.<
نوشته شده در
Thanks Guys for your time! And thanks for incuding the .js bit!!
Besides the obivious changes to these files, are you aware of where I might change 'sploiler' to 'tag' and have the same hidden text effect?<
Besides the obivious changes to these files, are you aware of where I might change 'sploiler' to 'tag' and have the same hidden text effect?<
نوشته شده در
Change the code I told you to add from this:
To this:
<
Code:
function spoiler() {
var text = getText();
if (helpstat) {
alert("The Spoiler Tag makes the enclosed text HIDDEN.\n\nUSE: [spoiler]This is some hidden text[ /spoiler]");
} else if (basic) {
AddTxt="[spoiler]" + text + "[ /spoiler]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be made hidden.",text);
} else {
txt=prompt("Text to be made hidden.","Text");
}
if (txt!=null) {
AddTxt="[spoiler]"+txt+"[/ spoiler]";
AddText(AddTxt);
}
}
}To this:
Code:
function tag() {
var text = getText();
if (helpstat) {
alert("The tag function makes the enclosed text HIDDEN.\n\nUSE: [tag]This is some hidden text[/tag]");
} else if (basic) {
AddTxt="[tag]" + text + "[/tag]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be made hidden.",text);
} else {
txt=prompt("Text to be made hidden.","Text");
}
if (txt!=null) {
AddTxt="[tag]"+txt+"[/tag]";
AddText(AddTxt);
}
}
}
آخرین ویرایش توسط
نوشته شده در
You'll also need to add this to inc_func_common.asp: (I had to add the space in the green text below so it would show. Yours won't have the space.)
Look for:
Below that add:
[/code]<
Look for:
Code:
fString = doCode(fString, "[spoiler]", "[/ spoiler]", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")Code:
fString = doCode(fString, "[tag]", "[/tag]", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")
آخرین ویرایش توسط
نوشته شده در
I forgot one more thing...
In inc_post_buttons.asp where you added:
Change it to:
<
In inc_post_buttons.asp where you added:
Code:
"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Spoiler","align=""top""") & "</a>" & vbNewLineChange it to:
Code:
"<a href=""Javascript:tag();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Tags","align=""top""") & "</a>" & vbNewLine
آخرین ویرایش توسط
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...