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,81 @@
/*
* =================================================================
* HTML Editor - A WYSIWYG web based editor for IE5.5+ and Mozilla v1.4+
*
* Website : http://gossamer-threads.com/
* Support : http://gossamer-threads.com/scripts/support/
* Revision : $Id: editor.css,v 1.1 2006/04/05 23:23:13 brewt Exp $
*
* Copyright (c) 2005 Gossamer Threads Inc. All Rights Reserved.
* Redistribution in part or in whole strictly prohibited. Please
* see LICENSE file for full details.
* =================================================================
*/
#editor {
margin: 0px;
padding: 0px;
}
.toolbar {
border: 1px solid;
border-color: white gray gray white;
height: 26px;
heigh\t: 24px;
background-color: lightgrey;
overflow: hidden;
}
.button {
margin: 0px;
padding: 0px;
border: 1px solid lightgrey;
width: 25px;
widt\h: 23px;
height: 24px;
heigh\t: 22px;
float: left;
}
.button-pressed {
border-color: gray white white gray;
background-color: #e9e7e3;
background-position: 1px 1px;
}
.button-mouse-over {
border-color: white gray gray white;
}
.button-pressed-mouse-over {
background-color: lightgrey;
}
.button-disabled {
filter: alpha(opacity = 25);
opacity: 0.25;
/* safari fix - when opacity is set, the background gets offset by about 50%?!? */
background-repeat: no-repeat;
}
.separator {
margin: 2px 3px;
border-left: 1px solid gray;
border-right: 1px solid white;
width: 0px;
height: 20px;
float: left;
}
#editable_iframe {
border: 0px;
width: 100%;
}
#editable_source {
margin: 0px;
padding: 0px;
border: 0px;
width: 100%;
visibility: hidden;
position: absolute;
/* this somehow fixes the focus problems in mozilla */
left: 0px;
}
#editable_content {
margin: 5px;
}
#editable_content p {
margin: 0px;
}

View File

