From 60d21716da68028ba63e4f2aa40c35f4bfe54b0d Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 10 Dec 2012 15:07:45 -0800 Subject: alternate wysiwyg bbcode editor --- library/bbedit/editor.css | 9 + library/bbedit/editor.js | 486 +++++++++++++++++++++ library/bbedit/images/.svn/all-wcprops | 53 +++ library/bbedit/images/.svn/entries | 300 +++++++++++++ .../images/.svn/prop-base/colors.gif.svn-base | 5 + .../images/.svn/prop-base/editbar_bg.gif.svn-base | 5 + .../images/.svn/prop-base/icon_html.gif.svn-base | 5 + .../images/.svn/prop-base/icon_list.gif.svn-base | 5 + .../images/.svn/prop-base/icon_quote.png.svn-base | 5 + .../.svn/prop-base/icon_youtube.gif.svn-base | 5 + .../bbedit/images/.svn/prop-base/img.gif.svn-base | 5 + .../bbedit/images/.svn/prop-base/url.gif.svn-base | 5 + .../images/.svn/text-base/colors.gif.svn-base | Bin 0 -> 1024 bytes .../images/.svn/text-base/editbar_bg.gif.svn-base | Bin 0 -> 301 bytes .../images/.svn/text-base/icon_html.gif.svn-base | Bin 0 -> 178 bytes .../images/.svn/text-base/icon_list.gif.svn-base | Bin 0 -> 82 bytes .../images/.svn/text-base/icon_quote.png.svn-base | Bin 0 -> 1239 bytes .../.svn/text-base/icon_youtube.gif.svn-base | Bin 0 -> 613 bytes .../bbedit/images/.svn/text-base/img.gif.svn-base | Bin 0 -> 570 bytes .../bbedit/images/.svn/text-base/url.gif.svn-base | Bin 0 -> 209 bytes library/bbedit/images/colors.gif | Bin 0 -> 1024 bytes library/bbedit/images/editbar_bg.gif | Bin 0 -> 301 bytes library/bbedit/images/icon_html.gif | Bin 0 -> 178 bytes library/bbedit/images/icon_list.gif | Bin 0 -> 82 bytes library/bbedit/images/icon_quote.png | Bin 0 -> 1239 bytes library/bbedit/images/icon_youtube.gif | Bin 0 -> 613 bytes library/bbedit/images/img.gif | Bin 0 -> 570 bytes library/bbedit/images/url.gif | Bin 0 -> 209 bytes library/bbedit/readme.txt | 28 ++ library/bbedit/sample.htm | 37 ++ 30 files changed, 953 insertions(+) create mode 100644 library/bbedit/editor.css create mode 100644 library/bbedit/editor.js create mode 100644 library/bbedit/images/.svn/all-wcprops create mode 100644 library/bbedit/images/.svn/entries create mode 100644 library/bbedit/images/.svn/prop-base/colors.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/editbar_bg.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/icon_html.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/icon_list.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/icon_quote.png.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/icon_youtube.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/img.gif.svn-base create mode 100644 library/bbedit/images/.svn/prop-base/url.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/colors.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/editbar_bg.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/icon_html.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/icon_list.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/icon_quote.png.svn-base create mode 100644 library/bbedit/images/.svn/text-base/icon_youtube.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/img.gif.svn-base create mode 100644 library/bbedit/images/.svn/text-base/url.gif.svn-base create mode 100644 library/bbedit/images/colors.gif create mode 100644 library/bbedit/images/editbar_bg.gif create mode 100644 library/bbedit/images/icon_html.gif create mode 100644 library/bbedit/images/icon_list.gif create mode 100644 library/bbedit/images/icon_quote.png create mode 100644 library/bbedit/images/icon_youtube.gif create mode 100644 library/bbedit/images/img.gif create mode 100644 library/bbedit/images/url.gif create mode 100644 library/bbedit/readme.txt create mode 100644 library/bbedit/sample.htm (limited to 'library/bbedit') diff --git a/library/bbedit/editor.css b/library/bbedit/editor.css new file mode 100644 index 000000000..30fd4ce0c --- /dev/null +++ b/library/bbedit/editor.css @@ -0,0 +1,9 @@ +.editorWYSIWYG {font: 10pt Tahoma;border:none;} +.editorBBCODE {font: 9pt "Courier New";} + +div.richeditor div.editbar {margin-top:5px;background-image:url('images/editbar_bg.gif');border-left:1px solid silver;border-right:1px solid silver;border-top:1px solid silver;border-bottom:none;} +div.richeditor div button{vertical-align:middle;width:25px;height:25px;border:1px solid transparent;background-color:Transparent;cursor:pointer;color:Black;background-position:center;background-repeat:no-repeat;background-image:none;} +div.richeditor div button:hover{border:1px solid silver;} +div.richeditor div.container {border-top:none;border-bottom:1px solid silver;border-left:1px solid silver;border-right:1px solid silver;} +div.richeditor textarea{padding:0px 0px 0px 0px;border:none;} +div.richeditor iframe{background-color:#ffffff;border:none;} \ No newline at end of file diff --git a/library/bbedit/editor.js b/library/bbedit/editor.js new file mode 100644 index 000000000..57de38876 --- /dev/null +++ b/library/bbedit/editor.js @@ -0,0 +1,486 @@ +/* +WYSIWYG-BBCODE editor +Copyright (c) 2009, Jitbit Sotware, http://www.jitbit.com/ +PROJECT HOME: http://wysiwygbbcode.codeplex.com/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY Jitbit Software ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL Jitbit Software BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +var myeditor, ifm; +var body_id, textboxelement; +var content; +var isIE = /msie|MSIE/.test(navigator.userAgent); +var isChrome = /Chrome/.test(navigator.userAgent); +var isSafari = /Safari/.test(navigator.userAgent) && !isChrome; +var browser = isIE || window.opera; +var textRange; +var enter = 0; +var editorVisible = false; +var enableWysiwyg = false; + +function rep(re, str) { + content = content.replace(re, str); +} + +function initEditor(textarea_id, wysiwyg) { + if(wysiwyg!=undefined) + enableWysiwyg = wysiwyg; + else + enableWysiwyg = true; + body_id = textarea_id; + textboxelement = document.getElementById(body_id); + textboxelement.setAttribute('class', 'editorBBCODE'); + textboxelement.className = "editorBBCODE"; + if (enableWysiwyg) { + ifm = document.createElement("iframe"); + ifm.setAttribute("id", "rte"); + ifm.setAttribute("frameborder", "0"); + ifm.style.width = textboxelement.style.width; + ifm.style.height = textboxelement.style.height; + textboxelement.parentNode.insertBefore(ifm, textboxelement); + textboxelement.style.display = 'none'; + if (ifm) { + ShowEditor(); + } else + setTimeout('ShowEditor()', 100); + } +} + +function getStyle(el,styleProp) +{ + var x = document.getElementById(el); + if (x.currentStyle) + var y = x.currentStyle[styleProp]; + else if (window.getComputedStyle) + var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); + return y; +} + +function ShowEditor() { + if (!enableWysiwyg) return; + editorVisible = true; + content = document.getElementById(body_id).value; + myeditor = ifm.contentWindow.document; + bbcode2html(); + myeditor.designMode = "on"; + myeditor.open(); + myeditor.write(''); + myeditor.write(''); + myeditor.write(content); + myeditor.write(''); + myeditor.close(); + if (myeditor.attachEvent) { + if(parent.ProcessKeyPress) + myeditor.attachEvent("onkeydown", parent.ProcessKeyPress); + myeditor.attachEvent("onkeypress", kp); + } + else if (myeditor.addEventListener) { + if (parent.ProcessKeyPress) + myeditor.addEventListener("keydown", parent.ProcessKeyPress, true); + myeditor.addEventListener("keypress",kp,true); + } +} + +function SwitchEditor() { + if (editorVisible) { + doCheck(); + ifm.style.display = 'none'; + textboxelement.style.display = ''; + editorVisible = false; + } + else { + if (enableWysiwyg && ifm) { + ifm.style.display = ''; + textboxelement.style.display = 'none'; + ShowEditor(); + editorVisible = true; + } + } +} + +function html2bbcode() { + rep(/]*?src=\"?([^<>]*?)\"?(\s[^<>]*)?\/?>/gi,"[img]$1[/img]"); + rep(/<\/(strong|b)>/gi, "[/b]"); + rep(/<(strong|b)(\s[^<>]*)?>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)(\s[^<>]*)?>/gi,"[i]"); + rep(/<\/u>/gi, "[/u]"); + rep(/\n/gi, " "); + rep(/\r/gi, " "); + rep(/]*)?>/gi, "[u]"); + rep(/
]*)?>/gi, "
");//chrome-safari fix to prevent double linefeeds + rep(/]*)?>/gi,"\n"); + rep(/]*)?>/gi,""); + rep(/<\/p>/gi, "\n"); + rep(/
    /gi, "[ul]"); + rep(/<\/ul>/gi, "[/ul]"); + rep(/
      /gi, "[ol]"); + rep(/<\/ol>/gi, "[/ol]"); + rep(/
    1. /gi, "[li]"); + rep(/<\/li>/gi, "[/li]"); + rep(/<\/div>\s*]*)>/gi, "\n");//chrome-safari fix to prevent double linefeeds + rep(/]*)>/gi,"\n"); + rep(/<\/div>/gi,"\n"); + rep(/ /gi," "); + rep(/"/gi,"\""); + rep(/&/gi,"&"); + var sc, sc2; + do { + sc = content; + rep(/]*?color=\"?([^<>]*?)\"?(\s[^<>]*)?>([^<>]*?)<\/font>/gi,"[color=$1]$3[/color]"); + if(sc==content) + rep(/]*>([^<>]*?)<\/font>/gi,"$1"); + rep(/]*?href=\"?([^<>]*?)\"?(\s[^<>]*)?>([^<>]*?)<\/a>/gi,"[url=$1]$3[/url]"); + sc2 = content; + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?font-weight: ?bold;?\"?\s*([^<]*?)<\/\1>/gi,"[b]<$1 style=$2[/b]"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?font-weight: ?normal;?\"?\s*([^<]*?)<\/\1>/gi,"<$1 style=$2"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?font-style: ?italic;?\"?\s*([^<]*?)<\/\1>/gi,"[i]<$1 style=$2[/i]"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?font-style: ?normal;?\"?\s*([^<]*?)<\/\1>/gi,"<$1 style=$2"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?text-decoration: ?underline;?\"?\s*([^<]*?)<\/\1>/gi,"[u]<$1 style=$2[/u]"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?text-decoration: ?none;?\"?\s*([^<]*?)<\/\1>/gi,"<$1 style=$2"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?color: ?([^<>]*?);\"?\s*([^<]*?)<\/\1>/gi, "[color=$2]<$1 style=$3[/color]"); + rep(/<(span|blockquote|pre)\s[^<>]*?style=\"?font-family: ?([^<>]*?);\"?\s*([^<]*?)<\/\1>/gi, "[font=$2]<$1 style=$3[/font]"); + rep(/<(blockquote|pre)\s[^<>]*?style=\"?\"? (class=|id=)([^<>]*)>([^<>]*?)<\/\1>/gi, "<$1 $2$3>$4"); + rep(/
      ([^<>]*?)<\/pre>/gi, "[code]$1[/code]");
      +		rep(/]*?style=\"?\"?>([^<>]*?)<\/span>/gi, "$1");
      +		if(sc2==content) {
      +			rep(/]*>([^<>]*?)<\/span>/gi, "$1");
      +			sc2 = content;
      +		}
      +	}while(sc!=content)
      +	rep(/<[^<>]*>/gi,"");
      +	rep(/</gi,"<");
      +	rep(/>/gi,">");
      +	
      +	do {
      +		sc = content;
      +		rep(/\[(b|i|u)\]\[quote([^\]]*)\]([\s\S]*?)\[\/quote\]\[\/\1\]/gi, "[quote$2][$1]$3[/$1][/quote]");
      +		rep(/\[color=([^\]]*)\]\[quote([^\]]*)\]([\s\S]*?)\[\/quote\]\[\/color\]/gi, "[quote$2][color=$1]$3[/color][/quote]");
      +		rep(/\[(b|i|u)\]\[code\]([\s\S]*?)\[\/code\]\[\/\1\]/gi, "[code][$1]$2[/$1][/code]");
      +		rep(/\[color=([^\]]*)\]\[code\]([\s\S]*?)\[\/code\]\[\/color\]/gi, "[code][color=$1]$2[/color][/code]");
      +	}while(sc!=content)
      +
      +	//clean up empty tags
      +	do {
      +		sc = content;
      +		rep(/\[b\]\[\/b\]/gi, "");
      +		rep(/\[i\]\[\/i\]/gi, "");
      +		rep(/\[u\]\[\/u\]/gi, "");
      +		rep(/\[quote[^\]]*\]\[\/quote\]/gi, "");
      +		rep(/\[code\]\[\/code\]/gi, "");
      +		rep(/\[url=([^\]]+)\]\[\/url\]/gi, "");
      +		rep(/\[img\]\[\/img\]/gi, "");
      +		rep(/\[color=([^\]]*)\]\[\/color\]/gi, "");
      +	}while(sc!=content)
      +}
      +
      +function bbcode2html() {
      +	// example: [b] to 
      +	rep(/\/gi,">");
      +	
      +	rep(/\n/gi, "
      "); + rep(/\[ul\]/gi, "
        "); + rep(/\[\/ul\]/gi, "
      "); + rep(/\[ol\]/gi, "
        "); + rep(/\[\/ol\]/gi, "
      "); + rep(/\[li\]/gi, "
    2. "); + rep(/\[\/li\]/gi, "
    3. "); + if(browser) { + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + }else { + rep(/\[b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/(b|i|u)\]/gi,""); + } + rep(/\[img\]([^\"]*?)\[\/img\]/gi,""); + var sc; + do { + sc = content; + rep(/\[url=([^\]]+)\]([\s\S]*?)\[\/url\]/gi,"$2"); + rep(/\[url\]([\s\S]*?)\[\/url\]/gi,"$1"); + if(browser) { + rep(/\[color=([^\]]*?)\]([\s\S]*?)\[\/color\]/gi, "$2"); + rep(/\[font=([^\]]*?)\]([\s\S]*?)\[\/font\]/gi, "$2"); + } else { + rep(/\[color=([^\]]*?)\]([\s\S]*?)\[\/color\]/gi, "$2"); + rep(/\[font=([^\]]*?)\]([\s\S]*?)\[\/font\]/gi, "$2"); + } + rep(/\[code\]([\s\S]*?)\[\/code\]/gi,"
      $1
       "); + }while(sc!=content); +} + +function doCheck() { + if (!editorVisible) { + ShowEditor(); + } + content = myeditor.body.innerHTML; + html2bbcode(); + document.getElementById(body_id).value = content; +} + +function stopEvent(evt){ + evt || window.event; + if (evt.stopPropagation){ + evt.stopPropagation(); + evt.preventDefault(); + }else if(typeof evt.cancelBubble != "undefined"){ + evt.cancelBubble = true; + evt.returnValue = false; + } + return false; +} + +function doQuote() { + if (editorVisible) { + ifm.contentWindow.focus(); + if (isIE) { + textRange = ifm.contentWindow.document.selection.createRange(); + var newTxt = "[quote=]" + textRange.text + "[/quote]"; + textRange.text = newTxt; + } + else { + var edittext = ifm.contentWindow.getSelection().getRangeAt(0); + var original = edittext.toString(); + edittext.deleteContents(); + edittext.insertNode(document.createTextNode("[quote=]" + original + "[/quote]")); + } + } + else { + AddTag('[quote=]', '[/quote]'); + } +} + +function kp(e){ + if(isIE) + var k = e.keyCode; + else + var k = e.which; + if(k==13) { + if(isIE) { + var r = myeditor.selection.createRange(); + if (r.parentElement().tagName.toLowerCase() != "li") { + r.pasteHTML('
      '); + if (r.move('character')) + r.move('character', -1); + r.select(); + stopEvent(e); + return false; + } + } + }else + enter = 0; +} + +function InsertSmile(txt) { + InsertText(txt); + document.getElementById('divSmilies').style.display = 'none'; +} +function InsertYoutube() { + InsertText("http://www.youtube.com/watch?v=XXXXXXXXXXX"); +} +function InsertText(txt) { + if (editorVisible) + insertHtml(txt); + else + textboxelement.value += txt; +} + +function doClick(command) { + if (editorVisible) { + ifm.contentWindow.focus(); + myeditor.execCommand(command, false, null); + } + else { + switch (command) { + case 'bold': + AddTag('[b]', '[/b]'); break; + case 'italic': + AddTag('[i]', '[/i]'); break; + case 'underline': + AddTag('[u]', '[/u]'); break; + case 'InsertUnorderedList': + AddTag('[ul][li]', '[/li][/ul]'); break; + } + } +} + +function doColor(color) { + ifm.contentWindow.focus(); + if (isIE) { + textRange = ifm.contentWindow.document.selection.createRange(); + textRange.select(); + } + myeditor.execCommand('forecolor', false, color); +} + +function doLink() { + if (editorVisible) { + ifm.contentWindow.focus(); + var mylink = prompt("Enter a URL:", "http://"); + if ((mylink != null) && (mylink != "")) { + if (isIE) { //IE + var range = ifm.contentWindow.document.selection.createRange(); + if (range.text == '') { + range.pasteHTML("" + mylink + ""); + } + else + myeditor.execCommand("CreateLink", false, mylink); + } + else if (window.getSelection) { //FF + var userSelection = ifm.contentWindow.getSelection().getRangeAt(0); + if(userSelection.toString().length==0) + myeditor.execCommand('inserthtml', false, "" + mylink + ""); + else + myeditor.execCommand("CreateLink", false, mylink); + } + else + myeditor.execCommand("CreateLink", false, mylink); + } + } + else { + AddTag('[url=',']click here[/url]'); + } +} +function doImage() { + if (editorVisible) { + ifm.contentWindow.focus(); + myimg = prompt('Enter Image URL:', 'http://'); + if ((myimg != null) && (myimg != "")) { + myeditor.execCommand('InsertImage', false, myimg); + } + } + else { + AddTag('[img]', '[/img]'); + } +} + +function insertHtml(html) { + ifm.contentWindow.focus(); + if (isIE) + ifm.contentWindow.document.selection.createRange().pasteHTML(html); + else + myeditor.execCommand('inserthtml', false, html); +} + +//textarea-mode functions +function MozillaInsertText(element, text, pos) { + element.value = element.value.slice(0, pos) + text + element.value.slice(pos); +} + +function AddTag(t1, t2) { + var element = textboxelement; + if (isIE) { + if (document.selection) { + element.focus(); + + var txt = element.value; + var str = document.selection.createRange(); + + if (str.text == "") { + str.text = t1 + t2; + } + else if (txt.indexOf(str.text) >= 0) { + str.text = t1 + str.text + t2; + } + else { + element.value = txt + t1 + t2; + } + str.select(); + } + } + else if (typeof(element.selectionStart) != 'undefined') { + var sel_start = element.selectionStart; + var sel_end = element.selectionEnd; + MozillaInsertText(element, t1, sel_start); + MozillaInsertText(element, t2, sel_end + t1.length); + element.selectionStart = sel_start; + element.selectionEnd = sel_end + t1.length + t2.length; + element.focus(); + } + else { + element.value = element.value + t1 + t2; + } +} + +//=======color picker +function getScrollY() { var scrOfX = 0, scrOfY = 0; if (typeof (window.pageYOffset) == 'number') { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return scrOfY; } + +document.write(""); + +function getTop2() { csBrHt = 0; if (typeof (window.innerWidth) == 'number') { csBrHt = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { csBrHt = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { csBrHt = document.body.clientHeight; } ctop = ((csBrHt / 2) - 115) + getScrollY(); return ctop; } +var nocol1 = "NO COLOR", +clos1 = "X"; + +function getLeft2() { var csBrWt = 0; if (typeof (window.innerWidth) == 'number') { csBrWt = window.innerWidth; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { csBrWt = document.documentElement.clientWidth; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { csBrWt = document.body.clientWidth; } cleft = (csBrWt / 2) - 125; return cleft; } + +//function setCCbldID2(val, textBoxID) { document.getElementById(textBoxID).value = val; } +function setCCbldID2(val) { if (editorVisible) doColor(val); else AddTag('[color=' + val + ']', '[/color]'); } + +function setCCbldSty2(objID, prop, val) { + switch (prop) { + case "bc": if (objID != 'none') { document.getElementById(objID).style.backgroundColor = val; }; break; + case "vs": document.getElementById(objID).style.visibility = val; break; + case "ds": document.getElementById(objID).style.display = val; break; + case "tp": document.getElementById(objID).style.top = val; break; + case "lf": document.getElementById(objID).style.left = val; break; + } +} + +function putOBJxColor2(Samp, pigMent, textBoxId) { if (pigMent != 'x') { setCCbldID2(pigMent, textBoxId); setCCbldSty2(Samp, 'bc', pigMent); } setCCbldSty2('colorpicker201', 'vs', 'hidden'); setCCbldSty2('colorpicker201', 'ds', 'none'); } + +function showColorGrid2(Sam, textBoxId) { + var objX = new Array('00', '33', '66', '99', 'CC', 'FF'); + var c = 0; + var xl = '"' + Sam + '","x", "' + textBoxId + '"'; var mid = ''; + mid += ''; + mid += ""; + var br = 1; + for (o = 0; o < 6; o++) { + mid += ''; + for (y = 0; y < 6; y++) { + if (y == 3) { mid += ''; } + for (x = 0; x < 6; x++) { + var grid = ''; + grid = objX[o] + objX[y] + objX[x]; + var b = "'" + Sam + "','" + grid + "', '" + textBoxId + "'"; + mid += ''; + c++; + } + } + } + mid += "
      " + clos1 + "
      "; + //var ttop=getTop2(); + //setCCbldSty2('colorpicker201','tp',ttop); + //document.getElementById('colorpicker201').style.left=getLeft2(); + document.getElementById('colorpicker201').innerHTML = mid; + setCCbldSty2('colorpicker201', 'vs', 'visible'); + setCCbldSty2('colorpicker201', 'ds', 'inline'); +} \ No newline at end of file diff --git a/library/bbedit/images/.svn/all-wcprops b/library/bbedit/images/.svn/all-wcprops new file mode 100644 index 000000000..89080d8df --- /dev/null +++ b/library/bbedit/images/.svn/all-wcprops @@ -0,0 +1,53 @@ +K 25 +svn:wc:ra_dav:version-url +V 26 +/svn/!svn/ver/43795/images +END +icon_html.gif +K 25 +svn:wc:ra_dav:version-url +V 40 +/svn/!svn/ver/43795/images/icon_html.gif +END +img.gif +K 25 +svn:wc:ra_dav:version-url +V 34 +/svn/!svn/ver/43795/images/img.gif +END +colors.gif +K 25 +svn:wc:ra_dav:version-url +V 37 +/svn/!svn/ver/43795/images/colors.gif +END +editbar_bg.gif +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/43795/images/editbar_bg.gif +END +url.gif +K 25 +svn:wc:ra_dav:version-url +V 34 +/svn/!svn/ver/43795/images/url.gif +END +icon_list.gif +K 25 +svn:wc:ra_dav:version-url +V 40 +/svn/!svn/ver/43795/images/icon_list.gif +END +icon_quote.png +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/43795/images/icon_quote.png +END +icon_youtube.gif +K 25 +svn:wc:ra_dav:version-url +V 43 +/svn/!svn/ver/43795/images/icon_youtube.gif +END diff --git a/library/bbedit/images/.svn/entries b/library/bbedit/images/.svn/entries new file mode 100644 index 000000000..24594acfb --- /dev/null +++ b/library/bbedit/images/.svn/entries @@ -0,0 +1,300 @@ +10 + +dir +43979 +https://wysiwygbbcode.svn.codeplex.com/svn/images +https://wysiwygbbcode.svn.codeplex.com/svn + + + +2010-04-07T14:06:43.507000Z +43795 +unknown + + + + + + + + + + + + + + +1e68c9db-d3bb-46d7-945c-fd054d4afafc + +icon_html.gif +file + + + + +2010-04-07T14:11:18.000000Z +67fe598a2ce41218bbe984ecb9ef5120 +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +178 + +img.gif +file + + + + +2010-04-07T14:11:18.000000Z +9f86ef7d2cb43dc9211bc4527a4caa4a +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +570 + +colors.gif +file + + + + +2010-04-07T14:11:18.000000Z +2b1af4a86dc3c0c38066fed59a6b9284 +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +1024 + +editbar_bg.gif +file + + + + +2010-04-07T14:11:18.000000Z +ab683894bf1f523a2c9e3888b88ff6fe +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +301 + +url.gif +file + + + + +2010-04-07T14:11:18.000000Z +80486c8b54c622eff5fbde9cbe941c36 +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +209 + +icon_list.gif +file + + + + +2010-04-07T14:11:18.000000Z +33b13631551a0890584ccc2f9d9187d2 +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +82 + +icon_quote.png +file + + + + +2010-04-07T14:11:18.000000Z +c1980342644a5392efefbb315b12b246 +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +1239 + +icon_youtube.gif +file + + + + +2010-04-07T14:11:18.000000Z +406fca567bc8bd5655ae0d2cbb6c061c +2010-04-07T14:06:43.507000Z +43795 +unknown +has-props + + + + + + + + + + + + + + + + + + + + +613 + diff --git a/library/bbedit/images/.svn/prop-base/colors.gif.svn-base b/library/bbedit/images/.svn/prop-base/colors.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/colors.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/editbar_bg.gif.svn-base b/library/bbedit/images/.svn/prop-base/editbar_bg.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/editbar_bg.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/icon_html.gif.svn-base b/library/bbedit/images/.svn/prop-base/icon_html.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/icon_html.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/icon_list.gif.svn-base b/library/bbedit/images/.svn/prop-base/icon_list.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/icon_list.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/icon_quote.png.svn-base b/library/bbedit/images/.svn/prop-base/icon_quote.png.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/icon_quote.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/icon_youtube.gif.svn-base b/library/bbedit/images/.svn/prop-base/icon_youtube.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/icon_youtube.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/img.gif.svn-base b/library/bbedit/images/.svn/prop-base/img.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/img.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/prop-base/url.gif.svn-base b/library/bbedit/images/.svn/prop-base/url.gif.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/library/bbedit/images/.svn/prop-base/url.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/library/bbedit/images/.svn/text-base/colors.gif.svn-base b/library/bbedit/images/.svn/text-base/colors.gif.svn-base new file mode 100644 index 000000000..b3ffe8a27 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/colors.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/editbar_bg.gif.svn-base b/library/bbedit/images/.svn/text-base/editbar_bg.gif.svn-base new file mode 100644 index 000000000..023a43cec Binary files /dev/null and b/library/bbedit/images/.svn/text-base/editbar_bg.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/icon_html.gif.svn-base b/library/bbedit/images/.svn/text-base/icon_html.gif.svn-base new file mode 100644 index 000000000..66c75fef8 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/icon_html.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/icon_list.gif.svn-base b/library/bbedit/images/.svn/text-base/icon_list.gif.svn-base new file mode 100644 index 000000000..e60f472c0 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/icon_list.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/icon_quote.png.svn-base b/library/bbedit/images/.svn/text-base/icon_quote.png.svn-base new file mode 100644 index 000000000..eae8a9ae9 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/icon_quote.png.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/icon_youtube.gif.svn-base b/library/bbedit/images/.svn/text-base/icon_youtube.gif.svn-base new file mode 100644 index 000000000..d15af5126 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/icon_youtube.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/img.gif.svn-base b/library/bbedit/images/.svn/text-base/img.gif.svn-base new file mode 100644 index 000000000..6e6fc24c5 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/img.gif.svn-base differ diff --git a/library/bbedit/images/.svn/text-base/url.gif.svn-base b/library/bbedit/images/.svn/text-base/url.gif.svn-base new file mode 100644 index 000000000..2833e4ba3 Binary files /dev/null and b/library/bbedit/images/.svn/text-base/url.gif.svn-base differ diff --git a/library/bbedit/images/colors.gif b/library/bbedit/images/colors.gif new file mode 100644 index 000000000..b3ffe8a27 Binary files /dev/null and b/library/bbedit/images/colors.gif differ diff --git a/library/bbedit/images/editbar_bg.gif b/library/bbedit/images/editbar_bg.gif new file mode 100644 index 000000000..023a43cec Binary files /dev/null and b/library/bbedit/images/editbar_bg.gif differ diff --git a/library/bbedit/images/icon_html.gif b/library/bbedit/images/icon_html.gif new file mode 100644 index 000000000..66c75fef8 Binary files /dev/null and b/library/bbedit/images/icon_html.gif differ diff --git a/library/bbedit/images/icon_list.gif b/library/bbedit/images/icon_list.gif new file mode 100644 index 000000000..e60f472c0 Binary files /dev/null and b/library/bbedit/images/icon_list.gif differ diff --git a/library/bbedit/images/icon_quote.png b/library/bbedit/images/icon_quote.png new file mode 100644 index 000000000..eae8a9ae9 Binary files /dev/null and b/library/bbedit/images/icon_quote.png differ diff --git a/library/bbedit/images/icon_youtube.gif b/library/bbedit/images/icon_youtube.gif new file mode 100644 index 000000000..d15af5126 Binary files /dev/null and b/library/bbedit/images/icon_youtube.gif differ diff --git a/library/bbedit/images/img.gif b/library/bbedit/images/img.gif new file mode 100644 index 000000000..6e6fc24c5 Binary files /dev/null and b/library/bbedit/images/img.gif differ diff --git a/library/bbedit/images/url.gif b/library/bbedit/images/url.gif new file mode 100644 index 000000000..2833e4ba3 Binary files /dev/null and b/library/bbedit/images/url.gif differ diff --git a/library/bbedit/readme.txt b/library/bbedit/readme.txt new file mode 100644 index 000000000..505e2ba67 --- /dev/null +++ b/library/bbedit/readme.txt @@ -0,0 +1,28 @@ +/* +WYSIWYG-BBCODE v1.6 +WYSIWYG-BBCODE editor +Copyright (c) 2009, Jitbit Sotware, http://www.jitbit.com/ +PROJECT HOME: http://wysiwygbbcode.codeplex.com/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY Jitbit Software ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL Jitbit Software BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/library/bbedit/sample.htm b/library/bbedit/sample.htm new file mode 100644 index 000000000..573687330 --- /dev/null +++ b/library/bbedit/sample.htm @@ -0,0 +1,37 @@ + + + + + + + +
      + + +
      +
      + + + + + + + + + + +
      +
      + +
      +
      + + + + + +
      + + \ No newline at end of file -- cgit v1.2.3