Add htmlarea http://www.htmlarea.com/ tool to appdb
This commit is contained in:
70
htmlarea/plugins/CharacterMap/character-map.js
Normal file
70
htmlarea/plugins/CharacterMap/character-map.js
Normal file
@@ -0,0 +1,70 @@
|
||||
// Character Map plugin for HTMLArea
|
||||
// Sponsored by http://www.systemconcept.de
|
||||
// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/)
|
||||
// Original Author - Bernhard Pfeifer novocaine@gmx.net
|
||||
//
|
||||
// (c) systemconcept.de 2004
|
||||
// Distributed under the same terms as HTMLArea itself.
|
||||
// This notice MUST stay intact for use (see license.txt).
|
||||
|
||||
function CharacterMap(editor) {
|
||||
this.editor = editor;
|
||||
|
||||
var cfg = editor.config;
|
||||
var toolbar = cfg.toolbar;
|
||||
var self = this;
|
||||
var i18n = CharacterMap.I18N;
|
||||
|
||||
cfg.registerButton({
|
||||
id : "insertcharacter",
|
||||
tooltip : i18n["CharacterMapTooltip"],
|
||||
image : editor.imgURL("ed_charmap.gif", "CharacterMap"),
|
||||
textMode : false,
|
||||
action : function(editor) {
|
||||
self.buttonPress(editor);
|
||||
}
|
||||
})
|
||||
|
||||
var a, i, j, found = false;
|
||||
for (i = 0; !found && i < toolbar.length; ++i) {
|
||||
a = toolbar[i];
|
||||
for (j = 0; j < a.length; ++j) {
|
||||
if (a[j] == "inserthorizontalrule") {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
a.splice(j, 0, "insertcharacter");
|
||||
else{
|
||||
toolbar[1].splice(0, 0, "separator");
|
||||
toolbar[1].splice(0, 0, "insertcharacter");
|
||||
}
|
||||
};
|
||||
|
||||
CharacterMap._pluginInfo = {
|
||||
name : "CharacterMap",
|
||||
version : "1.0",
|
||||
developer : "Holger Hees & Bernhard Pfeifer",
|
||||
developer_url : "http://www.systemconcept.de/",
|
||||
c_owner : "Holger Hees & Bernhard Pfeifer",
|
||||
sponsor : "System Concept GmbH & Bernhard Pfeifer",
|
||||
sponsor_url : "http://www.systemconcept.de/",
|
||||
license : "htmlArea"
|
||||
};
|
||||
|
||||
CharacterMap.prototype.buttonPress = function(editor) {
|
||||
editor._popupDialog( "plugin://CharacterMap/select_character", function( entity )
|
||||
{
|
||||
if ( !entity )
|
||||
{
|
||||
//user must have pressed Cancel
|
||||
return false;
|
||||
}
|
||||
|
||||
editor.insertHTML( entity );
|
||||
|
||||
}, null);
|
||||
}
|
||||
|
||||
BIN
htmlarea/plugins/CharacterMap/img/ed_charmap.gif
Normal file
BIN
htmlarea/plugins/CharacterMap/img/ed_charmap.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 B |
16
htmlarea/plugins/CharacterMap/lang/de.js
Normal file
16
htmlarea/plugins/CharacterMap/lang/de.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// I18N constants
|
||||
|
||||
// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
|
||||
// Sponsored by http://www.systemconcept.de
|
||||
// Author: Holger Hees, <hhees@systemconcept.de>
|
||||
//
|
||||
// (c) systemconcept.de 2004
|
||||
// Distributed under the same terms as HTMLArea itself.
|
||||
// This notice MUST stay intact for use (see license.txt).
|
||||
|
||||
CharacterMap.I18N = {
|
||||
"CharacterMapTooltip" : "Sonderzeichen einf<6E>gen",
|
||||
"Insert special character" : "Sonderzeichen einf<6E>gen",
|
||||
"HTML value:" : "HTML Wert:",
|
||||
"Cancel" : "Abbrechen"
|
||||
};
|
||||
16
htmlarea/plugins/CharacterMap/lang/en.js
Normal file
16
htmlarea/plugins/CharacterMap/lang/en.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// I18N constants
|
||||
|
||||
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
|
||||
// Sponsored by http://www.systemconcept.de
|
||||
// Author: Holger Hees, <hhees@systemconcept.de>
|
||||
//
|
||||
// (c) systemconcept.de 2004
|
||||
// Distributed under the same terms as HTMLArea itself.
|
||||
// This notice MUST stay intact for use (see license.txt).
|
||||
|
||||
CharacterMap.I18N = {
|
||||
"CharacterMapTooltip" : "Insert special character",
|
||||
"Insert special character" : "Insert special character",
|
||||
"HTML value:" : "HTML value:",
|
||||
"Cancel" : "Cancel"
|
||||
};
|
||||
251
htmlarea/plugins/CharacterMap/popups/select_character.html
Normal file
251
htmlarea/plugins/CharacterMap/popups/select_character.html
Normal file
@@ -0,0 +1,251 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title>Insert special character</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
@import url(../../../htmlarea.css);
|
||||
|
||||
td.character {
|
||||
|
||||
font-family: Verdana,Arial,Helvetica,sans-serif;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
font-weight: bold;
|
||||
|
||||
text-align: center;
|
||||
|
||||
background: #FFF;
|
||||
|
||||
padding: 4px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
td.character-hilite {
|
||||
|
||||
background: Highlight;
|
||||
|
||||
color: HighlightText;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
html, body {
|
||||
|
||||
background: ButtonFace;
|
||||
|
||||
color: ButtonText;
|
||||
|
||||
font: 11px Tahoma,Verdana,sans-serif;
|
||||
|
||||
margin: 0px;
|
||||
|
||||
padding: 0px;
|
||||
|
||||
}
|
||||
|
||||
body { padding: 5px; }
|
||||
|
||||
table {
|
||||
|
||||
font: 11px Tahoma,Verdana,sans-serif;
|
||||
|
||||
}
|
||||
|
||||
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
|
||||
|
||||
button { width: 70px; }
|
||||
|
||||
table .label { text-align: right; width: 8em; }
|
||||
|
||||
|
||||
|
||||
.title { background: none; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
|
||||
|
||||
border-bottom: 1px solid black; letter-spacing: 2px;
|
||||
|
||||
}
|
||||
|
||||
#buttons {
|
||||
|
||||
margin-top: 1em; border-top: 1px solid #999;
|
||||
|
||||
padding: 2px; text-align: right;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="../../../popups/popup.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
|
||||
|
||||
// Original Author - Bernhard Pfeifer novocaine@gmx.net
|
||||
|
||||
|
||||
|
||||
CharacterMap = window.opener.CharacterMap; // load the CharacterMap plugin and lang file ;-)
|
||||
|
||||
window.resizeTo(480, 300);
|
||||
|
||||
// center on parent
|
||||
|
||||
var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
|
||||
|
||||
var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
|
||||
|
||||
window.moveTo(x, y);
|
||||
|
||||
|
||||
|
||||
function _CloseOnEsc()
|
||||
|
||||
{
|
||||
|
||||
if ( event.keyCode == 27 )
|
||||
|
||||
{
|
||||
|
||||
window.close();
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Init() // run on page load
|
||||
|
||||
{
|
||||
|
||||
__dlg_translate(CharacterMap.I18N);
|
||||
|
||||
__dlg_init();
|
||||
|
||||
document.body.onkeypress = _CloseOnEsc;
|
||||
|
||||
|
||||
|
||||
var character = ''; // set default input to empty
|
||||
|
||||
View( null, character );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var oldView = null;
|
||||
|
||||
function View( td, character ) // preview character
|
||||
|
||||
{
|
||||
|
||||
if (oldView)
|
||||
|
||||
oldView.className = oldView.className.replace(/\s+character-hilite/, '');
|
||||
|
||||
document.getElementById( 'characterPreview' ).value = character;
|
||||
|
||||
document.getElementById( 'showCharacter' ).value = character;
|
||||
|
||||
if (td)
|
||||
|
||||
(oldView = td).className += " 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 style="background: Buttonface; margin: 0px; padding: 0px" onload="Init();self.focus();">
|
||||
|
||||
<form method="get" style="margin:2px; padding:2px" onSubmit="Set(document.getElementById('showCharacter').value); return false;">
|
||||
|
||||
<table border="0" cellspacing="0" cellpadding="4" width="100%">
|
||||
|
||||
<tr>
|
||||
|
||||
<td style="background: Buttonface" valign="center"><div style="padding: 1px; white-space: nowrap; font-family: tahoma,arial,sans-serif; font-size: 11px; font-weight: normal;">HTML value:<div id="characterPreview"></div></div></td>
|
||||
|
||||
<td style="background: Buttonface" valign="center"><input type="text" name="showcharacter" id="showCharacter" value="" size="15" style="background: #fff; font-size: 11px;" /></td>
|
||||
|
||||
<td style="background: Buttonface" width="100%"></td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="0" width="100%" style="cursor: pointer; background: #ADAD9C; border: 1px inset;">
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user