@ -0,0 +1,135 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Color</title>
<link type="text/css" rel="stylesheet" media="screen" href="editor_dialog.css">
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="editor_dialog.js"></script>
<script type="text/javascript">
var colors = ['FFFFFF', 'FFBFBF', 'FFDFBF', 'FFFFBF', 'EFFFBF', 'BFFFBF', 'BFFFEF', 'BFFFFF', 'BFDFFF', 'BFBFFF', 'DFBFFF', 'FFBFFF', 'FFBFDF', 'E0E0E0', 'FF8080', 'FFBF80', 'FFFF80', 'CFFF80', '80FF80', '80FFCF', '80FFFF', '80BFFF', '8080FF', 'BF80FF', 'FF80FF', 'FF80BF', 'C0C0C0', 'FF4040', 'FFA040', 'FFFF40', 'B0FF40', '40FF40', '40FFB0', '40FFFF', '40A0FF', '4040FF', 'A040FF', 'FF40FF', 'FF40A0', '808080', 'FF0000', 'FF8000', 'FFFF00', '80FF00', '00FF00', '00FF80', '00FFFF', '0080FF', '0000FF', '8000FF', 'FF00FF', 'FF0080', '646464', 'BF0000', 'BF6000', 'BFBF00', '80BF00', '00BF00', '00BF80', '00BFBF', '0060BF', '0000BF', '6000BF', 'BF00BF', 'BF0060', '484848', '800000', '804000', '808000', '588000', '008000', '008058', '008080', '004080', '000080', '400080', '800080', '800040', '000000', '500000', '502800', '505000', '385000', '005000', '005028', '005050', '002850', '000050', '280050', '500050', '500028'];
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 color, sample, submit, cssProperty, selected;
function checkColor(exec) {
var hc = getColor();
if (hc) {
var cell = document.getElementById(hc);
if (selected)
selected.className = null;
if (cell)
cell.className = 'selected';
selected = cell;
updateSample();
submit.disabled = false;
if (exec) {
hexcolor.value = hc;
submitForm();
}
}
else
submit.disabled = true;
return false;
}
function selectColor(e) {
if (!e) e = window.event;
var target = e.target ? e.target : e.srcElement;
if (selected)
selected.className = null;
target.className = 'selected';
selected = target;
hexcolor.value = target.id;
updateSample();
}
function getColor() {
if (hexcolor.value.match(/^#[0-9a-f]{6}$/i))
return hexcolor.value.toUpperCase();
else if (hexcolor.value.match(/^#[0-9a-f]{3}$/i)) {
var hc = hexcolor.value.toUpperCase();
return '#' + hc.substring(1, 2) + hc.substring(1, 2) + hc.substring(2, 3) + hc.substring(2, 3) + hc.substring(3, 4) + hc.substring(3, 4);
}
else if (colormap[hexcolor.value.toLowerCase()])
return colormap[hexcolor.value.toLowerCase()];
}
function updateSample() {
var hc = getColor();
if (hc)
sample.style[cssProperty] = hc;
}
function init() {
hexcolor = document.getElementById('hexcolor');
sample = document.getElementById('sample');
submit = document.getElementById('submit');
var palette = document.getElementById('palette');
for (var i = 0; i < colors.length; i++) {
var cell = document.createElement('div');
palette.appendChild(cell);
cell.id = '#' + colors[i];
cell.style.backgroundColor = '#' + colors[i];
registerEvent(cell, 'click', selectColor);
if (i % 13 == 0)
cell.style.clear = 'left';
}
if (opener.dialogWindow.values._foreground)
sample.style.color = opener.dialogWindow.values._foreground;
if (opener.dialogWindow.values._background)
sample.style.backgroundColor = opener.dialogWindow.values._background;
if (opener.dialogWindow.values._highlight)
document.getElementById('sample-span').style.backgroundColor = opener.dialogWindow.values._highlight;
if (opener.dialogWindow.values._type == 'background') {
document.title = 'Background Color';
cssProperty = 'backgroundColor';
}
else if (opener.dialogWindow.values._type == 'highlight') {
document.title = 'Highlight Color';
cssProperty = 'backgroundColor';
sample = document.getElementById('sample-span');
}
else {
document.title = 'Text Color';
cssProperty = 'color';
}
initForm();
setInterval(function () { checkColor() }, 250);
hexcolor.focus();
}
</script>
</head>
<body id="editor_color" onload="init()">
<form action="#" onsubmit="return checkColor(true)">
<div id="palette"></div>
<div id="samplewrapper">
<div id="sample"><span id="sample-span">Sample</span></div>
<input type="text" id="hexcolor" maxlength="20" class="text" title="Enter a custom color (e.g. '#FF0000' or 'red') here">
</div>
<div class="buttons">
<input type="submit" id="submit" value="OK" class="submit">
<input type="button" value="Cancel" class="button" onclick="opener.focus(); window.close();">
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,193 @@
/*
* =================================================================
* HTML Editor - A WYSIWYG web based editor for IE5.5+ and Mozilla v1.4+
*
* Website : http://gossamer-threads.com/
* Support : http://gossamer-threads.com/scripts/support/
* Revision : $Id: editor_dialog.css,v 1.2 2006/07/16 19:13:52 jagerman Exp $
*
* Copyright (c) 2005 Gossamer Threads Inc. All Rights Reserved.
* Redistribution in part or in whole strictly prohibited. Please
* see LICENSE file for full details.
* =================================================================
*/
body, input, select {
font-family: "Microsoft Sans Serif", Tahoma, Arial, sans-serif;
font-size: 11px;
}
body {
margin: 10px;
background-color: #dcdad5;
}
form {
margin: 0px;
}
fieldset {
padding: 0px;
}
.fieldset {
padding: 5px 10px 0px 10px;
}
.buttons {
text-align: right;
}
.buttons input.submit, .buttons input.button {
margin: 2px 0px;
width: 75px;
height: 24px;
}
input.text {
/* ie6 fix to correct the size of the text input */
padding: 1px 0px;
}
#editor_font #form {
width: 335px;
float: left;
}
#editor_font #fontwrapper {
margin-right: 10px;
width: 150px;
float: left;
/* ie6 fix to prevent the input/select from expanding the box (some mystery
padding on the right side) */
overflow: hidden;
}
#editor_font #stylewrapper {
margin-right: 10px;
width: 110px;
float: left;
overflow: hidden;
}
#editor_font #sizewrapper {
width: 55px;
float: left;
overflow: hidden;
}
#editor_font #font-sel, #editor_font #style-sel, #editor_font #size-sel, #editor_font #font, #editor_font #style, #editor_font #size {
width: 100%;
}
#editor_font #font-sel {
widt\h: 146px;
}
#editor_font #style-sel {
widt\h: 106px;
}
#editor_font #size-sel {
widt\h: 51px;
}
#editor_font #effectswrapper {
margin: 15px 10px 0px 0px;
width: 150px;
widt\h: 146px;
height: 82px;
heigh\t: 78px;
float: left;
}
#editor_font #samplewrapper {
margin: 15px 0px 0px 0px;
width: 175px;
widt\h: 171px;
height: 82px;
heigh\t: 78px;
float: left;
}
#editor_font #samplewrapper .fieldset {
/* ie5.5 needs this to center the sample */
text-align: center;
}
#editor_font #sample {
margin: 0px auto;
border: 1px inset;
width: 147px;
widt\h: 145px;
height: 52px;
heigh\t: 50px;
overflow: hidden;
text-align: center;
}
#editor_font .buttons {
padding-top: 1em;
}
#editor_link #urlwrapper {
width: 274px;
widt\h: 270px;
height: 78px;
heigh\t: 74px;
float: left;
}
#editor_link #url {
width: 200px;
}
#editor_link label.name {
margin-top: 2px;
width: 40px;
float: left;
}
#editor_link .row {
padding: 3px 0px;
}
#editor_image #form {
width: 320px;
float: left;
}
#editor_image .row {
padding: 3px 0px;
}
#editor_image label.name {
margin-top: 2px;
width: 95px;
float: left;
}
#editor_image input.text#src-url-input {
width: 215px;
}
#editor_image label, #editor_image input.radio {
vertical-align: middle;
}
#editor_color #palette div {
margin: 0px 1px 1px 0px;
border: 1px solid gray;
width: 25px;
widt\h: 23px;
height: 20px;
heigh\t: 18px;
font-size: 1px;
float: left;
}
#editor_color #palette div:hover, #editor_color #palette .selected {
border: 2px dotted white;
widt\h: 21px;
heigh\t: 16px;
}
#editor_color #samplewrapper {
margin-top: 10px;
float: left;
}
#editor_color #sample {
margin-right: 5px;
padding-top: 4px;
border: 1px solid #000000;
width: 80px;
widt\h: 78px;
height: 24px;
heigh\t: 18px;
float: left;
font-size: 11px;
text-align: center;
}
#editor_color #samplewrapper input {
width: 80px;
}
#editor_color .buttons {
margin-top: 8px;
float: right;
}
label, input {
vertical-align: bottom;
}

