Second pass at adding key files

This commit is contained in:
dsainty
2024-06-17 22:24:05 +10:00
parent aa25e9347f
commit b6fc94ff0f
923 changed files with 243184 additions and 0 deletions

View File

@ -0,0 +1,131 @@
.body_content {
font-family : <%if advanced_editor_font%><%advanced_editor_font%><%else%>Verdana, Arial, Helvetica, sans-serif<%endif%>;
font-size: <%if is_ie%>x-<%endif%>small;
color : #000000;
background-color: <%if advanced_editor_background%><%advanced_editor_background%><%else%>#FFFFFF<%endif%>;
cursor: default;
}
.html_content {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color : #000000;
background-color: #FFFFFF;
cursor: default;
visibility: hidden;
border: 0px;
width: 0px;
height: 0px;
padding: 5px;
}
.bar {
position : absolute;
background-color : <%if editor_base_color%><%editor_base_color%><%else%>#CCCCCC<%endif%>;
border-bottom : buttonshadow solid 1px;
border-left : buttonhighlight solid 1px;
border-right : buttonshadow solid 1px;
border-top : buttonhighlight solid 1px;
height : 25px;
top : 0px;
left : 0px;
}
.toolbar {
position : relative;
background-color : <%if editor_base_color%><%editor_base_color%><%else%>#CCCCCC<%endif%>;
border-bottom : 0px;
border-left : 0px;
border-right : 0px;
border-top : 0px;
height : 25px;
top : 0px;
left : 0px;
}
.menu {
position : absolute;
background-color : <%if editor_base_color%><%editor_base_color%><%else%>#CCCCCC<%endif%>;
border-bottom : buttonshadow solid 1px;
border-left : buttonhighlight solid 1px;
border-right : buttonshadow solid 1px;
border-top : buttonhighlight solid 1px;
height : 25px;
top : 0px;
left : 0px;
visibility : hidden;
}
.tb_icon {
position : absolute;
left : -1px;
top : -1px;
}
.icon_down {
position : absolute;
left : 0px;
top : 0px;
}
.icon_downpressed {
position : absolute;
left : 1px;
top : 1px;
}
.tb_menu_item {
position : absolute;
border-bottom : <%editor_base_color%> solid 1px;
border-left : <%editor_base_color%> solid 1px;
border-right : <%editor_base_color%> solid 1px;
border-top : <%editor_base_color%> solid 1px;
top : 1px;
height : 22px;
width : 23px;
}
.menu_item_mouseoverup {
position : absolute;
border-bottom : buttonshadow solid 1px;
border-left : buttonhighlight solid 1px;
border-right : buttonshadow solid 1px;
border-top : buttonhighlight solid 1px;
top : 1px;
height : 22px;
width : 23px;
}
.menu_item_mouseoverdown {
position : absolute;
border-bottom : buttonhighlight solid 1px;
border-left : buttonshadow solid 1px;
border-right : buttonhighlight solid 1px;
border-top : buttonshadow solid 1px;
top : 1px;
height : 22px;
width : 23px;
}
.menu_item_down {
position : absolute;
background-color : gainsboro;
border-bottom : buttonhighlight solid 1px;
border-left : buttonshadow solid 1px;
border-right : buttonhighlight solid 1px;
border-top : buttonshadow solid 1px;
top : 1px;
height : 22px;
width : 23px;
}
.tb_sep {
position : absolute;
border-left : buttonshadow solid 1px;
border-right : buttonhighlight solid 1px;
font-size : 0px;
top : 1px;
height : 22px;
width : 0px;
}

View File

@ -0,0 +1,89 @@
<html>
<head><title>Button</title>
<style><%include editor_dialog.css%></style>
<script>
var name, value, initial, tab;
function initDialog() {
name = document.getElementById('name');
value = document.getElementById('value');
tab = document.getElementById('tab');
type = document.getElementById('type');
}
function done () {
/* ---------------------------------------------------------
* When the user hits done this fucntion is called to
* produce the html from the div tags. It then inserts
* it into the edit window and closes this window.
*/
var html = '<input';
if (name.value)
html += ' name="' + name.value + '"';
if (value.value)
html += ' value="' + value.value + '"';
if (tab.value)
html += ' tabindex="' + tab.value + '"';
html += ' type=';
if (type.value == 2) {
html += '"reset"';
}
else if (type.value == 1) {
html += '"submit"';
}
else {
html += '"button"';
}
html += '>';
opener.dialogWindow.editor.returnForm(html);
window.close();
}
function check_type (title, val) {
/* ---------------------------------------------------------
* When the type radio is changed this is called to see if
* the value in the Value/label field should be changed.
*/
value.value = title;
type.value = val
}
</script>
<body class=body onload="initDialog()">
<table border=0 cellpadding=3 align=center>
<tr class="td">
<td>Name:</td><td><input id=name size=30></input></td>
</tr>
<tr class="td">
<td>Value/label:</td><td><input id=value size=30 value="Button"></input></td>
</tr>
<tr class="td">
<td>Button type:</td>
<td>
<table border=0>
<tr class="td">
<td>
<input type=radio id=type name=type onclick="check_type('Button', '0');" value="0" checked> Normal
</td>
<td>
<input type=radio id=type name=type onclick="check_type('Submit', '1');" value="1"> Submit
</td>
<td>
<input type=radio id=type name=type onclick="check_type('Reset', '2');" value="2"> Reset
</td>
</tr>
</table>
</td>
</tr>
<tr class="td">
<td>Tab order:</td><td><input id=tab size=3></td>
</tr>
</table>
<hr>
<div align=right>
<button class=button onclick="done();">OK</button> &nbsp;
<button class=button onclick="window.close();">Cancel</button>&nbsp;
</div>
</body>
</html>

View File

