Import xinha so we can switch from htmlarea and fix a bunch of in-browser issues that htmlarea has
This commit is contained in:
BIN
xinha/plugins/QuickTag/img/ed_quicktag.gif
Normal file
BIN
xinha/plugins/QuickTag/img/ed_quicktag.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 B |
16
xinha/plugins/QuickTag/lang/de.js
Normal file
16
xinha/plugins/QuickTag/lang/de.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// I18N constants
|
||||
// LANG: "de", ENCODING: UTF-8
|
||||
{
|
||||
"Quick Tag Editor": "Quick TAG Editor",
|
||||
"Enter the TAG you want to insert": "Enter the TAG you want to insert",
|
||||
"You have to select some text": "You have to select some text",
|
||||
"There are some unclosed quote": "There are some unclosed quote",
|
||||
"This attribute already exists in the TAG": "This attribute already exists in the TAG",
|
||||
"No CSS class avaiable": "No CSS classes avaiable",
|
||||
"OPTIONS": "OPTIONS",
|
||||
"ATTRIBUTES": "ATTRIBUTES",
|
||||
"TAGs": "TAGs",
|
||||
"Colors": "Colors",
|
||||
"Ok": "Ok",
|
||||
"Cancel": "Cancel"
|
||||
};
|
||||
18
xinha/plugins/QuickTag/lang/no.js
Normal file
18
xinha/plugins/QuickTag/lang/no.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// I18N constants
|
||||
// LANG: "no", ENCODING: UTF-8
|
||||
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
|
||||
|
||||
{
|
||||
"Quick Tag Editor": "Kjapp TAGG Editor",
|
||||
"Enter the TAG you want to insert": "Skriv inn taggen du vil ønsker å sette inn",
|
||||
"You have to select some text": "Du må velge noe tekst",
|
||||
"There are some unclosed quote": "Det mangler et hermetegn",
|
||||
"This attribute already exists in the TAG": "Denne attributten eksieterer allerede i taggen",
|
||||
"No CSS class avaiable": "Ingen CSS klasse tilgjengelig",
|
||||
"OPTIONS": "EGENSKAPER",
|
||||
"ATTRIBUTES": "ATTRIBUTTER",
|
||||
"TAGs": "TAGGer",
|
||||
"Colors": "Farger",
|
||||
"Ok": "Ok",
|
||||
"Cancel": "Avbryt"
|
||||
};
|
||||
16
xinha/plugins/QuickTag/lang/pt_br.js
Normal file
16
xinha/plugins/QuickTag/lang/pt_br.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// I18N constants
|
||||
// LANG: "pt_br", ENCODING: UTF-8
|
||||
{
|
||||
"Quick Tag Editor": "Editor Rápido",
|
||||
"Enter the TAG you want to insert": "Edite a TAG que deseja inserir",
|
||||
"You have to select some text": "É preciso selecionar algum texto",
|
||||
"No CSS class avaiable": "Não há classes CSS",
|
||||
"There are some unclosed quote...": "Há uma ou mais aspas sem fechamento",
|
||||
"This attribute already exists in the TAG": "Esse atributo já existe na TAG",
|
||||
"OPTIONS": "OPÇÕES",
|
||||
"ATTRIBUTES": "ATRIBUTOS",
|
||||
"TAGs": "TAGs",
|
||||
"Colors": "Cores",
|
||||
"Ok": "Ok",
|
||||
"Cancel": "Cancelar"
|
||||
};
|
||||
356
xinha/plugins/QuickTag/popups/quicktag.html
Normal file
356
xinha/plugins/QuickTag/popups/quicktag.html
Normal file
@@ -0,0 +1,356 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Quick Tag Editor</title>
|
||||
<script type="text/javascript" src="../tag-lib.js"></script>
|
||||
<script type="text/javascript" src="../../../popups/popup.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
window.resizeTo(400, 180);
|
||||
var QuickTag = window.opener.QuickTag;
|
||||
var curTag = 'none';
|
||||
var curTagOpt = false;
|
||||
var CSSEdit = false;
|
||||
var editor = null;
|
||||
|
||||
function Init() {
|
||||
__dlg_translate("QuickTag");
|
||||
__dlg_init();
|
||||
|
||||
var param = window.dialogArguments;
|
||||
editor = param['editor'];
|
||||
var selectext = param['selectedText']; // sem uso...
|
||||
|
||||
if(!document.all) window.resizeTo(400, 180); // i don't undertand why...
|
||||
|
||||
createDropdown("tags");
|
||||
|
||||
var to = document.getElementById('tagopen');
|
||||
if (document.all)
|
||||
to.attachEvent("onkeypress", function(e) { choice_dropdown(e) });
|
||||
else
|
||||
to.addEventListener("keypress", function(e) { choice_dropdown(e) }, true);
|
||||
to.focus();
|
||||
|
||||
document.getElementById('bt_colors').style.display = 'none';
|
||||
document.body.onkeypress = __dlg_key_press;
|
||||
};
|
||||
|
||||
function onCancel() {
|
||||
__dlg_close(null);
|
||||
return false;
|
||||
};
|
||||
|
||||
function quoteTest(val) {
|
||||
var er = /^\w+\s*(\w+=\"[^\"]*\"\s*|\w+=\'[^\']*\'\s*)*$/;
|
||||
return er.test(val);
|
||||
};
|
||||
|
||||
function onOK() {
|
||||
var el = document.getElementById('tagopen');
|
||||
if(!el.value) {
|
||||
alert(HTMLArea._lc("Enter the TAG you want to insert", "QuickTag"));
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
if(!quoteTest(el.value)) {
|
||||
alert(HTMLArea._lc("There are some unclosed quote", "QuickTag"));
|
||||
el.focus();
|
||||
el.select();
|
||||
return false;
|
||||
}
|
||||
var param = {};
|
||||
var cleanTO = document.getElementById('tagopen').value.replace(/(<|>)/g,"");
|
||||
param.tagopen = "<"+cleanTO+">";
|
||||
param.tagclose = param.tagopen.replace(/^<(\w+) ?.*>/,"</$1>");
|
||||
|
||||
var subtag = subTagLib[curTag];
|
||||
if(typeof subtag == 'object') {
|
||||
param.tagopen = param.tagopen+subtag.op;
|
||||
param.tagclose = subtag.cl+param.tagclose;
|
||||
}
|
||||
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
};
|
||||
|
||||
function __dlg_key_press(ev) {
|
||||
ev || (ev = window.event);
|
||||
switch(ev.keyCode) {
|
||||
case 13:
|
||||
document.getElementById('bt_ok').click();
|
||||
break;
|
||||
case 27:
|
||||
__dlg_close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
function selchange() {
|
||||
var toadd = document.getElementById('selectag').value;
|
||||
var oldval = document.getElementById('tagopen').value;
|
||||
var text = (oldval+toadd).replace(/^\s*(.+)\s*$/,"$1");
|
||||
var atrib = /(\w+)=\"$/.test(toadd) ? toadd.replace(/(\w+)=\"$/, "$1") : null;
|
||||
var showcolors = (/color\: ?$/.test(toadd)) ? true : false;
|
||||
var noCSSclasses = false;
|
||||
var obj = null;
|
||||
curTag = text.replace(/(^\w+) ?.*$/, "$1");
|
||||
curTagOpt = (tagLib[curTag] == true);
|
||||
|
||||
if(atrib) {
|
||||
var atrer = eval('/'+atrib+'=/ig');
|
||||
if(atrer.test(oldval) && !(/[^=]\"$/.test(toadd))) {
|
||||
alert(HTMLArea._lc("This attribute already exists in the TAG", "QuickTag"));
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(atrib) {
|
||||
case 'style':
|
||||
CSSEdit = true;
|
||||
break;
|
||||
case 'class':
|
||||
if(captureClasses() == 0) noCSSclasses = true;
|
||||
break;
|
||||
case 'color': case 'bgcolor': case 'bordercolor':
|
||||
case 'bordercolorlight': case 'bordercolordark':
|
||||
showcolors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(curTagOpt == true)
|
||||
obj = eval('opAtt_'+curTag+'["'+atrib+'"]');
|
||||
else
|
||||
obj = opAtt_all[atrib];
|
||||
}
|
||||
else if(!CSSEdit && (/(^\w+$|\"$)/.test(toadd))) {
|
||||
obj = 'all';
|
||||
if(curTagOpt == true) obj = curTag;
|
||||
toadd += ' ';
|
||||
}
|
||||
|
||||
if(CSSEdit && quoteTest(text))
|
||||
CSSEdit = false;
|
||||
|
||||
if(showcolors)
|
||||
document.getElementById('bt_colors').style.display = '';
|
||||
|
||||
if(obj)
|
||||
createDropdown(obj);
|
||||
else if(!CSSEdit)
|
||||
document.getElementById('showselect').style.visibility = 'hidden';
|
||||
|
||||
if(noCSSclasses) {
|
||||
document.getElementById('showselect').innerHTML = HTMLArea._lc("No CSS class avaiable", "QuickTag");
|
||||
document.getElementById('showselect').style.visibility = 'visible';
|
||||
}
|
||||
|
||||
addchanges();
|
||||
|
||||
function addchanges() {
|
||||
document.getElementById('tagopen').focus();
|
||||
document.getElementById('tagopen').value += toadd;
|
||||
};
|
||||
};
|
||||
|
||||
function captureClasses() {
|
||||
var cont = 0;
|
||||
// If there is no '<HTML>' in the HTMLArea content, when using
|
||||
// styleSheets[..].rule, IE generates an error.
|
||||
// In this case, we lost the classes in external CSS files.
|
||||
// If FullPage is loaded, there is no problem.
|
||||
if(!(/<\s*html\s*>/i.test(editor.getHTML())) && document.all) {
|
||||
var styles = editor._doc.getElementsByTagName("style");
|
||||
for(var i in styles) {
|
||||
var cont = styles[i].innerHTML;
|
||||
if(typeof cont != 'undefined') {
|
||||
var cls = cont.match(/\.\w+/ig,"");
|
||||
for(j in cls) if(/^\.\w+$/.test(cls[j])) {
|
||||
var classname = cls[j].replace(/\./,"")+'"';
|
||||
opAtt_all['class'][cls[j]] = classname;
|
||||
cont++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cont;
|
||||
}
|
||||
|
||||
var styleSheet = null;
|
||||
var styles = editor._doc.styleSheets;
|
||||
|
||||
for (var i = 0; i < styles.length; i++) {
|
||||
styleSheet = styles[i];
|
||||
if(document.all)
|
||||
var _rules = styleSheet.rules;
|
||||
else
|
||||
var _rules = styleSheet.cssRules;
|
||||
for (var j = 0; j < _rules.length; j++) {
|
||||
rule = _rules[j];
|
||||
if(/^\.\w+$/.test(rule.selectorText)) {
|
||||
var classname = rule.selectorText.replace(/\./,"")+'"';
|
||||
opAtt_all['class'][rule.selectorText] = classname;
|
||||
cont++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cont;
|
||||
};
|
||||
|
||||
function choice_dropdown(e) {
|
||||
if (document.all) Key = e.keyCode;
|
||||
else Key = e.charCode;
|
||||
|
||||
if(Key != 32) return;
|
||||
|
||||
var text = document.getElementById('tagopen').value.replace(/^\s*([^\s]+)\s*$/,"$1");
|
||||
|
||||
if(CSSEdit && quoteTest(text)) CSSEdit = false;
|
||||
if(CSSEdit) return;
|
||||
|
||||
if(curTag == 'none') {
|
||||
curTag = text.replace(/(^\w+) ?.*$/, "$1");
|
||||
curTagOpt = tagLib[curTag];
|
||||
}
|
||||
|
||||
if(!/\w/.test(text)) {
|
||||
document.getElementById('tagopen').value = '';
|
||||
createDropdown("tags");
|
||||
return;
|
||||
}
|
||||
|
||||
var att = 'all';
|
||||
if(curTagOpt == true)
|
||||
att = curTag;
|
||||
|
||||
createDropdown(att);
|
||||
};
|
||||
|
||||
function createDropdown(type) {
|
||||
var _div = document.getElementById('showselect');
|
||||
while(_div.hasChildNodes())
|
||||
_div.removeChild(_div.firstChild);
|
||||
_div.style.visibility = 'visible';
|
||||
|
||||
var _sel = document.createElement("select");
|
||||
_sel.id = "selectag";
|
||||
_sel.onchange = function() { selchange(); };
|
||||
|
||||
if(typeof type == 'object') {
|
||||
var obj = type;
|
||||
forObj(HTMLArea._lc("OPTIONS", "QuickTag"));
|
||||
_div.appendChild(_sel);
|
||||
return;
|
||||
}
|
||||
|
||||
if(type == 'tags') {
|
||||
var obj = allTags;
|
||||
forObj(HTMLArea._lc("TAGs", "QuickTag"));
|
||||
_div.appendChild(_sel);
|
||||
return;
|
||||
}
|
||||
|
||||
type = type.replace(/^h[1-6]$/,"h");
|
||||
var topt = eval('opTag_'+type);
|
||||
if(typeof topt == 'object')
|
||||
var obj = topt;
|
||||
else
|
||||
return;
|
||||
|
||||
forObj(HTMLArea._lc("ATTRIBUTES", "QuickTag"));
|
||||
_div.appendChild(_sel);
|
||||
|
||||
function forObj(first) {
|
||||
if(first) {
|
||||
var _op = document.createElement("option");
|
||||
_op.appendChild(document.createTextNode(first));
|
||||
_sel.appendChild(_op);
|
||||
}
|
||||
for(i in obj) {
|
||||
var opt = document.createElement("option");
|
||||
opt.appendChild(document.createTextNode(i));
|
||||
opt.value = obj[i];
|
||||
_sel.appendChild(opt);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function colors() {
|
||||
var colloc = window.location.toString().replace(/plugins.+$/,"") +
|
||||
"popups/select_color.html";
|
||||
window.open(colloc, 'colors', "toolbar=no,location=no,directories=no," +
|
||||
"status=no,menubar=no,scrollbars=no,resizable=no,width=240,height=182");
|
||||
};
|
||||
|
||||
// simulation of Dialog._return - select_color.html needs it.
|
||||
var Dialog = new Object();
|
||||
Dialog._return = function (val) {
|
||||
if(val != null) {
|
||||
if(CSSEdit)
|
||||
val += '; ';
|
||||
else
|
||||
val += '"';
|
||||
document.getElementById('tagopen').focus();
|
||||
document.getElementById('tagopen').value += "#"+val;
|
||||
document.getElementById('bt_colors').style.display = 'none';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
background: ButtonFace;
|
||||
color: ButtonText;
|
||||
font: 11px Tahoma,Verdana,sans-serif;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border-width: 0px;
|
||||
}
|
||||
body { padding: 5px; }
|
||||
table { font: 11px Tahoma,Verdana,sans-serif; }
|
||||
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
|
||||
button { width: 70px; }
|
||||
.space { padding: 2px; }
|
||||
.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 {
|
||||
border-top: 1px solid #999;
|
||||
padding: 5px;
|
||||
text-align: right;
|
||||
height: 20px;
|
||||
}
|
||||
form { padding: 0px; margin: 0px; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="dialog" onload="Init()">
|
||||
<form action="" method="get">
|
||||
<div class="title" style="width: 360px">Quick Tag Editor</div>
|
||||
<div align="center">
|
||||
<table border="0" width="370">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2" align="center" style="padding: 3px; background-color: #e9e9e9;">
|
||||
<strong style="font-size: 14px"><</strong>
|
||||
<input id="tagopen" type="text" style="background-color: #e9e9e9; width: 327px; border-width: 0px;">
|
||||
<strong style="font-size: 14px">></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="space"></div>
|
||||
<div class="buttons">
|
||||
<button type="button" id="bt_colors" onclick="colors();">Colors</button>
|
||||
<button type="button" id="bt_ok" onclick="return onOK();">Ok</button>
|
||||
<button type="button" onclick="return onCancel();">Cancel</button>
|
||||
</div>
|
||||
<div id="showselect" style="position:absolute; left:7px; top:75px; width:150px; z-index:100; visibility: visible; height: 13px; color: red;">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
53
xinha/plugins/QuickTag/quick-tag.js
Normal file
53
xinha/plugins/QuickTag/quick-tag.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------*\
|
||||
Quick Tag Editor Plugin for HTMLArea-3.0
|
||||
-----------------------------------------
|
||||
author: Cau guanabara
|
||||
e-mail: caugb@ibest.com.br
|
||||
\*---------------------------------------*/
|
||||
|
||||
function QuickTag(editor) {
|
||||
var cfg = editor.config;
|
||||
var self = this;
|
||||
|
||||
cfg.registerButton({
|
||||
id : "quickeditor",
|
||||
tooltip : this._lc("Quick Tag Editor"),
|
||||
image : editor.imgURL("ed_quicktag.gif", "QuickTag"),
|
||||
textMode : false,
|
||||
action : function(editor) {
|
||||
self.buttonPress(editor);
|
||||
}
|
||||
});
|
||||
cfg.addToolbarElement("quickeditor", "htmlmode", 1);
|
||||
};
|
||||
|
||||
QuickTag.prototype.buttonPress = function(editor) {
|
||||
var self = this;
|
||||
var sel = editor.getSelectedHTML().replace(/(<[^>]*>| |\n|\r)/g,"");
|
||||
var param = new Object();
|
||||
param.editor = editor;
|
||||
|
||||
if(/\w/.test(sel))
|
||||
editor._popupDialog("plugin://QuickTag/quicktag", function(p) { self.setTag(editor, p); }, param);
|
||||
else
|
||||
alert(this._lc('You have to select some text'));
|
||||
};
|
||||
|
||||
QuickTag.prototype.setTag = function(editor, param) {
|
||||
editor.surroundHTML(param.tagopen,param.tagclose);
|
||||
};
|
||||
|
||||
QuickTag._pluginInfo = {
|
||||
name : "QuickTag",
|
||||
version : "1.0 - beta",
|
||||
developer : "Cau Guanabara",
|
||||
developer_url : "mailto:caugb@ibest.com.br",
|
||||
c_owner : "Cau Guanabara",
|
||||
sponsor : "Independent production",
|
||||
sponsor_url : "http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html",
|
||||
license : "htmlArea"
|
||||
};
|
||||
|
||||
QuickTag.prototype._lc = function(string) {
|
||||
return HTMLArea._lc(string, 'QuickTag');
|
||||
}
|
||||
356
xinha/plugins/QuickTag/tag-lib.js
Normal file
356
xinha/plugins/QuickTag/tag-lib.js
Normal file
@@ -0,0 +1,356 @@
|
||||
/*
|
||||
TAG Library for QuickTag Plugin
|
||||
-------------------------------
|
||||
|
||||
allTags = All tags that appears in the first dropdown ('TAGS') {'caption': 'value'}
|
||||
tagLib = The tags with options (just to check if current TAG have options) {'[TAG]': true}
|
||||
subTagLib = Complements for some tags that needs it (TABLE)
|
||||
{'[TAG]': {'op': 'after tag open', 'cl': 'before tag close'}}
|
||||
opTag_all = Common attributes to all TAGS {'caption': 'value'}
|
||||
opAtt_all = Options for the common attributes {'attribute': {'caption': 'value'}}
|
||||
opTag_[TAG] = Attributes for [TAG] {'caption': 'value'}
|
||||
opAtt_[TAG] = Options for the [TAG] attributes {'attribute': {'caption': 'value'}}
|
||||
|
||||
*/
|
||||
|
||||
var allTags = {
|
||||
'a': 'a',
|
||||
'a (full)': 'a href="" target=""',
|
||||
'address': 'address',
|
||||
'b': 'b',
|
||||
'big': 'big',
|
||||
'blockquote': 'blockquote',
|
||||
'code': 'code',
|
||||
'div': 'div',
|
||||
'em': 'em',
|
||||
'fieldset': 'fieldset',
|
||||
'font': 'font',
|
||||
'font (full)': 'font face="" size="" color=""',
|
||||
'h1': 'h1',
|
||||
'h2': 'h2',
|
||||
'h3': 'h3',
|
||||
'h4': 'h4',
|
||||
'h5': 'h5',
|
||||
'h6': 'h6',
|
||||
'i': 'i',
|
||||
'legend': 'legend',
|
||||
'li': 'li',
|
||||
'ol': 'ol',
|
||||
'ul': 'ul',
|
||||
'p': 'p',
|
||||
'pre': 'pre',
|
||||
'small': 'small',
|
||||
'span': 'span',
|
||||
'strong': 'strong',
|
||||
'sub': 'sub',
|
||||
'sup': 'sup',
|
||||
'table': 'table'
|
||||
};
|
||||
|
||||
// tags with options
|
||||
var tagLib = {
|
||||
'a': true,
|
||||
'div': true,
|
||||
'font': true,
|
||||
'h1': true,
|
||||
'h2': true,
|
||||
'h3': true,
|
||||
'h4': true,
|
||||
'h5': true,
|
||||
'h6': true,
|
||||
'p': true,
|
||||
'table': true
|
||||
};
|
||||
// tags that needs some complement
|
||||
var subTagLib = {'table': {'op': '<tbody><tr><td>',
|
||||
'cl': '</td></tr></tbody>'}
|
||||
};
|
||||
|
||||
var opTag_a = {
|
||||
'href': 'href="',
|
||||
'name': 'name="',
|
||||
'target': 'target="'
|
||||
};
|
||||
var opAtt_a = {
|
||||
'href': {'http://': 'http://',
|
||||
'https://': 'https://',
|
||||
'ftp://': 'ftp://',
|
||||
'mailto:': 'mailto:',
|
||||
'#': '#"'},
|
||||
'target': {'_top': '_top"',
|
||||
'_self': '_self"',
|
||||
'_parent': '_parent"',
|
||||
'_blank': '_blank"'}
|
||||
};
|
||||
|
||||
var opTag_font = {
|
||||
'face': 'face="',
|
||||
'size': 'size="',
|
||||
'color': 'color="'
|
||||
};
|
||||
var opAtt_font = {
|
||||
'face': {'Verdana': 'Verdana"',
|
||||
'Arial': 'Arial"',
|
||||
'Tahoma': 'Tahoma"',
|
||||
'Courier New': 'Courier New"',
|
||||
'Times New Roman': 'Times New Roman"'},
|
||||
'size': {'1': '1"','2': '2"','3': '3"','4': '4"','5': '5"','6': '6"',
|
||||
'+1': '+1"','+2': '+2"','+3': '+3"','+4': '+4"','+5': '+5"','+6': '+6"',
|
||||
'-1': '-1"','-2': '-2"','-3': '-3"','-4': '-4"','-5': '-5"','-6': '-6"'}
|
||||
};
|
||||
|
||||
var opTag_div = {
|
||||
'align': 'align="'
|
||||
};
|
||||
var opAtt_div = {
|
||||
'align': {'center': 'center"',
|
||||
'left': 'left"',
|
||||
'right': 'right"',
|
||||
'justify': 'justify"'}
|
||||
};
|
||||
|
||||
var opTag_h = {
|
||||
'align': 'align="'
|
||||
};
|
||||
var opAtt_h = {
|
||||
'align': {'center': 'center"',
|
||||
'left': 'left"',
|
||||
'right': 'right"',
|
||||
'justify': 'justify"'}
|
||||
};
|
||||
|
||||
var opTag_p = {
|
||||
'align': 'align="'
|
||||
};
|
||||
var opAtt_p = {
|
||||
'align': {'center': 'center"',
|
||||
'left': 'left"',
|
||||
'right': 'right"',
|
||||
'justify': 'justify"'}
|
||||
};
|
||||
|
||||
var opTag_table = {
|
||||
'align': 'align="',
|
||||
'width': 'width="',
|
||||
'height': 'height="',
|
||||
'cellpadding': 'cellpadding="',
|
||||
'cellspacing': 'cellspacing="',
|
||||
'background': 'background="',
|
||||
'bgcolor': 'bgcolor="',
|
||||
'border': 'border="',
|
||||
'bordercolor': 'bordercolor="',
|
||||
'bordercolorlight': 'bordercolorlight="',
|
||||
'bordercolordark': 'bordercolordark="'
|
||||
};
|
||||
var opAtt_table = {
|
||||
'align': {'center': 'center"',
|
||||
'left': 'left"',
|
||||
'right': 'right"'}
|
||||
};
|
||||
|
||||
// for all tags
|
||||
var opTag_all = {
|
||||
'class': 'class="',
|
||||
'dir': 'dir="',
|
||||
'id': 'id="',
|
||||
'lang': 'lang="',
|
||||
'onFocus': 'onFocus="',
|
||||
'onBlur': 'onBlur="',
|
||||
'onClick': 'onClick="',
|
||||
'onDblClick': 'onDblClick="',
|
||||
'onMouseDown': 'onMouseDown="',
|
||||
'onMouseUp': 'onMouseUp="',
|
||||
'onMouseOver': 'onMouseOver="',
|
||||
'onMouseMove': 'onMouseMove="',
|
||||
'onMouseOut': 'onMouseOut="',
|
||||
'onKeyPress': 'onKeyPress="',
|
||||
'onKeyDown': 'onKeyDown="',
|
||||
'onKeyUp': 'onKeyUp="',
|
||||
'style': 'style="',
|
||||
'title': 'title="'
|
||||
};
|
||||
var opAtt_all = {
|
||||
'class': {},
|
||||
'dir': {'rtl': 'rtl"','ltr': 'ltr"'},
|
||||
'lang': {'Afrikaans ': 'af"',
|
||||
'Albanian ': 'sq"',
|
||||
'Arabic ': 'ar"',
|
||||
'Basque ': 'eu"',
|
||||
'Breton ': 'br"',
|
||||
'Bulgarian ': 'bg"',
|
||||
'Belarusian ': 'be"',
|
||||
'Catalan ': 'ca"',
|
||||
'Chinese ': 'zh"',
|
||||
'Croatian ': 'hr"',
|
||||
'Czech ': 'cs"',
|
||||
'Danish ': 'da"',
|
||||
'Dutch ': 'nl"',
|
||||
'English ': 'en"',
|
||||
'Estonian ': 'et"',
|
||||
'Faeroese ': 'fo"',
|
||||
'Farsi ': 'fa"',
|
||||
'Finnish ': 'fi"',
|
||||
'French ': 'fr"',
|
||||
'Gaelic ': 'gd"',
|
||||
'German ': 'de"',
|
||||
'Greek ': 'el"',
|
||||
'Hebrew ': 'he"',
|
||||
'Hindi ': 'hi"',
|
||||
'Hungarian ': 'hu"',
|
||||
'Icelandic ': 'is"',
|
||||
'Indonesian ': 'id"',
|
||||
'Italian ': 'it"',
|
||||
'Japanese ': 'ja"',
|
||||
'Korean ': 'ko"',
|
||||
'Latvian ': 'lv"',
|
||||
'Lithuanian ': 'lt"',
|
||||
'Macedonian ': 'mk"',
|
||||
'Malaysian ': 'ms"',
|
||||
'Maltese ': 'mt"',
|
||||
'Norwegian ': 'no"',
|
||||
'Polish ': 'pl"',
|
||||
'Portuguese ': 'pt"',
|
||||
'Rhaeto-Romanic ': 'rm"',
|
||||
'Romanian ': 'ro"',
|
||||
'Russian ': 'ru"',
|
||||
'Sami ': 'sz"',
|
||||
'Serbian ': 'sr"',
|
||||
'Setswana ': 'tn"',
|
||||
'Slovak ': 'sk"',
|
||||
'Slovenian ': 'sl"',
|
||||
'Spanish ': 'es"',
|
||||
'Sutu ': 'sx"',
|
||||
'Swedish ': 'sv"',
|
||||
'Thai ': 'th"',
|
||||
'Tsonga ': 'ts"',
|
||||
'Turkish ': 'tr"',
|
||||
'Ukrainian ': 'uk"',
|
||||
'Urdu ': 'ur"',
|
||||
'Vietnamese ': 'vi"',
|
||||
'Xhosa ': 'xh"',
|
||||
'Yiddish ': 'yi"',
|
||||
'Zulu': 'zu"'},
|
||||
'style': {'azimuth': 'azimuth: ',
|
||||
'background': 'background: ',
|
||||
'background-attachment': 'background-attachment: ',
|
||||
'background-color': 'background-color: ',
|
||||
'background-image': 'background-image: ',
|
||||
'background-position': 'background-position: ',
|
||||
'background-repeat': 'background-repeat: ',
|
||||
'border': 'border: ',
|
||||
'border-bottom': 'border-bottom: ',
|
||||
'border-left': 'border-left: ',
|
||||
'border-right': 'border-right: ',
|
||||
'border-top': 'border-top: ',
|
||||
'border-bottom-color': 'border-bottom-color: ',
|
||||
'border-left-color': 'border-left-color: ',
|
||||
'border-right-color': 'border-right-color: ',
|
||||
'border-top-color': 'border-top-color: ',
|
||||
'border-bottom-style': 'border-bottom-style: ',
|
||||
'border-left-style': 'border-left-style: ',
|
||||
'border-right-style': 'border-right-style: ',
|
||||
'border-top-style': 'border-top-style: ',
|
||||
'border-bottom-width': 'border-bottom-width: ',
|
||||
'border-left-width': 'border-left-width: ',
|
||||
'border-right-width': 'border-right-width: ',
|
||||
'border-top-width': 'border-top-width: ',
|
||||
'border-collapse': 'border-collapse: ',
|
||||
'border-color': 'border-color: ',
|
||||
'border-style': 'border-style: ',
|
||||
'border-width': 'border-width: ',
|
||||
'bottom': 'bottom: ',
|
||||
'caption-side': 'caption-side: ',
|
||||
'cell-spacing': 'cell-spacing: ',
|
||||
'clear': 'clear: ',
|
||||
'clip': 'clip: ',
|
||||
'color': 'color: ',
|
||||
'column-span': 'column-span: ',
|
||||
'content': 'content: ',
|
||||
'cue': 'cue: ',
|
||||
'cue-after': 'cue-after: ',
|
||||
'cue-before': 'cue-before: ',
|
||||
'cursor': 'cursor: ',
|
||||
'direction': 'direction: ',
|
||||
'display': 'display: ',
|
||||
'elevation': 'elevation: ',
|
||||
'filter': 'filter: ',
|
||||
'float': 'float: ',
|
||||
'font-family': 'font-family: ',
|
||||
'font-size': 'font-size: ',
|
||||
'font-size-adjust': 'font-size-adjust: ',
|
||||
'font-style': 'font-style: ',
|
||||
'font-variant': 'font-variant: ',
|
||||
'font-weight': 'font-weight: ',
|
||||
'height': 'height: ',
|
||||
'!important': '!important: ',
|
||||
'left': 'left: ',
|
||||
'letter-spacing': 'letter-spacing: ',
|
||||
'line-height': 'line-height: ',
|
||||
'list-style': 'list-style: ',
|
||||
'list-style-image': 'list-style-image: ',
|
||||
'list-style-position': 'list-style-position: ',
|
||||
'list-style-type': 'list-style-type: ',
|
||||
'margin': 'margin: ',
|
||||
'margin-bottom': 'margin-bottom: ',
|
||||
'margin-left': 'margin-left: ',
|
||||
'margin-right': 'margin-right: ',
|
||||
'margin-top': 'margin-top: ',
|
||||
'marks': 'marks: ',
|
||||
'max-height': 'max-height: ',
|
||||
'min-height': 'min-height: ',
|
||||
'max-width': 'max-width: ',
|
||||
'min-width': 'min-width: ',
|
||||
'orphans': 'orphans: ',
|
||||
'overflow': 'overflow: ',
|
||||
'padding': 'padding: ',
|
||||
'padding-bottom': 'padding-bottom: ',
|
||||
'padding-left': 'padding-left: ',
|
||||
'padding-right': 'padding-right: ',
|
||||
'padding-top': 'padding-top: ',
|
||||
'page-break-after': 'page-break-after: ',
|
||||
'page-break-before': 'page-break-before: ',
|
||||
'pause': 'pause: ',
|
||||
'pause-after': 'pause-after: ',
|
||||
'pause-before': 'pause-before: ',
|
||||
'pitch': 'pitch: ',
|
||||
'pitch-range': 'pitch-range: ',
|
||||
'play-during': 'play-during: ',
|
||||
'position': 'position: ',
|
||||
'richness': 'richness: ',
|
||||
'right': 'right: ',
|
||||
'row-span': 'row-span: ',
|
||||
'size': 'size: ',
|
||||
'speak': 'speak: ',
|
||||
'speak-date': 'speak-date: ',
|
||||
'speak-header': 'speak-header: ',
|
||||
'speak-numeral': 'speak-numeral: ',
|
||||
'speak-punctuation': 'speak-punctuation: ',
|
||||
'speak-time': 'speak-time: ',
|
||||
'speech-rate': 'speech-rate: ',
|
||||
'stress': 'stress: ',
|
||||
'table-layout': 'table-layout: ',
|
||||
'text-align': 'text-align: ',
|
||||
'text-decoration': 'text-decoration: ',
|
||||
'text-indent': 'text-indent: ',
|
||||
'text-shadow': 'text-shadow: ',
|
||||
'text-transform': 'text-transform: ',
|
||||
'top': 'top: ',
|
||||
'vertical-align': 'vertical-align: ',
|
||||
'visibility': 'visibility: ',
|
||||
'voice-family': 'voice-family: ',
|
||||
'volume': 'volume: ',
|
||||
'white-space': 'white-space: ',
|
||||
'widows': 'widows: ',
|
||||
'width': 'width: ',
|
||||
'word-spacing': 'word-spacing: ',
|
||||
'z-index': 'z-index: ' }
|
||||
};
|
||||
|
||||
// add the common items to all objects
|
||||
for(var i in tagLib) {
|
||||
i = i.replace(/^h[1-6]$/,"h"); // h1 .. h6
|
||||
for(var j in opTag_all)
|
||||
eval('opTag_'+i+'["'+j+'"] = opTag_all["'+j+'"];');
|
||||
for(var j in opAtt_all)
|
||||
eval('opAtt_'+i+'["'+j+'"] = opAtt_all["'+j+'"];');
|
||||
}
|
||||
Reference in New Issue
Block a user