Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/fckeditor/editor/dialog
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12486/phpslash-dev/public_html/scripts/fckeditor/editor/dialog
Added Files:
fck_colorselector.html fck_paste.html fck_tablecell.html
Log Message:
complete fckeditor addition
--- NEW FILE: fck_colorselector.html ---
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_colorselector.html
* Color Selection dialog window.
*
* Version: 2.0 Beta 2
* Modified: 2004-09-01 00:02:08
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<style TYPE="text/css">
#ColorTable { cursor: pointer ; cursor: hand ; }
#hicolor { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
#hicolortext { width: 75px ; text-align: right ; margin-bottom: 7px ; }
#selhicolor { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
#selcolor { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
#btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; }
.ColorCell { height: 15px ; width: 15px ; }
</style>
<script type="text/javascript">
var dialogArguments = window.parent.InnerDialogLoaded() ;
// Sets the Skin CSS
document.write( '<link href="' + dialogArguments.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
function OnLoad()
{
// First of all, translate the dialog box texts
dialogArguments.FCKLanguageManager.TranslatePage(document) ;
CreateColorTable() ;
window.parent.SetOkButton( true ) ;
window.parent.SetScrollBar( false ) ;
}
function CreateColorTable()
{
// Get the target table.
var oTable = document.getElementById('ColorTable') ;
// Create the base colors array.
var aColors = ['00','33','66','99','cc','ff'] ;
// This function combines two ranges of three values from the color array into a row.
function AppendColorRow( rangeA, rangeB )
{
for ( var i = rangeA ; i < rangeA + 3 ; i++ )
{
var oRow = oTable.insertRow(-1) ;
for ( var j = rangeB ; j < rangeB + 3 ; j++ )
{
for ( var n = 0 ; n < 6 ; n++ )
{
AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
}
}
}
}
// This function create a single color cell in the color table.
function AppendColorCell( targetRow, color )
{
var oCell = targetRow.insertCell(-1) ;
oCell.className = 'ColorCell' ;
oCell.bgColor = color ;
oCell.onmouseover = function()
{
document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
document.getElementById('hicolortext').innerHTML = this.bgColor ;
}
oCell.onclick = function()
{
document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
document.getElementById('selcolor').value = this.bgColor ;
}
}
AppendColorRow( 0, 0 ) ;
AppendColorRow( 3, 0 ) ;
AppendColorRow( 0, 3 ) ;
AppendColorRow( 3, 3 ) ;
// Create the last row.
var oRow = oTable.insertRow(-1) ;
// Create the gray scale colors cells.
for ( var n = 0 ; n < 6 ; n++ )
{
AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
}
// Fill the row with black cells.
for ( var i = 0 ; i < 12 ; i++ )
{
AppendColorCell( oRow, '#000000' ) ;
}
}
function Clear()
{
document.getElementById('selhicolor').style.backgroundColor = '' ;
document.getElementById('selcolor').value = '' ;
}
function ClearActual()
{
document.getElementById('hicolor').style.backgroundColor = '' ;
document.getElementById('hicolortext').innerHTML = ' ' ;
}
function UpdateColor()
{
try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
catch (e) { Clear() ; }
}
function Ok()
{
if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' )
window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ;
return true ;
}
</script>
</head>
<body onload="OnLoad()" scroll="no">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="5" cellpadding="0" width="100%">
<tr>
<td valign="top" align="center" nowrap width="100%">
<table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
</table>
</td>
<td valign="top" align="left" nowrap>
<span fckLang="DlgColorHighlight">Highlight</span>
<div id="hicolor"></div>
<div id="hicolortext"> </div>
<span fckLang="DlgColorSelected">Selected</span>
<div id="selhicolor"></div>
<input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
<br>
<input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
--- NEW FILE: fck_paste.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_paste.html
* This dialog is shown when, for some reason (usually security settings),
* the user is not able to paste data from the clipboard to the editor using
* the toolbar buttons or the context menu.
*
* Version: 2.0 Beta 2
* Modified: 2004-08-31 00:02:26
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script language="javascript">
var dialogArguments = window.parent.InnerDialogLoaded() ;
// Sets the Skin CSS
document.write( '<link href="' + dialogArguments.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
function OnLoad()
{
if ( window.parent.dialogArguments.CustomValue == 'Word' )
{
document.getElementById('frmData').style.display = '' ;
document.getElementById('frmData').contentDocument.designMode = 'on' ;
}
else
document.getElementById('txtData').style.display = '' ;
// First of all, translate the dialog box texts
dialogArguments.FCKLanguageManager.TranslatePage(document) ;
window.parent.SetOkButton( true ) ;
window.parent.SetScrollBar( false ) ;
}
function Ok()
{
if ( window.parent.dialogArguments.CustomValue == 'Word' )
{
var sHtml = document.getElementById('frmData').contentDocument.body.innerHTML ;
dialogArguments.FCK.CleanAndPaste( sHtml ) ;
}
else
{
var sText = dialogArguments.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ;
sText = sText.replace( /\n/g, '<BR>' ) ;
dialogArguments.FCK.InsertHtml( sText ) ;
}
return true ;
}
</script>
</head>
<body onload="OnLoad()" scroll="no">
<table height="98%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
The editor was not able to automaticaly execute pasting because of the <STRONG>secutiry
settings</STRONG> of your browser.
<BR>
Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>)
and hit <STRONG>OK</STRONG>.
</td>
</tr>
<tr>
<td valign="top" height="100%" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">
<textarea id="txtData" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; DISPLAY: none; BORDER-LEFT: #000000 1px; WIDTH: 99%; BORDER-BOTTOM: #000000 1px; HEIGHT: 98%"></textarea>
<iframe id="frmData" height="98%" width="99%" frameborder="no" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; DISPLAY: none; BORDER-LEFT: #000000 1px; BORDER-BOTTOM: #000000 1px; BACKGROUND-COLOR: #ffffff"></iframe>
</td>
</tr>
</table>
</body>
</html>
--- NEW FILE: fck_tablecell.html ---
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_tablecell.html
* Cell properties dialog window.
*
* Version: 2.0 Beta 2
* Modified: 2004-09-05 01:39:41
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
-->
<html>
<head>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript" src="../js/dhtmled.js"></script>
<script type="text/javascript" src="../js/fck_events.js"></script>
<script type="text/javascript" src="../js/fck_toolbar.js"></script>
<script type="text/javascript">
<!--
var dialogArguments = window.parent.InnerDialogLoaded() ;
// Sets the Skin CSS
document.write( '<link href="' + dialogArguments.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
// Gets the document DOM
var oDOM = dialogArguments.FCK.EditorDocument ;
function OnLoad()
{
// First of all, translate the dialog box texts
dialogArguments.FCKLanguageManager.TranslatePage(document) ;
window.parent.SetOkButton( true ) ;
}
function IsDigit( e )
{
e = e || event ;
var iCode = ( e.keyCode || e.charCode ) ;
return
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
}
//////// TODO
// Array of selected Cells
var aTD = new Array() ;
function setDefaults()
{
// Gets the document DOM
var oDOM = dialogArguments.objContent.DOM ;
var oRange = oDOM.selection.createRange() ;
var oParent = oRange.parentElement() ;
while (oParent && oParent.tagName != "td" && oParent.tagName != "TABLE")
oParent = oParent.parentNode ;
if ( oParent.tagName == "td" )
aTD[0] = oParent ;
else if ( oParent.tagName == "TABLE" )
{
// Loops throw all cells cheking if the selection, or part of it, is inside the cell
// and then add it to the selectec cells collection
for (i = 0 ; i < oParent.cells.length ; i++)
{
var oCellRange = oDOM.selection.createRange() ;
oCellRange.moveToElementText(oParent.cells[i]) ;
if ( oRange.inRange( oCellRange )
|| ( oRange.compareEndPoints('StartToStart',oCellRange) >= 0 && oRange.compareEndPoints('StartToEnd',oCellRange) <= 0 )
|| ( oRange.compareEndPoints('EndToStart',oCellRange) >= 0 && oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ) )
{
aTD[aTD.length] = oParent.cells[i] ;
}
}
}
if (aTD[0])
{
var iWidth = aTD[0].width ;
if (iWidth.indexOf('%') >= 0)
{
iWidth = iWidth.substr(0,iWidth.length - 1) ;
selWidthType.value = "percent" ;
}
txtWidth.value = iWidth ;
txtHeight.value = aTD[0].height ;
selWordWrap.value = ! aTD[0].noWrap ;
selHAlign.value = aTD[0].align ;
selVAlign.value = aTD[0].vAlign ;
txtRowSpan.value = aTD[0].rowSpan ;
txtCollSpan.value = aTD[0].colSpan ;
txtBackColor.value = aTD[0].bgColor ;
txtBorderColor.value = aTD[0].borderColor ;
cmbFontStyle.value = aTD[0].className ;
}
}
function ok()
{
for( i = 0 ; i < aTD.length ; i++ )
{
if (txtWidth.value != "") aTD[i].width = txtWidth.value + (selWidthType.value == "percent" ? "%" : "") ; else aTD[i].removeAttribute("width") ;
if (txtHeight.value != "") aTD[i].height = txtHeight.value ; else aTD[i].removeAttribute("height") ;
if (selWordWrap.value != "") aTD[i].noWrap = selWordWrap.value == "false" ; else aTD[i].removeAttribute("noWrap") ;
if (selHAlign.value != "") aTD[i].align = selHAlign.value ; else aTD[i].removeAttribute("align") ;
if (selVAlign.value != "") aTD[i].vAlign = selVAlign.value ; else aTD[i].removeAttribute("vAlign") ;
if (txtRowSpan.value != "") aTD[i].rowSpan = txtRowSpan.value ; else aTD[i].removeAttribute("rowSpan") ;
if (txtCollSpan.value != "") aTD[i].colSpan = txtCollSpan.value ; else aTD[i].removeAttribute("colSpan") ;
if (txtBackColor.value != "") aTD[i].bgColor = txtBackColor.value ; else aTD[i].removeAttribute("bgColor") ;
if (txtBorderColor.value != "") aTD[i].borderColor = txtBorderColor.value ; else aTD[i].removeAttribute("borderColor") ;
if (cmbFontStyle.value != "") aTD[i].className = cmbFontStyle.value ; else aTD[i].removeAttribute("className") ;
}
cancel() ;
}
function SelectBackColor()
{
var sColor = SelectColor() ;
if (sColor) txtBackColor.value = sColor ;
}
function SelectBorderColor()
{
var sColor = SelectColor() ;
if (sColor) txtBorderColor.value = sColor ;
}
function SelectColor()
{
return showModalDialog("fck_selcolor.html", dialogArguments, "dialogWidth:370px;dialogHeight:240px;help:no;scroll:no;status:no") ;
}
//-->
</script>
</head>
<body bottommargin="5" leftmargin="5" topmargin="5" rightmargin="5" onload="OnLoad()">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
<tr>
<td>
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td nowrap><span fckLang="DlgCellWidth">Width</span>:</td>
<td> <input onkeypress="event.returnValue=IsDigit();" id="txtWidth" type="text" maxLength="4"
size="3" name="txtWidth"> <select id="selWidthType" name="selWidthType">
<option fckLang="DlgCellWidthPx" value="pixels" selected>pixels</option>
<option fckLang="DlgCellWidthPc" value="percent">percent</option>
</select></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellHeight">Height</span>:</td>
<td> <INPUT id="txtHeight" type="text" maxLength="4" size="3" name="txtHeight" onkeypress="event.returnValue=IsDigit();"> <span fckLang="DlgCellWidthPx">pixels</span></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellWordWrap">Word Wrap</span>:</td>
<td> <select id="selWordWrap" name="selAlignment">
<option fckLang="DlgCellWordWrapNotSet" value="" selected><Not set></option>
<option fckLang="DlgCellWordWrapYes" value="true">Yes</option>
<option fckLang="DlgCellWordWrapNo" value="false">No</option>
</select></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
<td> <select id="selHAlign" name="selAlignment">
<option fckLang="DlgCellHorAlignNotSet" value="" selected><Not set></option>
<option fckLang="DlgCellHorAlignLeft" value="left">Left</option>
<option fckLang="DlgCellHorAlignCenter" value="center">Center</option>
<option fckLang="DlgCellHorAlignRight" value="right">Right</option>
</select></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellVerAlign">Vertival Alignement</span>:</td>
<td> <select id="selVAlign" name="selAlignment">
<option fckLang="DlgCellVerAlignNotSet" value="" selected><Not set></option>
<option fckLang="DlgCellVerAlignTop" value="top">Top</option>
<option fckLang="DlgCellVerAlignMiddle" value="middle">Middle</option>
<option fckLang="DlgCellVerAlignBottom" value="bottom">Bottom</option>
<option fckLang="DlgCellVerAlignBaseline" value="baseline">Baseline</option>
</select></td>
</tr>
</table>
</td>
<td> </td>
<td align="right">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td nowrap><span fckLang="DlgCellRowSpan">Rows Span</span>:</td>
<td> <input onkeypress="event.returnValue=IsDigit();" id="txtRowSpan" type="text" maxLength="3"
size="2" name="txtRows"></td>
<td></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellCollSpan">Columns Span</span>:</td>
<td> <input onkeypress="event.returnValue=IsDigit();" id="txtCollSpan" type="text" maxLength="2"
size="2" name="txtColumns"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellBackColor">Background Color</span>:</td>
<td> <input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
<td> <input type="button" fckLang="DlgCellBtnSelect" value="Select..." onclick="SelectBackColor()"></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgCellBorderColor">Border Color</span>:</td>
<td> <input id="txtBorderColor" type="text" size="8" name="txtCellPadding"></td>
<td> <input type="button" fckLang="DlgCellBtnSelect" value="Select..." onclick="SelectBorderColor()"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><span fckLang="DlgStyle">Style</span>:</td>
<td>
<script type="text/javascript">
var tbstyles = new TBCombo( "FontStyle" , "null" , "", dialogArguments.config.StyleNames, dialogArguments.config.StyleValues, 'CheckStyle("cmbFontStyle")');
document.write(tbstyles.GetHTML());
</script></td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><BR>
<input type="button" fckLang="DlgBtnOK" value="OK" onclick="ok();" style="WIDTH: 100px"> <input type="button" fckLang="DlgBtnCancel" value="Cancel" onclick="cancel();">
</td>
</tr>
</table>
</body>
</html>
|