@ -0,0 +1,409 @@
<html>
<head>
<title>Color</title>
<style>
<%include editor_dialog.css%>
.colorcell { width: 21px; height: 20px; font-size: 2px };
</style>
<script>
var colormap = {
'aliceblue' : '#F0F8FF',
'antiquewhite' : '#FAEBD7',
'aqua' : '#00FFFF',
'aquamarine' : '#7FFFD4',
'azure' : '#F0FFFF',
'beige' : '#F5F5DC',
'bisque' : '#FFE4C4',
'black' : '#000000',
'blanchedalmond' : '#FFEBCD',
'blue' : '#0000FF',
'blueviolet' : '#8A2BE2',
'brown' : '#A52A2A',
'burlywood' : '#DEB887',
'cadetblue' : '#5F9EA0',
'chartreuse' : '#7FFF00',
'chocolate' : '#D2691E',
'coral' : '#FF7F50',
'cornflowerblue' : '#6495ED',
'cornsilk' : '#FFF8DC',
'crimson' : '#DC143C',
'cyan' : '#00FFFF',
'darkblue' : '#00008B',
'darkcyan' : '#008B8B',
'darkgoldenrod' : '#B8860B',
'darkgray' : '#A9A9A9',
'darkgreen' : '#006400',
'darkkhaki' : '#BDB76B',
'darkmagenta' : '#8B008B',
'darkolivegreen' : '#556B2F',
'darkorange' : '#FF8C00',
'darkorchid' : '#9932CC',
'darkred' : '#8B0000',
'darksalmon' : '#E9967A',
'darkseagreen' : '#8FBC8F',
'darkslateblue' : '#483D8B',
'darkslategray' : '#2F4F4F',
'darkturquoise' : '#00CED1',
'darkviolet' : '#9400D3',
'deeppink' : '#FF1493',
'deepskyblue' : '#00BFFF',
'dimgray' : '#696969',
'dodgerblue' : '#1E90FF',
'firebrick' : '#B22222',
'floralwhite' : '#FFFAF0',
'forestgreen' : '#228B22',
'fuchsia' : '#FF00FF',
'gainsboro' : '#DCDCDC',
'ghostwhite' : '#F8F8FF',
'gold' : '#FFD700',
'goldenrod' : '#DAA520',
'gray' : '#808080',
'green' : '#008000',
'greenyellow' : '#ADFF2F',
'honeydew' : '#F0FFF0',
'hotpink' : '#FF69B4',
'indianred' : '#CD5C5C',
'indigo' : '#4B0082',
'ivory' : '#FFFFF0',
'khaki' : '#F0E68C',
'lavender' : '#E6E6FA',
'lavenderblush' : '#FFF0F5',
'lawngreen' : '#7CFC00',
'lemonchiffon' : '#FFFACD',
'lightblue' : '#ADD8E6',
'lightcoral' : '#F08080',
'lightcyan' : '#E0FFFF',
'lightgoldenrodyellow' : '#FAFAD2',
'lightgreen' : '#90EE90',
'lightgrey' : '#D3D3D3',
'lightpink' : '#FFB6C1',
'lightsalmon' : '#FFA07A',
'lightseagreen' : '#20B2AA',
'lightskyblue' : '#87CEFA',
'lightslategray' : '#778899',
'lightsteelblue' : '#B0C4DE',
'lightyellow' : '#FFFFE0',
'lime' : '#00FF00',
'limegreen' : '#32CD32',
'linen' : '#FAF0E6',
'magenta' : '#FF00FF',
'maroon' : '#800000',
'mediumaquamarine' : '#66CDAA',
'mediumblue' : '#0000CD',
'mediumorchid' : '#BA55D3',
'mediumpurple' : '#9370DB',
'mediumseagreen' : '#3CB371',
'mediumslateblue' : '#7B68EE',
'mediumspringgreen' : '#00FA9A',
'mediumturquoise' : '#48D1CC',
'mediumvioletred' : '#C71585',
'midnightblue' : '#191970',
'mintcream' : '#F5FFFA',
'mistyrose' : '#FFE4E1',
'moccasin' : '#FFE4B5',
'navajowhite' : '#FFDEAD',
'navy' : '#000080',
'oldlace' : '#FDF5E6',
'olive' : '#808000',
'olivedrab' : '#6B8E23',
'orange' : '#FFA500',
'orangered' : '#FF4500',
'orchid' : '#DA70D6',
'palegoldenrod' : '#EEE8AA',
'palegreen' : '#98FB98',
'paleturquoise' : '#AFEEEE',
'palevioletred' : '#DB7093',
'papayawhip' : '#FFEFD5',
'peachpuff' : '#FFDAB9',
'peru' : '#CD853F',
'pink' : '#FFC0CB',
'plum' : '#DDA0DD',
'powderblue' : '#B0E0E6',
'purple' : '#800080',
'red' : '#FF0000',
'rosybrown' : '#BC8F8F',
'royalblue' : '#4169E1',
'saddlebrown' : '#8B4513',
'salmon' : '#FA8072',
'sandybrown' : '#F4A460',
'seagreen' : '#2E8B57',
'seashell' : '#FFF5EE',
'sienna' : '#A0522D',
'silver' : '#C0C0C0',
'skyblue' : '#87CEEB',
'slateblue' : '#6A5ACD',
'slategray' : '#708090',
'snow' : '#FFFAFA',
'springgreen' : '#00FF7F',
'steelblue' : '#4682B4',
'tan' : '#D2B48C',
'teal' : '#008080',
'thistle' : '#D8BFD8',
'tomato' : '#FF6347',
'turquoise' : '#40E0D0',
'violet' : '#EE82EE',
'wheat' : '#F5DEB3',
'white' : '#FFFFFF',
'whitesmoke' : '#F5F5F5',
'yellow' : '#FFFF00',
'yellowgreen' : '#9ACD32'
};
var selectedId, color;
var editor = opener.dialogWindow.editor;
function mouseoverBorder (obj) {
obj.style.border = '2px outset buttonface';
obj.style.padding = '0px';
}
function mouseoutBorder (obj) {
obj.style.border = '1px solid gray';
obj.style.padding = '1px';
}
function selectedBorder (obj) {
obj.style.border = '2px inset buttonface';
obj.style.padding = '0px';
}
function InitColorPalette() {
if (document.getElementsByTagName)
var x = document.getElementsByTagName('TD');
else if (document.all)
var x = document.all.tags('TD');
for (var i=0;i<x.length;i++) {
if (x[i].id != 'sample' && x[i].id != 'button' && x[i].id != 'custom') {
x[i].onmouseover = over;
x[i].onmouseout = out;
x[i].onclick = setColor;
x[i].style.backgroundColor = x[i].style.color = x[i].id;
mouseoutBorder(x[i]);
}
}
document.getElementById('bok').onclick = returnColor;
if (opener.dialogWindow.currentColor) {
var input = document.getElementById('hexcolor');
input.value = opener.dialogWindow.currentColor;
setManualColor(input);
}
}
function over() {
if (this.id == selectedId) {
selectedBorder(this);
}
else {
mouseoverBorder(this);
}
}
function out() {
if (this.id == selectedId) {
selectedBorder(this);
}
else {
mouseoutBorder(this);
}
}
function textKey (event, textbox) {
if (event.keyCode == 13) {
textbox.blur();
return;
}
else if (textbox.value.length < 7) {
return event.keyCode;
}
}
function setColor() {
if (selectedId)
mouseoutBorder(document.getElementById(selectedId));
selectedId = this.id;
if (selectedId) {
color = selectedId;
selectedBorder(this);
document.getElementById('source').style.color = color;
document.getElementById('hexcolor').value = color;
}
}
function setManualColor (textbox) {
var newColor = textbox.value.toLowerCase();
if (colormap[newColor])
newColor = colormap[newColor];
newColor = newColor.toUpperCase();
if (newColor.substring(0, 1) != '#')
newColor = '#' + newColor;
// Turn a 3-digit hex color such as '#a62' into the 6 digit equivelant '#aa6622'
if (/^#[0-9A-F]{3}$/.test(newColor)) {
newColor = '#' +
newColor.substring(1,2) + newColor.substring(1,2) +
newColor.substring(2,3) + newColor.substring(2,3) +
newColor.substring(3,4) + newColor.substring(3,4);
alert("newcolor: " + newColor);
}
if (!/^#[0-9A-F]{6}$/.test(newColor)) {
textbox.value = '';
return;
}
else {
if (selectedId)
mouseoutBorder(document.getElementById(selectedId));
var have;
if (have = document.getElementById(newColor)) {
selectedBorder(have);
selectedId = newColor;
}
color = newColor;
document.getElementById('source').style.color = color;
textbox.value = color;
}
}
function returnColor() {
if (color) {
if (opener.dialogWindow.returnFunc) opener.dialogWindow.returnFunc(color);
else editor.returnColor(color);
window.close();
}
}
</script>
</head>
<body class="body" onLoad="InitColorPalette()">
<table border="1" cellpadding="1" cellspacing="1" align="center">
<tr>
<td class="colorcell" id="#FFFFFF">&nbsp;</td>
<td class="colorcell" id="#FFBFBF">&nbsp;</td>
<td class="colorcell" id="#FFDFBF">&nbsp;</td>
<td class="colorcell" id="#FFFFBF">&nbsp;</td>
<td class="colorcell" id="#EFFFBF">&nbsp;</td>
<td class="colorcell" id="#BFFFBF">&nbsp;</td>
<td class="colorcell" id="#BFFFEF">&nbsp;</td>
<td class="colorcell" id="#BFFFFF">&nbsp;</td>
<td class="colorcell" id="#BFDFFF">&nbsp;</td>
<td class="colorcell" id="#BFBFFF">&nbsp;</td>
<td class="colorcell" id="#DFBFFF">&nbsp;</td>
<td class="colorcell" id="#FFBFFF">&nbsp;</td>
<td class="colorcell" id="#FFBFDF">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#E0E0E0">&nbsp;</td>
<td class="colorcell" id="#FF8080">&nbsp;</td>
<td class="colorcell" id="#FFBF80">&nbsp;</td>
<td class="colorcell" id="#FFFF80">&nbsp;</td>
<td class="colorcell" id="#CFFF80">&nbsp;</td>
<td class="colorcell" id="#80FF80">&nbsp;</td>
<td class="colorcell" id="#80FFCF">&nbsp;</td>
<td class="colorcell" id="#80FFFF">&nbsp;</td>
<td class="colorcell" id="#80BFFF">&nbsp;</td>
<td class="colorcell" id="#8080FF">&nbsp;</td>
<td class="colorcell" id="#BF80FF">&nbsp;</td>
<td class="colorcell" id="#FF80FF">&nbsp;</td>
<td class="colorcell" id="#FF80BF">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#C0C0C0">&nbsp;</td>
<td class="colorcell" id="#FF4040">&nbsp;</td>
<td class="colorcell" id="#FFA040">&nbsp;</td>
<td class="colorcell" id="#FFFF40">&nbsp;</td>
<td class="colorcell" id="#B0FF40">&nbsp;</td>
<td class="colorcell" id="#40FF40">&nbsp;</td>
<td class="colorcell" id="#40FFB0">&nbsp;</td>
<td class="colorcell" id="#40FFFF">&nbsp;</td>
<td class="colorcell" id="#40A0FF">&nbsp;</td>
<td class="colorcell" id="#4040FF">&nbsp;</td>
<td class="colorcell" id="#A040FF">&nbsp;</td>
<td class="colorcell" id="#FF40FF">&nbsp;</td>
<td class="colorcell" id="#FF40A0">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#808080">&nbsp;</td>
<td class="colorcell" id="#FF0000">&nbsp;</td>
<td class="colorcell" id="#FF8000">&nbsp;</td>
<td class="colorcell" id="#FFFF00">&nbsp;</td>
<td class="colorcell" id="#80FF00">&nbsp;</td>
<td class="colorcell" id="#00FF00">&nbsp;</td>
<td class="colorcell" id="#00FF80">&nbsp;</td>
<td class="colorcell" id="#00FFFF">&nbsp;</td>
<td class="colorcell" id="#0080FF">&nbsp;</td>
<td class="colorcell" id="#0000FF">&nbsp;</td>
<td class="colorcell" id="#8000FF">&nbsp;</td>
<td class="colorcell" id="#FF00FF">&nbsp;</td>
<td class="colorcell" id="#FF0080">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#646464">&nbsp;</td>
<td class="colorcell" id="#BF0000">&nbsp;</td>
<td class="colorcell" id="#BF6000">&nbsp;</td>
<td class="colorcell" id="#BFBF00">&nbsp;</td>
<td class="colorcell" id="#80BF00">&nbsp;</td>
<td class="colorcell" id="#00BF00">&nbsp;</td>
<td class="colorcell" id="#00BF80">&nbsp;</td>
<td class="colorcell" id="#00BFBF">&nbsp;</td>
<td class="colorcell" id="#0060BF">&nbsp;</td>
<td class="colorcell" id="#0000BF">&nbsp;</td>
<td class="colorcell" id="#6000BF">&nbsp;</td>
<td class="colorcell" id="#BF00BF">&nbsp;</td>
<td class="colorcell" id="#BF0060">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#484848">&nbsp;</td>
<td class="colorcell" id="#800000">&nbsp;</td>
<td class="colorcell" id="#804000">&nbsp;</td>
<td class="colorcell" id="#808000">&nbsp;</td>
<td class="colorcell" id="#588000">&nbsp;</td>
<td class="colorcell" id="#008000">&nbsp;</td>
<td class="colorcell" id="#008058">&nbsp;</td>
<td class="colorcell" id="#008080">&nbsp;</td>
<td class="colorcell" id="#004080">&nbsp;</td>
<td class="colorcell" id="#000080">&nbsp;</td>
<td class="colorcell" id="#400080">&nbsp;</td>
<td class="colorcell" id="#800080">&nbsp;</td>
<td class="colorcell" id="#800040">&nbsp;</td>
</tr>
<tr>
<td class="colorcell" id="#000000">&nbsp;</td>
<td class="colorcell" id="#500000">&nbsp;</td>
<td class="colorcell" id="#502800">&nbsp;</td>
<td class="colorcell" id="#505000">&nbsp;</td>
<td class="colorcell" id="#385000">&nbsp;</td>
<td class="colorcell" id="#005000">&nbsp;</td>
<td class="colorcell" id="#005028">&nbsp;</td>
<td class="colorcell" id="#005050">&nbsp;</td>
<td class="colorcell" id="#002850">&nbsp;</td>
<td class="colorcell" id="#000050">&nbsp;</td>
<td class="colorcell" id="#280050">&nbsp;</td>
<td class="colorcell" id="#500050">&nbsp;</td>
<td class="colorcell" id="#500028">&nbsp;</td>
</tr>
</table>
<hr>
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td id="sample" class="body" width="80">
<div id="source" style="width: 80px; border: 1px solid #000000; background: #ffffff" align="center">Sample</div>
</td>
<td id="custom" width="80">
<input type="text" id="hexcolor" maxlength="20" onchange="setManualColor(this)" onkeydown="textKey(event, this)" style="width: 80px" title="Enter a custom color (e.g. '#FF0000' or 'red') here">
</td>
<td align="right" id="button" style="padding-right: 3px">
<nobr>
<input type="button" id="bok" class="button" value=" Ok ">
<input type="button" class="button" value="Cancel" onclick="window.close()">
</nobr>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,53 @@
/* ==================================================================
* Gossamer Threads Module Library - http://gossamer-threads.com/
*
* dialog
* Author : Scott Beck
* $Id: editor_dialog.css,v 1.6 2004/10/14 22:35:14 bao Exp $
*
* Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
* ==================================================================
*
* Description: Style sheet for dialog pop-ups.
*/
BODY {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
background-color : buttonface;
margin : 0;
}
TD {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
}
.sample {
font-family : Verdana, Arial, Helvetica, sans-serif;
border-left : buttonshadow solid 1px;
border-bottom : buttonhighlight solid 1px;
border-right : buttonhighlight solid 1px;
border-top : buttonshadow solid 1px;
overflow : hidden;
background-color : buttonface;
}
.button {
font-family : Verdana, Arial, Helvetica, sans-serif;
background-color : buttonface;
font-size : 11px;
width : 80px;
}
select {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 11px;
border-bottom : buttonhighlight solid 2px;
border-left : buttonshadow solid 2px;
border-right : buttonhighlight solid 2px;
border-top : buttonshadow solid 2px;
overflow : hidden;
cursor : default;
}

