code
stringlengths
1
2.08M
language
stringclasses
1 value
function loadTxt() { document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Percentage&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "Plak hier uw tekst inhoud (CTRL-V) "; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Tekst plakken</title>") }
JavaScript
function loadTxt() { document.getElementById("btnClose").value = "sluiten"; } function writeTitle() { document.write("<title>Voorbeeld</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Afbeelding Bron"; txtLang[1].innerHTML = "Herhalen"; txtLang[2].innerHTML = "Horizontale Uitlijning"; txtLang[3].innerHTML = "Verticale Uitlijning"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Herhalen" optLang[1].text = "Niet herhalen" optLang[2].text = "Herhalen x" optLang[3].text = "Herhalen y" optLang[4].text = "links" optLang[5].text = "midden" optLang[6].text = "rechts" optLang[7].text = "pixels" optLang[8].text = "procent" optLang[9].text = "boven" optLang[10].text = "midden" optLang[11].text = "onder" optLang[12].text = "pixels" optLang[13].text = "procent" document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Achtergrond Afbeelding</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Bron"; txtLang[1].innerHTML = "Alternatieve Tekst"; txtLang[2].innerHTML = "Afstand"; txtLang[3].innerHTML = "Uitlijning"; txtLang[4].innerHTML = "Boven"; txtLang[5].innerHTML = "Afbeelding rand"; txtLang[6].innerHTML = "Onder"; txtLang[7].innerHTML = "Breedte"; txtLang[8].innerHTML = "Left"; txtLang[9].innerHTML = "Hoogte"; txtLang[10].innerHTML = "Right"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "absOnder"; optLang[1].text = "absMidden"; optLang[2].text = "basislijn"; optLang[3].text = "onder"; optLang[4].text = "links"; optLang[5].text = "midden"; optLang[6].text = "rechts"; optLang[7].text = "Bovenkanttekst"; optLang[8].text = "boven"; document.getElementById("btnBorder").value = " Rand Stijl "; document.getElementById("btnReset").value = "reset" document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnInsert").value = "invoegen"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Afbeelding</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Uitlijning"; txtLang[1].innerHTML = "Inspringing"; txtLang[2].innerHTML = "Woord ruimte"; txtLang[3].innerHTML = "Karakter ruimte"; txtLang[4].innerHTML = "Lijnhoogte"; txtLang[5].innerHTML = "Tekst stand"; txtLang[6].innerHTML = "Wit ruimte"; document.getElementById("divPreview").innerHTML = "Lorem ipsum dolor sit amet, " + "consetetur sadipscing elitr, " + "sed diam nonumy eirmod tempor invidunt ut labore et " + "dolore magna aliquyam erat, " + "sed diam voluptua. At vero eos et accusam et justo " + "duo dolores et ea rebum. Stet clita kasd gubergren, " + "no sea takimata sanctus est Lorem ipsum dolor sit amet."; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Niet gebruikt"; optLang[1].text = "Links"; optLang[2].text = "Rechts"; optLang[3].text = "Midden"; optLang[4].text = "Uitgelijnd"; optLang[5].text = "Niet gebruikt"; optLang[6].text = "Kapitaal"; optLang[7].text = "Hoofdletters"; optLang[8].text = "Kleine letters"; optLang[9].text = "Geen"; optLang[10].text = "Niet gebruikt"; optLang[11].text = "Geen terugloop"; optLang[12].text = "pre"; optLang[13].text = "Normaal"; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Paragraaf Opmaak</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Rijen"; txtLang[1].innerHTML = "Ruimte"; txtLang[2].innerHTML = "Kolommen"; txtLang[3].innerHTML = "Opvulling"; txtLang[4].innerHTML = "Randen"; txtLang[5].innerHTML = "Samenvouwen"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Geen rand"; optLang[1].text = "Ja"; optLang[2].text = "Nee"; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnInsert").value = "invoegen"; document.getElementById("btnSpan1").value = "Samenvoegen v"; document.getElementById("btnSpan2").value = "Samenvoegen >"; } function writeTitle() { document.write("<title>Tabel Invoegen</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Naam"; txtLang[1].innerHTML = "Grootte"; txtLang[2].innerHTML = "Meerdere selecties"; txtLang[3].innerHTML = "Waarden"; document.getElementById("btnAdd").value = "toevoegen"; document.getElementById("btnUp").value = "op"; document.getElementById("btnDown").value = "neer"; document.getElementById("btnDel").value = "wissen"; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnInsert").value = "invoegen"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Lijst</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Naam"; txtLang[1].innerHTML = "Waarde"; txtLang[2].innerHTML = "Standaard"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Geselecteerd" optLang[1].text = "Niet Geselecteerd" document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnInsert").value = "invoegen"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Keuzerondje</title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "Automatische terugloop"; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function getTxt(s) { switch(s) { case "Search":return "Zoeken"; case "Cut":return "Knippen"; case "Copy":return "Kopi&euml;ren"; case "Paste":return "Plakken"; case "Undo":return "Ongedaan maken"; case "Redo":return "Opnieuw"; default:return ""; } } function writeTitle() { document.write("<title>Bron Bewerken</title>") }
JavaScript
function loadTxt() { document.getElementById("btnCheckAgain").value = " Opnieuw Controleren "; document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnOk").value = " ok "; } function getTxt(s) { switch(s) { case "Required": return "ieSpell (from www.iespell.com) is benodigd."; default:return ""; } } function writeTitle() { document.write("<title>Spellings Controle</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Type"; txtLang[1].innerHTML = "Naam"; txtLang[2].innerHTML = "Grootte"; txtLang[3].innerHTML = "Max Lengte"; txtLang[4].innerHTML = "Aant Lijnen"; txtLang[5].innerHTML = "Waarde"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Text" optLang[1].text = "Textgebied" optLang[2].text = "Wachtwoord" document.getElementById("btnCancel").value = "annuleren"; document.getElementById("btnInsert").value = "invoegen"; document.getElementById("btnApply").value = "toepassen"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Tekst Veld</title>") }
JavaScript
var sStyleWeight1; var sStyleWeight2; var sStyleWeight3; var sStyleWeight4; function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5b57\u9ad4 "; txtLang[1].innerHTML = "\u6a23\u5f0f "; txtLang[2].innerHTML = "\u5927\u5c0f "; txtLang[3].innerHTML = "\u524d\u666f\u8272\u5f69 "; txtLang[4].innerHTML = "\u80cc\u666f\u8272\u5f69 "; txtLang[5].innerHTML = "\u6587\u5b57\u88dd\u98fe "; txtLang[6].innerHTML = "\u5927\u5c0f\u5beb "; txtLang[7].innerHTML = "\u8ff7\u4f60\u5c0f\u5beb "; txtLang[8].innerHTML = "\u5782\u76f4 "; txtLang[9].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[10].innerHTML = "\u5e95\u7dda "; txtLang[11].innerHTML = "\u4e0a\u52a0\u7dda "; txtLang[12].innerHTML = "\u522a\u9664\u7dda "; txtLang[13].innerHTML = "\u6c92\u6709 "; txtLang[14].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[15].innerHTML = "\u6a19\u984c\u5927\u5beb "; txtLang[16].innerHTML = "\u5168\u90e8\u5927\u5beb "; txtLang[17].innerHTML = "\u5168\u90e8\u5c0f\u5beb "; txtLang[18].innerHTML = "\u6c92\u6709 "; txtLang[19].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[20].innerHTML = "\u5927\u5beb "; txtLang[21].innerHTML = "\u666e\u901a "; txtLang[22].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[23].innerHTML = "\u4e0a\u6a19 "; txtLang[24].innerHTML = "\u4e0b\u6a19 "; txtLang[25].innerHTML = "\u76f8\u5c0d "; txtLang[26].innerHTML = "\u57fa\u6e96\u7dda "; txtLang[27].innerHTML = "\u5b57\u5143\u9593\u8ddd "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u6a19\u6e96 " optLang[1].text = "\u659c\u9ad4 " optLang[2].text = "\u7c97\u9ad4 " optLang[3].text = "\u7c97\u9ad4\u52a0\u659c\u9ad4 " optLang[0].value = "Regular" optLang[1].value = "Italic" optLang[2].value = "Bold" optLang[3].value = "Bold Italic" sStyleWeight1 = "Regular" sStyleWeight2 = "Italic" sStyleWeight3 = "Bold" sStyleWeight4 = "Bold Italic" optLang[4].text = "\u4e0a " optLang[5].text = "\u4e2d " optLang[6].text = "\u4e0b " optLang[7].text = "\u6587\u5b57\u4e0a\u65b9 " optLang[8].text = "\u6587\u5b57\u4e0b\u65b9 " document.getElementById("btnPick1").value = "\u8272\u5f69 "; document.getElementById("btnPick2").value = "\u8272\u5f69 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Custom Colors": return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...": return "\u66f4\u591a\u8272\u5f69 ..."; default: return ""; } } function writeTitle() { document.write("<title>\u6587\u5b57\u683c\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u9810\u89bd "; txtLang[1].innerHTML = "\u6587\u5b57\u6a23\u5f0f "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "You're selecting BODY element.": return "\u60a8\u5df2\u9078\u64c7\u4e86 BODY\u5143\u7d20 ."; case "Please select a text.": return "\u8acb\u5148\u9078\u64c7\u6587\u5b57 ."; default:return ""; } } function writeTitle() { document.write("<title>Custom CSS</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u6a94\u6848 "; txtLang[1].innerHTML = "\u5bec\u5ea6 "; txtLang[2].innerHTML = "\u9ad8\u5ea6 "; txtLang[3].innerHTML = "\u81ea\u52d5\u64ad\u653e "; txtLang[4].innerHTML = "\u986f\u793a\u63a7\u5236\u81fa "; txtLang[5].innerHTML = "\u986f\u793a\u72c0\u614b\u5217 "; txtLang[6].innerHTML = "\u986f\u793a\u64ad\u653e\u81fa "; txtLang[7].innerHTML = "\u81ea\u52d5\u56de\u5e36 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u591a\u5a92\u9ad4 </title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "\u5f9e MS Word\u8cbc\u4e0a\u5167\u5bb9 (CTRL-V) "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u5f9e MS Word\u8cbc\u4e0a\u5167\u5bb9 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u9023\u7d50 "; txtLang[1].innerHTML = "\u6a19\u97f1 "; txtLang[2].innerHTML = "\u76ee\u6a19 "; txtLang[3].innerHTML = "\u9023\u7d50\u6a19\u97f1 "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "Self" optLang[1].text = "Blank" optLang[2].text = "Parent" document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u8d85\u9023\u7d50 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u985e\u5225\u540d\u7a31 "; txtLang[1].innerHTML = "\u9810\u89bd "; txtLang[2].innerHTML = "\u6587\u5b57\u6a23\u5f0f "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "You're selecting BODY element.": return "\u60a8\u5df2\u9078\u64c7\u4e86 BODY\u5143\u7d20 ."; case "Please select a text.": return "\u8acb\u5148\u9078\u64c7\u6587\u5b57 ."; default:return ""; } } function writeTitle() { document.write("<title>\u81ea\u8a02\u6a23\u5f0f </title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "HTML\u6e90\u78bc "; document.getElementById("btnClose").value = "\u95dc\u9589 "; } function writeTitle() { document.write("<title>\u7279\u6b8a\u5b57\u5143 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5c0b\u627e "; txtLang[1].innerHTML = "\u53d6\u4ee3 "; txtLang[2].innerHTML = "\u5927\u5c0f\u5beb\u9808\u76f8\u7b26 "; txtLang[3].innerHTML = "\u5168\u5b57\u62fc\u5beb\u9808\u76f8\u7b26 "; document.getElementById("btnSearch").value = "\u5c0b\u627e\u4e0b\u4e00\u500b ";; document.getElementById("btnReplace").value = "\u53d6\u4ee3 "; document.getElementById("btnReplaceAll").value = "\u4e9b\u90e8\u53d6\u4ee3 "; document.getElementById("btnClose").value = "\u95dc\u9589 "; } function getTxt(s) { switch(s) { case "Finished searching": return "Finished searching the document.\nSearch again from the top?"; default: return ""; } } function writeTitle() { document.write("<title>\u5c0b\u627e\u548c\u53d6\u4ee3 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u7a2e\u985e "; txtLang[1].innerHTML = "\u540d\u7a31 "; txtLang[2].innerHTML = "\u503c "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u6309\u9215 " optLang[1].text = "\u78ba\u8a8d\u5132\u5b58 " optLang[2].text = "\u91cd\u8a2d " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6309\u9215 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u984f\u8272 "; txtLang[1].innerHTML = "\u9670\u5f71 "; txtLang[2].innerHTML = "\u908a\u754c "; txtLang[3].innerHTML = "\u5de6 "; txtLang[4].innerHTML = "\u53f3 "; txtLang[5].innerHTML = "\u4e0a "; txtLang[6].innerHTML = "\u4e0b "; txtLang[7].innerHTML = "\u5132\u5b58\u683c\u5167\u8ddd "; txtLang[8].innerHTML = "\u5de6 "; txtLang[9].innerHTML = "\u53f3 "; txtLang[10].innerHTML = "\u4e0a "; txtLang[11].innerHTML = "\u4e0b "; txtLang[12].innerHTML = "\u91cf\u5ea6 "; txtLang[13].innerHTML = "\u6ff6\u5ea6 "; txtLang[14].innerHTML = "\u9ad8\u5ea6 "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u50cf\u7d20 "; optLang[1].text = "\u767e\u5206\u6bd4 "; optLang[2].text = "\u50cf\u7d20 "; optLang[3].text = "\u767e\u5206\u6bd4 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "No Border": return "\u7121\u908a\u6846 "; case "Outside Border": return "\u5916\u908a\u6846\u7dda "; case "Left Border": return "\u5de6\u908a\u6846\u7dda "; case "Top Border": return "\u4e0a\u908a\u6846\u7dda "; case "Right Border": return "\u53f3\u908a\u6846\u7dda "; case "Bottom Border": return "\u4e0b\u908a\u6846\u7dda "; case "Pick": return "\u9078\u64c7 "; case "Custom Colors": return "\u81ea\u8a02\u984f\u8272 "; case "More Colors...": return "\u66f4\u591a\u984f\u8272 ......"; default: return ""; } } function writeTitle() { document.write("<title>\u5132\u5b58\u683c\u683c\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); //txtLang[0].innerHTML = "\u5927\u5c0f "; txtLang[0].innerHTML = "\u81ea\u52d5\u8abf\u6574 "; txtLang[1].innerHTML = "\u5c6c\u6027 "; txtLang[2].innerHTML = "CSS\u6a23\u5f0f "; //txtLang[4].innerHTML = "\u63d2\u5165\u5217 "; //txtLang[5].innerHTML = "\u63d2\u5165\u6b04 "; //txtLang[6].innerHTML = "\u8de8 /\u5206\u62c6 \u5217 "; //txtLang[7].innerHTML = "\u8de8 /\u5206\u62c6 \u6b04 "; //txtLang[8].innerHTML = "\u522a\u9664\u5217 "; //txtLang[9].innerHTML = "\u522a\u9664\u6b04 "; txtLang[3].innerHTML = "\u5bec\u5ea6 "; txtLang[4].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u5167\u5bb9\u5927\u5c0f "; txtLang[5].innerHTML = "\u56fa\u5b9a\u8868\u683c\u5bec\u5ea6 "; txtLang[6].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u8996\u7a97\u5927\u5c0f "; txtLang[7].innerHTML = "\u9ad8\u5ea6 "; txtLang[8].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u5167\u5bb9\u5927\u5c0f "; txtLang[9].innerHTML = "\u56fa\u5b9a\u8868\u683c\u9ad8\u5ea6 "; txtLang[10].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u8996\u7a97\u5927\u5c0f "; txtLang[11].innerHTML = "\u5c0d\u9f4a "; txtLang[12].innerHTML = "\u908a\u754c "; txtLang[13].innerHTML = "\u5de6 "; txtLang[14].innerHTML = "\u53f3 "; txtLang[15].innerHTML = "\u4e0a "; txtLang[16].innerHTML = "\u4e0b "; txtLang[17].innerHTML = "\u908a\u6846 "; txtLang[18].innerHTML = "\u647a\u758a "; txtLang[19].innerHTML = "\u80cc\u666f "; txtLang[20].innerHTML = "\u5132\u5b58\u683c\u9593\u8ddd "; txtLang[21].innerHTML = "\u5132\u5b58\u683c\u5167\u8ddd "; txtLang[22].innerHTML = "CSS\u6587\u5b57\u6a23\u5f0f "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u50cf\u7d20 " optLang[1].text = "\u767e\u4efd\u6bd4 " optLang[2].text = "\u50cf\u7d20 " optLang[3].text = "\u767e\u4efd\u6bd4 " optLang[4].text = "" optLang[5].text = "\u5de6 " optLang[6].text = "\u4e2d " optLang[7].text = "\u53f3 " optLang[8].text = "\u7121\u908a\u6846 " optLang[9].text = "\u662f " optLang[10].text = "\u5426 " document.getElementById("btnPick").value="\u8272\u5f69 "; document.getElementById("btnImage").value="\u5f71\u50cf "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Cannot delete column.": return "\u4e0d\u80fd\u522a\u9664\u6b04\uff0c\u8acb\u5148\u79fb\u9664\u8de8\u6b04\u3002 "; case "Cannot delete row.": return "\u4e0d\u80fd\u522a\u9664\u5217\uff0c\u8acb\u5148\u79fb\u9664\u8de8\u5217\u3002 "; case "Custom Colors": return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...": return "\u66f4\u591a\u8272\u5f69 ..."; default:return ""; } } function writeTitle() { document.write("<title>\u8868\u683c\u5c6c\u6027 </title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "\u540d\u7a31 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6a94\u6848\u6b04\u4f4d </title>") }
JavaScript
function loadTxt() { document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>URL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>") }
JavaScript
function loadTxt() { document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u9577\u5ea6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "\u540d\u7a31 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u5b9a "; } function writeTitle() { document.write("<title>\u66f8\u61fa </title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "\u984f\u8272 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "No Border": return "\u7121\u908a\u6846 "; case "Outside Border": return "\u5916\u908a\u6846\u7dda "; case "Left Border": return "\u5de6\u908a\u6846\u7dda "; case "Top Border": return "\u4e0a\u908a\u6846\u7dda "; case "Right Border": return "\u53f3\u908a\u6846\u7dda "; case "Bottom Border": return "\u4e0b\u908a\u6846\u7dda "; case "Pick": return "\u9078\u64c7 "; case "Custom Colors": return "\u81ea\u8a02\u984f\u8272 "; case "More Colors...": return "\u66f4\u591a\u984f\u8272 ..."; default: return ""; } } function writeTitle() { document.write("<title>\u6846\u67b6 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u7de8\u865f "; txtLang[1].innerHTML = "\u9805\u76ee\u7b26\u865f "; txtLang[2].innerHTML = "\u8d77\u59cb\u503c "; txtLang[3].innerHTML = "\u5de6\u908a\u908a\u754c "; txtLang[4].innerHTML = "\u5f71\u50cf\u4f5c\u7b26\u865f\u7684\u9023\u7d50 " txtLang[5].innerHTML = "\u5de6\u908a\u908a\u754c "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Please select a list.":return "\u8acb\u5148\u9078\u64c7\u6b3e\u5f0f\u3002 "; default:return ""; } } function writeTitle() { document.write("<title>\u9805\u76ee\u7b26\u865f\u53ca\u7de8\u78bc\u683c\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u81ea\u52d5\u8abf\u6574 "; txtLang[1].innerHTML = "\u5c6c\u6027 "; txtLang[2].innerHTML = "CSS\u6a23\u5f0f "; txtLang[3].innerHTML = "\u5bec\u5ea6 "; txtLang[4].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u5167\u5bb9\u5927\u5c0f "; txtLang[5].innerHTML = "\u56fa\u5b9a\u5132\u5b58\u683c\u5bec\u5ea6 "; txtLang[6].innerHTML = "\u9ad8\u5ea6 "; txtLang[7].innerHTML = "\u81ea\u52d5\u8abf\u6574\u6210\u5167\u5bb9\u5927\u5c0f "; txtLang[8].innerHTML = "\u56fa\u5b9a\u5132\u5b58\u683c\u9ad8\u5ea6 "; txtLang[9].innerHTML = "\u6587\u5b57\u5c0d\u9f4a "; txtLang[10].innerHTML = "\u5167\u8ddd "; txtLang[11].innerHTML = "\u5de6 "; txtLang[12].innerHTML = "\u53f3 "; txtLang[13].innerHTML = "\u4e0a "; txtLang[14].innerHTML = "\u4e0b "; txtLang[15].innerHTML = "\u767d\u683c "; txtLang[16].innerHTML = "\u80cc\u666f "; txtLang[17].innerHTML = "\u9810\u89bd "; txtLang[18].innerHTML = "CSS\u6a23\u5f0f "; txtLang[19].innerHTML = "\u61c9\u7528\u81f3 "; document.getElementById("btnPick").value = "\u8272\u5f69 "; document.getElementById("btnImage").value = "\u5f71\u50cf "; document.getElementById("btnText").value = " \u6587\u5b57\u683c\u5f0f "; document.getElementById("btnBorder").value = " \u908a\u6846\u6a23\u8272 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u50cf\u7d20 " optLang[1].text = "\u767e\u4efd\u6bd4 " optLang[2].text = "\u50cf\u7d20 " optLang[3].text = "\u767e\u4efd\u6bd4 " optLang[4].text = "\u7121\u8a2d\u5b9a " optLang[5].text = "\u5411\u4e0a\u5c0d\u9f4a " optLang[6].text = "\u7f6e\u4e2d\u5c0d\u9f4a " optLang[7].text = "\u5411\u4e0b\u5c0d\u9f4a " optLang[8].text = "\u57fa\u6e96\u7dda " optLang[9].text = "sub" optLang[10].text = "super" optLang[11].text = "text-top" optLang[12].text = "text-bottom" optLang[13].text = "not set" optLang[14].text = "left" optLang[15].text = "center" optLang[16].text = "right" optLang[17].text = "justify" optLang[18].text = "Not Set" optLang[19].text = "No Wrap" optLang[20].text = "pre" optLang[21].text = "Normal" optLang[22].text = "Current Cell" optLang[23].text = "Current Row" optLang[24].text = "Current Column" optLang[25].text = "Whole Table" } function getTxt(s) { switch(s) { case "Custom Colors": return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...": return "\u66f4\u591a\u8272\u5f69 ..."; default: return ""; } } function writeTitle() { document.write("<title>Cell Properties</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u540d\u7a31 "; txtLang[1].innerHTML = "\u503c "; txtLang[2].innerHTML = "\u9810\u8a2d "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u5df2\u6838\u53d6 " optLang[1].text = "\u4e0d\u6838\u53d6 " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6838\u53d6\u65b9\u584a </title>") }
JavaScript
/*** Translation ***/ LanguageDirectory="tchi"; function getTxt(s) { switch(s) { case "Save":return "\u5132\u5b58 "; case "Preview":return "\u9810\u89bd "; case "Full Screen":return "\u5168\u87a2\u5e55 "; case "Search":return "\u5c0b\u627e "; case "Check Spelling":return "\u62fc\u5b57\u6aa2\u67e5 "; case "Text Formatting":return "\u5b57\u578b\u683c\u5f0f "; case "List Formatting":return "\u9805\u76ee\u683c\u5f0f "; case "Paragraph Formatting":return "\u6bb5\u843d\u683c\u5f0f "; case "Styles":return "\u6a23\u5f0f "; case "Custom CSS":return "\u81ea\u8a02 CSS"; case "Styles & Formatting":return "\u6a23\u5f0f\u53ca\u683c\u5f0f "; case "Style Selection":return "\u6a23\u5f0f "; case "Paragraph":return "\u6bb5\u843d\u6a19\u984c "; case "Font Name":return "\u5b57\u9ad4 "; case "Font Size":return "\u5b57\u9ad4\u5927\u5c0f "; case "Cut":return "\u526a\u4e0b "; case "Copy":return "\u8907\u88fd "; case "Paste":return "\u8cbc\u4e0a "; case "Undo":return "\u8907\u539f "; case "Redo":return "\u53d6\u6d88\u8907\u539f "; case "Bold":return "\u7c97\u9ad4 "; case "Italic":return "\u659c\u9ad4 "; case "Underline":return "\u5e95\u7dda "; case "Strikethrough":return "\u522a\u9664\u7dda "; case "Superscript":return "\u4e0a\u6a19 "; case "Subscript":return "\u4e0b\u6a19 "; case "Justify Left":return "\u9760\u5de6\u5c0d\u9f4a "; case "Justify Center":return "\u7f6e\u4e2d\u5c0d\u9f4a "; case "Justify Right":return "\u9760\u53f3\u5c0d\u9f4a "; case "Justify Full":return "\u5de6\u53f3\u5c0d\u9f4a "; case "Numbering":return "\u7de8\u865f "; case "Bullets":return "\u9805\u76ee\u7b26\u865f "; case "Indent":return "\u589e\u52a0\u7e2e\u6392 "; case "Outdent":return "\u6e1b\u5c11\u7e2e\u6392 "; case "Left To Right":return "\u7531\u5de6\u81f3\u53f3\u586b\u5beb "; case "Right To Left":return "\u7531\u53f3\u81f3\u5de6\u586b\u5beb "; case "Foreground Color":return "\u524d\u666f\u8272\u5f69 "; case "Background Color":return "\u80cc\u666f\u8272\u886b "; case "Hyperlink":return "\u8d85\u9023\u7d50 "; case "Bookmark":return "\u66f8\u97f1 "; case "Special Characters":return "\u7279\u6b8a\u5b57\u5143 "; case "Image":return "\u5f71\u50cf "; case "Flash":return "Flash"; case "Media":return "\u591a\u5a92\u9ad4\u6a94\u6848 "; case "Content Block":return "Content Block"; case "Internal Link":return "\u5167\u90e8\u9023\u7d50 "; case "Internal Image":return "Internal Image"; case "Object":return "\u7269\u4ef6 "; case "Insert Table":return "\u63d2\u5165\u8868\u683c "; case "Table Size":return "\u8868\u683c\u5927\u5c0f "; case "Edit Table":return "\u4fee\u6539\u8868\u683c "; case "Edit Cell":return "\u8868\u683c\u5132\u5b58\u683c "; case "Table":return "\u8868\u683c "; case "Border & Shading":return "\u908a\u6846\u548c\u9670\u5f71 "; case "Show/Hide Guidelines":return "\u986f\u793a /\u96b1\u85cf\u683c\u7dda "; case "Absolute":return "\u7d55\u5c0d\u503c "; case "Paste from Word":return "\u8cbc\u4e0a MS Word\u5167\u5bb9 "; case "Line":return "\u7dda\u689d "; case "Form Editor":return "\u8868\u55ae\u7de8\u8f2f "; case "Form":return "\u8868\u55ae "; case "Text Field":return "\u6587\u5b57\u6b04\u4f4d "; case "List":return "\u6e05\u55ae "; case "Checkbox":return "\u6838\u53d6\u65b9\u584a "; case "Radio Button":return "\u9078\u9805\u6309\u9215 "; case "Hidden Field":return "\u96b1\u85cf\u6b04\u4f4d "; case "File Field":return "\u6a94\u6848\u6b04\u4f4d "; case "Button":return "\u6309\u9215 "; case "Clean":return "\u6e05\u9664 "; case "View/Edit Source":return "\u89c0\u770b /\u4fee\u6539 HTML\u6e90\u78bc "; case "Tag Selector":return "\u6a19\u97f1\u9078\u7528 "; case "Clear All":return "\u5168\u90e8\u6e05\u9664 "; case "Tags":return "\u6a19\u97f1 "; case "Heading 1":return "\u6a19\u984c 1"; case "Heading 2":return "\u6a19\u984c 2"; case "Heading 3":return "\u6a19\u984c 3"; case "Heading 4":return "\u6a19\u984c 4"; case "Heading 5":return "\u6a19\u984c 5"; case "Heading 6":return "\u6a19\u984c 6"; case "Preformatted":return "\u9810\u5148\u683c\u5f0f\u5316 "; case "Normal (P)":return "\u6bb5\u843d (P)"; case "Normal (DIV)":return "\u6bb5\u843d (DIV)"; case "Size 1":return "\u5b57\u578b 1"; case "Size 2":return "\u5b57\u578b 2"; case "Size 3":return "\u5b57\u578b 3"; case "Size 4":return "\u5b57\u578b 4"; case "Size 5":return "\u5b57\u578b 5"; case "Size 6":return "\u5b57\u578b 6"; case "Size 7":return "\u5b57\u578b 7"; case "Are you sure you wish to delete all contents?": return "\u60a8\u78ba\u5b9a\u8981\u522a\u9664\u6240\u6709\u5167\u5bb9\u55ce\uff1f "; case "Remove Tag":return "\u79fb\u9664\u6a19\u97f1 "; case "Custom Colors":return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...":return "\u66f4\u591a\u8272\u5f69 ..."; case "Box Formatting":return "\u5132\u5b58\u683c\u683c\u5f0f\u5316 "; case "Advanced Table Insert":return "\u63d2\u5165\u8868\u683c\u9078\u55ae "; case "Edit Table/Cell":return "\u4fee\u6539\u8868\u683c /\u5132\u5b58\u683c "; case "Print":return "\u5217\u5370 "; case "Paste Text":return "Paste Text"; case "CSS Builder":return "CSS Builder"; case "Remove Formatting":return "Remove Formatting"; default:return ""; } }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u7db2\u9801\u8abf\u8272\u76e4 "; txtLang[1].innerHTML = "\u9078\u6709\u540d\u7a31\u7684\u984f\u8272 "; txtLang[2].innerHTML = "\u5b89\u5168\u7684\u7db2\u9801\u984f\u8272 "; txtLang[3].innerHTML = "\u65b0\u7684\u984f\u8272 "; txtLang[4].innerHTML = "\u73fe\u5728\u7684\u984f\u8272 "; txtLang[5].innerHTML = "\u81ea\u8a02\u984f\u8272 "; document.getElementById("btnAddToCustom").value = "\u65b0\u589e\u5230\u81ea\u8a02\u7684\u984f\u8272 "; document.getElementById("btnCancel").value = " \u53d6\u6d88 "; document.getElementById("btnRemove").value = " \u984f\u8272\u79fb\u9664 "; document.getElementById("btnApply").value = " \u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u8272\u5f69 </title>") }
JavaScript
var sStyleWeight1; var sStyleWeight2; var sStyleWeight3; var sStyleWeight4; function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5b57\u9ad4 "; txtLang[1].innerHTML = "\u6a23\u5f0f "; txtLang[2].innerHTML = "\u5927\u5c0f "; txtLang[3].innerHTML = "\u524d\u666f\u8272\u5f69 "; txtLang[4].innerHTML = "\u80cc\u666f\u8272\u5f69 "; txtLang[5].innerHTML = "\u6587\u5b57\u88dd\u98fe "; txtLang[6].innerHTML = "\u5927\u5c0f\u5beb "; txtLang[7].innerHTML = "\u8ff7\u4f60\u5c0f\u5beb "; txtLang[8].innerHTML = "\u5782\u76f4 "; txtLang[9].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[10].innerHTML = "\u5e95\u7dda "; txtLang[11].innerHTML = "\u4e0a\u52a0\u7dda "; txtLang[12].innerHTML = "\u522a\u9664\u7dda "; txtLang[13].innerHTML = "\u6c92\u6709 "; txtLang[14].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[15].innerHTML = "\u6a19\u984c\u5927\u5beb "; txtLang[16].innerHTML = "\u5168\u90e8\u5927\u5beb "; txtLang[17].innerHTML = "\u5168\u90e8\u5c0f\u5beb "; txtLang[18].innerHTML = "\u6c92\u6709 "; txtLang[19].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[20].innerHTML = "\u5927\u5beb "; txtLang[21].innerHTML = "\u666e\u901a "; txtLang[22].innerHTML = "\u6c92\u6709\u8a2d\u5b9a "; txtLang[23].innerHTML = "\u4e0a\u6a19 "; txtLang[24].innerHTML = "\u4e0b\u6a19 "; txtLang[25].innerHTML = "\u76f8\u5c0d "; txtLang[26].innerHTML = "\u57fa\u6e96\u7dda "; txtLang[27].innerHTML = "\u5b57\u5143\u9593\u8ddd "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u6a19\u6e96 " optLang[1].text = "\u659c\u9ad4 " optLang[2].text = "\u7c97\u9ad4 " optLang[3].text = "\u7c97\u9ad4\u52a0\u659c\u9ad4 " optLang[0].value = "Regular" optLang[1].value = "Italic" optLang[2].value = "Bold" optLang[3].value = "Bold Italic" sStyleWeight1 = "Regular" sStyleWeight2 = "Italic" sStyleWeight3 = "Bold" sStyleWeight4 = "Bold Italic" optLang[4].text = "\u4e0a " optLang[5].text = "\u4e2d " optLang[6].text = "\u4e0b " optLang[7].text = "\u6587\u5b57\u4e0a\u65b9 " optLang[8].text = "\u6587\u5b57\u4e0b\u65b9 " document.getElementById("btnPick1").value = "\u8272\u5f69 "; document.getElementById("btnPick2").value = "\u8272\u5f69 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Custom Colors": return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...": return "\u66f4\u591a\u8272\u5f69 ..."; default: return ""; } } function writeTitle() { document.write("<title>\u6587\u5b57\u683c\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u6a94\u6848 "; txtLang[1].innerHTML = "\u80cc\u666f\u8272\u5f69 "; txtLang[2].innerHTML = "\u5bec\u5ea6 "; txtLang[3].innerHTML = "\u9ad8\u5ea6 "; txtLang[4].innerHTML = "\u54c1\u8cea "; txtLang[5].innerHTML = "\u5c0d\u9f4a "; txtLang[6].innerHTML = "\u91cd\u8907\u64ad\u653e "; txtLang[7].innerHTML = "\u662f "; txtLang[8].innerHTML = "\u5426 "; txtLang[9].innerHTML = "Class ID"; txtLang[10].innerHTML = "CodeBase"; txtLang[11].innerHTML = "PluginsPage"; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u4f4e " optLang[1].text = "\u9ad8 " optLang[2].text = "<\u6c92\u6709\u8a2d\u5b9a >" optLang[3].text = "\u5de6 " optLang[4].text = "\u53f3 " optLang[5].text = "\u4e0a " optLang[6].text = "\u4e0b " document.getElementById("btnPick").value = "\u9078\u64c7 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Custom Colors": return "\u81ea\u8a02\u8272\u5f69 "; case "More Colors...": return "\u66f4\u591a\u8272\u5f69 ..."; default: return ""; } } function writeTitle() { document.write("<title>\u63d2\u5165 Flash</title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u540d\u7a31 "; txtLang[1].innerHTML = "\u503c "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u96b1\u85cf\u6b04\u4f4d </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u540d\u7a31 "; txtLang[1].innerHTML = "\u52d5\u4f5c "; txtLang[2].innerHTML = "\u65b9\u6cd5 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u8868\u55ae </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u6a23\u5f0f "; txtLang[1].innerHTML = "\u9810\u89bd "; txtLang[2].innerHTML = "\u61c9\u7528\u81f3 "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u5df1\u9078\u53d6\u7684\u6587\u5b57 " optLang[1].text = "\u73fe\u5728\u7684\u6a19\u97f1 " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "You're selecting BODY element.": return "\u60a8\u5df2\u9078\u64c7\u4e86 BODY\u5143\u7d20 ."; case "Please select a text.": return "\u8acb\u5148\u9078\u64c7\u6587\u5b57 ."; default:return ""; } } function writeTitle() { document.write("<title>\u6a23\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u65b0\u589e\u5217 "; txtLang[1].innerHTML = "\u65b0\u589e\u6b04 "; txtLang[2].innerHTML = "\u589e\u52a0 /\u522a\u9664\u5217\u5408\u4f75 "; txtLang[3].innerHTML = "\u589e\u52a0 /\u522a\u9664\u6b04\u5408\u4f75 "; txtLang[4].innerHTML = "\u522a\u9664\u5217 "; txtLang[5].innerHTML = "\u522a\u9664\u6b04 "; document.getElementById("btnInsRowAbove").title="\u65b0\u589e\u4e0a\u65b9\u5217 "; document.getElementById("btnInsRowBelow").title="\u65b0\u589e\u4e0b\u65b9\u5217 "; document.getElementById("btnInsColLeft").title="\u65b0\u589e\u5de6\u65b9\u6b04 "; document.getElementById("btnInsColRight").title="\u65b0\u589e\u53f3\u65b9\u6b04 "; document.getElementById("btnIncRowSpan").title="\u589e\u52a0\u5217\u5408\u4f75 "; document.getElementById("btnDecRowSpan").title="\u522a\u9664\u5217\u5408\u4f75 "; document.getElementById("btnIncColSpan").title="\u589e\u52a0\u6b04\u5408\u4f75 "; document.getElementById("btnDecColSpan").title="\u522a\u9664\u6b04\u5408\u4f75 "; document.getElementById("btnDelRow").title="\u522a\u9664\u5217 "; document.getElementById("btnDelCol").title="\u522a\u9664\u6b04 "; document.getElementById("btnClose").value = " \u95dc\u9589 "; } function getTxt(s) { switch(s) { case "\u4e0d\u80fd\u522a\u9664\u6b04 .": return "\u4e0d\u80fd\u522a\u9664\u6b04\uff0c\u8acb\u5148\u6d88\u9664\u6b04\u5408\u4f75 ."; case "\u4e0d\u80fd\u522a\u9664\u5217 .": return "\u4e0d\u80fd\u522a\u9664\u5217\uff0c\u8acb\u5148\u6d88\u9664\u5217\u5408\u4f75 ."; default:return ""; } } function writeTitle() { document.write("<title>\u8868\u683c\u5927\u5c0f </title>") }
JavaScript
function loadTxt() { document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u767e\u4efd\u6bd4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "Paste text content here (CTRL-V) "; document.getElementById("btnCancel").value = "cancel"; document.getElementById("btnOk").value = " ok "; } function writeTitle() { document.write("<title>Paste Text</title>") }
JavaScript
function loadTxt() { document.getElementById("btnClose").value = "\u95dc\u9589 "; } function writeTitle() { document.write("<title>\u9810\u89bd </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5f71\u50cf\u6a94\u6848 "; txtLang[1].innerHTML = "\u91cd\u8907 "; txtLang[2].innerHTML = "\u6c34\u5e73\u5c0d\u9f4a "; txtLang[3].innerHTML = "\u5782\u76f4\u5c0d\u9f4a "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u91cd\u8907 " optLang[1].text = "\u4e0d\u91cd\u8907 " optLang[2].text = "\u6a6b\u5411\u91cd\u8907 " optLang[3].text = "\u5782\u76f4\u91cd\u8907 " optLang[4].text = "\u5de6 " optLang[5].text = "\u4e2d " optLang[6].text = "\u53f3 " optLang[7].text = "\u50cf\u7d20 " optLang[8].text = "\u767e\u4efd\u6bd4 " optLang[9].text = "\u4e0a " optLang[10].text = "\u4e2d " optLang[11].text = "\u4e0b " optLang[12].text = "\u50cf\u7d20 " optLang[13].text = "\u767e\u4efd\u6bd4 " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u80cc\u666f\u5f71\u50cf </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u6a94\u6848 "; txtLang[1].innerHTML = "\u5f71\u50cf\u66ff\u4ee3\u6587\u5b57 "; txtLang[2].innerHTML = "\u8ddd\u96e2 "; txtLang[3].innerHTML = "\u5c0d\u9f4a "; txtLang[4].innerHTML = "\u4e0a "; txtLang[5].innerHTML = "\u908a\u6846 "; txtLang[6].innerHTML = "\u4e0b "; txtLang[7].innerHTML = "\u5bec\u5ea6 "; txtLang[8].innerHTML = "\u5de6 "; txtLang[9].innerHTML = "\u9ad8\u5ea6 "; txtLang[10].innerHTML = "\u53f3 "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u7d55\u5c0d\u5411\u4e0b "; optLang[1].text = "\u7d55\u5c0d\u4e2d\u9593 "; optLang[2].text = "\u57fa\u6e96\u7dda "; optLang[3].text = "\u9760\u4e0b\u5c0d\u9f4a "; optLang[4].text = "\u5411\u5de6\u5c0d\u9f4a "; optLang[5].text = "\u7f6e\u4e2d\u5c0d\u9f4a "; optLang[6].text = "\u5411\u53f3\u5c0d\u9f4a "; optLang[7].text = "\u6587\u5b57\u4e0a\u65b9 "; optLang[8].text = "\u9760\u4e0a\u5c0d\u9f4a "; document.getElementById("btnBorder").value = " \u908a\u6846\u6a23\u5f0f "; document.getElementById("btnReset").value = "\u91cd\u8a2d " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u5f71\u50cf </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5c0d\u9f4a "; txtLang[1].innerHTML = "\u7e2e\u6392 "; txtLang[2].innerHTML = "\u5b57\u9593\u8ddd\u96e2 "; txtLang[3].innerHTML = "\u5b57\u5143\u8ddd\u96e2 "; txtLang[4].innerHTML = "\u884c\u9ad8 "; txtLang[5].innerHTML = "\u5b57\u9ad4\u5927\u5c0f\u5beb "; txtLang[6].innerHTML = "\u767d\u7a7a\u683c "; document.getElementById("divPreview").innerHTML = "this para try to show you the effect, " + "\u986f\u793a\u6548\u679c , " + "sed diam nonumy eirmod tempor invidunt ut labore et " + "dolore magna aliquyam erat, " + "sed diam voluptua. At vero eos et accusam et justo " + "duo dolores et ea rebum. Stet clita kasd gubergren, " + "no sea takimata sanctus est Lorem ipsum dolor sit amet."; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u6c92\u6709\u8a2d\u5b9a "; optLang[1].text = "\u5de6 "; optLang[2].text = "\u53f3 "; optLang[3].text = "\u4e2d "; optLang[4].text = "\u5de6\u53f3\u5c0d\u9f4a "; optLang[5].text = "\u6c92\u6709\u8a2d\u5b9a "; optLang[6].text = "\u6a19\u984c\u5927\u5beb "; optLang[7].text = "\u5927\u5beb "; optLang[8].text = "\u5c0f\u5beb "; optLang[9].text = "\u6c92\u6709 "; optLang[10].text = "\u6c92\u6709\u8a2d\u5b9a "; optLang[11].text = "\u4e0d\u63db\u884c "; optLang[12].text = "pre"; optLang[13].text = "Normal"; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6bb5\u843d\u683c\u5f0f </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u5217 "; txtLang[1].innerHTML = "\u9593\u8ddd "; txtLang[2].innerHTML = "\u6b04 "; txtLang[3].innerHTML = "\u5167\u8ddd "; txtLang[4].innerHTML = "\u908a\u6846 "; txtLang[5].innerHTML = "\u647a\u758a "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u7121\u908a\u6846 "; optLang[1].text = "\u662f "; optLang[2].text = "\u5426 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnSpan1").value = "\u5782\u76f4\u8de8\u6b04 "; document.getElementById("btnSpan2").value = "\u6c34\u5e73\u8de8\u6b04 "; } function writeTitle() { document.write("<title>\u63d2\u5165\u8868\u683c </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u540d\u7a31 "; txtLang[1].innerHTML = "\u5927\u5c0f "; txtLang[2].innerHTML = "\u5141\u8a31\u591a\u9805\u9078\u64c7 "; txtLang[3].innerHTML = "\u503c "; document.getElementById("btnAdd").value = " \u65b0\u589e "; document.getElementById("btnUp").value = " \u4e0a\u79fb "; document.getElementById("btnDown").value = " \u4e0b\u79fb "; document.getElementById("btnDel").value = " \u522a\u9664 "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6e05\u55ae </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u540d\u7a31 "; txtLang[1].innerHTML = "\u503c "; txtLang[2].innerHTML = "\u9810\u8a2d "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u5df1\u6838\u53d6 " optLang[1].text = "\u5df1\u6838\u53d6 " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>Radio Button</title>") }
JavaScript
function loadTxt() { document.getElementById("txtLang").innerHTML = "\u63db\u884c "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Search":return "\u5c0b\u627e "; case "Cut":return "\u526a\u4e0b "; case "Copy":return "\u8907\u88fd "; case "Paste":return "\u8cbc\u4e0a "; case "Undo":return "\u5fa9\u539f "; case "Redo":return "\u53d6\u6d88\u5fa9\u539f "; default:return ""; } } function writeTitle() { document.write("<title>HTML\u6e90\u78bc\u7de8\u8f2f\u5668 </title>") }
JavaScript
function loadTxt() { document.getElementById("btnCheckAgain").value = " Check Again "; document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function getTxt(s) { switch(s) { case "Required": return "\u9808\u8981 ieSpell\u7a0b\u5f0f (from www.iespell.com)."; default:return ""; } } function writeTitle() { document.write("<title>\u62fc\u5b57\u6aa2\u67e5 : \u82f1\u6587 </title>") }
JavaScript
function loadTxt() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "\u7a2e\u985e "; txtLang[1].innerHTML = "\u540d\u7a31 "; txtLang[2].innerHTML = "\u5927\u5c0f "; txtLang[3].innerHTML = "\u5b57\u5143\u9577\u5ea6\u4e0a\u9650 "; txtLang[4].innerHTML = "\u884c\u6578 "; txtLang[5].innerHTML = "\u503c "; var optLang = document.getElementsByName("optLang"); optLang[0].text = "\u6587\u5b57\u6b04\u4f4d " optLang[1].text = "\u6587\u5b57\u5340\u57df " optLang[2].text = "\u5bc6\u78bc\u6b04\u4f4d " document.getElementById("btnCancel").value = "\u53d6\u6d88 "; document.getElementById("btnInsert").value = "\u63d2\u5165 "; document.getElementById("btnApply").value = "\u61c9\u7528 "; document.getElementById("btnOk").value = " \u78ba\u8a8d "; } function writeTitle() { document.write("<title>\u6587\u5b57\u6b04\u4f4d </title>") }
JavaScript
/*** Color Picker Object ***/ var arrColorPickerObjects=[]; function ColorPicker(sName,sParent) { this.oParent=sParent; if(sParent) { this.oName=sParent+"."+sName; this.oRenderName=sName+sParent; } else { this.oName=sName; this.oRenderName=sName; } arrColorPickerObjects.push(this.oName); this.url="color_picker.htm"; this.onShow=function(){return true;}; this.onHide=function(){return true;}; this.onPickColor=function(){return true;}; this.onRemoveColor=function(){return true;}; this.onMoreColor=function(){return true;}; this.show=showColorPicker; this.hide=hideColorPicker; this.hideAll=hideColorPickerAll; this.color; this.customColors=[]; this.refreshCustomColor=refreshCustomColor; this.isActive=false; this.txtCustomColors="Custom Colors"; this.txtMoreColors="More Colors..."; this.align="left"; this.currColor="#ffffff";//default current color this.RENDER=drawColorPicker; } function drawColorPicker() { var arrColors=[["#800000","#8b4513","#006400","#2f4f4f","#000080","#4b0082","#800080","#000000"], ["#ff0000","#daa520","#6b8e23","#708090","#0000cd","#483d8b","#c71585","#696969"], ["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"], ["#ff6347","#ffd700","#32cd32","#87ceeb","#00bfff","#9370db","#ff69b4","#dcdcdc"], ["#ffdab9","#ffffe0","#98fb98","#e0ffff","#87cefa","#e6e6fa","#dda0dd","#ffffff"]] var sHTMLColor="<table id=dropColor"+this.oRenderName+" style=\"z-index:1;display:none;position:absolute;border:#9b95a6 1px solid;cursor:default;background-color:#E9E8F2;padding:2px\" unselectable=on cellpadding=0 cellspacing=0 width=143 height=109><tr><td unselectable=on>" sHTMLColor+="<table align=center cellpadding=0 cellspacing=0 border=0 unselectable=on>"; for(var i=0;i<arrColors.length;i++) { sHTMLColor+="<tr>"; for(var j=0;j<arrColors[i].length;j++) sHTMLColor+="<td onclick=\""+this.oName+".color='"+arrColors[i][j]+"';"+this.oName+".onPickColor();"+this.oName+".currColor='"+arrColors[i][j]+"';"+this.oName+".hideAll()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='#E9E8F2 1px solid'\" style=\"cursor:default;padding:1px;border:#E9E8F2 1px solid;\" unselectable=on>"+ "<table style='margin:0;width:13px;height:13px;background:"+arrColors[i][j]+";border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td unselectable=on></td></tr>"+ "</table></td>"; sHTMLColor+="</tr>"; } //~~~ custom colors ~~~~ sHTMLColor+="<tr><td colspan=8 id=idCustomColor"+this.oRenderName+"></td></tr>"; //~~~ remove color & more colors ~~~~ sHTMLColor+= "<tr>"; sHTMLColor+= "<td unselectable=on>"+ "<table style='margin-left:1px;width:14px;height:14px;background:#E9E8F2;' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td onclick=\""+this.oName+".onRemoveColor();"+this.oName+".currColor='';"+this.oName+".hideAll()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='white 1px solid'\" style=\"cursor:default;padding:1px;border:white 1px solid;font-family:verdana;font-size:10px;font-color:black;line-height:9px;\" align=center valign=top unselectable=on>x</td></tr>"+ "</table></td>"; sHTMLColor+= "<td colspan=7 unselectable=on>"+ "<table style='margin:1px;width:117px;height:16px;background:#E9E8F2;border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td onclick=\""+this.oName+".onMoreColor();"+this.oName+".hideAll();window.showModelessDialog('"+this.url+"',[window,'"+this.oName+"'],'dialogWidth:432px;dialogHeight:427px;edge:Raised;center:1;help:0;resizable:1;')\" onmouseover=\"this.style.border='#777777 1px solid';this.style.background='#8d9aa7';this.style.color='#ffffff'\" onmouseout=\"this.style.border='#E9E8F2 1px solid';this.style.background='#E9E8F2';this.style.color='#000000'\" style=\"cursor:default;padding:1px;border:#efefef 1px solid\" style=\"font-family:verdana;font-size:9px;font-color:black;line-height:9px;padding:1px\" align=center valign=top nowrap unselectable=on>"+this.txtMoreColors+"</td></tr>"+ "</table></td>"; sHTMLColor+= "</tr>"; sHTMLColor+= "</table>"; sHTMLColor+="</td></tr></table>"; document.write(sHTMLColor); } function refreshCustomColor() { if(dialogArguments.oUtil)//[CUSTOM] this.customColors=dialogArguments.oUtil.obj.customColors;//[CUSTOM] (Get from public definition) else //text2.htm [CUSTOM] this.customColors=dialogArguments[0].oUtil.obj.customColors;//[CUSTOM] (Get from public definition) if(this.customColors.length==0) { eval("idCustomColor"+this.oRenderName).innerHTML=""; return; } sHTML="<table cellpadding=0 cellspacing=0 width=100%><tr><td colspan=8 style=\"font-family:verdana;font-size:9px;font-color:black;line-height:9px;padding:1\">"+this.txtCustomColors+":</td></tr></table>" sHTML+="<table cellpadding=0 cellspacing=0><tr>"; for(var i=0;i<this.customColors.length;i++) { if(i<22) { if(i==8||i==16||i==24||i==32)sHTML+="</tr></table><table cellpadding=0 cellspacing=0><tr>" sHTML+="<td onclick=\""+this.oName+".color='"+this.customColors[i]+"';"+this.oName+".onPickColor()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='#E9E8F2 1px solid'\" style=\"cursor:default;padding:1px;border:#E9E8F2 1px solid;\" unselectable=on>"+ " <table style='margin:0;width:13;height:13;background:"+this.customColors[i]+";border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ " <tr><td unselectable=on></td></tr>"+ " </table>"+ "</td>"; } } sHTML+="</tr></table>"; eval("idCustomColor"+this.oRenderName).innerHTML=sHTML; } function showColorPicker(oEl) { this.onShow(); this.hideAll(); var box=eval("dropColor"+this.oRenderName); box.style.display="block"; var nTop=0; var nLeft=0; oElTmp=oEl; while(oElTmp.tagName!="BODY" && oElTmp.tagName!="HTML") { if(oElTmp.style.top!="") nTop+=oElTmp.style.top.substring(1,oElTmp.style.top.length-2)*1; else nTop+=oElTmp.offsetTop; oElTmp = oElTmp.offsetParent; } oElTmp=oEl; while(oElTmp.tagName!="BODY" && oElTmp.tagName!="HTML") { if(oElTmp.style.left!="") nLeft+=oElTmp.style.left.substring(1,oElTmp.style.left.length-2)*1; else nLeft+=oElTmp.offsetLeft; oElTmp=oElTmp.offsetParent; } if(this.align=="left") box.style.left=nLeft; else//right box.style.left=nLeft-143+oEl.offsetWidth; //box.style.top=nTop+1;//[CUSTOM] box.style.top=nTop+1+oEl.offsetHeight;//[CUSTOM] this.isActive=true; this.refreshCustomColor(); } function hideColorPicker() { this.onHide(); var box=eval("dropColor"+this.oRenderName); box.style.display="none"; this.isActive=false; } function hideColorPickerAll() { for(var i=0;i<arrColorPickerObjects.length;i++) { var box=eval("dropColor"+eval(arrColorPickerObjects[i]).oRenderName); box.style.display="none"; eval(arrColorPickerObjects[i]).isActive=false; } }
JavaScript
/*** Editor Script Wrapper ***/ var oScripts=document.getElementsByTagName("script"); var sEditorPath; for(var i=0;i<oScripts.length;i++) { var sSrc=oScripts[i].src.toLowerCase(); if(sSrc.indexOf("scripts/innovaeditor.js")!=-1) sEditorPath=oScripts[i].src.replace(/innovaeditor.js/,""); } if(navigator.appName.indexOf('Microsoft')!=-1) document.write("<scr"+"ipt src='"+sEditorPath+"editor.js'></scr"+"ipt>"); else document.write("<scr"+"ipt src='"+sEditorPath+"moz/editor.js'></scr"+"ipt>");
JavaScript
/*** Color Picker Object ***/ var arrColorPickerObjects=[]; function ColorPicker(sName,sParent) { this.oParent=sParent; if(sParent) { this.oName=sParent+"."+sName; this.oRenderName=sName+sParent; } else { this.oName=sName; this.oRenderName=sName; } arrColorPickerObjects.push(this.oName); this.url="color_picker.htm"; this.onShow=function(){return true;}; this.onHide=function(){return true;}; this.onPickColor=function(){return true;}; this.onRemoveColor=function(){return true;}; this.onMoreColor=function(){return true;}; this.show=showColorPicker; this.hide=hideColorPicker; this.hideAll=hideColorPickerAll; this.color; this.customColors=[]; this.refreshCustomColor=refreshCustomColor; this.isActive=false; this.txtCustomColors="Custom Colors"; this.txtMoreColors="More Colors..."; this.align="left"; this.currColor="#ffffff";//default current color this.RENDER=drawColorPicker; } function drawColorPicker() { var arrColors=[["#800000","#8b4513","#006400","#2f4f4f","#000080","#4b0082","#800080","#000000"], ["#ff0000","#daa520","#6b8e23","#708090","#0000cd","#483d8b","#c71585","#696969"], ["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"], ["#ff6347","#ffd700","#32cd32","#87ceeb","#00bfff","#9370db","#ff69b4","#dcdcdc"], ["#ffdab9","#ffffe0","#98fb98","#e0ffff","#87cefa","#e6e6fa","#dda0dd","#ffffff"]] var sHTMLColor="<table id=dropColor"+this.oRenderName+" style=\"z-index:1;display:none;position:absolute;border:#9b95a6 1px solid;cursor:default;background-color:#E9E8F2;padding:2px\" unselectable=on cellpadding=0 cellspacing=0 width=145px><tr><td unselectable=on>" sHTMLColor+="<table align=center cellpadding=0 cellspacing=0 border=0 unselectable=on>"; for(var i=0;i<arrColors.length;i++) { sHTMLColor+="<tr>"; for(var j=0;j<arrColors[i].length;j++) sHTMLColor+="<td onclick=\""+this.oName+".color='"+arrColors[i][j]+"';"+this.oName+".onPickColor();"+this.oName+".currColor='"+arrColors[i][j]+"';"+this.oName+".hideAll()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='#E9E8F2 1px solid'\" style=\"cursor:default;padding:1px;border:#E9E8F2 1px solid;\" unselectable=on>"+ "<table style='margin:0px;width:13px;height:13px;background:"+arrColors[i][j]+";border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td unselectable=on></td></tr>"+ "</table></td>"; sHTMLColor+="</tr>"; } //~~~ custom colors ~~~~ sHTMLColor+="<tr><td colspan=8 id=idCustomColor"+this.oRenderName+"></td></tr>"; //~~~ remove color & more colors ~~~~ sHTMLColor+= "<tr>"; sHTMLColor+= "<td unselectable=on>"+ "<table style='margin-left:1px;width:14px;height:14px;background:#E9E8F2;' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td onclick=\""+this.oName+".onRemoveColor();"+this.oName+".currColor='';"+this.oName+".hideAll()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='white 1px solid'\" style=\"cursor:default;padding:1px;border:white 1px solid;font-family:verdana;font-size:10px;font-color:black;line-height:9px;\" align=center valign=top unselectable=on>x</td></tr>"+ "</table></td>"; sHTMLColor+= "<td colspan=7 unselectable=on>"+ "<table style='margin:1px;width:117px;height:16px;background:#E9E8F2;border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ "<tr><td id='"+this.oName+"moreColTd' onclick=\""+this.oName+".onMoreColor();"+this.oName+".hideAll();modalDialogShow('"+this.url+"?" +this.oName+ "', 442, 380)\" onmouseover=\"this.style.border='#777777 1px solid';this.style.background='#8d9aa7';this.style.color='#ffffff'\" onmouseout=\"this.style.border='#E9E8F2 1px solid';this.style.background='#E9E8F2';this.style.color='#000000'\" style=\"cursor:default;font-family:verdana;font-size:9px;font-color:black;line-height:9px;padding:1px\" align=center valign=top nowrap unselectable=on>"+this.txtMoreColors+"</td></tr>"+ "</table></td>"; sHTMLColor+= "</tr>"; sHTMLColor+= "</table>"; sHTMLColor+="</td></tr></table>"; document.write(sHTMLColor); } function refreshCustomColor() { var arg = eval(dialogArgument[0]); var arg2 = eval(dialogArgument[1]); if(arg.oUtil)//[CUSTOM] this.customColors=arg.oUtil.obj.customColors;//[CUSTOM] (Get from public definition) else //text2.htm [CUSTOM] this.customColors=arg2.oUtil.obj.customColors;//[CUSTOM] (Get from public definition) if(this.customColors.length==0) { document.getElementById("idCustomColor"+this.oRenderName).innerHTML=""; return; } sHTML="<table cellpadding=0 cellspacing=0 width=100%><tr><td colspan=8 style=\"font-family:verdana;font-size:9px;font-color:black;line-height:9px;padding:1\">"+this.txtCustomColors+":</td></tr></table>" sHTML+="<table cellpadding=0 cellspacing=0><tr>"; for(var i=0;i<this.customColors.length;i++) { if(i<22) { if(i==8||i==16||i==24||i==32)sHTML+="</tr></table><table cellpadding=0 cellspacing=0><tr>" sHTML+="<td onclick=\""+this.oName+".color='"+this.customColors[i]+"';"+this.oName+".onPickColor()\" onmouseover=\"this.style.border='#777777 1px solid'\" onmouseout=\"this.style.border='#E9E8F2 1px solid'\" style=\"cursor:default;padding:1px;border:#E9E8F2 1px solid;\" unselectable=on>"+ " <table style='margin:0;width:13;height:13;background:"+this.customColors[i]+";border:white 1px solid' cellpadding=0 cellspacing=0 unselectable=on>"+ " <tr><td unselectable=on></td></tr>"+ " </table>"+ "</td>"; } } sHTML+="</tr></table>"; document.getElementById("idCustomColor"+this.oRenderName).innerHTML=sHTML; } function showColorPicker(oEl) { this.onShow(); this.hideAll(); var box=document.getElementById("dropColor"+this.oRenderName); //remove hilite var allTds = box.getElementsByTagName("TD"); for (var i = 0; i<allTds.length; i++) { allTds[i].style.border="#E9E8F2 1px solid"; if (allTds[i].id==this.oName+"moreColTd") { allTds[i].style.border="#E9E8F2 1px solid"; allTds[i].style.background="#E9E8F2"; allTds[i].style.color="#000000"; } } box.style.display="block"; var nTop=0; var nLeft=0; oElTmp=oEl; while(oElTmp.tagName!="BODY" && oElTmp.tagName!="HTML") { if(oElTmp.style.top!="") nTop+=oElTmp.style.top.substring(1,oElTmp.style.top.length-2)*1; else nTop+=oElTmp.offsetTop; oElTmp = oElTmp.offsetParent; } oElTmp=oEl; while(oElTmp.tagName!="BODY" && oElTmp.tagName!="HTML") { if(oElTmp.style.left!="") nLeft+=oElTmp.style.left.substring(1,oElTmp.style.left.length-2)*1; else nLeft+=oElTmp.offsetLeft; oElTmp=oElTmp.offsetParent; } if(this.align=="left") box.style.left=nLeft; else//right box.style.left=nLeft-143+oEl.offsetWidth; //box.style.top=nTop+1;//[CUSTOM] box.style.top=nTop+1+oEl.offsetHeight;//[CUSTOM] this.isActive=true; this.refreshCustomColor(); } function hideColorPicker() { this.onHide(); var box=document.getElementById("dropColor"+this.oRenderName); box.style.display="none"; this.isActive=false; } function hideColorPickerAll() { for(var i=0;i<arrColorPickerObjects.length;i++) { var box=document.getElementById("dropColor"+eval(arrColorPickerObjects[i]).oRenderName); box.style.display="none"; eval(arrColorPickerObjects[i]).isActive=false; } } function convertHexToDec(hex) { return parseInt(hex,16); } function convertDecToHex(dec) { var tmp = parseInt(dec).toString(16); if(tmp.length == 1) tmp = ("0" +tmp); return tmp;//.toUpperCase(); } function convertDecToHex2(dec) { var tmp = parseInt(dec).toString(16); if(tmp.length == 1) tmp = ("00000" +tmp); if(tmp.length == 2) tmp = ("0000" +tmp); if(tmp.length == 3) tmp = ("000" +tmp); if(tmp.length == 4) tmp = ("00" +tmp); if(tmp.length == 5) tmp = ("0" +tmp); tmp = tmp.substr(4,1) + tmp.substr(5,1) + tmp.substr(2,1) + tmp.substr(3,1) + tmp.substr(0,1) + tmp.substr(1,1) return tmp;//.toUpperCase(); } //input color in format rgb(R,G,B) //ex, return by document.queryCommandValue(forcolor) function extractRGBColor(col) { var re = /rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)/i; if (re.test(col)) { var result = re.exec(col); return convertDecToHex(parseInt(result[1])) + convertDecToHex(parseInt(result[2])) + convertDecToHex(parseInt(result[3])); } return convertDecToHex2(0); }
JavaScript
// htmlArea v3.0 - Copyright (c) 2003-2005 dynarch.com // 2002-2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo/ // // $Id: htmlarea.js,v 1.96 2005/01/20 17:49:04 mishoo Exp $ if (typeof _editor_url == "string") { // Leave exactly one backslash at the end of _editor_url _editor_url = _editor_url.replace(/\x2f*$/, '/'); } else { alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail."); _editor_url = ''; } // make sure we have a language if (typeof _editor_lang == "string") { _editor_lang = _editor_lang.toLowerCase(); } else { _editor_lang = "en"; } // browser identification HTMLArea.agt = navigator.userAgent.toLowerCase(); HTMLArea.is_ie = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1)); HTMLArea.is_opera = (HTMLArea.agt.indexOf("opera") != -1); HTMLArea.is_mac = (HTMLArea.agt.indexOf("mac") != -1); HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac); HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac); HTMLArea.is_gecko = (navigator.product == "Gecko"); // Creates a new HTMLArea object. Tries to replace the textarea with the given // ID with it. function HTMLArea(textarea, config) { if (!HTMLArea._init_called) { alert("Error: You must called HTMLArea.init() first. Like this:\n\n" + "HTMLArea.init();\n" + "HTMLArea.onload = function() {\n" + " var editor = new HTMLArea('editor');\n" + " editor.generate();\n" + "};\n"); return; } if (HTMLArea.checkSupportedBrowser()) { if (typeof config == "undefined") { this.config = new HTMLArea.Config(); } else { this.config = config; } this._htmlArea = null; this._textArea = textarea; this._editMode = "wysiwyg"; this.plugins = {}; this._timerToolbar = null; this._timerUndo = null; this._undoQueue = new Array(this.config.undoSteps); this._undoPos = -1; this._customUndo = false; this._mdoc = document; // cache the document, we need it in plugins this.doctype = ''; } }; HTMLArea.onload = function(){}; HTMLArea._scripts = []; HTMLArea.loadScript = function(url, plugin) { if (plugin) url = HTMLArea.getPluginDir(plugin) + '/' + url; this._scripts.push(url); }; HTMLArea.init = function() { var head = document.getElementsByTagName("head")[0]; var current = 0; var savetitle = document.title; var evt = HTMLArea.is_ie ? "onreadystatechange" : "onload"; function loadNextScript() { if (current > 0 && HTMLArea.is_ie && !/loaded|complete/.test(window.event.srcElement.readyState)) return; if (current < HTMLArea._scripts.length) { var url = HTMLArea._scripts[current++]; document.title = "[HTMLArea: loading script " + current + "/" + HTMLArea._scripts.length + "]"; var script = document.createElement("script"); script.type = "text/javascript"; script.src = url; script[evt] = loadNextScript; head.appendChild(script); } else { document.title = savetitle; HTMLArea._init_called = 1; HTMLArea.onload(); } }; loadNextScript(); }; HTMLArea.loadScript(_editor_url + "dialog.js"); HTMLArea.loadScript(_editor_url + "popupwin.js"); HTMLArea.loadScript(_editor_url + "lang/" + _editor_lang + ".js"); // cache some regexps HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig; HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i; HTMLArea.RE_head = /<head>((.|\n)*?)<\/head>/i; HTMLArea.RE_body = /<body>((.|\n)*?)<\/body>/i; HTMLArea.Config = function () { this.version = "3.0"; this.width = "auto"; this.height = "auto"; // enable creation of a status bar? this.statusBar = true; // intercept ^V and use the HTMLArea paste command // If false, then passes ^V through to browser editor widget this.htmlareaPaste = false; // maximum size of the undo queue this.undoSteps = 20; // the time interval at which undo samples are taken this.undoTimeout = 500; // 1/2 sec. // the next parameter specifies whether the toolbar should be included // in the size or not. this.sizeIncludesToolbar = true; // if true then HTMLArea will retrieve the full HTML, starting with the // <HTML> tag. this.fullPage = false; // style included in the iframe document this.pageStyle = ""; // set to true if you want Word code to be cleaned upon Paste this.killWordOnPaste = true; // enable the 'Target' field in the Make Link dialog this.makeLinkShowsTarget = true; // BaseURL included in the iframe document this.baseURL = document.baseURI || document.URL; if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/)) this.baseURL = RegExp.$1 + "/"; // URL-s this.imgURL = "images/"; this.popupURL = "popups/"; // remove tags (these have to be a regexp, or null if this functionality is not desired) this.htmlRemoveTags = null; /** CUSTOMIZING THE TOOLBAR * ------------------------- * * It is recommended that you customize the toolbar contents in an * external file (i.e. the one calling HTMLArea) and leave this one * unchanged. That's because when we (InteractiveTools.com) release a * new official version, it's less likely that you will have problems * upgrading HTMLArea. */ this.toolbar = [ [ "fontname", "space", "fontsize", "space", "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "forecolor", "hilitecolor", "separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator", "popupeditor", "separator", /* "showhelp", */ "about" ] ]; this.fontname = { "&mdash; font &mdash;": '', "Arial": 'arial,helvetica,sans-serif', "Courier New": 'courier new,courier,monospace', "Georgia": 'georgia,times new roman,times,serif', "Tahoma": 'tahoma,arial,helvetica,sans-serif', "Times New Roman": 'times new roman,times,serif', "Verdana": 'verdana,arial,helvetica,sans-serif', "impact": 'impact', "WingDings": 'wingdings' }; this.fontsize = { "&mdash; size &mdash;" : "", "1 (8 pt)" : "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" }; this.formatblock = { "&mdash; format &mdash;" : "", "Heading 1": "h1", "Heading 2": "h2", "Heading 3": "h3", "Heading 4": "h4", "Heading 5": "h5", "Heading 6": "h6", "Normal" : "p", "Address" : "address", "Formatted": "pre" }; this.customSelects = {}; function cut_copy_paste(e, cmd, obj) { e.execCommand(cmd); }; this.debug = true; // ADDING CUSTOM BUTTONS: please read below! // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]" // - ID: unique ID for the button. If the button calls document.execCommand // it's wise to give it the same name as the called command. // - ACTION: function that gets called when the button is clicked. // it has the following prototype: // function(editor, buttonName) // - editor is the HTMLArea object that triggered the call // - buttonName is the ID of the clicked button // These 2 parameters makes it possible for you to use the same // handler for more HTMLArea objects or for more different buttons. // - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N) // - Icon: path to an icon image file for the button (TODO: use one image for all buttons!) // - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time. this.btnList = { bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ], italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ], underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ], strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ], subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ], superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ], justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ], justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ], justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ], justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ], orderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ], unorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ], outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ], indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ], forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ], hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ], inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ], createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ], insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ], inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ], htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ], popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ], about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ], showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ], undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ], redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ], cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ], copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ], paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ], lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ], righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ], removeformat: [ "Remove formatting", "ed_rmformat.gif", false, function(e) {e.execCommand("removeformat");} ], print: [ "Print document", "ed_print.gif", false, function(e) {e._iframe.contentWindow.print();} ], killword: [ "Clear MSOffice tags", "ed_killword.gif", false, function(e) {e.execCommand("killword");} ] }; /* ADDING CUSTOM BUTTONS * --------------------- * * It is recommended that you add the custom buttons in an external * file and leave this one unchanged. That's because when we * (InteractiveTools.com) release a new official version, it's less * likely that you will have problems upgrading HTMLArea. * * Example on how to add a custom button when you construct the HTMLArea: * * var editor = new HTMLArea("your_text_area_id"); * var cfg = editor.config; // this is the default configuration * cfg.btnList["my-hilite"] = * [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action * "Highlight selection", // tooltip * "my_hilite.gif", // image * false // disabled in text mode * ]; * cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar * * An alternate (also more convenient and recommended) way to * accomplish this is to use the registerButton function below. */ // initialize tooltips from the I18N module and generate correct image path for (var i in this.btnList) { var btn = this.btnList[i]; btn[1] = _editor_url + this.imgURL + btn[1]; if (typeof HTMLArea.I18N.tooltips[i] != "undefined") { btn[0] = HTMLArea.I18N.tooltips[i]; } } }; /** Helper function: register a new button with the configuration. It can be * called with all 5 arguments, or with only one (first one). When called with * only one argument it must be an object with the following properties: id, * tooltip, image, textMode, action. Examples: * * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...}); * 2. config.registerButton({ * id : "my-hilite", // the ID of your button * tooltip : "Hilite text", // the tooltip * image : "my-hilite.gif", // image to be displayed in the toolbar * textMode : false, // disabled in text mode * action : function(editor) { // called when the button is clicked * editor.surroundHTML('<span class="hilite">', '</span>'); * }, * context : "p" // will be disabled if outside a <p> element * }); */ HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) { var the_id; if (typeof id == "string") { the_id = id; } else if (typeof id == "object") { the_id = id.id; } else { alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments"); return false; } // check for existing id if (typeof this.customSelects[the_id] != "undefined") { // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists."); } if (typeof this.btnList[the_id] != "undefined") { // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists."); } switch (typeof id) { case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break; case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break; } }; /** The following helper function registers a dropdown box with the editor * configuration. You still have to add it to the toolbar, same as with the * buttons. Call it like this: * * FIXME: add example */ HTMLArea.Config.prototype.registerDropdown = function(object) { // check for existing id if (typeof this.customSelects[object.id] != "undefined") { // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists."); } if (typeof this.btnList[object.id] != "undefined") { // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists."); } this.customSelects[object.id] = object; }; /** Call this function to remove some buttons/drop-down boxes from the toolbar. * Pass as the only parameter a string containing button/drop-down names * delimited by spaces. Note that the string should also begin with a space * and end with a space. Example: * * config.hideSomeButtons(" fontname fontsize textindicator "); * * It's useful because it's easier to remove stuff from the defaul toolbar than * create a brand new toolbar ;-) */ HTMLArea.Config.prototype.hideSomeButtons = function(remove) { var toolbar = this.toolbar; for (var i = toolbar.length; --i >= 0;) { var line = toolbar[i]; for (var j = line.length; --j >= 0; ) { if (remove.indexOf(" " + line[j] + " ") >= 0) { var len = 1; if (/separator|space/.test(line[j + 1])) { len = 2; } line.splice(j, len); } } } }; /** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */ HTMLArea.replaceAll = function(config) { var tas = document.getElementsByTagName("textarea"); for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate()); }; /** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */ HTMLArea.replace = function(id, config) { var ta = HTMLArea.getElementById("textarea", id); return ta ? (new HTMLArea(ta, config)).generate() : null; }; // Creates the toolbar and appends it to the _htmlarea HTMLArea.prototype._createToolbar = function () { var editor = this; // to access this in nested functions var toolbar = document.createElement("div"); this._toolbar = toolbar; toolbar.className = "toolbar"; toolbar.unselectable = "1"; var tb_row = null; var tb_objects = new Object(); this._toolbarObjects = tb_objects; // creates a new line in the toolbar function newLine() { var table = document.createElement("table"); table.border = "0px"; table.cellSpacing = "0px"; table.cellPadding = "0px"; toolbar.appendChild(table); // TBODY is required for IE, otherwise you don't see anything // in the TABLE. var tb_body = document.createElement("tbody"); table.appendChild(tb_body); tb_row = document.createElement("tr"); tb_body.appendChild(tb_row); }; // END of function: newLine // init first line newLine(); // updates the state of a toolbar element. This function is member of // a toolbar element object (unnamed objects created by createButton or // createSelect functions below). function setButtonStatus(id, newval) { var oldval = this[id]; var el = this.element; if (oldval != newval) { switch (id) { case "enabled": if (newval) { HTMLArea._removeClass(el, "buttonDisabled"); el.disabled = false; } else { HTMLArea._addClass(el, "buttonDisabled"); el.disabled = true; } break; case "active": if (newval) { HTMLArea._addClass(el, "buttonPressed"); } else { HTMLArea._removeClass(el, "buttonPressed"); } break; } this[id] = newval; } }; // END of function: setButtonStatus // this function will handle creation of combo boxes. Receives as // parameter the name of a button as defined in the toolBar config. // This function is called from createButton, above, if the given "txt" // doesn't match a button. function createSelect(txt) { var options = null; var el = null; var cmd = null; var customSelects = editor.config.customSelects; var context = null; var tooltip = ""; switch (txt) { case "fontsize": case "fontname": case "formatblock": // the following line retrieves the correct // configuration option because the variable name // inside the Config object is named the same as the // button/select in the toolbar. For instance, if txt // == "formatblock" we retrieve config.formatblock (or // a different way to write it in JS is // config["formatblock"]. options = editor.config[txt]; cmd = txt; break; default: // try to fetch it from the list of registered selects cmd = txt; var dropdown = customSelects[cmd]; if (typeof dropdown != "undefined") { options = dropdown.options; context = dropdown.context; if (typeof dropdown.tooltip != "undefined") { tooltip = dropdown.tooltip; } } else { alert("ERROR [createSelect]:\nCan't find the requested dropdown definition"); } break; } if (options) { el = document.createElement("select"); el.title = tooltip; var obj = { name : txt, // field name element : el, // the UI element (SELECT) enabled : true, // is it enabled? text : false, // enabled in text mode? cmd : cmd, // command ID state : setButtonStatus, // for changing state context : context }; tb_objects[txt] = obj; for (var i in options) { var op = document.createElement("option"); op.innerHTML = i; op.value = options[i]; el.appendChild(op); } HTMLArea._addEvent(el, "change", function () { editor._comboSelected(el, txt); }); } return el; }; // END of function: createSelect // appends a new button to toolbar function createButton(txt) { // the element that will be created var el = null; var btn = null; switch (txt) { case "separator": el = document.createElement("div"); el.className = "separator"; break; case "space": el = document.createElement("div"); el.className = "space"; break; case "linebreak": newLine(); return false; case "textindicator": el = document.createElement("div"); el.appendChild(document.createTextNode("A")); el.className = "indicator"; el.title = HTMLArea.I18N.tooltips.textindicator; var obj = { name : txt, // the button name (i.e. 'bold') element : el, // the UI element (DIV) enabled : true, // is it enabled? active : false, // is it pressed? text : false, // enabled in text mode? cmd : "textindicator", // the command ID state : setButtonStatus // for changing state }; tb_objects[txt] = obj; break; default: btn = editor.config.btnList[txt]; } if (!el && btn) { el = document.createElement("div"); el.title = btn[0]; el.className = "button"; // let's just pretend we have a button object, and // assign all the needed information to it. var obj = { name : txt, // the button name (i.e. 'bold') element : el, // the UI element (DIV) enabled : true, // is it enabled? active : false, // is it pressed? text : btn[2], // enabled in text mode? cmd : btn[3], // the command ID state : setButtonStatus, // for changing state context : btn[4] || null // enabled in a certain context? }; tb_objects[txt] = obj; // handlers to emulate nice flat toolbar buttons HTMLArea._addEvent(el, "mouseover", function () { if (obj.enabled) { HTMLArea._addClass(el, "buttonHover"); } }); HTMLArea._addEvent(el, "mouseout", function () { if (obj.enabled) with (HTMLArea) { _removeClass(el, "buttonHover"); _removeClass(el, "buttonActive"); (obj.active) && _addClass(el, "buttonPressed"); } }); HTMLArea._addEvent(el, "mousedown", function (ev) { if (obj.enabled) with (HTMLArea) { _addClass(el, "buttonActive"); _removeClass(el, "buttonPressed"); _stopEvent(is_ie ? window.event : ev); } }); // when clicked, do the following: HTMLArea._addEvent(el, "click", function (ev) { if (obj.enabled) with (HTMLArea) { _removeClass(el, "buttonActive"); _removeClass(el, "buttonHover"); obj.cmd(editor, obj.name, obj); _stopEvent(is_ie ? window.event : ev); } }); var img = document.createElement("img"); img.src = btn[1]; img.style.width = "18px"; img.style.height = "18px"; el.appendChild(img); } else if (!el) { el = createSelect(txt); } if (el) { var tb_cell = document.createElement("td"); tb_row.appendChild(tb_cell); tb_cell.appendChild(el); } else { alert("FIXME: Unknown toolbar item: " + txt); } return el; }; var first = true; for (var i = 0; i < this.config.toolbar.length; ++i) { if (!first) { createButton("linebreak"); } else { first = false; } var group = this.config.toolbar[i]; for (var j = 0; j < group.length; ++j) { var code = group[j]; if (/^([IT])\[(.*?)\]/.test(code)) { // special case, create text label var l7ed = RegExp.$1 == "I"; // localized? var label = RegExp.$2; if (l7ed) { label = HTMLArea.I18N.custom[label]; } var tb_cell = document.createElement("td"); tb_row.appendChild(tb_cell); tb_cell.className = "label"; tb_cell.innerHTML = label; } else { createButton(code); } } } this._htmlArea.appendChild(toolbar); }; HTMLArea.prototype._createStatusBar = function() { var statusbar = document.createElement("div"); statusbar.className = "statusBar"; this._htmlArea.appendChild(statusbar); this._statusBar = statusbar; // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": ")); // creates a holder for the path view div = document.createElement("span"); div.className = "statusBarTree"; div.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; this._statusBarTree = div; this._statusBar.appendChild(div); if (!this.config.statusBar) { // disable it... statusbar.style.display = "none"; } }; // Creates the HTMLArea object and replaces the textarea with it. HTMLArea.prototype.generate = function () { var editor = this; // we'll need "this" in some nested functions // get the textarea var textarea = this._textArea; if (typeof textarea == "string") { // it's not element but ID this._textArea = textarea = HTMLArea.getElementById("textarea", textarea); } this._ta_size = { w: textarea.offsetWidth, h: textarea.offsetHeight }; textarea.style.display = "none"; // create the editor framework var htmlarea = document.createElement("div"); htmlarea.className = "htmlarea"; this._htmlArea = htmlarea; // insert the editor before the textarea. textarea.parentNode.insertBefore(htmlarea, textarea); if (textarea.form) { // we have a form, on submit get the HTMLArea content and // update original textarea. var f = textarea.form; if (typeof f.onsubmit == "function") { var funcref = f.onsubmit; if (typeof f.__msh_prevOnSubmit == "undefined") { f.__msh_prevOnSubmit = []; } f.__msh_prevOnSubmit.push(funcref); } f.onsubmit = function() { editor._textArea.value = editor.getHTML(); var a = this.__msh_prevOnSubmit; // call previous submit methods if they were there. if (typeof a != "undefined") { for (var i = a.length; --i >= 0;) { a[i](); } } }; if (typeof f.onreset == "function") { var funcref = f.onreset; if (typeof f.__msh_prevOnReset == "undefined") { f.__msh_prevOnReset = []; } f.__msh_prevOnReset.push(funcref); } f.onreset = function() { editor.setHTML(editor._textArea.value); editor.updateToolbar(); var a = this.__msh_prevOnReset; // call previous reset methods if they were there. if (typeof a != "undefined") { for (var i = a.length; --i >= 0;) { a[i](); } } }; } // add a handler for the "back/forward" case -- on body.unload we save // the HTML content into the original textarea. try { window.onunload = function() { editor._textArea.value = editor.getHTML(); }; } catch(e) {}; // creates & appends the toolbar this._createToolbar(); // create the IFRAME var iframe = document.createElement("iframe"); // workaround for the HTTPS problem // iframe.setAttribute("src", "javascript:void(0);"); iframe.src = _editor_url + "popups/blank.html"; htmlarea.appendChild(iframe); this._iframe = iframe; // creates & appends the status bar, if the case this._createStatusBar(); // remove the default border as it keeps us from computing correctly // the sizes. (somebody tell me why doesn't this work in IE) if (!HTMLArea.is_ie) { iframe.style.borderWidth = "1px"; // iframe.frameBorder = "1"; // iframe.marginHeight = "0"; // iframe.marginWidth = "0"; } // size the IFRAME according to user's prefs or initial textarea var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height); height = parseInt(height); var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width); width = parseInt(width); if (!HTMLArea.is_ie) { height -= 2; width -= 2; } iframe.style.width = width + "px"; if (this.config.sizeIncludesToolbar) { // substract toolbar height height -= this._toolbar.offsetHeight; height -= this._statusBar.offsetHeight; } if (height < 0) { height = 0; } iframe.style.height = height + "px"; // the editor including the toolbar now have the same size as the // original textarea.. which means that we need to reduce that a bit. textarea.style.width = iframe.style.width; textarea.style.height = iframe.style.height; // IMPORTANT: we have to allow Mozilla a short time to recognize the // new frame. Otherwise we get a stupid exception. function initIframe() { var doc = editor._iframe.contentWindow.document; if (!doc) { // Try again.. // FIXME: don't know what else to do here. Normally // we'll never reach this point. if (HTMLArea.is_gecko) { setTimeout(initIframe, 100); return false; } else { alert("ERROR: IFRAME can't be initialized."); } } if (HTMLArea.is_gecko) { // enable editable mode for Mozilla doc.designMode = "on"; } editor._doc = doc; if (!editor.config.fullPage) { doc.open(); var html = "<html>\n"; html += "<head>\n"; if (editor.config.baseURL) html += '<base href="' + editor.config.baseURL + '" />'; html += "<style>" + editor.config.pageStyle + " html,body { border: 0px; }</style>\n"; html += "</head>\n"; html += "<body>\n"; html += editor._textArea.value; html += "</body>\n"; html += "</html>"; doc.write(html); doc.close(); } else { var html = editor._textArea.value; if (html.match(HTMLArea.RE_doctype)) { editor.setDoctype(RegExp.$1); html = html.replace(HTMLArea.RE_doctype, ""); } doc.open(); doc.write(html); doc.close(); } if (HTMLArea.is_ie) { // enable editable mode for IE. For some reason this // doesn't work if done in the same place as for Gecko // (above). doc.body.contentEditable = true; } editor.focusEditor(); // intercept some events; for updating the toolbar & keyboard handlers HTMLArea._addEvents (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"], function (event) { return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event); }); // check if any plugins have registered refresh handlers for (var i in editor.plugins) { var plugin = editor.plugins[i].instance; if (typeof plugin.onGenerate == "function") plugin.onGenerate(); if (typeof plugin.onGenerateOnce == "function") { plugin.onGenerateOnce(); plugin.onGenerateOnce = null; } } setTimeout(function() { editor.updateToolbar(); }, 250); if (typeof editor.onGenerate == "function") editor.onGenerate(); }; setTimeout(initIframe, 100); return this; }; // Switches editor mode; parameter can be "textmode" or "wysiwyg". If no // parameter was passed this function toggles between modes. HTMLArea.prototype.setMode = function(mode) { if (typeof mode == "undefined") { mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode"); } switch (mode) { case "textmode": this._textArea.value = this.getHTML(); this._iframe.style.display = "none"; this._textArea.style.display = "block"; if (this.config.statusBar) { this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"]; } break; case "wysiwyg": if (HTMLArea.is_gecko) { // disable design mode before changing innerHTML try { this._doc.designMode = "off"; } catch(e) {}; } if (!this.config.fullPage) this._doc.body.innerHTML = this.getHTML(); else this.setFullHTML(this.getHTML()); this._iframe.style.display = "block"; this._textArea.style.display = "none"; if (HTMLArea.is_gecko) { // we need to refresh that info for Moz-1.3a try { this._doc.designMode = "on"; } catch(e) {}; } if (this.config.statusBar) { this._statusBar.innerHTML = ''; // this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": ")); this._statusBar.appendChild(this._statusBarTree); } break; default: alert("Mode <" + mode + "> not defined!"); return false; } this._editMode = mode; this.focusEditor(); for (var i in this.plugins) { var plugin = this.plugins[i].instance; if (typeof plugin.onMode == "function") plugin.onMode(mode); } }; HTMLArea.prototype.setFullHTML = function(html) { var save_multiline = RegExp.multiline; RegExp.multiline = true; if (html.match(HTMLArea.RE_doctype)) { this.setDoctype(RegExp.$1); html = html.replace(HTMLArea.RE_doctype, ""); } RegExp.multiline = save_multiline; if (!HTMLArea.is_ie) { if (html.match(HTMLArea.RE_head)) this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1; if (html.match(HTMLArea.RE_body)) this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1; } else { var html_re = /<html>((.|\n)*?)<\/html>/i; html = html.replace(html_re, "$1"); this._doc.open(); this._doc.write(html); this._doc.close(); this._doc.body.contentEditable = true; return true; } }; /*************************************************** * Category: PLUGINS ***************************************************/ // Create the specified plugin and register it with this HTMLArea HTMLArea.prototype.registerPlugin = function() { var plugin = arguments[0]; var args = []; for (var i = 1; i < arguments.length; ++i) args.push(arguments[i]); this.registerPlugin2(plugin, args); }; // this is the variant of the function above where the plugin arguments are // already packed in an array. Externally, it should be only used in the // full-screen editor code, in order to initialize plugins with the same // parameters as in the opener window. HTMLArea.prototype.registerPlugin2 = function(plugin, args) { if (typeof plugin == "string") plugin = eval(plugin); if (typeof plugin == "undefined") { /* FIXME: This should never happen. But why does it do? */ return false; } var obj = new plugin(this, args); if (obj) { var clone = {}; var info = plugin._pluginInfo; for (var i in info) clone[i] = info[i]; clone.instance = obj; clone.args = args; this.plugins[plugin._pluginInfo.name] = clone; } else alert("Can't register plugin " + plugin.toString() + "."); }; // static function that loads the required plugin and lang file, based on the // language loaded already for HTMLArea. You better make sure that the plugin // _has_ that language, otherwise shit might happen ;-) HTMLArea.getPluginDir = function(pluginName) { return _editor_url + "plugins/" + pluginName; }; HTMLArea.loadPlugin = function(pluginName) { var dir = this.getPluginDir(pluginName); var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g, function (str, l1, l2, l3) { return l1 + "-" + l2.toLowerCase() + l3; }).toLowerCase() + ".js"; var plugin_file = dir + "/" + plugin; var plugin_lang = dir + "/lang/" + _editor_lang + ".js"; //document.write("<script type='text/javascript' src='" + plugin_file + "'></script>"); //document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>"); this.loadScript(plugin_file); this.loadScript(plugin_lang); }; HTMLArea.loadStyle = function(style, plugin) { var url = _editor_url || ''; if (typeof plugin != "undefined") { url += "plugins/" + plugin + "/"; } url += style; if (/^\//.test(style)) url = style; var head = document.getElementsByTagName("head")[0]; var link = document.createElement("link"); link.rel = "stylesheet"; link.href = url; head.appendChild(link); //document.write("<style type='text/css'>@import url(" + url + ");</style>"); }; HTMLArea.loadStyle(typeof _editor_css == "string" ? _editor_css : "htmlarea.css"); /*************************************************** * Category: EDITOR UTILITIES ***************************************************/ HTMLArea.prototype.debugTree = function() { var ta = document.createElement("textarea"); ta.style.width = "100%"; ta.style.height = "20em"; ta.value = ""; function debug(indent, str) { for (; --indent >= 0;) ta.value += " "; ta.value += str + "\n"; }; function _dt(root, level) { var tag = root.tagName.toLowerCase(), i; var ns = HTMLArea.is_ie ? root.scopeName : root.prefix; debug(level, "- " + tag + " [" + ns + "]"); for (i = root.firstChild; i; i = i.nextSibling) if (i.nodeType == 1) _dt(i, level + 2); }; _dt(this._doc.body, 0); document.body.appendChild(ta); }; HTMLArea.getInnerText = function(el) { var txt = '', i; for (i = el.firstChild; i; i = i.nextSibling) { if (i.nodeType == 3) txt += i.data; else if (i.nodeType == 1) txt += HTMLArea.getInnerText(i); } return txt; }; HTMLArea.prototype._wordClean = function() { var editor = this, stats = { empty_tags : 0, mso_class : 0, mso_style : 0, mso_xmlel : 0, orig_len : this._doc.body.innerHTML.length, T : (new Date()).getTime() }, stats_txt = { empty_tags : "Empty tags removed: ", mso_class : "MSO class names removed: ", mso_style : "MSO inline style removed: ", mso_xmlel : "MSO XML elements stripped: " }; function showStats() { var txt = "HTMLArea word cleaner stats: \n\n"; for (var i in stats) if (stats_txt[i]) txt += stats_txt[i] + stats[i] + "\n"; txt += "\nInitial document length: " + stats.orig_len + "\n"; txt += "Final document length: " + editor._doc.body.innerHTML.length + "\n"; txt += "Clean-up took " + (((new Date()).getTime() - stats.T) / 1000) + " seconds"; alert(txt); }; function clearClass(node) { var newc = node.className.replace(/(^|\s)mso.*?(\s|$)/ig, ' '); if (newc != node.className) { node.className = newc; if (!/\S/.test(node.className)) { node.removeAttribute("className"); ++stats.mso_class; } } }; function clearStyle(node) { var declarations = node.style.cssText.split(/\s*;\s*/); for (var i = declarations.length; --i >= 0;) if (/^mso|^tab-stops/i.test(declarations[i]) || /^margin\s*:\s*0..\s+0..\s+0../i.test(declarations[i])) { ++stats.mso_style; declarations.splice(i, 1); } node.style.cssText = declarations.join("; "); }; function stripTag(el) { if (HTMLArea.is_ie) el.outerHTML = HTMLArea.htmlEncode(el.innerText); else { var txt = document.createTextNode(HTMLArea.getInnerText(el)); el.parentNode.insertBefore(txt, el); el.parentNode.removeChild(el); } ++stats.mso_xmlel; }; function checkEmpty(el) { if (/^(a|span|b|strong|i|em|font)$/i.test(el.tagName) && !el.firstChild) { el.parentNode.removeChild(el); ++stats.empty_tags; } }; function parseTree(root) { var tag = root.tagName.toLowerCase(), i, next; if ((HTMLArea.is_ie && root.scopeName != 'HTML') || (!HTMLArea.is_ie && /:/.test(tag))) { stripTag(root); return false; } else { clearClass(root); clearStyle(root); for (i = root.firstChild; i; i = next) { next = i.nextSibling; if (i.nodeType == 1 && parseTree(i)) checkEmpty(i); } } return true; }; parseTree(this._doc.body); // showStats(); // this.debugTree(); // this.setHTML(this.getHTML()); // this.setHTML(this.getInnerHTML()); // this.forceRedraw(); this.updateToolbar(); }; HTMLArea.prototype.forceRedraw = function() { this._doc.body.style.visibility = "hidden"; this._doc.body.style.visibility = "visible"; // this._doc.body.innerHTML = this.getInnerHTML(); }; // focuses the iframe window. returns a reference to the editor document. HTMLArea.prototype.focusEditor = function() { switch (this._editMode) { // notice the try { ... } catch block to avoid some rare exceptions in FireFox // (perhaps also in other Gecko browsers). Manual focus by user is required in // case of an error. Somebody has an idea? case "wysiwyg" : try { this._iframe.contentWindow.focus() } catch (e) {} break; case "textmode": try { this._textArea.focus() } catch (e) {} break; default : alert("ERROR: mode " + this._editMode + " is not defined"); } return this._doc; }; // takes a snapshot of the current text (for undo) HTMLArea.prototype._undoTakeSnapshot = function() { ++this._undoPos; if (this._undoPos >= this.config.undoSteps) { // remove the first element this._undoQueue.shift(); --this._undoPos; } // use the fasted method (getInnerHTML); var take = true; var txt = this.getInnerHTML(); if (this._undoPos > 0) take = (this._undoQueue[this._undoPos - 1] != txt); if (take) { this._undoQueue[this._undoPos] = txt; } else { this._undoPos--; } }; HTMLArea.prototype.undo = function() { if (this._undoPos > 0) { var txt = this._undoQueue[--this._undoPos]; if (txt) this.setHTML(txt); else ++this._undoPos; } }; HTMLArea.prototype.redo = function() { if (this._undoPos < this._undoQueue.length - 1) { var txt = this._undoQueue[++this._undoPos]; if (txt) this.setHTML(txt); else --this._undoPos; } }; // updates enabled/disable/active state of the toolbar elements HTMLArea.prototype.updateToolbar = function(noStatus) { var doc = this._doc; var text = (this._editMode == "textmode"); var ancestors = null; if (!text) { ancestors = this.getAllAncestors(); if (this.config.statusBar && !noStatus) { this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear for (var i = ancestors.length; --i >= 0;) { var el = ancestors[i]; if (!el) { // hell knows why we get here; this // could be a classic example of why // it's good to check for conditions // that are impossible to happen ;-) continue; } var a = document.createElement("a"); a.href = "#"; a.el = el; a.editor = this; a.onclick = function() { this.blur(); this.editor.selectNodeContents(this.el); this.editor.updateToolbar(true); return false; }; a.oncontextmenu = function() { // TODO: add context menu here this.blur(); var info = "Inline style:\n\n"; info += this.el.style.cssText.split(/;\s*/).join(";\n"); alert(info); return false; }; var txt = el.tagName.toLowerCase(); a.title = el.style.cssText; if (el.id) { txt += "#" + el.id; } if (el.className) { txt += "." + el.className; } a.appendChild(document.createTextNode(txt)); this._statusBarTree.appendChild(a); if (i != 0) { this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb))); } } } } for (var i in this._toolbarObjects) { var btn = this._toolbarObjects[i]; var cmd = i; var inContext = true; if (btn.context && !text) { inContext = false; var context = btn.context; var attrs = []; if (/(.*)\[(.*?)\]/.test(context)) { context = RegExp.$1; attrs = RegExp.$2.split(","); } context = context.toLowerCase(); var match = (context == "*"); for (var k = 0; k < ancestors.length; ++k) { if (!ancestors[k]) { // the impossible really happens. continue; } if (match || (ancestors[k].tagName.toLowerCase() == context)) { inContext = true; for (var ka = 0; ka < attrs.length; ++ka) { if (!eval("ancestors[k]." + attrs[ka])) { inContext = false; break; } } if (inContext) { break; } } } } btn.state("enabled", (!text || btn.text) && inContext); if (typeof cmd == "function") { continue; } // look-it-up in the custom dropdown boxes var dropdown = this.config.customSelects[cmd]; if ((!text || btn.text) && (typeof dropdown != "undefined")) { dropdown.refresh(this); continue; } switch (cmd) { case "fontname": case "fontsize": case "formatblock": if (!text) try { var value = ("" + doc.queryCommandValue(cmd)).toLowerCase(); if (!value) { btn.element.selectedIndex = 0; break; } // HACK -- retrieve the config option for this // combo box. We rely on the fact that the // variable in config has the same name as // button name in the toolbar. var options = this.config[cmd]; var k = 0; for (var j in options) { // FIXME: the following line is scary. if ((j.toLowerCase() == value) || (options[j].substr(0, value.length).toLowerCase() == value)) { btn.element.selectedIndex = k; throw "ok"; } ++k; } btn.element.selectedIndex = 0; } catch(e) {}; break; case "textindicator": if (!text) { try {with (btn.element.style) { backgroundColor = HTMLArea._makeColor( doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor")); if (/transparent/i.test(backgroundColor)) { // Mozilla backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor")); } color = HTMLArea._makeColor(doc.queryCommandValue("forecolor")); fontFamily = doc.queryCommandValue("fontname"); fontWeight = doc.queryCommandState("bold") ? "bold" : "normal"; fontStyle = doc.queryCommandState("italic") ? "italic" : "normal"; }} catch (e) { // alert(e + "\n\n" + cmd); } } break; case "htmlmode": btn.state("active", text); break; case "lefttoright": case "righttoleft": var el = this.getParentElement(); while (el && !HTMLArea.isBlockElement(el)) el = el.parentNode; if (el) btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr"))); break; default: cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist"); try { btn.state("active", (!text && doc.queryCommandState(cmd))); } catch (e) {} } } // take undo snapshots if (this._customUndo && !this._timerUndo) { this._undoTakeSnapshot(); var editor = this; this._timerUndo = setTimeout(function() { editor._timerUndo = null; }, this.config.undoTimeout); } // check if any plugins have registered refresh handlers for (var i in this.plugins) { var plugin = this.plugins[i].instance; if (typeof plugin.onUpdateToolbar == "function") plugin.onUpdateToolbar(); } }; /** Returns a node after which we can insert other nodes, in the current * selection. The selection is removed. It splits a text node, if needed. */ HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) { if (!HTMLArea.is_ie) { var sel = this._getSelection(); var range = this._createRange(sel); // remove the current selection sel.removeAllRanges(); range.deleteContents(); var node = range.startContainer; var pos = range.startOffset; switch (node.nodeType) { case 3: // Node.TEXT_NODE // we have to split it at the caret position. if (toBeInserted.nodeType == 3) { // do optimized insertion node.insertData(pos, toBeInserted.data); range = this._createRange(); range.setEnd(node, pos + toBeInserted.length); range.setStart(node, pos + toBeInserted.length); sel.addRange(range); } else { node = node.splitText(pos); var selnode = toBeInserted; if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) { selnode = selnode.firstChild; } node.parentNode.insertBefore(toBeInserted, node); this.selectNodeContents(selnode); this.updateToolbar(); } break; case 1: // Node.ELEMENT_NODE var selnode = toBeInserted; if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) { selnode = selnode.firstChild; } node.insertBefore(toBeInserted, node.childNodes[pos]); this.selectNodeContents(selnode); this.updateToolbar(); break; } } else { return null; // this function not yet used for IE <FIXME> } }; // Returns the deepest node that contains both endpoints of the selection. HTMLArea.prototype.getParentElement = function() { var sel = this._getSelection(); var range = this._createRange(sel); if (HTMLArea.is_ie) { switch (sel.type) { case "Text": case "None": // It seems that even for selection of type "None", // there _is_ a parent element and it's value is not // only correct, but very important to us. MSIE is // certainly the buggiest browser in the world and I // wonder, God, how can Earth stand it? return range.parentElement(); case "Control": return range.item(0); default: return this._doc.body; } } else try { var p = range.commonAncestorContainer; if (!range.collapsed && range.startContainer == range.endContainer && range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes()) p = range.startContainer.childNodes[range.startOffset]; /* alert(range.startContainer + ":" + range.startOffset + "\n" + range.endContainer + ":" + range.endOffset); */ while (p.nodeType == 3) { p = p.parentNode; } return p; } catch (e) { return null; } }; // Returns an array with all the ancestor nodes of the selection. HTMLArea.prototype.getAllAncestors = function() { var p = this.getParentElement(); var a = []; while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) { a.push(p); p = p.parentNode; } a.push(this._doc.body); return a; }; // Selects the contents inside the given node HTMLArea.prototype.selectNodeContents = function(node, pos) { this.focusEditor(); this.forceRedraw(); var range; var collapsed = (typeof pos != "undefined"); if (HTMLArea.is_ie) { range = this._doc.body.createTextRange(); range.moveToElementText(node); (collapsed) && range.collapse(pos); range.select(); } else { var sel = this._getSelection(); range = this._doc.createRange(); range.selectNodeContents(node); (collapsed) && range.collapse(pos); sel.removeAllRanges(); sel.addRange(range); } }; /** Call this function to insert HTML code at the current position. It deletes * the selection, if any. */ HTMLArea.prototype.insertHTML = function(html) { var sel = this._getSelection(); var range = this._createRange(sel); if (HTMLArea.is_ie) { range.pasteHTML(html); } else { // construct a new document fragment with the given HTML var fragment = this._doc.createDocumentFragment(); var div = this._doc.createElement("div"); div.innerHTML = html; while (div.firstChild) { // the following call also removes the node from div fragment.appendChild(div.firstChild); } // this also removes the selection var node = this.insertNodeAtSelection(fragment); } }; /** * Call this function to surround the existing HTML code in the selection with * your tags. FIXME: buggy! This function will be deprecated "soon". */ HTMLArea.prototype.surroundHTML = function(startTag, endTag) { var html = this.getSelectedHTML(); // the following also deletes the selection this.insertHTML(startTag + html + endTag); }; /// Retrieve the selected block HTMLArea.prototype.getSelectedHTML = function() { var sel = this._getSelection(); var range = this._createRange(sel); var existing = null; if (HTMLArea.is_ie) { existing = range.htmlText; } else { existing = HTMLArea.getHTML(range.cloneContents(), false, this); } return existing; }; /// Return true if we have some selection HTMLArea.prototype.hasSelectedText = function() { // FIXME: come _on_ mishoo, you can do better than this ;-) return this.getSelectedHTML() != ''; }; HTMLArea.prototype._createLink = function(link) { var editor = this; var outparam = null; if (typeof link == "undefined") { link = this.getParentElement(); if (link) { if (/^img$/i.test(link.tagName)) link = link.parentNode; if (!/^a$/i.test(link.tagName)) link = null; } } if (!link) { var sel = editor._getSelection(); var range = editor._createRange(sel); var compare = 0; if (HTMLArea.is_ie) { compare = range.compareEndPoints("StartToEnd", range); } else { compare = range.compareBoundaryPoints(range.START_TO_END, range); } if (compare == 0) { alert("You need to select some text before creating a link"); return; } outparam = { f_href : '', f_title : '', f_target : '', f_usetarget : editor.config.makeLinkShowsTarget }; } else outparam = { f_href : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"), f_title : link.title, f_target : link.target, f_usetarget : editor.config.makeLinkShowsTarget }; this._popupDialog("link.html", function(param) { if (!param) return false; var a = link; if (!a) try { editor._doc.execCommand("createlink", false, param.f_href); a = editor.getParentElement(); var sel = editor._getSelection(); var range = editor._createRange(sel); if (!HTMLArea.is_ie) { a = range.startContainer; if (!/^a$/i.test(a.tagName)) { a = a.nextSibling; if (a == null) a = range.startContainer.parentNode; } } } catch(e) {} else { var href = param.f_href.trim(); editor.selectNodeContents(a); if (href == "") { editor._doc.execCommand("unlink", false, null); editor.updateToolbar(); return false; } else { a.href = href; } } if (!(a && /^a$/i.test(a.tagName))) return false; a.target = param.f_target.trim(); a.title = param.f_title.trim(); editor.selectNodeContents(a); editor.updateToolbar(); }, outparam); }; // Called when the user clicks on "InsertImage" button. If an image is already // there, it will just modify it's properties. HTMLArea.prototype._insertImage = function(image) { var editor = this; // for nested functions var outparam = null; if (typeof image == "undefined") { image = this.getParentElement(); if (image && !/^img$/i.test(image.tagName)) image = null; } if (image) outparam = { f_base : editor.config.baseURL, f_url : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"), f_alt : image.alt, f_border : image.border, f_align : image.align, f_vert : image.vspace, f_horiz : image.hspace }; this._popupDialog("insert_image.html", function(param) { if (!param) { // user must have pressed Cancel return false; } var img = image; if (!img) { var sel = editor._getSelection(); var range = editor._createRange(sel); editor._doc.execCommand("insertimage", false, param.f_url); if (HTMLArea.is_ie) { img = range.parentElement(); // wonder if this works... if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else { img = range.startContainer.previousSibling; } } else { img.src = param.f_url; } for (var field in param) { var value = param[field]; switch (field) { case "f_alt" : img.alt = value; break; case "f_border" : img.border = parseInt(value || "0"); break; case "f_align" : img.align = value; break; case "f_vert" : img.vspace = parseInt(value || "0"); break; case "f_horiz" : img.hspace = parseInt(value || "0"); break; } } }, outparam); }; // Called when the user clicks the Insert Table button HTMLArea.prototype._insertTable = function() { var sel = this._getSelection(); var range = this._createRange(sel); var editor = this; // for nested functions this._popupDialog("insert_table.html", function(param) { if (!param) { // user must have pressed Cancel return false; } var doc = editor._doc; // create the table element var table = doc.createElement("table"); // assign the given arguments for (var field in param) { var value = param[field]; if (!value) { continue; } switch (field) { case "f_width" : table.style.width = value + param["f_unit"]; break; case "f_align" : table.align = value; break; case "f_border" : table.border = parseInt(value); break; case "f_spacing" : table.cellSpacing = parseInt(value); break; case "f_padding" : table.cellPadding = parseInt(value); break; } } var cellwidth = 0; if (param.f_fixed) cellwidth = Math.floor(100 / parseInt(param.f_cols)); var tbody = doc.createElement("tbody"); table.appendChild(tbody); for (var i = 0; i < param["f_rows"]; ++i) { var tr = doc.createElement("tr"); tbody.appendChild(tr); for (var j = 0; j < param["f_cols"]; ++j) { var td = doc.createElement("td"); if (cellwidth) td.style.width = cellwidth + "%"; tr.appendChild(td); // Mozilla likes to see something inside the cell. (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br")); } } if (HTMLArea.is_ie) { range.pasteHTML(table.outerHTML); } else { // insert the table editor.insertNodeAtSelection(table); } return true; }, null); }; /*************************************************** * Category: EVENT HANDLERS ***************************************************/ // el is reference to the SELECT object // txt is the name of the select field, as in config.toolbar HTMLArea.prototype._comboSelected = function(el, txt) { this.focusEditor(); var value = el.options[el.selectedIndex].value; switch (txt) { case "fontname": case "fontsize": this.execCommand(txt, false, value); break; case "formatblock": (HTMLArea.is_ie) && (value = "<" + value + ">"); this.execCommand(txt, false, value); break; default: // try to look it up in the registered dropdowns var dropdown = this.config.customSelects[txt]; if (typeof dropdown != "undefined") { dropdown.action(this); } else { alert("FIXME: combo box " + txt + " not implemented"); } } }; // the execCommand function (intercepts some commands and replaces them with // our own implementation) HTMLArea.prototype.execCommand = function(cmdID, UI, param) { var editor = this; // for nested functions this.focusEditor(); cmdID = cmdID.toLowerCase(); if (HTMLArea.is_gecko) try { this._doc.execCommand('useCSS', false, true); } catch (e) {}; switch (cmdID) { case "htmlmode" : this.setMode(); break; case "hilitecolor": (HTMLArea.is_ie) && (cmdID = "backcolor"); case "forecolor": this._popupDialog("select_color.html", function(color) { if (color) { // selection not canceled editor._doc.execCommand(cmdID, false, "#" + color); } }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID))); break; case "createlink": this._createLink(); break; case "popupeditor": // this object will be passed to the newly opened window HTMLArea._object = this; if (HTMLArea.is_ie) { //if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"])) { window.open(this.popupURL("fullscreen.html"), "ha_fullscreen", "toolbar=no,location=no,directories=no,status=no,menubar=no," + "scrollbars=no,resizable=yes,width=640,height=480"); } } else { window.open(this.popupURL("fullscreen.html"), "ha_fullscreen", "toolbar=no,menubar=no,personalbar=no,width=640,height=480," + "scrollbars=no,resizable=yes"); } break; case "undo": case "redo": if (this._customUndo) this[cmdID](); else this._doc.execCommand(cmdID, UI, param); break; case "inserttable": this._insertTable(); break; case "insertimage": this._insertImage(); break; case "about" : this._popupDialog("about.html", null, this); break; case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break; case "killword": this._wordClean(); break; case "cut": case "copy": case "paste": try { this._doc.execCommand(cmdID, UI, param); if (this.config.killWordOnPaste) this._wordClean(); } catch (e) { if (HTMLArea.is_gecko) { if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") { HTMLArea.I18N.msg["Moz-Clipboard"] = "Unprivileged scripts cannot access Cut/Copy/Paste programatically " + "for security reasons. Click OK to see a technical note at mozilla.org " + "which shows you how to allow a script to access the clipboard.\n\n" + "[FIXME: please translate this message in your language definition file.]"; } if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"])) window.open("http://mozilla.org/editor/midasdemo/securityprefs.html"); } } break; case "lefttoright": case "righttoleft": var dir = (cmdID == "righttoleft") ? "rtl" : "ltr"; var el = this.getParentElement(); while (el && !HTMLArea.isBlockElement(el)) el = el.parentNode; if (el) { if (el.style.direction == dir) el.style.direction = ""; else el.style.direction = dir; } break; default: try { this._doc.execCommand(cmdID, UI, param); } catch(e) { if (this.config.debug) { alert(e + "\n\nby execCommand(" + cmdID + ");"); } } } this.updateToolbar(); return false; }; /** A generic event handler for things that happen in the IFRAME's document. * This function also handles key bindings. */ HTMLArea.prototype._editorEvent = function(ev) { var editor = this; var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (!HTMLArea.is_ie && ev.type == "keypress"); if (keyEvent) for (var i in editor.plugins) { var plugin = editor.plugins[i].instance; if (typeof plugin.onKeyPress == "function") if (plugin.onKeyPress(ev)) return false; } if (keyEvent && ev.ctrlKey && !ev.altKey) { var sel = null; var range = null; var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase(); var cmd = null; var value = null; switch (key) { case 'a': if (!HTMLArea.is_ie) { // KEY select all sel = this._getSelection(); sel.removeAllRanges(); range = this._createRange(); range.selectNodeContents(this._doc.body); sel.addRange(range); HTMLArea._stopEvent(ev); } break; // simple key commands follow case 'b': cmd = "bold"; break; case 'i': cmd = "italic"; break; case 'u': cmd = "underline"; break; case 's': cmd = "strikethrough"; break; case 'l': cmd = "justifyleft"; break; case 'e': cmd = "justifycenter"; break; case 'r': cmd = "justifyright"; break; case 'j': cmd = "justifyfull"; break; case 'z': cmd = "undo"; break; case 'y': cmd = "redo"; break; case 'v': if (HTMLArea.is_ie || editor.config.htmlareaPaste) { cmd = "paste"; } break; case 'n': cmd = "formatblock"; value = HTMLArea.is_ie ? "<p>" : "p"; break; case '0': cmd = "killword"; break; // headings case '1': case '2': case '3': case '4': case '5': case '6': cmd = "formatblock"; value = "h" + key; if (HTMLArea.is_ie) value = "<" + value + ">"; break; } if (cmd) { // execute simple command this.execCommand(cmd, false, value); HTMLArea._stopEvent(ev); } } else if (keyEvent) { // other keys here switch (ev.keyCode) { case 13: // KEY enter if (HTMLArea.is_gecko && !ev.shiftKey) { this.dom_checkInsertP(); HTMLArea._stopEvent(ev); } break; case 8: // KEY backspace case 46: // KEY delete if (HTMLArea.is_gecko && !ev.shiftKey) { if (this.dom_checkBackspace()) HTMLArea._stopEvent(ev); } else if (HTMLArea.is_ie) { if (this.ie_checkBackspace()) HTMLArea._stopEvent(ev); } break; } } // update the toolbar state after some time if (editor._timerToolbar) { clearTimeout(editor._timerToolbar); } editor._timerToolbar = setTimeout(function() { editor.updateToolbar(); editor._timerToolbar = null; }, 50); }; HTMLArea.prototype.scrollToCaret = function() { var e = this.getParentElement(), w = this._iframe.contentWindow, h = w.innerHeight || w.height, d = this._doc, t = d.documentElement.scrollTop || d.body.scrollTop; if (typeof h == "undefined") return false; if (e.offsetTop > h + t) w.scrollTo(e.offsetLeft, e.offsetTop - h + e.offsetHeight); }; HTMLArea.prototype.convertNode = function(el, newTagName) { var newel = this._doc.createElement(newTagName), p = el.parentNode; while (el.firstChild) newel.appendChild(el.firstChild); p.insertBefore(newel, el); p.removeChild(el); return newel; }; HTMLArea.prototype.ie_checkBackspace = function() { var sel = this._getSelection(); var range = this._createRange(sel); var r2 = range.duplicate(); r2.moveStart("character", -1); var a = r2.parentElement(); if (a != range.parentElement() && /^a$/i.test(a.tagName)) { r2.collapse(true); r2.moveEnd("character", 1); r2.pasteHTML(''); r2.select(); return true; } }; HTMLArea.prototype.dom_checkBackspace = function() { var self = this; setTimeout(function() { var sel = self._getSelection(); var range = self._createRange(sel); var SC = range.startContainer; var SO = range.startOffset; var EC = range.endContainer; var EO = range.endOffset; var newr = SC.nextSibling; if (SC.nodeType == 3) SC = SC.parentNode; if (!/\S/.test(SC.tagName)) { var p = document.createElement("p"); while (SC.firstChild) p.appendChild(SC.firstChild); SC.parentNode.insertBefore(p, SC); SC.parentNode.removeChild(SC); var r = range.cloneRange(); r.setStartBefore(newr); r.setEndAfter(newr); r.extractContents(); sel.removeAllRanges(); sel.addRange(r); } }, 10); }; HTMLArea.prototype.dom_checkInsertP = function() { var i, SC, left, right, r2, sel = this._getSelection(), r = this._createRange(sel), p = this.getAllAncestors(), block = null, doc = this._doc, body = doc.body; for (i = 0; i < p.length; ++i) if (HTMLArea.isBlockElement(p[i]) && !/body|html/i.test(p[i].tagName)) { block = p[i]; break; } if (!r.collapsed) r.deleteContents(); sel.removeAllRanges(); SC = r.startContainer; if (!block) { left = SC; for (i = SC; i && i != body && !HTMLArea.isBlockElement(i); i = HTMLArea.getPrevNode(i)) left = i; right = SC; for (i = SC; i && i != body && !HTMLArea.isBlockElement(i); i = HTMLArea.getNextNode(i)) right = i; if (left != body && right != body) { r2 = r.cloneRange(); r2.setStartBefore(left); r2.surroundContents(block = doc.createElement("p")); if (!/\S/.test(HTMLArea.getInnerText(block))) block.innerHTML = "<br />"; block.normalize(); r.setEndAfter(right); r.surroundContents(block = doc.createElement("p")); if (!/\S/.test(HTMLArea.getInnerText(block))) block.innerHTML = "<br />"; block.normalize(); } else { r = doc.createRange(); r.setStart(body, 0); r.setEnd(body, 0); r.insertNode(block = doc.createElement("p")); block.innerHTML = "<br />"; } r.selectNodeContents(block); } else { r.setEndAfter(block); var df = r.extractContents(), left_empty = false; if (!/\S/.test(block.innerHTML)) { block.innerHTML = "<br />"; left_empty = true; } p = df.firstChild; if (p) { if (!/\S/.test(HTMLArea.getInnerText(p))) { if (/^h[1-6]$/i.test(p.tagName)) p = this.convertNode(p, "p"); p.innerHTML = "<br />"; } if (/^li$/i.test(p.tagName) && left_empty && !block.nextSibling) { left = block.parentNode; left.removeChild(block); r.setEndAfter(left); r.collapse(false); p = this.convertNode(p, /^[uo]l$/i.test(left.parentNode.tagName) ? "li" : "p"); } r.insertNode(df); r.selectNodeContents(p); } } r.collapse(true); sel.addRange(r); this.forceRedraw(); this.scrollToCaret(); }; // retrieve the HTML HTMLArea.prototype.getHTML = function() { switch (this._editMode) { case "wysiwyg" : if (!this.config.fullPage) { return HTMLArea.getHTML(this._doc.body, false, this); } else return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this); case "textmode" : return this._textArea.value; default : alert("Mode <" + mode + "> not defined!"); } return false; }; // retrieve the HTML (fastest version, but uses innerHTML) HTMLArea.prototype.getInnerHTML = function() { switch (this._editMode) { case "wysiwyg" : if (!this.config.fullPage) return this._doc.body.innerHTML; else return this.doctype + "\n" + this._doc.documentElement.innerHTML; case "textmode" : return this._textArea.value; default : alert("Mode <" + mode + "> not defined!"); } return false; }; // completely change the HTML inside HTMLArea.prototype.setHTML = function(html) { switch (this._editMode) { case "wysiwyg" : if (!this.config.fullPage) this._doc.body.innerHTML = html; else // this._doc.documentElement.innerHTML = html; this._doc.body.innerHTML = html; break; case "textmode" : this._textArea.value = html; break; default : alert("Mode <" + mode + "> not defined!"); } return false; }; // sets the given doctype (useful when config.fullPage is true) HTMLArea.prototype.setDoctype = function(doctype) { this.doctype = doctype; }; /*************************************************** * Category: UTILITY FUNCTIONS ***************************************************/ // variable used to pass the object to the popup editor window. HTMLArea._object = null; // function that returns a clone of the given object HTMLArea.cloneObject = function(obj) { if (!obj) return null; var newObj = new Object; // check for array objects if (obj.constructor.toString().indexOf("function Array(") == 1) { newObj = obj.constructor(); } // check for function objects (as usual, IE is fucked up) if (obj.constructor.toString().indexOf("function Function(") == 1) { newObj = obj; // just copy reference to it } else for (var n in obj) { var node = obj[n]; if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); } else { newObj[n] = node; } } return newObj; }; // FIXME!!! this should return false for IE < 5.5 HTMLArea.checkSupportedBrowser = function() { if (HTMLArea.is_gecko) { if (navigator.productSub < 20021201) { alert("You need at least Mozilla-1.3 Alpha.\n" + "Sorry, your Gecko is not supported."); return false; } if (navigator.productSub < 20030210) { alert("Mozilla < 1.3 Beta is not supported!\n" + "I'll try, though, but it might not work."); } } return HTMLArea.is_gecko || HTMLArea.is_ie; }; // selection & ranges // returns the current selection object HTMLArea.prototype._getSelection = function() { if (HTMLArea.is_ie) { return this._doc.selection; } else { return this._iframe.contentWindow.getSelection(); } }; // returns a range for the current selection HTMLArea.prototype._createRange = function(sel) { if (HTMLArea.is_ie) { return sel.createRange(); } else { this.focusEditor(); if (typeof sel != "undefined") { try { return sel.getRangeAt(0); } catch(e) { return this._doc.createRange(); } } else { return this._doc.createRange(); } } }; // event handling HTMLArea._addEvent = function(el, evname, func) { if (HTMLArea.is_ie) { el.attachEvent("on" + evname, func); } else { el.addEventListener(evname, func, true); } }; HTMLArea._addEvents = function(el, evs, func) { for (var i = evs.length; --i >= 0;) { HTMLArea._addEvent(el, evs[i], func); } }; HTMLArea._removeEvent = function(el, evname, func) { if (HTMLArea.is_ie) { el.detachEvent("on" + evname, func); } else { el.removeEventListener(evname, func, true); } }; HTMLArea._removeEvents = function(el, evs, func) { for (var i = evs.length; --i >= 0;) { HTMLArea._removeEvent(el, evs[i], func); } }; HTMLArea._stopEvent = function(ev) { if (HTMLArea.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } }; HTMLArea._removeClass = function(el, className) { if (!(el && el.className)) { return; } var cls = el.className.split(" "); var ar = new Array(); for (var i = cls.length; i > 0;) { if (cls[--i] != className) { ar[ar.length] = cls[i]; } } el.className = ar.join(" "); }; HTMLArea._addClass = function(el, className) { // remove the class first, if already there HTMLArea._removeClass(el, className); el.className += " " + className; }; HTMLArea._hasClass = function(el, className) { if (!(el && el.className)) { return false; } var cls = el.className.split(" "); for (var i = cls.length; i > 0;) { if (cls[--i] == className) { return true; } } return false; }; HTMLArea._blockTags = " body form textarea fieldset ul ol dl li div " + "p h1 h2 h3 h4 h5 h6 quote pre table thead " + "tbody tfoot tr td iframe address "; HTMLArea.isBlockElement = function(el) { return el && el.nodeType == 1 && (HTMLArea._blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); }; HTMLArea._closingTags = " head script style div span tr td tbody table em strong b i code cite dfn abbr acronym font a title "; HTMLArea.needsClosingTag = function(el) { return el && el.nodeType == 1 && (HTMLArea._closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); }; // performs HTML encoding of some given string HTMLArea.htmlEncode = function(str) { // we don't need regexp for that, but.. so be it for now. str = str.replace(/&/ig, "&amp;"); str = str.replace(/</ig, "&lt;"); str = str.replace(/>/ig, "&gt;"); str = str.replace(/\x22/ig, "&quot;"); // \x22 means '"' -- we use hex reprezentation so that we don't disturb // JS compressors (well, at least mine fails.. ;) return str; }; // Retrieves the HTML code from the given node. This is a replacement for // getting innerHTML, using standard DOM calls. // Wrapper catch a Mozilla-Exception with non well formed html source code HTMLArea.getHTML = function(root, outputRoot, editor){ try{ return HTMLArea.getHTMLWrapper(root,outputRoot,editor); } catch(e){ alert('Your Document is not well formed. Check JavaScript console for details.'); return editor._iframe.contentWindow.document.body.innerHTML; } } HTMLArea.getHTMLWrapper = function(root, outputRoot, editor) { var html = ""; switch (root.nodeType) { case 1: // Node.ELEMENT_NODE case 11: // Node.DOCUMENT_FRAGMENT_NODE var closed; var i; var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : ''; if (root_tag == 'br' && !root.nextSibling) break; if (outputRoot) outputRoot = !(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(root_tag)); if (HTMLArea.is_ie && root_tag == "head") { if (outputRoot) html += "<head>"; // lowercasize var save_multiline = RegExp.multiline; RegExp.multiline = true; var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) { return p1 + p2.toLowerCase(); }); RegExp.multiline = save_multiline; html += txt; if (outputRoot) html += "</head>"; break; } else if (outputRoot) { closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root))); html = "<" + root.tagName.toLowerCase(); var attrs = root.attributes; for (i = 0; i < attrs.length; ++i) { var a = attrs.item(i); if (!a.specified) { continue; } var name = a.nodeName.toLowerCase(); if (/_moz_editor_bogus_node/.test(name)) { html = ""; break; } if (/_moz|contenteditable|_msh/.test(name)) { // avoid certain attributes continue; } var value; if (name != "style") { // IE5.5 reports 25 when cellSpacing is // 1; other values might be doomed too. // For this reason we extract the // values directly from the root node. // I'm starting to HATE JavaScript // development. Browser differences // suck. // // Using Gecko the values of href and src are converted to absolute links // unless we get them using nodeValue() if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src" && !/^on/.test(name)) { value = root[a.nodeName]; } else { value = a.nodeValue; // IE seems not willing to return the original values - it converts to absolute // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href") // So we have to strip the baseurl manually :-/ if (HTMLArea.is_ie && (name == "href" || name == "src")) { value = editor.stripBaseURL(value); } } } else { // IE fails to put style in attributes list // FIXME: cssText reported by IE is UPPERCASE value = root.style.cssText; } if (/(_moz|^$)/.test(value)) { // Mozilla reports some special tags // here; we don't need them. continue; } html += " " + name + '="' + value + '"'; } if (html != "") { html += closed ? " />" : ">"; } } for (i = root.firstChild; i; i = i.nextSibling) { html += HTMLArea.getHTMLWrapper(i, true, editor); } if (outputRoot && !closed) { html += "</" + root.tagName.toLowerCase() + ">"; } break; case 3: // Node.TEXT_NODE // If a text node is alone in an element and all spaces, replace it with an non breaking one // This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element /* if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = '&nbsp;'; else */ html = /^script|style$/i.test(root.parentNode.tagName) ? root.data : HTMLArea.htmlEncode(root.data); break; case 4: // Node.CDATA_SECTION_NODE // FIXME: it seems we never get here, but I believe we should.. // maybe a browser problem?--CDATA sections are converted to plain text nodes and normalized // CDATA sections should go "as is" without further encoding html = "<![CDATA[" + root.data + "]]>"; break; case 8: // Node.COMMENT_NODE html = "<!--" + root.data + "-->"; break; // skip comments, for now. } return html; }; HTMLArea.getPrevNode = function(node) { if (!node) return null; if (node.previousSibling) return node.previousSibling; if (node.parentNode) return node.parentNode; return null; }; HTMLArea.getNextNode = function(node) { if (!node) return null; if (node.nextSibling) return node.nextSibling; if (node.parentNode) return node.parentNode; return null; }; HTMLArea.prototype.stripBaseURL = function(string) { var baseurl = this.config.baseURL; // strip to last directory in case baseurl points to a file baseurl = baseurl.replace(/[^\/]+$/, ''); var basere = new RegExp(baseurl); string = string.replace(basere, ""); // strip host-part of URL which is added by MSIE to links relative to server root baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1'); basere = new RegExp(baseurl); return string.replace(basere, ""); }; String.prototype.trim = function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }; // creates a rgb-style color from a number HTMLArea._makeColor = function(v) { if (typeof v != "number") { // already in rgb (hopefully); IE doesn't get here. return v; } // IE sends number; convert to rgb. var r = v & 0xFF; var g = (v >> 8) & 0xFF; var b = (v >> 16) & 0xFF; return "rgb(" + r + "," + g + "," + b + ")"; }; // returns hexadecimal color representation from a number or a rgb-style color. HTMLArea._colorToRgb = function(v) { if (!v) return ''; // returns the hex representation of one byte (2 digits) function hex(d) { return (d < 16) ? ("0" + d.toString(16)) : d.toString(16); }; if (typeof v == "number") { // we're talking to IE here var r = v & 0xFF; var g = (v >> 8) & 0xFF; var b = (v >> 16) & 0xFF; return "#" + hex(r) + hex(g) + hex(b); } if (v.substr(0, 3) == "rgb") { // in rgb(...) form -- Mozilla var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/; if (v.match(re)) { var r = parseInt(RegExp.$1); var g = parseInt(RegExp.$2); var b = parseInt(RegExp.$3); return "#" + hex(r) + hex(g) + hex(b); } // doesn't match RE?! maybe uses percentages or float numbers // -- FIXME: not yet implemented. return null; } if (v.substr(0, 1) == "#") { // already hex rgb (hopefully :D ) return v; } // if everything else fails ;) return null; }; // modal dialogs for Mozilla (for IE we're using the showModalDialog() call). // receives an URL to the popup dialog and a function that receives one value; // this function will get called after the dialog is closed, with the return // value of the dialog. HTMLArea.prototype._popupDialog = function(url, action, init) { Dialog(this.popupURL(url), action, init); }; // paths HTMLArea.prototype.imgURL = function(file, plugin) { if (typeof plugin == "undefined") return _editor_url + file; else return _editor_url + "plugins/" + plugin + "/img/" + file; }; HTMLArea.prototype.popupURL = function(file) { var url = ""; if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) { var plugin = RegExp.$1; var popup = RegExp.$2; if (!/\.html$/.test(popup)) popup += ".html"; url = _editor_url + "plugins/" + plugin + "/popups/" + popup; } else url = _editor_url + this.config.popupURL + file; return url; }; /** * FIX: Internet Explorer returns an item having the _name_ equal to the given * id, even if it's not having any id. This way it can return a different form * field even if it's not a textarea. This workarounds the problem by * specifically looking to search only elements having a certain tag name. */ HTMLArea.getElementById = function(tag, id) { var el, i, objs = document.getElementsByTagName(tag); for (i = objs.length; --i >= 0 && (el = objs[i]);) if (el.id == id) return el; return null; }; // EOF // Local variables: // // c-basic-offset:8 // // indent-tabs-mode:t // // End: //
JavaScript
// I18N constants // LANG: "it", ENCODING: UTF-8 | ISO-8859-1 // Author: Fabio Rotondo <fabio@rotondo.it> // Update for 3.0 rc1: Giovanni Premuda <gpremuda@softwerk.it> HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "it", tooltips: { bold: "Grassetto", italic: "Corsivo", underline: "Sottolineato", strikethrough: "Barrato", subscript: "Pedice", superscript: "Apice", justifyleft: "Allinea a sinistra", justifycenter: "Allinea in centro", justifyright: "Allinea a destra", justifyfull: "Giustifica", insertorderedlist: "Lista ordinata", insertunorderedlist: "Lista puntata", outdent: "Decrementa indentazione", indent: "Incrementa indentazione", forecolor: "Colore del carattere", hilitecolor: "Colore di sfondo", inserthorizontalrule: "Linea orizzontale", createlink: "Inserisci un link", insertimage: "Inserisci un'immagine", inserttable: "Inserisci una tabella", htmlmode: "Visualizzazione HTML", popupeditor: "Editor a pieno schermo", about: "Info sull'editor", showhelp: "Aiuto sull'editor", textindicator: "Stile corrente", undo: "Annulla", redo: "Ripristina", cut: "Taglia", copy: "Copia", paste: "Incolla", lefttoright: "Scrivi da sinistra a destra", righttoleft: "Scrivi da destra a sinistra" }, buttons: { "ok": "OK", "cancel": "Annulla" }, msg: { "Path": "Percorso", "TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG.", "IE-sucks-full-screen" : // translate here "The full screen mode is known to cause problems with Internet Explorer, " + "due to browser bugs that we weren't able to workaround. You might experience garbage " + "display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " + "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" + "You have been warned. Please press OK if you still want to try the full screen editor." }, dialogs: { "Annulla" : "Cancel", "Inserisci/modifica Link" : "Insert/Modify Link", "Nuova finestra (_blank)" : "New window (_blank)", "Nessuno (usa predefinito)" : "None (use implicit)", "OK" : "OK", "Altro" : "Other", "Stessa finestra (_self)" : "Same frame (_self)", "Target:" : "Target:", "Title (suggerimento):" : "Title (tooltip):", "Frame principale (_top)" : "Top frame (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Devi inserire un indirizzo per questo link" } };
JavaScript
// I18N constants // LANG: "hu", ENCODING: UTF-8 // Author: Miklós Somogyi, <somogyine@vnet.hu> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "hu", tooltips: { bold: "Félkövér", italic: "Dőlt", underline: "Aláhúzott", strikethrough: "Áthúzott", subscript: "Alsó index", superscript: "Felső index", justifyleft: "Balra zárt", justifycenter: "Középre zárt", justifyright: "Jobbra zárt", justifyfull: "Sorkizárt", orderedlist: "Számozott lista", unorderedlist: "Számozatlan lista", outdent: "Behúzás csökkentése", indent: "Behúzás növelése", forecolor: "Karakterszín", hilitecolor: "Háttérszín", horizontalrule: "Elválasztó vonal", createlink: "Hiperhivatkozás beszúrása", insertimage: "Kép beszúrása", inserttable: "Táblázat beszúrása", htmlmode: "HTML forrás be/ki", popupeditor: "Szerkesztő külön ablakban", about: "Névjegy", showhelp: "Súgó", textindicator: "Aktuális stílus", undo: "Visszavonás", redo: "Újra végrehajtás", cut: "Kivágás", copy: "Másolás", paste: "Beillesztés", lefttoright: "Irány balról jobbra", righttoleft: "Irány jobbról balra" }, buttons: { "ok": "Rendben", "cancel": "Mégsem" }, msg: { "Path": "Hierarchia", "TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb", "IE-sucks-full-screen" : // translate here "A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, " + "ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, " + "illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. " + "Windows 9x operaciós futtatása esetén elég valószínű, hogy 'General Protection Fault' " + "hibát okoz és újra kell indítania a számítógépet.\n\n" + "Figyelmeztettük. Kérjük nyomja meg a Rendben gombot, ha mégis szeretné megnyitni a " + "szerkesztőt külön ablakban." }, dialogs: { "Cancel" : "Mégsem", "Insert/Modify Link" : "Hivatkozás Beszúrása/Módosítása", "New window (_blank)" : "Új ablak (_blank)", "None (use implicit)" : "Nincs (use implicit)", "OK" : "OK", "Other" : "Más", "Same frame (_self)" : "Ugyanabba a keretbe (_self)", "Target:" : "Cél:", "Title (tooltip):" : "Cím (tooltip):", "Top frame (_top)" : "Felső keret (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Be kell írnia az URL-t, ahova a hivatkozás mutasson" } };
JavaScript
// I18N constants -- Japanese UTF-8 // by Manabu Onoue -- tmocsys@tmocsys.com HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "ja-utf8", tooltips: { bold: "太字", italic: "斜体", underline: "下線", strikethrough: "打ち消し線", subscript: "下付き添え字", superscript: "上付き添え字", justifyleft: "左寄せ", justifycenter: "中央寄せ", justifyright: "右寄せ", justifyfull: "均等割付", orderedlist: "番号付き箇条書き", unorderedlist: "記号付き箇条書き", outdent: "インデント解除", indent: "インデント設定", forecolor: "文字色", backcolor: "背景色", horizontalrule: "水平線", createlink: "リンク作成", insertimage: "画像挿入", inserttable: "テーブル挿入", htmlmode: "HTML表示切替", popupeditor: "エディタ拡大", about: "バージョン情報", help: "ヘルプ", textindicator: "現在のスタイル" } };
JavaScript
// I18N constants -- Japanese JIS // by Manabu Onoue -- tmocsys@tmocsys.com HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "ja-jis", tooltips: { bold: "$BB@;z(B", italic: "$B<PBN(B", underline: "$B2<@~(B", strikethrough: "$BBG$A>C$7@~(B", subscript: "$B2<IU$-E:$(;z(B", superscript: "$B>eIU$-E:$(;z(B", justifyleft: "$B:84s$;(B", justifycenter: "$BCf1{4s$;(B", justifyright: "$B1&4s$;(B", justifyfull: "$B6QEy3dIU(B", orderedlist: "$BHV9fIU$-2U>r=q$-(B", unorderedlist: "$B5-9fIU$-2U>r=q$-(B", outdent: "$B%$%s%G%s%H2r=|(B", indent: "$B%$%s%G%s%H@_Dj(B", forecolor: "$BJ8;z?'(B", backcolor: "$BGX7J?'(B", horizontalrule: "$B?eJ?@~(B", createlink: "$B%j%s%/:n@.(B", insertimage: "$B2hA|A^F~(B", inserttable: "$B%F!<%V%kA^F~(B", htmlmode: "HTML$BI=<(@ZBX(B", popupeditor: "$B%(%G%#%?3HBg(B", about: "$B%P!<%8%g%s>pJs(B", help: "$B%X%k%W(B", textindicator: "$B8=:_$N%9%?%$%k(B" } };
JavaScript
// I18N constants // LANG: "ru", ENCODING: UTF-8 | ISO-8859-1 // Author: Yulya Shtyryakova, <yulya@vdcom.ru> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "ru", tooltips: { bold: "Полужирный", italic: "Наклонный", underline: "Подчеркнутый", strikethrough: "Перечеркнутый", subscript: "Нижний индекс", superscript: "Верхний индекс", justifyleft: "По левому краю", justifycenter: "По центру", justifyright: "По правому краю", justifyfull: "По ширине", orderedlist: "Нумерованный лист", unorderedlist: "Маркированный лист", outdent: "Уменьшить отступ", indent: "Увеличить отступ", forecolor: "Цвет шрифта", hilitecolor: "Цвет фона", horizontalrule: "Горизонтальный разделитель", createlink: "Вставить гиперссылку", insertimage: "Вставить изображение", inserttable: "Вставить таблицу", htmlmode: "Показать Html-код", popupeditor: "Увеличить редактор", about: "О редакторе", showhelp: "Помощь", textindicator: "Текущий стиль", undo: "Отменить", redo: "Повторить", cut: "Вырезать", copy: "Копировать", paste: "Вставить" }, buttons: { "ok": "OK", "cancel": "Отмена" }, msg: { "Path": "Путь", "TEXT_MODE": "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим." } };
JavaScript
// I18N constants // LANG: "cz", ENCODING: UTF-8 | ISO-8859-2 // Author: Jiri Löw, <jirilow@jirilow.com> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "cz", tooltips: { bold: "Tučně", italic: "Kurzíva", underline: "Podtržení", strikethrough: "Přeškrtnutí", subscript: "Dolní index", superscript: "Horní index", justifyleft: "Zarovnat doleva", justifycenter: "Na střed", justifyright: "Zarovnat doprava", justifyfull: "Zarovnat do stran", orderedlist: "Seznam", unorderedlist: "Odrážky", outdent: "Předsadit", indent: "Odsadit", forecolor: "Barva písma", hilitecolor: "Barva pozadí", horizontalrule: "Vodorovná čára", createlink: "Vložit odkaz", insertimage: "Vložit obrázek", inserttable: "Vložit tabulku", htmlmode: "Přepnout HTML", popupeditor: "Nové okno editoru", about: "O této aplikaci", showhelp: "Nápověda aplikace", textindicator: "Zvolený styl", undo: "Vrátí poslední akci", redo: "Opakuje poslední akci", cut: "Vyjmout", copy: "Kopírovat", paste: "Vložit" }, buttons: { "ok": "OK", "cancel": "Zrušit" }, msg: { "Path": "Cesta", "TEXT_MODE": "Jste v TEXTOVÉM REŽIMU. Použijte tlačítko [<>] pro přepnutí do WYSIWIG." } };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "en", tooltips: { bold: "Bold", italic: "Italic", underline: "Underline", strikethrough: "Strikethrough", subscript: "Subscript", superscript: "Superscript", justifyleft: "Justify Left", justifycenter: "Justify Center", justifyright: "Justify Right", justifyfull: "Justify Full", orderedlist: "Ordered List", unorderedlist: "Bulleted List", outdent: "Decrease Indent", indent: "Increase Indent", forecolor: "Font Color", hilitecolor: "Background Color", horizontalrule: "Horizontal Rule", createlink: "Insert Web Link", insertimage: "Insert/Modify Image", inserttable: "Insert Table", htmlmode: "Toggle HTML Source", popupeditor: "Enlarge Editor", about: "About this editor", showhelp: "Help using editor", textindicator: "Current style", undo: "Undoes your last action", redo: "Redoes your last action", cut: "Cut selection", copy: "Copy selection", paste: "Paste from clipboard", lefttoright: "Direction left to right", righttoleft: "Direction right to left", removeformat: "Remove formatting", print: "Print document", killword: "Clear MSOffice tags" }, buttons: { "ok": "OK", "cancel": "Cancel" }, msg: { "Path": "Path", "TEXT_MODE": "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.", "IE-sucks-full-screen" : // translate here "The full screen mode is known to cause problems with Internet Explorer, " + "due to browser bugs that we weren't able to workaround. You might experience garbage " + "display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " + "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" + "You have been warned. Please press OK if you still want to try the full screen editor.", "Moz-Clipboard" : "Unprivileged scripts cannot access Cut/Copy/Paste programatically " + "for security reasons. Click OK to see a technical note at mozilla.org " + "which shows you how to allow a script to access the clipboard." }, dialogs: { // Common "OK" : "OK", "Cancel" : "Cancel", "Alignment:" : "Alignment:", "Not set" : "Not set", "Left" : "Left", "Right" : "Right", "Texttop" : "Texttop", "Absmiddle" : "Absmiddle", "Baseline" : "Baseline", "Absbottom" : "Absbottom", "Bottom" : "Bottom", "Middle" : "Middle", "Top" : "Top", "Layout" : "Layout", "Spacing" : "Spacing", "Horizontal:" : "Horizontal:", "Horizontal padding" : "Horizontal padding", "Vertical:" : "Vertical:", "Vertical padding" : "Vertical padding", "Border thickness:" : "Border thickness:", "Leave empty for no border" : "Leave empty for no border", // Insert Link "Insert/Modify Link" : "Insert/Modify Link", "None (use implicit)" : "None (use implicit)", "New window (_blank)" : "New window (_blank)", "Same frame (_self)" : "Same frame (_self)", "Top frame (_top)" : "Top frame (_top)", "Other" : "Other", "Target:" : "Target:", "Title (tooltip):" : "Title (tooltip):", "URL:" : "URL:", "You must enter the URL where this link points to" : "You must enter the URL where this link points to", // Insert Table "Insert Table" : "Insert Table", "Rows:" : "Rows:", "Number of rows" : "Number of rows", "Cols:" : "Cols:", "Number of columns" : "Number of columns", "Width:" : "Width:", "Width of the table" : "Width of the table", "Percent" : "Percent", "Pixels" : "Pixels", "Em" : "Em", "Width unit" : "Width unit", "Positioning of this table" : "Positioning of this table", "Cell spacing:" : "Cell spacing:", "Space between adjacent cells" : "Space between adjacent cells", "Cell padding:" : "Cell padding:", "Space between content and border in cell" : "Space between content and border in cell", // Insert Image "Insert Image" : "Insert Image", "Image URL:" : "Image URL:", "Enter the image URL here" : "Enter the image URL here", "Preview" : "Preview", "Preview the image in a new window" : "Preview the image in a new window", "Alternate text:" : "Alternate text:", "For browsers that don't support images" : "For browsers that don't support images", "Positioning of this image" : "Positioning of this image", "Image Preview:" : "Image Preview:" } };
JavaScript
// I18N constants // LANG: "lt", ENCODING: UTF-8 // Author: Jaroslav Šatkevič, <jaro@akl.lt> HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "en", tooltips: { bold: "Paryškinti", italic: "Kursyvas", underline: "Pabraukti", strikethrough: "Perbraukti", subscript: "Apatinis indeksas", superscript: "Viršutinis indeksas", justifyleft: "Lygiavimas pagal kairę", justifycenter: "Lygiavimas pagal centrą", justifyright: "Lygiavimas pagal dešinę", justifyfull: "Lygiuoti pastraipą", orderedlist: "Numeruotas sąrašas", unorderedlist: "Suženklintas sąrašas", outdent: "Sumažinti paraštę", indent: "Padidinti paraštę", forecolor: "Šrifto spalva", hilitecolor: "Fono spalva", horizontalrule: "Horizontali linija", createlink: "Įterpti nuorodą", insertimage: "Įterpti paveiksliuką", inserttable: "Įterpti lentelę", htmlmode: "Perjungti į HTML/WYSIWYG", popupeditor: "Išplėstas redagavimo ekranas/Enlarge Editor", about: "Apie redaktorių", showhelp: "Pagalba naudojant redaktorių", textindicator: "Dabartinis stilius", undo: "Atšaukia paskutini jūsų veiksmą", redo: "Pakartoja paskutinį atšauktą jūsų veiksmą", cut: "Iškirpti", copy: "Kopijuoti", paste: "Įterpti" }, buttons: { "ok": "OK", "cancel": "Atšaukti" }, msg: { "Path": "Kelias", "TEXT_MODE": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG.", "IE-sucks-full-screen" : // translate here "The full screen mode is known to cause problems with Internet Explorer, " + "due to browser bugs that we weren't able to workaround. You might experience garbage " + "display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " + "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" + "You have been warned. Please press OK if you still want to try the full screen editor." }, dialogs: { "Cancel" : "Atšaukti", "Insert/Modify Link" : "Idėti/Modifikuoti", "New window (_blank)" : "Naujas langas (_blank)", "None (use implicit)" : "None (use implicit)", "OK" : "OK", "Other" : "Kitas", "Same frame (_self)" : "Same frame (_self)", "Target:" : "Target:", "Title (tooltip):" : "Pavadinimas (tooltip):", "Top frame (_top)" : "Top frame (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Jus privalote nurodyti URL į kuri rodo šitą nuoroda" } };
JavaScript
// I18N constants // LANG: "el", ENCODING: UTF-8 | ISO-8859-7 // Author: Dimitris Glezos, dimitris@glezos.com HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "el", tooltips: { bold: "Έντονα", italic: "Πλάγια", underline: "Υπογραμμισμένα", strikethrough: "Διαγραμμένα", subscript: "Δείκτης", superscript: "Δείκτης", justifyleft: "Στοίχιση Αριστερά", justifycenter: "Στοίχιση Κέντρο", justifyright: "Στοίχιση Δεξιά", justifyfull: "Πλήρης Στοίχιση", orderedlist: "Αρίθμηση", unorderedlist: "Κουκκίδες", outdent: "Μείωση Εσοχής", indent: "Αύξηση Εσοχής", forecolor: "Χρώμα Γραμματοσειράς", hilitecolor: "Χρώμα Φόντου", horizontalrule: "Οριζόντια Γραμμή", createlink: "Εισαγωγή Συνδέσμου", insertimage: "Εισαγωγή/Τροποποίηση Εικόνας", inserttable: "Εισαγωγή Πίνακα", htmlmode: "Εναλλαγή σε/από HTML", popupeditor: "Μεγένθυνση επεξεργαστή", about: "Πληροφορίες", showhelp: "Βοήθεια", textindicator: "Παρών στυλ", undo: "Αναίρεση τελευταίας ενέργειας", redo: "Επαναφορά από αναίρεση", cut: "Αποκοπή", copy: "Αντιγραφή", paste: "Επικόλληση", lefttoright: "Κατεύθυνση αριστερά προς δεξιά", righttoleft: "Κατεύθυνση από δεξιά προς τα αριστερά" }, buttons: { "ok": "OK", "cancel": "Ακύρωση" }, msg: { "Path": "Διαδρομή", "TEXT_MODE": "Είστε σε TEXT MODE. Χρησιμοποιήστε το κουμπί [<>] για να επανέρθετε στο WYSIWIG.", "IE-sucks-full-screen": "Η κατάσταση πλήρης οθόνης έχει προβλήματα με τον Internet Explorer, " + "λόγω σφαλμάτων στον ίδιο τον browser. Αν το σύστημα σας είναι Windows 9x " + "μπορεί και να χρειαστείτε reboot. Αν είστε σίγουροι, πατήστε ΟΚ." }, dialogs: { "Cancel" : "Ακύρωση", "Insert/Modify Link" : "Εισαγωγή/Τροποποίηση σύνδεσμου", "New window (_blank)" : "Νέο παράθυρο (_blank)", "None (use implicit)" : "Κανένα (χρήση απόλυτου)", "OK" : "Εντάξει", "Other" : "Αλλο", "Same frame (_self)" : "Ίδιο frame (_self)", "Target:" : "Target:", "Title (tooltip):" : "Τίτλος (tooltip):", "Top frame (_top)" : "Πάνω frame (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Πρέπει να εισάγετε το URL που οδηγεί αυτός ο σύνδεσμος" } };
JavaScript
// I18N constants : Vietnamese // LANG: "en", ENCODING: UTF-8 // Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com> // Modified 21/07/2004 by Phạm Mai Quân <pmquan@4vn.org> HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "vn", tooltips: { bold: "Đậm", italic: "Nghiêng", underline: "Gạch Chân", strikethrough: "Gạch Xóa", subscript: "Viết Xuống Dưới", superscript: "Viết Lên Trên", justifyleft: "Căn Trái", justifycenter: "Căn Giữa", justifyright: "Căn Phải", justifyfull: "Căn Đều", insertorderedlist: "Danh Sách Có Thứ Tự (1, 2, 3)", insertunorderedlist: "Danh Sách Phi Thứ Tự (Chấm đầu dòng)", outdent: "Lùi Ra Ngoài", indent: "Thụt Vào Trong", forecolor: "Màu Chữ", hilitecolor: "Màu Nền", inserthorizontalrule: "Dòng Kẻ Ngang", createlink: "Tạo Liên Kết", insertimage: "Chèn Ảnh", inserttable: "Chèn Bảng", htmlmode: "Chế Độ Mã HTML", popupeditor: "Phóng To Ô Soạn Thảo", about: "Tự Giới Thiệu", showhelp: "Giúp Đỡ", textindicator: "Định Dạng Hiện Thời", undo: "Hủy thao tác trước", redo: "Lấy lại thao tác vừa bỏ", cut: "Cắt", copy: "Sao chép", paste: "Dán", lefttoright: "Viết từ trái sang phải", righttoleft: "Viết từ phải sang trái" }, buttons: { "ok": "Đồng ý", "cancel": "Hủy", "IE-sucks-full-screen" : // translate here "Chế độ phóng to ô soạn thảo có thể gây lỗi với Internet Explorer vì một số lỗi của trình duyệt này," + " vì thế chế độ này có thể sẽ không chạy. Hiển thị không đúng, lộn xộn, không có đầy đủ chức năng," + " và cũng có thể làm trình duyệt của bạn bị tắt ngang. Nếu bạn đang sử dụng Windows 9x " + "bạn có thể bị báo lỗi 'General Protection Fault' và máy tính của bạn buộc phải khởi động lại.\n\n" + "Chúng tôi đã cảnh báo bạn. Nhấn nút 'Đồng ý' nếu bạn vẫn muốn sử dụng tính năng này." }, msg: { "Path": "Đường Dẫn", "TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG." }, dialogs: { "Cancel" : "Hủy", "Insert/Modify Link" : "Thêm/Chỉnh sửa đường dẫn", "New window (_blank)" : "Cửa sổ mới (_blank)", "None (use implicit)" : "Không (sử dụng implicit)", "OK" : "Đồng ý", "Other" : "Khác", "Same frame (_self)" : "Trên cùng khung (_self)", "Target:" : "Nơi hiện thị:", "Title (tooltip):" : "Tiêu đề (của hướng dẫn):", "Top frame (_top)" : "Khung trên cùng (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Bạn phải điền địa chỉ (URL) mà đường dẫn sẽ liên kết tới" } };
JavaScript
// I18N constants // LANG: "ro", ENCODING: UTF-8 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "ro", tooltips: { bold: "Îngroşat", italic: "Italic", underline: "Subliniat", strikethrough: "Tăiat", subscript: "Indice jos", superscript: "Indice sus", justifyleft: "Aliniere la stânga", justifycenter: "Aliniere pe centru", justifyright: "Aliniere la dreapta", justifyfull: "Aliniere în ambele părţi", orderedlist: "Listă ordonată", unorderedlist: "Listă marcată", outdent: "Micşorează alineatul", indent: "Măreşte alineatul", forecolor: "Culoarea textului", hilitecolor: "Culoare de fundal", horizontalrule: "Linie orizontală", createlink: "Inserează/modifică link", insertimage: "Inserează/modifică imagine", inserttable: "Inserează un tabel", htmlmode: "Sursa HTML / WYSIWYG", popupeditor: "Maximizează editorul", about: "Despre editor", showhelp: "Documentaţie (devel)", textindicator: "Stilul curent", undo: "Anulează ultima acţiune", redo: "Reface ultima acţiune anulată", cut: "Taie în clipboard", copy: "Copie în clipboard", paste: "Aduce din clipboard", lefttoright: "Direcţia de scriere: stânga - dreapta", righttoleft: "Direcţia de scriere: dreapta - stânga" }, buttons: { "ok": "OK", "cancel": "Anulează" }, msg: { "Path": "Calea", "TEXT_MODE": "Eşti în modul TEXT. Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG." }, dialogs: { "Cancel" : "Renunţă", "Insert/Modify Link" : "Inserează/modifcă link", "New window (_blank)" : "Fereastră nouă (_blank)", "None (use implicit)" : "Nimic (foloseşte ce-i implicit)", "OK" : "Acceptă", "Other" : "Alt target", "Same frame (_self)" : "Aceeaşi fereastră (_self)", "Target:" : "Ţinta:", "Title (tooltip):" : "Titlul (tooltip):", "Top frame (_top)" : "Fereastra principală (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "Trebuie să introduceţi un URL" } };
JavaScript
// I18N constants // LANG: "he", ENCODING: UTF-8 // Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "he", tooltips: { bold: "מודגש", italic: "נטוי", underline: "קו תחתי", strikethrough: "קו אמצע", subscript: "כתב עילי", superscript: "כתב תחתי", justifyleft: " ישור לשמאל", justifycenter: "ישור למרכז", justifyright: "ישור לימין", justifyfull: "ישור לשורה מלאה", orderedlist: "רשימה ממוספרת", unorderedlist: "רשימה לא ממוספרת", outdent: "הקטן כניסה", indent: "הגדל כניסה", forecolor: "צבע גופן", hilitecolor: "צבע רקע", horizontalrule: "קו אנכי", createlink: "הכנס היפר-קישור", insertimage: "הכנס/שנה תמונה", inserttable: "הכנס טבלה", htmlmode: "שנה מצב קוד HTML", popupeditor: "הגדל את העורך", about: "אודות עורך זה", showhelp: "עזרה לשימוש בעורך", textindicator: "סגנון נוכחי", undo: "מבטל את פעולתך האחרונה", redo: "מבצע מחדש את הפעולה האחרונה שביטלת", cut: "גזור בחירה", copy: "העתק בחירה", paste: "הדבק מהלוח", lefttoright: "כיוון משמאל לימין", righttoleft: "כיוון מימין לשמאל" }, buttons: { "ok": "אישור", "cancel": "ביטול" }, msg: { "Path": "נתיב עיצוב", "TEXT_MODE": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).", "IE-sucks-full-screen" : // translate here "מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, " + "עקב באגים בדפדפן לא יכולנו לפתור את זה. את/ה עלול/ה לחוות תצוגת זבל, " + "בעיות בתפקוד העורך ו/או קריסה של הדפדפן. אם המערכת שלך היא Windows 9x " + "סביר להניח שתקבל/י 'General Protection Fault' ותאלצ/י לאתחל את המחשב.\n\n" + "ראה/י הוזהרת. אנא לחץ/י אישור אם את/ה עדיין רוצה לנסות את העורך במסך מלא." }, dialogs: { "Cancel" : "ביטול", "Insert/Modify Link" : "הוסף/שנה קישור", "New window (_blank)" : "חלון חדש (_blank)", "None (use implicit)" : "ללא (השתמש ב-frame הקיים)", "OK" : "OK", "Other" : "אחר", "Same frame (_self)" : "אותו frame (_self)", "Target:" : "יעד:", "Title (tooltip):" : "כותרת (tooltip):", "Top frame (_top)" : "Frame עליון (_top)", "URL:" : "URL:", "You must enter the URL where this link points to" : "חובה לכתוב URL שאליו קישור זה מצביע" } };
JavaScript
// I18N constants // LANG: "ch", ENCODING: UTF-8 // Samuel Stone, http://stonemicro.com/ HTMLArea.I18N = { // the following should be the filename without .js extension // it will be used for automatically load plugin language. lang: "ch", tooltips: { bold: "粗體", italic: "斜體", underline: "底線", strikethrough: "刪線", subscript: "下標", superscript: "上標", justifyleft: "靠左", justifycenter: "居中", justifyright: "靠右", justifyfull: "整齊", orderedlist: "順序清單", unorderedlist: "無序清單", outdent: "伸排", indent: "縮排", forecolor: "文字顏色", backcolor: "背景顏色", horizontalrule: "水平線", createlink: "插入連結", insertimage: "插入圖像", inserttable: "插入表格", htmlmode: "切換HTML原始碼", popupeditor: "伸出編輯系統", about: "關於 HTMLArea", help: "說明", textindicator: "字體例子", undo: "回原", redo: "重来", cut: "剪制选项", copy: "复制选项", paste: "贴上", lefttoright: "从左到右", righttoleft: "从右到左" }, buttons: { "ok": "好", "cancel": "取消" }, msg: { "Path": "途徑", "TEXT_MODE": "你在用純字編輯方式. 用 [<>] 按鈕轉回 所見即所得 編輯方式.", "IE-sucks-full-screen" : // translate here "整頁式在Internet Explorer 上常出問題, " + "因為這是 Internet Explorer 的無名問題,我們無法解決。" + "你可能看見一些垃圾,或遇到其他問題。" + "我們已警告了你. 如果要轉到 正頁式 請按 好.", "Moz-Clipboard" : "Unprivileged scripts cannot access Cut/Copy/Paste programatically " + "for security reasons. Click OK to see a technical note at mozilla.org " + "which shows you how to allow a script to access the clipboard." }, dialogs: { "Cancel" : "取消", "Insert/Modify Link" : "插入/改寫連結", "New window (_blank)" : "新窗户(_blank)", "None (use implicit)" : "無(use implicit)", "OK" : "好", "Other" : "其他", "Same frame (_self)" : "本匡 (_self)", "Target:" : "目標匡:", "Title (tooltip):" : "主題 (tooltip):", "Top frame (_top)" : "上匡 (_top)", "URL:" : "網址:", "You must enter the URL where this link points to" : "你必須輸入你要连结的網址" } };
JavaScript
/** This file is derived from PopupDiv, developed by Mihai Bazon for * SamWare.net. Modifications were needed to make it usable in HTMLArea. * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com. * * This file does not function standalone. It is dependent of global functions * defined in HTMLArea-3.0 (htmlarea.js). * * Please see file htmlarea.js for further details. **/ var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) && (navigator.userAgent.toLowerCase().indexOf("opera") == -1) ); var is_compat = (document.compatMode == "BackCompat"); function PopupDiv(editor, titleText, handler, initFunction) { var self = this; this.editor = editor; this.doc = editor._mdoc; this.handler = handler; var el = this.doc.createElement("div"); el.className = "content"; var popup = this.doc.createElement("div"); popup.className = "dialog popupdiv"; this.element = popup; var s = popup.style; s.position = "absolute"; s.left = "0px"; s.top = "0px"; var title = this.doc.createElement("div"); title.className = "title"; this.title = title; popup.appendChild(title); HTMLArea._addEvent(title, "mousedown", function(ev) { self._dragStart(is_ie ? window.event : ev); }); var button = this.doc.createElement("div"); button.className = "button"; title.appendChild(button); button.innerHTML = "&#x00d7;"; title.appendChild(this.doc.createTextNode(titleText)); this.titleText = titleText; button.onmouseover = function() { this.className += " button-hilite"; }; button.onmouseout = function() { this.className = this.className.replace(/\s*button-hilite\s*/g, " "); }; button.onclick = function() { this.className = this.className.replace(/\s*button-hilite\s*/g, " "); self.close(); }; popup.appendChild(el); this.content = el; this.doc.body.appendChild(popup); this.dragging = false; this.onShow = null; this.onClose = null; this.modal = false; initFunction(this); }; PopupDiv.currentPopup = null; PopupDiv.prototype.showAtElement = function(el, mode) { this.defaultSize(); var pos, ew, eh; var popup = this.element; popup.style.display = "block"; var w = popup.offsetWidth; var h = popup.offsetHeight; popup.style.display = "none"; if (el != window) { pos = PopupDiv.getAbsolutePos(el); ew = el.offsetWidth; eh = el.offsetHeight; } else { pos = {x:0, y:0}; var size = PopupDiv.getWindowSize(); ew = size.x; eh = size.y; } var FX = false, FY = false; if (mode.indexOf("l") != -1) { pos.x -= w; FX = true; } if (mode.indexOf("r") != -1) { pos.x += ew; FX = true; } if (mode.indexOf("t") != -1) { pos.y -= h; FY = true; } if (mode.indexOf("b") != -1) { pos.y += eh; FY = true; } if (mode.indexOf("c") != -1) { FX || (pos.x += Math.round((ew - w) / 2)); FY || (pos.y += Math.round((eh - h) / 2)); } this.showAt(pos.x, pos.y); }; PopupDiv.prototype.defaultSize = function() { var s = this.element.style; var cs = this.element.currentStyle; var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) + parseInt(cs.borderRightWidth) + parseInt(cs.paddingLeft) + parseInt(cs.paddingRight)) : 0; var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) + parseInt(cs.borderBottomWidth) + parseInt(cs.paddingTop) + parseInt(cs.paddingBottom)) : 0; s.display = "block"; s.width = (this.content.offsetWidth + addX) + "px"; s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px"; s.display = "none"; }; PopupDiv.prototype.showAt = function(x, y) { this.defaultSize(); var s = this.element.style; s.display = "block"; s.left = x + "px"; s.top = y + "px"; this.hideShowCovered(); PopupDiv.currentPopup = this; HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup); HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup); if (is_ie && this.modal) { this.doc.body.setCapture(false); this.doc.body.onlosecapture = function() { (PopupDiv.currentPopup) && (this.doc.body.setCapture(false)); }; } window.event && HTMLArea._stopEvent(window.event); if (typeof this.onShow == "function") { this.onShow(); } else if (typeof this.onShow == "string") { eval(this.onShow); } var field = this.element.getElementsByTagName("input")[0]; if (!field) { field = this.element.getElementsByTagName("select")[0]; } if (!field) { field = this.element.getElementsByTagName("textarea")[0]; } if (field) { field.focus(); } }; PopupDiv.prototype.close = function() { this.element.style.display = "none"; PopupDiv.currentPopup = null; this.hideShowCovered(); HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup); HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup); is_ie && this.modal && this.doc.body.releaseCapture(); if (typeof this.onClose == "function") { this.onClose(); } else if (typeof this.onClose == "string") { eval(this.onClose); } this.element.parentNode.removeChild(this.element); }; PopupDiv.prototype.getForm = function() { var forms = this.content.getElementsByTagName("form"); return (forms.length > 0) ? forms[0] : null; }; PopupDiv.prototype.callHandler = function() { var tags = ["input", "textarea", "select"]; var params = new Object(); for (var ti = tags.length; --ti >= 0;) { var tag = tags[ti]; var els = this.content.getElementsByTagName(tag); for (var j = 0; j < els.length; ++j) { var el = els[j]; params[el.name] = el.value; } } this.handler(this, params); return false; }; PopupDiv.getAbsolutePos = function(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = PopupDiv.getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; PopupDiv.getWindowSize = function() { if (window.innerHeight) { return { y: window.innerHeight, x: window.innerWidth }; } if (this.doc.body.clientHeight) { return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth }; } return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth }; }; PopupDiv.prototype.hideShowCovered = function () { var self = this; function isContained(el) { while (el) { if (el == self.element) { return true; } el = el.parentNode; } return false; }; var tags = new Array("applet", "select"); var el = this.element; var p = PopupDiv.getAbsolutePos(el); var EX1 = p.x; var EX2 = el.offsetWidth + EX1; var EY1 = p.y; var EY2 = el.offsetHeight + EY1; if (el.style.display == "none") { EX1 = EX2 = EY1 = EY2 = 0; } for (var k = tags.length; k > 0; ) { var ar = this.doc.getElementsByTagName(tags[--k]); var cc = null; for (var i = ar.length; i > 0;) { cc = ar[--i]; if (isContained(cc)) { cc.style.visibility = "visible"; continue; } p = PopupDiv.getAbsolutePos(cc); var CX1 = p.x; var CX2 = cc.offsetWidth + CX1; var CY1 = p.y; var CY2 = cc.offsetHeight + CY1; if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { cc.style.visibility = "visible"; } else { cc.style.visibility = "hidden"; } } } }; PopupDiv.prototype._dragStart = function (ev) { if (this.dragging) { return false; } this.dragging = true; PopupDiv.currentPopup = this; var posX = ev.clientX; var posY = ev.clientY; if (is_ie) { posY += this.doc.body.scrollTop; posX += this.doc.body.scrollLeft; } else { posY += window.scrollY; posX += window.scrollX; } var st = this.element.style; this.xOffs = posX - parseInt(st.left); this.yOffs = posY - parseInt(st.top); HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt); HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent); HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd); HTMLArea._stopEvent(ev); }; PopupDiv.dragIt = function (ev) { var popup = PopupDiv.currentPopup; if (!(popup && popup.dragging)) { return false; } is_ie && (ev = window.event); var posX = ev.clientX; var posY = ev.clientY; if (is_ie) { posY += this.doc.body.scrollTop; posX += this.doc.body.scrollLeft; } else { posY += window.scrollY; posX += window.scrollX; } popup.hideShowCovered(); var st = popup.element.style; st.left = (posX - popup.xOffs) + "px"; st.top = (posY - popup.yOffs) + "px"; HTMLArea._stopEvent(ev); }; PopupDiv.dragEnd = function () { var popup = PopupDiv.currentPopup; if (!popup) { return false; } popup.dragging = false; HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd); HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent); HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt); popup.hideShowCovered(); }; PopupDiv.checkPopup = function (ev) { is_ie && (ev = window.event); var el = is_ie ? ev.srcElement : ev.target; var cp = PopupDiv.currentPopup; for (; (el != null) && (el != cp.element); el = el.parentNode); if (el == null) { cp.modal || ev.type == "mouseover" || cp.close(); HTMLArea._stopEvent(ev); } }; PopupDiv.prototype.addButtons = function() { var self = this; var div = this.doc.createElement("div"); this.content.appendChild(div); div.className = "buttons"; for (var i = 0; i < arguments.length; ++i) { var btn = arguments[i]; var button = this.doc.createElement("button"); div.appendChild(button); button.innerHTML = HTMLArea.I18N.buttons[btn]; switch (btn) { case "ok": button.onclick = function() { self.callHandler(); self.close(); }; break; case "cancel": button.onclick = function() { self.close(); }; break; } } };
JavaScript
// (c) dynarch.com 2003-2005 // Distributed under the same terms as HTMLArea itself. function PopupWin(editor, title, handler, initFunction) { this.editor = editor; this.handler = handler; var dlg = window.open("", "__ha_dialog", "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40" + "scrollbars=no,resizable=no"); this.window = dlg; var doc = dlg.document; this.doc = doc; var self = this; var base = document.baseURI || document.URL; if (base && base.match(/(.*)\/([^\/]+)/)) { base = RegExp.$1 + "/"; } if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url) && !/http:\/\//.test(_editor_url)) { // _editor_url doesn't start with '/' which means it's relative // FIXME: there's a problem here, it could be http:// which // doesn't start with slash but it's not relative either. base += _editor_url; } else base = _editor_url; if (!/\/$/.test(base)) { // base does not end in slash, add it now base += '/'; } this.baseURL = base; doc.open(); var html = "<html><head><title>" + title + "</title>\n"; // html += "<base href='" + base + "htmlarea.js' />\n"; html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n"; html += "<body class='dialog popupwin' id='--HA-body'></body></html>"; doc.write(html); doc.close(); // sometimes I Hate Mozilla... ;-( function init2() { var body = doc.body; if (!body) { setTimeout(init2, 25); return false; } dlg.title = title; doc.documentElement.style.padding = "0px"; doc.documentElement.style.margin = "0px"; var content = doc.createElement("div"); content.className = "content"; self.content = content; body.appendChild(content); self.element = body; initFunction(self); dlg.focus(); }; init2(); }; PopupWin.prototype.callHandler = function() { var tags = ["input", "textarea", "select"]; var params = new Object(); for (var ti = tags.length; --ti >= 0;) { var tag = tags[ti]; var els = this.content.getElementsByTagName(tag); for (var j = 0; j < els.length; ++j) { var el = els[j]; var val = el.value; if (el.tagName.toLowerCase() == "input") { if (el.type == "checkbox") { val = el.checked; } } params[el.name] = val; } } this.handler(this, params); return false; }; PopupWin.prototype.close = function() { this.window.close(); }; PopupWin.prototype.addButtons = function() { var self = this; var div = this.doc.createElement("div"); this.content.appendChild(div); div.className = "buttons"; for (var i = 0; i < arguments.length; ++i) { var btn = arguments[i]; var button = this.doc.createElement("button"); div.appendChild(button); button.innerHTML = HTMLArea.I18N.buttons[btn]; switch (btn) { case "ok": button.onclick = function() { self.callHandler(); self.close(); return false; }; break; case "cancel": button.onclick = function() { self.close(); return false; }; break; } } }; PopupWin.prototype.showAtElement = function() { var self = this; // Mozilla needs some time to realize what's goin' on.. setTimeout(function() { var w = self.content.offsetWidth + 4; var h = self.content.offsetHeight + 4; // size to content -- that's fuckin' buggy in all fuckin' browsers!!! // so that we set a larger size for the dialog window and then center // the element inside... phuck! // center... var el = self.content; var s = el.style; // s.width = el.offsetWidth + "px"; // s.height = el.offsetHeight + "px"; s.position = "absolute"; s.left = (w - el.offsetWidth) / 2 + "px"; s.top = (h - el.offsetHeight) / 2 + "px"; if (HTMLArea.is_gecko) { self.window.innerWidth = w; self.window.innerHeight = h; } else { self.window.resizeTo(w + 8, h + 35); } }, 25); };
JavaScript
// htmlArea v3.0 - Copyright (c) 2003-2005 dynarch.com // 2002-2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003-2004 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: dialog.js,v 1.7 2005/01/20 17:49:04 mishoo Exp $ // Though "Dialog" looks like an object, it isn't really an object. Instead // it's just namespace for protecting global symbols. function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } Dialog._geckoOpenModal(url, action, init); }; Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); if (Dialog._modal && !Dialog._modal.closed) { HTMLArea._stopEvent(ev); } }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; Dialog._geckoOpenModal = function(url, action, init) { var dlg = window.open(url, "hadialog", "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // capture some window's events function capwin(w) { HTMLArea._addEvent(w, "click", Dialog._parentEvent); HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent); HTMLArea._addEvent(w, "focus", Dialog._parentEvent); }; // release the captured events function relwin(w) { HTMLArea._removeEvent(w, "click", Dialog._parentEvent); HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent); HTMLArea._removeEvent(w, "focus", Dialog._parentEvent); }; capwin(window); // capture other frames for (var i = 0; i < window.frames.length; capwin(window.frames[i++])); // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } relwin(window); // capture other frames for (var i = 0; i < window.frames.length; relwin(window.frames[i++])); Dialog._modal = null; }; };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Xiang Wei Zhuo, http://www.zhuo.org // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) ImageManager.I18N = { "Image Manager" : "Image Manager", "Crop" : "Crop" }; /* */
JavaScript
/** * The ImageManager plugin javascript. * @author $Author: Wei Zhuo $ * @version $Id: image-manager.js 26 2004-03-31 02:35:21Z Wei Zhuo $ * @package ImageManager */ /** * To Enable the plug-in add the following line before HTMLArea is initialised. * * HTMLArea.loadPlugin("ImageManager"); * * Then configure the config.inc.php file, that is all. * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/ */ /** * It is pretty simple, this file over rides the HTMLArea.prototype._insertImage * function with our own, only difference is the popupDialog url * point that to the php script. */ function ImageManager(editor) { var tt = ImageManager.I18N; }; ImageManager._pluginInfo = { name : "ImageManager", version : "1.0", developer : "Xiang Wei Zhuo", developer_url : "http://www.zhuo.org/htmlarea/", license : "htmlArea" }; // Over ride the _insertImage function in htmlarea.js. // Open up the ImageManger script instead. HTMLArea.prototype._insertImage = function(image) { var editor = this; // for nested functions var outparam = null; if (typeof image == "undefined") { image = this.getParentElement(); if (image && !/^img$/i.test(image.tagName)) image = null; } if (image) outparam = { f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"), f_alt : image.alt, f_border : image.border, f_align : image.align, f_vert : image.vspace, f_horiz : image.hspace, f_width : image.width, f_height : image.height }; var manager = _editor_url + 'plugins/ImageManager/manager.php'; Dialog(manager, function(param) { if (!param) { // user must have pressed Cancel return false; } var img = image; if (!img) { var sel = editor._getSelection(); var range = editor._createRange(sel); editor._doc.execCommand("insertimage", false, param.f_url); if (HTMLArea.is_ie) { img = range.parentElement(); // wonder if this works... if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else { img = range.startContainer.previousSibling; } } else { img.src = param.f_url; } for (field in param) { var value = param[field]; switch (field) { case "f_alt" : img.alt = value; break; case "f_border" : img.border = parseInt(value || "0"); break; case "f_align" : img.align = value; break; case "f_vert" : img.vspace = parseInt(value || "0"); break; case "f_horiz" : img.hspace = parseInt(value || "0"); break; case "f_width" : img.width = parseInt(value || "0"); break; case "f_height" : img.height = parseInt(value || "0"); break; } } }, outparam); };
JavaScript
/*********************************************************************** ** Title.........: Simple Lite Slider for Image Editor ** Version.......: 1.1 ** Author........: Xiang Wei ZHUO <wei@zhuo.org> ** Filename......: slider.js ** Last changed..: 31 Mar 2004 ** Notes.........: Works in IE and Mozilla **/ var ie=document.all var ns6=document.getElementById&&!document.all document.onmouseup = captureStop; var currentSlider = null,sliderField = null; var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0; function getMouseXY(e) { //alert('hello'); x = ns6? e.clientX: event.clientX y = ns6? e.clientY: event.clientY if (sx < 0) sx = x; if (sy < 0) sy = y; var dx = initX +(x-sx); if (dx <= rangeMin) dx = rangeMin; else if (dx >= rangeMax) dx = rangeMax; var range = (dx-rangeMin)/(rangeMax - rangeMin)*100; if (currentSlider != null) currentSlider.style.left = dx+"px"; if (sliderField != null) { sliderField.value = parseInt(range); } return false; } function initSlider() { if (currentSlider == null) currentSlider = document.getElementById('sliderbar'); if (sliderField == null) sliderField = document.getElementById('quality'); if (rangeMin == null) rangeMin = 3 if (rangeMax == null) { var track = document.getElementById('slidertrack'); rangeMax = parseInt(track.style.width); } } function updateSlider(value) { initSlider(); var newValue = parseInt(value)/100*(rangeMax-rangeMin); if (newValue <= rangeMin) newValue = rangeMin; else if (newValue >= rangeMax) newValue = rangeMax; if (currentSlider != null) currentSlider.style.left = newValue+"px"; var range = newValue/(rangeMax - rangeMin)*100; if (sliderField != null) sliderField.value = parseInt(range); } function captureStart() { initSlider(); initX = parseInt(currentSlider.style.left); if (initX > rangeMax) initX = rangeMax; else if (initX < rangeMin) initX = rangeMin; document.onmousemove = getMouseXY; return false; } function captureStop() { sx = -1; sy = -1; document.onmousemove = null; return false; }
JavaScript
/*********************************************************************** ** Title.........: Javascript Graphics ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <wei@zhuo.org> ** Filename......: wz_jsgraphics.js ** Last changed..: 31 Aug 2003 ** Notes.........: Modified for Image Editor, added extra commands **/ /* This notice must be untouched at all times. wz_jsgraphics.js v. 2.03 The latest version is available at http://www.walterzorn.com or http://www.devira.com or http://www.walterzorn.de Copyright (c) 2002-2003 Walter Zorn. All rights reserved. Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de> Last modified: 11. 6. 2003 High Performance JavaScript Graphics Library. Provides methods - to draw lines, rectangles, ellipses, polygons with specifiable line thickness, - to fill rectangles and ellipses - to draw text. NOTE: Operations, functions and branching have rather been optimized to efficiency and speed than to shortness of source code. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.gnu.org/copyleft/gpl.html for more details. */ var jg_ihtm, jg_ie, jg_dom, jg_n4 = (document.layers && typeof document.classes != "undefined"); function chkDHTM(x, i) { x = document.body || null; jg_ie = (x && typeof x.insertAdjacentHTML != "undefined"); jg_dom = (x && !jg_ie && typeof x.appendChild != "undefined" && typeof document.createRange != "undefined" && typeof (i = document.createRange()).setStartBefore != "undefined" && typeof i.createContextualFragment != "undefined"); jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"); } function pntDoc() { this.wnd.document.write(this.htm); this.htm = ''; } function pntCnvDom() { var x = document.createRange(); x.setStartBefore(this.cnv); x = x.createContextualFragment(this.htm); this.cnv.appendChild(x); this.htm = ''; } function pntCnvIe() { this.cnv.insertAdjacentHTML("BeforeEnd", this.htm); this.htm = ''; } function pntCnvIhtm() { this.cnv.innerHTML += this.htm; this.htm = ''; } function pntCnv() { this.htm = ''; } function mkDiv(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;background-color:' + this.color + ';'+ '"><\/div>'; //alert(this.htm); } function mkDivPrint(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'border-left:' + w + 'px solid ' + this.color + ';'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;background-color:' + this.color + ';'+ '"><\/div>'; } function mkLyr(x, y, w, h) { this.htm += '<layer '+ 'left="' + x + '" '+ 'top="' + y + '" '+ 'width="' + w + '" '+ 'height="' + h + '" '+ 'bgcolor="' + this.color + '"><\/layer>\n'; } function mkLbl(txt, x, y) { this.htm += '<div style="position:absolute;white-space:nowrap;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'font-family:' + this.ftFam + ';'+ 'font-size:' + this.ftSz + ';'+ 'color:' + this.color + ';' + this.ftSty + '">'+ txt + '<\/div>'; } function mkLin(x1, y1, x2, y2) { if (x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1; if (dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx, ox = x; while ((dx--) > 0) { ++x; if (p > 0) { this.mkDiv(ox, y, x-ox, 1); y += yIncr; p += pru; ox = x; } else p += pr; } this.mkDiv(ox, y, x2-ox+1, 1); } else { var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy, oy = y; if (y2 <= y1) { while ((dy--) > 0) { if (p > 0) { this.mkDiv(x++, y, 1, oy-y+1); y += yIncr; p += pru; oy = y; } else { y += yIncr; p += pr; } } this.mkDiv(x2, y2, 1, oy-y2+1); } else { while ((dy--) > 0) { y += yIncr; if (p > 0) { this.mkDiv(x++, oy, 1, y-oy); p += pru; oy = y; } else p += pr; } this.mkDiv(x2, oy, 1, y2-oy+1); } } } function mkLin2D(x1, y1, x2, y2) { if (x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1; var s = this.stroke; if (dx >= dy) { if (s-0x3 > 0) { var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1; } else var _s = s; var ad = Math.ceil(s/2); var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx, ox = x; while ((dx--) > 0) { ++x; if (p > 0) { this.mkDiv(ox, y, x-ox+ad, _s); y += yIncr; p += pru; ox = x; } else p += pr; } this.mkDiv(ox, y, x2-ox+ad+1, _s); } else { if (s-0x3 > 0) { var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1; } else var _s = s; var ad = Math.round(s/2); var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy, oy = y; if (y2 <= y1) { ++ad; while ((dy--) > 0) { if (p > 0) { this.mkDiv(x++, y, _s, oy-y+ad); y += yIncr; p += pru; oy = y; } else { y += yIncr; p += pr; } } this.mkDiv(x2, y2, _s, oy-y2+ad); } else { while ((dy--) > 0) { y += yIncr; if (p > 0) { this.mkDiv(x++, oy, _s, y-oy+ad); p += pru; oy = y; } else p += pr; } this.mkDiv(x2, oy, _s, y2-oy+ad+1); } } } function mkLinDott(x1, y1, x2, y2) { if (x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1, drw = true; if (dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx; while ((dx--) > 0) { if (drw) this.mkDiv(x, y, 1, 1); drw = !drw; if (p > 0) { y += yIncr; p += pru; } else p += pr; ++x; } if (drw) this.mkDiv(x, y, 1, 1); } else { var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy; while ((dy--) > 0) { if (drw) this.mkDiv(x, y, 1, 1); drw = !drw; y += yIncr; if (p > 0) { ++x; p += pru; } else p += pr; } if (drw) this.mkDiv(x, y, 1, 1); } } function mkOv(left, top, width, height) { var a = width>>1, b = height>>1, wod = width&1, hod = (height&1)+1, cx = left+a, cy = top+b, x = 0, y = b, ox = 0, oy = b, aa = (a*a)<<1, bb = (b*b)<<1, st = (aa>>1)*(1-(b<<1)) + bb, tt = (bb>>1) - aa*((b<<1)-1), w, h; while (y > 0) { if (st < 0) { st += bb*((x<<1)+0x3); tt += (bb<<1)*(++x); } else if (tt < 0) { st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); w = x-ox; h = oy-y; if (w&0x2 && h&0x2) { this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1); this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); } else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); ox = x; oy = y; } else { tt -= aa*((y<<1)-0x3); st -= (aa<<1)*(--y); } } this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); } function mkOv2D(left, top, width, height) { var s = this.stroke; width += s-1; height += s-1; var a = width>>1, b = height>>1, wod = width&1, hod = (height&1)+1, cx = left+a, cy = top+b, x = 0, y = b, aa = (a*a)<<1, bb = (b*b)<<1, st = (aa>>1)*(1-(b<<1)) + bb, tt = (bb>>1) - aa*((b<<1)-1); if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0)) { var ox = 0, oy = b, w, h, pxl, pxr, pxt, pxb, pxw; while (y > 0) { if (st < 0) { st += bb*((x<<1)+0x3); tt += (bb<<1)*(++x); } else if (tt < 0) { st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); w = x-ox; h = oy-y; if (w-1) { pxw = w+1+(s&1); h = s; } else if (h-1) { pxw = s; h += 1+(s&1); } else pxw = h = s; this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); ox = x; oy = y; } else { tt -= aa*((y<<1)-0x3); st -= (aa<<1)*(--y); } } this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); } else { var _a = (width-((s-1)<<1))>>1, _b = (height-((s-1)<<1))>>1, _x = 0, _y = _b, _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, _st = (_aa>>1)*(1-(_b<<1)) + _bb, _tt = (_bb>>1) - _aa*((_b<<1)-1), pxl = new Array(), pxt = new Array(), _pxb = new Array(); pxl[0] = 0; pxt[0] = b; _pxb[0] = _b-1; while (y > 0) { if (st < 0) { st += bb*((x<<1)+0x3); tt += (bb<<1)*(++x); pxl[pxl.length] = x; pxt[pxt.length] = y; } else if (tt < 0) { st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); pxl[pxl.length] = x; pxt[pxt.length] = y; } else { tt -= aa*((y<<1)-0x3); st -= (aa<<1)*(--y); } if (_y > 0) { if (_st < 0) { _st += _bb*((_x<<1)+0x3); _tt += (_bb<<1)*(++_x); _pxb[_pxb.length] = _y-1; } else if (_tt < 0) { _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1); _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3); _pxb[_pxb.length] = _y-1; } else { _tt -= _aa*((_y<<1)-0x3); _st -= (_aa<<1)*(--_y); _pxb[_pxb.length-1]--; } } } var ox = 0, oy = b, _oy = _pxb[0], l = pxl.length, w, h; for (var i = 0; i < l; i++) { if (typeof _pxb[i] != "undefined") { if (_pxb[i] < _oy || pxt[i] < oy) { x = pxl[i]; this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); ox = x; oy = pxt[i]; _oy = _pxb[i]; } } else { x = pxl[i]; this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); ox = x; oy = pxt[i]; } } this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); } } function mkOvDott(left, top, width, height) { var a = width>>1, b = height>>1, wod = width&1, hod = height&1, cx = left+a, cy = top+b, x = 0, y = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, st = (aa2>>1)*(1-(b<<1)) + bb, tt = (bb>>1) - aa2*((b<<1)-1), drw = true; while (y > 0) { if (st < 0) { st += bb*((x<<1)+0x3); tt += (bb<<1)*(++x); } else if (tt < 0) { st += bb*((x<<1)+0x3) - aa4*(y-1); tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3); } else { tt -= aa2*((y<<1)-0x3); st -= aa4*(--y); } if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); drw = !drw; } } function mkRect(x, y, w, h) { var s = this.stroke; this.mkDiv(x, y, w, s); this.mkDiv(x+w, y, s, h); this.mkDiv(x, y+h, w+s, s); this.mkDiv(x, y+s, s, h-s); } function mkRectDott(x, y, w, h) { this.drawLine(x, y, x+w, y); this.drawLine(x+w, y, x+w, y+h); this.drawLine(x, y+h, x+w, y+h); this.drawLine(x, y, x, y+h); } function jsgFont() { this.PLAIN = 'font-weight:normal;'; this.BOLD = 'font-weight:bold;'; this.ITALIC = 'font-style:italic;'; this.ITALIC_BOLD = this.ITALIC + this.BOLD; this.BOLD_ITALIC = this.ITALIC_BOLD; } var Font = new jsgFont(); function jsgStroke() { this.DOTTED = -1; } var Stroke = new jsgStroke(); function jsGraphics(id, wnd) { this.setColor = new Function('arg', 'this.color = arg;'); this.getColor = new Function('return this.color'); this.setStroke = function(x) { this.stroke = x; if (!(x+1)) { this.drawLine = mkLinDott; this.mkOv = mkOvDott; this.drawRect = mkRectDott; } else if (x-1 > 0) { this.drawLine = mkLin2D; this.mkOv = mkOv2D; this.drawRect = mkRect; } else { this.drawLine = mkLin; this.mkOv = mkOv; this.drawRect = mkRect; } }; this.setPrintable = function(arg) { this.printable = arg; this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv; }; this.setFont = function(fam, sz, sty) { this.ftFam = fam; this.ftSz = sz; this.ftSty = sty || Font.PLAIN; }; this.drawPolyline = this.drawPolyLine = function(x, y, s) { var i = x.length-1; while (i >= 0) this.drawLine(x[i], y[i], x[--i], y[i]); }; this.fillRect = function(x, y, w, h) { this.mkDiv(x, y, w, h); }; this.fillRectPattern = function(x, y, w, h, url) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;'+ //'background-color:' + this.color + ';'+ "background-image: url('" + url + "');"+ "layer-background-image: url('" + url + "');"+ 'z-index:100;"><\/div>'; //alert(this.htm); } this.drawHandle = function(x, y, w, h, cursor) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'padding: 2px;overflow:hidden;'+ "cursor: '" + cursor + "';"+ '" class="handleBox" id="' + cursor + '" ><\/div>'; } this.drawHandleBox = function(x, y, w, h, cursor) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+ 'overflow:hidden; border: solid 1px '+ this.color+';'+ "cursor: '" + cursor + "';"+ '" class="handleBox" id="' + cursor + '" ><\/div>'; } this.drawPolygon = function(x, y) { this.drawPolyline(x, y); this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]); }; this.drawEllipse = this.drawOval = function(x, y, w, h) { this.mkOv(x, y, w, h); }; this.fillEllipse = this.fillOval = function(left, top, w, h) { var a = (w -= 1)>>1, b = (h -= 1)>>1, wod = (w&1)+1, hod = (h&1)+1, cx = left+a, cy = top+b, x = 0, y = b, ox = 0, oy = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, st = (aa2>>1)*(1-(b<<1)) + bb, tt = (bb>>1) - aa2*((b<<1)-1), pxl, dw, dh; if (w+1) while (y > 0) { if (st < 0) { st += bb*((x<<1)+0x3); tt += (bb<<1)*(++x); } else if (tt < 0) { st += bb*((x<<1)+0x3) - aa4*(y-1); pxl = cx-x; dw = (x<<1)+wod; tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3); dh = oy-y; this.mkDiv(pxl, cy-oy, dw, dh); this.mkDiv(pxl, cy+oy-dh+hod, dw, dh); ox = x; oy = y; } else { tt -= aa2*((y<<1)-0x3); st -= aa4*(--y); } } this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); }; this.drawString = mkLbl; this.clear = function() { this.htm = ""; if (this.cnv) this.cnv.innerHTML = this.defhtm; }; this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) { this.mkDiv(xr+cx, yt+cy, w, h); this.mkDiv(xr+cx, yb+cy, w, h); this.mkDiv(xl+cx, yb+cy, w, h); this.mkDiv(xl+cx, yt+cy, w, h); }; this.setStroke(1); this.setPrintable(false); this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); this.color = '#000000'; this.htm = ''; this.wnd = wnd || window; if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); if (typeof id != 'string' || !id) this.paint = pntDoc; else { this.cnv = document.all? (this.wnd.document.all[id] || null) : document.getElementById? (this.wnd.document.getElementById(id) || null) : null; this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; } }
JavaScript
/** * Functions for the image listing, used by images.php only * @author $Author: Wei Zhuo $ * @version $Id: images.js 26 2004-03-31 02:35:21Z Wei Zhuo $ * @package ImageManager */ function i18n(str) { if(I18N) return (I18N[str] || str); else return str; }; function changeDir(newDir) { showMessage('Loading'); location.href = "images.php?dir="+newDir; } function newFolder(dir, newDir) { location.href = "images.php?dir="+dir+"&newDir="+newDir; } //update the dir list in the parent window. function updateDir(newDir) { var selection = window.top.document.getElementById('dirPath'); if(selection) { for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == newDir) { selection.selectedIndex = i; showMessage('Loading'); break; } } } } function selectImage(filename, alt, width, height) { var topDoc = window.top.document; var obj = topDoc.getElementById('f_url'); obj.value = filename; var obj = topDoc.getElementById('f_width'); obj.value = width; var obj = topDoc.getElementById('f_width'); obj.value = width; var obj = topDoc.getElementById('f_height'); obj.value = height; var obj = topDoc.getElementById('f_alt'); obj.value = alt; var obj = topDoc.getElementById('orginal_width'); obj.value = width; var obj = topDoc.getElementById('orginal_height'); obj.value = height; } function showMessage(newMessage) { var topDoc = window.top.document; var message = topDoc.getElementById('message'); var messages = topDoc.getElementById('messages'); if(message && messages) { if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(topDoc.createTextNode(i18n(newMessage))); messages.style.display = "block"; } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function confirmDeleteFile(file) { if(confirm(i18n("Delete file?"))) return true; return false; } function confirmDeleteDir(dir, count) { if(count > 0) { alert(i18n("Please delete all files/folders inside the folder you wish to delete first.")); return; } if(confirm(i18n("Delete folder?"))) return true; return false; } addEvent(window, 'load', init);
JavaScript
// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: popup.js 26 2004-03-31 02:35:21Z Wei Zhuo $ // Slightly modified for the ImageManager, window resizing is done only // by each window's script. Added translation for a few other HTML elements. function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; function comboSelectValue(c, val) { var ops = c.getElementsByTagName("option"); for (var i = ops.length; --i >= 0;) { var op = ops[i]; op.selected = (op.value == val); } c.value = val; }; function __dlg_onclose() { if(opener.Dialog._return) opener.Dialog._return(null); }; function __dlg_init(bottom) { var body = document.body; var body_height = 0; if (typeof bottom == "undefined") { var div = document.createElement("div"); body.appendChild(div); var pos = getAbsolutePos(div); body_height = pos.y; } else { var pos = getAbsolutePos(bottom); body_height = pos.y + bottom.offsetHeight; } if(opener && opener.Dialog && opener.Dialog._arguments) window.dialogArguments = opener.Dialog._arguments; if (!document.all) { //window.sizeToContent(); //window.sizeToContent(); // for reasons beyond understanding, // only if we call it twice we get the // correct size. window.addEventListener("unload", __dlg_onclose, true); // center on parent var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; window.moveTo(x, y); //window.innerWidth = body.offsetWidth + 5; //window.innerHeight = body_height + 2; } else { // window.dialogHeight = body.offsetHeight + 50 + "px"; // window.dialogWidth = body.offsetWidth + "px"; //window.resizeTo(body.offsetWidth, body_height); var ch = body.clientHeight; var cw = body.clientWidth; //window.resizeBy(body.offsetWidth - cw, body_height - ch); var W = body.offsetWidth; var H = 2 * body_height - ch; if(ch <= 0) H = body_height; var x = (screen.availWidth - W) / 2; var y = (screen.availHeight - H) / 2; window.moveTo(x, y); } document.body.onkeypress = __dlg_close_on_esc; }; function __dlg_translate(i18n) { var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"]; for (var type in types) { var spans = document.getElementsByTagName(types[type]); for (var i = spans.length; --i >= 0;) { var span = spans[i]; if (span.firstChild && span.firstChild.data) { var txt = i18n[span.firstChild.data]; if (txt) span.firstChild.data = txt; } if(span.title){ var txt = i18n[span.title]; if(txt) span.title = txt; } if(span.alt){ var txt = i18n[span.alt]; if(txt) span.alt = txt; } } } var txt = i18n[document.title]; if (txt) document.title = txt; }; // closes the dialog and passes the return info upper. function __dlg_close(val) { opener.Dialog._return(val); window.close(); }; function __dlg_close_on_esc(ev) { ev || (ev = window.event); if (ev.keyCode == 27) { window.close(); return false; } return true; };
JavaScript
// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003-2004 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo $ // Though "Dialog" looks like an object, it isn't really an object. Instead // it's just namespace for protecting global symbols. function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } Dialog._geckoOpenModal(url, action, init); }; Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); if (Dialog._modal && !Dialog._modal.closed) { Dialog._stopEvent(ev); } }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; Dialog._geckoOpenModal = function(url, action, init) { //var urlLink = "hadialog"+url.toString(); var myURL = "hadialog"+url; var regObj = /\W/g; myURL = myURL.replace(regObj,'_'); var dlg = window.open(url, myURL, "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // capture some window's events function capwin(w) { Dialog._addEvent(w, "click", Dialog._parentEvent); Dialog._addEvent(w, "mousedown", Dialog._parentEvent); Dialog._addEvent(w, "focus", Dialog._parentEvent); }; // release the captured events function relwin(w) { Dialog._removeEvent(w, "click", Dialog._parentEvent); Dialog._removeEvent(w, "mousedown", Dialog._parentEvent); Dialog._removeEvent(w, "focus", Dialog._parentEvent); }; capwin(window); // capture other frames for (var i = 0; i < window.frames.length; capwin(window.frames[i++])); // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } relwin(window); // capture other frames for (var i = 0; i < window.frames.length; relwin(window.frames[i++])); Dialog._modal = null; }; }; // event handling Dialog._addEvent = function(el, evname, func) { if (Dialog.is_ie) { el.attachEvent("on" + evname, func); } else { el.addEventListener(evname, func, true); } }; Dialog._removeEvent = function(el, evname, func) { if (Dialog.is_ie) { el.detachEvent("on" + evname, func); } else { el.removeEventListener(evname, func, true); } }; Dialog._stopEvent = function(ev) { if (Dialog.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } }; Dialog.agt = navigator.userAgent.toLowerCase(); Dialog.is_ie = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
JavaScript
/** * Functions for the ImageManager, used by manager.php only * @author $Author: Wei Zhuo $ * @version $Id: manager.js 26 2004-03-31 02:35:21Z Wei Zhuo $ * @package ImageManager */ //Translation function i18n(str) { if(I18N) return (I18N[str] || str); else return str; }; //set the alignment options function setAlign(align) { var selection = document.getElementById('f_align'); for(var i = 0; i < selection.length; i++) { if(selection.options[i].value == align) { selection.selectedIndex = i; break; } } } //initialise the form init = function () { __dlg_init(); if(I18N) __dlg_translate(I18N); var uploadForm = document.getElementById('uploadForm'); if(uploadForm) uploadForm.target = 'imgManager'; var param = window.dialogArguments; if (param) { document.getElementById("f_url").value = param["f_url"]; document.getElementById("f_alt").value = param["f_alt"]; document.getElementById("f_border").value = param["f_border"]; document.getElementById("f_vert").value = param["f_vert"]; document.getElementById("f_horiz").value = param["f_horiz"]; document.getElementById("f_width").value = param["f_width"]; document.getElementById("f_height").value = param["f_height"]; setAlign(param["f_align"]); } document.getElementById("f_url").focus(); } function onCancel() { __dlg_close(null); return false; }; function onOK() { // pass data back to the calling window var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width"]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); if(id == "f_url" && el.value.indexOf('://') < 0 ) param[id] = makeURL(base_url,el.value); else param[id] = el.value; } __dlg_close(param); return false; }; //similar to the Files::makeFile() in Files.php function makeURL(pathA, pathB) { if(pathA.substring(pathA.length-1) != '/') pathA += '/'; if(pathB.charAt(0) == '/'); pathB = pathB.substring(1); return pathA+pathB; } function updateDir(selection) { var newDir = selection.options[selection.selectedIndex].value; changeDir(newDir); } function goUpDir() { var selection = document.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; if(currentDir.length < 2) return false; var dirs = currentDir.split('/'); var search = ''; for(var i = 0; i < dirs.length - 2; i++) { search += dirs[i]+'/'; } for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == search) { selection.selectedIndex = i; var newDir = selection.options[i].value; changeDir(newDir); break; } } } function changeDir(newDir) { if(typeof imgManager != 'undefined') imgManager.changeDir(newDir); } function toggleConstrains(constrains) { var lockImage = document.getElementById('imgLock'); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { lockImage.src = "img/locked.gif"; checkConstrains('width') } else { lockImage.src = "img/unlocked.gif"; } } function checkConstrains(changed) { //alert(document.form1.constrain_prop); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { var obj = document.getElementById('orginal_width'); var orginal_width = parseInt(obj.value); var obj = document.getElementById('orginal_height'); var orginal_height = parseInt(obj.value); var widthObj = document.getElementById('f_width'); var heightObj = document.getElementById('f_height'); var width = parseInt(widthObj.value); var height = parseInt(heightObj.value); if(orginal_width > 0 && orginal_height > 0) { if(changed == 'width' && width > 0) { heightObj.value = parseInt((width/orginal_width)*orginal_height); } if(changed == 'height' && height > 0) { widthObj.value = parseInt((height/orginal_height)*orginal_width); } } } } function showMessage(newMessage) { var message = document.getElementById('message'); var messages = document.getElementById('messages'); if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(document.createTextNode(i18n(newMessage))); messages.style.display = "block"; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function doUpload() { var uploadForm = document.getElementById('uploadForm'); if(uploadForm) showMessage('Uploading'); } function refresh() { var selection = document.getElementById('dirPath'); updateDir(selection); } function newFolder() { var selection = document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; Dialog("newFolder.html", function(param) { if (!param) // user must have pressed Cancel return false; else { var folder = param['f_foldername']; if(folder == thumbdir) { alert(i18n('Invalid folder name, please choose another folder name.')); return false; } if (folder && folder != '' && typeof imgManager != 'undefined') imgManager.newFolder(dir, encodeURI(folder)); } }, null); } addEvent(window, 'load', init);
JavaScript
/** * Javascript used by the editorFrame.php, it basically initializes the frame. * @author $Author: Wei Zhuo $ * @version $Id: editorFrame.js 26 2004-03-31 02:35:21Z Wei Zhuo $ * @package ImageManager */ var topDoc = window.top.document; var t_cx = topDoc.getElementById('cx'); var t_cy = topDoc.getElementById('cy'); var t_cw = topDoc.getElementById('cw'); var t_ch = topDoc.getElementById('ch'); var m_sx = topDoc.getElementById('sx'); var m_sy = topDoc.getElementById('sy'); var m_w = topDoc.getElementById('mw'); var m_h = topDoc.getElementById('mh'); var m_a = topDoc.getElementById('ma'); var m_d = topDoc.getElementById('md'); var s_sw = topDoc.getElementById('sw'); var s_sh = topDoc.getElementById('sh'); var r_ra = topDoc.getElementById('ra'); var pattern = "img/2x2.gif"; function doSubmit(action) { if (action == 'crop') { var url = "editorFrame.php?img="+currentImageFile+"&action=crop&params="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value); //alert(url); location.href = url; //location.reload(); } else if (action == 'scale') { var url = "editorFrame.php?img="+currentImageFile+"&action=scale&params="+parseInt(s_sw.value)+','+parseInt(s_sh.value); //alert(url); location.href = url; } else if (action == 'rotate') { var flip = topDoc.getElementById('flip'); if(flip.value == 'hoz' || flip.value == 'ver') location.href = "editorFrame.php?img="+currentImageFile+"&action=flip&params="+flip.value; else if (isNaN(parseFloat(r_ra.value))==false) location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate&params="+parseFloat(r_ra.value); } else if(action == 'save') { var s_file = topDoc.getElementById('save_filename'); var s_format = topDoc.getElementById('save_format'); var s_quality = topDoc.getElementById('quality'); var format = s_format.value.split(","); if(s_file.value.length <= 0) { alert(i18n('Please enter a filename to save.')); } else { var filename = encodeURI(s_file.value); var quality = parseInt(s_quality.value); var url = "editorFrame.php?img="+currentImageFile+"&action=save&params="+format[0]+","+quality+"&file="+filename; //alert(url); location.href = url; } } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } var jg_doc init = function() { jg_doc = new jsGraphics("imgCanvas"); // draw directly into document jg_doc.setColor("#000000"); // black initEditor(); } addEvent(window, 'load', init);
JavaScript
// Spell Checker Plugin for HTMLArea-3.0 // Sponsored by www.americanbible.org // Implementation by Mihai Bazon, http://dynarch.com/mishoo/ // // (c) dynarch.com 2003-2005. // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). // // $Id: spell-check-ui.js,v 1.11 2005/01/20 17:49:03 mishoo Exp $ // internationalization file was already loaded in parent ;-) var SpellChecker = window.opener.SpellChecker; var i18n = SpellChecker.I18N; var HTMLArea = window.opener.HTMLArea; var is_ie = HTMLArea.is_ie; var editor = SpellChecker.editor; var frame = null; var currentElement = null; var wrongWords = null; var modified = false; var allWords = {}; var fixedWords = []; var suggested_words = {}; function makeCleanDoc(leaveFixed) { // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML'; var words = wrongWords.concat(fixedWords); for (var i = words.length; --i >= 0;) { var el = words[i]; if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) { el.parentNode.insertBefore(el.firstChild, el); el.parentNode.removeChild(el); } else el.className = "HA-spellcheck-fixed"; } // we should use innerHTML here, but IE6's implementation fucks up the // HTML to such extent that our poor Perl parser doesn't understand it // anymore. return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor); }; function recheckClicked() { document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".'; var field = document.getElementById("f_content"); field.value = makeCleanDoc(true); field.form.submit(); }; function saveClicked() { if (modified) { editor.setHTML(makeCleanDoc(false)); } window.close(); return false; }; function cancelClicked() { var ok = true; if (modified) { ok = confirm(i18n["QUIT_CONFIRMATION"]); } if (ok) { window.close(); } return false; }; function replaceWord(el) { var replacement = document.getElementById("v_replacement").value; var this_word_modified = (el.innerHTML != replacement); if (this_word_modified) modified = true; if (el) { el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " "); } el.className += " HA-spellcheck-fixed"; el.__msh_fixed = true; if (!this_word_modified) { return false; } el.innerHTML = replacement; }; function replaceClicked() { replaceWord(currentElement); var start = currentElement.__msh_id; var index = start; do { ++index; if (index == wrongWords.length) { index = 0; } } while ((index != start) && wrongWords[index].__msh_fixed); if (index == start) { index = 0; alert(i18n["Finished list of mispelled words"]); } wrongWords[index].__msh_wordClicked(true); return false; }; function revertClicked() { document.getElementById("v_replacement").value = currentElement.__msh_origWord; replaceWord(currentElement); currentElement.className = "HA-spellcheck-error HA-spellcheck-current"; return false; }; function replaceAllClicked() { var replacement = document.getElementById("v_replacement").value; var ok = true; var spans = allWords[currentElement.__msh_origWord]; if (spans.length == 0) { alert("An impossible condition just happened. Call CIA. ;-)"); } else if (spans.length == 1) { replaceClicked(); return false; } /* var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n"; if (replacement == currentElement.__msh_origWord) { ok = confirm(message + "Ignore all occurrences?"); } else { ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?"); } */ if (ok) { for (var i = 0; i < spans.length; ++i) { if (spans[i] != currentElement) { replaceWord(spans[i]); } } // replace current element the last, so that we jump to the next word ;-) replaceClicked(); } return false; }; function ignoreClicked() { document.getElementById("v_replacement").value = currentElement.__msh_origWord; replaceClicked(); return false; }; function ignoreAllClicked() { document.getElementById("v_replacement").value = currentElement.__msh_origWord; replaceAllClicked(); return false; }; function learnClicked() { alert("Not [yet] implemented"); return false; }; function internationalizeWindow() { var types = ["div", "span", "button"]; for (var i = 0; i < types.length; ++i) { var tag = types[i]; var els = document.getElementsByTagName(tag); for (var j = els.length; --j >= 0;) { var el = els[j]; if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) { var txt = el.innerHTML; if (typeof i18n[txt] != "undefined") { el.innerHTML = i18n[txt]; } } } } }; function initDocument() { internationalizeWindow(); modified = false; frame = document.getElementById("i_framecontent"); var field = document.getElementById("f_content"); field.value = HTMLArea.getHTML(editor._doc.body, false, editor); field.form.submit(); document.getElementById("f_init").value = "0"; // assign some global event handlers var select = document.getElementById("v_suggestions"); select.onchange = function() { document.getElementById("v_replacement").value = this.value; }; if (is_ie) { select.attachEvent("ondblclick", replaceClicked); } else { select.addEventListener("dblclick", replaceClicked, true); } document.getElementById("b_replace").onclick = replaceClicked; // document.getElementById("b_learn").onclick = learnClicked; document.getElementById("b_replall").onclick = replaceAllClicked; document.getElementById("b_ignore").onclick = ignoreClicked; document.getElementById("b_ignall").onclick = ignoreAllClicked; document.getElementById("b_recheck").onclick = recheckClicked; document.getElementById("b_revert").onclick = revertClicked; document.getElementById("b_info").onclick = displayInfo; document.getElementById("b_ok").onclick = saveClicked; document.getElementById("b_cancel").onclick = cancelClicked; select = document.getElementById("v_dictionaries"); select.onchange = function() { document.getElementById("f_dictionary").value = this.value; }; }; function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; function wordClicked(scroll) { var self = this; if (scroll) (function() { var pos = getAbsolutePos(self); var ws = { x: frame.offsetWidth - 4, y: frame.offsetHeight - 4 }; var wp = { x: frame.contentWindow.document.body.scrollLeft, y: frame.contentWindow.document.body.scrollTop }; pos.x -= Math.round(ws.x/2); if (pos.x < 0) pos.x = 0; pos.y -= Math.round(ws.y/2); if (pos.y < 0) pos.y = 0; frame.contentWindow.scrollTo(pos.x, pos.y); })(); if (currentElement) { var a = allWords[currentElement.__msh_origWord]; currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " "); for (var i = 0; i < a.length; ++i) { var el = a[i]; if (el != currentElement) { el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " "); } } } currentElement = this; this.className += " HA-spellcheck-current"; var a = allWords[currentElement.__msh_origWord]; for (var i = 0; i < a.length; ++i) { var el = a[i]; if (el != currentElement) { el.className += " HA-spellcheck-same"; } } // document.getElementById("b_replall").disabled = (a.length <= 1); // document.getElementById("b_ignall").disabled = (a.length <= 1); var txt; if (a.length == 1) { txt = "one occurrence"; } else if (a.length == 2) { txt = "two occurrences"; } else { txt = a.length + " occurrences"; } var suggestions = suggested_words[this.__msh_origWord]; if (suggestions) suggestions = suggestions.split(/,/); else suggestions = []; var select = document.getElementById("v_suggestions"); document.getElementById("statusbar").innerHTML = "Found " + txt + ' for word "<b>' + currentElement.__msh_origWord + '</b>"'; for (var i = select.length; --i >= 0;) { select.remove(i); } for (var i = 0; i < suggestions.length; ++i) { var txt = suggestions[i]; var option = document.createElement("option"); option.value = txt; option.appendChild(document.createTextNode(txt)); select.appendChild(option); } document.getElementById("v_currentWord").innerHTML = this.__msh_origWord; if (suggestions.length > 0) { select.selectedIndex = 0; select.onchange(); } else { document.getElementById("v_replacement").value = this.innerHTML; } select.style.display = "none"; select.style.display = "block"; return false; }; function wordMouseOver() { this.className += " HA-spellcheck-hover"; }; function wordMouseOut() { this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " "); }; function displayInfo() { var info = frame.contentWindow.spellcheck_info; if (!info) alert("No information available"); else { var txt = "** Document information **"; for (var i in info) { txt += "\n" + i + " : " + info[i]; } alert(txt); } return false; }; function finishedSpellChecking() { // initialization of global variables currentElement = null; wrongWords = null; allWords = {}; fixedWords = []; suggested_words = frame.contentWindow.suggested_words; document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)"; var doc = frame.contentWindow.document; var spans = doc.getElementsByTagName("span"); var sps = []; var id = 0; for (var i = 0; i < spans.length; ++i) { var el = spans[i]; if (/HA-spellcheck-error/.test(el.className)) { sps.push(el); el.__msh_wordClicked = wordClicked; el.onclick = function(ev) { ev || (ev = window.event); ev && HTMLArea._stopEvent(ev); return this.__msh_wordClicked(false); }; el.onmouseover = wordMouseOver; el.onmouseout = wordMouseOut; el.__msh_id = id++; var txt = (el.__msh_origWord = el.firstChild.data); el.__msh_fixed = false; if (typeof allWords[txt] == "undefined") { allWords[txt] = [el]; } else { allWords[txt].push(el); } } else if (/HA-spellcheck-fixed/.test(el.className)) { fixedWords.push(el); } } wrongWords = sps; if (sps.length == 0) { if (!modified) { alert(i18n["NO_ERRORS_CLOSING"]); window.close(); } else { alert(i18n["NO_ERRORS"]); } return false; } (currentElement = sps[0]).__msh_wordClicked(true); var as = doc.getElementsByTagName("a"); for (var i = as.length; --i >= 0;) { var a = as[i]; a.onclick = function() { if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" + this.href + "\n" + i18n["I will open it in a new page."])) { window.open(this.href); } return false; }; } var dicts = doc.getElementById("HA-spellcheck-dictionaries"); if (dicts) { dicts.parentNode.removeChild(dicts); dicts = dicts.innerHTML.split(/,/); var select = document.getElementById("v_dictionaries"); for (var i = select.length; --i >= 0;) { select.remove(i); } for (var i = 0; i < dicts.length; ++i) { var txt = dicts[i]; var option = document.createElement("option"); if (/^@(.*)$/.test(txt)) { txt = RegExp.$1; option.selected = true; } option.value = txt; option.appendChild(document.createTextNode(txt)); select.appendChild(option); } } };
JavaScript
// Spell Checker Plugin for HTMLArea-3.0 // Sponsored by www.americanbible.org // Implementation by Mihai Bazon, http://dynarch.com/mishoo/ // // (c) dynarch.com 2003-2005. // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). // // $Id: spell-checker.js,v 1.9 2005/01/20 17:49:02 mishoo Exp $ function SpellChecker(editor) { this.editor = editor; var cfg = editor.config; var tt = SpellChecker.I18N; var bl = SpellChecker.btnList; var self = this; // register the toolbar buttons provided by this plugin var toolbar = []; for (var i = 0; i < bl.length; ++i) { var btn = bl[i]; if (!btn) { toolbar.push("separator"); } else { var id = "SC-" + btn[0]; cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false, function(editor, id) { // dispatch button press event self.buttonPress(editor, id); }, btn[1]); toolbar.push(id); } } for (var i = 0; i < toolbar.length; ++i) { cfg.toolbar[0].push(toolbar[i]); } }; SpellChecker._pluginInfo = { name : "SpellChecker", version : "1.0", developer : "Mihai Bazon", developer_url : "http://dynarch.com/mishoo/", c_owner : "Mihai Bazon", sponsor : "American Bible Society", sponsor_url : "http://www.americanbible.org", license : "htmlArea" }; SpellChecker.btnList = [ null, // separator ["spell-check"] ]; SpellChecker.prototype.buttonPress = function(editor, id) { switch (id) { case "SC-spell-check": SpellChecker.editor = editor; SpellChecker.init = true; var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html"; var win; if (HTMLArea.is_ie) { win = window.open(uiurl, "SC_spell_checker", "toolbar=no,location=no,directories=no,status=no,menubar=no," + "scrollbars=no,resizable=yes,width=600,height=450"); } else { win = window.open(uiurl, "SC_spell_checker", "toolbar=no,menubar=no,personalbar=no,width=600,height=450," + "scrollbars=no,resizable=yes"); } win.focus(); break; } }; // this needs to be global, it's accessed from spell-check-ui.html SpellChecker.editor = null;
JavaScript
// I18N constants // LANG: "nl", ENCODING: UTF-8 | ISO-8859-1 // Author: A.H van den Broek http://www.kontaktfm.nl // Email : tonbroek@kontaktfm.nl // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Weet u zeker dat u deze link wilt openen?", "Cancel" : "Annuleer", "Dictionary" : "Woordenboek", "Finished list of mispelled words" : "klaar met de lijst van fouten woorden", "I will open it in a new page." : "Ik zal het in een nieuwe pagina openen.", "Ignore all" : "alles overslaan", "Ignore" : "Overslaan", "NO_ERRORS" : "Geen fouten gevonden met dit woordenboek.", "NO_ERRORS_CLOSING" : "Spell checking is klaar, geen fouten gevonden. spell checking word gesloten...", "OK" : "OK", "Original word" : "Originele woord", "Please wait. Calling spell checker." : "Even wachten. spell checker wordt geladen.", "Please wait: changing dictionary to" : "even wachten: woordenboek wordt veranderd naar", "QUIT_CONFIRMATION" : "Dit zal alle veranderingen annuleren en de spell checker sluiten. Weet u het zeker?", "Re-check" : "Opnieuw", "Replace all" : "Alles vervangen", "Replace with" : "Vervangen met", "Replace" : "Vervangen", "Revert" : "Omkeren", "SC-spell-check" : "Spell-check", "Suggestions" : "Suggestie", "pliz weit ;-)" : "Even wachten ;-)" };
JavaScript
// I18N constants // LANG: "it", ENCODING: UTF-8 | ISO-8859-1 // Author: Fabio Rotondo, <fabio@rotondo.it> SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Devi confermare l'apertura di questo link", "Cancel" : "Annulla", "Dictionary" : "Dizionario", "Finished list of mispelled words" : "La lista delle parole scritte male è terminata", "I will open it in a new page." : "Lo aprirò in una nuova pagina.", "Ignore all" : "Ignora sempre", "Ignore" : "Ignora", "NO_ERRORS" : "Non sono state trovate parole scritte male con il dizionario selezionato.", "NO_ERRORS_CLOSING" : "Controllo completato, non sono state trovate parole scritte male. Sto chiudendo...", "OK" : "OK", "Original word" : "Parola originale", "Please wait. Calling spell checker." : "Attendere. Sto invocando lo Spell Checker.", "Please wait: changing dictionary to" : "Attendere. Cambio il dizionario in", "QUIT_CONFIRMATION" : "Questo annullerà le modifiche e chiuderà lo Spell Checker. Conferma.", "Re-check" : "Ricontrolla", "Replace all" : "Sostituisci sempre", "Replace with" : "Stostituisci con", "Replace" : "Sostituisci", "SC-spell-check" : "Spell-check", "Suggestions" : "Suggerimenti", "pliz weit ;-)" : "Attendere Prego ;-)" };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Broxx, <broxx@broxx.com> SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Wollen Sie diesen Link oeffnen", "Cancel" : "Abbrechen", "Dictionary" : "Woerterbuch", "Finished list of mispelled words" : "Liste der nicht bekannten Woerter", "I will open it in a new page." : "Wird auf neuer Seite geoeffnet", "Ignore all" : "Alle ignorieren", "Ignore" : "Ignorieren", "NO_ERRORS" : "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden", "NO_ERRORS_CLOSING" : "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt. Wird nun geschlossen...", "OK" : "OK", "Original word" : "Original Wort", "Please wait. Calling spell checker." : "Bitte warten. Woerterbuch wird durchsucht.", "Please wait: changing dictionary to" : "Bitte warten: Woerterbuch wechseln zu", "QUIT_CONFIRMATION" : "Aenderungen werden nicht uebernommen. Bitte bestaettigen.", "Re-check" : "Neuueberpruefung", "Replace all" : "Alle ersetzen", "Replace with" : "Ersetzen mit", "Replace" : "Ersetzen", "SC-spell-check" : "Ueberpruefung", "Suggestions" : "Vorschlag", "pliz weit ;-)" : "bittsche wartn ;-)" };
JavaScript
// I18N constants // LANG: "hu", ENCODING: UTF-8 // Author: Miklós Somogyi, <somogyine@vnet.hu> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Megerősítés", "Cancel" : "Mégsem", "Dictionary" : "Szótár", "Finished list of mispelled words" : "A tévesztett szavak listájának vége", "I will open it in a new page." : "Megnyitás új lapon", "Ignore all" : "Minden elvetése", "Ignore" : "Elvetés", "NO_ERRORS" : "A választott szótár szerint nincs tévesztett szó.", "NO_ERRORS_CLOSING" : "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...", "OK" : "Rendben", "Original word" : "Eredeti szó", "Please wait. Calling spell checker." : "Kis türelmet, a helyesírásellenőrző hívása folyamatban.", "Please wait: changing dictionary to" : "Kis türelmet, szótár cseréje", "QUIT_CONFIRMATION" : "Kilépés a változások eldobásával. Jóváhagyja?", "Re-check" : "Újraellenőrzés", "Replace all" : "Mind cseréje", "Replace with" : "Csere a következőre:", "Replace" : "Csere", "SC-spell-check" : "Helyesírásellenőrzés", "Suggestions" : "Tippek", "pliz weit ;-)" : "Kis türelmet ;-)" };
JavaScript
// I18N constants // LANG: "cz", ENCODING: UTF-8 | ISO-8859-2 // Author: Jiri Löw, <jirilow@jirilow.com> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Prosím potvrďte otevření tohoto odkazu", "Cancel" : "Zrušit", "Dictionary" : "Slovník", "Finished list of mispelled words" : "Dokončen seznam chybných slov", "I will open it in a new page." : "Bude otevřen jej v nové stránce.", "Ignore all" : "Ignorovat vše", "Ignore" : "Ignorovat", "NO_ERRORS" : "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.", "NO_ERRORS_CLOSING" : "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...", "OK" : "OK", "Original word" : "Původní slovo", "Please wait. Calling spell checker." : "Prosím čekejte. Komunikuace s kontrolou správnosti slov.", "Please wait: changing dictionary to" : "Prosím čekejte: změna adresáře na", "QUIT_CONFIRMATION" : "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.", "Re-check" : "Překontrolovat", "Replace all" : "Zaměnit všechno", "Replace with" : "Zaměnit za", "Replace" : "Zaměnit", "SC-spell-check" : "Kontrola správnosti slov", "Suggestions" : "Doporučení", "pliz weit ;-)" : "strpení prosím ;-)" };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Please confirm that you want to open this link", "Cancel" : "Cancel", "Dictionary" : "Dictionary", "Finished list of mispelled words" : "Finished list of mispelled words", "I will open it in a new page." : "I will open it in a new page.", "Ignore all" : "Ignore all", "Ignore" : "Ignore", "NO_ERRORS" : "No mispelled words found with the selected dictionary.", "NO_ERRORS_CLOSING" : "Spell check complete, didn't find any mispelled words. Closing now...", "OK" : "OK", "Original word" : "Original word", "Please wait. Calling spell checker." : "Please wait. Calling spell checker.", "Please wait: changing dictionary to" : "Please wait: changing dictionary to", "QUIT_CONFIRMATION" : "This will drop changes and quit spell checker. Please confirm.", "Re-check" : "Re-check", "Replace all" : "Replace all", "Replace with" : "Replace with", "Replace" : "Replace", "Revert" : "Revert", "SC-spell-check" : "Spell-check", "Suggestions" : "Suggestions", "pliz weit ;-)" : "pliz weit ;-)" };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Steen Sønderup, <steen@soenderup.com> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Vil du følge dette link?", "Cancel" : "Anuler", "Dictionary" : "Ordbog", "Finished list of mispelled words" : "Listen med stavefejl er gennemgået", "I will open it in a new page." : "Jeg vil åbne det i en ny side.", "Ignore all" : "Ignorer alle", "Ignore" : "Ignorer", "NO_ERRORS" : "Der blev ikke fundet nogle stavefejl med den valgte ordbog.", "NO_ERRORS_CLOSING" : "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl. Lukker...", "OK" : "OK", "Original word" : "Oprindeligt ord", "Please wait. Calling spell checker." : "Vent venligst. Henter stavekontrol.", "Please wait: changing dictionary to" : "Vent venligst: skifter ordbog til", "QUIT_CONFIRMATION" : "Alle dine ændringer vil gå tabt, vil du fortsætte?", "Re-check" : "Tjek igen", "Replace all" : "Erstat alle", "Replace with" : "Erstat med", "Replace" : "Erstat", "SC-spell-check" : "Stavekontrol", "Suggestions" : "Forslag", "pliz weit ;-)" : "Vent venligst" };
JavaScript
// I18N constants // LANG: "ro", ENCODING: UTF-8 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "Vă rog confirmaţi că vreţi să deschideţi acest link", "Cancel" : "Anulează", "Dictionary" : "Dicţionar", "Finished list of mispelled words" : "Am terminat lista de cuvinte greşite", "I will open it in a new page." : "O voi deschide într-o altă fereastră.", "Ignore all" : "Ignoră toate", "Ignore" : "Ignoră", "NO_ERRORS" : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.", "NO_ERRORS_CLOSING" : "Am terminat, nu am detectat nici o greşeală. Acum închid fereastra...", "OK" : "OK", "Original word" : "Cuvântul original", "Please wait. Calling spell checker." : "Vă rog aşteptaţi. Apelez spell-checker-ul.", "Please wait: changing dictionary to" : "Vă rog aşteptaţi. Schimb dicţionarul cu", "QUIT_CONFIRMATION" : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?", "Re-check" : "Scanează", "Replace all" : "Înlocuieşte toate", "Replace with" : "Înlocuieşte cu", "Replace" : "Înlocuieşte", "SC-spell-check" : "Detectează greşeli", "Suggestions" : "Sugestii", "pliz weit ;-)" : "va rog ashteptatzi ;-)" };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "אנא אשר שברצונך לפתוח קישור זה", "Cancel" : "ביטול", "Dictionary" : "מילון", "Finished list of mispelled words" : "הסתיימה רשימת המילים המאויתות באופן שגוי", "I will open it in a new page." : "אני אפתח את זה בחלון חדש.", "Ignore all" : "התעלם מהכל", "Ignore" : "התעלם", "NO_ERRORS" : "לא נמצאו מילים מאויתות באופן שגוי עם המילון הנבחר.", "NO_ERRORS_CLOSING" : "בדיקת האיות נסתיימה, לא נמצאו מילים מאויתות באופן שגוי. נסגר כעת...", "OK" : "אישור", "Original word" : "המילה המקורית", "Please wait. Calling spell checker." : "אנא המתן. קורא לבודק איות.", "Please wait: changing dictionary to" : "אנא המתן: מחליף מילון ל-", "QUIT_CONFIRMATION" : "זה יבטל את השינויים ויצא מבודק האיות. אנא אשר.", "Re-check" : "בדוק מחדש", "Replace all" : "החלף הכל", "Replace with" : "החלף ב-", "Replace" : "החלף", "Revert" : "החזר שינויים", "SC-spell-check" : "בדיקת איות", "Suggestions" : "הצעות", "pliz weit ;-)" : "ענא המטן ;-)" };
JavaScript
// I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Adam Wright, http://blog.hipikat.org/ // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) HtmlTidy.I18N = { "tidying" : "\n Tidying up the HTML source, please wait...", "HT-html-tidy" : "HTML Tidy" };
JavaScript
// Plugin for htmlArea to run code through the server's HTML Tidy // By Adam Wright, for The University of Western Australia // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). function HtmlTidy(editor) { this.editor = editor; var cfg = editor.config; var tt = HtmlTidy.I18N; var bl = HtmlTidy.btnList; var self = this; this.onMode = this.__onMode; // register the toolbar buttons provided by this plugin var toolbar = []; for (var i = 0; i < bl.length; ++i) { var btn = bl[i]; if (btn == "html-tidy") { var id = "HT-html-tidy"; cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true, function(editor, id) { // dispatch button press event self.buttonPress(editor, id); }, btn[1]); toolbar.push(id); } else if (btn == "html-auto-tidy") { var ht_class = { id : "HT-auto-tidy", options : { "Auto-Tidy" : "auto", "Don't Tidy" : "noauto" }, action : function (editor) { self.__onSelect(editor, this); }, refresh : function (editor) { }, context : "body" }; cfg.registerDropdown(ht_class); } } for (var i in toolbar) { cfg.toolbar[0].push(toolbar[i]); } }; HtmlTidy._pluginInfo = { name : "HtmlTidy", version : "1.0", developer : "Adam Wright", developer_url : "http://blog.hipikat.org/", sponsor : "The University of Western Australia", sponsor_url : "http://www.uwa.edu.au/", license : "htmlArea" }; HtmlTidy.prototype.__onSelect = function(editor, obj) { // Get the toolbar element object var elem = editor._toolbarObjects[obj.id].element; // Set our onMode event appropriately if (elem.value == "auto") this.onMode = this.__onMode; else this.onMode = null; }; HtmlTidy.prototype.__onMode = function(mode) { if ( mode == "textmode" ) { this.buttonPress(this.editor, "HT-html-tidy"); } }; HtmlTidy.btnList = [ null, // separator ["html-tidy"], ["html-auto-tidy"] ]; HtmlTidy.prototype.onGenerateOnce = function() { var editor = this.editor; var ifr = document.createElement("iframe"); ifr.name = "htiframe_name"; var s = ifr.style; s.position = "absolute"; s.width = s.height = s.border = s.left = s.top = s.padding = s.margin = "0px"; document.body.appendChild(ifr); var frm = '<form id="htiform_id" name="htiform_name" method="post" target="htiframe_name" action="'; frm += _editor_url + 'plugins/HtmlTidy/html-tidy-logic.php'; frm += '"><textarea name="htisource_name" id="htisource_id">'; frm += '</textarea></form>'; var newdiv = document.createElement('div'); newdiv.style.display = "none"; newdiv.innerHTML = frm; document.body.appendChild(newdiv); }; HtmlTidy.prototype.buttonPress = function(editor, id) { var i18n = HtmlTidy.I18N; switch (id) { case "HT-html-tidy": var oldhtml = editor.getHTML(); // Ask the server for some nice new html, based on the old... var myform = document.getElementById('htiform_id'); var txtarea = document.getElementById('htisource_id'); txtarea.value = editor.getHTML(); // Apply the 'meanwhile' text, e.g. "Tidying HTML, please wait..." editor.setHTML(i18n['tidying']); // The returning tidying processing script needs to find the editor window._editorRef = editor; // ...And send our old source off for processing! myform.submit(); break; } }; HtmlTidy.prototype.processTidied = function(newSrc) { editor = this.editor; editor.setHTML(newSrc); };
JavaScript
// FullPage Plugin for HTMLArea-3.0 // Implementation by Mihai Bazon. Sponsored by http://thycotic.com // // (c) dynarch.com 2003-2005. // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). // // $Id: full-page.js,v 1.4 2005/01/20 17:49:03 mishoo Exp $ function FullPage(editor) { this.editor = editor; var cfg = editor.config; cfg.fullPage = true; var tt = FullPage.I18N; var self = this; cfg.registerButton("FP-docprop", tt["Document properties"], editor.imgURL("docprop.gif", "FullPage"), false, function(editor, id) { self.buttonPress(editor, id); }); // add a new line in the toolbar cfg.toolbar[0].splice(0, 0, "separator"); cfg.toolbar[0].splice(0, 0, "FP-docprop"); }; FullPage._pluginInfo = { name : "FullPage", version : "1.0", developer : "Mihai Bazon", developer_url : "http://dynarch.com/mishoo/", c_owner : "Mihai Bazon", sponsor : "Thycotic Software Ltd.", sponsor_url : "http://thycotic.com", license : "htmlArea" }; FullPage.prototype.buttonPress = function(editor, id) { var self = this; switch (id) { case "FP-docprop": var doc = editor._doc; var links = doc.getElementsByTagName("link"); var style1 = ''; var style2 = ''; var charset = ''; for (var i = links.length; --i >= 0;) { var link = links[i]; if (/stylesheet/i.test(link.rel)) { if (/alternate/i.test(link.rel)) style2 = link.href; else style1 = link.href; } } var metas = doc.getElementsByTagName("meta"); for (var i = metas.length; --i >= 0;) { var meta = metas[i]; if (/content-type/i.test(meta.httpEquiv)) { r = /^text\/html; *charset=(.*)$/i.exec(meta.content); charset = r[1]; } } var title = doc.getElementsByTagName("title")[0]; title = title ? title.innerHTML : ''; var init = { f_doctype : editor.doctype, f_title : title, f_body_bgcolor : HTMLArea._colorToRgb(doc.body.style.backgroundColor), f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color), f_base_style : style1, f_alt_style : style2, f_charset : charset, editor : editor }; editor._popupDialog("plugin://FullPage/docprop", function(params) { self.setDocProp(params); }, init); break; } }; FullPage.prototype.setDocProp = function(params) { var txt = ""; var doc = this.editor._doc; var head = doc.getElementsByTagName("head")[0]; var links = doc.getElementsByTagName("link"); var metas = doc.getElementsByTagName("meta"); var style1 = null; var style2 = null; var charset = null; var charset_meta = null; for (var i = links.length; --i >= 0;) { var link = links[i]; if (/stylesheet/i.test(link.rel)) { if (/alternate/i.test(link.rel)) style2 = link; else style1 = link; } } for (var i = metas.length; --i >= 0;) { var meta = metas[i]; if (/content-type/i.test(meta.httpEquiv)) { r = /^text\/html; *charset=(.*)$/i.exec(meta.content); charset = r[1]; charset_meta = meta; } } function createLink(alt) { var link = doc.createElement("link"); link.rel = alt ? "alternate stylesheet" : "stylesheet"; head.appendChild(link); return link; }; function createMeta(name, content) { var meta = doc.createElement("meta"); meta.httpEquiv = name; meta.content = content; head.appendChild(meta); return meta; }; if (!style1 && params.f_base_style) style1 = createLink(false); if (params.f_base_style) style1.href = params.f_base_style; else if (style1) head.removeChild(style1); if (!style2 && params.f_alt_style) style2 = createLink(true); if (params.f_alt_style) style2.href = params.f_alt_style; else if (style2) head.removeChild(style2); if (charset_meta) { head.removeChild(charset_meta); charset_meta = null; } if (!charset_meta && params.f_charset) charset_meta = createMeta("Content-Type", "text/html; charset="+params.f_charset); for (var i in params) { var val = params[i]; switch (i) { case "f_title": var title = doc.getElementsByTagName("title")[0]; if (!title) { title = doc.createElement("title"); head.appendChild(title); } else while (node = title.lastChild) title.removeChild(node); if (!HTMLArea.is_ie) title.appendChild(doc.createTextNode(val)); else doc.title = val; break; case "f_doctype": this.editor.setDoctype(val); break; case "f_body_bgcolor": doc.body.style.backgroundColor = val; break; case "f_body_fgcolor": doc.body.style.color = val; break; } } };
JavaScript
// I18N for the FullPage plugin // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Holger Hees, http://www.systemconcept.de // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) FullPage.I18N = { "Alternate style-sheet:": "Alternativer Stylesheet:", "Background color:": "Hintergrundfarbe:", "Cancel": "Abbrechen", "DOCTYPE:": "DOCTYPE:", "Document properties": "Dokumenteigenschaften", "Document title:": "Dokumenttitel:", "OK": "OK", "Primary style-sheet:": "Stylesheet:", "Text color:": "Textfarbe:" };
JavaScript
// I18N for the FullPage plugin // LANG: "fr", ENCODING: UTF-8 | ISO-8859-1 // Author: Cédric Guillemette, http://www.ebdata.com // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) FullPage.I18N = { "Alternate style-sheet:": "Feuille de style alternative:", "Background color:": "Couleur d'arrière plan:", "Cancel": "Annuler", "DOCTYPE:": "DOCTYPE:", "Document properties": "Propriétés de document", "Document title:": "Titre du document:", "OK": "OK", "Primary style-sheet:": "Feuille de style primaire:", "Text color:": "Couleur de texte:" };
JavaScript
// I18N for the FullPage plugin // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) FullPage.I18N = { "Alternate style-sheet:": "Alternate style-sheet:", "Background color:": "Background color:", "Cancel": "Cancel", "DOCTYPE:": "DOCTYPE:", "Document properties": "Document properties", "Document title:": "Document title:", "OK": "OK", "Primary style-sheet:": "Primary style-sheet:", "Text color:": "Text color:" };
JavaScript
// I18N for the FullPage plugin // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) FullPage.I18N = { "Alternate style-sheet:": "Template CSS alternativ:", "Background color:": "Culoare de fundal:", "Cancel": "Renunţă", "DOCTYPE:": "DOCTYPE:", "Document properties": "Proprietăţile documentului", "Document title:": "Titlul documentului:", "OK": "Acceptă", "Primary style-sheet:": "Template CSS principal:", "Text color:": "Culoare text:" };
JavaScript
// I18N for the FullPage plugin // LANG: "he", ENCODING: UTF-8 // Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) FullPage.I18N = { "Alternate style-sheet:": "גיליון סגנון אחר:", "Background color:": "צבע רקע:", "Cancel": "ביטול", "DOCTYPE:": "DOCTYPE:", "Document properties": "מאפייני מסמך", "Document title:": "כותרת מסמך:", "OK": "אישור", "Primary style-sheet:": "גיליון סגנון ראשי:", "Text color:": "צבע טקסט:" };
JavaScript
// I18N constants // LANG: "nl", ENCODING: UTF-8 | ISO-8859-1 // Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) TableOperations.I18N = { "Align": "Uitlijning", "All four sides": "Alle 4 zijden", "Background": "Achtergrond", "Baseline": "Basis", "Border": "Rand", "Borders": "Randen", "Bottom": "Onder", "CSS Style": "CSS Style", "Caption": "Opmerking", "Cell Properties": "Celeigenschappen", "Center": "Centreren", "Char": "Karakter", "Collapsed borders": "Geen randen", "Color": "Kleur", "Description": "Omschrijving", "FG Color": "Voorgrond", "Float": "Zwevend", "Frames": "Frames", "Height": "Hoogte", "How many columns would you like to merge?": "Hoeveel kolommen wilt u samenvoegen?", "How many rows would you like to merge?": "Hoeveel rijen wilt u samenvoegen?", "Image URL": "Afbeelding URL", "Justify": "Uitvullen", "Layout": "Opmaak", "Left": "Links", "Margin": "Marge", "Middle": "Midden", "No rules": "Geen regels", "No sides": "Geen zijlijnen", "None": "Geen", "Padding": "Celmarge", "Please click into some cell": "Klik in een cel a.u.b.", "Right": "Rechts", "Row Properties": "Rijeigenschappen", "Rules will appear between all rows and columns": "Regels verschijnen tussen alle rijen en kolommen", "Rules will appear between columns only": "Regels verschijnen enkel tussen de kolommen", "Rules will appear between rows only": "Regels verschijnen enkel tussen de rijen", "Rules": "Regels", "Spacing and padding": "Celmarge en afstand tussen cellen", "Spacing": "marge", "Summary": "Overzicht", "TO-cell-delete": "Cel verwijderen", "TO-cell-insert-after": "Voeg cel toe achter", "TO-cell-insert-before": "Voeg cel toe voor", "TO-cell-merge": "Cellen samenvoegen", "TO-cell-prop": "Celeigenschappen", "TO-cell-split": "Cel splitsen", "TO-col-delete": "Kolom verwijderen", "TO-col-insert-after": "Kolom invoegen achter", "TO-col-insert-before": "Kolom invoegen voor", "TO-col-split": "Kolom splitsen", "TO-row-delete": "Rij verwijderen", "TO-row-insert-above": "Rij invoegen boven", "TO-row-insert-under": "Rij invoegen onder", "TO-row-prop": "Rij eigenschappen", "TO-row-split": "Rij splitsen", "TO-table-prop": "Tabel eigenschappen", "Table Properties": "Tabel eigenschappen", "Text align": "Text uitlijning", "The bottom side only": "Enkel aan de onderkant", "The left-hand side only": "Enkel aan de linkerkant", "The right and left sides only": "Enkel aan de linker en rechterkant", "The right-hand side only": "Enkel aan de rechterkant", "The top and bottom sides only": "Enkel aan de bovenen onderkant", "The top side only": "Enkel aan de bovenkant", "Top": "Boven", "Unset color": "Wis kleur", "Vertical align": "Vertikale uitlijning", "Width": "Breedte", "not-del-last-cell": "HTMLArea kan de laatste cel in deze tabel niet verwijderen.", "not-del-last-col": "HTMLArea kan de laatste kolom in deze tabel niet verwijderen.", "not-del-last-row": "HTMLArea kan de laatste rij in deze tabel niet verwijderen.", "percent": "procent", "pixels": "pixels" };
JavaScript