View File

@ -0,0 +1,7 @@
<html>
<head>
<title>HTML Editor</title>
<link type="text/css" rel="stylesheet" media="screen" href="editor.css">
</head>
<body id="editable_content"></body>
</html>

View File

@ -0,0 +1,251 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Font</title>
<link type="text/css" rel="stylesheet" media="screen" href="editor_dialog.css">
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="editor_dialog.js"></script>
<script type="text/javascript">
var font, fontSel, style, styleSel, size, sizeSel, underline, color, sample, sampleText, submit;
var dialogWindow = {};
function colorDialog() {
if (color.value != '')
return;
if (dialogWindow.win && !dialogWindow.win.closed)
dialogWindow.win.close();
dialogWindow.url = 'editor_color.html';
dialogWindow.width = 358;
dialogWindow.height = 200;
dialogWindow.name = Math.random().toString().replace(/\./, "");
dialogWindow.left = (screen.width - dialogWindow.width) / 2;
dialogWindow.top = (screen.height - dialogWindow.height) / 2;
dialogWindow.attribs = 'left=' + dialogWindow.left + ',top=' + dialogWindow.top +
'location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,width=' + dialogWindow.width +
',height=' + dialogWindow.height;
dialogWindow.values = opener.dialogWindow.values;
dialogWindow.returnCall = 'opener.setColor(hexcolor.value)';
dialogWindow.win = window.open(dialogWindow.url, dialogWindow.name, dialogWindow.attribs);
dialogWindow.win.focus();
}
function setColor(clr) {
if (!clr)
return;
var match = 0;
for (var i = 0; i < color.childNodes.length; i++)
if (color.childNodes[i].value == clr)
match++;
if (match)
color.value = clr;
else {
if (color.options[color.options.length - 1].value == '') {
var newColor = document.createElement('option');
color.appendChild(newColor);
newColor.value = clr;
newColor.innerHTML = clr;
newColor.selected = true;
}
else {
color.selectedIndex = color.options.length - 1;
color.options[color.selectedIndex].value = clr;
color.options[color.selectedIndex].innerHTML = clr;
}
}
updateSample();
}
function checkFont(exec) {
if (font.value && font.value.match(/\w+/) &&
style.value && style.value.match(/\w+/) &&
size.value && size.value.match(/^\d+$/)) {
submit.disabled = false;
if (exec)
submitForm();
}
else
submit.disabled = true;
return false;
}
function updateSample() {
if (font.selectedIndex >= 0) {
fontSel.value = font.options[font.selectedIndex].value;
sampleText.style.fontFamily = fontSel.value;
}
if (style.selectedIndex >= 0) {
switch (style.options[style.selectedIndex].value) {
case 'r':
styleSel.value = 'Regular';
sampleText.style.fontStyle = 'normal';
sampleText.style.fontWeight = 'normal';
break;
case 'b':
styleSel.value = 'Bold';
sampleText.style.fontStyle = 'normal';
sampleText.style.fontWeight = 'bold';
break;
case 'i':
styleSel.value = 'Italic';
sampleText.style.fontStyle = 'italic';
sampleText.style.fontWeight = 'normal';
break;
case 'bi':
styleSel.value = 'Bold Italic';
sampleText.style.fontStyle = 'italic';
sampleText.style.fontWeight = 'bold';
}
}
if (size.selectedIndex >= 0) {
sizeSel.value = size.options[size.selectedIndex].innerHTML;
// A DTD is specified on this page, so IE treats the font sizes differently
// (hence the difference between this code and the code in editor.js).
var fontsize = {
0 : 'xx-small', // not used
1 : 'x-small',
2 : 'small',
3 : 'medium',
4 : 'large',
5 : 'x-large',
6 : 'xx-large',
7 : '48px'
};
sampleText.style.fontSize = fontsize[parseInt(size.options[size.selectedIndex].value)];
}
if (color.selectedIndex >= 0)
sampleText.style.color = color.options[color.selectedIndex].value;
sampleText.style.textDecoration = underline.checked ? 'underline' : 'none';
var padding = parseInt((sample.offsetHeight - 2 - sampleText.offsetHeight) / 2);
if (padding < 0)
padding = 0;
if (!(isIE && ieVersion < 6))
sample.style.height = sample.offsetHeight - padding - 2 + 'px';
sample.style.paddingTop = padding + 'px';
}
function init() {
font = document.getElementById('font');
fontSel = document.getElementById('font-sel');
style = document.getElementById('style');
styleSel = document.getElementById('style-sel');
size = document.getElementById('size');
sizeSel = document.getElementById('size-sel');
underline = document.getElementById('underline');
color = document.getElementById('hexcolor');
sample = document.getElementById('sample');
sampleText = document.getElementById('sample-span');
submit = document.getElementById('submit');
sample.style.backgroundColor = opener.dialogWindow.values._background;
sampleText.style.backgroundColor = opener.dialogWindow.values._highlight;
initForm();
setColor(opener.dialogWindow.values.hexcolor);
updateSample();
registerEvent(font, 'change', updateSample);
registerEvent(style, 'change', updateSample);
registerEvent(size, 'change', updateSample);
if (isIE)
registerEvent(underline, 'propertychange', updateSample);
else
registerEvent(underline, 'change', updateSample);
registerEvent(color, 'change', function () { updateSample(); colorDialog() });
setInterval(function () { checkFont() }, 250);
}
</script>
</head>
<body id="editor_font" onload="init()">
<form action="#" onsubmit="return checkFont(true)">
<div id="form">
<div id="fontwrapper">
<label for="font" accesskey="f"><u>F</u>ont:</label><br>
<input type="text" id="font-sel" class="text" readonly><br>
<select id="font" size="7">
<option value="Arial">Arial</option>
<option value="Arial Black">Arial Black</option>
<option value="Arial Narrow">Arial Narrow</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="Courier">Courier</option>
<option value="Courier New">Courier New</option>
<option value="Fixedsys">Fixedsys</option>
<option value="Garamond">Garamond</option>
<option value="Georgia">Georgia</option>
<option value="Lucida Console">Lucida Console</option>
<option value="MS Sans Serif">MS Sans Serif</option>
<option value="MS Serif">MS Serif</option>
<option value="System">System</option>
<option value="Tahoma">Tahoma</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Verdana">Verdana</option>
<option value="Webdings">Webdings</option>
<option value="Wingdings">Wingdings</option>
</select>
</div>
<div id="stylewrapper">
<label for="style" accesskey="y">Font st<u>y</u>le:</label><br>
<input type="text" id="style-sel" class="text" readonly><br>
<select id="style" size="7">
<option value="r">Regular</option>
<option value="b">Bold</option>
<option value="i">Italic</option>
<option value="bi">Bold Italic</option>
</select>
</div>
<div id="sizewrapper">
<label for="size" accesskey="s"><u>S</u>ize:</label><br>
<input type="text" id="size-sel" class="text" readonly><br>
<select id="size" size="7">
<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>
<fieldset id="effectswrapper">
<legend>Effects</legend>
<div class="fieldset">
<input type="checkbox" id="underline" class="checkbox"><label for="underline" accesskey="u"><u>U</u>nderline</label><br>
<label for="hexcolor" accesskey="c"><u>C</u>olor:</label><br>
<select id="hexcolor">
<option value="#000000">Black</option>
<option value="#808080">Gray</option>
<option value="#C0C0C0">Silver</option>
<option value="#FFFFFF">White</option>
<option value="#00FF00">Lime</option>
<option value="#008000">Green</option>
<option value="#FFFF00">Yellow</option>
<option value="#808000">Olive</option>
<option value="#FF0000">Red</option>
<option value="#800000">Maroon</option>
<option value="#FF00FF">Fuchsia</option>
<option value="#800080">Purple</option>
<option value="#00FFFF">Aqua</option>
<option value="#008080">Teal</option>
<option value="#000080">Navy</option>
<option value="#0000FF">Blue</option>
<option value="">Custom Color</option>
</select>
</div>
</fieldset>
<fieldset id="samplewrapper">
<legend>Sample</legend>
<div class="fieldset">
<div id="sample">
<span id="sample-span">AaBbYyZz</span>
</div>
</div>
</fieldset>
</div>
<div class="buttons">
<input type="submit" value="OK" id="submit" class="submit">
<input type="button" value="Cancel" class="button" onclick="opener.focus(); window.close()">
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>HTML Editor</title>
<link type="text/css" rel="stylesheet" media="screen" href="editor.css">
</head>
<body id="editor">
<noscript>
<p>
You currently have the Advanced Editor set as your default post editor.
JavaScript must be enabled to use the Advanced Editor, but it seems your web
browser does not support JavaScript or has disabled it.
</p>
<p>
You can do one of the following:
</p>
<ul>
<li>Turn on JavaScript</li>
<li>Switch to the Basic editor by clicking on the <strong>Switch to Basic Editor</strong> button above</li>
<li>Change your settings to default to the Basic editor by clicking on the <strong>Edit Profile</strong> menu, then <strong>Display Settings</strong> and select <strong>Basic</strong> for the <strong>Post editor</strong> option</li>
</ul>
</noscript>
<div id="toolbar_area"></div>
<iframe id="editable_iframe" src="editor_editable.html" frameborder="0"></iframe>
</body>
</html>

