Upgrade to xinha svn head to fix issues with xinha editors not appearing in Firefox 1.5
This commit is contained in:
@@ -1,97 +1,97 @@
|
||||
function InsertAnchor(editor) {
|
||||
this.editor = editor;
|
||||
var cfg = editor.config;
|
||||
var self = this;
|
||||
|
||||
// register the toolbar buttons provided by this plugin
|
||||
cfg.registerButton({
|
||||
id : "insert-anchor",
|
||||
tooltip : this._lc("Insert Anchor"),
|
||||
image : editor.imgURL("insert-anchor.gif", "InsertAnchor"),
|
||||
textMode : false,
|
||||
action : function(editor) {
|
||||
self.buttonPress(editor);
|
||||
}
|
||||
});
|
||||
cfg.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(string) {
|
||||
return HTMLArea._lc(string, 'InsertAnchor');
|
||||
}
|
||||
|
||||
InsertAnchor.prototype.onGenerate = function() {
|
||||
var style_id = "IA-style"
|
||||
var style = this.editor._doc.getElementById(style_id);
|
||||
if (style == null) {
|
||||
style = this.editor._doc.createElement("link");
|
||||
style.id = style_id;
|
||||
style.rel = 'stylesheet';
|
||||
style.href = _editor_url + 'plugins/InsertAnchor/insert-anchor.css';
|
||||
this.editor._doc.getElementsByTagName("HEAD")[0].appendChild(style);
|
||||
}
|
||||
}
|
||||
|
||||
InsertAnchor.prototype.buttonPress = function(editor) {
|
||||
var outparam = null;
|
||||
var html = editor.getSelectedHTML();
|
||||
var sel = editor._getSelection();
|
||||
var range = editor._createRange(sel);
|
||||
var a = editor._activeElement(sel);
|
||||
if(!(a != null && a.tagName.toLowerCase() == 'a')) {
|
||||
a = editor._getFirstAncestor(sel, 'a');
|
||||
}
|
||||
if (a != null && a.tagName.toLowerCase() == 'a')
|
||||
outparam = { name : a.id };
|
||||
else
|
||||
outparam = { name : '' };
|
||||
|
||||
editor._popupDialog( "plugin://InsertAnchor/insert_anchor", function( param ) {
|
||||
if ( param ) {
|
||||
var anchor = param["name"];
|
||||
if (anchor == "" || anchor == null) {
|
||||
if (a) {
|
||||
var child = a.innerHTML;
|
||||
a.parentNode.removeChild(a);
|
||||
editor.insertHTML(child);
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var doc = editor._doc;
|
||||
if (!a) {
|
||||
// editor.surroundHTML('<a id="' + anchor + '" name="' + anchor + '" title="' + anchor + '" class="anchor">', '</a>');
|
||||
a = doc.createElement("a");
|
||||
a.id = anchor;
|
||||
a.name = anchor;
|
||||
a.title = anchor;
|
||||
a.className = "anchor";
|
||||
a.innerHTML = html;
|
||||
if (HTMLArea.is_ie) {
|
||||
range.pasteHTML(a.outerHTML);
|
||||
} else {
|
||||
editor.insertNodeAtSelection(a);
|
||||
}
|
||||
} else {
|
||||
a.id = anchor;
|
||||
a.name = anchor;
|
||||
a.title = anchor;
|
||||
a.className = "anchor";
|
||||
}
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
}, outparam);
|
||||
}
|
||||
function InsertAnchor(editor) {
|
||||
this.editor = editor;
|
||||
var cfg = editor.config;
|
||||
var self = this;
|
||||
|
||||
// register the toolbar buttons provided by this plugin
|
||||
cfg.registerButton({
|
||||
id : "insert-anchor",
|
||||
tooltip : this._lc("Insert Anchor"),
|
||||
image : editor.imgURL("insert-anchor.gif", "InsertAnchor"),
|
||||
textMode : false,
|
||||
action : function(editor) {
|
||||
self.buttonPress(editor);
|
||||
}
|
||||
});
|
||||
cfg.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(string) {
|
||||
return HTMLArea._lc(string, 'InsertAnchor');
|
||||
};
|
||||
|
||||
InsertAnchor.prototype.onGenerate = function() {
|
||||
var style_id = "IA-style";
|
||||
var style = this.editor._doc.getElementById(style_id);
|
||||
if (style == null) {
|
||||
style = this.editor._doc.createElement("link");
|
||||
style.id = style_id;
|
||||
style.rel = 'stylesheet';
|
||||
style.href = _editor_url + 'plugins/InsertAnchor/insert-anchor.css';
|
||||
this.editor._doc.getElementsByTagName("HEAD")[0].appendChild(style);
|
||||
}
|
||||
};
|
||||
|
||||
InsertAnchor.prototype.buttonPress = function(editor) {
|
||||
var outparam = null;
|
||||
var html = editor.getSelectedHTML();
|
||||
var sel = editor._getSelection();
|
||||
var range = editor._createRange(sel);
|
||||
var a = editor._activeElement(sel);
|
||||
if(!(a != null && a.tagName.toLowerCase() == 'a')) {
|
||||
a = editor._getFirstAncestor(sel, 'a');
|
||||
}
|
||||
if (a != null && a.tagName.toLowerCase() == 'a')
|
||||
outparam = { name : a.id };
|
||||
else
|
||||
outparam = { name : '' };
|
||||
|
||||
editor._popupDialog( "plugin://InsertAnchor/insert_anchor", function( param ) {
|
||||
if ( param ) {
|
||||
var anchor = param["name"];
|
||||
if (anchor == "" || anchor == null) {
|
||||
if (a) {
|
||||
var child = a.innerHTML;
|
||||
a.parentNode.removeChild(a);
|
||||
editor.insertHTML(child);
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var doc = editor._doc;
|
||||
if (!a) {
|
||||
// editor.surroundHTML('<a id="' + anchor + '" name="' + anchor + '" title="' + anchor + '" class="anchor">', '</a>');
|
||||
a = doc.createElement("a");
|
||||
a.id = anchor;
|
||||
a.name = anchor;
|
||||
a.title = anchor;
|
||||
a.className = "anchor";
|
||||
a.innerHTML = html;
|
||||
if (HTMLArea.is_ie) {
|
||||
range.pasteHTML(a.outerHTML);
|
||||
} else {
|
||||
editor.insertNodeAtSelection(a);
|
||||
}
|
||||
} else {
|
||||
a.id = anchor;
|
||||
a.name = anchor;
|
||||
a.title = anchor;
|
||||
a.className = "anchor";
|
||||
}
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
}, outparam);
|
||||
};
|
||||
|
||||
@@ -1,10 +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"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
"Insert Anchor": "Insérer une ancre",
|
||||
"Anchor name": "Nom de l'ancre",
|
||||
"Delete": "Supprimer"
|
||||
}
|
||||
};
|
||||
@@ -1,8 +1,7 @@
|
||||
// I18N constants
|
||||
// LANG: "no", ENCODING: UTF-8
|
||||
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
|
||||
|
||||
{
|
||||
"Insert Anchor": "Sett inn anker",
|
||||
"Anchor name": "Anker navn (ID)"
|
||||
}
|
||||
};
|
||||
8
xinha/plugins/InsertAnchor/lang/pl.js
Normal file
8
xinha/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ń"
|
||||
};
|
||||
@@ -4,18 +4,17 @@
|
||||
<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(300, 150);
|
||||
|
||||
function Init() {
|
||||
__dlg_translate("InsertAnchor");
|
||||
__dlg_init();
|
||||
window.resizeTo(400, 180);
|
||||
window.resizeTo(400, 150);
|
||||
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
|
||||
@@ -23,7 +22,7 @@ function onOK() {
|
||||
param["name"] = document.getElementById("name").value;
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function onDelete() {
|
||||
// pass data back to the calling window
|
||||
@@ -31,12 +30,12 @@ function onDelete() {
|
||||
param["name"] = "";
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
__dlg_close(null);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user