code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Insert special character": "特殊文字を挿入",
"Cancel": "中止"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharacterMap/lang/ja.js | JavaScript | art | 129 |
// I18N constants
// LANG: "nb", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"Insert special character": "Sett inn tegn",
"Cancel": "Avbryt"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharacterMap/lang/nb.js | JavaScript | art | 196 |
// I18N constants
// LANG: "es", ENCODING: UTF-8
// translated: Derick Leony <dleony@gmail.com>
{
"Edit HTML for selected text": "Editar código HTML del texto seleccionado",
"Tag Editor": "Editor de Etiquetas"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharacterMap/lang/es.js | JavaScript | art | 225 |
// I18N constants
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
// Last revision: 05 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Cancel": "Cancelar",
"Insert special character": "Inserir caracter especial"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharacterMap/lang/pt_br.js | JavaScript | art | 573 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Insert special character</title>
<link rel="stylesheet" type="text/css" href="../CharacterMap.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript">
window.resizeTo(480, 300);
// HTMLSource based on HTMLArea XTD 1.5 modified by Holger Hees
// Original Author - Bernhard Pfeifer novocaine@gmx.net
HTMLArea = window.opener.HTMLArea;
function Init() // run on page load
{
__dlg_translate('CharacterMap');
__dlg_init();
var character = ''; // set default input to empty
View( null, character );
document.getElementById("cancel").focus();
}
var oldView = null;
function View( td, character ) // preview character
{
if (oldView)
HTMLArea._removeClass(oldView, 'character-hilite');
if (td) {
oldView = td;
HTMLArea._addClass(oldView, 'character-hilite');
}
}
function Set( string ) // return character
{
var character = string;
__dlg_close( character );
}
function onCancel() // cancel selection
{
__dlg_close( null );
return false;
}
</script>
</head>
<body class="dialog popup" onload="Init();">
<table border="0" cellspacing="1" cellpadding="0" width="100%">
<tr>
<td class="character" onmouseover="View(this,'&Yuml;')" onclick="Set('Ÿ')">Ÿ</td>
<td class="character" onmouseover="View(this,'&scaron;')" onclick="Set('š')">š</td>
<td class="character" onmouseover="View(this,'&#064;')" onclick="Set('@')">@</td>
<td class="character" onmouseover="View(this,'&quot;')" onclick="Set('"')">"</td>
<td class="character" onmouseover="View(this,'&iexcl;')" onclick="Set('¡')">¡</td>
<td class="character" onmouseover="View(this,'&cent;')" onclick="Set('¢')">¢</td>
<td class="character" onmouseover="View(this,'&pound;')" onclick="Set('£')">£</td>
<td class="character" onmouseover="View(this,'&curren;')" onclick="Set('¤')">¤</td>
<td class="character" onmouseover="View(this,'&yen;')" onclick="Set('¥')">¥</td>
<td class="character" onmouseover="View(this,'&brvbar;')" onclick="Set('¦')">¦</td>
<td class="character" onmouseover="View(this,'&sect;')" onclick="Set('§')">§</td>
<td class="character" onmouseover="View(this,'&uml;')" onclick="Set('¨')">¨</td>
<td class="character" onmouseover="View(this,'&copy;')" onclick="Set('©')">©</td>
<td class="character" onmouseover="View(this,'&ordf;')" onclick="Set('ª')">ª</td>
<td class="character" onmouseover="View(this,'&laquo;')" onclick="Set('«')">«</td>
<td class="character" onmouseover="View(this,'&not;')" onclick="Set('¬')">¬</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&macr;')" onclick="Set('¯')">¯</td>
<td class="character" onmouseover="View(this,'&deg;')" onclick="Set('°')">°</td>
<td class="character" onmouseover="View(this,'&plusmn;')" onclick="Set('±')">±</td>
<td class="character" onmouseover="View(this,'&sup2;')" onclick="Set('²')">²</td>
<td class="character" onmouseover="View(this,'&sup3;')" onclick="Set('³')">³</td>
<td class="character" onmouseover="View(this,'&acute;')" onclick="Set('´')">´</td>
<td class="character" onmouseover="View(this,'&micro;')" onclick="Set('µ')">µ</td>
<td class="character" onmouseover="View(this,'&para;')" onclick="Set('¶')">¶</td>
<td class="character" onmouseover="View(this,'&middot;')" onclick="Set('·')">·</td>
<td class="character" onmouseover="View(this,'&cedil;')" onclick="Set('¸')">¸</td>
<td class="character" onmouseover="View(this,'&sup1;')" onclick="Set('¹')">¹</td>
<td class="character" onmouseover="View(this,'&ordm;')" onclick="Set('º')">º</td>
<td class="character" onmouseover="View(this,'&raquo;')" onclick="Set('»')">»</td>
<td class="character" onmouseover="View(this,'&frac14;')" onclick="Set('¼')">¼</td>
<td class="character" onmouseover="View(this,'&frac12;')" onclick="Set('½')">½</td>
<td class="character" onmouseover="View(this,'&frac34;')" onclick="Set('¾')">¾</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&iquest;')" onclick="Set('¿')">¿</td>
<td class="character" onmouseover="View(this,'&times;')" onclick="Set('×')">×</td>
<td class="character" onmouseover="View(this,'&Oslash;')" onclick="Set('Ø')">Ø</td>
<td class="character" onmouseover="View(this,'&divide;')" onclick="Set('÷')">÷</td>
<td class="character" onmouseover="View(this,'&oslash;')" onclick="Set('ø')">ø</td>
<td class="character" onmouseover="View(this,'&fnof;')" onclick="Set('ƒ')">ƒ</td>
<td class="character" onmouseover="View(this,'&circ;')" onclick="Set('ˆ')">ˆ</td>
<td class="character" onmouseover="View(this,'&tilde;')" onclick="Set('˜')">˜</td>
<td class="character" onmouseover="View(this,'&ndash;')" onclick="Set('–')">–</td>
<td class="character" onmouseover="View(this,'&mdash;')" onclick="Set('—')">—</td>
<td class="character" onmouseover="View(this,'&lsquo;')" onclick="Set('‘')">‘</td>
<td class="character" onmouseover="View(this,'&rsquo;')" onclick="Set('’')">’</td>
<td class="character" onmouseover="View(this,'&sbquo;')" onclick="Set('‚')">‚</td>
<td class="character" onmouseover="View(this,'&ldquo;')" onclick="Set('“')">“</td>
<td class="character" onmouseover="View(this,'&rdquo;')" onclick="Set('”')">”</td>
<td class="character" onmouseover="View(this,'&bdquo;')" onclick="Set('„')">„</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&dagger;')" onclick="Set('†')">†</td>
<td class="character" onmouseover="View(this,'&Dagger;')" onclick="Set('‡')">‡</td>
<td class="character" onmouseover="View(this,'&bull;')" onclick="Set('•')">•</td>
<td class="character" onmouseover="View(this,'&hellip;')" onclick="Set('…')">…</td>
<td class="character" onmouseover="View(this,'&permil;')" onclick="Set('‰')">‰</td>
<td class="character" onmouseover="View(this,'&lsaquo;')" onclick="Set('‹')">‹</td>
<td class="character" onmouseover="View(this,'&rsaquo;')" onclick="Set('›')">›</td>
<td class="character" onmouseover="View(this,'&euro;')" onclick="Set('€')">€</td>
<td class="character" onmouseover="View(this,'&trade;')" onclick="Set('™')">™</td>
<td class="character" onmouseover="View(this,'&Agrave;')" onclick="Set('À')">À</td>
<td class="character" onmouseover="View(this,'&Aacute;')" onclick="Set('Á')">Á</td>
<td class="character" onmouseover="View(this,'&Acirc;')" onclick="Set('Â')">Â</td>
<td class="character" onmouseover="View(this,'&Atilde;')" onclick="Set('Ã')">Ã</td>
<td class="character" onmouseover="View(this,'&Auml;')" onclick="Set('Ä')">Ä</td>
<td class="character" onmouseover="View(this,'&Aring;')" onclick="Set('Å')">Å</td>
<td class="character" onmouseover="View(this,'&AElig;')" onclick="Set('Æ')">Æ</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&Ccedil;')" onclick="Set('Ç')">Ç</td>
<td class="character" onmouseover="View(this,'&Egrave;')" onclick="Set('È')">È</td>
<td class="character" onmouseover="View(this,'&Eacute;')" onclick="Set('É')">É</td>
<td class="character" onmouseover="View(this,'&Ecirc;')" onclick="Set('Ê')">Ê</td>
<td class="character" onmouseover="View(this,'&Euml;')" onclick="Set('Ë')">Ë</td>
<td class="character" onmouseover="View(this,'&Igrave;')" onclick="Set('Ì')">Ì</td>
<td class="character" onmouseover="View(this,'&Iacute;')" onclick="Set('Í')">Í</td>
<td class="character" onmouseover="View(this,'&Icirc;')" onclick="Set('Î')">Î</td>
<td class="character" onmouseover="View(this,'&Iuml;')" onclick="Set('Ï')">Ï</td>
<td class="character" onmouseover="View(this,'&ETH;')" onclick="Set('Ð')">Ð</td>
<td class="character" onmouseover="View(this,'&Ntilde;')" onclick="Set('Ñ')">Ñ</td>
<td class="character" onmouseover="View(this,'&Ograve;')" onclick="Set('Ò')">Ò</td>
<td class="character" onmouseover="View(this,'&Oacute;')" onclick="Set('Ó')">Ó</td>
<td class="character" onmouseover="View(this,'&Ocirc;')" onclick="Set('Ô')">Ô</td>
<td class="character" onmouseover="View(this,'&Otilde;')" onclick="Set('Õ')">Õ</td>
<td class="character" onmouseover="View(this,'&Ouml;')" onclick="Set('Ö')">Ö</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&reg;')" onclick="Set('®')">®</td>
<td class="character" onmouseover="View(this,'&times;')" onclick="Set('×')">×</td>
<td class="character" onmouseover="View(this,'&Ugrave;')" onclick="Set('Ù')">Ù</td>
<td class="character" onmouseover="View(this,'&Uacute;')" onclick="Set('Ú')">Ú</td>
<td class="character" onmouseover="View(this,'&Ucirc;')" onclick="Set('Û')">Û</td>
<td class="character" onmouseover="View(this,'&Uuml;')" onclick="Set('Ü')">Ü</td>
<td class="character" onmouseover="View(this,'&Yacute;')" onclick="Set('Ý')">Ý</td>
<td class="character" onmouseover="View(this,'&THORN;')" onclick="Set('Þ')">Þ</td>
<td class="character" onmouseover="View(this,'&szlig;')" onclick="Set('ß')">ß</td>
<td class="character" onmouseover="View(this,'&agrave;')" onclick="Set('à')">à</td>
<td class="character" onmouseover="View(this,'&aacute;')" onclick="Set('á')">á</td>
<td class="character" onmouseover="View(this,'&acirc;')" onclick="Set('â')">â</td>
<td class="character" onmouseover="View(this,'&atilde;')" onclick="Set('ã')">ã</td>
<td class="character" onmouseover="View(this,'&auml;')" onclick="Set('ä')">ä</td>
<td class="character" onmouseover="View(this,'&aring;')" onclick="Set('å')">å</td>
<td class="character" onmouseover="View(this,'&aelig;')" onclick="Set('æ')">æ</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&ccedil;')" onclick="Set('ç')">ç</td>
<td class="character" onmouseover="View(this,'&egrave;')" onclick="Set('è')">è</td>
<td class="character" onmouseover="View(this,'&eacute;')" onclick="Set('é')">é</td>
<td class="character" onmouseover="View(this,'&ecirc;')" onclick="Set('ê')">ê</td>
<td class="character" onmouseover="View(this,'&euml;')" onclick="Set('ë')">ë</td>
<td class="character" onmouseover="View(this,'&igrave;')" onclick="Set('ì')">ì</td>
<td class="character" onmouseover="View(this,'&iacute;')" onclick="Set('í')">í</td>
<td class="character" onmouseover="View(this,'&icirc;')" onclick="Set('î')">î</td>
<td class="character" onmouseover="View(this,'&iuml;')" onclick="Set('ï')">ï</td>
<td class="character" onmouseover="View(this,'&eth;')" onclick="Set('ð')">ð</td>
<td class="character" onmouseover="View(this,'&ntilde;')" onclick="Set('ñ')">ñ</td>
<td class="character" onmouseover="View(this,'&ograve;')" onclick="Set('ò')">ò</td>
<td class="character" onmouseover="View(this,'&oacute;')" onclick="Set('ó')">ó</td>
<td class="character" onmouseover="View(this,'&ocirc;')" onclick="Set('ô')">ô</td>
<td class="character" onmouseover="View(this,'&otilde;')" onclick="Set('õ')">õ</td>
<td class="character" onmouseover="View(this,'&ouml;')" onclick="Set('ö')">ö</td>
</tr><tr>
<td class="character" onmouseover="View(this,'&divide;')" onclick="Set('÷')">÷</td>
<td class="character" onmouseover="View(this,'&oslash;')" onclick="Set('ø')">ø</td>
<td class="character" onmouseover="View(this,'&ugrave;')" onclick="Set('ù')">ù</td>
<td class="character" onmouseover="View(this,'&uacute;')" onclick="Set('ú')">ú</td>
<td class="character" onmouseover="View(this,'&ucirc;')" onclick="Set('û')">û</td>
<td class="character" onmouseover="View(this,'&uuml;')" onclick="Set('ü')">ü</td>
<td class="character" onmouseover="View(this,'&yacute;')" onclick="Set('ý')">ý</td>
<td class="character" onmouseover="View(this,'&thorn;')" onclick="Set('þ')">þ</td>
<td class="character" onmouseover="View(this,'&yuml;')" onclick="Set('ÿ')">ÿ</td>
<td class="character" onmouseover="View(this,'&OElig;')" onclick="Set('Œ')">Œ</td>
<td class="character" onmouseover="View(this,'&oelig;')" onclick="Set('œ')">œ</td>
<td class="character" onmouseover="View(this,'&Scaron;')" onclick="Set('Š')">Š</td>
<td class="character" colspan="4"> </td>
</tr>
</table><br>
<form action="#"><button type="button" id="cancel" name="cancel" onclick="return onCancel();">Cancel</button></form>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharacterMap/popups/select_character.html | HTML | art | 13,913 |
.navi_links {
width: 177px;
margin: 0;
padding: 0px;
list-style:none;
border: none;
}
.navi_links li {
margin:0 0 3px 0;
}
.navi_links li a {
font-size: 13px;
line-height: 16px;
height: 16px;
display:block;
color:#000;
text-decoration: none;
font-weight: bold;
background-color: #fff;
cursor: pointer;
border: 2px solid white;
}
.Link1 {
background-color: #DF1D1F !important;
}
.Link2 {
background-color: #F9A413 !important;
}
.Link3 {
background-color: #167730 !important;
}
.Link4 {
background-color: #233350 !important;
}
.Link5 {
background-color: #70685B !important;
}
a.Link1:hover span{
background-color: #DF1D1F !important;
}
a.Link2:hover span {
background-color: #F9A413 !important;
}
.Link3:hover span {
background-color: #167730 !important;
color:white;
}
.Link4:hover span {
background-color: #233350 !important;
color:white;
}
.Link5:hover span {
background-color: #70685B !important;
color:white;
}
.navi_links li a span {
height: 16px;
text-indent: 4px;
display:block;
margin-left: 15px;
background-color: #FFF;
}
div.message_box {
border: dotted 1px black;
margin: 1em;
padding:1em;
}
.red {
color:red;
}
.green {
color:green;
} | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/InsertSnippet.css | CSS | art | 1,187 |
<!--Box 1-->
<div class="message_box red">
Visit the <a href="http://xinha.org">Xinha website</a>
</div>
<!--/Box 1-->
<!--INFORMATION ABOUT SOMETHING-->
<div class="message_box green">
This is an information about something
</div>
<!--/INFORMATION ABOUT SOMETHING-->
<!--Menu-->
<ul class="navi_links">
<li class="navi">
<a href="Link1" class="Link1" tabindex="1"><span class="span_class"> Link1 </span></a>
</li>
<li class="navi">
<a href="Link2" class="Link2" tabindex="2"><span class="span_class"> Link2 </span></a>
</li>
<li class="navi">
<a href="Link3" class="Link3" tabindex="3"><span class="span_class"> Link3 </span></a>
</li>
<li class="navi">
<a href="Link4" class="Link4" tabindex="4"><span class="span_class"> Link4 </span></a>
</li>
<li class="navi">
<a href="Link5" class="Link5" tabindex="5"><span class="span_class"> Link5 </span></a>
</li>
</ul>
<!--/Menu--> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/snippets.html | HTML | art | 953 |
/*------------------------------------------*\
InsertSnippet for Xinha
_______________________
Insert HTML fragments or template variables
\*------------------------------------------*/
function InsertSnippet(editor) {
this.editor = editor;
var cfg = editor.config;
var self = this;
cfg.registerButton({
id : "insertsnippet",
tooltip : this._lc("Insert Snippet"),
image : editor.imgURL("ed_snippet.gif", "InsertSnippet"),
textMode : false,
action : function(editor) {
self.buttonPress(editor);
}
});
cfg.addToolbarElement("insertsnippet", "insertimage", -1);
this.snippets = null;
var backend = cfg.InsertSnippet.snippets + '?';
if(cfg.InsertSnippet.backend_data != null)
{
for ( var i in cfg.InsertSnippet.backend_data )
{
backend += '&' + i + '=' + encodeURIComponent(cfg.InsertSnippet.backend_data[i]);
}
}
Xinha._getback(backend,function (getback) {eval(getback); self.snippets = snippets;});
}
InsertSnippet.prototype.onUpdateToolbar = function() {
if (!this.snippets){
this.editor._toolbarObjects.insertsnippet.state("enabled", false);
}
else InsertSnippet.prototype.onUpdateToolbar = null;
}
InsertSnippet._pluginInfo = {
name : "InsertSnippet",
version : "1.2",
developer : "Raimund Meyer",
developer_url : "http://x-webservice.net",
c_owner : "Raimund Meyer",
sponsor : "",
sponsor_url : "",
license : "htmlArea"
};
InsertSnippet.prototype._lc = function(string) {
return Xinha._lc(string, 'InsertSnippet');
};
InsertSnippet.prototype.onGenerate = function() {
this.editor.addEditorStylesheet(Xinha.getPluginDir("InsertSnippet") + '/InsertSnippet.css');
};
Xinha.Config.prototype.InsertSnippet =
{
'snippets' : Xinha.getPluginDir("InsertSnippet")+"/demosnippets.js", // purely demo purposes, you should change this
'css' : ['../InsertSnippet.css'], //deprecated, CSS is now pulled from xinha_config
'showInsertVariable': false,
'backend_data' : null
};
InsertSnippet.prototype.buttonPress = function(editor) {
var args = editor.config;
args.snippets = this.snippets;
var self = this;
editor._popupDialog( "plugin://InsertSnippet/insertsnippet", function( param ) {
if ( !param ) {
return false;
}
editor.focusEditor();
if (param['how'] == 'variable') {
editor.insertHTML('{'+self.snippets[param["snippetnum"]].id+'}');
} else {
editor.insertHTML(self.snippets[param["snippetnum"]].HTML);
}
}, args);
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/InsertSnippet.js | JavaScript | art | 2,640 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"Insert Snippet": "Snippet invoegen",
"Cancel": "Annuleren",
"Variable":"Variabele",
"Insert as":"Invoegen als",
"Show preview":"Laat voorbeeld zien",
"Hide preview":"Verberg voorbeeld"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/lang/nl.js | JavaScript | art | 298 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
{
"Insert Snippet": "Snippet einfügen",
"Cancel": "Abbrechen",
"Variable":"Variable",
"Insert as":"Einfügen als",
"Show preview":"Vorschau zeigen",
"Hide preview":"Vorschau verbergen"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/lang/de.js | JavaScript | art | 244 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Insert Snippet": "スニペットの挿入",
"Cancel": "中止",
"Variable":"変数",
"Insert as":"形式を選んで挿入",
"Show preview":"プレビュー表示",
"Hide preview":"プレビュー非表示"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/lang/ja.js | JavaScript | art | 268 |
// I18N constants
// LANG: "nb", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"Insert Snippet": "Sett inn snutt",
"Cancel": "Avbryt",
"Variable":"Variabel",
"Insert as":"Sett inn som",
"Show preview":"Vis forhåndsvisning",
"Hide preview":"Skjul forhåndsvisning"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/lang/nb.js | JavaScript | art | 315 |
// I18N constants
//
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
//
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
//
// Last revision: 06 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
//
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Cancel": "Cancelar",
"Hide preview": "Esconder Visualização",
"Insert Snippet": "Inserir Fragmento de Código",
"Insert as": "Inserir como",
"InsertSnippet for Xinha": "Fragmento de Códigos para o Xinha",
"Show preview": "Mostrar Visualização",
"This is an information about something": "Isto é uma informação sobre alguma coisa",
"Variable": "Variável"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/lang/pt_br.js | JavaScript | art | 879 |
<?php
$snippets_file = 'snippets.html';
include_once('../../contrib/php-xinha.php');
if($passed_data = xinha_read_passed_data())
{
extract($passed_data);
}
$snippets = file_get_contents($snippets_file);
preg_match_all('/<!--(.*?)-->(.*?)<!--\/.*?-->/s',$snippets,$matches);
$array=array();
for ($i=0;$i<count($matches[1]);$i++)
{
$id = $matches[1][$i];
$html = $matches[2][$i];
$array[] = array('id'=>$id,'HTML'=>$html);
}
print "var snippets = " . xinha_to_js($array);
?> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/snippets.php | PHP | art | 508 |
var snippets = [];
var i = 0;
snippets[i] = {};
snippets[i]['id'] = 'Box 1';
snippets[i]['HTML'] = '<div class="message_box red">\n Visit the <a href="http://xinha.org">Xinha website</a></div>';
i++;
snippets[i] = {};
snippets[i]['id'] = 'INFORMATION ABOUT SOMETHING';
snippets[i]['HTML'] = '<div class="message_box green">\n This is an information about something\n</div>';
i++;
snippets[i] = {};
snippets[i]['id'] = 'Menu';
snippets[i]['HTML'] = '<ul class="navi_links">\n <li class="navi">\n <a href="Link1" class="Link1" tabindex="1"><span class="span_class">Link1</span></a>\n </li>\n \n <li class="navi">\n <a href="Link2" class="Link2" tabindex="2"><span class="span_class">Link2</span></a>\n </li>\n\n \n <li class="navi">\n <a href="Link3" class="Link3" tabindex="3"><span class="span_class">Link3</span></a>\n </li>\n \n <li class="navi">\n <a href="Link4" class="Link4" tabindex="4"><span class="span_class">Link4</span></a>\n </li>\n \n <li class="navi">\n <a href="Link5" class="Link5" tabindex="5"><span class="span_class">Link5</span></a>\n\n </li>\n\n</ul>'; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/demosnippets.js | JavaScript | art | 1,098 |
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Insert Snippet</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<link rel="stylesheet" type="text/css" href="../InsertSnippet.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var InsertSnippet = window.opener.InsertSnippet;
var editor = null;
function Init() {
__dlg_translate("InsertSnippet");
__dlg_init(null, {width:800,height:600});
var config = window.dialogArguments;
var snippets = config.snippets;
if ( config.pageStyle && !Xinha.is_ie)
{
var style = document.createElement("style");
style.type = "text/css";
style.innerHTML = config.pageStyle;
document.getElementsByTagName("HEAD")[0].appendChild(style);
}
if ( typeof config.pageStyleSheets !== 'undefined' )
{
for ( var i = 0; i < config.pageStyleSheets.length; i++ )
{
var style = document.createElement("link");
style.type = "text/css";
style.rel = 'stylesheet';
style.href = config.pageStyleSheets[i];
document.getElementsByTagName("HEAD")[0].appendChild(style);
}
}
var tbody = document.getElementById("snippettable");
var snippet_html;
var snippet_name;
var trow;
for(var i = 0; i < snippets.length; i++)
{
trow = tbody.insertRow(i);
snippet_html = snippets[i]['HTML'];
snippet_name = snippets[i]['id'];
var insertAsVariable = '';
if (config.InsertSnippet.showInsertVariable)
{
insertAsVariable = ' | <a href="javascript:onOK('+i+','+'\'variable\''+')">'+Xinha._lc("Variable","InsertSnippet")+'</a>';
}
var new_cell = trow.insertCell(0);
new_cell.innerHTML = snippet_name +': '+Xinha._lc("Insert as","InsertSnippet")+' <a href="javascript:onOK('+i+','+'\'html\''+')">HTML</a>'+insertAsVariable + ' (<a id="show_preview'+i+'" href="javascript:preview(\'show\','+i+')">'+Xinha._lc("Show preview","InsertSnippet")+'</a>)<div id="preview'+i+'" style="display:none">'+snippets[i]['HTML']+'</div>';
new_cell.id = 'cell' + i;
}
document.body.onkeypress = __dlg_key_press;
}
function preview(action,i) {
var show_preview_link = document.getElementById('show_preview'+i);
switch(action)
{
case 'show':
document.getElementById('preview'+i).style.display = 'block';
show_preview_link.innerHTML = Xinha._lc("Hide preview","InsertSnippet");
show_preview_link.href = "javascript:preview('hide','"+i+"');";
break;
case 'hide':
document.getElementById('preview'+i).style.display = 'none';
show_preview_link.innerHTML = Xinha._lc("Show preview","InsertSnippet");
show_preview_link.href = "javascript:preview('show','"+i+"');";
break;
}
}
function onCancel() {
__dlg_close(null);
return false;
}
function onOK(snippetnum,how) {
var params = new Object();
params["snippetnum"] = snippetnum;
params["how"] = how;
__dlg_close(params);
return false;
}
function __dlg_key_press(ev) {
ev || (ev = window.event);
switch(ev.keyCode) {
case 13:
document.getElementById('bt_ok').click();
break;
case 27:
__dlg_close();
return false;
}
return true;
}
</script>
<style type="text/css">
body {margin:0 !IMPORTANT;padding:0 !IMPORTANT;}
.buttons {border-top: 1px solid #999; padding: 5px; text-align: right; height: 20px; }
td {background:white;padding:5px;border:1px solid;border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;}
.preview {}
</style>
</head>
<body class="dialog" onload="Init()">
<form action="" method="get">
<div class="title" >Insert Snippet</div>
<div style="height:470px;overflow:auto;">
<table style="border: 0; width: 100%;" id="snippettable">
</table>
</div>
<div class="space"></div>
<div class="buttons">
<button type="button" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/popups/insertsnippet.html | HTML | art | 3,950 |
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>InsertSnippet for Xinha</title>
<style type="text/css">
body { font-family: sans-serif; }
pre {border: dotted grey thin; background-color:LightYellow;padding:10px }
p { width:500px }
</style>
</head>
<body >
<h1>InsertSnippet for Xinha</h1>
<p>Insert HTML fragments in your document.
</p>
<h2>Usage</h2>
<p>
In order to use your own snippets you have to add at least one parameter to your xinha_config:
</p>
<pre>
xinha_config.InsertSnippet.snippets = Xinha.getPluginDir('InsertSnippet') + "/snippets.php";
</pre>
<p>
The path above indicates the use of the provided backend. This parses a file that contains the snippets and
should have the following format:
</p>
<pre>
<!--Snippet ID-->
Snippet content
<!--/Snippet ID-->
...and so on
</pre>
<p>
You can use the snippets.html in the plugin folder or tell the backend where to find the file like this
</p>
<pre>
with (xinha_config.InsertSnippet)
{
<?php
// define backend configuration for the plugin
$backend_data['snippets_file'] = '/file/containing/snippets.html';
require_once '../contrib/php-xinha.php';
xinha_pass_to_php_backend($backend_data);
?>
}
</pre>
<p style="font-size:80%">Raimund Meyer (xinha@raimundmeyer.de)</p>
</body>
</html>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/InsertSnippet/readme.html | HTML | art | 1,446 |
<h1 id="[h1]"><l10n>File Browser</l10n></h1>
<div style="width:95px; float:left; height:100%">
<fieldset><legend><l10n>Places</l10n></legend>
<div class="placesmanager" id="[placesList]" title="_(List of Places)">
<div class="file" id="[WWW]"><img class="icon" src="../images/tango/32x32/apps/internet-web-browser.png"/><p class="filename">WWW</p></div>
</div>
</fieldset>
</div>
<div style="margin-left:100px;">
<div id="[placeBackend]">
<fieldset><legend><l10n>File Manager</l10n></legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td style="padding: 10px;" nowrap="nowrap">
<label for="[filters]">Directory</label>
<select id="[filters]" class="dirWidth"></select>
<a href="#" id="[dirUp]" title="_(Directory Up)"><img src="../images/tango/16x16/actions/go-up.png" alt="_(Directory Up)" height="15" width="15"></a>
<a href="#" id="[dirCreate]" title="_(New Folder)"><img src="../images/tango/16x16/actions/folder-new.png" alt="_(New Folder)" height="15" width="15"></a>
<select id="[viewType]">
<option value="thumbnail" selected="selected">Thumbnail View</option>
<option value="listing">List View</option>
</select>
</td>
</tr>
<tr><td style="padding: 0px 10px 10px;">
<div class="filemanager" id="[fileList]" title="_(File List)"></div>
</td></tr>
</tbody></table>
</fieldset>
<fieldset id="[import]" class="collapsed">
<legend id="[importlegend]"><l10n>Import ⌄<!--˅--></l10n></legend>
<div id="[importui]"></div>
</fieldset>
</div>
<div id="[placeWww]">
<fieldset><legend><l10n>Web URL</l10n></legend>
<label for="URL">Enter URL below:</label><br />
<input id="URL" type="text" size="50" />
</fieldset>
</div>
<fieldset id="[namefield]">
<legend><l10n>Filename</l10n></legend>
<input id="[filename]" type="text" />
</fieldset>
<fieldset id="[detailsfield]">
<legend><l10n>Details</l10n></legend>
<div id="[details_image]">
<table class="inputTable">
<tbody>
<tr>
<td style="text-align: right;"><label for="[image_alt]">Alt</label></td>
<td colspan="5"><input type="text" value="" id="[image_alt]"/></td>
<td style="vertical-align: top; text-align: center;" colspan="2" rowspan="5">
<div style="border: 1px inset ; padding: 4px; background-color: rgb(204, 204, 204); width: 100px; height: 100px;">
<img id="[image_preview]" alt="" src="img/1x1_transparent.gif"/>
</div>
</td>
</tr>
<tr>
<td style="text-align: right;"> <label for="[image_width]">Width</label></td>
<td><input type="text" value="" id="[image_width]"/></td>
<td rowspan="2" style="vertical-align:middle"><img width="25" height="32" alt="Constrained Proportions" id="[image_constrain_icon]" src="img/locked.gif"/>
<input type="checkbox" onclick="javascript:toggleConstrains(this);" checked="checked" id="[image_constrain]" value="on" />
<label for="[image_constrain]">Constrain Proportions</label>
</td>
<td style="text-align: right;" rowspan="3"/>
<td style="text-align: right;"><label for="[image_margin]">Margin</label></td>
<td><input type="text" value="" class="smallWidth" id="[image_margin]"/></td>
</tr>
<tr>
<td style="text-align: right;"><label for="[image_height]">Height</label></td>
<td class="smallWidth"><input type="text" value="" class="smallWidth" id="[image_height]"/></td>
<td style="text-align: right;"><label for="[image_padding]">Padding</label></td>
<td><input type="text" value="" class="smallWidth" id="[image_padding]"/>
</td>
<td style="text-align: left;">Color</td>
<td>
<input type="text" size="7" id="[image_backgroundColor]" /><span class="buttonColor"><span class="chooser"> </span><span class="nocolor">×</span></span>
</td>
</tr>
<tr>
<td style="text-align: right;"><label for="[image_align]">Align</label></td>
<td colspan="2"> <select title="Positioning of this image" id="[image_align]" size="1">
<option selected="selected" value="">Not set</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="texttop">Texttop</option>
<option value="absmiddle">Absmiddle</option>
<option value="baseline">Baseline</option>
<option value="absbottom">Absbottom</option>
<option value="bottom">Bottom</option>
<option value="middle">Middle</option>
<option value="top">Top</option>
</select> </td>
<td style="text-align: right;"><label for="[image_border]">Border</label></td>
<td><input type="text" value="" class="smallWidth" id="[image_border]"/></td>
<td style="text-align: left;">Border Color</td>
<td><input type="text" size="7" id="[image_borderColor]" /><span class="buttonColor"><span class="chooser"> </span><span class="nocolor">×</span></span></td>
</tr>
</tbody></table>
<!--// image properties -->
</div>
</fieldset>
<input type="button" id="[confirm]" value="_(Confirm)" />
<input type="button" id="[cancel]" value="_(Cancel)" />
</div>
</div>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PersistentStorage/dialog.html | HTML | art | 5,733 |
/**
* @fileOverview PersistentStorage PersistentStorage.js file.
* This plugin is a rethinking of the ExtendFileManager plugin written and
* designed by Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer.
*
* @author Douglas Mayle <douglas@openplans.org>
* @version 1.0
*/
/**
* The global namespace
* @name window
*/
(function($) {
/**
* @name PersistentStorage
* @class Provides an interface for persistant storage options to the user.
* @param editor A reference to the Xinha Editor this plugin instance is attached to.
*/
var PersistentStorage = window.PersistentStorage = function (editor) {
/**
* @memberOf Xinha
*/
this.editor = editor;
var self = this;
}
/**
* Plugin Metadata
* @namespace
* @static
*/
PersistentStorage._pluginInfo = {
/** Plugin name */
name : "PersistentStorage",
/** Plugin version */
version : "1.0",
/** Plugin author */
developer : "Douglas Mayle",
/** Plugin author's website */
developer_url : "http://douglas.mayle.org",
/** Plugin license */
license : "BSD"
};
/**
* The list of backend modules registered with this instance.
*/
PersistentStorage.prototype._backends = {};
/**
* The list of user config files received from backends.
*/
PersistentStorage.prototype._userconfigs = [];
/**
* The name of the currently active backend.
*/
PersistentStorage.prototype._activeBackend = '';
/**
* The value of the type filter that's currently in effect.
*/
PersistentStorage.prototype._typeFilter = '';
/**
* The currently displayed view type.
*/
PersistentStorage.prototype._viewType = 'thumbnail';
/**
* On Xinha activation, this get's called so that we can prepare any resources
* we need to function.
*/
PersistentStorage.prototype.onGenerateOnce = function () {
// We use _prepareDialog to asynchronously load the dialog markup and then
// perform necessary processing.
this._prepareDialog();
};
function addClass(element, className) {
var classRegex = new RegExp(' ?' + className + ' ?');
if (!classRegex.test(element.className)) {
element.className += ' ' + className;
}
}
function removeClass(element, className) {
var classRegex = new RegExp(' ?' + className + ' ?');
if (classRegex.test(element.className)) {
element.className = element.className.replace(classRegex, ' ');
}
}
function toggleClass(element, className) {
var classRegex = new RegExp(' ?' + className + ' ?');
if (classRegex.test(element.className)) {
element.className = element.className.replace(classRegex, ' ');
} else {
element.className += ' ' + className;
}
}
/**
* Once we're sure we have a backend that supports document functionality,
* we'll load the interface that exposes it.
*/
PersistentStorage.prototype._registerDocumentUI = function () {
if (this._documentEnabled) {
// No need to repeated rebuild the UI.
return;
}
this._documentEnabled = true;
var self = this;
var editor = this.editor;
editor.config.registerButton({
id : 'newdocument',
tooltip : Xinha._lc( 'New Document', 'PersistentStorage' ),
image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',0,5],
textMode : true,
action : function() { self.newDocument(); }
}
);
editor.config.registerButton({
id : 'opendocument',
tooltip : Xinha._lc( 'Open Document', 'PersistentStorage' ),
image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',1,5],
textMode : true,
action : function() { self.openDialog(); }
}
);
editor.config.registerButton({
id : 'savedocument',
tooltip : Xinha._lc( 'Save Document', 'PersistentStorage' ),
image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',9,1],
textMode : true,
action : function() { self.saveDialog(); }
}
);
editor.config.addToolbarElement('newdocument', 'fullscreen', 1);
editor.config.addToolbarElement('opendocument', 'newdocument', 1);
editor.config.addToolbarElement('savedocument', 'opendocument', 1);
// Since this is after the editor load, we have to trigger an udate manually...
editor._rebuildToolbar();
};
/**
* Backend storage plugins should call this method so that they can be exposed
* to the user. Because of possible quirks in plugin loading, you should use
* the following example code when registering.
* @param name The name of the module
* @param module The module instance
* @param config Configuration information that tells us about the module
* @param user_config AN object representing the user configuration loaded from
* this module.
* @example
* PSBackend.prototype.onGenerateOnce = function () {
* // Register with the Persistent Storage plugin.
* this._registerBackend();
* };
* PSBackend.prototype._registerBackend = function(timeWaited) {
* var editor = this.editor;
* var self = this;
*
* if (!timeWaited) {
* timeWaited = 0;
* }
*
* // Retry over a period of ten seconds to register. We back off exponentially
* // to limit resouce usage in the case of misconfiguration.
* var registerTimeout = 10000;
*
* if (timeWaited > registerTimeout) {
* // This is most likely a configuration error. We're loaded and
* // PersistentStorage is not.
* return;
* }
*
* if (!editor.plugins['PersistentStorage'] ||
* !editor.plugins['PersistentStorage'].instance ||
* !editor.plugins['PersistentStorage'].instance.ready) {
*
* window.setTimeout(function() {
* self._registerBackend(timeWaited ? timeWaited*2 : 50);
* }, timeWaited ? timeWaited : 50);
*
* return;
* }
* var PS = editor.plugins['PersistentStorage'].instance;
*
* // Support user configuration. This loading should be moved into PersistentStorage...
* this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) {
* var userconfig = json ? eval('(' + json + ')') : false;
* PS.registerBackend('PSLocal', self, self.config, userconfig);
* });
*/
PersistentStorage.prototype.registerBackend = function (name, module, config, user_config) {
this._backends[name] = {module: module, config: config, name: name};
// TODO I'd like something more than just whoever calls back first wins for ordering.
if (!this._activeBackend) {
this.setBackend(name);
}
if (config.capabilities.upload_operations &&
config.capabilities.file_operations) {
this._registerDocumentUI();
}
// Handle user configuration
if (user_config) {
this._userconfigs.push(user_config);
this.configureUser();
}
this.updatePlacesDisplay();
}
/**
* Go through the list of user configs and reconfigure Xinha.
*/
PersistentStorage.prototype.configureUser = function () {
// Temp code does not handle user affinity
var self = this;
for (var index=0; index<this._userconfigs.length; ++index) {
// A user config can have various options, we'll deal with each in turn.
var config = this._userconfigs[index];
for (var pluginName in (config.plugins || {})) {
// Try to load each of the plugins requested by the user.
Xinha.loadPlugin(pluginName, function() {
// On successful load, we'll register the plugin with this instance.
self.editor.registerPlugins([pluginName]);
Xinha.refreshPlugin(self.editor.plugins[pluginName].instance);
// Now that
self.editor._rebuildToolbar();
}, config.plugins[pluginName]);
}
}
}
/**
* Present the user with a clean slate document. Someday, we'll cycle through
* a list of templates in storage.
*/
PersistentStorage.prototype.newDocument = function () {
if (this.editor._doc.body.lastChild) {
// There's already some content, let's make sure.
if (!confirm(Xinha._lc('This will erase any unsaved content. If you\'re certain, please click OK to continue.', 'PersistentStorage'))) {
return;
}
}
while (this.editor._doc.body.lastChild) {
this.editor._doc.body.removeChild(this.editor._doc.body.lastChild);
}
}
/**
* Present a save dialog to the user.
*/
PersistentStorage.prototype.saveDialog = function () {
var self = this;
// Setup the dialog title
var title = this.dialog.getElementById("h1");
title.innerHTML = Xinha._lc('Save Document', 'PersistentStorage');
// Setup the confirmation button and action.
var button = this.dialog.getElementById("confirm");
button.value = Xinha._lc('Save', 'PersistentStorage');
button.onclick = function() {
self.saveDocument();
};
// Enable and disable the buttons with filename input
var nameinput = this.dialog.getElementById("filename");
button.disabled = nameinput.value ? false : true;
nameinput.onkeyup = nameinput.onkeypress = nameinput.onchange = function() {
button.disabled = nameinput.value ? false : true;
}
this.showDialog({typeFilter:['document','html','text','folder'], styleFor:'documentsave'});
}
/**
* Use the selected backend to save the current document.
*/
PersistentStorage.prototype.saveDocument = function () {
var editor = this.editor;
var module = this._backends[this._activeBackend].module;
var filename = this.dialog.getElementById("filename");
module.saveDocument(module.viewFilter, filename.value, editor.getHTML(), function() {
module.cache = null;
});
this.dialog.hide();
}
/**
* Present an open dialog to the user.
*/
PersistentStorage.prototype.openDialog = function () {
var self = this;
// Setup the dialog title
var title = this.dialog.getElementById("h1");
title.innerHTML = Xinha._lc('Open Document', 'PersistentStorage');
// Setup the confirmation button and action.
var button = this.dialog.getElementById("confirm");
button.value = Xinha._lc('Open', 'PersistentStorage');
button.onclick = function() {
self.openDocument();
};
this.showDialog({typeFilter:['document','html','text','folder'], styleFor:'documentload'});
}
/**
* Use the selected backend to load the selected entry into the editor.
*/
PersistentStorage.prototype.openDocument = function () {
var editor = this.editor;
var module = this._backends[this._activeBackend].module;
module.loadDocument(this.selectedEntry[0], function(documentSource) {
editor.setHTML(documentSource);
});
this.dialog.hide();
}
/**
* @param options Configuration options that tweak the display of the dialog.
* @param options.typeFilter {String[]} Object types to allow in the display.
* Possibilities are 'image', 'media', 'document', and 'folder'.
* @param options.styleFor {String} Possible stylings of the dialog. This can
* be 'insertion', 'link', 'documentsave', or 'documentload'.
* @example
* Interface Mockup
*
* ****************************************************************************
* * *
* * #Places## #File Browser################################################# *
* * # # # ______________ ________________ ________________ # *
* * # === # # |/subdir | ^(Up) |*Create Folder| |View as Icons^| # *
* * # |*| # # -------------- ---------------- ---------------- # *
* * # |*| # # # *
* * # === # # *********** *********** *********** *********** # *
* * #Server # # * Thumb * * Thumb * * Thumb * * Thumb * # *
* * # # # * * * * * * * * # *
* * # /\ # # *(Edit) * *(Edit) * *(Edit) * *(Edit) * # *
* * # < > # # *(Delete) * *(Delete) * *(Delete) * *(Delete) * # *
* * # \/ # # *********** *********** *********** *********** # *
* * # Gears # # # *
* * # # ############################################################## *
* * # # *
* * # # *Import-(Collapsed)******************************************* *
* * # # *
* * # # #File Name -or- File Details################################## *
* * # # # # *
* * # # # # *
* * # # # # *
* * # # # # *
* * ######### ############################################################## *
* * *
* ****************************************************************************
*/
PersistentStorage.prototype.showDialog = function (options) {
// Create a reference to this PS instance to allow for asynchronous
// continuation (if we're not ready.)
var self = this;
if (!this.ready) {
window.setTimeout(function() {self.showDialog(options);}, 80);
return;
}
// We hide and show the various elements of the dialog depending on usage.
removeClass(this.dialog.getElementById("WWW"), 'hidden');
addClass(this.dialog.getElementById("namefield"), 'hidden');
addClass(this.dialog.getElementById("placeWww"), 'hidden');
addClass(this.dialog.getElementById("placeBackend"), 'hidden');
switch (options.styleFor) {
case 'link':
removeClass(this.dialog.getElementById("placeWww"), 'hidden');
this.updatePlacesDisplay('shared_publish');
break;
case 'insertion':
removeClass(this.dialog.getElementById("placeBackend"), 'hidden');
this.updatePlacesDisplay('shared_publish');
break;
case 'documentsave':
addClass(this.dialog.getElementById("WWW"), 'hidden');
removeClass(this.dialog.getElementById("namefield"), 'hidden');
removeClass(this.dialog.getElementById("placeBackend"), 'hidden');
this.updatePlacesDisplay('file_operations');
break;
case 'documentload':
addClass(this.dialog.getElementById("WWW"), 'hidden');
removeClass(this.dialog.getElementById("placeBackend"), 'hidden');
this.updatePlacesDisplay('file_operations');
break;
}
var directories = this.dialog.getElementById("filters");
var fileBrowser = this.dialog.getElementById("fileList");
// Store the type filter so that view updates will correctly filter the contents.
this._typeFilter = options.typeFilter;
var module = this._backends[this._activeBackend].module;
this.updateFileBrowser();
}
/**
* Take the list of filters and build the contents of the select element.
* @param filters {Filter[]} An array of filter choices to display to the user.
* @param filters[n].value The unique key that represents this filter to the backend.
* @param filters[n].display {String} A text string to display to the user to
* represent the given filter.
* @param select {HTMLElement} The select node to update.
*/
PersistentStorage.prototype.displayFilters = function(filters, viewFilter) {
// Clear out the previous directory listing.
var select = this.dialog.getElementById("filters");
while (select.lastChild) {
select.removeChild(select.lastChild);
}
// For each element in the array, we extract out the display text and the
// value and put them into an option element to add to the select element.
for (var index=0; index<filters.length; ++index) {
var option = document.createElement('option');
option.setAttribute("value", filters[index].value);
if (filters[index].value == viewFilter) {
option.setAttribute("selected", 'selected');
}
var text = document.createTextNode(filters[index].display);
option.appendChild(text);
select.appendChild(option);
}
}
/**
* Given an entry, build an html UI element.
* @param entry An object representing a file entry.
* @param entry.URL The URL where this entry is located, if available,
* @param entry.thumbURL The URL of an image that represents a thumbnail
* preview of this file.
* @param entry.$type {String} The type of this entry. This can be one of:
* 'image', 'media', 'folder', 'document', 'html', or 'text'
* @param entry.name The name of this entry to display to the user.
*/
PersistentStorage.prototype.buildThumbnail = function(entry) {
var self = this;
// We store the active module so that any elements built with data from this
// module can call back to it.
var module = this._backends[this._activeBackend].module;
var fileBlock = document.createElement('div');
fileBlock.entry = entry;
fileBlock.className = 'file';
// Use a closure here to make sure that the onclick handler has the
// right binding,
Xinha._addEvent(fileBlock, "click", function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
if (self.selectedEntry) {
// Unselect
removeClass(self.selectedEntry[1], 'selected');
if (self.selectedEntry[1] == fileBlock) {
// Allow click to toggle.
self.selectedEntry = null;
return;
}
}
self.selectedEntry = [entry, fileBlock];
self.selectedEntry[1].className += ' selected';
var filename = self.dialog.getElementById('filename');
filename.value = entry.name;
var confirmbutton = self.dialog.getElementById('confirm');
confirmbutton.disabled = false;
});
var image = document.createElement('img');
image.className = 'icon';
if (entry.$type == 'image') {
image.className = 'thumb';
image.setAttribute('src', entry.URL);
} else if (entry.$type == 'folder') {
image.setAttribute('src', entry.thumbURL || entry.URL || this.editor.imgURL('images/tango/32x32/places/folder.png'));
} else if (entry.$type == 'document') {
image.setAttribute('src', entry.thumbURL || entry.URL || this.editor.imgURL('images/tango/32x32/mimetypes/text-html.png'));
} else if (entry.$type == 'html') {
image.setAttribute('src', entry.thumbURL || entry.URL || this.editor.imgURL('images/tango/32x32/mimetypes/text-html.png'));
} else if (entry.$type == 'txt') {
image.setAttribute('src', entry.thumbURL || entry.URL || this.editor.imgURL('images/tango/32x32/mimetypes/text-g-generic.png'));
} else {
image.setAttribute('src', entry.thumbURL || entry.URL || this.editor.imgURL('images/tango/32x32/mimetypes/x-office-document.png'));
}
image = fileBlock.appendChild(image);
var deleteIcon = document.createElement('img');
deleteIcon.className = 'action delete';
deleteIcon.setAttribute('alt', Xinha._lc('Delete', 'PersistentStorage'));
deleteIcon.setAttribute('title', Xinha._lc('Delete', 'PersistentStorage'));
deleteIcon.setAttribute('src', this.editor.imgURL('images/tango/16x16/places/user-trash.png'));
deleteIcon = fileBlock.appendChild(deleteIcon);
Xinha._addEvent(deleteIcon, "click", function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
module.deleteEntry(entry, function(success) {
module.cache = null;
if (success) {
fileBlock.parentNode.removeChild(fileBlock);
} else {
alert('Error deleting file ' + entry.name);
}
});
});
var fileName = document.createElement('p');
fileName.className = 'filename';
var fileNameText = document.createTextNode(entry.name);
fileNameText = fileName.appendChild(fileNameText);
fileName = fileBlock.appendChild(fileName);
// Use a closure here to make sure that the onclick handler has the
// right binding,
fileName.onclick = function(fileName) {
return function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
fileName.style.border = '1px solid red';
return false;
};
}(fileName);
var copyIcon = document.createElement('img');
copyIcon.className = 'action copy';
copyIcon.setAttribute('src', this.editor.imgURL('images/tango/16x16/actions/edit-copy.png'));
copyIcon.setAttribute('alt', Xinha._lc('Copy', 'PersistentStorage'));
copyIcon.setAttribute('title', Xinha._lc('Copy', 'PersistentStorage'));
Xinha._addEvent(copyIcon, "click", function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
module.copyEntry(entry, function(success, newentry) {
module.cache = null;
if (success) {
fileBlock.parentNode.appendChild(self.buildThumbnail(newentry));
} else {
alert('Error copying file ' + entry.name);
}
});
});
copyIcon = fileBlock.appendChild(copyIcon);
return fileBlock;
}
/**
* Build up the file browser display in the element.
* @param metadata {Entry[]} A list of entries to display in the file browser.
* @param metadata[n].URL The URL where this entry is located, if available,
* @param metadata[n].thumbURL The URL of an image that represents a thumbnail
* preview of this file.
* @param metadata[n].$type {String} The type of this entry. This can be one of:
* 'image', 'media', 'folder', 'document', 'html', or 'text'
* @param metadata[n].name The name of this entry to display to the user.
*/
PersistentStorage.prototype.displayBrowser = function(metadata) {
// The div element that contains the file browser.
var div = this.dialog.getElementById("fileList");
// Clear out the previous directory listing.
while (div.lastChild) {
div.removeChild(div.lastChild);
}
var editor = this.editor;
var self = this;
for (var index=0; index<metadata.length; ++index) {
switch (this._viewType) {
case 'listing':
break;
case 'thumbnail':
default:
var thumb = div.appendChild(this.buildThumbnail(metadata[index]));
// If jQuery is loaded with the draggable and droppable UI controls,
// we'll enhance our interface.
if ($ && $.ui && $.ui.draggable && $.ui.droppable) {
// Make the objects draggable, but don't allow them to just hang
// around.
$(thumb).draggable({revert:true});
// All folders become drop targets to allow for easier moving
// around.
if (metadata[index].$type == 'folder') {
// Just in case Xinha is used on a page with other draggables, we
// need to limit the targets we accept.
$(thumb).droppable({accept: '*',
drop: function(e, ui) {
// Set up a reference to the drop target so that we can move
// all dragged items into it.
var target = this;
ui.draggable.each(function() {
// We extract the entry reference from the DOM node.
var file = this;
var entry = file.entry;
// TODO: Whoagh... What if our backend is a drop target?
var module = self._backends[self._activeBackend].module;
// This only works intra-module...
module.moveEntry(entry, target.entry, function(success) {
module.cache = null;
if (success) {
file.parentNode.removeChild(file);
} else {
alert('Error deleting file ' + entry.name);
}
});
});
}
});
}
}
}
}
// If the browser is empty, we'll display an empty message
if (!div.firstChild) {
var message = document.createTextNode('No files found');
div.appendChild(message);
}
}
/**
* Update the file browser according to the latest criteria.
*/
PersistentStorage.prototype.updateFileBrowser = function() {
var self = this;
var module = this._backends[this._activeBackend].module;
var buildDialog = function(cache) {
// We cache the module data to save server roundtrips.
module.cache = cache;
// The backends are expected to process their cached data to create
// two data structures for us. The first one is a list of filters
// used to keep the amount of data manageable in the interface.
// (e.g. directories, or tags, etc.)
var filters = module.getFilters(module.cache);
// Now that we have valid filter data, we setup the initial filter.
var resetFilter = true;
if (module.viewFilter) {
for (var index=0; index<filters.length; ++index) {
if (filters[index].value == module.viewFilter) {
resetFilter = false;
}
}
}
if (resetFilter) {
module.viewFilter = filters[0].value;
}
// The second data structure we need is a list of metadata about
// each file so that we can generate the appropriate listing.
var metadata = module.getMetadata(module.cache, module.viewFilter, self._typeFilter);
self.dialog.show();
self.displayFilters(filters, module.viewFilter);
self.displayBrowser(metadata);
};
if (module.cache) {
buildDialog(module.cache);
return;
}
module.loadData(buildDialog);
}
/**
* Prepare all external resources necessary to display the dialog.
*/
PersistentStorage.prototype._prepareDialog = function() {
var self = this;
var editor = this.editor;
if (!this.html) {
Xinha._getback(Xinha.getPluginDir("PersistentStorage") + "/dialog.html",
function(getback) {
self.html = getback;
self._prepareDialog();
});
return;
}
this.dialog = new Xinha.Dialog(editor, this.html, "PersistentStorage",
{width: 800,
closeOnEscape: true,
resizable: true,
centered: true,
modal: true
});
// The cancel dialog just hides the dialog.
this.dialog.getElementById("cancel").onclick = function() {
self.dialog.hide();
};
// Directory creation prompts the user for a directory name.
this.dialog.getElementById("dirCreate").onclick = function() {
var dirname = prompt(Xinha._lc('Please enter the name of the directory you\'d like to create.', 'PersistentStorage'));
if (dirname) {
var module = self._backends[self._activeBackend].module;
module.makeFolder(module.viewFilter, dirname, function(success) {
if (success) {
module.cache = null;
self.updateFileBrowser();
}
});
}
};
// The import field is hidden by default, and clicking on it toggles that state.
var importLegend = this.dialog.getElementById("importlegend");
var importDiv = this.dialog.getElementById("import");
importLegend.onclick = function() {
toggleClass(importDiv, 'collapsed');
};
// Since the WWW icons is a static element, we hook up it's click handler
// here, rather than when showing the dialog
var iconWWW = this.dialog.getElementById("WWW");
Xinha._addEvent(iconWWW, "click", function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
for (var indexEl=iconWWW.parentNode.firstChild; indexEl; indexEl = indexEl.nextSibling) {
if (1 != indexEl.nodeType) {
// We only process HTML nodes.
continue;
}
removeClass(indexEl, 'selected');
}
addClass(iconWWW, 'selected');
addClass(self.dialog.getElementById("placeBackend"), 'hidden');
removeClass(self.dialog.getElementById("placeWww"), 'hidden');
});
// Clicking inside of the file browser will deselect all files.
var fileBrowser = this.dialog.getElementById("fileList");
Xinha._addEvent(fileBrowser, "click", function(ev) {
for (var file=fileBrowser.firstChild; file; file=file.nextSibling) {
removeClass(file, 'selected');
}
});
// Setup the filter control so that user selection will refilter the shown
// files.
var filterControl = this.dialog.getElementById("filters");
filterControl.onchange = function() {
var module = self._backends[self._activeBackend].module;
module.viewFilter = filterControl.options[filterControl.selectedIndex].value;
self.updateFileBrowser();
};
// Setup the viewtype control to change the internals of the file list.
var viewType = this.dialog.getElementById("viewType");
viewType.onchange = function() {
self._viewType = viewType.options[viewType.selectedIndex].value;
self.updateFileBrowser();
}
this.ready = true;
};
/**
* Update the list of available backends.
*/
PersistentStorage.prototype.updatePlacesDisplay = function(capability) {
var self = this;
var placesBrowser = this.dialog.getElementById("placesList");
// Clear out any empty text nodes in the places browser.
while (placesBrowser.firstChild && 3 == placesBrowser.firstChild.nodeType) {
placesBrowser.removeChild(placesBrowser.firstChild);
}
var WWW = placesBrowser.firstChild;
while (WWW.nextSibling) {
placesBrowser.removeChild(WWW.nextSibling);
}
for (var backendName in this._backends) {
if (capability && !this._backends[backendName].config.capabilities[capability]) {
continue;
}
var thumb = placesBrowser.appendChild(this.placesIcon(this._backends[backendName]));
if ($ && $.ui && $.ui.draggable && $.ui.droppable) {
// Just in case Xinha is used on a page with other draggables, we
// need to limit the targets we accept.
$(thumb).droppable({accept: '*',
drop: function(e, ui) {
// Set up a reference to the drop target so that we can move
// all dragged items into it.
var target = this;
ui.draggable.each(function() {
// We extract the entry reference from the DOM node.
var file = this;
var entry = file.entry;
// TODO: Whoagh... What if our backend is a drop target?
var module = self._backends[self._activeBackend].module;
module.loadDocument(entry, function(documentSource) {
target.backend.module.saveDocument(module.viewFilter, entry.name, documentSource, function() {
target.backend.module.cache = null;
module.deleteEntry(entry, function(success) {
module.cache = null;
if (success) {
file.parentNode.removeChild(file);
} else {
alert('Error deleting file ' + entry.name);
}
});
});
});
});
}
});
}
}
}
/**
* Set the currently active backend
*/
PersistentStorage.prototype.setBackend = function(backendName) {
if (this._activeBackend == backendName) {
// Save ourselves some work.
return;
}
this._activeBackend = backendName;
var module = this._backends[this._activeBackend];
if (module.config.capabilities.import_operations) {
Xinha._removeClass(this.dialog.getElementById("import"),'hidden');
var importUI = this.dialog.getElementById("importui");
while (importUI.firstChild) {
// Clear out the import UI of any other backend.
importUI.removeChild(importUI.firstChild);
}
module.module.buildImportUI(this.dialog, importUI);
} else {
Xinha._addClass(this.dialog.getElementById("import"),'hidden');
}
}
/**
* Build a UI representation of the backend.
*/
PersistentStorage.prototype.placesIcon = function(backend) {
var self = this;
var placesBlock = document.createElement('div');
placesBlock.backend = backend;
placesBlock.className = 'file';
if (this._activeBackend == backend.name) {
placesBlock.className += ' selected';
}
// Use a closure here to make sure that the onclick handler has the
// right binding,
Xinha._addEvent(placesBlock, "click", function(ev) {
ev = ev || window.event;
Xinha._stopEvent(ev);
for (var indexEl=placesBlock.parentNode.firstChild; indexEl; indexEl = indexEl.nextSibling) {
if (1 != indexEl.nodeType) {
// We only process HTML nodes.
continue;
}
removeClass(indexEl, 'selected');
}
addClass(placesBlock, 'selected');
removeClass(self.dialog.getElementById("placeBackend"), 'hidden');
addClass(self.dialog.getElementById("placeWww"), 'hidden');
self.setBackend(backend.name);
self.updateFileBrowser();
});
var image = document.createElement('img');
image.className = 'icon';
image.setAttribute('src', backend.config.thumbURL || this.editor.imgURL('images/tango/32x32/places/network-server.png'));
image = placesBlock.appendChild(image);
var placesName = document.createElement('p');
placesName.className = 'filename';
var placesNameText = document.createTextNode(backend.config.displayName || backend.name);
placesNameText = placesName.appendChild(placesNameText);
placesName = placesBlock.appendChild(placesName);
return placesBlock;
}
/**
* The Xinha text editor
* @name Xinha
*/
var Xinha = window.Xinha;
/**
* We override the native _insertImage function of Xinha. We call the instance
* version of the method in order to setup the proper context.
* @param image TODO Figure out what this is :-D
*/
Xinha.prototype._insertImage = function(image) {
var editor = this;
var PS = editor.plugins['PersistentStorage'].instance;
// Setup the dialog title
var title = PS.dialog.getElementById("h1");
title.innerHTML = Xinha._lc('Insert Image', 'PersistentStorage');
// Setup the confirmation button and action.
var button = PS.dialog.getElementById("confirm");
button.value = Xinha._lc('Insert', 'PersistentStorage');
button.onclick = function() {
PS.insertImage();
};
PS.showDialog({typeFilter:['image','folder'],styleFor:'insertion'});
}
/**
* Take a selected image from the dialog and insert it into the document.
*/
PersistentStorage.prototype.insertImage = function() {
var editor = this.editor;
this.dialog.hide();
var image = editor._doc.createElement('img');
if (this.selectedEntry) {
image.setAttribute('src', this.selectedEntry[0].URL);
} else {
image.setAttribute('src', this.dialog.getElementById("URL").value);
}
for (var prop in {width:'',height:'',margin:'',padding:'',border:'',borderColor:'',backgroundColor:''}) {
var val = this.dialog.getElementById('image_' + prop).value.replace(/^\s+$/,'');
if (val) {
image.style[prop] = val;
}
}
editor.insertNodeAtSelection(image);
var range = editor.createRange(editor.getSelection());
range.collapse(false);
}
})(window.jQuery);
//Xinha.prototype._linkFile = function(link) {
//
// var editor = this;
// var outparam = {"editor" : this, param : 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 (Xinha.is_ie) {
// if ( sel.type == "Control" )
// compare = range.length;
// else
// compare = range.compareEndPoints("StartToEnd", range);
// } else {
// compare = range.compareBoundaryPoints(range.START_TO_END, range);
// }
// if (compare == 0) {
// alert(Xinha._lc("You must select some text before making a new link.", 'PersistentStorage'));
// return;
// }
// outparam.param = {
// f_href : '',
// f_title : '',
// f_target : '',
// f_usetarget : editor.config.makeLinkShowsTarget,
// baseHref: editor.config.baseHref
// };
// } else
// outparam.param = {
// f_href : Xinha.is_ie ? link.href : link.getAttribute("href"),
// f_title : link.title,
// f_target : link.target,
// f_usetarget : editor.config.makeLinkShowsTarget,
// baseHref: editor.config.baseHref
// };
//
// Dialog(this.config.PersistentStorage.manager+'&mode=link', 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 (!Xinha.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);
//};
//
//function shortSize(cssSize)
//{
// if(/ /.test(cssSize))
// {
// var sizes = cssSize.split(' ');
// var useFirstSize = true;
// for(var i = 1; i < sizes.length; i++)
// {
// if(sizes[0] != sizes[i])
// {
// useFirstSize = false;
// break;
// }
// }
// if(useFirstSize) cssSize = sizes[0];
// }
//
// return cssSize;
//}
//
//function convertToHex(color) {
//
// if (typeof color == "string" && /, /.test.color)
// color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b)
//
// if (typeof color == "string" && / /.test.color) { // multiple values
// var colors = color.split(' ');
// var colorstring = '';
// for (var i = 0; i < colors.length; i++) {
// colorstring += Xinha._colorToRgb(colors[i]);
// if (i + 1 < colors.length)
// colorstring += " ";
// }
// return colorstring;
// }
//
// return Xinha._colorToRgb(color);
//}
//});
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PersistentStorage/PersistentStorage.js | JavaScript | art | 39,955 |
// Simple CSS (className) plugin for the editor
// Sponsored by http://www.miro.com.au
// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
//
// (c) dynarch.com 2003
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// $Id: CSS.js 1084 2008-10-12 17:42:42Z ray $
// @TODO This is the default and won't be very useful to others.
// We should make this better.
Xinha.Config.prototype.cssPluginConfig =
{
combos : [
{ label: "Syntax",
// menu text // CSS class
options: { "None" : "",
"Code" : "code",
"String" : "string",
"Comment" : "comment",
"Variable name" : "variable-name",
"Type" : "type",
"Reference" : "reference",
"Preprocessor" : "preprocessor",
"Keyword" : "keyword",
"Function name" : "function-name",
"Html tag" : "html-tag",
"Html italic" : "html-helper-italic",
"Warning" : "warning",
"Html bold" : "html-helper-bold"
},
context: "pre"
},
{ label: "Info",
options: { "None" : "",
"Quote" : "quote",
"Highlight" : "highlight",
"Deprecated" : "deprecated"
}
}
]
};
function CSS(editor, params) {
this.editor = editor;
var cfg = editor.config;
var self = this;
var plugin_config;
if(params && params.length)
{
plugin_config = params[0];
}
else
{
plugin_config = editor.config.cssPluginConfig;
}
var combos = plugin_config.combos;
for (var i = 0; i < combos.length; i++) {
var combo = combos[i];
var id = "CSS-class" + i;
var css_class = {
id : id,
options : combo.options,
action : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
refresh : function(editor) { self.updateValue(editor, this); },
context : combo.context
};
cfg.registerDropdown(css_class);
cfg.addToolbarElement(["T[" + combo.label + "]", id, "separator"] , "formatblock", -1);
}
}
CSS._pluginInfo = {
name : "CSS",
version : "1.0",
developer : "Mihai Bazon",
developer_url : "http://dynarch.com/mishoo/",
c_owner : "Mihai Bazon",
sponsor : "Miro International",
sponsor_url : "http://www.miro.com.au",
license : "htmlArea"
};
CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
var tbobj = editor._toolbarObjects[obj.id];
var index = tbobj.element.selectedIndex;
var className = tbobj.element.value;
// retrieve parent element of the selection
var parent = editor.getParentElement();
var surround = true;
var is_span = (parent && parent.tagName.toLowerCase() == "span");
var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
if (update_parent) {
parent.className = className;
editor.updateToolbar();
return;
}
if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
while (parent.firstChild) {
parent.parentNode.insertBefore(parent.firstChild, parent);
}
parent.parentNode.removeChild(parent);
editor.updateToolbar();
return;
}
if (is_span) {
// maybe we could simply change the class of the parent node?
if (parent.childNodes.length == 1) {
parent.className = className;
surround = false;
// in this case we should handle the toolbar updation
// ourselves.
editor.updateToolbar();
}
}
// Other possibilities could be checked but require a lot of code. We
// can't afford to do that now.
if (surround) {
// shit happens ;-) most of the time. this method works, but
// it's dangerous when selection spans multiple block-level
// elements.
editor.surroundHTML("<span class='" + className + "'>", "</span>");
}
};
CSS.prototype.updateValue = function(editor, obj) {
var select = editor._toolbarObjects[obj.id].element;
var parent = editor.getParentElement();
if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
var options = select.options;
var value = parent.className;
for (var i = options.length; --i >= 0;) {
var option = options[i];
if (value == option.value) {
select.selectedIndex = i;
return;
}
}
}
select.selectedIndex = 0;
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CSS/CSS.js | JavaScript | art | 4,538 |
/**
* PSLocal PSLocal.js file.
* This plugin is a Gears based local persistent storage backend.
*/
(function() {
var PSLocal = window.PSLocal = function PSLocal(editor) {
this.editor = editor;
this.config = {
capabilities: {
directory_operations: true,
file_operations: true,
image_operations: false,
upload_operations: true,
import_operations: false,
user_publish: false,
shared_publish: false,
user_storage: true
},
displayName: 'Local'
}
}
PSLocal._pluginInfo = {
name : "PSLocal",
version : "2.0",
developer : "Douglas Mayle",
developer_url : "http://xinha.org",
license : "BSD"
};
PSLocal.prototype.onGenerateOnce = function () {
// We use _prepareBackend to asynchronously load the Gears backend.
this._prepareBackend();
};
PSLocal.prototype._showGearsButton = function() {
var self = this;
var editor = this.editor;
editor.config.registerButton({
id : 'localstorage',
tooltip : Xinha._lc( 'Learn About Local Storage', 'PSLocal' ),
image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',2,8],
textMode : true,
action : function() { self.learnDialog(); }
}
);
editor.config.addToolbarElement('localstorage', 'fullscreen', 1);
// Since this is after the editor load, we have to trigger an udate manually...
editor._rebuildToolbar();
}
PSLocal.prototype._prepareBackend = function() {
var self = this;
var editor = this.editor;
if (!this.gears_init) {
this.gears_init = true;
Xinha._loadback(Xinha.getPluginDir("PSLocal") + "/gears_init.js",
function() {
self._prepareBackend();
});
return;
}
if (!window.google || !google.gears) {
// No gears, so no need to register. We'll register a button, however, to
// enable users to learn about the support we offer.
this._showGearsButton();
return;
}
if (!google.gears.factory.hasPermission) {
if (!google.gears.factory.getPermission('Xinha', editor.imgURL('/images/xinha-small-icon.gif'), Xinha._lc( 'Enable Gears in order to use local document storage and configuration.', 'PSLocal' ))) {
// The user has denied access to Gears. We'll give them a UI to allow
// them to change their mind.
this._showGearsButton();
return;
}
}
this.workerPool = google.gears.factory.create('beta.workerpool', '1.0');
this.remoteStorageWorker = this.workerPool.createWorkerFromUrl("http://xinhadocs.org/worker.js");
this._registerBackend();
}
PSLocal.prototype.learnDialog = function(timeWaited) {
var self = this;
var editor = this.editor;
if (!this.html) {
Xinha._getback(Xinha.getPluginDir("PSLocal") + "/dialog.html",
function(getback) {
self.html = getback;
self.learnDialog();
});
return;
}
if (this.dialog) {
this.dialog.show();
return;
}
this.dialog = new Xinha.Dialog(editor, this.html, "PersistentStorage",
{width: 700,
closeOnEscape: true,
resizable: true,
centered: true,
modal: true
});
var link = this.dialog.getElementById('GearsLink');
// Tack on our URL so that Google will return here after installation.
link.href += location.href;
var button = this.dialog.getElementById("confirm");
if (window.google && google.gears) {
Xinha._addClass(this.dialog.getElementById('InstallText'), 'hidden');
// The user has gears installed, but has denied us access to it, so we'll
// give them the option to change their mind.
button.value = Xinha._lc('Enable', 'PSLocal');
button.onclick = function() {
// The user gave us permission, so we'll reload the page.
if (confirm(Xinha._lc('This will reload the page, causing you to lose any unsaved work. Press "OK" to reload.', 'PSLocal' ))) {
window.location.reload(true);
}
}
} else {
Xinha._addClass(this.dialog.getElementById('EnableText'), 'hidden');
// Gears isn't installed, so we'll build the dialog to prompt installation.
button.value = Xinha._lc('Install', 'PSLocal');
button.onclick = function() {
location.href = link.href;
}
}
var cancel = this.dialog.getElementById('cancel');
cancel.onclick = function() {
self.dialog.hide();
}
this.dialog.show();
}
PSLocal.prototype._registerBackend = function(timeWaited) {
var editor = this.editor;
var self = this;
if (!timeWaited) {
timeWaited = 0;
}
// Retry over a period of ten seconds to register. We back off exponentially
// to limit resouce usage in the case of misconfiguration.
var registerTimeout = 10000;
if (timeWaited > registerTimeout) {
// This is most likely a configuration error. We're loaded and
// PersistentStorage is not.
return;
}
if (!editor.plugins['PersistentStorage'] ||
!editor.plugins['PersistentStorage'].instance ||
!editor.plugins['PersistentStorage'].instance.ready) {
window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50);
return;
}
var PS = editor.plugins['PersistentStorage'].instance;
var self = this;
this.config.thumbURL = this.editor.imgURL('images/tango/32x32/places/folder.png');
this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) {
var userconfig = json ? eval('(' + json + ')') : false;
PS.registerBackend('PSLocal', self, self.config, userconfig);
});
}
PSLocal.prototype.loadDocument = function(entry, asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback('');
}
if (message.body.response) {
asyncCallback(message.body.response);
} else if (entry.URL) {
Xinha._getback(entry.URL,
function(documentSource) {
asyncCallback(documentSource);
});
} else {
// Oops, no data :-(
asyncCallback('');
}
}
this.workerPool.sendMessage({func: 'loadDocument', entry: entry}, this.remoteStorageWorker);
}
PSLocal.prototype.loadData = function (asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback('');
}
asyncCallback({dirs: message.body.dirs, files: message.body.files});
}
this.workerPool.sendMessage({func: 'loadData'}, this.remoteStorageWorker);
}
PSLocal.prototype.getFilters = function(filedata) {
// Clear out the previous directory listing.
var filters = [], paths = {};
var dirList = filedata.dirs;
for (var index=0; index<dirList.length; ++index) {
filters.push({value:dirList[index],display:dirList[index]});
}
// We can't return an empty filter list.
if (!filters.length) {
filters.push({value:'/',display:'/'});
}
return filters;
}
PSLocal.prototype.getMetadata = function(filedata, filterPath) {
var editor = this.editor;
var self = this;
var metadata = [];
var fileList = filedata.files;
for (var index=0; index<fileList.length; ++index) {
// Gah perform file splitting here..
var pathpart = fileList[index].fullpath.split('/');
if (pathpart.length > 2) {
pathpart = pathpart.slice(0,pathpart.length-1).join('/');
} else {
pathpart = '/';
}
var filepart = fileList[index].fullpath.split('/').slice(-1)[0];
if (filterPath == pathpart) {
metadata.push({
URL: fileList[index].url,
thumbURL: editor.imgURL('images/tango/32x32/mimetypes/text-x-generic.png'),
name: filepart,
key: fileList[index].fullpath,
$type: fileList[index].filetype
});
}
}
var dirList = filedata.dirs;
for (var index=0; index<dirList.length; ++index) {
// We have to be careful to filter out when filterPath IS the current intry in dirList
if (1 == filterPath.length) {
// If the filter path is the root '/' (ie. length of one) then we
// select the directory if a) It is not also of length one (ie. '/')
// and b) has only one slash in it. (We check the number of slashes by
// splitting the string by '/' and subtracting one from the length.)
var matches = dirList[index].length > 1 && dirList[index].split('/').length == 2;
} else {
// Chop the last component of the directory and compare against the filter.
var matches = dirList[index].split('/').slice(0,-1).join('/') == filterPath;
}
if (matches) {
metadata.push({
name: dirList[index].split('/').slice(-1),
key: dirList[index],
$type: 'folder'
});
}
}
return metadata;
}
PSLocal.prototype.saveDocument = function(parentpath, filename, documentSource, asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback(false);
}
if (asyncCallback) {
asyncCallback(message.body.response);
}
}
this.workerPool.sendMessage({func: 'saveDocument', parentpath: parentpath, filename: filename, content:documentSource}, this.remoteStorageWorker);
}
PSLocal.prototype.deleteEntry = function(entry, asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback(false);
}
if (asyncCallback) {
asyncCallback(message.body.response);
}
}
this.workerPool.sendMessage({func: 'deleteEntry', entry: entry}, this.remoteStorageWorker);
}
PSLocal.prototype.makeFolder = function(currentPath, folderName, asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback(false);
}
if (asyncCallback) {
asyncCallback(true);
}
}
this.workerPool.sendMessage({func: 'makeFolder', parentpath: currentPath, dirname: folderName}, this.remoteStorageWorker);
}
PSLocal.prototype.copyEntry = function(entry, asyncCallback) {
this.workerPool.onmessage = function(a, b, message) {
if (!message.body || !message.body.authorized) {
// Fail
asyncCallback(false);
}
if (asyncCallback) {
asyncCallback(message.body.response, message.body.entry);
}
}
this.workerPool.sendMessage({func: 'copyEntry', entry: entry}, this.remoteStorageWorker);
}
})();
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PSLocal/PSLocal.js | JavaScript | art | 11,180 |
// Copyright 2007, Google Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Sets up google.gears.*, which is *the only* supported way to access Gears.
//
// Circumvent this file at your own risk!
//
// In the future, Gears may automatically define google.gears.* without this
// file. Gears may use these objects to transparently fix bugs and compatibility
// issues. Applications that use the code below will continue to work seamlessly
// when that happens.
(function() {
// We are already defined. Hooray!
if (window.google && google.gears) {
return;
}
var factory = null;
// Firefox
if (typeof GearsFactory != 'undefined') {
factory = new GearsFactory();
} else {
// IE
try {
factory = new ActiveXObject('Gears.Factory');
// privateSetGlobalObject is only required and supported on WinCE.
if (factory.getBuildInfo().indexOf('ie_mobile') != -1) {
factory.privateSetGlobalObject(this);
}
} catch (e) {
// Safari
if ((typeof navigator.mimeTypes != 'undefined')
&& navigator.mimeTypes["application/x-googlegears"]) {
factory = document.createElement("object");
factory.style.display = "none";
factory.width = 0;
factory.height = 0;
factory.type = "application/x-googlegears";
document.documentElement.appendChild(factory);
}
}
}
// *Do not* define any objects if Gears is not installed. This mimics the
// behavior of Gears defining the objects in the future.
if (!factory) {
return;
}
// Now set up the objects, being careful not to overwrite anything.
//
// Note: In Internet Explorer for Windows Mobile, you can't add properties to
// the window object. However, global objects are automatically added as
// properties of the window object in all browsers.
if (!window.google) {
google = {};
}
if (!google.gears) {
google.gears = {factory: factory};
}
})();
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PSLocal/gears_init.js | JavaScript | art | 3,370 |
<h1><l10n>Enabling Local Storage</l10n></h1>
<p><l10n>Xinha uses Google Gears to enable local document storage. With Gears installed, you can save drafts of your documents on your hard drive, configure Xinha to look the way you want, and carry this information wherever you use Xinha on the web.</l10n></p>
<p id="InstallText"><l10n>To learn more about Gears, and enable this functionality on your system, please see <a id="[GearsLink]" href="http://gears.google.com/?action=install&message=Enable local storage for Xinha&return=">http://gears.google.com</a> or click "Install" below.</l10n></p>
<p id="EnableText"><l10n>To enable Gears for this website, click "Enable" to reload the page then enable Gears.. Since the page will be refreshed, please be sure to save any unfinished work.</l10n></p>
<input type="button" id="[confirm]" value="_(Confirm)" />
<input type="button" id="[cancel]" value="_(Cancel)" />
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PSLocal/dialog.html | HTML | art | 914 |
<h1 id="[h1]"><l10n>SmartReplace Settings</l10n></h1>
<div style="margin-left: 10px;">
<table style="width: 100%;border:none">
<tr>
<td style="width:15px"><input type="checkbox" id="[enable]" name="[enable]" value="on" /></td>
<td style="text-align:left"><l10n>Enable automatic replacements</l10n></td>
</tr>
<tr>
<td style="width:15px"><input type="checkbox" id="[convert]" name="[convert]" value="on" /></td>
<td style="text-align:left"><l10n>Convert all quotes and dashes in the current document</l10n> <input style="display:none" type="button" id="[ok]" value="_(OK)" /></td>
</tr>
</table>
</div>
<div class="buttons">
</div>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/dialog.html | HTML | art | 658 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"SmartReplace Settings" : "SmartReplace Instellingen",
"Enable automatic replacements" : "Automatisch vervangen inschakelen",
"Convert all quotes and dashes in the current document": "Converteer alle quotes en schuine strepen",
"OpeningDoubleQuotes": "„",
"ClosingDoubleQuotes": "“",
"OpeningSingleQuote": "‚",
"ClosingSingleQuote": "‘"
/*
"OpeningDoubleQuotes": "»",
"ClosingDoubleQuotes": "«",
"OpeningSingleQuote": "›",
"ClosingSingleQuote": "‹"
*/
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/lang/nl.js | JavaScript | art | 602 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
{
"SmartReplace Settings" : "SmartReplace Einstellungen",
"Enable automatic replacements" : "Automatische Ersetzung aktivieren",
"Convert all quotes and dashes in the current document": "Alle Anführungszeichen und Gedankenstriche umwandeln",
"OpeningDoubleQuotes": "„",
"ClosingDoubleQuotes": "“",
"OpeningSingleQuote": "‚",
"ClosingSingleQuote": "‘"
/*
"OpeningDoubleQuotes": "»",
"ClosingDoubleQuotes": "«",
"OpeningSingleQuote": "›",
"ClosingSingleQuote": "‹"
*/
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/lang/de.js | JavaScript | art | 566 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"SmartReplace Settings" : "Paramètres SmartReplace",
"Enable automatic replacements" : "Activer le remplacement automatique",
"Convert all quotes and dashes in the current document": "Convertir tous les guillemets et tirets dans le document actuel",
"OpeningDoubleQuotes": "»",
"ClosingDoubleQuotes": "«",
"OpeningSingleQuote": "",
"ClosingSingleQuote": ""
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/lang/fr.js | JavaScript | art | 422 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"SmartReplace Settings" : "SmartReplace設定",
"Enable automatic replacements" : "自動置換の有効化",
"Convert all quotes and dashes in the current document": "文書内の引用符とダッシュをすべて変換",
"OpeningDoubleQuotes": "„",
"ClosingDoubleQuotes": "“",
"OpeningSingleQuote": "‚",
"ClosingSingleQuote": "‘"
/*
"OpeningDoubleQuotes": "»",
"ClosingDoubleQuotes": "«",
"OpeningSingleQuote": "›",
"ClosingSingleQuote": "‹"
*/
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/lang/ja.js | JavaScript | art | 532 |
// I18N constants
//
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
//
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
//
// Last revision: 06 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
//
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Cancel": "Cancelar",
"Convert all quotes and dashes in the current document": "Converter todas as citações e hífens no documento atual",
"Enable automatic replacements": "Ativar substituições automáticas",
"OK": "OK",
"SmartReplace": "Substituição Rápida",
"SmartReplace Settings": "Configurações da Substituição Rápida"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/lang/pt_br.js | JavaScript | art | 848 |
/*------------------------------------------*\
SmartReplace for Xinha
_______________________
\*------------------------------------------*/
function SmartReplace(editor) {
this.editor = editor;
var cfg = editor.config;
var self = this;
cfg.registerButton
({
id : "smartreplace",
tooltip : this._lc("SmartReplace"),
image : [_editor_url +'iconsets/Tango/ed_buttons_main.png',3,8],
textMode : false,
action : function(e, objname, obj) { self.buttonPress(null, obj); }
});
cfg.addToolbarElement("smartreplace", "htmlmode", 1);
}
SmartReplace._pluginInfo = {
name : "SmartReplace",
version : "1.0",
developer : "Raimund Meyer",
developer_url : "http://x-webservice.net",
c_owner : "Raimund Meyer",
sponsor : "",
sponsor_url : "",
license : "htmlArea"
};
SmartReplace.prototype._lc = function(string) {
return Xinha._lc(string, 'SmartReplace');
};
Xinha.Config.prototype.SmartReplace =
{
'defaultActive' : true,
'quotes' : null//[String.fromCharCode(187),String.fromCharCode(171),String.fromCharCode(8250),String.fromCharCode(8249)]
}
SmartReplace.prototype.toggleActivity = function(newState)
{
if (typeof newState != 'undefined')
{
this.active = newState;
}
else
{
this.active = this.active ? false : true;
}
this.editor._toolbarObjects.smartreplace.state("active", this.active);
}
SmartReplace.prototype.onUpdateToolbar = function() {
this.editor._toolbarObjects.smartreplace.state("active", this.active);
}
SmartReplace.prototype.onGenerate = function() {
this.active = this.editor.config.SmartReplace.defaultActive;
this.editor._toolbarObjects.smartreplace.state("active", this.active);
var self = this;
Xinha._addEvent(
self.editor._doc,
"keypress",
function (event)
{
return self.keyEvent(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event);
});
var quotes = this.editor.config.SmartReplace.quotes;
if (quotes && typeof quotes == 'object')
{
this.openingQuotes = quotes[0];
this.closingQuotes = quotes[1];
this.openingQuote = quotes[2];
this.closingQuote = quotes[3];
}
else
{
this.openingQuotes = this._lc("OpeningDoubleQuotes");
this.closingQuote = this._lc("ClosingSingleQuote");
this.closingQuotes = this._lc("ClosingDoubleQuotes");
this.openingQuote = this._lc("OpeningSingleQuote");
}
if (this.openingQuotes == 'OpeningDoubleQuotes') //If nothing else is defined, English style as default
{
this.openingQuotes = String.fromCharCode(8220);
this.closingQuotes = String.fromCharCode(8221);
this.openingQuote = String.fromCharCode(8216);
this.closingQuote = String.fromCharCode(8217);
}
};
SmartReplace.prototype.keyEvent = function(ev)
{
if ( !this.active) return true;
var editor = this.editor;
var charCode = Xinha.is_ie ? ev.keyCode : ev.which;
var key = String.fromCharCode(charCode);
if ( key == '"' || key == "'")
{
Xinha._stopEvent(ev);
return this.smartQuotes(key);
}
if (charCode == 32) //space bar
{
return this.smartReplace(ev, 2, /^\s-/, ' '+String.fromCharCode(8211), false); // space-space -> dash
}
if ( key == '.' ) // ... -> ellipsis
{
return this.smartReplace(ev, 2, /\.\./, String.fromCharCode(8230), true);
}
return true;
}
SmartReplace.prototype.smartQuotes = function(kind)
{
if (kind == "'")
{
var opening = this.openingQuote;
var closing = this.closingQuote;
}
else
{
var opening = this.openingQuotes;
var closing = this.closingQuotes;
}
var editor = this.editor;
var sel = editor.getSelection();
if (Xinha.is_ie)
{
var r = editor.createRange(sel);
if (r.text !== '')
{
r.text = '';
}
r.moveStart('character', -1);
if(r.text.match(/\S/))
{
r.moveStart('character', +1);
r.text = closing;
}
else
{
r.moveStart('character', +1);
r.text = opening;
}
}
else
{
var r = editor.createRange(sel);
if (!r.collapsed)
{
editor.insertNodeAtSelection(document.createTextNode(''));
}
if (r.startOffset > 0) r.setStart(r.startContainer, r.startOffset -1);
if(r.toString().match(/[^\s\xA0]/))
{;
r.collapse(false);
editor.insertNodeAtSelection(document.createTextNode(closing));
}
else
{
editor.insertNodeAtSelection(document.createTextNode(r.toString()[0]+opening));
}
editor.getSelection().collapseToEnd();
}
return false;
}
SmartReplace.prototype.smartReplace = function(ev, lookback, re, replace, stopEvent)
{
var editor = this.editor;
var sel = this.editor.getSelection();
var r = this.editor.createRange(sel);
if (Xinha.is_ie)
{
r.moveStart('character', -lookback);
if(r.text.match(re))
{
r.text = replace;
if (stopEvent)
{
Xinha._stopEvent(ev);
return false
}
}
}
else
{
if (r.startOffset > 1) r.setStart(r.startContainer, r.startOffset -lookback);
if(r.toString().match(re))
{
this.editor.insertNodeAtSelection(document.createTextNode(replace));
r.deleteContents();
r.collapse(true);
if (stopEvent)
{
Xinha._stopEvent(ev);
return false
}
}
editor.getSelection().collapseToEnd();
}
return true;
}
SmartReplace.prototype.replaceAll = function()
{
var doubleQuotes = [
'"',
String.fromCharCode(8220),
String.fromCharCode(8221),
String.fromCharCode(8222),
String.fromCharCode(187),
String.fromCharCode(171)
];
var singleQuotes = [
"'",
String.fromCharCode(8216),
String.fromCharCode(8217),
String.fromCharCode(8218),
String.fromCharCode(8250),
String.fromCharCode(8249)
];
var html = this.editor.getHTML();
var reOpeningDouble = new RegExp ('(\\s|^|>)('+doubleQuotes.join('|')+')(\\S)','g');
html = html.replace(reOpeningDouble,'$1'+this.openingQuotes+'$3');
var reOpeningSingle = new RegExp ('(\\s|^|>)('+singleQuotes.join('|')+')(\\S)','g');
html = html.replace(reOpeningSingle,'$1'+this.openingQuote+'$3');
var reClosingDouble = new RegExp ('(\\S)('+doubleQuotes.join('|')+')','g');
html = html.replace(reClosingDouble,'$1'+this.closingQuotes);
var reClosingSingle = new RegExp ('(\\S)('+singleQuotes.join('|')+')','g');
html = html.replace(reClosingSingle,'$1'+this.closingQuote);
var reDash = new RegExp ('( | )(-)( | )','g');
html = html.replace(reDash,' '+String.fromCharCode(8211)+' ');
this.editor.setHTML(html);
}
SmartReplace.prototype.buttonPress = function(opts, obj)
{
var self = this;
if ( this.dialog.rootElem.style.display != 'none')
{
return this.dialog.hide();
}
var doOK = function()
{
var opts = self.dialog.hide();
self.toggleActivity((opts.enable) ? true : false);
if (opts.convert)
{
self.replaceAll();
self.dialog.getElementById("convert").checked = false;
}
}
var inputs =
{
enable : self.active ? "on" : '',
convert: ''
};
this.show(inputs, doOK);
};
SmartReplace.prototype.onGenerateOnce = function()
{
this._prepareDialog();
};
SmartReplace.prototype._prepareDialog = function()
{
var self = this;
var editor = this.editor;
if(!this.html)
{
Xinha._getback( Xinha.getPluginDir("SmartReplace") + '/dialog.html', function(getback) { self.html = getback; self._prepareDialog(); });
return;
}
// Now we have everything we need, so we can build the dialog.
this.dialog = new Xinha.Dialog(editor, this.html, 'SmartReplace',{},{modal:false});
this.dialog.attachToPanel('top');
this.dialog.getElementById('enable').onchange = function ()
{
self.toggleActivity(this.checked);
}
this.dialog.getElementById('convert').onchange = function ()
{
self.dialog.getElementById('ok').style.display = ( this.checked ) ? '' : 'none';
}
this.dialog.getElementById('ok').onclick = function ()
{
self.replaceAll();
self.dialog.getElementById('convert').checked = false;
this.style.display = 'none';
}
this.ready = true;
};
SmartReplace.prototype.show = function(inputs)
{
if(!this.ready)
{
var self = this;
window.setTimeout(function() {self.show(inputs,ok,cancel);},100);
return;
}
// Connect the OK and Cancel buttons
var self = this;
this.dialog.show(inputs);
// Init the sizes
this.dialog.onresize();
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SmartReplace/SmartReplace.js | JavaScript | art | 8,581 |
/**
* PSFixed PSFixed.js file.
* This plugin is a fake persistent storage backed. It is configured with a
* fixed list of stored objects and presents them to the user for insertion.
* A sample config is below:
*
* PSFixed.config = {
* 'xinha.png': {
* $type: 'image',
* URL: 'http://trac.xinha.org/chrome/common/trac_banner.png'
* },
* 'browser': {
* $type: 'folder',
* 'firefox.png': {
* $type: 'image',
* URL: 'http://www.mozilla.com/img/tignish/firefox/vs-firefox-logo.png'
* }
* }
* }
*/
(function() {
var PSFixed = window.PSFixed = function PSFixed(editor) {
this.editor = editor;
}
PSFixed._pluginInfo = {
name : "PSFixed",
version : "2.0",
developer : "Douglas Mayle",
developer_url : "http://xinha.org",
license : "BSD"
};
PSFixed.prototype.onGenerateOnce = function () {
// We use _prepareDialog to asynchronously load the dialog markup and then
// perform necessary processing.
this._registerBackend();
};
PSFixed.prototype._registerBackend = function(timeWaited) {
var editor = this.editor;
var self = this;
if (!timeWaited) {
timeWaited = 0;
}
// Retry over a period of ten seconds to register. We back off exponentially
// to limit resouce usage in the case of misconfiguration.
var registerTimeout = 10000;
if (timeWaited > registerTimeout) {
// This is most likely a configuration error. We're loaded and
// PersistentStorage is not.
return;
}
if (!editor.plugins['PersistentStorage'] ||
!editor.plugins['PersistentStorage'].instance ||
!editor.plugins['PersistentStorage'].instance.ready) {
window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50);
return;
}
editor.plugins['PersistentStorage'].instance.registerBackend('PSFixed', this);
}
PSFixed.prototype.loadData = function (asyncCallback) {
// We don't expect the user to set the type on the root folder, so we set it
// ourselves.
if (!this.config.$type) {
this.config.$type = 'folder';
}
asyncCallback(this.config);
}
var treeRecurse = function treeRecurse(tree, callback, root) {
if (typeof root == 'undefined') {
root = '/';
callback('/', '', tree);
}
for (var key in tree) {
callback(root, key, tree[key]);
if (tree[key].$type == 'folder') {
treeRecurse(tree[key], callback, root + key + '/');
}
}
};
PSFixed.prototype.getFilters = function(dirTree) {
var filters = [];
treeRecurse(dirTree, function(path, key, value) {
if (value.$type != 'folder') {
return;
}
var filePath = key.length ? path + key + '/' : path;
filters.push({
value: filePath,
display: filePath
});
});
return filters;
}
PSFixed.prototype.getMetadata = function(dirTree, filterPath) {
var editor = this.editor;
var self = this;
var metadata = [];
treeRecurse(dirTree, function(path, key, value) {
if (!value.$type || !key) {
// This is a builtin property of objects, not one returned by the
// backend.
return;
}
if (path != filterPath) {
return;
}
if (value.$type == 'folder') {
metadata.push({
URL: self.editor.imgURL('folder.gif', 'PersistentStorage'),
name: key,
key: path + key,
$type: value.$type
});
} else {
metadata.push({
URL: value.URL,
name: key,
key: path + key,
$type: value.$type
});
}
});
return metadata;
}
})();
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PSFixed/PSFixed.js | JavaScript | art | 3,782 |
<?php
/** This PHP file is intended for use with XMLHTTPRequest from Xinha
* it requrns javascript to set the Xinha html with tidied html that is
* submitted in a $_POST parameter called 'content'
*/
if(get_magic_quotes_gpc())
{
// trigger_error('Magic Quotes GPC is on, cleaning GPC.', E_USER_NOTICE);
$to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);
while(count($to_clean))
{
$cleaning =& $to_clean[array_pop(array_keys($to_clean))];
unset($to_clean[array_pop(array_keys($to_clean))]);
foreach(array_keys($cleaning) as $k)
{
if(is_array($cleaning[$k]))
{
$to_clean[] =& $cleaning[$k];
}
else
{
$cleaning[$k] = stripslashes($cleaning[$k]);
}
}
}
}
header('Content-Type: text/javascript; charset=utf-8');
/** Function to POST some data to a URL */
function PostIt($DataStream, $URL)
{
// Strip http:// from the URL if present
$URL = ereg_replace("^http://", "", $URL);
// Separate into Host and URI
$Host = substr($URL, 0, strpos($URL, "/"));
$URI = strstr($URL, "/");
// Form up the request body
$ReqBody = "";
while (list($key, $val) = each($DataStream)) {
if ($ReqBody) $ReqBody.= "&";
$ReqBody.= $key."=".urlencode($val);
}
$ContentLength = strlen($ReqBody);
// Generate the request header
$ReqHeader =
"POST $URI HTTP/1.0\n".
"Host: $Host\n".
"User-Agent: PostIt\n".
"Content-Type: application/x-www-form-urlencoded\n".
"Content-Length: $ContentLength\n\n".
"$ReqBody\n";
// echo $ReqHeader;
// Open the connection to the host
$socket = fsockopen($Host, 80, $errno, $errstr);
if (!$socket) {
$result = "($errno) $errstr";
return $Result;
}
fputs($socket, $ReqHeader);
$result = '';
while(!feof($socket))
{
$result .= fgets($socket);
}
return $result;
}
function js_encode($string)
{
static $strings = "\\,\",',%,&,<,>,{,},@,\n,\r";
if(!is_array($strings))
{
$tr = array();
foreach(explode(',', $strings) as $chr)
{
$tr[$chr] = sprintf('\x%02X', ord($chr));
}
$strings = $tr;
}
return strtr($string, $strings);
}
// Any errors would screq up our javascript
error_reporting(0);
ini_set('display_errors', false);
if(trim(@$_REQUEST['content']))
{
// PHP's urldecode doesn't understand %uHHHH for unicode
$_REQUEST['content'] = preg_replace('/%u([a-f0-9]{4,4})/ei', 'utf8_chr(0x$1)', $_REQUEST['content']);
function utf8_chr($num)
{
if($num<128)return chr($num);
if($num<1024)return chr(($num>>6)+192).chr(($num&63)+128);
if($num<32768)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);
if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);
return '';
}
ob_start();
passthru("echo " . escapeshellarg($_REQUEST['content']) . " | tidy -q -i -u -wrap 9999 -utf8 -bare -asxhtml 2>/dev/null", $result);
$content = ob_get_contents();
ob_end_clean();
if(strlen($content) < 4)
{
// Tidy on the local machine failed, try a post
$res_1
= PostIt(
array
(
'_function' => 'tidy',
'_html' => $_REQUEST['content'],
'char-encoding' => 'utf8',
'_output' => 'warn',
'indent' => 'auto',
'wrap' => 9999,
'break-before-br' => 'y',
'bare' => 'n',
'word-2000' => 'n',
'drop-empty-paras' => 'y',
'drop-font-tags' => 'n',
),
'http://infohound.net/tidy/tidy.pl');
if(preg_match('/<a href="([^"]+)" title="Save the tidied HTML/', $res_1, $m))
{
$tgt = strtr($m[1], array_flip(get_html_translation_table(HTML_ENTITIES)));
$content = implode('', file('http://infohound.net/tidy/' . $tgt));
}
}
if(strlen($content) && ! preg_match('/<\/body>/i', $_REQUEST['content']))
{
if( preg_match('/<body[^>]*>(.*)<\/body>/is', $content, $matches) )
{
$content = $matches[1];
}
}
elseif(!strlen($content))
{
$content = $_REQUEST['content'];
}
if($content)
{
?>
{action:'setHTML',value:'<?php echo js_encode($content) ?>'};
<?php
}
else
{
?>
{action:'alert',value:'Tidy failed. Check your HTML for syntax errors.'};
<?php
}
}
else
{
?>
{action:'alert',value:"You don't have anything to tidy!"}
<?php
}
?>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/tidy.php | PHP | art | 4,748 |
/** superClean combines HTMLTidy, Word Cleaning and font stripping into a single function
* it works a bit differently in how it asks for parameters */
function SuperClean(editor, args)
{
this.editor = editor;
var superclean = this;
editor._superclean_on = false;
editor.config.registerButton('superclean', this._lc("Clean up HTML"), [_editor_url +'iconsets/Tango/ed_buttons_main.png',6,4], true, function(e, objname, obj) { superclean._superClean(null, obj); });
// See if we can find 'killword' and replace it with superclean
editor.config.addToolbarElement("superclean", "killword", 0);
}
SuperClean._pluginInfo =
{
name : "SuperClean",
version : "1.0",
developer: "James Sleeman, Niko Sams",
developer_url: "http://www.gogo.co.nz/",
c_owner : "Gogo Internet Services",
license : "htmlArea",
sponsor : "Gogo Internet Services",
sponsor_url : "http://www.gogo.co.nz/"
};
SuperClean.prototype._lc = function(string) {
return Xinha._lc(string, 'SuperClean');
};
Xinha.Config.prototype.SuperClean =
{
// set to the URL of a handler for html tidy, this handler
// (see tidy.php for an example) must that a single post variable
// "content" which contains the HTML to tidy, and return javascript like
// editor.setHTML('<strong>Tidied Html</strong>')
// it's called through XMLHTTPRequest
'tidy_handler': Xinha.getPluginDir("SuperClean") + '/tidy.php',
// set additional arguments needed for the tidy request
'tidy_args' : {},
//avaliable filters (these are built-in filters)
// You can either use
// 'filter_name' : "Label/Description String"
// or 'filter_name' : {label: "Label", checked: true/false, filterFunction: function(html) { ... return html;} }
// filterFunction in the second format above is optional.
'filters': { 'tidy': Xinha._lc('General tidy up and correction of some problems.', 'SuperClean'),
'word_clean': Xinha._lc('Clean bad HTML from Microsoft Word', 'SuperClean'),
'remove_faces': Xinha._lc('Remove custom typefaces (font "styles").', 'SuperClean'),
'remove_sizes': Xinha._lc('Remove custom font sizes.', 'SuperClean'),
'remove_colors': Xinha._lc('Remove custom text colors.', 'SuperClean'),
'remove_lang': Xinha._lc('Remove lang attributes.', 'SuperClean'),
'remove_fancy_quotes': {label:Xinha._lc('Replace directional quote marks with non-directional quote marks.', 'SuperClean'), checked:false}
//additional custom filters (defined in plugins/SuperClean/filters/word.js)
//'paragraph': 'remove paragraphs'},
//'word': 'exteded Word-Filter' },
},
//if false all filters are applied, if true a dialog asks what filters should be used
'show_dialog': false
};
SuperClean.filterFunctions = { };
SuperClean.prototype.onGenerateOnce = function()
{
if(this.editor.config.tidy_handler)
{
//for backwards compatibility
this.editor.config.SuperClean.tidy_handler = this.editor.config.tidy_handler;
this.editor.config.tidy_handler = null;
}
if(!this.editor.config.SuperClean.tidy_handler && this.editor.config.filters.tidy) {
//unset tidy-filter if no tidy_handler
this.editor.config.filters.tidy = null;
}
SuperClean.loadAssets();
this.loadFilters();
};
SuperClean.prototype.onUpdateToolbar = function()
{
if (!(SuperClean.methodsReady && SuperClean.html))
{
this.editor._toolbarObjects.superclean.state("enabled", false);
}
else this.onUpdateToolbar = null;
};
SuperClean.loadAssets = function()
{
var self = SuperClean;
if (self.loading) return;
self.loading = true;
Xinha._getback(Xinha.getPluginDir("SuperClean") + '/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; });
Xinha._getback( Xinha.getPluginDir("SuperClean") + '/dialog.html', function(getback) { self.html = getback; } );
};
SuperClean.prototype.loadFilters = function()
{
var sc = this;
//load the filter-functions
for(var filter in this.editor.config.SuperClean.filters)
{
if (/^(remove_colors|remove_sizes|remove_faces|remove_lang|word_clean|remove_fancy_quotes|tidy)$/.test(filter)) continue; //skip built-in functions
if(!SuperClean.filterFunctions[filter])
{
var filtDetail = this.editor.config.SuperClean.filters[filter];
if(typeof filtDetail.filterFunction != 'undefined')
{
SuperClean.filterFunctions[filter] = filterFunction;
}
else
{
Xinha._getback(Xinha.getPluginDir("SuperClean") + '/filters/'+filter+'.js',
function(func) {
eval('SuperClean.filterFunctions.'+filter+'='+func+';');
sc.loadFilters();
});
}
return;
}
}
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/SuperClean.js | JavaScript | art | 4,834 |
<h1 id="[h1]"><l10n>Clean up HTML</l10n></h1>
<div style="margin-left: 10px;" id="[main]">
<l10n>Please select from the following cleaning options...</l10n>
<!--filters-->
</div>
<div id="[waiting]" style="display:none;margin:3em 1em;text-align:center"><l10n>Please stand by while cleaning in process...</l10n></div>
<div id="[alert]" style="display:none;margin:3em 1em;text-align:center"></l10n></div>
<div class="buttons" id="[buttons]">
<input type="button" id="[ok]" value="_(OK)" />
<input type="button" id="[cancel]" value="_(Cancel)" />
</div> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/dialog.html | HTML | art | 572 |
SuperClean.prototype._superClean = function(opts, obj)
{
if(this.editor.config.SuperClean.show_dialog && !this._dialog)
{
this._dialog = new SuperClean.Dialog(this);
}
var superclean = this;
// Do the clean if we got options
var doOK = function()
{
superclean._dialog.dialog.getElementById("main").style.display = "none";
superclean._dialog.dialog.getElementById("waiting").style.display = "";
superclean._dialog.dialog.getElementById("buttons").style.display = "none";
var opts = superclean._dialog.dialog.getValues();
var editor = superclean.editor;
if(opts.word_clean) editor._wordClean();
var D = editor.getEditorContent();
for(var filter in editor.config.SuperClean.filters)
{
if(filter=='tidy' || filter=='word_clean') continue;
if(opts[filter])
{
D = SuperClean.filterFunctions[filter](D, editor);
}
}
D = D.replace(/(style|class)="\s*"/gi, '');
D = D.replace(/<(font|span)\s*>/gi, '');
editor.setEditorContent(D);
if(opts.tidy)
{
var callback = function(javascriptResponse)
{
eval("var response = " + javascriptResponse);
switch (response.action)
{
case 'setHTML':
editor.setEditorContent(response.value);
superclean._dialog.hide();
break;
case 'alert':
superclean._dialog.dialog.getElementById("buttons").style.display = "";
superclean._dialog.dialog.getElementById("ok").style.display = "none";
superclean._dialog.dialog.getElementById("waiting").style.display = "none";
superclean._dialog.dialog.getElementById("alert").style.display = "";
superclean._dialog.dialog.getElementById("alert").innerHTML = superclean._lc(response.value);
break;
default: // make the dialog go away if sth goes wrong, who knows...
superclean._dialog.hide();
break;
}
}
var args = editor.config.SuperClean.tidy_args;
if ( typeof args != 'object' )
{
args = {};
}
args['content'] = editor.getInnerHTML();
Xinha._postback(editor.config.SuperClean.tidy_handler, args, callback);
}
else
{
superclean._dialog.hide();
}
return true;
}
if(this.editor.config.SuperClean.show_dialog)
{
var inputs = {};
this._dialog.show(inputs, doOK);
}
else
{
var editor = this.editor;
var html = editor.getEditorContent();
for(var filter in editor.config.SuperClean.filters)
{
if(filter=='tidy') continue; //call tidy last
html = SuperClean.filterFunctions[filter](html, editor);
}
html = html.replace(/(style|class)="\s*"/gi, '');
html = html.replace(/<(font|span)\s*>/gi, '');
editor.setEditorContent(html);
if(editor.config.SuperClean.filters.tidy)
{
SuperClean.filterFunctions.tidy(html, editor);
}
}
};
SuperClean.filterFunctions.remove_colors = function(D)
{
D = D.replace(/color="?[^" >]*"?/gi, '');
// { (stops jedit's fold breaking)
D = D.replace(/([^-])color:[^;}"']+;?/gi, '$1');
return(D);
};
SuperClean.filterFunctions.remove_sizes = function(D)
{
D = D.replace(/size="?[^" >]*"?/gi, '');
// { (stops jedit's fold breaking)
D = D.replace(/font-size:[^;}"']+;?/gi, '');
return(D);
};
SuperClean.filterFunctions.remove_faces = function(D)
{
D = D.replace(/face="?[^" >]*"?/gi, '');
// { (stops jedit's fold breaking)
D = D.replace(/font-family:[^;}"']+;?/gi, '');
return(D);
};
SuperClean.filterFunctions.remove_lang = function(D)
{
D = D.replace(/lang="?[^" >]*"?/gi, '');
return(D);
};
SuperClean.filterFunctions.word_clean = function(html, editor)
{
editor.setHTML(html);
editor._wordClean();
return editor.getInnerHTML();
};
SuperClean.filterFunctions.remove_fancy_quotes = function(D)
{
D = D.replace(new RegExp(String.fromCharCode(8216),"g"),"'");
D = D.replace(new RegExp(String.fromCharCode(8217),"g"),"'");
D = D.replace(new RegExp(String.fromCharCode(8218),"g"),"'");
D = D.replace(new RegExp(String.fromCharCode(8219),"g"),"'");
D = D.replace(new RegExp(String.fromCharCode(8220),"g"),"\"");
D = D.replace(new RegExp(String.fromCharCode(8221),"g"),"\"");
D = D.replace(new RegExp(String.fromCharCode(8222),"g"),"\"");
D = D.replace(new RegExp(String.fromCharCode(8223),"g"),"\"");
return D;
};
SuperClean.filterFunctions.tidy = function(html, editor)
{
var callback = function(javascriptResponse)
{
eval("var response = " + javascriptResponse);
switch (response.action)
{
case 'setHTML':
editor.setEditorContent(response.value);
break;
case 'alert':
alert(Xinha._lc(response.value, 'SuperClean'));
break;
}
}
var args = editor.config.SuperClean.tidy_args;
if ( typeof args != 'object' )
{
args = {};
}
args['content'] = html;
Xinha._postback(editor.config.SuperClean.tidy_handler, args, callback);
};
SuperClean.Dialog = function (SuperClean)
{
var lDialog = this;
this.Dialog_nxtid = 0;
this.SuperClean = SuperClean;
this.id = { }; // This will be filled below with a replace, nifty
this.ready = false;
this.dialog = false;
// load the dTree script
this._prepareDialog();
};
SuperClean.Dialog.prototype._prepareDialog = function()
{
var lDialog = this;
var SuperClean = this.SuperClean;
var html = window.SuperClean.html;
var htmlFilters = "";
for(var filter in this.SuperClean.editor.config.SuperClean.filters)
{
htmlFilters += " <div>\n";
var filtDetail = this.SuperClean.editor.config.SuperClean.filters[filter];
if(typeof filtDetail.label == 'undefined')
{
htmlFilters += " <input type=\"checkbox\" name=\"["+filter+"]\" id=\"["+filter+"]\" checked value=\"on\" />\n";
htmlFilters += " <label for=\"["+filter+"]\">"+this.SuperClean.editor.config.SuperClean.filters[filter]+"</label>\n";
}
else
{
htmlFilters += " <input type=\"checkbox\" name=\"["+filter+"]\" id=\"["+filter+"]\" value=\"on\"" + (filtDetail.checked ? "checked" : "") + " />\n";
htmlFilters += " <label for=\"["+filter+"]\">"+filtDetail.label+"</label>\n";
}
htmlFilters += " </div>\n";
}
html = html.replace('<!--filters-->', htmlFilters);
// Now we have everything we need, so we can build the dialog.
var dialog = this.dialog = new Xinha.Dialog(SuperClean.editor, html, 'SuperClean',{width:400});
this.ready = true;
};
SuperClean.Dialog.prototype._lc = SuperClean.prototype._lc;
SuperClean.Dialog.prototype.show = function(inputs, ok, cancel)
{
if(!this.ready)
{
var lDialog = this;
window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100);
return;
}
// Connect the OK and Cancel buttons
var dialog = this.dialog;
var lDialog = this;
if(ok)
{
this.dialog.getElementById('ok').onclick = ok;
}
else
{
this.dialog.getElementById('ok').onclick = function() {lDialog.hide();};
}
if(cancel)
{
this.dialog.getElementById('cancel').onclick = cancel;
}
else
{
this.dialog.getElementById('cancel').onclick = function() { lDialog.hide()};
}
// Show the dialog
this.SuperClean.editor.disableToolbar(['fullscreen','SuperClean']);
this.dialog.show(inputs);
// Init the sizes
this.dialog.onresize();
};
SuperClean.Dialog.prototype.hide = function()
{
var ret = this.dialog.hide();
this.SuperClean.editor.enableToolbar();
this.dialog.getElementById("main").style.display = "";
this.dialog.getElementById("buttons").style.display = "";
this.dialog.getElementById("waiting").style.display = "none";
this.dialog.getElementById("alert").style.display = "none";
this.dialog.getElementById("ok").style.display = "";
return ret;
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/pluginMethods.js | JavaScript | art | 7,892 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"Clean up HTML": "HTML opschonen",
"Please select from the following cleaning options...": "Selecteer de gewenste opschoon opties...",
"General tidy up and correction of some problems.": "Algemeen opschonen en correctie",
"Clean bad HTML from Microsoft Word": "Overbodige/verkeerde HTML van Microsoft Word opschonen",
"Remove custom typefaces (font \"styles\").": "Verwijder aangepaste lettertypes (font face)",
"Remove custom font sizes.": "Verwijder aangepaste lettergroottes (font size)",
"Remove custom text colors.": "Verwijder aangepaste tekstkleuren (font color)",
"Remove lang attributes.": "Verwijder alle taal (lang) attributen.",
"Go": "Opschonen",
"Cancel": "Annuleren",
"Tidy failed. Check your HTML for syntax errors.": "Tidy mislukt. Controleer HTML op fouten.",
"You don't have anything to tidy!": "Er is niets om op te schonen!"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/nl.js | JavaScript | art | 988 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
// translated: Raimund Meyer xinha@ray-of-light.org
{
"Clean up HTML": "HTML säubern",
"Please select from the following cleaning options...": "Bitte Optionen auswählen...",
"General tidy up and correction of some problems.": "Allgemeines aufräumen und Korrektur einiger Probleme.",
"Clean bad HTML from Microsoft Word": "Schlechtes HTML aus Microsoft Word aufräumen",
"Remove custom typefaces (font \"styles\").": "Schriftarten entfernen (font face).",
"Remove custom font sizes.": "Schriftgrößen entfernen (font size).",
"Remove custom text colors.": "Schriftfarben entfernen (font color).",
"Remove lang attributes.": "Sprachattribute entfernen.",
"Go": "Go",
"Cancel": "Abbrechen",
"Tidy failed. Check your HTML for syntax errors.": "Säubern fehlgeschlagen. Überprüfen Sie Ihren Code auf Fehler.",
"You don't have anything to tidy!": "Es gibt nichts zu säubern...!",
"Please stand by while cleaning in process..." : "Bitte warten Sie, während die Säuberung läuft..."
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/de.js | JavaScript | art | 1,063 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"Clean up HTML": "Nettoyer le code HTML",
"Please select from the following cleaning options...": "Veuillez sélectionner une option de nettoyage.",
"General tidy up and correction of some problems.": "Nettoyage générique et correction des problèmes mineurs.",
"Clean bad HTML from Microsoft Word": "Nettoyer les balises HTML de Microsoft Word",
"Remove custom typefaces (font \"styles\").": "Supprimer les polices personalisées (font \"styles\").",
"Remove custom font sizes.": "Supprimer les tailles de polices personnalisées.",
"Remove custom text colors.": "Supprimer les couleurs de texte personalisées.",
"Remove lang attributes.": "Supprimer les attributs de langue.",
"Go": "Commencer",
"Cancel": "Annuler",
"Tidy failed. Check your HTML for syntax errors.": "Tidy a échoué. Vérifier la syntaxe HTML.",
"You don't have anything to tidy!": "Rien à transmettre à tidy !"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/fr.js | JavaScript | art | 966 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Clean up HTML": "HTMLのクリーンナップ",
"Please select from the following cleaning options...": "以下のクリーンナップオプションを選択してください...",
"General tidy up and correction of some problems.": "一般的な適正化といくつかの問題を修正します。",
"Clean bad HTML from Microsoft Word": "Microsoft Wordによる不正なHTMLの清潔化",
"Remove custom typefaces (font \"styles\").": "独自フォント名設定の除去 (font face)。",
"Remove custom font sizes.": "独自フォントサイズ設定の除去。",
"Remove custom text colors.": "独自文字色設定の除去。",
"Remove lang attributes.": "言語属性の除去。",
"Go": "実行",
"Cancel": "中止",
"Tidy failed. Check your HTML for syntax errors.": "適正化に失敗しました。HTMLの文法エラーを確認してください。",
"You don't have anything to tidy!": "適正化するものは何もありません!",
"Replace directional quote marks with non-directional quote marks.": "方向つき引用符を方向なし引用符に置換。",
"CANCEL": "中止"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/ja.js | JavaScript | art | 1,190 |
// I18N constants
// LANG: "da", ENCODING: UTF-8
// Author: Bjarke M. Lauridsen, http://www.detailx.dk, detailx@gmail.com
{
"Clean up HTML": "Rengør HTML",
"Please select from the following cleaning options...": "Vælg et eller flere af følgende rengøringsværktøjer...",
"General tidy up and correction of some problems.": "Generel oprydning og rettelse af diverse problemer.",
"Clean bad HTML from Microsoft Word": "Rengør uønsket HTML fra Microsoft Word",
"Remove custom typefaces (font \"styles\").": "Slet skriftsnit (font \"styles\").",
"Remove custom font sizes.": "Slet skriftstørrelser.",
"Remove custom text colors.": "Slet tekstfarver.",
"Remove lang attributes.": "Slet lang attributter.",
"Go": "Ok",
"Cancel": "Annuller",
"Tidy failed. Check your HTML for syntax errors.": "Tidy mislykkedes. Tjek din HTML for syntaksfejl.",
"Replace directional quote marks with non-directional quote marks.": "Erstat directional anførselstegn med ikke-directional anførselstegn",
"You don't have anything to tidy!": "Der er ikke noget at rengøre!"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/da.js | JavaScript | art | 1,103 |
// I18N constants
// LANG: "nb", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"Clean up HTML": "Vask HTML kode",
"Please select from the following cleaning options...": "Vennligst velg blandt de forskjellige mulighetene å vaske/ rydde i HTML koden",
"General tidy up and correction of some problems.": "Generell opprydding i HTML koden samt korrigering av typiske feil",
"Clean bad HTML from Microsoft Word": "Vask HTML kode for feil og problemer etter Microsoft Word",
"Remove custom typefaces (font \"styles\").": "Fjerne egendefinerte skrifttyper (font face)",
"Remove custom font sizes.": "Fjerne egendefinerte skriftstørrelser (font size)",
"Remove custom text colors.": "Fjerne egendefinerte skriftfarger (font color)",
"Remove lang attributes.": "Fjerne lang-attributter.",
"Go": "Utfør",
"Cancel": "Avbryt",
"Tidy failed. Check your HTML for syntax errors.": "Tidy (Programmet som retter HTML koden) feilet. Vennligst se over HTML koden for feil.",
"You don't have anything to tidy!": "Det finnes ingen HTML kode å vaske!"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/nb.js | JavaScript | art | 1,110 |
// I18N constants
//
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
//
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
//
// Last revision: 06 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
//
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Cancel": "",
"Clean bad HTML from Microsoft Word": "Limpar códigos mal formatados do Microsoft Word",
"Clean up HTML": "Limpar HTML",
"General tidy up and correction of some problems.": "Limpesa geral e correção de alguns problemas.",
"OK": "",
"Please select from the following cleaning options...": "Por favor, selecione uma das opções de limpesa...",
"Remove custom font sizes.": "Remover tamanho de fontes personalizados (font size).",
"Remove custom text colors.": "Remover cores de texto personalizados (font color).",
"Remove custom typefaces (font \"styles\").": "Remover tipos de letras personalizadas (font \"styles\").",
"Remove lang attributes.": "Remover atributos de idioma.",
"Replace directional quote marks with non-directional quote marks.": "",
// not find with lc_parse_strings.php
"Tidy failed. Check your HTML for syntax errors.": "Limpesa falhou. Verifique seu HTML por erros de sintaxe.",
"You don't have anything to tidy!": "Você não possui nada para limpar!"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/lang/pt_br.js | JavaScript | art | 1,529 |
function(html) {
// Remove HTML comments
html = html.replace(/<!--[\w\s\d@{}:.;,'"%!#_=&|?~()[*+\/\-\]]*-->/gi, "" );
html = html.replace(/<!--[^\0]*-->/gi, '');
// Remove all HTML tags
html = html.replace(/<\/?\s*HTML[^>]*>/gi, "" );
// Remove all BODY tags
html = html.replace(/<\/?\s*BODY[^>]*>/gi, "" );
// Remove all META tags
html = html.replace(/<\/?\s*META[^>]*>/gi, "" );
// Remove all SPAN tags
html = html.replace(/<\/?\s*SPAN[^>]*>/gi, "" );
// Remove all FONT tags
html = html.replace(/<\/?\s*FONT[^>]*>/gi, "");
// Remove all IFRAME tags.
html = html.replace(/<\/?\s*IFRAME[^>]*>/gi, "");
// Remove all STYLE tags & content
html = html.replace(/<\/?\s*STYLE[^>]*>(.|[\n\r\t])*<\/\s*STYLE\s*>/gi, "" );
// Remove all TITLE tags & content
html = html.replace(/<\s*TITLE[^>]*>(.|[\n\r\t])*<\/\s*TITLE\s*>/gi, "" );
// Remove javascript
html = html.replace(/<\s*SCRIPT[^>]*>[^\0]*<\/\s*SCRIPT\s*>/gi, "");
// Remove all HEAD tags & content
html = html.replace(/<\s*HEAD[^>]*>(.|[\n\r\t])*<\/\s*HEAD\s*>/gi, "" );
// Remove Class attributes
html = html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
// Remove Style attributes
html = html.replace(/<\s*(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
// Remove Lang attributes
html = html.replace(/<\s*(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
// Remove XML elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
// Remove Tags with XML namespace declarations: <o:p></o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
// Replace the
html = html.replace(/ /, " " );
// Transform <p><br /></p> to <br>
//html = html.replace(/<\s*p[^>]*>\s*<\s*br\s*\/>\s*<\/\s*p[^>]*>/gi, "<br>");
html = html.replace(/<\s*p[^>]*><\s*br\s*\/?>\s*<\/\s*p[^>]*>/gi, "<br>");
// Remove <P>
html = html.replace(/<\s*p[^>]*>/gi, "");
// Replace </p> with <br>
html = html.replace(/<\/\s*p[^>]*>/gi, "<br>");
// Remove any <br> at the end
html = html.replace(/(\s*<br>\s*)*$/, "");
html = html.trim();
return html;
} | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/filters/word.js | JavaScript | art | 2,095 |
function(html) {
html = html.replace(/<\s*p[^>]*>/gi, '');
html = html.replace(/<\/\s*p\s*>/gi, '');
html = html.trim();
return html;
} | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SuperClean/filters/paragraph.js | JavaScript | art | 144 |
function UnsavedChanges(editor) {
// Keep a copy of the editor to perform any necessary functions
var editor = editor;
// Private variable for storing the unmodified contents. This is necessary
// because whenDocReady needs a closure to reference this object.
var defaultValue;
// Variable to allow the protector to be bypassed in the case of submit.
var bypass = false;
var protector = function(event) {
if (bypass) {
return;
}
if (defaultValue != (editor.getEditorContent ? editor.getEditorContent() : editor.outwardHtml(editor.getHTML()))) {
// This needs to use _lc for multiple languages
var dirty_prompt = Xinha._lc('You have unsaved changes in the editor', 'UnsavedChanges');
event.returnValue = dirty_prompt;
return dirty_prompt;
}
}
this.onBeforeSubmit = function() {
bypass = true;
}
// Setup to be called when the plugin is loaded.
// We need a copy of the initial content for detection to work properly, so
// we will setup a callback for when the document is ready to store an
// unmodified copy of the content.
this.onGenerate = function() {
editor.whenDocReady(function () {
// Copy the original, unmodified contents to check for changes
defaultValue = defaultValue || (editor.getEditorContent ? editor.getEditorContent() : editor.outwardHtml(editor.getHTML()));
// Set up the blocker
Xinha._addEvent(window, 'beforeunload', protector);
});
}
}
// An object containing metadata for this plugin
UnsavedChanges._pluginInfo = {
name:'UnsavedChanges',
version:'3.7',
developer:'Douglas Mayle',
developer_url:'http://douglas.mayle.org',
c_owner:'Douglas Mayle',
sponsor:'The Open Planning Project',
sponsor_url:'http://topp.openplans.org',
license:'LGPL'
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/UnsavedChanges/UnsavedChanges.js | JavaScript | art | 1,941 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"You have unsaved changes in the editor": "Vous n'avez pas enregistré vos modifications"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/UnsavedChanges/lang/fr.js | JavaScript | art | 146 |
// I18N constants
// LANG: "es", ENCODING: UTF-8
{
"You have unsaved changes in the editor": "Usted no ha guardado sus modificaciones"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/UnsavedChanges/lang/es.js | JavaScript | art | 140 |
// I18N constants
// LANG: "fr_ca", ENCODING: UTF-8
{
"You have unsaved changes in the editor": "Tu n'as pas enregistré tes modifications"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/UnsavedChanges/lang/fr_ca.js | JavaScript | art | 145 |
/** Save the content of the editor to the text area when blurring (losing focus).
*
* @author Peter Siewert
* @see Ticket #1433
*/
SaveOnBlur._pluginInfo = {
name:"SaveOnBlur",
version:"1.0",
developer:"Peter Siewert",
developer_url:"http://xinha.org",
sponsor:"",
sponsor_url:"",
license:"htmlArea"
};
function SaveOnBlur(editor){
this.editor=editor;
}
SaveOnBlur.prototype.onKeyPress=function(){
this.queue_xinha_update_textarea();
return false;
};
SaveOnBlur.prototype.onMouseDown=function(){
this.queue_xinha_update_textarea();
return false;
};
SaveOnBlur.prototype.queue_xinha_update_textarea = function()
{
var blurry = this;
if(!this._attach_blur)
{
Xinha._addEvent(this.editor._iframe, 'blur', function(){ blurry.xinha_update_textarea(); }); // IE
Xinha._addEvent(this.editor._doc, 'blur', function(){ blurry.xinha_update_textarea(); }); // GECKO
this._attach_blur = 1;
}
}
SaveOnBlur.prototype.xinha_update_textarea = function()
{
this.editor._textArea.value=this.editor.outwardHtml(this.editor.getHTML());
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/SaveOnBlur/SaveOnBlur.js | JavaScript | art | 1,085 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl
{
"Cut": "Knippen",
"Copy": "Kopiëren",
"Paste": "Plakken",
"_Image Properties...": "Eigenschappen afbeelding...",
"_Modify Link...": "Hyperlin_k aanpassen...",
"Chec_k Link...": "Controleer hyperlin_k...",
"_Remove Link...": "Ve_rwijder hyperlink...",
"C_ell Properties...": "C_eleigenschappen...",
"Ro_w Properties...": "Rijeigenscha_ppen...",
"I_nsert Row Before": "Rij invoegen boven",
"In_sert Row After": "Rij invoegen onder",
"_Delete Row": "Rij _verwijderen",
"_Table Properties...": "_Tabeleigenschappen...",
"Insert _Column Before": "Kolom invoegen voor",
"Insert C_olumn After": "Kolom invoegen na",
"De_lete Column": "Kolom verwijderen",
"Justify Left": "Links uitlijnen",
"Justify Center": "Centreren",
"Justify Right": "Rechts uitlijnen",
"Justify Full": "Uitvullen",
"Make lin_k...": "Maak hyperlin_k...",
"Remove the $elem Element...": "Verwijder het $elem element...",
"Please confirm that you want to remove this element:": "Is het werkelijk de bedoeling dit element te verwijderen:",
"Remove this node from the document": "Verwijder dit punt van het document",
"How did you get here? (Please report!)": "Hoe kwam je hier? (A.U.B. doorgeven!)",
"Show the image properties dialog": "Laat het afbeeldingseigenschappen dialog zien",
"Modify URL": "Aanpassen URL",
"Current URL is": "Huidig URL is",
"Opens this link in a new window": "Opend deze hyperlink in een nieuw venster",
"Please confirm that you want to unlink this element.": "Is het werkelijk de bedoeling dit element te unlinken.",
"Link points to:": "Hyperlink verwijst naar:",
"Unlink the current element": "Unlink het huidige element",
"Show the Table Cell Properties dialog": "Laat de tabel celeigenschappen dialog zien",
"Show the Table Row Properties dialog": "Laat de tabel rijeigenschappen dialog zien",
"Insert a new row before the current one": "Voeg een nieuwe rij in boven de huidige",
"Insert a new row after the current one": "Voeg een nieuwe rij in onder de huidige",
"Delete the current row": "Verwijder de huidige rij",
"Show the Table Properties dialog": "Laat de tabel eigenschappen dialog zien",
"Insert a new column before the current one": "Voeg een nieuwe kolom in voor de huidige",
"Insert a new column after the current one": "Voeg een nieuwe kolom in na de huidige",
"Delete the current column": "Verwijder de huidige kolom",
"Create a link": "Maak een hyperlink"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/nl.js | JavaScript | art | 2,571 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
// translated: Raimund Meyer xinha@ray-of-light.org
{
"Cut": "Ausschneiden",
"Copy": "Kopieren",
"Paste": "Einfügen",
"_Image Properties...": "Eigenschaften",
"Show the image properties dialog": "Fenster für die Bildoptionen anzeigen",
"_Modify Link...": "Link ändern",
"Current URL is": "Aktuelle URL ist",
"Chec_k Link...": "Link testen",
"Opens this link in a new window": "Diesen Link in neuem Fenster öffnen",
"_Remove Link...": "Link entfernen",
"Please confirm that you want to unlink this element.": "Wollen sie diesen Link wirklich entfernen?",
"Link points to:": "Link zeigt auf:",
"Unlink the current element": "Link auf Element entfernen",
"C_ell Properties...": "Zellenoptionen",
"Show the Table Cell Properties dialog": "Zellenoptionen anzeigen",
"Ro_w Properties...": "Zeilenoptionen",
"Show the Table Row Properties dialog": "Zeilenoptionen anzeigen",
"I_nsert Row Before": "Zeile einfügen vor Position",
"Insert a new row before the current one": "Zeile einfügen vor der aktuellen Position",
"In_sert Row After": "Zeile einügen nach Position",
"Insert a new row after the current one": "Zeile einfügen nach der aktuellen Position",
"_Delete Row": "Zeile löschen",
"Delete the current row": "Zeile löschen",
"_Table Properties...": "Tabellenoptionen",
"Show the Table Properties dialog": "Tabellenoptionen anzeigen",
"Insert _Column Before": "Spalte einfügen vor Position",
"Insert a new column before the current one": "Spalte einfügen vor der aktuellen Position",
"Insert C_olumn After": "Spalte einfügen nach Position",
"Insert a new column after the current one": "Spalte einfügen nach der aktuellen Position",
"De_lete Column": "Spalte löschen",
"Delete the current column": "Spalte löschen",
"Justify Left": "Linksbündig",
"Justify Center": "Zentriert",
"Justify Right": "Rechtsbündig",
"Justify Full": "Blocksatz",
"Make lin_k...": "Link erstellen",
"Create a link": "Link erstellen",
"Remove the $elem Element...": "Element $elem entfernen...",
"Please confirm that you want to remove this element:": "Wollen sie dieses Element wirklich entfernen?",
"Remove this node from the document": "Dieses Element aus dem Dokument entfernen",
"Insert paragraph before": "Absatz einfügen vor Position",
"Insert a paragraph before the current node": "Absatz einfügen vor der aktuellen Position",
"Insert paragraph after": "Absatz einfügen hinter Position",
"Insert a paragraph after the current node": "Absatz einfügen hinter der aktuellen Position",
"How did you get here? (Please report!)": "Wie sind Sie denn hier hin gekommen? (Please report!)"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/de.js | JavaScript | art | 2,725 |
// I18N constants
// LANG: "pl", ENCODING: UTF-8
// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
{
"Cut": "Wytnij",
"Copy": "Kopiuj",
"Paste": "Wklej",
"_Image Properties...": "Właściwości obrazka",
"Show the image properties dialog": "Pokaż okienko właściwości obrazka",
"_Modify Link...": "Zmień odnośnik",
"Current URL is": "Bieżący URL odnośnika",
"Chec_k Link...": "Sprawdź odnośnik",
"Opens this link in a new window": "Otwiera ten odnośnik w nowym oknie",
"_Remove Link...": "Usuń odnośnik",
"Please confirm that you want to unlink this element.": "Na pewno chcesz usunąć odnośnik?",
"Link points to:": "Odnośnik wskazuje na:",
"Unlink the current element": "Usuń odnośnik z zaznaczonego elementu",
"C_ell Properties...": "Właściwości komórki",
"Show the Table Cell Properties dialog": "Pokaż okno właściwości komórki",
"Ro_w Properties...": "Właściwości wiersza",
"Show the Table Row Properties dialog": "Pokaż okno właściwości wiersza",
"I_nsert Row Before": "Wstaw wiersz przed",
"Insert a new row before the current one": "Wstaw nowy wiersz przed bieżącym",
"In_sert Row After": "Wstaw wiersz po",
"Insert a new row after the current one": "Wstaw nowy wiersz po bieżącym",
"_Delete Row": "Usuń wiersz",
"Delete the current row": "Usuń bieżący wiersz",
"_Table Properties...": "Właściwości tabeli",
"Show the Table Properties dialog": "Pokaż okienko właściwości tabeli",
"Insert _Column Before": "Wstaw kolumnę przed",
"Insert a new column before the current one": "Wstaw nową kolumnę przed bieżącą",
"Insert C_olumn After": "Wstaw kolumnę po",
"Insert a new column after the current one": "Wstaw nową kolumnę po bieżącej",
"De_lete Column": "Usuń kolumnę",
"Delete the current column": "Usuwa bieżącą kolumnę",
"Justify Left": "Wyrównaj do lewej",
"Justify Center": "Wycentruj",
"Justify Right": "Wyrównaj do prawej",
"Justify Full": "Wyjustuj",
"Make lin_k...": "Utwórz odnośnik",
"Create a link": "Utwórz odnośnik",
"Remove the $elem Element...": "Usuń $elem...",
"Please confirm that you want to remove this element:": "Na pewno chcesz usunąć ten element?",
"Remove this node from the document": "Usuń ten element z dokumentu",
"Insert paragraph before": "Wstaw akapit przed",
"Insert a paragraph before the current node": "Wstaw akapit przed bieżącym elementem",
"Insert paragraph after": "Wstaw akapit po",
"Insert a paragraph after the current node": "Wstaw akapit po bieżącym elemencie",
"How did you get here? (Please report!)": "Jak tu trafiłeś (Proszę, podaj okoliczności!)"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/pl.js | JavaScript | art | 2,724 |
// I18N constants
// LANG: "sv", ENCODING: UTF-8
// Swedish version for rev. 477 (Mar 2006) by Thomas Loo <tloo@saltstorm.net>
// TODO: Proper keybindings
// C,D,e, ,I, ,k,k,l,M, ,n,o,R, ,s,T, ,w : English
// H B j R m F v : Swedish
{
"Cut": "Klipp ut",
"Copy": "Kopiera",
"Paste": "Klistra in",
"_Image Properties...": "_Bildegenskaper...",
"Show the image properties dialog": "Visa bildegenskaper",
"_Modify Link...": "_Redigera Länk...",
"Current URL is": "Aktuellt URL är",
"Chec_k Link...": "Kontrollera länk...",
"Opens this link in a new window": "Öppna länk i nytt fönster",
"_Remove Link...": "_Ta bort länk...",
"Please confirm that you want to unlink this element.": "Bekräfta borttagning av länk",
"Link points to:": "Länken pekar mot:",
"Unlink the current element": "Ta bort länk kopplad till elementet",
"C_ell Properties...": "C_ellegenskaper...",
"Show the Table Cell Properties dialog": "Visa egenskaper for cellen",
"Ro_w Properties...": "Radegenskaper... (_w)",
"Show the Table Row Properties dialog": "Visa egenskaper för rad",
"I_nsert Row Before": "I_nfoga rad före",
"Insert a new row before the current one": "Infoga ny rad före aktuell",
"In_sert Row After": "Infoga rad efter aktuell rad",
"Insert a new row after the current one": "Infoga ny rad efter aktuell",
"_Delete Row": "Radera rad (_d)",
"Delete the current row": "T bort aktuell rad",
"_Table Properties...": "_Tabellegenskaper...",
"Show the Table Properties dialog": "Visa tabellegenskaper",
"Insert _Column Before": "Infoga kolumn efter (_c)",
"Insert a new column before the current one": "Infoga kolumn före aktuell",
"Insert C_olumn After": "Infoga k_olumn efter",
"Insert a new column after the current one": "Infoga kolumn efter aktuell",
"De_lete Column": "_Radera kolumn",
"Delete the current column": "Radera aktuell kolumn",
"Justify Left": "_Vänsterjustera",
"Justify Center": "_Centerjustera",
"Justify Right": "_Högerjustera",
"Justify Full": "Block_justera",
"Make lin_k...": "Skapa län_k...",
"Create a link": "SKapa ny länk",
"Remove the $elem Element...": "Radera elementet $elem...",
"Please confirm that you want to remove this element:": "Bekräfta borttagning av element:",
"Remove this node from the document": "Radera nod från dokumentet",
"Insert paragraph before": "Infoga paragraf före",
"Insert a paragraph before the current node": "Infoga paragraf före aktuell nod",
"Insert paragraph after": "Infoga paragraf efter",
"Insert a paragraph after the current node": "Infoga paragraf efter aktuell nod",
"How did you get here? (Please report!)": "Hur hamnade du här? (Beskriv förloppet)"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/sv.js | JavaScript | art | 2,747 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"Cut": "Couper",
"Copy": "Copier",
"Paste": "Coller",
"_Image Properties...": "_Propriétés de l'image...",
"_Modify Link...": "_Modifier le lien...",
"Chec_k Link...": "_Vérifier le lien...",
"_Remove Link...": "_Supprimer le lien...",
"C_ell Properties...": "P_ropriétés de la cellule...",
"Ro_w Properties...": "Pr_opriétés de la rangée...",
"I_nsert Row Before": "Insérer une rangée a_vant",
"In_sert Row After": "Insér_er une rangée après",
"_Delete Row": "Suppr_imer une rangée",
"_Table Properties...": "Proprié_tés de la table...",
"Insert _Column Before": "I_nsérer une colonne avant",
"Insert C_olumn After": "Insérer une colonne après",
"De_lete Column": "_Supprimer la colonne",
"Justify Left": "Aligner à gauche",
"Justify Center": "Aligner au centre",
"Justify Right": "Aligner à droite",
"Justify Full": "Justifier",
"Make lin_k...": "Convertir en lien...",
"Remove the $elem Element...": "Supprimer Élément $elem...",
"Insert paragraph before": "Insérer un paragraphe avant",
"Insert paragraph after": "Insérer un paragraphe après",
"Please confirm that you want to remove this element:": "Confirmer la suppression de cet élément:",
"Remove this node from the document": "Supprimer ce noeud du document",
"How did you get here? (Please report!)": "Comment êtes-vous arrivé ici ? (Reportez le bug SVP !)",
"Show the image properties dialog": "Afficher le dialogue des propriétés d'image",
"Modify URL": "Modifier l'URL",
"Current URL is": "L'URL courante est",
"Opens this link in a new window": "Ouvrir ce lien dans une nouvelle fenêtre",
"Please confirm that you want to unlink this element.": "Voulez-vous vraiment enlever le lien présent sur cet élément.",
"Link points to:": "Le lien pointe sur:",
"Unlink the current element": "Enlever le lien sur cet élément",
"Show the Table Cell Properties dialog": "Afficher la boite de propriété des cellules",
"Show the Table Row Properties dialog": "Afficher la boite de propriété des rangées",
"Insert a new row before the current one": "Insérer une nouvelle rangée avant celle-ci",
"Insert a new row after the current one": "Insérer une nouvelle rangée après celle-ci",
"Delete the current row": "Supprimer la rangée courante",
"Show the Table Properties dialog": "Afficher la boite de propriété de tableau",
"Insert a new column before the current one": "Insérer une nouvelle rangée avant celle-ci",
"Insert a new column after the current one": "Insérer une nouvelle colonne après celle-ci",
"Delete the current column": "Supprimer cette colonne",
"Create a link": "Créer un lien",
"Insert a paragraph before the current node": "Insérer un paragraphe avant le noeud courant",
"Insert a paragraph after the current node": "Insérer un paragraphe après le noeud courant"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/fr.js | JavaScript | art | 2,936 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Cut": "切り取り",
"Copy": "コピー",
"Paste": "貼り付け",
"_Image Properties...": "画像のプロパティ(_I)...",
"Show the image properties dialog": "この画像のプロパティダイアログを表示します",
"_Modify Link...": "リンクの修正(_M)...",
"Current URL is": "現在のURL",
"Chec_k Link...": "リンクを確認(_K)...",
"Opens this link in a new window": "このリンクを新しいウィンドウで開きます",
"_Remove Link...": "リンクの削除(_R)",
"Please confirm that you want to unlink this element.": "この要素のリンクを削除します。よろしいですか。",
"Link points to:": "リンク先:",
"Unlink the current element": "この要素のリンクを解除",
"C_ell Properties...": "セルのプロパティ(_E)...",
"Ro_w Properties...": "行のプロパティ(_W)...",
"Show the Table Row Properties dialog": "テーブル行のプロパティダイアログを表示します",
"I_nsert Row Before": "上に行を挿入(_N)",
"Insert a new row before the current one": "選択中の行の上に一行挿入します",
"In_sert Row After": "下に行を挿入(_S)",
"Insert a new row after the current one": "選択中の行の下に一行挿入します",
"_Delete Row": "行の削除(_D)",
"Delete the current row": "選択中の行を削除します",
"_Table Properties...": "テーブルのプロパティ(_T)...",
"Show the Table Properties dialog": "テーブルのプロパティダイアログを表示します",
"Insert _Column Before": "左に列を挿入(_C)",
"Insert a new column before the current one": "選択中の列の左に一列挿入します",
"Insert C_olumn After": "右に列を挿入(_O)",
"Insert a new column after the current one": "選択中の列の右に一列挿入します",
"De_lete Column": "列の削除(_L)",
"Delete the current column": "選択中の列を削除します",
"Justify Left": "左寄せ",
"Justify Center": "中央寄せ",
"Justify Right": "右寄せ",
"Justify Full": "均等割付",
"Make lin_k...": "リンクの作成(_K)...",
"Create a link": "新たなリンクを作成します",
"Remove the $elem Element...": "$elem 要素を削除 ...",
"Please confirm that you want to remove this element:": "この要素を削除します。よろしいですか。:",
"Remove this node from the document": "ドキュメントからこのノードを削除します",
"Insert paragraph before": "前に段落を挿入",
"Insert a paragraph before the current node": "選択中のノードの手前に段落を挿入します",
"Insert paragraph after": "後に段落を挿入",
"Insert a paragraph after the current node": "選択中のノードの後に段落を挿入します",
"How did you get here? (Please report!)": "どうやってここに来ましたか?(どうか報告を!)",
"Show the Table Cell Properties dialog": "テーブルセルのプロパティダイアログを表示します",
"Insert Cell Before": "前にセルを挿入",
"Insert Cell After": "後にセルを挿入",
"Delete Cell": "セルの削除",
"Merge Cells": "セルの結合"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/ja.js | JavaScript | art | 3,243 |
// I18N constants
// LANG: "no", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
// Used key commands
// C,D,e, ,I, ,k,k,l,M, ,n,o,R, ,s,T, ,w : English
// H B j R m F v : Norwegian
{
"Cut": "Klipp ut",
"Copy": "Kopier",
"Paste": "Lim inn",
"_Image Properties...": "_Bildeegenskaper...",
"Show the image properties dialog": "Vis bildeegenskaper",
"_Modify Link...": "_Rediger Link...",
"Current URL is": "Gjeldende URL er",
"Chec_k Link...": "Sje_kk Link...",
"Opens this link in a new window": "Åpner denne link i nytt vindu",
"_Remove Link...": "_Fjerne Link...",
"Please confirm that you want to unlink this element.": "Vennligst bekreft at du ønsker å fjerne link på elementet",
"Link points to:": "Link peker til:",
"Unlink the current element": "Fjerne link på gjeldende element",
"C_ell Properties...": "C_elleegenskaper...",
"Show the Table Cell Properties dialog": "Vis egenskaper for celle",
"Ro_w Properties...": "Rad Egenskaper... (_w)",
"Show the Table Row Properties dialog": "Vis egenskaper for rad",
"I_nsert Row Before": "Sett I_nn rad før",
"Insert a new row before the current one": "Sett inn ny rad før gjeldende",
"In_sert Row After": "_Sett inn rad etter",
"Insert a new row after the current one": "Sett inn ny rad etter gjeldende",
"_Delete Row": "Slett rad (_d)",
"Delete the current row": "Slett gjeldende rad",
"_Table Properties...": "_Tabellegenskaper...",
"Show the Table Properties dialog": "Vis egenskaper for tabellen",
"Insert _Column Before": "Sett inn kolonne etter (_c)",
"Insert a new column before the current one": "Sett inn kolonne før gjeldende",
"Insert C_olumn After": "Sett inn k_olonne etter",
"Insert a new column after the current one": "Sett inn kolonne etter gjeldende",
"De_lete Column": "S_lett kolonne",
"Delete the current column": "Slett gjeldende kolonne",
"Justify Left": "_Venstrejuster",
"Justify Center": "_Midtjuster",
"Justify Right": "_Høyrejuster",
"Justify Full": "Blokk_juster",
"Make lin_k...": "Lag len_ke...",
"Create a link": "Lag ny link",
"Remove the $elem Element...": "Fjerne $elem elementet...",
"Please confirm that you want to remove this element:": "Vennligst bekreft at du ønsker å fjerne elementet:",
"Remove this node from the document": "Fjerne denne node fra dokumentet",
"Insert paragraph before": "Sett inn paragraf før",
"Insert a paragraph before the current node": "Sett inn paragraf før gjeldende node",
"Insert paragraph after": "Sett inn paragraf etter",
"Insert a paragraph after the current node": "Sett inn paragraf etter gjeldende node",
"How did you get here? (Please report!)": "Hva skjedde? (Vennligst beskriv)"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/nb.js | JavaScript | art | 2,786 |
// I18N constants
// LANG: "es", ENCODING: UTF-8
// translated: Derick Leony <dleony@gmail.com>
{
"Cut": "Cortar",
"Copy": "Copiar",
"Paste": "Pegar",
"_Image Properties...": "_Propiedades de imagen...",
"_Modify Link...": "_Modificar hipervínculo...",
"Chec_k Link...": "_Verificar hipervínculo...",
"_Remove Link...": "_Suprimir hipervínculo...",
"C_ell Properties...": "P_ropiedades de celda...",
"Ro_w Properties...": "Pr_opiedades de la fila...",
"I_nsert Row Before": "_Insertar fila delante",
"In_sert Row After": "I_nsertar fila detrás",
"_Delete Row": "S_uprimir fila",
"_Table Properties...": "Propi_edades de la tabla...",
"Insert _Column Before": "Insert_ar columna delante",
"Insert C_olumn After": "Insertar _columna detrás",
"De_lete Column": "_Suprimir columna",
"Justify Left": "Alinear a la izquierda",
"Justify Center": "Centrar",
"Justify Right": "Alinear a la derecha",
"Justify Full": "Justificar",
"Make lin_k...": "Convertir en _hipervínculo...",
"Remove the $elem Element...": "Suprimir el elemento $elem...",
"Insert paragraph before": "Insertar párrafo delante",
"Insert paragraph after": "Insertar párrafo detrás",
"Please confirm that you want to remove this element:": "Por favor, confirme que desea suprimir este elemento:",
"Remove this node from the document": "Suprimir este nodo del documento",
"How did you get here? (Please report!)": "¿Cómo ha llegado aquí? (¡Por favor reporte el error!)",
"Show the image properties dialog": "Mostrar el diálogo de propiedades de imagen",
"Modify URL": "Modificar URL",
"Current URL is": "La URL actual es",
"Opens this link in a new window": "Abre este hipervínculo en una ventana nueva",
"Please confirm that you want to unlink this element.": "Por favor, confirme que desea suprimir el hipervínculo de este elemento.",
"Link points to:": "El hipervínculo apunta a:",
"Unlink the current element": "Suprimir el hipervínculo del elemento actual",
"Show the Table Cell Properties dialog": "Mostrar el diálogo Propiedades de la Celda",
"Show the Table Row Properties dialog": "Mostrar el diálogo Propiedades de la Fila",
"Insert a new row before the current one": "Insertar una fila nueva antes de la actual",
"Insert a new row after the current one": "Insertar una fila nueva después de la actual",
"Delete the current row": "Suprimir la fila actual",
"Show the Table Properties dialog": "Mostrar el diálogo Propiedades de la Tabla",
"Insert a new column before the current one": "Insertar una columna nueva antes de la actual",
"Insert a new column after the current one": "Insertar una columna nueva después de la actual",
"Delete the current column": "Suprimir la columna actual",
"Create a link": "Crear un hipervínculo",
"Insert a paragraph before the current node": "Insertar un párrafo antes del nodo actual",
"Insert a paragraph after the current node": "Insertar un párrafo después del nodo actual"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/es.js | JavaScript | art | 3,003 |
// I18N constants
// LANG: "he", ENCODING: UTF-8
// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>
{
"Cut": "גזור",
"Copy": "העתק",
"Paste": "הדבק",
"_Image Properties...": "_מאפייני תמונה...",
"_Modify Link...": "_שנה קישור...",
"Chec_k Link...": "בדו_ק קישור...",
"_Remove Link...": "_הסר קישור...",
"C_ell Properties...": "מאפייני ת_א...",
"Ro_w Properties...": "מאפייני _טור...",
"I_nsert Row Before": "ה_כנס שורה לפני",
"In_sert Row After": "הכנ_ס שורה אחרי",
"_Delete Row": "_מחק שורה",
"_Table Properties...": "מאפייני ט_בלה...",
"Insert _Column Before": "הכנס _טור לפני",
"Insert C_olumn After": "הכנס ט_ור אחרי",
"De_lete Column": "מח_ק טור",
"Justify Left": "ישור לשמאל",
"Justify Center": "ישור למרכז",
"Justify Right": "ישור לימין",
"Justify Full": "ישור לשורה מלאה",
"Make lin_k...": "צור קי_שור...",
"Remove the $elem Element...": "הסר את אלמנט ה- $elem...",
"Please confirm that you want to remove this element:": "אנא אשר שברצונך להסיר את האלמנט הזה:",
"Remove this node from the document": "הסרה של node זה מהמסמך",
"How did you get here? (Please report!)": "איך הגעת הנה? (אנא דווח!)",
"Show the image properties dialog": "מציג את חלון הדו-שיח של מאפייני תמונה",
"Modify URL": "שינוי URL",
"Current URL is": "URL נוכחי הוא",
"Opens this link in a new window": "פתיחת קישור זה בחלון חדש",
"Please confirm that you want to unlink this element.": "אנא אשר שאתה רוצה לנתק את אלמנט זה.",
"Link points to:": "הקישור מצביע אל:",
"Unlink the current element": "ניתוק את האלמנט הנוכחי",
"Show the Table Cell Properties dialog": "מציג את חלון הדו-שיח של מאפייני תא בטבלה",
"Show the Table Row Properties dialog": "מציג את חלון הדו-שיח של מאפייני שורה בטבלה",
"Insert a new row before the current one": "הוספת שורה חדשה לפני הנוכחית",
"Insert a new row after the current one": "הוספת שורה חדשה אחרי הנוכחית",
"Delete the current row": "מחיקת את השורה הנוכחית",
"Show the Table Properties dialog": "מציג את חלון הדו-שיח של מאפייני טבלה",
"Insert a new column before the current one": "הוספת טור חדש לפני הנוכחי",
"Insert a new column after the current one": "הוספת טור חדש אחרי הנוכחי",
"Delete the current column": "מחיקת את הטור הנוכחי",
"Create a link": "יצירת קישור"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/he.js | JavaScript | art | 2,900 |
// I18N constants
// LANG: "pt_br", ENCODING: UTF-8
// Brazilian Portuguese Translation
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// Site: www.mpg.com.br
// Please don´t remove this information - Por favor, não remova esta informação
// If you modify this source, please insert a comment with your name and e-mail
// Se modificar esta fonte, insira um comentário com seu nome e e-mail
// Last revision: September 2007
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Cut": "Recortar",
"Copy": "Copiar",
"Paste": "Colar",
"_Image Properties...": "Propriedades da imagem...",
"Show the image properties dialog": "Mostrar a caixa de diálogo das Propriedades da imagem",
"_Modify Link...": "Modificar link",
"Current URL is": "A URL corrente é",
"Chec_k Link...": "Verificar Link...",
"Opens this link in a new window": "Abrir este link em uma nova janela",
"_Remove Link...": "Remover Link",
"Please confirm that you want to unlink this element.": "Por favor, confirme que deseja retirar o link do elemento.",
"Link points to:": "Link para:",
"Unlink the current element": "Remover link do elemento atual",
"C_ell Properties...": "Propriedades da célula",
"Show the Table Cell Properties dialog": "Mostrar caixa de diálogo de Propriedades da Célula",
"Ro_w Properties...": "Propriedades da Linha",
"Show the Table Row Properties dialog": "Mostrar caixa de diálogo de Propriedades da Linha",
"I_nsert Row Before": "Inserir linha antes deste ponto",
"Insert a new row before the current one": "Inserir uma nova linha antes desta",
"In_sert Row After": "Inserir linha depois deste ponto",
"Insert a new row after the current one": "Inserir uma linha após esta",
"_Delete Row": "Apagar linha",
"Delete the current row": "Apagar a linha atual",
"_Table Properties...": "Propriedades da Tabela",
"Show the Table Properties dialog": "Mostrar caixa de diálogo de Propriedades da Tabela",
"Insert _Column Before": "Inserir coluna antes deste ponto",
"Insert a new column before the current one": "Inserir uma nova coluna antes desta",
"Insert C_olumn After": "Inserir coluna após este ponto",
"Insert a new column after the current one": "Inserir uma nova coluna após esta",
"De_lete Column": "Apagar Coluna",
"Delete the current column": "Apagar a coluna atual",
"Justify Left": "Justificar à esquerda",
"Justify Center": "Justificar centralizado",
"Justify Right": "Justificar à direita",
"Justify Full": "Justificação completa",
"Make lin_k...": "Criar link...",
"Create a link": "Criar um novo link",
"Remove the $elem Element...": "Remover o elemento $elem...",
"Please confirm that you want to remove this element:": "Por favor, confirme que deseja remover este elemento:",
"Remove this node from the document": "Remover este nó do documento",
"Insert paragraph before": "Inserir um parágrafo antes",
"Insert a paragraph before the current node": "Inserir um parágrafo antes do nó atual",
"Insert paragraph after": "Inserir um parágrafo após",
"Insert a paragraph after the current node": "Inserir um parágrafo após o nó atual",
"How did you get here? (Please report!)": "Como você começou aqui? (Por favor, informe!)",
"Show the Table Cell Properties dialog": "Mostrar Propriedades da Tabelas",
"Insert Cell Before": "Inserir Célula Antes",
"Insert Cell After": "Inserir Célula Depois",
"Delete Cell": "Apagar Célula",
"Merge Cells": "Mesclar Células"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/lang/pt_br.js | JavaScript | art | 3,563 |
// Context Menu Plugin for HTMLArea-3.0
// Sponsored by www.americanbible.org
// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
//
// (c) dynarch.com 2003.
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// $Id: ContextMenu.js 1196 2009-11-08 04:34:16Z gogo $
Xinha.loadStyle("menu.css", "ContextMenu");
function ContextMenu(editor) {
this.editor = editor;
}
ContextMenu._pluginInfo = {
name : "ContextMenu",
version : "1.0",
developer : "Mihai Bazon",
developer_url : "http://dynarch.com/mishoo/",
c_owner : "dynarch.com",
sponsor : "American Bible Society",
sponsor_url : "http://www.americanbible.org",
license : "htmlArea"
};
Xinha.Config.prototype.ContextMenu = {
disableMozillaSpellCheck : false,
customHooks : { } // 'a': [ ['Label', function() { alert('Action'); }, 'Tooltip', '/icon.jpg' ] ]
}
ContextMenu.prototype.onGenerate = function() {
var self = this;
var doc = this.editordoc = this.editor._iframe.contentWindow.document;
Xinha._addEvents(doc, ["contextmenu"],
function (event) {
return self.popupMenu(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event);
});
this.currentMenu = null;
if (this.editor.config.ContextMenu.disableMozillaSpellCheck) {
this.editordoc.body.spellcheck = false; // Firefox spellchecking is quite confusing for the user when they don't get the browser context menu
}
};
ContextMenu.prototype.getContextMenu = function(target) {
var self = this;
var editor = this.editor;
var config = editor.config;
var menu = [];
var tbo = this.editor.plugins.TableOperations;
if (tbo) tbo = tbo.instance;
var selection = editor.hasSelectedText();
if (!Xinha.is_gecko) {
if (selection) {
menu.push([ Xinha._lc("Cut", "ContextMenu"), function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
[ Xinha._lc("Copy", "ContextMenu"), function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
menu.push([ Xinha._lc("Paste", "ContextMenu"), function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
}
}
var currentTarget = target;
var elmenus = [];
var link = null;
var table = null;
var tr = null;
var td = null;
var img = null;
function tableOperation(opcode) {
tbo.buttonPress(editor, opcode);
}
function insertPara(after) {
var el = currentTarget;
var par = el.parentNode;
var p = editor._doc.createElement("p");
p.appendChild(editor._doc.createElement("br"));
par.insertBefore(p, after ? el.nextSibling : el);
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (!Xinha.is_ie) {
sel.removeAllRanges();
range.selectNodeContents(p);
range.collapse(true);
sel.addRange(range);
} else {
range.moveToElementText(p);
range.collapse(true);
range.select();
}
}
for (; target; target = target.parentNode) {
var tag = target.tagName;
if (!tag)
continue;
tag = tag.toLowerCase();
switch (tag) {
case "img":
img = target;
elmenus.push(null,
[ Xinha._lc("_Image Properties...", "ContextMenu"),
function() {
editor._insertImage(img);
},
Xinha._lc("Show the image properties dialog", "ContextMenu"),
config.btnList["insertimage"][1] ]
);
break;
case "a":
link = target;
elmenus.push(null,
[ Xinha._lc("_Modify Link...", "ContextMenu"),
function() { editor.config.btnList['createlink'][3](editor); },
Xinha._lc("Current URL is", "ContextMenu") + ': ' + link.href,
config.btnList["createlink"][1] ],
[ Xinha._lc("Chec_k Link...", "ContextMenu"),
function() { window.open(link.href); },
Xinha._lc("Opens this link in a new window", "ContextMenu") ],
[ Xinha._lc("_Remove Link...", "ContextMenu"),
function() {
if (confirm(Xinha._lc("Please confirm that you want to unlink this element.", "ContextMenu") + "\n" +
Xinha._lc("Link points to:", "ContextMenu") + " " + link.href)) {
while (link.firstChild)
link.parentNode.insertBefore(link.firstChild, link);
link.parentNode.removeChild(link);
}
},
Xinha._lc("Unlink the current element", "ContextMenu") ]
);
break;
case "td":
td = target;
if (!tbo) break;
elmenus.push(null,
[ Xinha._lc("C_ell Properties...", "ContextMenu"),
function() { tableOperation("TO-cell-prop"); },
Xinha._lc("Show the Table Cell Properties dialog", "ContextMenu"),
config.btnList["TO-cell-prop"][1] ],
[ Xinha._lc("Insert Cell After", "ContextMenu"),
function() { tableOperation("TO-cell-insert-after"); },
Xinha._lc("Insert Cell After", "ContextMenu"),
config.btnList["TO-cell-insert-after"][1] ],
[ Xinha._lc("Insert Cell Before", "ContextMenu"),
function() { tableOperation("TO-cell-insert-before"); },
Xinha._lc("Insert Cell After", "ContextMenu"),
config.btnList["TO-cell-insert-before"][1] ],
[ Xinha._lc("Delete Cell", "ContextMenu"),
function() { tableOperation("TO-cell-delete"); },
Xinha._lc("Delete Cell", "ContextMenu"),
config.btnList["TO-cell-delete"][1] ],
[ Xinha._lc("Merge Cells", "ContextMenu"),
function() { tableOperation("TO-cell-merge"); },
Xinha._lc("Merge Cells", "ContextMenu"),
config.btnList["TO-cell-merge"][1] ]
);
break;
case "tr":
tr = target;
if (!tbo) break;
elmenus.push(null,
[ Xinha._lc("Ro_w Properties...", "ContextMenu"),
function() { tableOperation("TO-row-prop"); },
Xinha._lc("Show the Table Row Properties dialog", "ContextMenu"),
config.btnList["TO-row-prop"][1] ],
[ Xinha._lc("I_nsert Row Before", "ContextMenu"),
function() { tableOperation("TO-row-insert-above"); },
Xinha._lc("Insert a new row before the current one", "ContextMenu"),
config.btnList["TO-row-insert-above"][1] ],
[ Xinha._lc("In_sert Row After", "ContextMenu"),
function() { tableOperation("TO-row-insert-under"); },
Xinha._lc("Insert a new row after the current one", "ContextMenu"),
config.btnList["TO-row-insert-under"][1] ],
[ Xinha._lc("_Delete Row", "ContextMenu"),
function() { tableOperation("TO-row-delete"); },
Xinha._lc("Delete the current row", "ContextMenu"),
config.btnList["TO-row-delete"][1] ]
);
break;
case "table":
table = target;
if (!tbo) break;
elmenus.push(null,
[ Xinha._lc("_Table Properties...", "ContextMenu"),
function() { tableOperation("TO-table-prop"); },
Xinha._lc("Show the Table Properties dialog", "ContextMenu"),
config.btnList["TO-table-prop"][1] ],
[ Xinha._lc("Insert _Column Before", "ContextMenu"),
function() { tableOperation("TO-col-insert-before"); },
Xinha._lc("Insert a new column before the current one", "ContextMenu"),
config.btnList["TO-col-insert-before"][1] ],
[ Xinha._lc("Insert C_olumn After", "ContextMenu"),
function() { tableOperation("TO-col-insert-after"); },
Xinha._lc("Insert a new column after the current one", "ContextMenu"),
config.btnList["TO-col-insert-after"][1] ],
[ Xinha._lc("De_lete Column", "ContextMenu"),
function() { tableOperation("TO-col-delete"); },
Xinha._lc("Delete the current column", "ContextMenu"),
config.btnList["TO-col-delete"][1] ]
);
break;
case "body":
elmenus.push(null,
[ Xinha._lc("Justify Left", "ContextMenu"),
function() { editor.execCommand("justifyleft"); }, null,
config.btnList["justifyleft"][1] ],
[ Xinha._lc("Justify Center", "ContextMenu"),
function() { editor.execCommand("justifycenter"); }, null,
config.btnList["justifycenter"][1] ],
[ Xinha._lc("Justify Right", "ContextMenu"),
function() { editor.execCommand("justifyright"); }, null,
config.btnList["justifyright"][1] ],
[ Xinha._lc("Justify Full", "ContextMenu"),
function() { editor.execCommand("justifyfull"); }, null,
config.btnList["justifyfull"][1] ]
);
break;
}
}
if (selection && !link)
menu.push(null, [ Xinha._lc("Make lin_k...", "ContextMenu"),
function() { editor.config.btnList['createlink'][3](editor); },
Xinha._lc("Create a link", "ContextMenu"),
config.btnList["createlink"][1] ]);
if(editor.config.ContextMenu.customHooks[currentTarget.tagName.toLowerCase()])
{
var items = editor.config.ContextMenu.customHooks[currentTarget.tagName.toLowerCase()];
for (var i = 0; i < items.length; ++i)
{
menu.push(items[i]);
}
}
for (var i = 0; i < elmenus.length; ++i)
menu.push(elmenus[i]);
if (!/html|body/i.test(currentTarget.tagName))
menu.push(null,
[ Xinha._lc({string: "Remove the $elem Element...", replace: {elem: "<" + currentTarget.tagName + ">"}}, "ContextMenu"),
function() {
if (confirm(Xinha._lc("Please confirm that you want to remove this element:", "ContextMenu") + " " +
currentTarget.tagName)) {
var el = currentTarget;
var p = el.parentNode;
p.removeChild(el);
if (Xinha.is_gecko) {
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
p.appendChild(editor._doc.createElement("br"));
editor.forceRedraw();
editor.focusEditor();
editor.updateToolbar();
if (table) {
var save_collapse = table.style.borderCollapse;
table.style.borderCollapse = "collapse";
table.style.borderCollapse = "separate";
table.style.borderCollapse = save_collapse;
}
}
}
},
Xinha._lc("Remove this node from the document", "ContextMenu") ],
[ Xinha._lc("Insert paragraph before", "ContextMenu"),
function() { insertPara(false); },
Xinha._lc("Insert a paragraph before the current node", "ContextMenu") ],
[ Xinha._lc("Insert paragraph after", "ContextMenu"),
function() { insertPara(true); },
Xinha._lc("Insert a paragraph after the current node", "ContextMenu") ]
);
if (!menu[0]) menu.shift(); //If the menu begins with a separator, remove it for cosmetical reasons
return menu;
};
ContextMenu.prototype.popupMenu = function(ev) {
var self = this;
if (this.currentMenu)
{
this.closeMenu();
}
function getPos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = getPos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
}
function documentClick(ev) {
ev || (ev = window.event);
if (!self.currentMenu) {
alert(Xinha._lc("How did you get here? (Please report!)", "ContextMenu"));
return false;
}
var el = Xinha.is_ie ? ev.srcElement : ev.target;
for (; el != null && el != self.currentMenu; el = el.parentNode);
if (el == null)
self.closeMenu();
//Xinha._stopEvent(ev);
//return false;
}
var keys = [];
function keyPress(ev) {
ev || (ev = window.event);
Xinha._stopEvent(ev);
if (ev.keyCode == 27) {
self.closeMenu();
return false;
}
var key = String.fromCharCode(Xinha.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
for (var i = keys.length; --i >= 0;) {
var k = keys[i];
if (k[0].toLowerCase() == key)
k[1].__msh.activate();
}
}
self.closeMenu = function() {
self.currentMenu.parentNode.removeChild(self.currentMenu);
self.currentMenu = null;
Xinha._removeEvent(document, "mousedown", documentClick);
Xinha._removeEvent(self.editordoc, "mousedown", documentClick);
if (keys.length > 0)
Xinha._removeEvent(self.editordoc, "keypress", keyPress);
if (Xinha.is_ie)
self.iePopup.hide();
}
var target = Xinha.is_ie ? ev.srcElement : ev.target;
var ifpos = getPos(self.editor._htmlArea);//_iframe);
var x = ev.clientX + ifpos.x;
var y = ev.clientY + ifpos.y;
var div;
var doc;
if (!Xinha.is_ie) {
doc = document;
} else {
// IE stinks
var popup = this.iePopup = window.createPopup();
doc = popup.document;
doc.open();
doc.write("<html><head><style type='text/css'>@import url(" + Xinha.getPluginDir('ContextMenu') + "/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
doc.close();
}
div = doc.createElement("div");
if (Xinha.is_ie)
div.unselectable = "on";
div.oncontextmenu = function() { return false; };
div.className = "htmlarea-context-menu";
if (!Xinha.is_ie) {
div.style.visibility = "hidden";
div.style.left = div.style.top = "-200px";
}
doc.body.appendChild(div);
var table = doc.createElement("table");
div.appendChild(table);
table.cellSpacing = 0;
table.cellPadding = 0;
var parent = doc.createElement("tbody");
table.appendChild(parent);
var options = this.getContextMenu(target);
for (var i = 0; i < options.length; ++i) {
var option = options[i];
var item = doc.createElement("tr");
parent.appendChild(item);
if (Xinha.is_ie)
item.unselectable = "on";
else item.onmousedown = function(ev) {
Xinha._stopEvent(ev);
return false;
};
if (!option) {
item.className = "separator";
var td = doc.createElement("td");
td.className = "icon";
var IE_IS_A_FUCKING_SHIT = '>';
if (Xinha.is_ie) {
td.unselectable = "on";
IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'> ";
}
td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
var td1 = td.cloneNode(true);
td1.className = "label";
item.appendChild(td);
item.appendChild(td1);
} else {
var label = option[0];
item.className = "item";
item.__msh = {
item: item,
label: label,
action: option[1],
tooltip: option[2] || null,
icon: option[3] || null,
activate: function() {
self.closeMenu();
self.editor.focusEditor();
this.action();
}
};
label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
if (label != option[0])
keys.push([ RegExp.$1, item ]);
label = label.replace(/__/, "_");
var td1 = doc.createElement("td");
if (Xinha.is_ie)
td1.unselectable = "on";
item.appendChild(td1);
td1.className = "icon";
if (item.__msh.icon)
{
var t = Xinha.makeBtnImg(item.__msh.icon, doc);
td1.appendChild(t);
}
var td2 = doc.createElement("td");
if (Xinha.is_ie)
td2.unselectable = "on";
item.appendChild(td2);
td2.className = "label";
td2.innerHTML = label;
item.onmouseover = function() {
this.className += " hover";
self.editor._statusBarTree.innerHTML = this.__msh.tooltip || ' ';
};
item.onmouseout = function() { this.className = "item"; };
item.oncontextmenu = function(ev) {
this.__msh.activate();
if (!Xinha.is_ie)
Xinha._stopEvent(ev);
return false;
};
item.onmouseup = function(ev) {
var timeStamp = (new Date()).getTime();
if (timeStamp - self.timeStamp > 500)
this.__msh.activate();
if (!Xinha.is_ie)
Xinha._stopEvent(ev);
return false;
};
//if (typeof option[2] == "string")
//item.title = option[2];
}
}
if (!Xinha.is_ie) {
/* keep then menu from overflowing the client window boundaries */
/* provide a virtual margin to leave a swoosh of air between the
meny and the window edge. This should probably go into the menu
container css as margin 10px instead...
*/
var margin = 10;
if (y + div.offsetHeight + margin > window.innerHeight)
y = window.innerHeight - div.offsetHeight - margin;
if (x + div.offsetWidth + margin > window.innerWidth)
x = window.innerWidth - div.offsetWidth - margin;
div.style.left = x + "px";
div.style.top = y + "px";
div.style.visibility = "visible";
} else {
// To get the size we need to display the popup with some width/height
// then we can get the actual size of the div and redisplay the popup at the
// correct dimensions.
this.iePopup.show(ev.screenX, ev.screenY, 300,50);
var w = div.offsetWidth;
var h = div.offsetHeight;
this.iePopup.show(ev.screenX, ev.screenY, w, h);
}
this.currentMenu = div;
this.timeStamp = (new Date()).getTime();
Xinha._addEvent(document, "mousedown", documentClick);
Xinha._addEvent(this.editordoc, "mousedown", documentClick);
if (keys.length > 0)
Xinha._addEvent(this.editordoc, "keypress", keyPress);
Xinha._stopEvent(ev);
return false;
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/ContextMenu.js | JavaScript | art | 16,956 |
/* styles for the ContextMenu /HTMLArea */
/* The ContextMenu plugin is (c) dynarch.com 2003. */
/* Distributed under the same terms as HTMLArea itself */
div.htmlarea-context-menu {
position: absolute;
border: 1px solid #aca899;
padding: 2px;
background-color: #fff;
color: #000;
cursor: default;
z-index: 1000;
}
div.htmlarea-context-menu table {
font: 11px tahoma,verdana,sans-serif;
border-collapse: collapse;
}
div.htmlarea-context-menu tr.item td.icon img {
/* taken care of by xinha.makeBtnImg() */
/* width: 18px; */
/* height: 18px; */
}
div.htmlarea-context-menu tr.item td.icon {
padding: 0px 3px;
width: 18px;
height: 18px;
background-color: #cdf;
}
div.htmlarea-context-menu tr.item td.label {
padding: 1px 10px 1px 3px;
}
div.htmlarea-context-menu tr.separator td {
padding: 2px 0px;
}
div.htmlarea-context-menu tr.separator td div {
border-top: 1px solid #aca899;
overflow: hidden;
position: relative;
}
div.htmlarea-context-menu tr.separator td.icon {
background-color: #cdf;
}
div.htmlarea-context-menu tr.separator td.icon div {
/* margin-left: 3px; */
border-color: #fff;
}
div.htmlarea-context-menu tr.separator td.label div {
margin-right: 3px;
}
div.htmlarea-context-menu tr.item.hover {
background-color: #316ac5;
color: #fff;
}
div.htmlarea-context-menu tr.item.hover td.icon {
background-color: #619af5;
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ContextMenu/menu.css | CSS | art | 1,392 |
/*------------------------------------------*\
PreserveScripts for Xinha
____________________
Replace blocks of of PHP or JavaScript with icons in the editor, this way making it possible to edit sourcecode containing PHP,
and preventing Javascript from being accidentally deleted because it's normally invisible
\*------------------------------------------*/
function PreserveScripts(editor) {
this.editor = editor;
}
PreserveScripts._pluginInfo = {
name : "PreserveScripts",
version : "1.0",
developer : "Raimund Meyer",
developer_url : "http://x-webservice.net",
c_owner : "Raimund Meyer",
sponsor : "",
sponsor_url : "",
license : "LGPL"
}
Xinha.Config.prototype.PreserveScripts =
{
'preservePHP' : true,
'preserveJS' : true
}
PreserveScripts.prototype.inwardHtml = function(html)
{
var s = this;
var c = s.editor.config.PreserveScripts;
this.storage = {}; //empty the cache
var i = 1;
html = html.replace(/\n?<\?(php)?(\s|[^\s])*?\?>\n?/ig,
function(m)
{
if ( c.preservePHP ) // if config set to false wipe out php completely, otherwise ugly fragments may remain
{
s.storage['PreserveScripts_'+i] = m;
var r = '<img title="PHP" id="PreserveScripts_'+i+'" src="'+Xinha.getPluginDir("PreserveScripts")+'/php.png" />';
i++;
return r;
}
else
{
return '';
}
});
if ( c.preserveJS )
{
html = html.replace(/\n?<script(\s|[^\s])*?<\/script>\n?/g,
function(m)
{
s.storage['PreserveScripts_'+i] = m;
var r = '<img title="JavaScript" id="PreserveScripts_'+i+'" src="' + Xinha.getPluginDir("PreserveScripts") + '/js.png" />';
i++;
return r;
});
}
return html;
}
PreserveScripts.prototype.outwardHtml = function(html)
{
var s = this;
html = html.replace(/<img[^>]*id="(PreserveScripts_\d+)"[^>]*>/g,function(m0,m1){return s.storage[m1];});
return html;
} | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/PreserveScripts/PreserveScripts.js | JavaScript | art | 1,892 |
// Charcounter for Xinha
// (c) Udo Schmal & L.N.Schaffrath NeueMedien
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
function CharCounter(editor) {
this.editor = editor;
this._Chars = 0;
this._Words = 0;
this._HTML = 0;
this.onKeyPress = this.__onKeyPress;
}
Xinha.Config.prototype.CharCounter =
{
'showChar': true, // show the characters count,
'showWord': true, // show the words count,
'showHtml': true, // show the exact html count
'separator': ' | ', // separator used to join informations
'maxHTML' : -1 // -1 for unlimited length, other number for limiting the length of the edited HTML
};
CharCounter._pluginInfo = {
name : "CharCounter",
version : "1.31",
developer : "Udo Schmal",
developer_url : "http://www.schaffrath-neuemedien.de",
sponsor : "L.N.Schaffrath NeueMedien",
sponsor_url : "http://www.schaffrath-neuemedien.de",
c_owner : "Udo Schmal & L.N.Schaffrath NeueMedien",
license : "htmlArea"
};
CharCounter.prototype._lc = function(string) {
return Xinha._lc(string, "CharCounter");
};
CharCounter.prototype.onGenerateOnce = function() {
var self = this;
if (this.charCount==null) {
var charCount = self.editor.registerStatusWidget('CharCounter', ['wysiwyg']);
this.charCount = charCount;
}
};
CharCounter.prototype.__onKeyPress= function(ev) {
if ((ev.keyCode != 8) && (ev.keyCode !=46)) { // not backspace & delete
if (this.editor.config.CharCounter.maxHTML!=-1) {
var contents = this.editor.getHTML();
if (contents.length >= this.editor.config.CharCounter.maxHTML) {
Xinha._stopEvent(ev);
return true;
}
}
}
}
CharCounter.prototype._updateCharCount= function() {
var editor = this.editor;
var cfg = editor.config;
var contents = editor.getHTML();
var string = new Array();
if (cfg.CharCounter.showHtml) {
string[string.length] = this._lc("HTML") + ": " + contents.length;
}
this._HTML = contents.length;
if (cfg.CharCounter.showWord || cfg.CharCounter.showChar) {
contents = contents.replace(/<\/?\s*!--[^-->]*-->/gi, "" );
contents = contents.replace(/<(.+?)>/g, '');//Don't count HTML tags
contents = contents.replace(/ /gi, ' ');
contents = contents.replace(/([\n\r\t])/g, ' ');//convert newlines and tabs into space
contents = contents.replace(/( +)/g, ' ');//count spaces only once
contents = contents.replace(/&(.*);/g, ' ');//Count htmlentities as one keystroke
contents = contents.replace(/^\s*|\s*$/g, '');//trim
}
if (cfg.CharCounter.showWord) {
this._Words = 0;
for (var x=0;x<contents.length;x++)
{
if (contents.charAt(x) == " " ) {this._Words++;}
}
if (this._Words >=1) { this._Words++; }
string[string.length] = this._lc("Words") + ": " + this._Words ;
}
if (cfg.CharCounter.showChar) {
string[string.length] = this._lc("Chars") + ": " + contents.length;
this._Chars = contents.length;
}
this.charCount.innerHTML = string.join(cfg.CharCounter.separator);
};
CharCounter.prototype.onUpdateToolbar = function() {
this.charCount.innerHTML = this._lc("... in progress");
if(this._timeoutID) {
window.clearTimeout(this._timeoutID);
}
var e = this;
this._timeoutID = window.setTimeout(function() {e._updateCharCount();}, 1000);
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/CharCounter.js | JavaScript | art | 3,500 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"Chars": "Tekens",
"Words": "Woorden",
"... in progress": "... wordt verwerkt"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/nl.js | JavaScript | art | 195 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
{
"Chars": "Zeichen",
"Words": "Worte",
"... in progress": "... in Bearbeitung"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/de.js | JavaScript | art | 231 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"Chars": "Caractères",
"Words": "Mots"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/fr.js | JavaScript | art | 97 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Chars": "文字数",
"Words": "単語数",
"... in progress": "... 処理中"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/ja.js | JavaScript | art | 138 |
// I18N constants
// LANG: "nb", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"Chars": "Tegn"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/nb.js | JavaScript | art | 151 |
// I18N constants
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
// Last revision: 05 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"... in progress": "... em processo",
"Chars": "Caracteres",
"HTML": "HTML",
"Words": "Palavras"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/CharCounter/lang/pt_br.js | JavaScript | art | 596 |
/** htmlArea - James' Fork - Linker Plugin **/
Linker._pluginInfo =
{
name : "Linker",
version : "1.0",
developer: "James Sleeman",
developer_url: "http://www.gogo.co.nz/",
c_owner : "Gogo Internet Services",
license : "htmlArea",
sponsor : "Gogo Internet Services",
sponsor_url : "http://www.gogo.co.nz/"
};
Xinha.loadStyle('dTree/dtree.css', 'Linker');
Xinha.Config.prototype.Linker =
{
'treeCaption' : document.location.host,
'backend' : Xinha.getPluginDir("Linker") + '/scan.php',
'backend_data' : null,
'files' : null,
'dialog': null,
'canSetTarget': true,
'canRemoveLink': true
};
function Linker(editor, args)
{
this.editor = editor;
this.lConfig = editor.config.Linker;
var linker = this;
if(editor.config.btnList.createlink)
{
editor.config.btnList.createlink[3]
= function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); };
}
else
{
editor.config.registerButton(
'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false,
function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); }
);
}
// See if we can find 'createlink'
editor.config.addToolbarElement("createlink", "createlink", 0);
}
Linker.prototype._lc = function(string)
{
return Xinha._lc(string, 'Linker');
};
Linker.prototype.onGenerateOnce = function()
{
Linker.loadAssets();
this.loadFiles();
};
Linker.prototype.onUpdateToolbar = function()
{
if (typeof dTree == 'undefined' || !Linker.methodsReady || !Linker.html || !this.files)
{
this.editor._toolbarObjects.createlink.state("enabled", false);
}
else this.onUpdateToolbar = null;
};
Linker.Dialog_dTrees = [ ];
Linker.loadAssets = function()
{
var self = Linker;
if (self.loading) return;
self.loading = true;
Xinha._getback(Xinha.getPluginDir("Linker") + '/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; });
Xinha._loadback( Xinha.getPluginDir("Linker") + '/dTree/dtree.js', function() {Linker.dTreeReady = true; } );
Xinha._getback( Xinha.getPluginDir("Linker") + '/dialog.html', function(getback) { self.html = getback; } );
}
Linker.prototype.loadFiles = function()
{
var linker = this;
if(linker.lConfig.backend)
{
//get files from backend
Xinha._postback(linker.lConfig.backend,
linker.lConfig.backend_data,
function(txt) {
try {
linker.files = eval(txt);
} catch(Error) {
linker.files = [ {url:'',title:Error.toString()} ];
}
});
}
else if(linker.lConfig.files != null)
{
//get files from plugin-config
linker.files = linker.lConfig.files;
}
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/Linker.js | JavaScript | art | 3,008 |
<h1 id="[h1]"><l10n>Insert/Modify Link</l10n></h1>
<div style="position:relative">
<div id="[dTree]">(the dTree goes in here)</div>
<div id="[options]" >
<fieldset>
<legend><label><input type="radio" name="[type]" id="[type_url]" value="url" checked="checked" />
<l10n>URL Link</l10n>
</label></legend>
<table id="[urltable]" width="100%">
<tr>
<th><label for="[href]"><l10n>URL:</l10n> </label></th>
<td><input type="text" name="[href]" id="[href]" style="width:100%" value="http://www.example.com/" onfocus="if (this.value == 'http://www.example.com/') this.value = '';" /></td>
</tr>
<tr style="vertical-align: top;" id="[target_options]">
<th><l10n>Target:</l10n></th>
<td>
<div id="[noTarget]"><label><input type="radio" name="[target]" id="[noTargetRadio]" value="" /> <l10n>Ordinary Link</l10n></label></div>
<div id="[sameWindow]"><label><input type="radio" name="[target]" id="[sameWindowRadio]" value="_top" /> <l10n>Same Window (jump out of frames)</l10n></label></div>
<div id="[newWindow]"><label><input type="radio" name="[target]" id="[newWindowRadio]" value="_blank" /> <l10n>New Window</l10n> </label></div>
<div id="[popupWindow]">
<label><input type="radio" name="[target]" id="[popupWindowRadio]" value="popup" /> <l10n>Popup Window</l10n> </label>
<div style="padding-left:10px">
<table id="[popuptable]">
<tr>
<th style="text-align: left;"><l10n>Size:</l10n></th>
<td colspan="3"><input type="text" name="[p_width]" size="4" />x<input type="text" name="[p_height]" size="4" /> <l10n>(px)</l10n></td>
</tr>
<tr>
<th style="text-align: left;"><l10n>Name:</l10n></th>
<td colspan="3"><input type="text" name="[p_name]" style="width:100%" value="_(PopupWindow)" /></td>
</tr>
<tr>
<th style="text-align: left;"><l10n>Menu Bar:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="menubar=yes" /></td>
<th style="text-align: left;"><l10n>Toolbar:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="toolbar=yes" checked="checked" /></td>
</tr>
<tr>
<th style="text-align: left;"><l10n>Location Bar:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="location=yes" /></td>
<th style="text-align: left;"><l10n>Status Bar:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="status=yes" /></td>
</tr>
<tr>
<th style="text-align: left;"><l10n>Scrollbars:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="scrollbars=yes" checked="checked" /></td>
<th style="text-align: left;"><l10n>Resizeable:</l10n></th>
<td><input type="checkbox" name="[p_options]" value="resizeable=yes" checked="checked" /></td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</fieldset>
<fieldset id="[mailtofieldset]">
<legend><label><input type="radio" name="[type]" id="[type_mailto]" value="mailto"/>
<l10n>Email Link</l10n>
</label></legend>
<table id="[mailtable]" width="100%">
<tr>
<th><label for="[to]"><l10n>Email Address:</l10n> </label></th>
<td><input type="text" name="[to]" id="[to]" style="width:100%" value="alice@example.com" onfocus="if (this.value == 'alice@example.com') this.value = '';" /></td>
</tr>
<tr>
<th><label for="[subject]"><l10n>Subject:</l10n> </label></th>
<td><input type="text" name="[subject]" style="width:100%" value="" /></td>
</tr>
<tr>
<th><label for="[body]"><l10n>Message Template:</l10n> </label></th>
<td><textarea name="[body]" style="width:100%" rows="5"></textarea></td>
</tr>
</table>
</fieldset>
<fieldset id="[anchorfieldset]">
<legend><label><input type="radio" name="[type]" id="[type_anchor]" value="anchor"/>
<l10n>Anchor-Link</l10n>
</label></legend>
<table id="[anchortable]" width="100%">
<tr>
<th><label for="[anchor]"><l10n>Anchor:</l10n> </label></th>
<td>
<select name="[anchor]" id="[anchor]">
</select>
</td>
</tr>
</table>
</fieldset>
<div style="text-align:right">
<input type="button" id="[ok]" value="_(OK)" />
<input type="button" id="[clear]" value="_(Remove Link)" />
<input type="button" id="[cancel]" value="_(Cancel)" />
</div>
</div>
</div>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/dialog.html | HTML | art | 4,864 |
Linker.prototype._createLink = function(a)
{
if (!this._dialog)
{
this._dialog = new Linker.Dialog(this);
}
if(!a && this.editor.selectionEmpty(this.editor.getSelection()))
{
alert(this._lc("You must select some text before making a new link."));
return false;
}
var inputs =
{
type: 'url',
href: 'http://www.example.com/',
target: '',
p_width: '',
p_height: '',
p_options: ['menubar=no','toolbar=yes','location=no','status=no','scrollbars=yes','resizeable=yes'],
to: 'alice@example.com',
subject: '',
body: '',
anchor: ''
};
if(a && a.tagName.toLowerCase() == 'a')
{
var href =this.editor.fixRelativeLinks(a.getAttribute('href'));
var m = href.match(/^mailto:(.*@[^?&]*)(\?(.*))?$/);
var anchor = href.match(/^#(.*)$/);
if(m)
{
// Mailto
inputs.type = 'mailto';
inputs.to = m[1];
if(m[3])
{
var args = m[3].split('&');
for(var x = 0; x<args.length; x++)
{
var j = args[x].match(/(subject|body)=(.*)/);
if(j)
{
inputs[j[1]] = decodeURIComponent(j[2]);
}
}
}
}
else if (anchor)
{
//Anchor-Link
inputs.type = 'anchor';
inputs.anchor = anchor[1];
}
else
{
if(a.getAttribute('onclick'))
{
var m = a.getAttribute('onclick').match(/window\.open\(\s*this\.href\s*,\s*'([a-z0-9_]*)'\s*,\s*'([a-z0-9_=,]*)'\s*\)/i);
// Popup Window
inputs.href = href ? href : '';
inputs.target = 'popup';
inputs.p_name = m[1];
inputs.p_options = [ ];
var args = m[2].split(',');
for(var x = 0; x < args.length; x++)
{
var i = args[x].match(/(width|height)=([0-9]+)/);
if(i)
{
inputs['p_' + i[1]] = parseInt(i[2]);
}
else
{
inputs.p_options.push(args[x]);
}
}
}
else
{
// Normal
inputs.href = href;
inputs.target = a.target;
}
}
}
var linker = this;
// If we are not editing a link, then we need to insert links now using execCommand
// because for some reason IE is losing the selection between now and when doOK is
// complete. I guess because we are defocusing the iframe when we click stuff in the
// linker dialog.
this.a = a; // Why doesn't a get into the closure below, but if I set it as a property then it's fine?
var doOK = function()
{
//if(linker.a) alert(linker.a.tagName);
var a = linker.a;
var values = linker._dialog.hide();
var atr =
{
href: '',
target:'',
title:'',
onclick:''
};
if(values.type == 'url')
{
if(values.href)
{
atr.href = values.href.trim();
atr.target = values.target;
if(values.target == 'popup')
{
if(values.p_width)
{
values.p_options.push('width=' + values.p_width);
}
if(values.p_height)
{
values.p_options.push('height=' + values.p_height);
}
atr.onclick = 'if(window.parent && window.parent.Xinha){return false}window.open(this.href, \'' + (values.p_name.replace(/[^a-z0-9_]/i, '_')) + '\', \'' + values.p_options.join(',') + '\');return false;';
}
}
}
else if(values.type == 'anchor')
{
if(values.anchor)
{
atr.href = values.anchor.value;
}
}
else
{
if(values.to)
{
atr.href = 'mailto:' + values.to;
if(values.subject) atr.href += '?subject=' + encodeURIComponent(values.subject);
if(values.body) atr.href += (values.subject ? '&' : '?') + 'body=' + encodeURIComponent(values.body);
}
}
if (atr.href) atr.href = atr.href.trim();
if(a && a.tagName.toLowerCase() == 'a')
{
if(!atr.href)
{
if(confirm(linker._dialog._lc('Are you sure you wish to remove this link?')))
{
var p = a.parentNode;
while(a.hasChildNodes())
{
p.insertBefore(a.removeChild(a.childNodes[0]), a);
}
p.removeChild(a);
linker.editor.updateToolbar();
return;
}
}
else
{
// Update the link
for(var i in atr)
{
a.setAttribute(i, atr[i]);
}
// If we change a mailto link in IE for some hitherto unknown
// reason it sets the innerHTML of the link to be the
// href of the link. Stupid IE.
if(Xinha.is_ie)
{
if(/mailto:([^?<>]*)(\?[^<]*)?$/i.test(a.innerHTML))
{
a.innerHTML = RegExp.$1;
}
}
}
}
else
{
if(!atr.href) return true;
// Insert a link, we let the browser do this, we figure it knows best
var tmp = Xinha.uniq('http://www.example.com/Link');
linker.editor._doc.execCommand('createlink', false, tmp);
// Fix them up
var anchors = linker.editor._doc.getElementsByTagName('a');
for(var i = 0; i < anchors.length; i++)
{
var anchor = anchors[i];
if(anchor.href == tmp)
{
// Found one.
if (!a) a = anchor;
for(var j in atr)
{
anchor.setAttribute(j, atr[j]);
}
}
}
}
linker.editor.selectNodeContents(a);
linker.editor.updateToolbar();
};
this._dialog.show(inputs, doOK);
};
Linker.prototype._getSelectedAnchor = function()
{
var sel = this.editor.getSelection();
var rng = this.editor.createRange(sel);
var a = this.editor.activeElement(sel);
if(a != null && a.tagName.toLowerCase() == 'a')
{
return a;
}
else
{
a = this.editor._getFirstAncestor(sel, 'a');
if(a != null)
{
return a;
}
}
return null;
};
Linker.Dialog_dTrees = [ ];
Linker.Dialog = function (linker)
{
var lDialog = this;
this.Dialog_nxtid = 0;
this.linker = linker;
this.id = { }; // This will be filled below with a replace, nifty
this.ready = false;
this.dialog = false;
// load the dTree script
this._prepareDialog();
};
Linker.Dialog.prototype._prepareDialog = function()
{
var lDialog = this;
var linker = this.linker;
var files = this.linker.files;
// Now we have everything we need, so we can build the dialog.
if(!linker.lConfig.dialog && Xinha.Dialog) linker.lConfig.dialog = Xinha.Dialog;
var dialog = this.dialog = new linker.lConfig.dialog(linker.editor, Linker.html, 'Linker',{width:600,height:400});
var dTreeName = Xinha.uniq('dTree_');
this.dTree = new dTree(dTreeName, Xinha.getPluginDir("Linker") + '/dTree/');
eval(dTreeName + ' = this.dTree');
this.dTree.add(this.Dialog_nxtid++, -1, linker.lConfig.treeCaption , null, linker.lConfig.treeCaption);
this.makeNodes(files, 0);
// Put it in
var ddTree = this.dialog.getElementById('dTree');
//ddTree.innerHTML = this.dTree.toString();
ddTree.innerHTML = '';
// ddTree.style.position = 'absolute';
// ddTree.style.left = 1 + 'px';
// ddTree.style.top = 0 + 'px';
ddTree.style.overflow = 'auto';
ddTree.style.height = '300px';
if ( Xinha.is_ie )
{
ddTree.style.styleFloat = "left";
}
else
{
ddTree.style.cssFloat = "left";
}
ddTree.style.backgroundColor = 'white';
this.ddTree = ddTree;
this.dTree._linker_premade = this.dTree.toString();
var options = this.dialog.getElementById('options');
//options.style.position = 'absolute';
//options.style.top = 0 + 'px';
//options.style.right = 0 + 'px';
options.style.width = 320 + 'px';
options.style.overflow = 'auto';
// Hookup the resizer
this.dialog.rootElem.style.paddingBottom ="0";
this.dialog.onresize = function()
{
var h = parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight;
var w = parseInt(dialog.width) - 330 ;
// An error is thrown with IE when trying to set a negative width or a negative height
// But perhaps a width / height of 0 is not the minimum required we need to set
if (w<0) w = 0;
if (h<0) h = 0;
//options.style.height =
lDialog.ddTree.style.height = h + 'px';
lDialog.ddTree.style.width = w + 'px';
}
// Set the onclick handlers for the link type radio buttons
var self = this;
this.dialog.getElementById('type_url').onclick = function() {
self.showOptionsForType('url');
};
this.dialog.getElementById('type_mailto').onclick = function() {
self.showOptionsForType('mailto');
};
this.dialog.getElementById('type_anchor').onclick = function() {
self.showOptionsForType('anchor');
};
var hidePopupOptions = function() {
self.showOptionsForTarget('none')
};
this.dialog.getElementById('noTargetRadio').onclick = hidePopupOptions;
this.dialog.getElementById('sameWindowRadio').onclick = hidePopupOptions;
this.dialog.getElementById('newWindowRadio').onclick = hidePopupOptions;
this.dialog.getElementById('popupWindowRadio').onclick = function() {
self.showOptionsForTarget('popup');
};
this.ready = true;
ddTree = null;
Xinha.freeLater(lDialog, 'ddTree');
options = null;
};
Linker.Dialog.prototype.makeNodes = function(files, parent)
{
for(var i = 0; i < files.length; i++)
{
if(typeof files[i] == 'string')
{
this.dTree.add(this.Dialog_nxtid++, parent,
files[i].replace(/^.*\//, ''),
'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
files[i]);
}
else if(typeof files[i]=="object" && files[i] && typeof files[i].length==="number") // there seems to be a strange bug in IE that requires this complicated check, see #1197
{
var id = this.Dialog_nxtid++;
this.dTree.add(id, parent, files[i][0].replace(/^.*\//, ''), null, files[i][0]);
this.makeNodes(files[i][1], id);
}
else if(typeof files[i] == 'object')
{
var id = this.Dialog_nxtid++;
if(files[i].title) var title = files[i].title;
else if(files[i].url) var title = files[i].url.replace(/^.*\//, '');
else var title = "no title defined";
if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);';
else var link = '';
this.dTree.add(id, parent, title, link, title);
if(files[i].children) {
this.makeNodes(files[i].children, id);
}
}
}
};
Linker.Dialog.prototype._lc = Linker.prototype._lc;
Linker.Dialog.prototype.show = function(inputs, ok, cancel)
{
if(!this.ready)
{
var lDialog = this;
window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100);
return;
}
if(this.ddTree.innerHTML == '')
{
this.ddTree.innerHTML = this.dTree._linker_premade;
}
if(!this.linker.lConfig.canSetTarget)
{
this.dialog.getElementById('target_options').style.display = 'none';
}
this.showOptionsForType(inputs.type);
this.showOptionsForTarget(inputs.target);
var anchor = this.dialog.getElementById('anchor');
for(var i=anchor.length;i>=0;i--) {
anchor[i] = null;
}
var html = this.linker.editor.getHTML();
var anchors = new Array();
var m = html.match(/<a[^>]+name="([^"]+)"/gi);
if(m)
{
for(i=0;i<m.length;i++)
{
var n = m[i].match(/name="([^"]+)"/i);
if(!anchors.contains(n[1])) anchors.push(n[1]);
}
}
m = html.match(/id="([^"]+)"/gi);
if(m)
{
for(i=0;i<m.length;i++)
{
n = m[i].match(/id="([^"]+)"/i);
if(!anchors.contains(n[1])) anchors.push(n[1]);
}
}
for(i=0;i<anchors.length;i++)
{
var opt = new Option(anchors[i],'#'+anchors[i],false,(inputs.anchor == anchors[i]));
anchor[anchor.length] = opt;
}
// Configuration for disabling the mail link functionality.
if(this.linker.lConfig.disableMailto)
{
this.dialog.getElementById('mailtofieldset').style.display = "none";
}
// Configuration for hiding the anchor functionality. Also, no need to show
// the UI if there are no anchors present in the document.
if(anchor.length==0 || this.linker.lConfig.disableAnchors)
{
this.dialog.getElementById('anchorfieldset').style.display = "none";
// If we disable the other two fieldsets, we'll hide the (now) unnecessary
// radio button.
if (this.linker.lConfig.disableMailto)
{
this.dialog.getElementById('type').style.display = "none";
}
}
// Disable link targets (all targets available by default)
var disabledTargets = this.linker.lConfig.disableTargetTypes;
if (typeof disabledTargets == 'undefined')
{
disabledTargets = [];
}
else if (typeof disabledTargets == 'string')
{
disabledTargets = [disabledTargets];
}
for (var i=0; i<disabledTargets.length; i++)
{
this.dialog.getElementById(disabledTargets[i]).style.display = "none";
}
if (disabledTargets.length == 3) // only one target option is visible
{
if (disabledTargets.contains('popupWindow'))
{
// There's no need to show anything, so hide the entire div
this.dialog.getElementById('target_options').style.display = "none";
}
else
{
// Only popups are allowed, hide the radio button
this.dialog.getElementById('popupWindowRadio').style.display = "none";
this.showOptionsForTarget('popup');
}
}
var enabledTargets = new Array();
if (!disabledTargets.contains('noTarget'))
{
enabledTargets.push('noTargetRadio');
}
if (!disabledTargets.contains('sameWindow'))
{
enabledTargets.push('sameWindowRadio');
}
if (!disabledTargets.contains('newWindow'))
{
enabledTargets.push('newWindowRadio');
}
if (!disabledTargets.contains('popupWindow'))
{
enabledTargets.push('popupWindowRadio');
}
// if we're not editing an existing link, hide the remove link button
if (inputs.href == 'http://www.example.com/' && inputs.to == 'alice@example.com') {
this.dialog.getElementById('clear').style.display = "none";
}
else { //
var clearBtn = this.dialog.getElementById('clear');
clearBtn.style.display = "";
if (ok)
{
clearBtn.onclick = function() { lDialog.removeLink(ok); };
}
}
// It could be forced not be able to be removed, as is the case with link-picker.js
if(!this.linker.lConfig.canRemoveLink)
{
this.dialog.getElementById('clear').style.display = 'none';
}
// Connect the OK and Cancel buttons
var dialog = this.dialog;
var lDialog = this;
if(ok)
{
this.dialog.getElementById('ok').onclick = ok;
}
else
{
this.dialog.getElementById('ok').onclick = function() {lDialog.hide();};
}
if(cancel)
{
this.dialog.getElementById('cancel').onclick = cancel;
}
else
{
this.dialog.getElementById('cancel').onclick = function() { lDialog.hide()};
}
// Show the dialog
this.linker.editor.disableToolbar(['fullscreen','linker']);
this.dialog.show(inputs);
// If we set the default radio button *before* we call dialog.show()
// it doesn' work...
var targetSelected = false;
for (var i=0; i<enabledTargets.length; i++)
{
if (this.dialog.getElementById(enabledTargets[i]).checked == true)
{
targetSelected = true;
break;
}
}
// If no target is selected, select the first one by default
if (!targetSelected && enabledTargets.length > 0)
{
this.dialog.getElementById(enabledTargets[0]).checked = true;
}
// Init the sizes
this.dialog.onresize();
};
Linker.Dialog.prototype.hide = function()
{
this.linker.editor.enableToolbar();
return this.dialog.hide();
};
Linker.Dialog.prototype.removeLink = function(applyFunc)
{
this.dialog.getElementById('href').value = "";
this.dialog.getElementById('to').value = "";
return applyFunc();
};
Linker.Dialog.prototype.showOptionsForType = function(type)
{
var urlOptions = this.dialog.getElementById('urltable');
var mailtoOptions = this.dialog.getElementById('mailtable');
var anchorOptions = this.dialog.getElementById('anchortable');
if (type == 'anchor')
{
anchorOptions.style.display = '';
urlOptions.style.display = 'none';
mailtoOptions.style.display = 'none';
}
else if (type == 'mailto')
{
mailtoOptions.style.display = '';
urlOptions.style.display = 'none';
anchorOptions.style.display = 'none';
}
else
{
urlOptions.style.display = '';
mailtoOptions.style.display = 'none';
anchorOptions.style.display = 'none';
}
};
Linker.Dialog.prototype.showOptionsForTarget = function(target)
{
var popupOptions = this.dialog.getElementById('popuptable');
popupOptions.style.display = target == 'popup' ? '' : 'none';
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/pluginMethods.js | JavaScript | art | 17,310 |
<?php
// /home/username/foo/public_html/bar
$dir = dirname(__FILE__)."/../..";
// http://example.com/bar (or relative url, or semi absolute)
$url = '';
$include = '/\.(php|shtml|html|htm|shtm|cgi|txt|doc|pdf|rtf|xls|csv)$/';
$exclude = '';
$dirinclude = '';
$direxclude = '/(^|\/)[._]|htmlarea/'; // Exclude the htmlarea tree by default
// New backend config data passing
// if data was passed using xinha_pass_to_backend() we extract and use it
// as the items above
require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
if($passed_data = xinha_read_passed_data())
{
extract($passed_data);
}
// Old deprecated backend config data passing
// not described because you shouldn't use it.
//------------------------------------------------------------------------
$hash = '';
foreach(explode(',', 'dir,include,exclude,dirinclude,direxclude') as $k)
{
if(isset($_REQUEST[$k]))
{
if(get_magic_quotes_gpc())
{
$_REQUEST[$k] = stripslashes($_REQUEST[$k]);
}
$hash .= $k . '=' . $_REQUEST[$k];
$$k = $_REQUEST[$k];
}
}
if($hash)
{
session_start();
if(!isset($_SESSION[sha1($hash)]))
{
?>
[ ];
<?php
exit;
}
}
//------------------------------------------------------------------------
// Neither dir nor url should have trailing slash
$dir = preg_replace('/\/$/', '', $dir);
$url = preg_replace('/\/$/', '', $url);
function scan($dir, $durl = '')
{
global $include, $exclude, $dirinclude, $direxclude;
static $seen = array();
$files = array();
$dir = realpath($dir);
if(isset($seen[$dir]))
{
return $files;
}
$seen[$dir] = TRUE;
$dh = @opendir($dir);
while($dh && ($file = readdir($dh)))
{
if($file[0] !== '.')
{
$path = realpath($dir . '/' . $file);
$url = $durl . '/' . $file;
if(($dirinclude && !preg_match($dirinclude, $url)) || ($direxclude && preg_match($direxclude, $url))) continue;
if(is_dir($path))
{
if($subdir = scan($path, $url))
{
$files[] = array('url'=>$url, 'children'=>$subdir);
}
}
elseif(is_file($path))
{
if(($include && !preg_match($include, $url)) || ($exclude && preg_match($exclude, $url))) continue;
$files[] = array('url'=>$url);
}
}
}
@closedir($dh);
return dirsort($files);
}
function dirsort($files)
{
usort($files, 'dircomp');
return $files;
}
function dircomp($a, $b)
{
if(isset($a['children']) && !isset($b['children'])) return -1;
if(isset($b['children']) && !isset($a['children'])) return 1;
return strcmp(strtolower($a['url']), strtolower($b['url']));
}
echo xinha_to_js(scan($dir,$url));
?>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/scan.php | PHP | art | 3,122 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"You must select some text before making a new link.": "Selecteer de tekst welke gelinkt moet worden.",
"Are you sure you wish to remove this link?": "Wilt u deze link werkelijk verwijderen?"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/nl.js | JavaScript | art | 303 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
{
"You must select some text before making a new link.": "Sie müssen einen Text markieren um einen Link zu erstellen",
"Are you sure you wish to remove this link?": "Wollen Sie diesen Link wirklich entfernen?",
"Remove Link": "Link entfernen",
"URL Link": "URL Adresse",
"Ordinary Link": "Standard Link",
"Same Window (jump out of frames)": "Selbes Fenster (ganzer Bereich)",
"New Window": "Neues Fenster",
"Popup Window": "Pop-Up Fenster",
"Email Link": "Email Link",
"Email Address:": "Email Adresse",
"Subject:": "Betreff:",
"Message Template:": "Nachrichten Vorlage:",
"Size:": "Größe:",
"Name:": "Name:"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/de.js | JavaScript | art | 788 |
// I18N constants
// LANG: "pl", ENCODING: UTF-8
// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
{
"You must select some text before making a new link.": "Zaznacz tekst przed dodaniem odnośnika.",
"Are you sure you wish to remove this link?": "Na pewno chcesz usunąć odnośnik?",
"Remove Link": "USUŃ ODNOŚNIK",
"URL Link": "Adres URL",
"Ordinary Link": "Zwykły odnośnik",
"Same Window (jump out of frames)": "To samo okno (wyskocz z ramek)",
"New Window": "Nowe okno",
"Popup Window": "Okienko pop-up",
"Email Link": "Link do e-maila",
"Email Address:": "Adres e-mail",
"Subject:": "Temat:",
"Message Template:": "Szablon wiadmości:",
"Size:": "Rozmiar:",
"Name:": "Nazwa:"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/pl.js | JavaScript | art | 758 |
// I18N constants
// LANG: "fr", ENCODING: UTF-8
{
"You must select some text before making a new link.": "Vous devez sélectionner un texte avant de créer un nouveau lien",
"Are you sure you wish to remove this link?": "Confirmez-vous la suppression de ce lien ?",
"Remove Link": "Supprimer",
"URL Link": "Lien URL",
"Ordinary Link": "Lien standard",
"Same Window (jump out of frames)": "Même fenêtre (sort des frames)",
"New Window": "Nouvelle fenêtre",
"Popup Window": "Fenêtre popup",
"Email Link": "Lien email",
"Email Address:": "Adresse email",
"Subject:": "Sujet",
"Message Template:": "Message",
"Size:": "Taille",
"Name:": "Nom"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/fr.js | JavaScript | art | 674 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"You must select some text before making a new link.": "リンクを作成するにはテキストを選択する必要があります",
"Are you sure you wish to remove this link?": "本当にこのリンクを削除しますか?",
"Remove Link": "リンク削除",
"URL Link": "URLリンク",
"Ordinary Link": "標準リンク",
"Same Window (jump out of frames)": "同一ウィンドウ (フレーム最上位)",
"New Window": "新しいウィンドウ",
"Popup Window": "ポップアップウィンドウ",
"Email Link": "Eメールリンク",
"Email Address:": "アドレス:",
"Subject:": "件名:",
"Message Template:": "本文雛形:",
"Size:": "サイズ:",
"Name:": "名前:",
"Menu Bar:": "メニュー",
"Toolbar:": "ツールバー",
"Location Bar:": "アドレスバー",
"Status Bar:": "ステータスバー",
"Scrollbars:": "スクロール",
"Resizeable:": "リサイズ"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/ja.js | JavaScript | art | 983 |
// I18N constants
// LANG: "nb", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"You must select some text before making a new link.": "Du må markere tekst eller et bilde før du kan lage en lenke.",
"Are you sure you wish to remove this link?": "Er du sikker på at du vil fjerne lenken?"
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/nb.js | JavaScript | art | 343 |
// I18N constants
//
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
//
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
//
// Last revision: 06 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
//
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt
{
"Anchor-Link": "Link-Âncora",
"Anchor:": "Âncora:",
"Are you sure you wish to remove this link?": "Você tem certeza que deseja remover este link?",
"Cancel": "Cancelar",
"Email Address:": "Endereço de E-mail:",
"Email Link": "Link de E-mail",
"Insert/Modify Link": "Inserir/Modificar Link",
"Location Bar:": "Barra de Localização:",
"Menu Bar:": "Barra de Menu:",
"Message Template:": "Modelo de Mensagem:",
"Name:": "Nome:",
"New Window": "Nova Janela",
"OK": "OK",
"Ordinary Link": "Link Comum",
"Popup Window": "Janela Pop-up",
"Remove Link": "Remover Link",
"Resizeable:": "Redimensionável",
"Same Window (jump out of frames)": "Mesma Janela (Sair fora dos frames)",
"Scrollbars:": "Barra de Rolagem:",
"Size:": "Tamanho:",
"Status Bar:": "Barra de Informações:",
"Subject:": "Assunto:",
"Target:": "Destino:",
"Toolbar:": "Barra de Ferramentas:",
"URL Link": "URL do Link",
"You must select some text before making a new link.": "Você precisa selecionar algum texto antes de criar um novo link."
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/lang/pt_br.js | JavaScript | art | 1,560 |
/*--------------------------------------------------|
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landr? |
| |
| This script can be used freely as long as all |
| copyright messages are intact. |
| |
| Updated: 17.04.2003 |
|--------------------------------------------------*/
// Node object
function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.target = target;
this.icon = icon;
this.iconOpen = iconOpen;
this._io = open || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
}
// Tree object
function dTree(objName, baseDir) {
this.config = {
target : null,
folderLinks : true,
useSelection : true,
useCookies : true,
useLines : true,
useIcons : true,
useStatusText : false,
closeSameLevel : false,
inOrder : false
};
this.icon = {
root : baseDir + 'img/base.gif',
folder : baseDir + 'img/folder.gif',
folderOpen : baseDir + 'img/folderopen.gif',
node : baseDir + 'img/page.gif',
empty : baseDir + 'img/empty.gif',
line : baseDir + 'img/line.gif',
join : baseDir + 'img/join.gif',
joinBottom : baseDir + 'img/joinbottom.gif',
plus : baseDir + 'img/plus.gif',
plusBottom : baseDir + 'img/plusbottom.gif',
minus : baseDir + 'img/minus.gif',
minusBottom : baseDir + 'img/minusbottom.gif',
nlPlus : baseDir + 'img/nolines_plus.gif',
nlMinus : baseDir + 'img/nolines_minus.gif'
};
this.obj = objName;
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
}
// Adds a new node to the node array
dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
};
// Open/close all nodes
dTree.prototype.openAll = function() {
this.oAll(true);
};
dTree.prototype.closeAll = function() {
this.oAll(false);
};
// Outputs the tree to the page
dTree.prototype.toString = function() {
this.setCS_All();
var str = '<div class="dtree">\n';
if (document.getElementById) {
if (this.config.useCookies) this.selectedNode = this.getSelected();
str += this.addNode(this.root);
} else str += 'Browser not supported.';
str += '</div>';
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
return str;
};
// Creates the tree structure
dTree.prototype.addNode = function(pNode) {
var str = '';
var n=0;
if (this.config.inOrder) n = pNode._ai;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == pNode.id) {
var cn = this.aNodes[n];
cn._p = pNode;
cn._ai = n;
// this.setCS(cn);
if (!cn.target && this.config.target) cn.target = this.config.target;
if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
if (!this.config.folderLinks && cn._hc) cn.url = null;
if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
cn._is = true;
this.selectedNode = n;
this.selectedFound = true;
}
str += this.node(cn, n);
if (cn._ls) break;
}
}
return str;
};
// Creates the node icon, url and text
dTree.prototype.node = function(node, nodeId) {
var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
if (this.config.useIcons) {
if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
if (this.root.id == node.pid) {
node.icon = this.icon.root;
node.iconOpen = this.icon.root;
}
str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
}
if (node.url) {
str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
if (node.title) str += ' title="' + node.title + '"';
if (node.target) str += ' target="' + node.target + '"';
if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
str += '>';
}
else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
str += node.name;
if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
str += '</div>';
if (node._hc) {
str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
str += this.addNode(node);
str += '</div>';
}
this.aIndent.pop();
return str;
};
// Adds the empty and line icons
dTree.prototype.indent = function(node, nodeId) {
var str = '';
if (this.root.id != node.pid) {
for (var n=0; n<this.aIndent.length; n++)
str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
if (node._hc) {
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
str += '" alt="" /></a>';
} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
}
return str;
};
// Checks if a node has any children and if it is the last sibling
dTree.prototype.setCS = function(node) {
var lastId;
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id) node._hc = true;
if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
}
if (lastId==node.id) node._ls = true;
};
dTree.prototype.setCS_All = function()
{
var ids = { }; // ID => { _hc: haschildren, _ls_is: lastsibling}
for(var n = 0; n < this.aNodes.length; n++)
{
var node = this.aNodes[n];
if(!ids[node.pid])
{
ids[node.pid] = { _hc: true, _ls_is: node.id };
}
else
{
ids[node.pid]._hc = true;
ids[node.pid]._ls_is = node.id;
}
if(!ids[node.id])
{
ids[node.id] = { _hc: false, _ls_is: null }
}
}
for(var n = 0; n < this.aNodes.length; n++)
{
var node = this.aNodes[n];
node._ls = ids[node.pid]._ls_is == node.id ? true : false;
if(ids[node.id])
{
node._hc = ids[node.id]._hc;
}
}
};
// Returns the selected node
dTree.prototype.getSelected = function() {
var sn = this.getCookie('cs' + this.obj);
return (sn) ? sn : null;
};
// Highlights the selected node
dTree.prototype.s = function(id) {
if (!this.config.useSelection) return;
var cn = this.aNodes[id];
if (cn._hc && !this.config.folderLinks) return;
if (this.selectedNode != id) {
if (this.selectedNode || this.selectedNode==0) {
eOld = document.getElementById("s" + this.obj + this.selectedNode);
eOld.className = "node";
}
eNew = document.getElementById("s" + this.obj + id);
eNew.className = "nodeSel";
this.selectedNode = id;
if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
}
};
// Toggle Open or close
dTree.prototype.o = function(id) {
var cn = this.aNodes[id];
this.nodeStatus(!cn._io, id, cn._ls);
cn._io = !cn._io;
if (this.config.closeSameLevel) this.closeLevel(cn);
if (this.config.useCookies) this.updateCookie();
};
// Open or close all nodes
dTree.prototype.oAll = function(status) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
this.nodeStatus(status, n, this.aNodes[n]._ls)
this.aNodes[n]._io = status;
}
}
if (this.config.useCookies) this.updateCookie();
};
// Opens the tree to a specific node
dTree.prototype.openTo = function(nId, bSelect, bFirst) {
if (!bFirst) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].id == nId) {
nId=n;
break;
}
}
}
var cn=this.aNodes[nId];
if (cn.pid==this.root.id || !cn._p) return;
cn._io = true;
cn._is = bSelect;
if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
if (this.completed && bSelect) this.s(cn._ai);
else if (bSelect) this._sn=cn._ai;
this.openTo(cn._p._ai, false, true);
};
// Closes all nodes on the same level as certain node
dTree.prototype.closeLevel = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
}
// Closes all children of a node
dTree.prototype.closeAllChildren = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
}
// Change the status of a node(open or closed)
dTree.prototype.nodeStatus = function(status, id, bottom) {
eDiv = document.getElementById('d' + this.obj + id);
eJoin = document.getElementById('j' + this.obj + id);
if (this.config.useIcons) {
eIcon = document.getElementById('i' + this.obj + id);
eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
}
eJoin.src = (this.config.useLines)?
((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
((status)?this.icon.nlMinus:this.icon.nlPlus);
eDiv.style.display = (status) ? 'block': 'none';
};
// [Cookie] Clears a cookie
dTree.prototype.clearCookie = function() {
var now = new Date();
var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
this.setCookie('co'+this.obj, 'cookieValue', yesterday);
this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
};
// [Cookie] Sets value in a cookie
dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
document.cookie =
escape(cookieName) + '=' + escape(cookieValue)
+ (expires ? '; expires=' + expires.toGMTString() : '')
+ (path ? '; path=' + path : '')
+ (domain ? '; domain=' + domain : '')
+ (secure ? '; secure' : '');
};
// [Cookie] Gets a value from a cookie
dTree.prototype.getCookie = function(cookieName) {
var cookieValue = '';
var posName = document.cookie.indexOf(escape(cookieName) + '=');
if (posName != -1) {
var posValue = posName + (escape(cookieName) + '=').length;
var endPos = document.cookie.indexOf(';', posValue);
if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
else cookieValue = unescape(document.cookie.substring(posValue));
}
return (cookieValue);
};
// [Cookie] Returns ids of open nodes as a string
dTree.prototype.updateCookie = function() {
var str = '';
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
if (str) str += '.';
str += this.aNodes[n].id;
}
}
this.setCookie('co' + this.obj, str);
};
// [Cookie] Checks if a node id is in a cookie
dTree.prototype.isOpen = function(id) {
var aOpen = this.getCookie('co' + this.obj).split('.');
for (var n=0; n<aOpen.length; n++)
if (aOpen[n] == id) return true;
return false;
};
// If Push and pop is not implemented by the browser
if (!Array.prototype.push) {
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
};
}
if (!Array.prototype.pop) {
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
};
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/dTree/dtree.js | JavaScript | art | 13,322 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Destroydrop » Javascripts » Tree » Api</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<link rel="stylesheet" href="/dd.css" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div id="shadow">
<div id="content">
<div id="location">
<h1><a href="/">Destroydrop</a> » <a href="/javascripts/">Javascripts</a> » <a href="/javascripts/tree/">Tree</a> » <a href="/javascripts/tree/api/">Api</a></h1>
</div>
<div class="line"></div>
<div id="files">
<h3>Overview</h3>
<div class="line"></div>
<div class="item">
<ul class="arrow">
<li><a href="#functions">Functions</a>
<ul class="arrow">
<li><a href="#add">add</a></li>
<li><a href="#openall">openAll</a></li>
<li><a href="#closeall">closeAll</a></li>
<li><a href="#opento">openTo</a></li>
</ul>
</li>
<li><a href="#configuration">Configuration</a></li>
</ul>
</div>
<a name="functions"></a>
<h3>Functions</h3>
<div class="line"></div>
<div class="item">
<a name="add"></a>
<h4 class="func">add()</h4>
<p>Adds a node to the tree.<br />Can only be called before the tree is drawn.</p>
<p>id, pid and name are required.</p>
<h4>Parameters</h4>
<table class="files">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>id</td>
<td>Number</td>
<td>Unique identity number.</td>
</tr>
<tr>
<td>pid</td>
<td>Number</td>
<td>Number refering to the parent node. The value for the root node has to be -1.</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>Text label for the node.</td>
</tr>
<tr>
<td>url</td>
<td>String</td>
<td>Url for the node.</td>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td>Title for the node.</td>
</tr>
<tr>
<td>target</td>
<td>String</td>
<td>Target for the node.</td>
</tr>
<tr>
<td>icon</td>
<td>String</td>
<td>Image file to use as the icon. Uses default if not specified.</td>
</tr>
<tr>
<td>iconOpen</td>
<td>String</td>
<td>Image file to use as the open icon. Uses default if not specified.</td>
</tr>
<tr>
<td>open</td>
<td>Boolean</td>
<td>Is the node open.</td>
</tr>
</table>
<br />
<h4>Example</h4>
<p><code>mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code></p>
<br />
<a name="openall"></a>
<h4 class="func">openAll()</h4>
<p>Opens all the nodes.<br />Can be called before and after the tree is drawn.</p>
<h4>Example</h4>
<p><code>mytree.openAll();</code></p>
<br />
<a name="closeall"></a>
<h4 class="func">closeAll()</h4>
<p>Closes all the nodes.<br />Can be called before and after the tree is drawn.</p>
<h4>Example</h4>
<p><code>mytree.closeAll();</code></p>
<br />
<a name="opento"></a>
<h4 class="func">openTo()</h4>
<p>Opens the tree to a certain node and can also select the node.<br />
Can only be called after the tree is drawn.</p>
<h4>Parameters</h4>
<table class="files">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>id</td>
<td>Number</td>
<td>Identity number for the node.</td>
</tr>
<tr>
<td>select</td>
<td>Boolean</td>
<td>Should the node be selected.</td>
</tr>
</table>
<h4>Example</h4>
<p><code>mytree.openTo(4, true);</code></p>
</div>
<a name="configuration"></a>
<h3>Configuration</h3>
<div class="line"></div>
<div class="item">
<table class="files">
<tr>
<th>Variable</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>target</td>
<td>String</td>
<td>true</td>
<td>Target for all the nodes.</td>
</tr>
<tr>
<td>folderLinks</td>
<td>Boolean</td>
<td>true</td>
<td>Should folders be links.</td>
</tr>
<tr>
<td>useSelection</td>
<td>Boolean</td>
<td>true</td>
<td>Nodes can be selected(highlighted).</td>
</tr>
<tr>
<td>useCookies</td>
<td>Boolean</td>
<td>true</td>
<td>The tree uses cookies to rember it's state.</td>
</tr>
<tr>
<td>useLines</td>
<td>Boolean</td>
<td>true</td>
<td>Tree is drawn with lines.</td>
</tr>
<tr>
<td>useIcons</td>
<td>Boolean</td>
<td>true</td>
<td>Tree is drawn with icons.</td>
</tr>
<tr>
<td>useStatusText</td>
<td>Boolean</td>
<td>false</td>
<td>Displays node names in the statusbar instead of the url.</td>
</tr>
<tr>
<td>closeSameLevel</td>
<td>Boolean</td>
<td>false</td>
<td>Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.</td>
</tr>
<tr>
<td>inOrder</td>
<td>Boolean</td>
<td>false</td>
<td>If parent nodes are always added before children, setting this to true speeds up the tree.</td>
</tr>
</table>
<h4>Example</h4>
<p><code>mytree.config.target = "mytarget";</code></p>
</div>
</div>
<div class="line"></div>
<div id="copy">
<p class="right"><a href="http://validator.w3.org/check/referer">XHTML</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p>
<p><a href="mailto:drop@destroydrop.com">©2002-2003 Geir Landrö</a></p>
</div>
</div>
</div>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/dTree/api.html | HTML | art | 5,315 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Destroydrop » Javascripts » Tree</title>
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="dtree.js"></script>
</head>
<body>
<h1><a href="/">Destroydrop</a> » <a href="/javascripts/">Javascripts</a> » <a href="/javascripts/tree/">Tree</a></h1>
<h2>Example</h2>
<div class="dtree">
<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>
<script type="text/javascript">
<!--
d = new dTree('d');
d.add(0,-1,'My example tree');
d.add(1,0,'Node 1','example01.html');
d.add(2,0,'Node 2','example01.html');
d.add(3,1,'Node 1.1','example01.html');
d.add(4,0,'Node 3','example01.html');
d.add(5,3,'Node 1.1.1','example01.html');
d.add(6,5,'Node 1.1.1.1','example01.html');
d.add(7,0,'Node 4','example01.html');
d.add(8,1,'Node 1.2','example01.html');
d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','img/imgfolder.gif');
d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
d.add(11,9,'Mom\'s birthday','example01.html');
d.add(12,0,'Recycle Bin','example01.html','','','img/trash.gif');
document.write(d);
//-->
</script>
</div>
<p><a href="mailto:drop@destroydrop.com">©2002-2003 Geir Landrö</a></p>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/dTree/example01.html | HTML | art | 1,511 |
/*--------------------------------------------------|
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landr? |
|--------------------------------------------------*/
.dtree {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #666;
white-space: nowrap;
}
.dtree img {
border: 0px !important;
margin:0px !important;
display:inline !important;
vertical-align: middle !important;
}
.dtree a,.dtree a:visited {
color: #333;
text-decoration: none;
}
.dtree a.node, .dtree a.nodeSel {
white-space: nowrap;
padding: 1px 2px 1px 2px;
/*padding: 0px 1px 0px 1px;*/
}
.dtree a.node:hover, .dtree a.nodeSel:hover {
color: #333;
text-decoration: underline;
}
.dtree a.nodeSel {
background-color: #c0d2ec;
/*
-moz-border-radius : 4px;
border:1px dotted #333;
*/
}
.dtree .clip {
overflow: hidden;
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/dTree/dtree.css | CSS | art | 1,008 |
/*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
-- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/
--
-- Use of Xinha is granted by the terms of the htmlArea License (based on
-- BSD license) please read license.txt in this package for details.
--
-- Xinha was originally based on work by Mihai Bazon which is:
-- Copyright (c) 2003-2004 dynarch.com.
-- Copyright (c) 2002-2003 interactivetools.com, inc.
-- This copyright notice MUST stay intact for use.
--
-- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Dialogs/inline-dialog.js $
-- $LastChangedDate: 2007-01-24 03:26:04 +1300 (Wed, 24 Jan 2007) $
-- $LastChangedRevision: 694 $
-- $LastChangedBy: gogo $
--------------------------------------------------------------------------*/
/** The Link Picker is a semi-standalone instance of the Linker plugin which can be used
* for providing a Linker style browse dialog for selecting urls which are then
* returned into a standard form field.
*
* Usage:
* --------------------------------------------------------------------------
* {{{
<!-- If you are already using Xinha on the page you should already have this stuff... -->
<script language="javascript">
_editor_url = '/url/to/xinha';
_editor_lang = "en";
</script>
<script type="text/javascript" src="/url/to/xinha/XinhaCore.js"></script>
<!-- There are four files required for link picker, in this order. -->
<script type="text/javascript" src="/url/to/xinha/modules/Dialog/XinhaDialog.js"></script>
<script type="text/javascript" src="/url/to/xinha/modules/Dialog/DetachedDialog.js"></script>
<script type="text/javascript" src="/url/to/xinha/plugins/Linker/Linker.js"></script>
<script type="text/javascript" src="/url/to/xinha/plugins/Linker/link-picker.js"></script>
<script language="javascript">
with(LinkPicker.Config.prototype)
{
<?php
// See Linker for more possible config items
$myConfig = array
(
'dir' => '/path/to/base' ,
'url' => '/url/to/base' ,
);
xinha_pass_to_php_backend($myConfig);
?>
}
Xinha._addEvent(window, 'load', function()
{
new LinkPicker(
document.getElementById('url'), // this is the field that you want to pick links for, it gets a Browse button
new LinkPicker.Config()
);
});
</script>
<form>
<input type="text" id="url" />
<div id="dialogHere" style="width:640px; height:480px;"></div>
</form>
* }}}
*
*/
function LinkPicker(field, config)
{
this.field = field;
var linkPicker = this;
// We use a tempoary anchor tag to pass to the Linker plugin
this.tmpAnchor = document.createElement('a');
// We will use the detached dialog always
config.dialog = LinkPicker.Dialog;
config.canSetTarget = false;
config.canRemoveLink = false;
// These methods are dummy versions of stuff that would normally be in a Xinha object
this.selectionEmpty = function() { return true; };
this.getSelection = function() { return null; };
this.selectNodeContents = function() { return true; };
this.getHTML = function() { return ''; }
this.disableToolbar = function() { return true; }
this.enableToolbar = function() { return true; }
this._doc = {
execCommand: function() { return false; },
getElementsByTagName: function() { return [ ]; }
}
this.config = {
Linker: config,
btnList: { },
registerButton: function() { return true; },
addToolbarElement: function() { }
}
// Add a button next to the field
var button = document.createElement('input'); button.type='button';
button.value = 'Browse';
button.onclick = function() { linkPicker.editLink(); return false; }
field.parentNode.insertBefore(button,field.nextSibling);
// We co-opt updateToolbar as the point at which we copy the temporary anchor across to the field
// Linker calls this as the last step, so perfect.
this.updateToolbar = function() { linkPicker.field.value = this.fixRelativeLinks(linkPicker.tmpAnchor.href); };
this.linker = new Linker(this);
this.linker.onGenerateOnce();
}
LinkPicker.prototype.editLink = function()
{
this.tmpAnchor.href = this.field.value;
this.linker._createLink(this.tmpAnchor);
}
LinkPicker.prototype.fixRelativeLinks = function(href)
{
return href.replace(document.location.href.replace( /^(https?:\/\/[^\/]*)(.*)$/i, '$1' ), '');
}
LinkPicker.Dialog = function(linkPicker, html, localizer, size, options)
{
LinkPicker.Dialog.parentConstructor.call(this, html, localizer, size, options);
}
Xinha.extend(LinkPicker.Dialog, Xinha.DetachedDialog);
LinkPicker.Config = function() { }
LinkPicker.Config.prototype = Xinha.Config.prototype.Linker; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Linker/link-picker.js | JavaScript | art | 5,054 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Maarten Molenschot, maarten@nrgmm.nl
{
"Form": "Formulier",
"Textarea": "Tekstgebied",
"Selection Field": "Selectielijst",
"Checkbox": "Checkbox",
"Radio Button": "Radio knop",
"Text Field": "Tekstveld",
"Password Field": "Wachtwoordveld",
"File Field": "Bestandsveld",
"Submit Button": "Verzend knop",
"Reset Button": "Wis knop",
"Image Button": "Afbeelding knop",
"Button": "Knop",
"Hidden Field": "Verborgen veld",
"Label": "Label",
"Field Set": "Veldset",
"Form Element: INPUT": "Formulier element: INPUT",
"Form Element: SELECT": "Formulier element: SELECT",
"Form Element: TEXTAREA": "Formulier element: TEXTAREA",
"Form Element: LABEL": "Formulier element: LABEL",
"Form Element: FIELDSET": "Formulier element: FIELDSET",
"Form Name:": "Formulier naame:",
"Form handler script": "Formulier script",
"Action URL:": "Actie URL:",
"Method:": "Methode:",
"Post": "POST",
"Get": "GET",
"Encoding:": "Encodering:",
"HTML-Form to CGI (default)": "HTML formulier naar CGI (standaard)",
"multipart Form Data (File-Upload)": "Multipart formulier data(Bestands upload)",
"Target Frame:": "Doel venster:",
"Name/ID:": "Naam/ID:",
"Value:": "Waarde:",
"Disabled": "Uitgeschakeld",
"Checked": "Checked",
"Tab Index:": "Tab volgorde:",
"Access Key:": "Toegangs toets:",
"Read Only": "Alleen lezen",
"Dimensions": "Dimenties",
"Size:": "Grootte:",
"Max length:": "Maximale lengte:",
"Button Script": "Knop script",
"'onClick'=": "'onClick'=",
"Image source": "Afbeelding bron",
"Image URL:": "Afbeelding URL:",
"Multiple Select": "Meerdere selectie mogelijkheden",
"Options": "Opties",
"Lable:": "Label:",
"Move Up": "Omhoog",
"Move Down": "Omlaag",
"Delete": "Verwijderen",
"Add": "Toevoegen",
"Columns:": "Kolommen:",
"Rows:": "Rijen:",
"Wrap Mode:": "Terugloop:",
"Off": "Uit",
"Soft": "Zacht",
"Hard": "Hard",
"Physical": "Fysiek",
"Virtual": "Virtueel",
"normal": "normaal",
"nowrap": "geen terugloop",
"pre": "pre",
"Initial Text:": "Start tekst:",
"Text:": "Tekst:",
"For Control:": "Voor controle:",
"Legend:": "Legend:",
"Cancel": "Annuleren",
"Name": "Naame",
"Name of the form input": "Naam van formulier invoer",
"Value of the form input": "Waarde van formulier invoer",
"Size of text box in characters": "Grootte van tekstveld in tekens",
"Maximum number of characters accepted": "Maximaal aantal tekens toegestaan",
"Javascript for button click": "Knop klik met JavaScript",
"URL of image": "Afbeelding URL",
"Name of the form select": "Naam van formulier select",
"name of the textarea": "Naam van tekst gebied",
"Width in number of characters": "Breedte in aantal tekens",
"Height in number of rows": "Hoogte in aantal tekens",
"Default text (optional)": "Standaard tekst (optioneel)",
"You must enter the form name": "Voer een formulier Naam in",
"You must enter a Name": "Voer een Naam in",
"Please enter a Label": "Voer een Label in"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/lang/nl.js | JavaScript | art | 3,158 |
// I18N constants
// LANG: "ja", ENCODING: UTF-8
{
"Form": "フォーム",
"Textarea": "テキストエリア",
"Selection Field": "選択肢フィールド",
"Checkbox": "チェックボックス",
"Radio Button": "ラジオボタン",
"Text Field": "テキストフィールド",
"Password Field": "パスワードフィールド",
"File Field": "ファイルフィールド",
"Submit Button": "送信ボタン",
"Reset Button": "リセットボタン",
"Image Button": "画像ボタン",
"Button": "ボタン",
"Hidden Field": "非表示フィールド",
"Label": "ラベル",
"Field Set": "フィールドセット",
"Form Element: INPUT": "フォーム要素: INPUT",
"Form Element: SELECT": "フォーム要素: SELECT",
"Form Element: TEXTAREA": "フォーム要素: TEXTAREA",
"Form Element: LABEL": "フォーム要素: LABEL",
"Form Element: FIELDSET": "フォーム要素: FIELDSET",
"Form Name:": "フォーム名:",
"Form handler script": "フォーム処理スクリプト",
"Action URL:": "アクションURL:",
"Method:": "メソッド:",
"Post": "POST",
"Get": "GET",
"Encoding:": "エンコード:",
"HTML-Form to CGI (default)": "HTMLフォームからCGIへ(デフォルト)",
"multipart Form Data (File-Upload)": "マルチパート(ファイルアップロード用)",
"Target Frame:": "ターゲット:",
"Name/ID:": "名前/ID:",
"Value:": "値:",
"Disabled": "無効",
"Checked": "チェック済み",
"Tab Index:": "タブ順序:",
"Access Key:": "アクセスキー:",
"Read Only": "読み取り専用",
"Dimensions": "大きさ",
"Size:": "サイズ:",
"Max length:": "最大長:",
"Button Script": "ボタンスクリプト",
"'onClick'=": "'onClick'=",
"Image source": "画像ソース",
"Image URL:": "画像URL:",
"Multiple Select": "複数選択",
"Options": "選択肢",
"Lable:": "ラベル:",
"Move Up": "上へ",
"Move Down": "下へ",
"Delete": "削除",
"Add": "追加",
"Columns:": "列数:",
"Rows:": "行数:",
"Wrap Mode:": "折り返し:",
"Off": "オフ",
"Soft": "ソフト",
"Hard": "ハード",
"Physical": "物理的",
"Virtual": "仮想",
"normal": "標準",
"nowrap": "折り返しなし",
"pre": "フォーマット済み",
"Initial Text:": "初期テキスト:",
"Text:": "テキスト:",
"For Control:": "制御対象:",
"Legend:": "グループ名:",
"Cancel": "中止",
"Name": "名前",
"Name of the form input": "フォーム入力の名前",
"Value of the form input": "フォーム入力の値",
"Size of text box in characters": "文字数によるテキストボックスの大きさ",
"Maximum number of characters accepted": "入力可能な最大文字数",
"Javascript for button click": "ボタンクリック時のJavaScritp",
"URL of image": "画像のURL",
"Name of the form select": "",
"name of the textarea": "テキストエリアの名前",
"Width in number of characters": "文字数による幅",
"Height in number of rows": "行数による高さ",
"Default text (optional)": "テキスト初期値(オプション)",
"You must enter the form name": "フォーム名が必要です",
"You must enter a Name": "名前が必要です",
"Please enter a Label": "ラベルを入力してください"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/lang/ja.js | JavaScript | art | 3,342 |
// I18N constants
// LANG: "pt_br", ENCODING: UTF-8
// Portuguese Brazilian Translation
// Author: Marcio Barbosa, <marcio@mpg.com.br>
// MSN: tomarshall@msn.com - ICQ: 69419933
// Site: http://www.mpg.com.br
// Last revision: 05 september 2007
// Please don´t remove this information
// If you modify any source, please insert a comment with your name and e-mail
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
{
"Access Key:": "Tecla de Acesso:",
"Action URL:": "Ação - URL:",
"Button Script": "Script de Botão",
"Cancel": "Cancelar",
"Checked": "Definido",
"Columns:": "Colunas:",
"Default text (optional)": "Texto padrão (opcional)",
"Dimensions": "Dimensões",
"Disabled": "Desativado",
"Encoding:": "Codificação:",
"For Control:": "Para Controle:",
"Form": "Formulário",
"Form Element: FIELDSET": "Elemento do formulário: FIELDSET",
"Form Element: INPUT": "Elemento do formulário: INPUT",
"Form Element: LABEL": "Elemento do formulário: LABEL",
"Form Element: SELECT": "Elemento do formulário: SELECT",
"Form Element: TEXTAREA": "Elemento do formulário: TEXTAREA",
"Form Name:": "Nome do Formulário:",
"Form handler script": "Script do Formulário",
"HTML-Form to CGI (default)": "Formulário para CGI (padrão)",
"Hard": "Difícil",
"Height in number of rows": "Altura em número de linhas",
"Image URL:": "URL da imagem:",
"Image source": "Imagem de Origem",
"Initial Text:": "Texto Inicial:",
"Insert/Edit Form": "Inserir/Editar Formulário",
"Insert/Edit Form Element FIELDSET": "Inserir/Editar Elemento FIELDSET",
"Insert/Edit Form Element INPUT": "Inserir/Editar Elemento INPUT",
"Insert/Edit Form Element LABEL": "Inserir/Editar Elemento LABEL",
"Insert/Edit Form Element SELECT": "Inserir/Editar Elemento SELECT",
"Insert/Edit Form Element TEXTAREA": "Inserir/Editar Elemento TEXTAREA",
"Javascript for button click": "Javascript para botão de clicar",
"Label:": "Etiqueta:",
"Legend:": "Legenda:",
"Max length:": "Comprimento Máx.:",
"Maximum number of characters accepted": "Máximo número de caracteres aceitos",
"Method:": "Método:",
"Name": "Nome",
"Name of the form input": "Nome do formulário de entrada",
"Name of the form select": "Nome do formulário de seleção",
"Name/ID:": "Nome/ID:",
"OK": "OK",
"Off": "Desligado",
"Options": "Opções",
"Physical": "Físico",
"Please enter a Label": "Por favor, entre uma Etiqueta",
"Post": "Post",
"Read Only": "Somente Leitura",
"Rows:": "Linhas:",
"Size of text box in characters": "Tamanho da caixa de texto em caracteres",
"Size:": "Tamanho:",
"Soft": "Fácil",
"Tab Index:": "Ordem de Tabulação:",
"Target Frame:": "Frame de destino:",
"Text:": "Texto:",
"URL of image": "URL da imagem",
"Value of the form input": "Valor do formulário de entrada",
"Value:": "Valor:",
"Virtual": "Virtual",
"Width in number of characters": "Largura em número de caracteres",
"Wrap Mode:": "Modo de quebras:",
"You must enter a Name": "Você precisa entrar com um Nome",
"multipart Form Data (File-Upload)": "Formulário de dados multipart (Enviar arquivo)",
"name of the textarea": "nome da área de texto",
"normal": "normal",
"nowrap": "sem quebras"
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/lang/pt_br.js | JavaScript | art | 3,338 |
form {
border: 1px dotted red;
}
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/forms.css | CSS | art | 38 |
// Form plugin for Xinha
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
function Forms(editor) {
this.editor = editor;
var cfg = editor.config;
var bl = Forms.btnList;
var self = this;
// register the toolbar buttons provided by this plugin
var toolbar = ["linebreak"];
for (var i = 0; i < bl.length; ++i) {
var btn = bl[i];
if (!btn) {
toolbar.push("separator");
} else {
var id = btn[0];
if (i<3)
cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false,
function(editor, id) {
// dispatch button press event
self.buttonPress(editor, id);
});
else
cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false,
function(editor, id) {
// dispatch button press event
self.buttonPress(editor, id);
},"form");
toolbar.push(id);
}
}
// add a new line in the toolbar
cfg.toolbar.push(toolbar);
}
Forms._pluginInfo = {
name : "Forms",
origin : "version: 1.0, by Nelson Bright, BrightWork, Inc., http://www.brightworkweb.com",
version : "2.0",
developer : "Udo Schmal",
developer_url : "",
sponsor : "L.N.Schaffrath NeueMedien",
sponsor_url : "http://www.schaffrath-neuemedien.de/",
c_owner : "Udo Schmal & Schaffrath-NeueMedien",
license : "htmlArea"
};
// the list of buttons added by this plugin
Forms.btnList = [
// form properties button
null, // separator
["form", "Form"],
null, // separator
// form elements
["textarea", "Textarea"],
["select", "Selection Field"],
["checkbox", "Checkbox"],
["radio", "Radio Button"],
["text", "Text Field"],
["password", "Password Field"],
["file", "File Field"],
["button", "Button"],
["submit", "Submit Button"],
["reset", "Reset Button"],
["image", "Image Button"],
["hidden", "Hidden Field"],
["label", "Label"],
["fieldset", "Field Set"]
];
Forms.prototype._lc = function(string) {
return Xinha._lc(string, 'Forms');
};
Forms.prototype.onGenerate = function() {
this.editor.addEditorStylesheet(Xinha.getPluginDir("Forms") + '/forms.css');
};
Forms.prototype.buttonPress = function(editor,button_id, node) {
function optionValues(text,value) {
this.text = text;
this.value = value;
}
var outparam = new Object();
var type = button_id;
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (button_id=="form") { //Form
// see if selection is inside an existing 'form' tag
var pe = editor.getParentElement();
var frm = null;
while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) {
if(pe.tagName.toLowerCase() == "form") {
frm = pe;
break;
} else
pe = pe.parentNode;
}
if (frm) {
outparam.f_name = frm.name;
outparam.f_action = frm.action;
outparam.f_method = frm.method;
outparam.f_enctype = frm.enctype;
outparam.f_target = frm.target;
} else {;
outparam.f_name = "";
outparam.f_action = "";
outparam.f_method = "";
outparam.f_enctype = "";
outparam.f_target = "";
}
editor._popupDialog("plugin://Forms/form", function(param) {
if (param) {
if(frm) {
frm.name = param["f_name"];
frm.setAttribute("action", param["f_action"]);
frm.setAttribute("method", param["f_method"]);
frm.setAttribute("enctype",param["f_enctype"]);
frm.setAttribute("target", param["f_target"]);
} else {
frm = '<form name="' + param["f_name"] + '"';
if (param["f_action"] != "") frm += ' action="' + param["f_action"] + '"';
if (param["f_method"] != "") frm += ' method="' + param["f_method"] + '"';
if (param["f_enctype"] != "") frm += ' enctype="' + param["f_enctype"] + '"';
if (param["f_target"] != "") frm += ' target="' + param["f_target"] + '"';
frm += '>';
editor.surroundHTML(frm, ' </form>');
}
}
}, outparam);
} else { // form element (checkbox, radio, text, password, textarea, select, button, submit, reset, image, hidden)
var tagName = "";
// see if selection is an form element
if (typeof node == "undefined") {
node = editor.getParentElement();
var tag = node.tagName.toLowerCase()
if (node && (tag == "legend")) {
node = node.parentElement;
tag = node.tagName.toLowerCase();
}
if (node && !(tag == "textarea" || tag == "select" || tag == "input" || tag == "label" || tag == "fieldset"))
node = null;
}
if(node) {
type = node.tagName.toLowerCase();
outparam.f_name = node.name;
tagName = node.tagName;
if (type == "input") {
outparam.f_type = node.type;
type = node.type;
}
switch (type) {
case "textarea":
outparam.f_cols = node.cols;
outparam.f_rows = node.rows;
outparam.f_text = node.innerHTML;
outparam.f_wrap = node.getAttribute("wrap");
outparam.f_readOnly = node.getAttribute("readOnly");
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "select":
outparam.f_size = parseInt(node.size);
outparam.f_multiple = node.getAttribute("multiple");
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
var a_options = new Array();
for (var i=0; i<=node.options.length-1; i++) {
a_options[i] = new optionValues(node.options[i].text, node.options[i].value);
}
outparam.f_options = a_options;
break;
case "text":
case "password":
outparam.f_value = node.value;
outparam.f_size = node.size;
outparam.f_maxLength = node.maxLength;
outparam.f_readOnly = node.getAttribute("readOnly");
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "hidden":
outparam.f_value = node.value;
break;
case "submit":
case "reset":
outparam.f_value = node.value;
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "checkbox":
case "radio":
outparam.f_value = node.value;
outparam.f_checked = node.checked;
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "button":
outparam.f_value = node.value;
outparam.f_onclick = node.getAttribute("onclick");
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "image":
outparam.f_value = node.value;
outparam.f_src = node.src;
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "file":
outparam.f_disabled = node.getAttribute("disabled");
outparam.f_tabindex = node.getAttribute("tabindex");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "label":
outparam.f_text = node.innerHTML;
outparam.f_for = node.getAttribute("for");
outparam.f_accesskey = node.getAttribute("accesskey");
break;
case "fieldset":
if(node.firstChild.tagName.toLowerCase()=="legend")
outparam.f_text = node.firstChild.innerHTML;
else
outparam.f_text = "";
break;
}
} else {
outparam.f_name = "";
switch (button_id) {
case "textarea":
case "select":
case "label":
case "fieldset":
tagName = button_id;
break;
default:
tagName = "input";
outparam.f_type = button_id;
break;
}
outparam.f_options = "";
outparam.f_cols = "20";
outparam.f_rows = "4";
outparam.f_multiple = "false";
outparam.f_value = "";
outparam.f_size = "";
outparam.f_maxLength = "";
outparam.f_checked = "";
outparam.f_src = "";
outparam.f_onclick = "";
outparam.f_wrap = "";
outparam.f_readOnly = "false";
outparam.f_disabled = "false";
outparam.f_tabindex = "";
outparam.f_accesskey = "";
outparam.f_for = "";
outparam.f_text = "";
outparam.f_legend = "";
}
editor._popupDialog("plugin://Forms/" + tagName + ".html", function(param) {
if (param) {
if(param["f_cols"])
if (isNaN(parseInt(param["f_cols"],10)) || parseInt(param["f_cols"],10) <= 0)
param["f_cols"] = "";
if(param["f_rows"])
if(isNaN(parseInt(param["f_rows"],10)) || parseInt(param["f_rows"],10) <= 0)
param["f_rows"] = "";
if(param["f_size"])
if(isNaN(parseInt(param["f_size"],10)) || parseInt(param["f_size"],10) <= 0)
param["f_size"] = "";
if(param["f_maxlength"])
if(isNaN(parseInt(param["f_maxLength"],10)) || parseInt(param["f_maxLength"],10) <= 0)
param["f_maxLength"] = "";
if(node) {
//prepare existing Element
for (field in param) {
//alert(field.substring(2,20) + '=' + param[field]); //to be silent! by htanaka
if ((field=="f_text") || (field=="f_options") || (field=="f_onclick") || (field=="f_checked"))continue;
if (param[field] != "")
node.setAttribute(field.substring(2,20), param[field]);
else
node.removeAttribute(field.substring(2,20));
}
if (type == "textarea") {
node.innerHTML = param["f_text"];
} else if(type == "select") {
node.options.length = 0;
var optionsList = param["f_options"];
for (i=0; i<= optionsList.length-1; i++) {
node.options[i] = new Option(optionsList[i].text, optionsList[i].value)
}
} else if(type == "label") {
node.innerHTML = param["f_text"];
} else if(type == "fieldset") {
if(outparam.f_text != "") {
if(node.firstChild.tagName.toLowerCase()=="legend")
node.firstChild.innerHTML = param["f_text"];
} else {}// not implemented jet
} else if((type == "checkbox") || (type == "radio")) { //input
if(param["f_checked"]!="")
node.checked = true;
else
node.checked = false;
} else {
if(param["f_onclick"]){
node.onclick = "";
if(param["f_onclick"]!="")
node.onclick = param["f_onclick"];
}
}
} else {
//create Element
var text = "";
for (field in param) {
if (!param[field]) continue;
if ((param[field]=="") || (field=="f_text")|| (field=="f_options"))continue;
text += " " + field.substring(2,20) + '="' + param[field] + '"';
}
if(type == "textarea") {
text = '<textarea' + text + '>' + param["f_text"] + '</textarea>';
} else if(type == "select") {
text = '<select' + text + '>';
var optionsList = param["f_options"];
for (i=0; i<= optionsList.length-1; i++) {
text += '<option value="'+optionsList[i].value+'">'+optionsList[i].text+'</option>';
}
text += '</select>';
} else if(type == "label") {
text = '<label' + text + '>' + param["f_text"] + '</label>';
} else if(type == "fieldset") {
text = '<fieldset' + text + '>';
if (param["f_legend"] != "") text += '<legend>' + param["f_text"] + '</legend>';
text += '</fieldset>';
} else {
text = '<input type="'+type+'"' + text + '>';
}
editor.insertHTML(text);
}
}
}, outparam);
}
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/Forms.js | JavaScript | art | 13,053 |
<html>
<head>
<title>Insert/Edit Form Element TEXTAREA</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var fields = ["f_name", "f_text", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readOnly", "f_disabled"];
function Init() {
__dlg_translate("Forms");
__dlg_init(null,{width:260, height:380});
var param = window.dialogArguments;
for (var i in fields) {
switch (fields[i]) {
case "f_readOnly":
case "f_disabled":
document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
default:
document.getElementById(fields[i]).value = param[fields[i]]; break;
}
}
document.getElementById("f_name").focus();
}
function onOK() {
var el = document.getElementById("f_name");
if (!el.value) {
alert(Xinha._lc("You must enter a Name","Forms"));
el.focus();
return false;
}
// pass data back to the calling window
var param = new Object();
for (var i in fields) {
switch (fields[i]) {
case "f_readOnly":
case "f_disabled":
if(Xinha.is_ie)
param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
else
param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
break;
default:
param[fields[i]] = document.getElementById(fields[i]).value; break;
}
}
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div id="f_type" class="title">Form Element: TEXTAREA</div>
<form action="" method="get">
<div class="fr">Name/ID:</div>
<input type="text" name="name" id="f_name" title="name of the textarea" />
<p />
<fieldset>
<legend>Dimensions</legend>
<div class="fr">Columns:</div>
<input type="text" name="cols" id="f_cols" size="5" title="Width in number of characters" />
<p />
<div class="fr">Rows:</div>
<input type="text" name="rows" id="f_rows" size="5" title="Height in number of rows" />
<p />
</fieldset>
<div class="space"></div>
<div class="fr">Wrap Mode:</div>
<select name="wrap" id="f_wrap">
<option value=""></option>
<option value="off">Off</option>
<option value="soft">Soft</option>
<option value="hard">Hard</option>
<option value="physical">Physical</option>
<option value="virtual">Virtual</option>
<option value="normal">normal</option>
<option value="nowrap">nowrap</option>
<option value="pre">pre</option>
</select>
<p />
<div class="fr">Read Only</div>
<input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
<p />
<div class="fr">Disabled</div>
<input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
<p />
<div class="fr">Tab Index:</div>
<input type="text" name="tabindex" id="f_tabindex" />
<p />
<div class="fr">Access Key:</div>
<input type="text" name="accesskey" id="f_accesskey" />
<p />
<div class="fr">Initial Text:</div>
<input type="text" name="text" id="f_text" title="Default text (optional)" />
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/textarea.html | HTML | art | 3,498 |
<html>
<head>
<title>Insert/Edit Form Element SELECT</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var fields = ["f_name", "f_size", "f_tabindex", "f_multiple", "f_disabled"];
function Init() {
__dlg_translate("Forms");
__dlg_init(null,{width:360, height:400});
var param = window.dialogArguments;
for (var i in fields) {
switch (fields[i]) {
case "f_multiple":
case "f_disabled":
document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
case "f_size":
document.getElementById(fields[i]).value = (param[fields[i]]<=0)?"":param[fields[i]]; break;
default:
document.getElementById(fields[i]).value = param[fields[i]]; break;
}
}
for (var i=0; i<=param.f_options.length-1; i++) {
document.getElementById("f_select").options[i] = new Option(param.f_options[i].text, param.f_options[i].value);
}
document.getElementById("f_name").focus();
}
function onOK() {
var el = document.getElementById("f_name");
if (!el.value) {
alert(Xinha._lc("You must enter a Name","Forms"));
el.focus();
return false;
}
// pass data back to the calling window
var param = new Object();
for (var i in fields) {
switch (fields[i]) {
case "f_multiple":
if (document.getElementById("f_size").value=="1")
param["f_multiple"] = "";
else
param["f_multiple"] = (document.getElementById(fields[i]).checked)?"multiple":"";
break;
case "f_disabled":
param[fields[i]] = (document.getElementById(fields[i]).checked)?"disabled":""; break;
default:
param[fields[i]] = document.getElementById(fields[i]).value; break;
}
}
function optionValues(text,value) {
this.text = text;
this.value = value;
}
optionNodes = new Array(); // for option text/value pairs
for (var i=0; i<= document.getElementById("f_select").options.length-1; i++) {
optionNodes[i] = new optionValues(document.getElementById("f_select").options[i].text, document.getElementById("f_select").options[i].value);
}
param["f_options"] = optionNodes;
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
//functions to build select options list
//Populates Label and Value fields with selected option values
function getValues(){
var d = document;
d.getElementById("f_optionvalue").value = d.getElementById("f_select").options[d.getElementById("f_select").selectedIndex].value;
d.getElementById("f_optiontext").value = d.getElementById("f_select").options[d.getElementById("f_select").selectedIndex].text;
d.getElementById("f_update").value ="Update Option";
}
//Add or update options to the select box
function addItem(item) {
var d = document;
if (item.f_optiontext.value =="") {alert(Xinha._lc("Please enter a Label","Forms"));}
else {
if (d.getElementById("f_select").options.selectedIndex != -1) { //update item
var indx = d.getElementById("f_select").options.selectedIndex;
d.getElementById("f_select").options[indx].text=d.getElementById("f_optiontext").value;
d.getElementById("f_select").options[indx].value=d.getElementById("f_optionvalue").value;
} else { //add new item
var newItem = d.getElementById("f_select").options.length++;
d.getElementById("f_select").options[newItem].text=d.getElementById("f_optiontext").value;
d.getElementById("f_select").options[newItem].value=d.getElementById("f_optionvalue").value;
}
d.getElementById("f_select").selectedIndex = -1; //deselect
d.getElementById("f_optiontext").value="";//clean up
d.getElementById("f_optionvalue").value="";
d.getElementById("f_update").value ="Add Option";
d.getElementById("f_optiontext").focus();
}
}
//Clears selected option
function deleteItem() {
var d = document;
for (var i = d.getElementById("f_select").options.length - 1; i>=0; i--) {
var opt = d.getElementById("f_select").options[i];
if (opt.selected) {
d.getElementById("f_select").options[i] = null;
}
}
d.getElementById("f_select").selectedIndex = -1;
d.getElementById("f_optiontext").value="";
d.getElementById("f_optionvalue").value="";
d.getElementById("f_optiontext").focus();
}
//Moves selected option up
function moveOptionUp() {
var d = document;
for (i=0; i<d.getElementById("f_select").options.length; i++) {
if (d.getElementById("f_select").options[i].selected) {
if (i != 0 && !d.getElementById("f_select").options[i-1].selected) {
swapOptions(d.getElementById("f_select"),i,i-1);
d.getElementById("f_select").options[i-1].selected = true;
}
}
}
}
//Moves selected option down
function moveOptionDown() {
var d = document;
for (i=d.getElementById("f_select").options.length-1; i>=0; i--) {
if (d.getElementById("f_select").options[i].selected) {
if (i != (d.getElementById("f_select").options.length-1) && ! d.getElementById("f_select").options[i+1].selected) {
swapOptions(d.getElementById("f_select"),i,i+1);
d.getElementById("f_select").options[i+1].selected = true;
}
}
}
}
function swapOptions(obj,i,j) {
var o = obj.options;
var i_selected = o[i].selected;
var j_selected = o[j].selected;
var temp = new Option(o[i].text, o[i].value);
var temp2= new Option(o[j].text, o[j].value);
o[i] = temp2;
o[j] = temp;
o[i].selected = j_selected;
o[j].selected = i_selected;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div id="f_type" class="title">Form Element: SELECT</div>
<form action="" method="get">
<div class="fr">Name/ID:</div>
<input type="text" name="name" id="f_name" title="Name of the form select" />
<p />
<div class="fr">Size:</div>
<input name="size" id="f_size" type="text" value="" size="15" />
<p />
<div class="fr"><nobr>Multiple Select</nobr></div>
<input name="multiple" id="f_multiple" type="checkbox" value="multiple" value="on" />
<p />
<div class="fr">Disabled</div>
<input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
<p />
<div class="fr">Tab Index:</div>
<input type="text" name="tabindex" id="f_tabindex" />
<p />
<div class="space"></div>
<fieldset id="fldLayout">
<legend>Options</legend>
<table border="0" cellspacing="0">
<tr>
<td style="text-align: right;">
<select name="select" id="f_select" Size="6" onchange="getValues();" style="width:16em">
</select>
</td>
<td style="text-align: center;">
<input type="button" name="up" value="Move Up" style="width:6em" onClick="moveOptionUp()"><br />
<input type="button" name="down" value="Move Down" style="width:6em" onClick="moveOptionDown()"><br />
<input type="button" name="delete" value="Delete" style="width:6em" onClick="deleteItem();">
</td>
</tr>
</table>
<div class="space"></div>
<table border="0" cellspacing="0">
<tr>
<td style="text-align: right;">Label:</td>
<td><input type="text" id="f_optiontext" name="optionText" value="" size="15"></td>
<td style="text-align: right;">Value:</td>
<td><input name="optionValue" id="f_optionvalue" type="text" value="" size="15"></td>
<td><input type="button" name="update" id="f_update" value="Add" onclick="addItem(document.forms[0])"></td>
</tr>
</table>
</fieldset>
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/select.html | HTML | art | 7,845 |
<html>
<head>
<title>Insert/Edit Form Element INPUT</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var fields = null;
var type;
function Init() {
__dlg_translate("Forms");
__dlg_init();
var param = window.dialogArguments;
type = param.f_type;
document.getElementById("f_type").innerHTML = Xinha._lc('Form Element: INPUT', "Forms") + '(' + type + ')';
document.getElementById("txt").style.display = "none";
document.getElementById("chk").style.display = "none";
document.getElementById("btn").style.display = "none";
document.getElementById("img").style.display = "none";
switch (type) {
case "text":
case "password":
fields = ["f_name", "f_value", "f_readOnly", "f_disabled", "f_tabindex", "f_accesskey", "f_size", "f_maxLength"];
height = 350;
document.getElementById("txt").style.display = "block";
break;
case "checkbox":
case "radio":
fields = ["f_name", "f_value", "f_checked", "f_disabled", "f_tabindex", "f_accesskey"];
document.getElementById("chk").style.display = "block";
height = 280;
break;
case "button":
fields = ["f_name", "f_value", "f_disabled", "f_onclick", "f_tabindex", "f_accesskey"];
document.getElementById("btn").style.display = "block";
height = 300;
break;
case "file":
fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey"];
document.getElementById("f_value").disabled = true;
height = 280;
break;
case "image":
fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey", "f_src"];
document.getElementById("img").style.display = "block";
document.getElementById("f_value").disabled = true;
height = 300;
break;
case "reset":
case "submit":
fields = ["f_name", "f_value", "f_disabled", "f_tabindex", "f_accesskey"];
height =260;
break;
case "hidden":
fields = ["f_name", "f_value"];
document.getElementById("f_disabled").disabled = true;
document.getElementById("f_tabindex").disabled = true;
document.getElementById("f_accesskey").disabled = true;
height =260;
break;
}
for (var i in fields) {
switch (fields[i]) {
case "f_readOnly":
case "f_disabled":
case "f_checked":
document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
default:
document.getElementById(fields[i]).value = param[fields[i]]; break;
}
}
window.resizeTo(320,height);
document.getElementById("f_name").focus();
}
function onOK() {
var el = document.getElementById("f_name");
if (!el.value) {
alert(Xinha._lc("You must enter a Name","Forms"));
el.focus();
return false;
}
// pass data back to the calling window
var param = new Object();
for (var i in fields) {
switch (fields[i]) {
case "f_readOnly":
case "f_disabled":
case "f_checked":
if(Xinha.is_ie)
param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
else
param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
break;
default:
param[fields[i]] = document.getElementById(fields[i]).value; break;
}
}
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div id="f_type" class="title"></div>
<form action="" method="get">
<div class="fr">Name/ID:</div>
<input type="text" name="name" id="f_name" title="Name of the form input" />
<p />
<div class="fr">Value:</div>
<input type="text" name="value" id="f_value" title="Value of the form input" />
<p />
<div class="fr">Disabled</div>
<input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
<p />
<div id="chk">
<div class="fr">Checked</div>
<input name="checked" id="f_checked" type="checkbox" value="on" />
<p />
</div>
<div class="fr">Tab Index:</div>
<input type="text" name="tabindex" id="f_tabindex" />
<p />
<div class="fr">Access Key:</div>
<input type="text" name="accesskey" id="f_accesskey" />
<p />
<div id="txt">
<div class="fr">Read Only</div>
<input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
<p />
<fieldset>
<legend>Dimensions</legend>
<div class="space"></div>
<div class="fr">Size:</div>
<input type="text" name="size" id="f_size" size="5" title="Size of text box in characters" />
<div class="space"></div>
<div class="fr">Max length:</div>
<input type="text" name="maxLength" id="f_maxLength" size="5" title="Maximum number of characters accepted" />
<div class="space"></div>
</fieldset>
</div>
<div id="btn">
<fieldset>
<legend> Button Script</legend>
<div class="space"></div>
<div class="fr">'onClick'=</div>
<input type="text" name="onClick" id="f_onclick" title="Javascript for button click" />
<div class="space"></div>
</fieldset>
</div>
<div id="img">
<fieldset>
<legend>Image source</legend>
<div class="space"></div>
<div class="fr">Image URL:</div>
<input type="text" name="src" id="f_src" title="URL of image" />
<div class="space"></div>
</fieldset>
</div>
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/input.html | HTML | art | 5,758 |
<html>
<head>
<title>Insert/Edit Form Element FIELDSET</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
function Init() {
__dlg_translate("Forms");
__dlg_init(null,{width:260, height:150});
var param = window.dialogArguments;
document.getElementById("f_text").value = param["f_text"];
document.getElementById("f_text").focus();
}
function onOK() {
// pass data back to the calling window
var param = new Object();
param["f_text"] = document.getElementById("f_text").value;
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div id="f_type" class="title">Form Element: FIELDSET</div>
<form action="" method="get">
<div class="fr">Legend:</div>
<input type="text" name="text" id="f_text" />
<p />
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/fieldset.html | HTML | art | 1,205 |
<html>
<head>
<title>Insert/Edit Form Element LABEL</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var fields = ["f_text","f_for","f_accesskey"];
function Init() {
__dlg_translate("Forms");
__dlg_init(null,{width:260, height:220});
var param = window.dialogArguments;
for (var i in fields) {
document.getElementById(fields[i]).value = param[fields[i]];
}
document.getElementById("f_text").focus();
}
function onOK() {
// pass data back to the calling window
// pass data back to the calling window
var param = new Object();
for (var i in fields) {
param[fields[i]] = document.getElementById(fields[i]).value;
}
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div id="f_type" class="title">Form Element: LABEL</div>
<form action="" method="get">
<div class="fr">Text:</div>
<input type="text" name="text" id="f_text" />
<p />
<div class="fr">For Control:</div>
<input type="text" name="for" id="f_for" />
<p />
<div class="fr">Access Key:</div>
<input type="text" name="accesskey" id="f_accesskey" />
<p />
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html> | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/label.html | HTML | art | 1,562 |
<html>
<head>
<title>Insert/Edit Form</title>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript" src="../../../popups/popup.js"></script>
<script type="text/javascript">
var fields = ["f_name", "f_action", "f_method", "f_enctype", "f_target"];
function Init() {
__dlg_translate("Forms");
__dlg_init(null,{width:360, height:280});
var param = window.dialogArguments;
for (var i in fields) {
document.getElementById(fields[i]).value = param[fields[i]];
}
document.getElementById("f_name").focus();
}
function onOK() {
var required = {
"f_name": "You must enter the form name"
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(Xinha._lc(required[i],"Forms"));
el.focus();
return false;
}
}
// pass data back to the calling window
var param = new Object();
for (var i in fields) {
param[fields[i]] = document.getElementById(fields[i]).value;
}
__dlg_close(param);
return false;
}
function onCancel() {
__dlg_close(null);
return false;
}
</script>
</head>
<body class="dialog" onload="Init()">
<div class="title">Form</div>
<form action="" method="get">
<div class="fr">Form Name:</div>
<input type="text" name="name" id="f_name" size="20" title="Name" />
<p />
<fieldset>
<legend>Form handler script</legend>
<div class="space"></div>
<div class="fr">Action URL:</div>
<input name="action" id="f_action" type="text" size="30">
<p />
<div class="fr">Method:</div>
<select name="f_method" id="f_method">
<option value=""></option>
<option value="post">Post</option>
<option value="get">Get</option>
</select>
<div class="space"></div>
<div class="fr">Encoding:</div>
<select name="enctype" id="f_enctype">
<option value=""></option>
<option value="application/x-www-form-urlencoded">HTML-Form to CGI (default)</option>
<option value="multipart/form-data">multipart Form Data (File-Upload)</option>
</select>
<p />
<div class="fr">Target Frame:</div>
<input name="target" id="f_target" type="text" size="30">
<p />
</fieldset>
<div id="buttons">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/Forms/popups/form.html | HTML | art | 2,378 |
// ListType Plugin for Xinha
// Toolbar Implementation by Mihai Bazon, http://dynarch.com/mishoo/
Xinha.loadStyle( 'ListType.css', 'ListType' );
function ListType( editor )
{
this.editor = editor;
var cfg = editor.config;
var self = this;
if ( cfg.ListType.mode == 'toolbar' )
{
var options = {};
options[Xinha._lc( "Decimal numbers", "ListType" )] = "decimal";
options[Xinha._lc( "Lower roman numbers", "ListType" )] = "lower-roman";
options[Xinha._lc( "Upper roman numbers", "ListType" )] = "upper-roman";
options[Xinha._lc( "Lower latin letters", "ListType" )] = "lower-alpha";
options[Xinha._lc( "Upper latin letters", "ListType" )] = "upper-alpha";
if (!Xinha.is_ie)
// IE doesn't support this property; even worse, it complains
// with a gross error message when we tried to select it,
// therefore let's hide it from the damn "browser".
options[Xinha._lc( "Lower greek letters", "ListType" )] = "lower-greek";
var obj =
{
id : "listtype",
tooltip : Xinha._lc( "Choose list style type (for ordered lists)", "ListType" ),
options : options,
action : function( editor ) { self.onSelect( editor, this ); },
refresh : function( editor ) { self.updateValue( editor, this ); },
context : "ol"
};
cfg.registerDropdown( obj );
cfg.addToolbarElement( "listtype", ["insertorderedlist","orderedlist"], 1 );
}
else
{
editor._ListType = editor.addPanel( 'right' );
Xinha.freeLater( editor, '_ListType' );
Xinha.addClass( editor._ListType, 'ListType' );
// hurm, ok it's pretty to use the background color for the whole panel,
// but should not it be set by default when creating the panel ?
Xinha.addClass( editor._ListType.parentNode, 'dialog' );
editor.notifyOn( 'modechange',
function(e,args)
{
if ( args.mode == 'text' ) editor.hidePanel( editor._ListType );
}
);
var elts_ul = ['disc', 'circle', 'square', 'none'];
var elts_ol = ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman', 'none'];
var divglobal = document.createElement( 'div' );
divglobal.style.height = '90px';
var div = document.createElement( 'div' );
this.divUL = div;
div.style.display = 'none';
for ( var i=0; i<elts_ul.length; i++ )
{
div.appendChild( this.createImage( elts_ul[i] ) );
}
divglobal.appendChild( div );
var div = document.createElement( 'div' );
this.divOL = div;
div.style.display = 'none';
for ( var i=0; i<elts_ol.length; i++ )
{
div.appendChild( this.createImage( elts_ol[i] ) );
}
divglobal.appendChild( div );
editor._ListType.appendChild( divglobal );
editor.hidePanel( editor._ListType );
}
}
Xinha.Config.prototype.ListType =
{
'mode': 'toolbar' // configuration mode : toolbar or panel
};
ListType._pluginInfo =
{
name : "ListType",
version : "2.1",
developer : "Laurent Vilday",
developer_url : "http://www.mokhet.com/",
c_owner : "Xinha community",
sponsor : "",
sponsor_url : "",
license : "HTMLArea"
};
ListType.prototype.onSelect = function( editor, combo )
{
var tbobj = editor._toolbarObjects[ combo.id ].element;
var parent = editor.getParentElement();
while (!/^ol$/i.test( parent.tagName ))
parent = parent.parentNode;
parent.style.listStyleType = tbobj.value;
};
ListType.prototype.updateValue = function( editor, combo )
{
var tbobj = editor._toolbarObjects[ combo.id ].element;
var parent = editor.getParentElement();
while ( parent && !/^ol$/i.test( parent.tagName ) )
parent = parent.parentNode;
if (!parent)
{
tbobj.selectedIndex = 0;
return;
}
var type = parent.style.listStyleType;
if (!type)
{
tbobj.selectedIndex = 0;
}
else
{
for ( var i = tbobj.firstChild; i; i = i.nextSibling )
{
i.selected = (type.indexOf(i.value) != -1);
}
}
};
ListType.prototype.onUpdateToolbar = function()
{
if ( this.editor.config.ListType.mode == 'toolbar' ) return ;
var parent = this.editor.getParentElement();
while ( parent && !/^[o|u]l$/i.test( parent.tagName ) )
parent = parent.parentNode;
if (parent && /^[o|u]l$/i.test( parent.tagName ) )
{
this.showPanel( parent );
}
else if (this.editor._ListType.style.display != 'none')
{
this.editor.hidePanel( this.editor._ListType );
}
};
ListType.prototype.createImage = function( listStyleType )
{
var self = this;
var editor = this.editor;
var a = document.createElement( 'a' );
a.href = 'javascript:void(0)';
Xinha._addClass( a, listStyleType );
Xinha._addEvent( a, "click", function ()
{
var parent = editor._ListType.currentListTypeParent;
parent.style.listStyleType = listStyleType;
self.showActive( parent );
return false;
}
);
return a;
};
ListType.prototype.showActive = function( parent )
{
var activeDiv = ( parent.tagName.toLowerCase() == 'ul' ) ? this.divUL : this.divOL;
this.divUL.style.display = 'none';
this.divOL.style.display = 'none';
activeDiv.style.display = 'block';
var defaultType = parent.style.listStyleType;
if ( '' == defaultType ) defaultType = ( parent.tagName.toLowerCase() == 'ul' )? 'disc':'decimal';
for ( var i=0; i<activeDiv.childNodes.length; i++ )
{
var elt = activeDiv.childNodes[i];
if ( Xinha._hasClass( elt, defaultType ) )
{
Xinha._addClass( elt, 'active' );
}
else
{
Xinha._removeClass( elt, 'active' );
}
}
};
ListType.prototype.showPanel = function( parent )
{
this.editor._ListType.currentListTypeParent = parent;
this.showActive(parent);
this.editor.showPanel( this.editor._ListType );
}; | zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ListType/ListType.js | JavaScript | art | 5,798 |
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: Mihai Bazon, http://dynarch.com/mishoo
{
"Decimal numbers": "Decimale nummers",
"Lower roman numbers": "Romeinse nummers klein",
"Upper roman numbers": "Romeinse nummers groot",
"Lower latin letters": "Latijnse letters klein",
"Upper latin letters": "Latijnse letters groot",
"Lower greek letters": "Griekse letters",
"Choose list style type (for ordered lists)": "Kies stijl type (voor ordered lists)"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/nl.js | JavaScript | art | 480 |
// I18N constants
// LANG: "de", ENCODING: UTF-8
// translated: Raimund Meyer xinha@ray-of-light.org
{
"Decimal numbers": "Zahlen",
"Lower roman numbers": "Römisch klein",
"Upper roman numbers": "Römisch groß",
"Lower latin letters": "Zeichen klein",
"Upper latin letters": "Zeichen groß",
"Lower greek letters": "Griechisch",
"Choose list style type (for ordered lists)": "Wählen Sie einen Typ für die Nummerierung aus"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/de.js | JavaScript | art | 444 |
// I18N constants
// LANG: "pl", ENCODING: UTF-8
// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio
{
"Decimal numbers": "Cyfry arabskie",
"Lower roman numbers": "Małe rzymskie",
"Upper roman numbers": "Duże rzymskie",
"Lower latin letters": "Małe litery",
"Upper latin letters": "Duże litery",
"Lower greek letters": "Małe litery greckie",
"Choose list style type (for ordered lists)": "Wybierz typ listy numerowanej"
};
| zzh-simple-hr | ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/pl.js | JavaScript | art | 477 |