View File

@ -0,0 +1,212 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%~set page_mode = $in.editor_type%><%if not page_mode or page_mode ne message%><%set page_mode = 'post'%><%endif%>
<html>
<head>
<title>Insert Image</title>
<link type="text/css" rel="stylesheet" media="screen" href="<%static_url%>/editor/editor_dialog.css">
<script type="text/javascript" src="<%static_url%>/js/utils.js"></script>
<script type="text/javascript" src="<%static_url%>/editor/editor_dialog.js"></script>
<script type="text/javascript">
//<![CDATA[
var src = {}, activeSource, sourceTypes = ['url', 'file', 'inline'];
var inlineImages = [];
var inlines = opener.getInlineAttachments();
<%~if attachment_uploaded%>
inlines.push(['<%escape_js attachment_uploaded%>', 'temp', '<%attachment_uploaded_id%>']);
<%~endif%>
function checkSource(submitting) {
if (activeSource && src[activeSource + '-input'] && src[activeSource + '-input'].value && src[activeSource + '-input'].value.match(/\S/)) {
submit.disabled = false;
if (submitting) {
if (activeSource == 'file')
return true;
else
submitWrapper();
}
}
else
submit.disabled = true;
return false;
}
function changeElement() {
activeSource = false;
for (var i = 0; i < sourceTypes.length; i++) {
if (src[sourceTypes[i]] && src[sourceTypes[i]].checked) {
activeSource = sourceTypes[i];
break;
}
}
if (!activeSource) return;
for (var i = 0; i < sourceTypes.length; i++) {
if (src[sourceTypes[i]])
src[sourceTypes[i] + '-row'].style.display = activeSource == sourceTypes[i] ? 'block' : 'none';
}
}
function init() {
<%~if attachment_uploaded%>
// The upload succeeded: make the parent page refresh the attachment list
if (opener.refreshAttachmentList)
opener.refreshAttachmentList();
<%~endif%>
// We need to copy the temp_id from the parent document.
document.getElementById('temp_id').value = opener.document.getElementById('temp_id').value;
// Also copy over forum_id, parent_post_id, and post_id, if they exist.
var hidden = [opener.document.getElementById('forum_id'), opener.document.getElementById('parent_post_id'), opener.document.getElementById('post_id')];
for (var i = 0; i < hidden.length; i++) {
if (hidden[i]) {
var h = document.createElement('input');
h.type = 'hidden';
h.name = hidden[i].name;
h.value = hidden[i].value;
document.getElementById('image_form').appendChild(h);
}
}
var eventType = isIE ? 'propertychange' : 'change';
for (var i = 0; i < sourceTypes.length; i++) {
var sourceType = sourceTypes[i];
src[sourceType] = document.getElementById('src-' + sourceType);
src[sourceType + '-input'] = document.getElementById('src-' + sourceType + '-input');
src[sourceType + '-label'] = document.getElementById('src-' + sourceType + '-label');
src[sourceType + '-value'] = document.getElementById('src-' + sourceType + '-value');
src[sourceType + '-row'] = document.getElementById('src-' + sourceType + '-row');
if (src[sourceType]) registerEvent(src[sourceType], eventType, changeElement);
}
if (inlines.length > 0) {
for (i = 0; i < inlines.length; i++) {
var filename = inlines[i][0];
var inlineRadio;
// Hack around a weird IE bug where setting the name attribute
// below results in the radio button not showing its state properly
try {
inlineRadio = document.createElement('<input type="radio" name="inline_image" />');
}
catch (e) {
inlineRadio = document.createElement('input');
}
inlineRadio.type = 'radio';
inlineRadio.name = 'inline_image';
inlineRadio.id = 'inline_image' + i;
inlineRadio.value = filename;
<%~if attachment_uploaded%>
if (filename == '<%escape_js attachment_uploaded%>') {
inlineRadio.checked = true;
src['inline-input'].value = filename;
}
<%~endif%>
var inlineLabel = document.createElement('label');
inlineLabel.appendChild(document.createTextNode(filename));
inlineLabel.htmlFor = 'inline_image' + i;
var box = document.createElement('span');
box.appendChild(inlineRadio);
box.appendChild(inlineLabel);
src['inline-value'].appendChild(box);
inlineImages[inlineImages.length] = inlineRadio;
registerEvent(inlineRadio, 'click', function(radioBox) { return function () { src['inline-input'].value = radioBox.value; }; }(inlineRadio));
}
}
else {
src['inline'].parentNode.removeChild(src['inline']);
src['inline-label'].parentNode.removeChild(src['inline-label']);
src['inline-row'].parentNode.removeChild(src['inline-row']);
delete src['inline'];
delete src['inline-label'];
delete src['inline-row'];
}
if (!opener.canAttach) {
src['file'].parentNode.removeChild(src['file']);
src['file-label'].parentNode.removeChild(src['file-label']);
src['file-row'].parentNode.removeChild(src['file-row']);
delete src['file'];
delete src['file-label'];
delete src['file-row'];
}
submit = document.getElementById('submit');
changeElement();
setInterval(function () { checkSource() }, 250);
if (src['url'] && src['url'].checked) document.getElementById('src-url-input').focus();
<%~if error_loop.length%>
alert('Error:\n<%loop error_loop%><%escape_js loop_value%><%unless last%>\n<%endunless%><%endloop%>');
<%~elsif attachment_uploaded%>
if (true || confirm("submit form?")) submitWrapper();
<%~endif%>
}
function submitWrapper () {
if (activeSource == 'inline') {
var att_type = 'temp', att_id = 0;
for (var i = 0; i < inlines.length; i++) {
if (inlines[i][0] == src['inline-input'].value) {
att_type = inlines[i][1];
att_id = inlines[i][2];
break;
}
}
var url = '<%set url = GForum::SEO::url(params => "do=${page_mode}_attachment")%><%escape_js url%>;' + att_type + 'att_id=' + att_id;
if (att_type == 'temp')
url += ';<%if page_mode eq "post"%>post_unique<%else%>temp_id<%endif%>=' + document.getElementById('temp_id').value;
src['url-input'].value = url;
}
submitForm();
}
registerEvent(window, 'load', init);
//]]>
</script>
</head>
<body id="editor_image">
<form id="image_form" action="<%GForum::SEO::url()%>" method="post" enctype="multipart/form-data" onsubmit="return checkSource(true)">
<%hidden_form%>
<input type="hidden" name="do" value="<%page_mode%>_attachment_upload" />
<input type="hidden" id="temp_id" name="temp_id" value="" /><%-- populated from parent window by init() --%>
<input type="hidden" name="redo" value="<%this_do%>" />
<div id="form">
<div class="row">
<label class="name">Insert Image from:</label>
<input type="radio" id="src-url" name="src-type" class="radio"<%unless attachment_uploaded or error_loop.length%> checked<%endunless%>><label id="src-url-label" for="src-url" accesskey="u"><u>U</u>RL</label>
<%~unless attachment_uploaded%>
<input type="radio" id="src-file" name="src-type" class="radio"<%if error_loop.length%> checked<%endif%>><label id="src-file-label" for="src-file" accesskey="f"><u>F</u>ile</label>
<%~endunless%>
<input type="radio" id="src-inline" name="src-type" class="radio"<%if attachment_uploaded%> checked<%endunless%>><label id="src-inline-label" for="src-inline" accesskey="i"><u>I</u>nline Attachment</label>
</div>
<div id="src-url-row" class="row">
<label for="src-url-input" class="name" accesskey="s">Image <u>S</u>ource:</label>
<input type="text" id="src-url-input" value="" class="text">
</div>
<%~unless attachment_uploaded%>
<div id="src-file-row" class="row">
<label for="src-file-input" class="name" accesskey="m">I<u>m</u>age Upload:</label>
<input type="file" accept="image/*" id="src-file-input" name="<%if page_mode eq message%>msg<%else%>post<%endif%>_attachment" class="file">
<input type="hidden" name="<%if page_mode eq message%>message<%else%>post<%endif%>_attachment_inline" value="1">
</div>
<%~endunless%>
<div id="src-inline-row" class="row">
<input type="hidden" id="src-inline-input" value="">
<label class="name">I<u>n</u>line Attachment:</label>
<div id="src-inline-value" class="value"><%-- populated by init() --%></div>
</div>
</div>
<div class="buttons">
<input type="submit" id="submit" value="OK" class="submit">
<input type="button" value="Cancel" class="button" onclick="window.close()">
</div>
</form>
<div id="output-box"></div>
</body>
</html>

