wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 4, 2010 21:39:11 GMT -8
Browser Tested: Internet Explorer 7/8, Firefox, Chrome, Opera, and Safari Most forum software have BBCode buttons with the quick reply but ProBoards doesn't. This mod aims to fix this problem. This code also allows you to add tags and their buttons like the following four tag mods I use on my forum: PreviewGlobal Footer <script language="javascript"> /* Ultimate Quick Reply Mod by wildgoosespeeder Parts of the following codes were used in this code: UBBC Buttons With Quick Reply by Mithras Color drop-down in Quick Reply box by Todge Smileys with quick reply by Peter */ if(location.href.match(/thread=/) && !document.postForm && !location.href.match(/action=(downloadattachmentpage|movetopic|reportpost)/) && document.getElementsByTagName("form")[0].method == "post") { var buttonsPerRow = 14; // 14 default. // Buttons - [Image Location, Opening Tag, Closing Tag, Title/Alternate Text] var buttons = [ ["http://s1.images.proboards.com/bold.gif","[b]","[/b]","Bold"], ["http://s1.images.proboards.com/italicize.gif","[i]","[/i]","Italicize"], ["http://s1.images.proboards.com/underline.gif","[u]","[/u]","Underline"], ["http://s1.images.proboards.com/strike.gif","[s]","[/s]","Strikethrough"], ["http://s1.images.proboards.com/glow.gif","[glow=red,2,300]","[/glow]","Glow"], ["http://s1.images.proboards.com/shadow.gif","[shadow=red,left,300]","[/shadow]","Shadow"], ["http://s1.images.proboards.com/move.gif","[move]","[/move]","Marquee"], ["http://s1.images.proboards.com/pre.gif","[pre]","[/pre]","Preformatted Text"], ["http://s1.images.proboards.com/left.gif","[left]","[/left]","Align Left"], ["http://s1.images.proboards.com/center.gif","[center]","[/center]","Align Center"], ["http://s1.images.proboards.com/right.gif","[right]","[/right]","Align Right"], ["http://s1.images.proboards.com/hr.gif","[hr]","","Horizontal Rule"], ["http://s1.images.proboards.com/size.gif","[size=2]","[/size]","Font Size"], ["http://s1.images.proboards.com/face.gif","[font=Verdana]","[/font]","Font Face"], ["http://s1.images.proboards.com/youtube.gif","[youtube]","[/youtube]","YouTube Video"], ["http://s1.images.proboards.com/blockquote.gif","[blockquote]","[/blockquote]","Blockquote"], ["http://s1.images.proboards.com/url.gif","[url]","[/url]","Insert Hyperlink"], ["http://s1.images.proboards.com/img.gif","[img]","[/img]","Insert Image"], ["http://s1.images.proboards.com/email2.gif","[email]","[/email]","Insert Email"], ["http://s1.images.proboards.com/table.gif","[table][tr][td]","[/td][/tr][/table]","Insert Table"], ["http://s1.images.proboards.com/tr.gif","[tr]","[/tr]","Insert Table Row"], ["http://s1.images.proboards.com/td.gif","[td]","[/td]","Insert Table Column Cell"], ["http://s1.images.proboards.com/sup.gif","[sup]","[/sup]","Superscript"], ["http://s1.images.proboards.com/sub.gif","[sub]","[/sub]","Subscript"], ["http://s1.images.proboards.com/tele.gif","[tt]","[/tt]","Teletype"], ["http://s1.images.proboards.com/code.gif","[c"+"ode]","[/c"+"ode]","Insert Code"], ["http://s1.images.proboards.com/quote2.gif","[quote]","[/quote]","Insert Quote"], ["http://s1.images.proboards.com/list.gif","[ul]\\n[li]","\\n[/li][li]\\n[/li][li]\\n[/li][/ul]","Insert List"] ]; // List of smileys - [Image Location, UBBC Code, Title/Alternate Text] var iSmileys = [ ["http://s1.images.proboards.com/smiley.gif",":)","Smiley"], ["http://s1.images.proboards.com/wink.gif",";)","Wink"], ["http://s1.images.proboards.com/cheesy.gif",":D","Cheesy"], ["http://s1.images.proboards.com/grin.gif",";D","Grin"], ["http://s1.images.proboards.com/angry.gif","%3E:(","Angry"], ["http://s1.images.proboards.com/sad.gif",":(","Sad"], ["http://s1.images.proboards.com/shocked.gif",":o","Shocked"], ["http://s1.images.proboards.com/cool.gif","8-)","Cool"], ["http://s1.images.proboards.com/huh.gif","???","Huh"], ["http://s1.images.proboards.com/rolleyes.gif","::)","Roll Eyes"], ["http://s1.images.proboards.com/tongue.gif",":P","Tongue"], ["http://s1.images.proboards.com/embarassed.gif",":-[","Embarassed"], ["http://s1.images.proboards.com/lipsrsealed.gif",":-X","Lips Sealed"], ["http://s1.images.proboards.com/undecided.gif",":-/","Undecided"], ["http://s1.images.proboards.com/kiss.gif",":-*","Kiss"], ["http://s1.images.proboards.com/cry.gif",":%27(","Cry"] ]; var hrSize = 435; var buttonHTML = ""; for(i = 0; i < buttons.length; i++) { if(i == buttonsPerRow) { var colors = ["Black","Red","Yellow","Pink","Green","Orange","Purple","Blue","Beige","Brown","Teal","Navy","Maroon","Lime Green"]; buttonHTML += " <select name='color' onChange='ubbc(\"[color=\", \"[/color]\", this.options[this.selectedIndex].value);this.selectedIndex=0;'><option value='color'>Colors</option>"; for(c = 0; c < colors.length; c++) { buttonHTML += "<option value='" + colors[c].split(" ").join("") + "'>" + colors[c] + "</option>"; } buttonHTML += "</select><br />"; } buttonHTML += "<a href='javascript:ubbc(\"" + buttons[i][1] + "\",\"" + buttons[i][2] + "\")'><img src='" + buttons[i][0] + "' border='0' title='" + buttons[i][3] + "' alt='" + buttons[i][3] + "' /></a>"; } buttonHTML += "<hr width='" + hrSize + "' align='left' />"; for(s = 0; s < iSmileys.length; s++) { buttonHTML += "<a href='javascript:ubbc(\" " + iSmileys[s][1] + "\",\"\")'><img src='" + iSmileys[s][0] + "' border='0' title='" + iSmileys[s][2] + "' alt='" + iSmileys[s][2] + "' /></a> "; } buttonHTML += "<hr width='" + hrSize + "' align='left' />"; var tds = document.getElementsByTagName("td"); for(a = tds.length; a > 0; a--) { if(tds[a-1].width == "100%" && tds[a].align == "right") { tds[a-1].innerHTML = buttonHTML + tds[a-1].innerHTML; break; } } } function ubbc(open, end) { var tAreas = document.getElementsByTagName('textarea'); for(i=0; i<tAreas.length; i++) { if(tAreas[i].rows == 5 && tAreas[i].cols == 100) { var tArea = tAreas[i]; } } var isIE = (document.all)? true : false; var open = (open)? open : ""; var end = (end)? end : ""; if(isIE) { tArea.focus(); var curSelect = document.selection.createRange(); if(arguments[2]) { curSelect.text = open + arguments[2] + "]" + curSelect.text + end; } else { curSelect.text = open + curSelect.text + end; } } else if(!isIE && typeof tArea.selectionStart != "undefined") { var selStart = tArea.value.substr(0, tArea.selectionStart); var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length); var curSelection = tArea.value.replace(selStart, '').replace(selEnd, ''); if(arguments[2]) { tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd; } else { tArea.value = selStart + open + curSelection + end + selEnd; } } else { tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end; } } </script> *had to make a small change to the tag to make it work with a script[/color]
|
|
|
Post by Wormopolis on Oct 23, 2010 14:48:00 GMT -8
might want to add in some instructions on what they need to do if they want to add in a UBBC tag for other codes (like the 4 you have listed or even colorSmear).
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 24, 2010 13:44:15 GMT -8
I thought that comment before the bold button array is pretty clear... I think my code would really come in handy for WormoCodes. Are you thinking of adding it? I would really appreciate it if you did. To me this code is one of those manditory codes every board shouldn't be without.
|
|
|
Post by Wormopolis on Oct 24, 2010 13:48:56 GMT -8
one would hope that comment tags can make things clear, but examples always seem to make things easier.
I am working on a menu code today, so if I finish it I will see about implementing this script.
|
|
|
Post by randie on Nov 7, 2010 0:42:55 GMT -8
Seems to me, I recall you getting help with this at PBS about a year back maybe two? You took other codes which were already wrote an added them to this. Correct me if I'm wrong?How can you claim you wrote any of it? Ice that baby!
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Nov 7, 2010 10:43:13 GMT -8
I combined codes and improved upon them. That code only does UBBC buttons. My code does UBBC buttons, color drop-down, and smileys.
|
|
Nightwalker
Full Member
Everything Happens at Night
Posts: 138
Nightwalker said 0 great things
|
Post by Nightwalker on Nov 7, 2010 11:04:42 GMT -8
I do see the connection but WGS did change some things....
I do that a lot too. Take things that were already done and add stuff to it. Why do all the work when it's been done already...
|
|
|
Post by randie on Nov 7, 2010 12:51:23 GMT -8
I combined codes and improved upon them. That code only does UBBC buttons. My code does UBBC buttons, color drop-down, and smileys. Give credit where it's due. You wrote none of this "code". You Modified it.I do see the connection but WGS did change some things.... I do that a lot too. Take things that were already done and add stuff to it. Why do all the work when it's been done already... It's called ripping!
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Nov 7, 2010 15:59:46 GMT -8
Well what I did is what is called "fair use". Let's look at YouTube. I'm sure you hear a lot of those "false DMCA claims". Under copyright law of the United States, it goes along the lines of taking source material and creating something new. I suck at explaining:
I know that is for video but the point I'm trying to make is this is fair.
|
|
|
Post by Wormopolis on Nov 7, 2010 16:07:12 GMT -8
Even merging 2 codes isnt the same as writing one from scratch. The only way a code like this could be accepted, whether on a database or public opinion, would be to include the credit in the header for the original 2 codes.
Otherwise, what stops someone from just renaming variables or changing the order of conditional loops, and then putting their own name on the top?
|
|
|
Post by randie on Nov 7, 2010 16:25:00 GMT -8
Well what I did is what is called "fair use". Let's look at YouTube. I'm sure you hear a lot of those "false DMCA claims". Under copyright law of the United States, it goes along the lines of taking source material and creating something new. I suck at explaining: I know that is for video but the point I'm trying to make is this is fair. Youtube? ha ha Kidding right? Submit it at PBS and see where/how it goes? You do suck at explaining ripping codes!
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Nov 7, 2010 16:25:09 GMT -8
If I remember correctly, I think I PMed to ask permission from each code creator to use their code in my code. Each one said yes.
|
|
|
Post by randie on Nov 7, 2010 16:39:21 GMT -8
If I remember correctly, I think I PMed to ask permission from each code creator to use their code in my code. Each one said yes. You still don't get it huh? Just modify the the part where you say... /* Ultimate Quick Reply Mod by wildgoosespeeder */ /* Took Several Codes and combined them */ /* Thank to Mithras and whoever else belongs here*/ I really don't give a damn but ripping is ripping.
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Nov 7, 2010 17:00:43 GMT -8
ProBoards Support has accepted these codes a while ago as shown here and they are the top dog for rules on ProBoards so I don't see the problem.
|
|
|
Post by randie on Nov 7, 2010 17:17:20 GMT -8
ProBoards Support has accepted these codes a while ago as shown here and they are the top dog for rules on ProBoards so I don't see the problem. Cool. You provided no links. Wow, No problem. ;D Just do what Wormo said and add some damn credit to the code. You did'nt write it so give credit where it's due! As far as I'm concerned this code will be subject to copyright laws just as the one you posted to... oh... wait that was a youtube.
|
|