View File

@ -0,0 +1,9 @@
<html>
<head>
<style>
<%include editor.css%>
<%if is_ie%>p { margin: 0px; }<%endif%>
</style>
</head>
<body id="editor_content" class="body_content" topmargin="5" leftmargin="5"></body>
</html>

View File

@ -0,0 +1,313 @@
<html>
<head>
<title>Select Font</title>
<style><%include editor_dialog.css%></style>
<script>
var ie = false;
var ie6 = false;
if (window.navigator.appVersion.search('MSIE') > 0) ie = true;
// Allow for possible future versions of IE, which hopefully will support what IE6 supports
if (window.navigator.appVersion.search('MSIE 6') > 0 ||
window.navigator.appVersion.search('MSIE 7') > 0 ||
window.navigator.appVersion.search('MSIE 8') > 0)
ie6 = true;
var fontList, styleList, sizeList, underline, colorList, fontBox, styleBox, sizeBox, sample, dlg, dialogWindow;
var editor = opener.dialogWindow.editor;
function initDialog() {
fontList = document.getElementById('fontList');
styleList = document.getElementById('styleList');
sizeList = document.getElementById('sizeList');
underline = document.getElementById('underline');
fontBox = document.getElementById('fontBox');
colorList = document.getElementById('colorList');
styleBox = document.getElementById('styleBox');
sizeBox = document.getElementById('sizeBox');
sample = document.getElementById('sample');
dlg = document.getElementById('dlg');
populateFont();
editor.fontLoad(fontList, styleList, sizeList, colorList, underline);
fontList.onchange = loadFont;
styleList.onchange = loadFont;
sizeList.onchange = loadFont;
underline.onclick = loadFont;
colorList.onchange = loadFont;
if (!ie) {
// Mozilla's default groove coloring isn't very nice; use a better one:
document.getElementById('groove1').style.borderColor = 'ThreeDLightShadow';
document.getElementById('groove2').style.borderColor = 'ThreeDLightShadow';
/* The following Javascript is used to change the styles on the various font
* elements under Mozilla to adjust them slightly to look more or less the same
* as they do under IE. The specific problem arises because IE considers
* positions to be relative to the element excluding the border, but Mozilla
* includes the border. Mozilla's approach seems more "correct", but since the
* primary user base of the advanced editor is using IE, we do the dynamic
* adjustments for Mozilla instead of IE. They are relatively minor tweaks,
* and taking them out certainly won't break anything.
*/
fontBox.style.width = parseInt(fontBox.style.width) + 2 + 'px';
fontBox.style.left = parseInt(fontBox.style.left) - 1 + 'px';
fontBox.style.top = parseInt(fontBox.style.top) - 1 + 'px';
styleBox.style.width = parseInt(styleBox.style.width) + 2 + 'px';
styleBox.style.left = parseInt(styleBox.style.left) - 1 + 'px';
styleBox.style.top = parseInt(styleBox.style.top) - 1 + 'px';
sizeBox.style.width = parseInt(sizeBox.style.width) + 2 + 'px';
sizeBox.style.left = parseInt(sizeBox.style.left) - 1 + 'px';
sizeBox.style.top = parseInt(sizeBox.style.top) - 1 + 'px';
var sampleTable = document.getElementById('sampleTable');
sampleTable.style.height = parseInt(sampleTable.style.height) + 2 + 'px';
sample.style.width = parseInt(sample.style.width) + 4 + 'px';
}
loadFont();
}
function populateFont() {
if (ie6) {
var fonts = [];
for (var i = 1; i <= dlg.fonts.count; i++) fonts[i - 1] = dlg.fonts(i);
fonts.sort();
for (var i = 0; i < fonts.length; i++) addFont(fontList, fonts[i]);
}
else {
addFont(fontList, 'Arial');
addFont(fontList, 'Arial Black');
addFont(fontList, 'Arial Narrow');
addFont(fontList, 'Century Gothic');
addFont(fontList, 'Comic Sans MS');
addFont(fontList, 'Courier');
addFont(fontList, 'Courier New');
addFont(fontList, 'Fixedsys');
addFont(fontList, 'Garamond');
addFont(fontList, 'Georgia');
addFont(fontList, 'Lucida Console');
addFont(fontList, 'MS Sans Serif');
addFont(fontList, 'MS Serif');
addFont(fontList, 'System');
addFont(fontList, 'Tahoma');
addFont(fontList, 'Times New Roman');
addFont(fontList, 'Verdana');
addFont(fontList, 'Webdings');
addFont(fontList, 'Wingdings');
}
}
function addFont (sel, fontName) {
var o = document.createElement("OPTION");
sel.options.add(o);
o.innerHTML = fontName;
o.value = fontName;
}
function loadFont() {
if (fontList.selectedIndex >= 0) {
var font = fontList.options[fontList.selectedIndex].value;
fontBox.value = font
sample.style.fontFamily = font;
}
if (styleList.selectedIndex >= 0) {
var style = styleList.options[styleList.selectedIndex].value;
if (style == 'r') {
styleBox.value = 'Regular';
sample.style.fontStyle = 'normal';
sample.style.fontWeight = 'normal';
}
else if (style == 'b') {
styleBox.value = 'Bold';
sample.style.fontStyle = 'normal';
sample.style.fontWeight = 'bold';
}
else if (style == 'i') {
styleBox.value = 'Italic';
sample.style.fontWeight = 'normal';
sample.style.fontStyle = 'italic';
}
else if (style == 'bi') {
styleBox.value = 'Bold Italic';
sample.style.fontWeight = 'bold';
sample.style.fontStyle = 'italic';
}
}
if (sizeList.selectedIndex >= 0) {
sizeBox.value = sizeList.options[sizeList.selectedIndex].innerHTML;
sample.style.fontSize = sizeList.options[sizeList.selectedIndex].innerHTML;
}
if (colorList.selectedIndex >= 0) {
sample.style.color = colorList.options[colorList.selectedIndex].value;
}
if (underline.checked)
sample.style.textDecoration = 'underline';
else
sample.style.textDecoration = 'none';
}
function colorDialog (width, height) {
/*------------------------------------------------------------
* show dialog window
*/
var url = editor.config.baseURL + 'editor_color;' + editor.config.extraURL;
if (!dialogWindow) dialogWindow = new Object();
if (dialogWindow.win && !dialogWindow.win.closed && dialogWindow.url == url) {
dialogWindow.win.focus();
}
else {
if (dialogWindow.win && !dialogWindow.win.closed) dialogWindow.win.close();
dialogWindow.returnFunc = colorReturn;
dialogWindow.url = url;
dialogWindow.width = width;
dialogWindow.height = height;
dialogWindow.name = Math.random().toString().replace(/\./, "");
dialogWindow.left = (screen.width - width) / 2;
dialogWindow.top = (screen.height - height) / 2;
dialogWindow.attribs = 'left=' + dialogWindow.left + ',' +
'top=' + dialogWindow.top + ',' +
'resizable=no,statusbar=yes,' +
'width=' + dialogWindow.width + ',' +
'height=' + dialogWindow.height;
dialogWindow.currentColor = colorList.value;
dialogWindow.win = window.open(dialogWindow.url, dialogWindow.name, dialogWindow.attribs);
dialogWindow.editor = editor;
dialogWindow.win.focus();
}
}
function colorReturn(color) {
var clr = color.toUpperCase();
var select;
if (clr == '#000000') select = 'black';
else if (clr == '#000080') select = 'navy';
else if (clr == '#0000FF') select = 'blue';
else if (clr == '#008000') select = 'green';
else if (clr == '#008080') select = 'teal';
else if (clr == '#00FF00') select = 'lime';
else if (clr == '#00FFFF') select = 'aqua';
else if (clr == '#800000') select = 'maroon';
else if (clr == '#800080') select = 'purple';
else if (clr == '#808000') select = 'olive';
else if (clr == '#808080') select = 'gray';
else if (clr == '#C0C0C0') select = 'silver';
else if (clr == '#FF0000') select = 'red';
else if (clr == '#FF00FF') select = 'fuchsia';
else if (clr == '#FFFF00') select = 'yellow';
else if (clr == '#FFFFFF') select = 'white';
if (select) colorList.value = select;
else {
colorList.selectedIndex = colorList.options.length - 1;
colorList.options[colorList.selectedIndex].value = color;
colorList.options[colorList.selectedIndex].innerHTML = color;
}
loadFont();
}
function returnFont() {
var font, size, color, under, bold, italic;
if (fontList.selectedIndex >= 0) font = fontList.options[fontList.selectedIndex].value;
if (sizeList.selectedIndex >= 0) size = sizeList.options[sizeList.selectedIndex].value;
if (colorList.selectedIndex >= 0) color = colorList.options[colorList.selectedIndex].value;
var under = underline.checked;
var bold = /b/.test(styleList.value);
var italic = /i/.test(styleList.value);
editor.returnFont(font, size, color, bold, italic, under);
window.close();
}
</script>
</head>
<body onLoad="initDialog()" class="body">
<!-- In IE6, this object can be used to get a list of system fonts. Using document.write to create it resulted in a crash on some computers -->
<object id="dlg" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object>
<div style="position: absolute; top: 7px; left: 10px" >Font:</div>
<input type="text" id="fontBox" style="font-size: 8pt; font-family: MS Sans Serif; height: 22px; width: 160px; position: absolute; top: 27px; left: 10px">
<select id="fontList" size="7" style="width: 162px; position: absolute; top: 49px; left: 9px"></select>
<div style="border: 1px groove; position: absolute; top: 175px; left: 10px; height: 100px; width: 160px" id="groove1"><div style="position: relative; top: -9px; left: 5px; width: 4.25em; background-color: ButtonFace">&nbsp;Effects&nbsp;</div></div>
<input type="checkbox" id="underline" style="position: absolute; top: 192px; left: 25px">
<div type="text" style="font-family: 'MS Sans Serif'; font-size: 8pt; border-width: 0px; position: absolute; top: 194px; left: 48px; width: 60px" onclick="underline.click()">Underline</div>
<div style="position: absolute; top: 218px; left: 25px">Color:</div>
<select id="colorList" size="1" style="font-face: 8pt; width: 80; position: absolute; top: 238px; left: 25px">
<option value="black">Black</option>
<option value="gray">Gray</option>
<option value="silver">Silver</option>
<option value="white">White</option>
<option value="lime">Lime</option>
<option value="green">Green</option>
<option value="yellow">Yellow</option>
<option value="olive">Olive</option>
<option value="red">Red</option>
<option value="maroon">Maroon</option>
<option value="fuchsia">Fuchsia</option>
<option value="purple">Purple</option>
<option value="aqua">Aqua</option>
<option value="teal">Teal</option>
<option value="navy">Navy</option>
<option value="blue">Blue</option>
<option value="">Custom</option>
</select>
<script>
document.write('<button style="position: absolute; top: 235px; left: 115px; height: 25px; width: 25px; padding: 0px" onclick="colorDialog(345, 193)" onmousedown="pressColorButton()" onmouseup="releaseColorButton()" onmouseout="releaseColorButton()">' +
'<img src="' + editor.config.imageURL + '/color.gif" id="colorButtonImage" style="position: relative; ' + (ie ? 'left: -3px' : 'left: -5px') + '; top: -1px; width: 23px; height: 23px; border: 0px"></button>');
function pressColorButton () {
var img = document.getElementById('colorButtonImage');
img.style.left = ie ? '-2px' : '-4px';
img.style.top = '0px';
}
function releaseColorButton () {
var img = document.getElementById('colorButtonImage');
img.style.left = ie ? '-3px' : '-5px';
img.style.top = '-1px';
}
</script>
<div style="position: absolute; top: 7px; left: 180px">Style:</div>
<input type="text" id="styleBox" style="font-size: 8pt; height: 22px; width: 77px; position: absolute; top: 27px; left: 185px" readonly>
<select id="styleList" size="7" style="width: 79px; position: absolute; top: 49px; left: 184px">
<option value="r">Regular</option>
<option value="b">Bold</option>
<option value="i">Italic</option>
<option value="bi">Bold Italic</option>
</select>
<div style="position: absolute; top: 7px; left: 277px">Size:</div>
<input type="text" id="sizeBox" style="font-size: 8pt; height: 22px; width: 60px; position: absolute; top: 27px; left: 277px" readonly>
<select id="sizeList" size="7" style="width: 62px; position: absolute; top: 49px; left: 276px">
<option value="1">8</option>
<option value="2">10</option>
<option value="3">12</option>
<option value="4">14</option>
<option value="5">18</option>
<option value="6">24</option>
<option value="7">36</option>
</select>
<div style="border: 1px groove; position: absolute; top: 175px; left: 185px; height: 100px; width: 153px" id="groove2"><div style="position: relative; top: -9px; left: 5px; width: 4.30em; background-color: buttonface">&nbsp;Sample&nbsp;</div></div>
<table width="131" style="position: absolute; top: 189px; left: 195px; height: 76px" cellpadding=0 cellspacing=0 id="sampleTable"><tr><td valign="middle" align="center" class="sample"><div style="overflow: hidden; width: 131px" id="sample">AaBbYyZz</div></td></tr></table>
<button class="button" onclick="returnFont()" style="position: absolute; top: 26px; left: 345px">OK</button>
<button class="button" onclick="window.close()" style="position: absolute; top: 54px; left: 345px">Cancel</button>
</body>
</html>

