(Experimental) Replace htmlarea with XINHA. Thanks to abdussamad!
This commit is contained in:
BIN
htmlarea/plugins/InsertAnchor/img/insert-anchor.gif
Executable file
BIN
htmlarea/plugins/InsertAnchor/img/insert-anchor.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 370 B |
BIN
htmlarea/plugins/InsertAnchor/img/placeholder.gif
Executable file
BIN
htmlarea/plugins/InsertAnchor/img/placeholder.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 834 B |
8
htmlarea/plugins/InsertAnchor/insert-anchor.css
Executable file
8
htmlarea/plugins/InsertAnchor/insert-anchor.css
Executable file
@@ -0,0 +1,8 @@
|
||||
a.anchor {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-image: url(img/insert-anchor.gif);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left top;
|
||||
border: 1px dotted blue;
|
||||
}
|
||||
84
htmlarea/plugins/InsertAnchor/insert-anchor.js
Normal file
84
htmlarea/plugins/InsertAnchor/insert-anchor.js
Normal file
@@ -0,0 +1,84 @@
|
||||
/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
|
||||
/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */
|
||||
/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertAnchor/insert-anchor.js */
|
||||
function InsertAnchor(_1){
|
||||
this.editor=_1;
|
||||
var _2=_1.config;
|
||||
var _3=this;
|
||||
this.placeholderImg="<img class=\"IA_placeholder\" src=\""+Xinha.getPluginDir("InsertAnchor")+"/img/placeholder.gif\" />";
|
||||
_2.registerButton({id:"insert-anchor",tooltip:this._lc("Insert Anchor"),image:_1.imgURL("insert-anchor.gif","InsertAnchor"),textMode:false,action:function(_4){
|
||||
_3.buttonPress(_4);
|
||||
}});
|
||||
_2.addToolbarElement("insert-anchor","createlink",1);
|
||||
}
|
||||
InsertAnchor._pluginInfo={name:"InsertAnchor",origin:"version: 1.0, by Andre Rabold, MR Printware GmbH, http://www.mr-printware.de",version:"2.0",developer:"Udo Schmal",developer_url:"http://www.schaffrath-neuemedien.de",c_owner:"Udo Schmal",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de",license:"htmlArea"};
|
||||
InsertAnchor.prototype._lc=function(_5){
|
||||
return Xinha._lc(_5,"InsertAnchor");
|
||||
};
|
||||
InsertAnchor.prototype.onGenerate=function(){
|
||||
this.editor.addEditorStylesheet(Xinha.getPluginDir("InsertAnchor")+"/insert-anchor.css");
|
||||
};
|
||||
InsertAnchor.prototype.inwardHtml=function(_6){
|
||||
_6=_6.replace(/(<a[^>]*class="anchor"[^>]*>)/g,"$1"+this.placeholderImg);
|
||||
return _6;
|
||||
};
|
||||
InsertAnchor.prototype.outwardHtml=function(_7){
|
||||
_7=_7.replace(/(<img[^>]*class="?IA_placeholder"?[^>]*>)/ig,"");
|
||||
return _7;
|
||||
};
|
||||
InsertAnchor.prototype.buttonPress=function(_8){
|
||||
var _9=null;
|
||||
var _a=_8.getSelectedHTML();
|
||||
var _b=_8._getSelection();
|
||||
var _c=_8._createRange(_b);
|
||||
var _d=this;
|
||||
var a=_8._activeElement(_b);
|
||||
if(!(a!=null&&a.tagName.toLowerCase()=="a")){
|
||||
a=_8._getFirstAncestor(_b,"a");
|
||||
}
|
||||
if(a!=null&&a.tagName.toLowerCase()=="a"){
|
||||
_9={name:a.id};
|
||||
}else{
|
||||
_9={name:""};
|
||||
}
|
||||
_8._popupDialog("plugin://InsertAnchor/insert_anchor",function(_f){
|
||||
if(_f){
|
||||
var _10=_f["name"];
|
||||
if(_10==""||_10==null){
|
||||
if(a){
|
||||
var _11=_d.outwardHtml(a.innerHTML);
|
||||
a.parentNode.removeChild(a);
|
||||
_8.insertHTML(_11);
|
||||
}
|
||||
return;
|
||||
}
|
||||
try{
|
||||
var doc=_8._doc;
|
||||
if(!a){
|
||||
a=doc.createElement("a");
|
||||
a.id=_10;
|
||||
a.name=_10;
|
||||
a.title=_10;
|
||||
a.className="anchor";
|
||||
a.innerHTML=_d.placeholderImg;
|
||||
if(_a){
|
||||
a.innerHTML+=_a;
|
||||
}
|
||||
if(Xinha.is_ie){
|
||||
_c.pasteHTML(a.outerHTML);
|
||||
}else{
|
||||
_8.insertNodeAtSelection(a);
|
||||
}
|
||||
}else{
|
||||
a.id=_10;
|
||||
a.name=_10;
|
||||
a.title=_10;
|
||||
a.className="anchor";
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
}
|
||||
},_9);
|
||||
};
|
||||
|
||||
8
htmlarea/plugins/InsertAnchor/lang/de.js
Normal file
8
htmlarea/plugins/InsertAnchor/lang/de.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// I18N constants
|
||||
// LANG: "de", ENCODING: UTF-8
|
||||
// translated: Raimund Meyer xinha@ray-of-light.org
|
||||
{
|
||||
"Insert Anchor": "Anker einfügen",
|
||||
"Anchor name": "Name (ID)",
|
||||
"Delete": "Löschen"
|
||||
};
|
||||
7
htmlarea/plugins/InsertAnchor/lang/fr.js
Normal file
7
htmlarea/plugins/InsertAnchor/lang/fr.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// I18N constants
|
||||
// LANG: "fr", ENCODING: UTF-8
|
||||
{
|
||||
"Insert Anchor": "Insérer une ancre",
|
||||
"Anchor name": "Nom de l'ancre",
|
||||
"Delete": "Supprimer"
|
||||
};
|
||||
7
htmlarea/plugins/InsertAnchor/lang/ja.js
Normal file
7
htmlarea/plugins/InsertAnchor/lang/ja.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// I18N constants
|
||||
// LANG: "ja", ENCODING: UTF-8
|
||||
{
|
||||
"Insert Anchor": "アンカーの挿入",
|
||||
"Anchor name": "アンカーの名前",
|
||||
"Delete": "削除"
|
||||
};
|
||||
7
htmlarea/plugins/InsertAnchor/lang/nb.js
Normal file
7
htmlarea/plugins/InsertAnchor/lang/nb.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// I18N constants
|
||||
// LANG: "nb", ENCODING: UTF-8
|
||||
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
|
||||
{
|
||||
"Insert Anchor": "Sett inn anker",
|
||||
"Anchor name": "Ankernavn (ID)"
|
||||
};
|
||||
8
htmlarea/plugins/InsertAnchor/lang/nl.js
Normal file
8
htmlarea/plugins/InsertAnchor/lang/nl.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// I18N constants
|
||||
// LANG: "de", ENCODING: UTF-8
|
||||
// translated: Raimund Meyer xinha@ray-of-light.org
|
||||
{
|
||||
"Insert Anchor": "Anker invoegen",
|
||||
"Anchor name": "Naam (ID)",
|
||||
"Delete": "Verwijderen"
|
||||
};
|
||||
8
htmlarea/plugins/InsertAnchor/lang/pl.js
Normal file
8
htmlarea/plugins/InsertAnchor/lang/pl.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// I18N constants
|
||||
// LANG: "pl", ENCODING: UTF-8
|
||||
// translated: Krzysztof Kotowicz koto@webworkers.pl
|
||||
{
|
||||
"Insert Anchor": "Wstaw kotwicę",
|
||||
"Anchor name": "Nazwa kotwicy",
|
||||
"Delete": "Usuń"
|
||||
};
|
||||
22
htmlarea/plugins/InsertAnchor/lang/pt_br.js
Normal file
22
htmlarea/plugins/InsertAnchor/lang/pt_br.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// 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 name": "Nome da âncora",
|
||||
"Cancel": "Cancelar",
|
||||
"Delete": "Deletar",
|
||||
"Insert Anchor": "Inserir Âncora",
|
||||
"OK": "OK"
|
||||
}
|
||||
59
htmlarea/plugins/InsertAnchor/popups/insert_anchor.html
Executable file
59
htmlarea/plugins/InsertAnchor/popups/insert_anchor.html
Executable file
@@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Anchor</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
|
||||
<script type="text/javascript" src="../../../popups/popup.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.resizeTo(400, 150);
|
||||
function Init() {
|
||||
__dlg_translate("InsertAnchor");
|
||||
__dlg_init();
|
||||
|
||||
var param = window.dialogArguments;
|
||||
if (param) {
|
||||
document.getElementById("name").value = param["name"];
|
||||
}
|
||||
document.getElementById("name").focus();
|
||||
}
|
||||
|
||||
function onOK() {
|
||||
// pass data back to the calling window
|
||||
var param = new Object();
|
||||
param["name"] = document.getElementById("name").value;
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
}
|
||||
|
||||
function onDelete() {
|
||||
// pass data back to the calling window
|
||||
var param = new Object();
|
||||
param["name"] = "";
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
__dlg_close(null);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="dialog" onload="Init()">
|
||||
<div class="title">Insert Anchor</div>
|
||||
<form>
|
||||
<table border="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="label">Anchor name</td>
|
||||
<td><input type="text" id="name" style="width: 100%" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="buttons">
|
||||
<button type="submit" name="ok" onclick="return onOK();">OK</button>
|
||||
<button type="button" name="delete" onclick="return onDelete();">Delete</button>
|
||||
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user