View File

@ -0,0 +1,59 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Create Link</title>
<link type="text/css" rel="stylesheet" media="screen" href="editor_dialog.css">
<script type="text/javascript" src="editor_dialog.js"></script>
<script type="text/javascript">
var protocol, url, submit;
function updateURL() {
url.value = protocol.value + (url.value ? url.value.replace(/^\w+:(\/\/)?/, '') : '');
}
function checkURL(exec) {
if (url.value && url.value.match(/^\w+:(\/\/)?\w+/)) {
submit.disabled = false;
if (exec)
submitForm();
}
else
submit.disabled = true;
return false;
}
function init() {
protocol = document.getElementById('protocol');
url = document.getElementById('url');
submit = document.getElementById('submit');
initForm();
setInterval(function () { checkURL() }, 250);
url.focus();
}
</script>
</head>
<body id="editor_link" onload="init()">
<form action="#" onsubmit="return checkURL(true)">
<fieldset id="urlwrapper">
<legend>Hyperlink Information</legend>
<div class="fieldset">
<div class="row">
<label for="protocol" class="name" accesskey="t"><u>T</u>ype:</label>
<select id="protocol" onchange="updateURL()">
<option value="">Other</option>
<option value="ftp://">ftp://</option>
<option value="http://" selected>http://</option>
<option value="https://">https://</option>
<option value="mailto:">mailto:</option>
</select>
</div>
<div class="row">
<label for="url" class="name" accesskey="u"><u>U</u>RL:</label>
<input type="text" id="url" value="http://" class="text">
</div>
</div>
</fieldset>
<div class="buttons">
<input type="submit" id="submit" value="OK" class="submit">
<input type="button" value="Cancel" class="button" onclick="opener.focus(); window.close()">
</div>
</form>
</body>
</html>