View File

@ -0,0 +1,9 @@
<html>
<head><style><%include editor.css%></style></head>
<body leftmargin="0" topmargin="0" bgcolor="#D6D6D6">
<div id="editor_toolbar" class="toolbar"></div>
<iframe id="editor_editor" style="position: absolute; width: 100%" src="glist.cgi?do=msg_page;pg=editor_editor.html;t=common<%hidden_query%>"></iframe>
<textarea id="editor_html" class="html_content"></textarea>
<div id="editor_menu" class="menu"></div>
</body>
</html

View File

@ -0,0 +1,92 @@
<html>
<head><title>Insert Image</title>
<style><%include editor_dialog.css%></style>
<script>
var form = document.frm_image;
var editor = opener.dialogWindow.editor;
var att = editor.inlineAttachments();
var attachments = att[0];
var num_att = att[1];
var is_ie = window.opener.editor_isIE;
var inline_selected;
function showSource () {
var img_src = document.getElementById('img_src');
var inline = document.getElementById('inline');
img_src.style.visibility = 'visible';
inline.style.visibility = 'hidden';
var src_radio = document.getElementById('source_radio');
if (src_radio) src_radio.checked = true;
}
function showInline () {
var img_src = document.getElementById('img_src');
var inline = document.getElementById('inline');
img_src.style.visibility = 'hidden';
inline.style.visibility = 'visible';
document.getElementById('inline_radio').checked = true;
}
function selectInline (radio) {
inline_selected = radio.value;
}
function imageReturn () {
var src_radio = document.getElementById('source_radio');
if (!src_radio || src_radio.checked) {
var img = document.createElement('IMG');
img.src = document.getElementById('img_src').value
editor.returnImage(img);
}
else if (document.getElementById('inline_radio').checked) {
editor.returnImage(inline_selected, true);
}
window.close();
}
function imageCancel () {
window.close();
}
function cancelEvent (evt) {
if (is_ie) evt.cancelBubble = true;
else evt.stopPropagation();
}
</script>
</head>
<body class="body">
<form onsubmit="imageReturn()">
<script>
if (num_att > 0) {
document.write('<div style="position: absolute; left: 10px; top: 5px; height: 20px; cursor: default" onclick="showSource()"><input type="radio" id="source_radio" name="image_type" value="source" onclick="showSource()" checked style="position: relative; top: 2px"> Image Location</div>\n' +
'<div style="position: absolute; right: 10px; top: 5px; height: 20px; cursor: default" onclick="showInline()"><input type="radio" id="inline_radio" name="image_type" value="inline" style="position: relative; top: 2px"> Inline Image</div>\n' +
'<div id="source" style="position: absolute; left: 10px; top: 30px; height: 40px">\n' +
' <input id="img_src" name="img_source" value="http://" style="width: 300px">\n' +
'</div>\n');
document.write('<div id="inline" style="position: absolute; left: 10px; top: 30px; height: 40px; width: 300px; visibility: hidden; overflow: auto">\n');
for (i in attachments) {
var filename = i.replace(/"/, '&quot;').replace(/&/, '&amp;').replace(/>/, '&gt;').replace(/</, '&lt;');
document.write('<span style="white-space: nowrap; cursor: default" onclick="this.childNodes[0].click();"><input type="radio" name="inline_image" value="' + filename + '" onclick="selectInline(this)" style="position: relative; top: 2px"> ' + filename + '</span>\n');
}
document.write('</div>\n');
}
else {
document.write('<div style="position: absolute; left: 10px; top: 10px; height: 20px">Image Location:</div>\n' +
'<div id="source" style="position: absolute; left: 10px; top: 30px; height: 40px">\n' +
' <input id="img_src" name="img_source" value="http://" style="width: 300px">\n' +
'</div>\n');
}
document.write('<div style="position: absolute; left: 10px; top: 80px; bottom: 5px"><input type="button" class="button" onclick="imageReturn()" value="Submit"></div>\n');
document.write('<div style="position: absolute; right: 10px; top: 80px"><input type="button" class="button" onclick="imageCancel()" value="Cancel"></div>\n');
</script>
</form>
</body>
</html>

View File

@ -0,0 +1,30 @@
<html>
<head>
<title>Create a Link</title>
<style><%include editor_dialog.css%></style>
<script>
function returnLink() {
var url = document.getElementById('url').value;
if (url.search('http') == -1) {
alert("Please correct the URL");
return;
}
opener.dialogWindow.editor.returnLink(url);
window.close();
}
</script>
</head>
<body class=body>
<BR>
<table border=0 cellpadding=3 align=center>
<tr class=body>
<td valign="top">URL:</td>
<td align="right" valign="top">
<input size="40" id="url" name="url" value="http://"><br>
<input type="button" class=button onclick="returnLink()" value="Submit">
<input type="button" class=button onclick="window.close();" value="Cancel">
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,2 @@
<span id="load_bar" class="body"><div style="position: relative; left: 10px; top:100px; visibility: visible; font-family : Verdana, Arial, Helvetica, sans-serif; font-size: 12px">Loading...</div></span>
<iframe id="editor_iframe" style="position:ralative; width: 100%; height: 100%; visibility: hidden" scrolling="no" src="glist.cgi?do=msg_page;pg=editor_iframe.html;t=common<%hidden_query%>"></iframe>

View File

@ -0,0 +1,50 @@
<html>
<head>
<title>Create Table</title>
<style><%include editor_dialog.css%></style>
</head>
<script>
var numrows, numcols, paddind, spacing, width, border;
function initDialog() {
numrows = document.getElementById('tb_numrows');
numcols = document.getElementById('tb_numcols');
padding = document.getElementById('tb_padding');
spacing = document.getElementById('tb_spacing');
width = document.getElementById('tb_width');
border = document.getElementById('tb_border');
}
function setReturn() {
opener.dialogWindow.editor.returnTable(numrows.value, numcols.value, width.value, padding.value, spacing.value, border.value);
window.close();
}
</script>
<body class=body onload="initDialog()">
<BR>
<table cellspacing=0 align=center width=80% align=center>
<tr class=body>
<td>Rows:</td>
<td><input type=text size=4 id=tb_numrows maxlength=3 value=3></td>
<td>Cell Padding:</td>
<td><input type=text size=1 id=tb_padding maxlength=1 value=1></td>
</tr>
<tr class=body>
<td>Columns:</td>
<td><input type=text size=4 id=tb_numcols maxlength=3 value=3></td>
<td>Cell spacing:</td>
<td><input type=text size=1 id=tb_spacing maxlength=1 value=1></td>
</tr>
<tr class=body>
<td>Width</td>
<td><input type=text size=4 maxlength=4 id=tb_width value="100%"></td>
<td>Border:</td>
<td colspan=3><input type=text size=1 maxlength=1 id=tb_border value="1"></td>
</tr>
</table>
<HR>
<div align=right>
<input type="button" class=button ONCLICK="setReturn();" value="Submit">
<input type="button" class=button ONCLICK="window.close();" value="Cancel">&nbsp;
</div>

View File

@ -0,0 +1,27 @@
/* inline spellcheck */
.spell {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
background-color: #E8F9E6;
border: 1px inset #cccccc;
}
.spell-updated {
color: #326aaf;
}
.spell-misspelled {
color: #ff0000;
}
.spell-menu {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
background-color: #CCCCCC;
border: 1px outset #CCCCCC;
}
.spell-menu-mouse-out {
background-color: #CCCCCC;
}
.spell-menu-mouse-over {
background-color: #797AA1;
color: #ffffff;
}

View File

@ -0,0 +1,59 @@
<script src="<%static_url%>/js/utils.js"></script>
<script src="<%static_url%>/js/spellcheck.js"></script>
<script src="<%static_url%>/js/editor.js"></script>
<script>
<%include utils.js%>
var sc = new spellCheck('sc');
sc.config.imageURL = "<%image_url%>/pics";
sc.config.addPermission = true;
sc.config.menuMaxRows = <%if suggested_word_num%><%suggested_word_num%><%else%>10<%endif%>
sc.config.addWord = 'msg_addword';
sc.config.disableElements = [
'button_attach',
'button_mode',
'button_text',
'button_create',
'button_reset',
'url_switch'
];
<%if emode eq 'html' or emode eq 'multi'%>
<%if ie_version < 5.5 and mozilla_version < 1.4%>
<%set editor_advanced = 0%>
<%endif%>
<%elsif emode eq 'text'%>
<%set editor_advanced = 0%>
<%endif%>
<%if editor_advanced%>
var ae = new advancedEditor('ae');
ae.config.imageURL = "<%image_url%>/toolbar";
ae.config.baseURL = "<%cgi_url%>/glist.cgi?do=msg_page;t=common;pg=";
ae.config.extraURL = "<%hidden_query%>";
ae.names.editorForm = 'myform';
ae.names.contentObject = 'msg_content_html';
ae.deleteCommand(['normal', 'form', 'sep7']);
ae.deleteCommand((isIE ? 'sep0' : 'sep1'));
ae.toolbar['image'][0] = 'showDialog("editor_image.html", 380, 120)';
sc.names.checkContent = 'msg_content_html';
sc.editor = ae;
<%else%>
sc.names.checkContent = "<%if emode eq 'text'%>msg_content_text<%else%>msg_content_html<%endif%>";
<%endif%>
<%if emode eq 'multi'%>
sc.names.checkContent = ['msg_content_html', 'msg_content_text'];
sc.names.checkResult = ['result_spellcheck', 'result_spellcheck2'];
sc.isMultiple = true;
<%endif%>
var old = window.onload;
window.onload = function () {
if (old) old();
if (typeof(ae) == 'object') ae.load();
sc.load();
}
</script>

View File

@ -0,0 +1,70 @@
<script>
var interval_handle;
function init() {
var sc = parent.sc;
if (typeof(sc) == 'undefined') {
alert("Object spellcheck does not exist. Please check your template!");
return;
}
if (sc.loaded) {
clearInterval(interval_handle);
<%if do eq 'msg_addword'%>
<%if error%>alert("<%error%>")<%else%>alert("'<%word%>' has been added to the dictionary.")<%endif%>
<%endif%>
var objects = sc.objects;
objects.checkForm = document.result_form;
<%if words or $text_words%>
loadWords();
if (objects.checkContent != 'undefined' && objects.checkForm)
sc.check();
<%endif%>
sc.formLoaded = true;
}
}
function loadWords() {
var sc = parent.sc;
sc.words[0] = [
<%loop words%>
['<%escape_js word%>', <%if misspelled%>1, '<%escape_js word%>'<%else%>0<%endif%>]<%unless last%>,<%endunless%><%--
--%><%endloop%>
];
<%if misspellings%>
sc.corrections[0] = {
<%misspellings%>
};
sc.misspelled = true;
<%else%>
sc.misspelled = false;
<%endif%>
sc.words[1] = [
<%loop text_words%>
['<%escape_js word%>', <%if misspelled%>1, '<%escape_js word%>'<%else%>0<%endif%>]<%unless last%>,<%endunless%><%--
--%><%endloop%>
];
<%if text_misspellings%>
sc.corrections[1] = {
<%text_misspellings%>
};
sc.misspelled = true;
<%endif%>
}
window.onload = function() {
interval_handle = setInterval(init, 500);
}
</script>
<body>
<form name="result_form" action="glist.cgi" method="post">
<%hidden_objects%>
<input id="do" name="do" type="hidden" value="msg_spellcheck">
<input name="inline" type="hidden" value="1">
<input name="emode" type="hidden" value="<%if emode%><%emode%><%endif%>">
<input name="advanced_editor" type="hidden" value="0">
<input name="compose_is_html" type="hidden" value="0">
<input name="content" type="hidden" value="">
<%if emode eq 'multi'%><input name="content2" type="hidden" value=""><%endif%>
</form>
</body>

View File

@ -0,0 +1,7 @@
<style><%include spellcheck.css%></style>
<div id="result_spellcheck" style="position: absolute; text-align:left; visibility: hidden; width: 97%; height:0px; overflow: auto; padding: 4px"></div>
<%if emode eq 'multi'%>
<div id="result_spellcheck2" style="position: absolute; text-align:left; visibility: hidden; width: 97%; height:0px; overflow: auto; padding: 4px"></div>
<%endif%>
<div id="suggest_menu" style="position: absolute; visibility: hidden; cursor: default; padding: 1px"></div><br>
<iframe id="frame_spellcheck" style="visibility: hidden; height: 0px; width: 0px" src="glist.cgi?do=msg_spellcheck;load=1;emode=<%emode%>;t=common<%hidden_query%>"></iframe>