/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/diacritic.js |
---|
File deleted |
\ No newline at end of file |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css |
---|
File deleted |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/multihexa.js |
---|
File deleted |
\ No newline at end of file |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/keyboard_layout.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/00.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/data.js |
---|
File deleted |
\ No newline at end of file |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey/dialogue.js |
---|
File deleted |
\ No newline at end of file |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_find.html |
---|
File deleted |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_universalkey.html |
---|
File deleted |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_div.html |
---|
New file |
0,0 → 1,364 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Form dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta content="noindex, nofollow" name="robots" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var FCKLang = oEditor.FCKLang ; |
var FCKBrowserInfo = oEditor.FCKBrowserInfo ; |
var FCKStyles = oEditor.FCKStyles ; |
var FCKElementPath = oEditor.FCKElementPath ; |
var FCKDomRange = oEditor.FCKDomRange ; |
var FCKDomTools = oEditor.FCKDomTools ; |
var FCKDomRangeIterator = oEditor.FCKDomRangeIterator ; |
var FCKListsLib = oEditor.FCKListsLib ; |
var AlwaysCreate = dialog.Args().CustomValue ; |
String.prototype.IEquals = function() |
{ |
var thisUpper = this.toUpperCase() ; |
var aArgs = arguments ; |
// The arguments could also be a single array. |
if ( aArgs.length == 1 && aArgs[0].pop ) |
aArgs = aArgs[0] ; |
for ( var i = 0 ; i < aArgs.length ; i++ ) |
{ |
if ( thisUpper == aArgs[i].toUpperCase() ) |
return true ; |
} |
return false ; |
} |
var CurrentContainers = [] ; |
if ( !AlwaysCreate ) |
{ |
dialog.Selection.EnsureSelection() ; |
CurrentContainers = FCKDomTools.GetSelectedDivContainers() ; |
} |
// Add some tabs |
dialog.AddTab( 'General', FCKLang.DlgDivGeneralTab ); |
dialog.AddTab( 'Advanced', FCKLang.DlgDivAdvancedTab ) ; |
function AddStyleOption( styleName ) |
{ |
var el = GetE( 'selStyle' ) ; |
var opt = document.createElement( 'option' ) ; |
opt.text = opt.value = styleName ; |
if ( FCKBrowserInfo.IsIE ) |
el.add( opt ) ; |
else |
el.add( opt, null ) ; |
} |
function OnDialogTabChange( tabCode ) |
{ |
ShowE( 'divGeneral', tabCode == 'General' ) ; |
ShowE( 'divAdvanced', tabCode == 'Advanced' ) ; |
dialog.SetAutoSize( true ) ; |
} |
function GetNearestAncestorDirection( node ) |
{ |
var dir = 'ltr' ; // HTML default. |
while ( ( node = node.parentNode ) ) |
{ |
if ( node.dir ) |
dir = node.dir ; |
} |
return dir ; |
} |
window.onload = function() |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
// Popuplate the style menu |
var styles = FCKStyles.GetStyles() ; |
var selectableStyles = {} ; |
for ( var i in styles ) |
{ |
if ( ! /^_FCK_/.test( i ) && styles[i].Element == 'div' ) |
selectableStyles[i] = styles[i] ; |
} |
if ( CurrentContainers.length <= 1 ) |
{ |
var target = CurrentContainers[0] ; |
var match = null ; |
for ( var i in selectableStyles ) |
{ |
if ( target && styles[i].CheckElementRemovable( target, true ) ) |
match = i ; |
} |
if ( !match ) |
AddStyleOption( "" ) ; |
for ( var i in selectableStyles ) |
AddStyleOption( i ) ; |
if ( match ) |
GetE( 'selStyle' ).value = match ; |
// Set the value for other inputs |
if ( target ) |
{ |
GetE( 'txtClass' ).value = target.className ; |
GetE( 'txtId' ).value = target.id ; |
GetE( 'txtLang' ).value = target.lang ; |
GetE( 'txtInlineStyle').value = target.style.cssText ; |
GetE( 'txtTitle' ).value = target.title ; |
GetE( 'selLangDir').value = target.dir || GetNearestAncestorDirection( target ) ; |
} |
} |
else |
{ |
GetE( 'txtId' ).disabled = true ; |
AddStyleOption( "" ) ; |
for ( var i in selectableStyles ) |
AddStyleOption( i ) ; |
} |
} |
function CreateDiv() |
{ |
var newBlocks = [] ; |
var range = new FCKDomRange( FCK.EditorWindow ) ; |
range.MoveToSelection() ; |
var bookmark = range.CreateBookmark() ; |
// Kludge for #1592: if the bookmark nodes are in the beginning of |
// $tagName, then move them to the nearest block element in the |
// $tagName. |
if ( FCKBrowserInfo.IsIE ) |
{ |
var bStart = range.GetBookmarkNode( bookmark, true ) ; |
var bEnd = range.GetBookmarkNode( bookmark, false ) ; |
var cursor ; |
if ( bStart |
&& bStart.parentNode.nodeName.IEquals( 'div' ) |
&& !bStart.previousSibling ) |
{ |
cursor = bStart ; |
while ( ( cursor = cursor.nextSibling ) ) |
{ |
if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] ) |
FCKDomTools.MoveNode( bStart, cursor, true ) ; |
} |
} |
if ( bEnd |
&& bEnd.parentNode.nodeName.IEquals( 'div' ) |
&& !bEnd.previousSibling ) |
{ |
cursor = bEnd ; |
while ( ( cursor = cursor.nextSibling ) ) |
{ |
if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] ) |
{ |
if ( cursor.firstChild == bStart ) |
FCKDomTools.InsertAfterNode( bStart, bEnd ) ; |
else |
FCKDomTools.MoveNode( bEnd, cursor, true ) ; |
} |
} |
} |
} |
var iterator = new FCKDomRangeIterator( range ) ; |
var block ; |
iterator.EnforceRealBlocks = true ; |
var paragraphs = [] ; |
var groups = [] ; |
var lastBlockLimit = null ; |
while ( ( block = iterator.GetNextParagraph() ) ) |
{ |
var elementPath = new FCKElementPath( block ) ; |
if ( elementPath.BlockLimit != lastBlockLimit ) |
{ |
groups.push( [] ) ; |
lastBlockLimit = elementPath.BlockLimit ; |
} |
groups[groups.length - 1].push( block ) ; |
} |
for ( var i = 0 ; i < groups.length ; i++ ) |
{ |
var divNode = FCK.EditorDocument.createElement( 'div' ) ; |
groups[i][0].parentNode.insertBefore( divNode, groups[i][0] ) ; |
for ( var j = 0 ; j < groups[i].length ; j++ ) |
FCKDomTools.MoveNode( groups[i][j], divNode ) ; |
newBlocks.push( divNode ) ; |
} |
range.MoveToBookmark( bookmark ) ; |
range.Select() ; |
FCK.Focus() ; |
FCK.Events.FireEvent( 'OnSelectionChange' ) ; |
return newBlocks ; |
} |
function Ok() |
{ |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( CurrentContainers.length < 1 ) |
CurrentContainers = CreateDiv(); |
var setValue = function( attrName, inputName ) |
{ |
var val = GetE( inputName ).value ; |
for ( var i = 0 ; i < CurrentContainers.length ; i++ ) |
{ |
if ( val == '' ) |
CurrentContainers[i].removeAttribute( attrName ) ; |
else |
CurrentContainers[i].setAttribute( attrName, val ) ; |
} |
} |
// Apply modifications to the DIV container according to dialog inputs. |
if ( CurrentContainers.length == 1 ) |
{ |
setValue( 'class', 'txtClass' ) ; |
setValue( 'id', 'txtId' ) ; |
} |
setValue( 'lang', 'txtLang' ) ; |
if ( FCKBrowserInfo.IsIE ) |
{ |
for ( var i = 0 ; i < CurrentContainers.length ; i++ ) |
CurrentContainers[i].style.cssText = GetE( 'txtInlineStyle' ).value ; |
} |
else |
setValue( 'style', 'txtInlineStyle' ) ; |
setValue( 'title', 'txtTitle' ) ; |
for ( var i = 0 ; i < CurrentContainers.length ; i++ ) |
{ |
var dir = GetE( 'selLangDir' ).value ; |
var styleName = GetE( 'selStyle' ).value ; |
if ( GetNearestAncestorDirection( CurrentContainers[i] ) != dir ) |
CurrentContainers[i].dir = dir ; |
else |
CurrentContainers[i].removeAttribute( 'dir' ) ; |
if ( styleName ) |
FCKStyles.GetStyle( styleName ).ApplyToObject( CurrentContainers[i] ) ; |
} |
return true ; |
} |
</script> |
</head> |
<body style="overflow: hidden"> |
<div id="divGeneral"> |
<table cellspacing="0" cellpadding="0" width="100%" border="0"> |
<colgroup span="2"> |
<col width="49%" /> |
<col width="2%" /> |
<col width="49%" /> |
</colgroup> |
<tr> |
<td> |
<span fcklang="DlgDivStyle">Style</span><br /> |
<select id="selStyle" style="width: 100%;"> |
</select> |
</td> |
<td> </td> |
<td> |
<span fcklang="DlgGenClass">Stylesheet Classes</span><br /> |
<input id="txtClass" style="width: 100%" type="text" /> |
</td> |
</tr> |
</table> |
</div> |
<div id="divAdvanced" style="display: none"> |
<table cellspacing="0" cellpadding="0" width="100%" border="0"> |
<colgroup span="2"> |
<col width="49%" /> |
<col width="2%" /> |
<col width="49%" /> |
</colgroup> |
<tr> |
<td> |
<span fcklang="DlgGenId">Id</span><br /> |
<input style="width: 100%" type="text" id="txtId" /> |
</td> |
<td> </td> |
<td> |
<span fcklang="DlgGenLangCode">Language Code</span><br /> |
<input style="width: 100%" type="text" id="txtLang" /> |
</td> |
</tr> |
<tr> |
<td colspan="3"> </td> |
</tr> |
<tr> |
<td colspan="3"> |
<span fcklang="DlgDivInlineStyle">Inline Style</span><br /> |
<input style="width: 100%" type="text" id="txtInlineStyle" /> |
</td> |
</tr> |
<tr> |
<td colspan="3"> </td> |
</tr> |
<tr> |
<td colspan="3"> |
<span fcklang="DlgGenTitle">Advisory Title</span><br /> |
<input style="width: 100%" type="text" id="txtTitle" /> |
</td> |
</tr> |
<tr> |
<td> </td> |
</tr> |
<tr> |
<td> |
<span fcklang="DlgGenLangDir">Language Direction</span><br /> |
<select id="selLangDir"> |
<option fcklang="DlgGenLangDirLtr" value="ltr">Left to Right (LTR) |
<option fcklang="DlgGenLangDirRtl" value="rtl">Right to Left (RTL) |
</select> |
</td> |
</tr> |
</table> |
</div> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html |
---|
1,8 → 1,8 |
<html> |
<head> |
<link rel="stylesheet" type="text/css" href="spellerStyle.css" /> |
<script src="controlWindow.js"></script> |
<script> |
<script type="text/javascript" src="controlWindow.js"></script> |
<script type="text/javascript"> |
var spellerObject; |
var controlWindowObj; |
138,7 → 138,7 |
disabled> |
</td> |
<td> </td> |
<td> |
<td> |
<!-- by FredCK |
<input class="buttonDefault" type="button" value="Close" onClick="end_spell();"> |
--> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html |
---|
26,8 → 26,8 |
function encodeForPost( str ) { |
var s = new String( str ); |
s = encodeURIComponent( s ); |
// additionally encode single quotes to evade any PHP |
// magic_quotes_gpc setting (it inserts escape characters and |
// additionally encode single quotes to evade any PHP |
// magic_quotes_gpc setting (it inserts escape characters and |
// therefore skews the btye positions of misspelled words) |
return s.replace( /\'/g, '%27' ); |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php |
---|
1,17 → 1,20 |
<?php |
header('Content-type: text/html; charset=utf-8'); |
//$spellercss = '/speller/spellerStyle.css'; // by FredCK |
$spellercss = '../spellerStyle.css'; // by FredCK |
//$word_win_src = '/speller/wordWindow.js'; // by FredCK |
$word_win_src = '../wordWindow.js'; // by FredCK |
$textinputs = $_POST['textinputs']; # array |
//$aspell_prog = 'aspell'; // by FredCK (for Linux) |
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows) |
$lang = 'en_US'; |
//$aspell_opts = "-a --lang=$lang --encoding=utf-8"; // by FredCK |
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; // by FredCK |
$tempfiledir = "./"; |
// The following variables values must reflect your installation needs. |
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows) |
//$aspell_prog = 'aspell'; // by FredCK (for Linux) |
$lang = 'en_US'; |
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK |
$tempfiledir = "./"; |
$spellercss = '../spellerStyle.css'; // by FredCK |
$word_win_src = '../wordWindow.js'; // by FredCK |
$textinputs = $_POST['textinputs']; # array |
$input_separator = "A"; |
# set the JavaScript variable to the submitted text. |
59,7 → 62,7 |
# handle a server-side error. |
function error_handler( $err ) { |
echo "error = '" . escape_quote( $err ) . "';\n"; |
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n"; |
} |
## get the list of misspelled words. Put the results in the javascript words array |
79,6 → 82,10 |
if( $fh = fopen( $tempfile, 'w' )) { |
for( $i = 0; $i < count( $textinputs ); $i++ ) { |
$text = urldecode( $textinputs[$i] ); |
// Strip all tags for the text. (by FredCK - #339 / #681) |
$text = preg_replace( "/<[^>]+>/", " ", $text ) ; |
$lines = explode( "\n", $text ); |
fwrite ( $fh, "%\n" ); # exit terse mode |
fwrite ( $fh, "^$input_separator\n" ); |
190,4 → 197,3 |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css |
---|
46,4 → 46,4 |
width:200px; |
margin-top:2; |
font-size:8pt; |
} |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js |
---|
12,7 → 12,7 |
this._adjustIndexes = _adjustIndexes; |
this._isWordChar = _isWordChar; |
this._lastPos = _lastPos; |
// public properties |
this.wordChar = /[a-zA-Z]/; |
this.windowType = "wordWindow"; |
69,7 → 69,7 |
break; |
} else { |
total_words++; |
} |
} |
} |
} |
return total_words; |
115,17 → 115,17 |
var oldText = word.value; |
// update the text given the index of the string |
beginStr = this.textInputs[textIndex].substring( 0, pos ); |
endStr = this.textInputs[textIndex].substring( |
pos + oldText.length, |
this.textInputs[textIndex].length |
endStr = this.textInputs[textIndex].substring( |
pos + oldText.length, |
this.textInputs[textIndex].length |
); |
this.textInputs[textIndex] = beginStr + newText + endStr; |
// adjust the indexes on the stack given the differences in |
// length between the new word and old word. |
// adjust the indexes on the stack given the differences in |
// length between the new word and old word. |
var lengthDiff = newText.length - oldText.length; |
this._adjustIndexes( textIndex, wordIndex, lengthDiff ); |
word.size = newText.length; |
word.value = newText; |
this.removeFocus( textIndex, wordIndex ); |
140,39 → 140,39 |
d.open(); |
// iterate through each text input. |
for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { |
for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { |
var end_idx = 0; |
var begin_idx = 0; |
var begin_idx = 0; |
d.writeln( '<form name="textInput'+txtid+'">' ); |
var wordtxt = this.textInputs[txtid]; |
this.indexes[txtid] = []; |
if( wordtxt ) { |
if( wordtxt ) { |
var orig = this.originalSpellings[txtid]; |
if( !orig ) break; |
//!!! plain text, or HTML mode? |
d.writeln( '<div class="plainText">' ); |
// iterate through each occurrence of a misspelled word. |
// iterate through each occurrence of a misspelled word. |
for( var i = 0; i < orig.length; i++ ) { |
// find the position of the current misspelled word, |
// starting at the last misspelled word. |
// starting at the last misspelled word. |
// and keep looking if it's a substring of another word |
do { |
begin_idx = wordtxt.indexOf( orig[i], end_idx ); |
end_idx = begin_idx + orig[i].length; |
// word not found? messed up! |
if( begin_idx == -1 ) break; |
// look at the characters immediately before and after |
if( begin_idx == -1 ) break; |
// look at the characters immediately before and after |
// the word. If they are word characters we'll keep looking. |
var before_char = wordtxt.charAt( begin_idx - 1 ); |
var after_char = wordtxt.charAt( end_idx ); |
} while ( |
this._isWordChar( before_char ) |
} while ( |
this._isWordChar( before_char ) |
|| this._isWordChar( after_char ) |
); |
// keep track of its position in the original text. |
// keep track of its position in the original text. |
this.indexes[txtid][i] = begin_idx; |
// write out the characters before the current misspelled word |
181,17 → 181,17 |
d.write( this.printForHtml( wordtxt.charAt( j ))); |
} |
// write out the misspelled word. |
// write out the misspelled word. |
d.write( this._wordInputStr( orig[i] )); |
// if it's the last word, write out the rest of the text |
if( i == orig.length-1 ){ |
d.write( printForHtml( wordtxt.substr( end_idx ))); |
} |
} |
} |
d.writeln( '</div>' ); |
} |
d.writeln( '</form>' ); |
} |
200,8 → 200,8 |
// for( var k = 0; k < d.forms[j].elements.length; k++ ) { |
// alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value ); |
// } |
//} |
//} |
// set the _forms property |
this._forms = d.forms; |
d.close(); |
217,7 → 217,7 |
function printForHtml( n ) { |
return n ; // by FredCK |
/* |
var htmlstr = n; |
if( htmlstr.length == 1 ) { |
// do simple case statement if it's just one character |
239,6 → 239,7 |
htmlstr = htmlstr.replace( /\n/g, '<br/>' ); |
return htmlstr; |
} |
*/ |
} |
function _isWordChar( letter ) { |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js |
---|
19,7 → 19,6 |
// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK |
this.popUpProps = null ; // by FredCK |
// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK |
this.spellCheckScript = 'server-scripts/spellchecker.php'; // by FredCK |
//this.spellCheckScript = '/cgi-bin/spellchecker.pl'; |
// values used to keep track of what happened to a word |
37,7 → 36,7 |
this.controlWin = null; |
this.wordWin = null; |
this.textArea = textObject; // deprecated |
this.textInputs = arguments; |
this.textInputs = arguments; |
// private methods |
this._spellcheck = _spellcheck; |
97,7 → 96,7 |
// set properties from args |
this.wordWin = wordWindowObj; |
this.controlWin = controlWindowObj; |
// reset properties |
this.wordWin.resetForm(); |
this.controlWin.resetForm(); |
112,7 → 111,7 |
// start |
this._spellcheck(); |
return true; |
} |
132,6 → 131,7 |
this.currentWordIndex++; |
this._spellcheck(); |
} |
return true; |
} |
function ignoreAll() { |
148,7 → 148,7 |
return false; |
} |
// set this word as an "ignore all" word. |
// set this word as an "ignore all" word. |
this._setAsIgnored( ti, wi, this.ignrAllFlag ); |
// loop through all the words after this word |
156,7 → 156,7 |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == ti && j > wi ) || i > ti ) { |
// future word: set as "from ignore all" if |
// 1) do not already have a flag and |
// 1) do not already have a flag and |
// 2) have the same value as current word |
if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) |
&& ( !this.wordFlags[i][j] )) { |
169,6 → 169,7 |
// finally, move on |
this.currentWordIndex++; |
this._spellcheck(); |
return true; |
} |
function replaceWord() { |
183,7 → 184,7 |
return false; |
} |
if( !this.controlWin.replacementText ) { |
return; |
return false ; |
} |
var txt = this.controlWin.replacementText; |
if( txt.value ) { |
193,6 → 194,7 |
this._spellcheck(); |
} |
} |
return true; |
} |
function replaceAll() { |
208,10 → 210,10 |
return false; |
} |
var txt = this.controlWin.replacementText; |
if( !txt.value ) return; |
if( !txt.value ) return false; |
var newspell = new String( txt.value ); |
// set this word as a "replace all" word. |
// set this word as a "replace all" word. |
this._setWordText( ti, wi, newspell, this.replAllFlag ); |
// loop through all the words after this word |
219,7 → 221,7 |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == ti && j > wi ) || i > ti ) { |
// future word: set word text to s_word_to_repl if |
// 1) do not already have a flag and |
// 1) do not already have a flag and |
// 2) have the same value as s_word_to_repl |
if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) |
&& ( !this.wordFlags[i][j] )) { |
228,10 → 230,11 |
} |
} |
} |
// finally, move on |
this.currentWordIndex++; |
this._spellcheck(); |
return true; |
} |
function terminateSpell() { |
286,12 → 289,12 |
function undo() { |
// skip if this is the first word! |
var ti = this.currentTextIndex; |
var wi = this.currentWordIndex |
var wi = this.currentWordIndex; |
if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) { |
this.wordWin.removeFocus( ti, wi ); |
// go back to the last word index that was acted upon |
// go back to the last word index that was acted upon |
do { |
// if the current word index is zero then reset the seed |
if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) { |
303,30 → 306,31 |
this.currentWordIndex--; |
} |
} |
} while ( |
} while ( |
this.wordWin.totalWords( this.currentTextIndex ) == 0 |
|| this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll |
|| this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll |
); |
); |
var text_idx = this.currentTextIndex; |
var idx = this.currentWordIndex; |
var preReplSpell = this.wordWin.originalSpellings[text_idx][idx]; |
// if we got back to the first word then set the Undo button back to disabled |
if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) { |
this.controlWin.disableUndo(); |
} |
var i, j, origSpell ; |
// examine what happened to this current word. |
switch( this.wordFlags[text_idx][idx] ) { |
// replace all: go through this and all the future occurances of the word |
// replace all: go through this and all the future occurances of the word |
// and revert them all to the original spelling and clear their flags |
case this.replAllFlag : |
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == text_idx && j >= idx ) || i > text_idx ) { |
var origSpell = this.wordWin.originalSpellings[i][j]; |
origSpell = this.wordWin.originalSpellings[i][j]; |
if( origSpell == preReplSpell ) { |
this._setWordText ( i, j, origSpell, undefined ); |
} |
334,22 → 338,22 |
} |
} |
break; |
// ignore all: go through all the future occurances of the word |
// ignore all: go through all the future occurances of the word |
// and clear their flags |
case this.ignrAllFlag : |
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == text_idx && j >= idx ) || i > text_idx ) { |
var origSpell = this.wordWin.originalSpellings[i][j]; |
origSpell = this.wordWin.originalSpellings[i][j]; |
if( origSpell == preReplSpell ) { |
this.wordFlags[i][j] = undefined; |
this.wordFlags[i][j] = undefined; |
} |
} |
} |
} |
break; |
// replace: revert the word to its original spelling |
case this.replWordFlag : |
this._setWordText ( text_idx, idx, preReplSpell, undefined ); |
357,7 → 361,7 |
} |
// For all four cases, clear the wordFlag of this word. re-start the process |
this.wordFlags[text_idx][idx] = undefined; |
this.wordFlags[text_idx][idx] = undefined; |
this._spellcheck(); |
} |
} |
364,13 → 368,13 |
function _spellcheck() { |
var ww = this.wordWin; |
// check if this is the last word in the current text element |
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) { |
this.currentTextIndex++; |
this.currentWordIndex = 0; |
// keep going if we're not yet past the last text element |
if( this.currentTextIndex < this.wordWin.textInputs.length ) { |
if( this.currentTextIndex < this.wordWin.textInputs.length ) { |
this._spellcheck(); |
return; |
} else { |
378,7 → 382,7 |
return; |
} |
} |
// if this is after the first one make sure the Undo button is enabled |
if( this.currentWordIndex > 0 ) { |
this.controlWin.enableUndo(); |
404,10 → 408,10 |
// add suggestion in list for each suggested word. |
// get the array of suggested words out of the |
// three-dimensional array containing all suggestions. |
var a_suggests = this.wordWin.suggestions[text_num][word_num]; |
var a_suggests = this.wordWin.suggestions[text_num][word_num]; |
if( a_suggests ) { |
// got an array of suggestions. |
for( var ii = 0; ii < a_suggests.length; ii++ ) { |
for( var ii = 0; ii < a_suggests.length; ii++ ) { |
this.controlWin.addSuggestion( a_suggests[ii] ); |
} |
} |
449,10 → 453,9 |
for( var i = 0; i < document.forms.length; i++ ) { |
for( var j = 0; j < document.forms[i].elements.length; j++ ) { |
if( document.forms[i].elements[j].type.match( inputPattern )) { |
inputs[inputs.length] = document.forms[i].elements[j]; |
} |
inputs[inputs.length] = document.forms[i].elements[j]; |
} |
} |
} |
return inputs; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_document_preview.html |
* Preview shown in the "Document Properties" dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Preview shown in the "Document Properties" dialog window. |
--> |
<html> |
<head> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_docprops.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_docprops.html |
* Link dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Link dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
63,30 → 67,34 |
var oMetaTags = new Object() ; |
// Get all META tags defined in the document. |
var aMetas = oHead.getElementsByTagName('meta') ; |
AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('meta') ) ; |
AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('fck:meta') ) ; |
// Loop throw all METAs and put it in the HashTable. |
for ( var i = 0 ; i < aMetas.length ; i++ ) |
function AppendMetaCollection( targetObject, metaCollection ) |
{ |
// Try to get the "name" attribute. |
var sName = GetAttribute( aMetas[i], 'name', GetAttribute( aMetas[i], '___fcktoreplace:name', '' ) ) ; |
// Loop throw all METAs and put it in the HashTable. |
for ( var i = 0 ; i < metaCollection.length ; i++ ) |
{ |
// Try to get the "name" attribute. |
var sName = GetAttribute( metaCollection[i], 'name', GetAttribute( metaCollection[i], '___fcktoreplace:name', '' ) ) ; |
// If no "name", try with the "http-equiv" attribute. |
if ( sName.length == 0 ) |
{ |
if ( document.all ) |
// If no "name", try with the "http-equiv" attribute. |
if ( sName.length == 0 ) |
{ |
// Get the http-equiv value from the outerHTML. |
var oHttpEquivMatch = aMetas[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ; |
if ( oHttpEquivMatch ) |
sName = oHttpEquivMatch[1] ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
// Get the http-equiv value from the outerHTML. |
var oHttpEquivMatch = metaCollection[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ; |
if ( oHttpEquivMatch ) |
sName = oHttpEquivMatch[1] ; |
} |
else |
sName = GetAttribute( metaCollection[i], 'http-equiv', '' ) ; |
} |
else |
sName = GetAttribute( aMetas[i], 'http-equiv', '' ) ; |
if ( sName.length > 0 ) |
targetObject[ sName.toLowerCase() ] = metaCollection[i] ; |
} |
if ( sName.length > 0 ) |
oMetaTags[ sName.toLowerCase() ] = aMetas[i] ; |
} |
//#### END |
113,7 → 121,7 |
// On IE, it is not possible to set the "name" attribute of the META tag. |
// So a temporary attribute is used and it is replaced when getting the |
// editor's HTML/XHTML value. This is sad, I know :( |
if ( document.all ) |
if ( oEditor.FCKBrowserInfo.IsIE ) |
SetAttribute( oMeta, '___fcktoreplace:name', name ) ; |
else |
SetAttribute( oMeta, 'name', name ) ; |
122,7 → 130,8 |
oMetaTags[ name.toLowerCase() ] = oMeta ; |
} |
oMeta.content = content ; |
SetAttribute( oMeta, 'content', content ) ; |
// oMeta.content = content ; |
} |
function RemoveMetadata( name ) |
141,7 → 150,7 |
var oMeta = oMetaTags[ name.toLowerCase() ] ; |
if ( oMeta && oMeta != null ) |
return oMeta.content ; |
return oMeta.getAttribute( 'content', 2 ) ; |
else |
return '' ; |
} |
173,7 → 182,7 |
GetE('txtLang').value = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ; // "xml:lang" takes precedence to "lang". |
// Character Set Encoding. |
// if ( document.all ) |
// if ( oEditor.FCKBrowserInfo.IsIE ) |
// var sCharSet = FCK.EditorDocument.charset ; |
// else |
var sCharSet = GetMetadata( 'Content-Type' ) ; |
180,7 → 189,7 |
if ( sCharSet != null && sCharSet.length > 0 ) |
{ |
// if ( !document.all ) |
// if ( !oEditor.FCKBrowserInfo.IsIE ) |
sCharSet = sCharSet.match( /[^=]*$/ ) ; |
GetE('selCharSet').value = sCharSet ; |
255,7 → 264,7 |
if ( sCharSet.length > 0 ) |
sCharSet = 'text/html; charset=' + sCharSet ; |
// if ( document.all ) |
// if ( oEditor.FCKBrowserInfo.IsIE ) |
// FCK.EditorDocument.charset = sCharSet ; |
// else |
SetMetadata( 'Content-Type', sCharSet, true ) ; |
273,7 → 282,7 |
if ( sCharSet.length == 0 ) |
sCharSet = 'utf-8' ; |
FCK.XmlDeclaration = '<?xml version="1.0" encoding="' + sCharSet + '"?>' ; |
FCK.XmlDeclaration = '<' + '?xml version="1.0" encoding="' + sCharSet + '"?>' ; |
SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ; |
} |
349,9 → 358,9 |
GetE(txtField).disabled = bNotOther ; |
} |
function SetColor( inputId, color ) |
function SetColor( inputId, color ) |
{ |
GetE( inputId ).value = color + '' ; |
GetE( inputId ).value = color + '' ; |
UpdatePreview() ; |
} |
365,11 → 374,11 |
{ |
switch ( wich ) |
{ |
case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; return ; |
case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorText, window ) ; return ; |
case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorLink, window ) ; return ; |
case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorVisited, window ) ; return ; |
case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorActive, window ) ; return ; |
case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectBackColor, window ) ; return ; |
case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorText, window ) ; return ; |
case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorLink, window ) ; return ; |
case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorVisited, window ) ; return ; |
case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorActive, window ) ; return ; |
} |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_source.html |
---|
1,34 → 1,41 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_source.html |
* Source editor dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Source editor dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html> |
<head> |
<title>Source</title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<meta name="robots" content="noindex, nofollow"> |
<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script language="javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var FCKConfig = oEditor.FCKConfig ; |
var FCKTools = oEditor.FCKTools ; |
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; |
window.onload = function() |
{ |
// EnableXHTML and EnableSourceXHTML has been deprecated |
44,9 → 51,9 |
{ |
if ( oEditor.FCKBrowserInfo.IsIE ) |
oEditor.FCKUndo.SaveUndoStep() ; |
FCK.SetHTML( document.getElementById('txtSource').value, false ) ; |
FCK.SetData( document.getElementById('txtSource').value, false ) ; |
return true ; |
} |
</script> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_smiley.html |
---|
1,22 → 1,26 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_smiley.html |
* Smileys (emoticons) dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Smileys (emoticons) dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title></title> |
29,28 → 33,34 |
cursor: hand; |
} |
</style> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
window.onload = function () |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
dialog.SetAutoSize( true ) ; |
} |
function InsertSmiley( url ) |
{ |
var oImg = oEditor.FCK.CreateElement( 'IMG' ) ; |
oEditor.FCKUndo.SaveUndoStep() ; |
var oImg = oEditor.FCK.InsertElement( 'img' ) ; |
oImg.src = url ; |
oImg.setAttribute( '_fcksavedurl', url ) ; |
// For long smileys list, it seams that IE continues loading the images in |
// the background when you quickly select one image. so, let's clear |
// everything before closing. |
document.body.innerHTML = '' ; |
window.parent.Cancel() ; |
dialog.Cancel() ; |
} |
function over(td) |
64,7 → 74,7 |
} |
</script> |
</head> |
<body scroll="no"> |
<body style="overflow: hidden"> |
<table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%"> |
<script type="text/javascript"> |
73,7 → 83,7 |
var sBasePath = FCKConfig.SmileyPath ; |
var aImages = FCKConfig.SmileyImages ; |
var iCols = FCKConfig.SmileyColumns ; |
var iColWidth = parseInt( 100 / iCols ) ; |
var iColWidth = parseInt( 100 / iCols, 10 ) ; |
var i = 0 ; |
while (i < aImages.length) |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_about.html |
---|
1,28 → 1,33 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_about.html |
* "About" dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* "About" dialog window. |
--> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<meta name="robots" content="noindex, nofollow"> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script language="javascript"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta name="robots" content="noindex, nofollow" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var FCKLang = oEditor.FCKLang ; |
59,73 → 64,84 |
window.parent.SetAutoSize( true ) ; |
} |
</script> |
</head> |
<body scroll="no" style="OVERFLOW: hidden"> |
<div id="divAbout"> |
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
<tr> |
<td> |
<img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left"> |
<table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right"> |
<tr> |
<td align="center" nowrap style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"> |
<span fckLang="DlgAboutVersion">version</span> |
<br> |
<b>2.3.2</b><br /> |
Build 1082</td> |
</tr> |
</table> |
</td> |
</tr> |
<tr height="100%"> |
<td align="center"> |
<br> |
<span style="FONT-SIZE: 14px" dir="ltr"><br> |
<b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site"> |
Support <b>Open Source</b> Software</a></b> </span> |
<br><br><br> |
<span fckLang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About" target="_blank"> |
http://www.fckeditor.net/</a>. |
<br> |
Copyright © 2003-2006 <a href="#" onclick="SendEMail();">Frederico Caldeira |
Knabben</a> |
</td> |
</tr> |
<tr> |
<td align="center"> |
<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36"> |
</td> |
</tr> |
</table> |
</div> |
<div id="divLicense" style="DISPLAY: none"> |
<table height="100%" width="100%"> |
<tr> |
<td> |
<span fckLang="DlgAboutLicense">Licensed under the terms of the GNU Lesser General |
Public License</span> |
<br> |
<a href="http://www.opensource.org/licenses/lgpl-license.php" target="_blank">http://www.opensource.org/licenses/lgpl-license.php</a> |
<br> |
</td> |
</tr> |
<tr> |
<td height="100%"> |
<iframe height="100%" width="100%" src="fck_about/lgpl.html"></iframe> |
</td> |
</tr> |
</table> |
</div> |
<div id="divInfo" style="DISPLAY: none" dir="ltr"> |
<table align="center" width="80%" border="0"> |
<tr> |
<td> |
<script language="javascript"> |
</script> |
</head> |
<body style="overflow: hidden"> |
<div id="divAbout"> |
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="height: 100%"> |
<tr> |
<td colspan="2"> |
<img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left" /> |
<table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right"> |
<tr> |
<td align="center" nowrap="nowrap" style="border-right: #000000 1px solid; border-top: #000000 1px solid; |
border-left: #000000 1px solid; border-bottom: #000000 1px solid"> |
<span fcklang="DlgAboutVersion">version</span> |
<br /> |
<b>2.6.3</b><br /> |
Build 19836</td> |
</tr> |
</table> |
</td> |
</tr> |
<tr style="height: 100%"> |
<td align="center" valign="middle"> |
<span style="font-size: 14px" dir="ltr"> |
<b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site"> |
Support <b>Open Source</b> Software</a></b> </span> |
<div style="padding-top:15px"> |
<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" /> |
</div> |
</td> |
<td align="center" nowrap="nowrap" valign="middle"> |
<div> |
<div style="margin-bottom:5px" dir="ltr">Selected Sponsor</div> |
<a href="http://www.spellchecker.net/fckeditor/" target="_blank"><img alt="Selected Sponsor" border="0" src="fck_about/sponsors/spellchecker_net.gif" width="75" height="75" /></a> |
</div> |
</td> |
</tr> |
<tr> |
<td width="100%" nowrap="nowrap"> |
<span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About" |
target="_blank">http://www.fckeditor.net/</a>. |
<br /> |
Copyright © 2003-2008 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a> |
</td> |
<td align="center"> |
<a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a> |
</td> |
</tr> |
</table> |
</div> |
<div id="divLicense" style="display: none"> |
<p> |
Licensed under the terms of any of the following licenses at your |
choice: |
</p> |
<ul> |
<li style="margin-bottom:15px"> |
<b>GNU General Public License</b> Version 2 or later (the "GPL")<br /> |
<a href="http://www.gnu.org/licenses/gpl.html" target="_blank">http://www.gnu.org/licenses/gpl.html</a> |
</li> |
<li style="margin-bottom:15px"> |
<b>GNU Lesser General Public License</b> Version 2.1 or later (the "LGPL")<br /> |
<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a> |
</li> |
<li> |
<b>Mozilla Public License</b> Version 1.1 or later (the "MPL")<br /> |
<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a> |
</li> |
</ul> |
</div> |
<div id="divInfo" style="display: none" dir="ltr"> |
<table align="center" width="80%" border="0"> |
<tr> |
<td> |
<script type="text/javascript"> |
<!-- |
document.write( '<b>User Agent<\/b><br>' + window.navigator.userAgent + '<br><br>' ) ; |
document.write( '<b>Browser<\/b><br>' + window.navigator.appName + ' ' + window.navigator.appVersion + '<br><br>' ) ; |
document.write( '<b>Platform<\/b><br>' + window.navigator.platform + '<br><br>' ) ; |
document.write( '<b>User Agent<\/b><br />' + window.navigator.userAgent + '<br /><br />' ) ; |
document.write( '<b>Browser<\/b><br />' + window.navigator.appName + ' ' + window.navigator.appVersion + '<br /><br />' ) ; |
document.write( '<b>Platform<\/b><br />' + window.navigator.platform + '<br /><br />' ) ; |
var sUserLang = '?' ; |
134,12 → 150,12 |
else if ( window.navigator.userLanguage ) |
sUserLang = window.navigator.userLanguage.toLowerCase() ; |
document.write( '<b>User Language<\/b><br>' + sUserLang ) ; |
document.write( '<b>User Language<\/b><br />' + sUserLang ) ; |
//--> |
</script> |
</td> |
</tr> |
</table> |
</div> |
</body> |
</script> |
</td> |
</tr> |
</table> |
</div> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_replace.html |
---|
1,22 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_replace.html |
* "Replace" dialog box window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* Abdul-Aziz A. Al-Oraij (aziz.oraij.com) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* "Find" and "Replace" dialog box window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
23,131 → 26,623 |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta content="noindex, nofollow" name="robots" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var dialogArguments = dialog.Args() ; |
function OnLoad() |
var FCKLang = oEditor.FCKLang ; |
var FCKDomTools = oEditor.FCKDomTools ; |
var FCKDomRange = oEditor.FCKDomRange ; |
var FCKListsLib = oEditor.FCKListsLib ; |
var FCKTools = oEditor.FCKTools ; |
var EditorDocument = oEditor.FCK.EditorDocument ; |
var HighlightStyle = oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ) ; |
dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ; |
dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ; |
var idMap = {} ; |
function OnDialogTabChange( tabCode ) |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage( document ) ; |
ShowE( 'divFind', ( tabCode == 'Find' ) ) ; |
ShowE( 'divReplace', ( tabCode == 'Replace' ) ) ; |
idMap['FindText'] = 'txtFind' + tabCode ; |
idMap['CheckCase'] = 'chkCase' + tabCode ; |
idMap['CheckWord'] = 'chkWord' + tabCode ; |
window.parent.SetAutoSize( true ) ; |
if ( tabCode == 'Replace' ) |
dialog.SetAutoSize( true ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
GetNextNonEmptyTextNode = function( node, stopNode ) |
{ |
while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 ) |
1 ; |
return node ; |
} |
function btnStat(frm) |
CharacterCursor = function( arg ) |
{ |
document.getElementById('btnReplace').disabled = |
document.getElementById('btnReplaceAll').disabled = |
( document.getElementById('txtFind').value.length == 0 ) ; |
if ( arg.nodeType && arg.nodeType == 9 ) |
{ |
this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ; |
this._offset = 0 ; |
this._doc = arg ; |
} |
else |
{ |
this._textNode = arguments[0] ; |
this._offset = arguments[1] ; |
this._doc = FCKTools.GetElementDocument( arguments[0] ) ; |
} |
} |
CharacterCursor.prototype = |
{ |
GetCharacter : function() |
{ |
return ( this._textNode && this._textNode.nodeValue.charAt( this._offset ) ) || null ; |
}, |
function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound ) |
// Non-normalized. |
GetTextNode : function() |
{ |
return this._textNode ; |
}, |
// Non-normalized. |
GetIndex : function() |
{ |
return this._offset ; |
}, |
// Return value means whehther we've crossed a line break or a paragraph boundary. |
MoveNext : function() |
{ |
if ( this._offset < this._textNode.length - 1 ) |
{ |
this._offset++ ; |
return false ; |
} |
var crossed = false ; |
var curNode = this._textNode ; |
while ( ( curNode = FCKDomTools.GetNextSourceNode( curNode ) ) |
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) ) |
{ |
var tag = curNode.nodeName.toLowerCase() ; |
if ( FCKListsLib.BlockElements[tag] || tag == 'br' ) |
crossed = true ; |
} |
this._textNode = curNode ; |
this._offset = 0 ; |
return crossed ; |
}, |
// Return value means whehther we've crossed a line break or a paragraph boundary. |
MoveBack : function() |
{ |
if ( this._offset > 0 && this._textNode.length > 0 ) |
{ |
this._offset = Math.min( this._offset - 1, this._textNode.length - 1 ) ; |
return false ; |
} |
var crossed = false ; |
var curNode = this._textNode ; |
while ( ( curNode = FCKDomTools.GetPreviousSourceNode( curNode ) ) |
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) ) |
{ |
var tag = curNode.nodeName.toLowerCase() ; |
if ( FCKListsLib.BlockElements[tag] || tag == 'br' ) |
crossed = true ; |
} |
this._textNode = curNode ; |
this._offset = curNode.length - 1 ; |
return crossed ; |
}, |
Clone : function() |
{ |
return new CharacterCursor( this._textNode, this._offset ) ; |
} |
} ; |
CharacterRange = function( initCursor, maxLength ) |
{ |
for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) |
this._cursors = initCursor.push ? initCursor : [initCursor] ; |
this._maxLength = maxLength ; |
this._highlightRange = null ; |
} |
CharacterRange.prototype = |
{ |
ToDomRange : function() |
{ |
var oNode = parentNode.childNodes[i] ; |
if ( oNode.nodeType == 3 ) |
var firstCursor = this._cursors[0] ; |
var lastCursor = this._cursors[ this._cursors.length - 1 ] ; |
var domRange = new FCKDomRange( FCKTools.GetElementWindow( firstCursor.GetTextNode() ) ) ; |
var w3cRange = domRange._Range = domRange.CreateRange() ; |
w3cRange.setStart( firstCursor.GetTextNode(), firstCursor.GetIndex() ) ; |
w3cRange.setEnd( lastCursor.GetTextNode(), lastCursor.GetIndex() + 1 ) ; |
domRange._UpdateElementInfo() ; |
return domRange ; |
}, |
Highlight : function() |
{ |
if ( this._cursors.length < 1 ) |
return ; |
var domRange = this.ToDomRange() ; |
HighlightStyle.ApplyToRange( domRange, false, true ) ; |
this._highlightRange = domRange ; |
var charRange = CharacterRange.CreateFromDomRange( domRange ) ; |
var focusNode = domRange.StartNode ; |
if ( focusNode.nodeType != 1 ) |
focusNode = focusNode.parentNode ; |
FCKDomTools.ScrollIntoView( focusNode, false ) ; |
this._cursors = charRange._cursors ; |
}, |
RemoveHighlight : function() |
{ |
if ( this._highlightRange ) |
{ |
var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ; |
if ( oNode.nodeValue != sReplaced ) |
HighlightStyle.RemoveFromRange( this._highlightRange, false, true ) ; |
var charRange = CharacterRange.CreateFromDomRange( this._highlightRange ) ; |
this._cursors = charRange._cursors ; |
this._highlightRange = null ; |
} |
}, |
GetHighlightDomRange : function() |
{ |
return this._highlightRange; |
}, |
MoveNext : function() |
{ |
var next = this._cursors[ this._cursors.length - 1 ].Clone() ; |
var retval = next.MoveNext() ; |
if ( retval ) |
this._cursors = [] ; |
this._cursors.push( next ) ; |
if ( this._cursors.length > this._maxLength ) |
this._cursors.shift() ; |
return retval ; |
}, |
MoveBack : function() |
{ |
var prev = this._cursors[0].Clone() ; |
var retval = prev.MoveBack() ; |
if ( retval ) |
this._cursors = [] ; |
this._cursors.unshift( prev ) ; |
if ( this._cursors.length > this._maxLength ) |
this._cursors.pop() ; |
return retval ; |
}, |
GetEndCharacter : function() |
{ |
if ( this._cursors.length < 1 ) |
return null ; |
var retval = this._cursors[ this._cursors.length - 1 ].GetCharacter() ; |
return retval ; |
}, |
GetNextRange : function( len ) |
{ |
if ( this._cursors.length == 0 ) |
return null ; |
var cur = this._cursors[ this._cursors.length - 1 ].Clone() ; |
cur.MoveNext() ; |
return new CharacterRange( cur, len ) ; |
}, |
GetCursors : function() |
{ |
return this._cursors ; |
} |
} ; |
CharacterRange.CreateFromDomRange = function( domRange ) |
{ |
var w3cRange = domRange._Range ; |
var startContainer = w3cRange.startContainer ; |
var endContainer = w3cRange.endContainer ; |
var startTextNode, startIndex, endTextNode, endIndex ; |
if ( startContainer.nodeType == 3 ) |
{ |
startTextNode = startContainer ; |
startIndex = w3cRange.startOffset ; |
} |
else if ( domRange.StartNode.nodeType == 3 ) |
{ |
startTextNode = domRange.StartNode ; |
startIndex = 0 ; |
} |
else |
{ |
startTextNode = GetNextNonEmptyTextNode( domRange.StartNode, domRange.StartNode.parentNode ) ; |
if ( !startTextNode ) |
return null ; |
startIndex = 0 ; |
} |
if ( endContainer.nodeType == 3 && w3cRange.endOffset > 0 ) |
{ |
endTextNode = endContainer ; |
endIndex = w3cRange.endOffset - 1 ; |
} |
else |
{ |
endTextNode = domRange.EndNode ; |
while ( endTextNode.nodeType != 3 ) |
endTextNode = endTextNode.lastChild ; |
endIndex = endTextNode.length - 1 ; |
} |
var cursors = [] ; |
var current = new CharacterCursor( startTextNode, startIndex ) ; |
cursors.push( current ) ; |
if ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) && !domRange.CheckIsEmpty() ) |
{ |
do |
{ |
current = current.Clone() ; |
current.MoveNext() ; |
cursors.push( current ) ; |
} |
while ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) ) ; |
} |
return new CharacterRange( cursors, cursors.length ) ; |
} |
// Knuth-Morris-Pratt Algorithm for stream input |
KMP_NOMATCH = 0 ; |
KMP_ADVANCED = 1 ; |
KMP_MATCHED = 2 ; |
KmpMatch = function( pattern, ignoreCase ) |
{ |
var overlap = [ -1 ] ; |
for ( var i = 0 ; i < pattern.length ; i++ ) |
{ |
overlap.push( overlap[i] + 1 ) ; |
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) ) |
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ; |
} |
this._Overlap = overlap ; |
this._State = 0 ; |
this._IgnoreCase = ( ignoreCase === true ) ; |
if ( ignoreCase ) |
this.Pattern = pattern.toLowerCase(); |
else |
this.Pattern = pattern ; |
} |
KmpMatch.prototype = { |
FeedCharacter : function( c ) |
{ |
if ( this._IgnoreCase ) |
c = c.toLowerCase(); |
while ( true ) |
{ |
if ( c == this.Pattern.charAt( this._State ) ) |
{ |
oNode.nodeValue = sReplaced ; |
if ( ! replaceAll ) |
return true ; |
hasFound = true ; |
this._State++ ; |
if ( this._State == this.Pattern.length ) |
{ |
// found a match, start over, don't care about partial matches involving the current match |
this._State = 0; |
return KMP_MATCHED; |
} |
return KMP_ADVANCED ; |
} |
else if ( this._State == 0 ) |
return KMP_NOMATCH; |
else |
this._State = this._Overlap[ this._State ]; |
} |
hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ; |
if ( ! replaceAll && hasFound ) |
return true ; |
return null ; |
}, |
Reset : function() |
{ |
this._State = 0 ; |
} |
return hasFound ; |
}; |
// Place a range at the start of document. |
function OnLoad() |
{ |
// First of all, translate the dialog box texts. |
oEditor.FCKLanguageManager.TranslatePage( document ) ; |
// Show the appropriate tab at startup. |
if ( dialogArguments.CustomValue == 'Find' ) |
{ |
dialog.SetSelectedTab( 'Find' ) ; |
dialog.SetAutoSize( true ) ; |
} |
else |
dialog.SetSelectedTab( 'Replace' ) ; |
SelectField( 'txtFind' + dialogArguments.CustomValue ) ; |
} |
function GetRegexExpr() |
function btnStat() |
{ |
var sExpr = EscapeRegexString( document.getElementById('txtFind').value ) ; |
GetE('btnReplace').disabled = |
GetE('btnReplaceAll').disabled = |
GetE('btnFind').disabled = |
( GetE(idMap["FindText"]).value.length == 0 ) ; |
} |
if ( document.getElementById('chkWord').checked ) |
sExpr = '\\b' + sExpr + '\\b' ; |
function btnStatDelayed() |
{ |
setTimeout( btnStat, 1 ) ; |
} |
return sExpr ; |
function GetSearchString() |
{ |
return GetE(idMap['FindText']).value ; |
} |
function GetCase() |
function GetReplaceString() |
{ |
return ( document.getElementById('chkCase').checked ? '' : 'i' ) ; |
return GetE("txtReplace").value ; |
} |
function GetReplacement() |
function GetCheckCase() |
{ |
return document.getElementById('txtReplace').value.replace( /\$/g, '$$$$' ) ; |
return !! ( GetE(idMap['CheckCase']).checked ) ; |
} |
function EscapeRegexString( str ) |
function GetMatchWord() |
{ |
return str.replace( /[\\\^\$\*\+\?\{\}\.\(\)\!\|\[\]\-]/g, '\\$&' ) ; |
return !! ( GetE(idMap['CheckWord']).checked ) ; |
} |
/* Is this character a unicode whitespace or a punctuation mark? |
* References: |
* http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces) |
* http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks) |
*/ |
function CheckIsWordSeparator( c ) |
{ |
var code = c.charCodeAt( 0 ); |
if ( code >= 9 && code <= 0xd ) |
return true; |
if ( code >= 0x2000 && code <= 0x200a ) |
return true; |
switch ( code ) |
{ |
case 0x20: |
case 0x85: |
case 0xa0: |
case 0x1680: |
case 0x180e: |
case 0x2028: |
case 0x2029: |
case 0x202f: |
case 0x205f: |
case 0x3000: |
return true; |
default: |
} |
return /[.,"'?!;:]/.test( c ) ; |
} |
FindRange = null ; |
function _Find() |
{ |
var searchString = GetSearchString() ; |
if ( !FindRange ) |
FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ; |
else |
{ |
FindRange.RemoveHighlight() ; |
FindRange = FindRange.GetNextRange( searchString.length ) ; |
} |
var matcher = new KmpMatch( searchString, ! GetCheckCase() ) ; |
var matchState = KMP_NOMATCH ; |
var character = '%' ; |
while ( character != null ) |
{ |
while ( ( character = FindRange.GetEndCharacter() ) ) |
{ |
matchState = matcher.FeedCharacter( character ) ; |
if ( matchState == KMP_MATCHED ) |
break ; |
if ( FindRange.MoveNext() ) |
matcher.Reset() ; |
} |
if ( matchState == KMP_MATCHED ) |
{ |
if ( GetMatchWord() ) |
{ |
var cursors = FindRange.GetCursors() ; |
var head = cursors[ cursors.length - 1 ].Clone() ; |
var tail = cursors[0].Clone() ; |
if ( !head.MoveNext() && !CheckIsWordSeparator( head.GetCharacter() ) ) |
continue ; |
if ( !tail.MoveBack() && !CheckIsWordSeparator( tail.GetCharacter() ) ) |
continue ; |
} |
FindRange.Highlight() ; |
return true ; |
} |
} |
FindRange = null ; |
return false ; |
} |
function Find() |
{ |
if ( ! _Find() ) |
alert( FCKLang.DlgFindNotFoundMsg ) ; |
} |
function Replace() |
{ |
var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ; |
if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), false, false ) ) |
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; |
var saveUndoStep = function( selectRange ) |
{ |
var ieRange ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
ieRange = document.selection.createRange() ; |
selectRange.Select() ; |
oEditor.FCKUndo.SaveUndoStep() ; |
var cloneRange = selectRange.Clone() ; |
cloneRange.Collapse( false ) ; |
cloneRange.Select() ; |
if ( ieRange ) |
setTimeout( function(){ ieRange.select() ; }, 1 ) ; |
} |
if ( FindRange && FindRange.GetHighlightDomRange() ) |
{ |
var range = FindRange.GetHighlightDomRange() ; |
var bookmark = range.CreateBookmark() ; |
FindRange.RemoveHighlight() ; |
range.MoveToBookmark( bookmark ) ; |
saveUndoStep( range ) ; |
range.DeleteContents() ; |
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ; |
range._UpdateElementInfo() ; |
FindRange = CharacterRange.CreateFromDomRange( range ) ; |
} |
else |
{ |
if ( ! _Find() ) |
{ |
FindRange && FindRange.RemoveHighlight() ; |
alert( FCKLang.DlgFindNotFoundMsg ) ; |
} |
} |
} |
function ReplaceAll() |
{ |
var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ; |
if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), true, false ) ) |
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; |
window.parent.Cancel() ; |
oEditor.FCKUndo.SaveUndoStep() ; |
var replaceCount = 0 ; |
while ( _Find() ) |
{ |
var range = FindRange.GetHighlightDomRange() ; |
var bookmark = range.CreateBookmark() ; |
FindRange.RemoveHighlight() ; |
range.MoveToBookmark( bookmark) ; |
range.DeleteContents() ; |
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ; |
range._UpdateElementInfo() ; |
FindRange = CharacterRange.CreateFromDomRange( range ) ; |
replaceCount++ ; |
} |
if ( replaceCount == 0 ) |
{ |
FindRange && FindRange.RemoveHighlight() ; |
alert( FCKLang.DlgFindNotFoundMsg ) ; |
} |
dialog.Cancel() ; |
} |
window.onunload = function() |
{ |
if ( FindRange ) |
{ |
FindRange.RemoveHighlight() ; |
FindRange.ToDomRange().Select() ; |
} |
} |
</script> |
</head> |
<body onload="OnLoad()" style="overflow: hidden"> |
<table cellspacing="3" cellpadding="2" width="100%" border="0"> |
<tr> |
<td nowrap="nowrap"> |
<label for="txtFind" fcklang="DlgReplaceFindLbl"> |
Find what:</label> |
</td> |
<td width="100%"> |
<input id="txtFind" onkeyup="btnStat(this.form)" style="width: 100%" tabindex="1" |
type="text" /> |
</td> |
<td> |
<input id="btnReplace" style="width: 100%" disabled="disabled" onclick="Replace();" |
type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" /> |
</td> |
</tr> |
<tr> |
<td valign="top" nowrap="nowrap"> |
<label for="txtReplace" fcklang="DlgReplaceReplaceLbl"> |
Replace with:</label> |
</td> |
<td valign="top"> |
<input id="txtReplace" style="width: 100%" tabindex="2" type="text" /> |
</td> |
<td> |
<input id="btnReplaceAll" disabled="disabled" onclick="ReplaceAll()" type="button" |
value="Replace All" fcklang="DlgReplaceReplAllBtn" /> |
</td> |
</tr> |
<tr> |
<td valign="bottom" colspan="3"> |
<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match |
case</label> |
<br /> |
<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match |
whole word</label> |
</td> |
</tr> |
</table> |
<div id="divFind" style="display: none"> |
<table cellspacing="3" cellpadding="2" width="100%" border="0"> |
<tr> |
<td nowrap="nowrap"> |
<label for="txtFindFind" fcklang="DlgReplaceFindLbl"> |
Find what:</label> |
</td> |
<td width="100%"> |
<input id="txtFindFind" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1" |
type="text" /> |
</td> |
<td> |
<input id="btnFind" style="width: 80px" disabled="disabled" onclick="Find();" |
type="button" value="Find" fcklang="DlgFindFindBtn" /> |
</td> |
</tr> |
<tr> |
<td valign="bottom" colspan="3"> |
<input id="chkCaseFind" tabindex="3" type="checkbox" /><label for="chkCaseFind" fcklang="DlgReplaceCaseChk">Match |
case</label> |
<br /> |
<input id="chkWordFind" tabindex="4" type="checkbox" /><label for="chkWordFind" fcklang="DlgReplaceWordChk">Match |
whole word</label> |
</td> |
</tr> |
</table> |
</div> |
<div id="divReplace" style="display:none"> |
<table cellspacing="3" cellpadding="2" width="100%" border="0"> |
<tr> |
<td nowrap="nowrap"> |
<label for="txtFindReplace" fcklang="DlgReplaceFindLbl"> |
Find what:</label> |
</td> |
<td width="100%"> |
<input id="txtFindReplace" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1" |
type="text" /> |
</td> |
<td> |
<input id="btnReplace" style="width: 80px" disabled="disabled" onclick="Replace();" |
type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" /> |
</td> |
</tr> |
<tr> |
<td valign="top" nowrap="nowrap"> |
<label for="txtReplace" fcklang="DlgReplaceReplaceLbl"> |
Replace with:</label> |
</td> |
<td valign="top"> |
<input id="txtReplace" style="width: 100%" tabindex="2" type="text" /> |
</td> |
<td> |
<input id="btnReplaceAll" style="width: 80px" disabled="disabled" onclick="ReplaceAll()" type="button" |
value="Replace All" fcklang="DlgReplaceReplAllBtn" /> |
</td> |
</tr> |
<tr> |
<td valign="bottom" colspan="3"> |
<input id="chkCaseReplace" tabindex="3" type="checkbox" /><label for="chkCaseReplace" fcklang="DlgReplaceCaseChk">Match |
case</label> |
<br /> |
<input id="chkWordReplace" tabindex="4" type="checkbox" /><label for="chkWordReplace" fcklang="DlgReplaceWordChk">Match |
whole word</label> |
</td> |
</tr> |
</table> |
</div> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_listprop.html |
---|
1,22 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_listprop.html |
* Bulleted List dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* Marcel J Bennett (start attribute) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Bulleted List dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
26,12 → 29,14 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ; |
var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'UL' ) ; |
var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( sListType ) ; |
var oActiveSel ; |
window.onload = function() |
39,11 → 44,10 |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
if ( oActiveEl ) |
if ( sListType == 'UL' ) |
oActiveSel = GetE('selBulleted') ; |
else |
{ |
oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'OL' ) ; |
if ( oActiveEl ) |
{ |
oActiveSel = GetE('selNumbered') ; |
57,10 → 61,13 |
if ( oActiveEl ) |
{ |
if ( oActiveEl.getAttribute('type') ) |
oActiveSel.value = oActiveEl.getAttribute('type').toLowerCase() ; |
oActiveSel.value = oActiveEl.getAttribute('type') ; |
} |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ; |
} |
function Ok() |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_paste.html |
---|
1,23 → 1,27 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* 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. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* 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. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
24,86 → 28,175 |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta name="robots" content="noindex, nofollow" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK; |
var FCKTools = oEditor.FCKTools ; |
var FCKConfig = oEditor.FCKConfig ; |
var FCKBrowserInfo = oEditor.FCKBrowserInfo ; |
window.onload = function () |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
if ( window.parent.dialogArguments.CustomValue == 'Word' ) |
var sPastingType = dialog.Args().CustomValue ; |
if ( sPastingType == 'Word' || sPastingType == 'Security' ) |
{ |
var oFrame = document.getElementById('frmData') |
oFrame.style.display = '' ; |
if ( oFrame.contentDocument ) |
oFrame.contentDocument.designMode = 'on' ; |
else |
oFrame.contentWindow.document.body.contentEditable = true ; |
if ( sPastingType == 'Security' ) |
document.getElementById( 'xSecurityMsg' ).style.display = '' ; |
// For document.domain compatibility (#123) we must do all the magic in |
// the URL for IE. |
var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ? |
'javascript:void(0)' : |
'javascript:void( (function(){' + |
'document.open() ;' + |
'document.domain=\'' + document.domain + '\' ;' + |
'document.write(\'<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' + |
'document.close() ;' + |
'document.body.contentEditable = true ;' + |
'window.focus() ;' + |
'})() )' ; |
var eFrameSpace = document.getElementById( 'xFrameSpace' ) ; |
eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' + |
'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ; |
var oFrame = eFrameSpace.firstChild ; |
if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ) |
{ |
// Avoid errors if the pasted content has any script that fails: #389 |
var oDoc = oFrame.contentWindow.document ; |
oDoc.open() ; |
oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ; |
oDoc.close() ; |
if ( FCKBrowserInfo.IsIE ) |
oDoc.body.contentEditable = true ; |
else |
oDoc.designMode = 'on' ; |
oFrame.contentWindow.focus(); |
} |
} |
else |
{ |
document.getElementById('txtData').style.display = '' ; |
document.getElementById('oWordCommands').style.display = 'none' ; |
} |
window.parent.SetOkButton( true ) ; |
window.parent.SetAutoSize( true ) ; |
if ( sPastingType != 'Word' ) |
document.getElementById('oWordCommands').style.display = 'none' ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
} |
function Ok() |
{ |
// Before doing anything, save undo snapshot. |
oEditor.FCKUndo.SaveUndoStep() ; |
var sHtml ; |
if ( window.parent.dialogArguments.CustomValue == 'Word' ) |
var sPastingType = dialog.Args().CustomValue ; |
if ( sPastingType == 'Word' || sPastingType == 'Security' ) |
{ |
var oFrame = document.getElementById('frmData') ; |
if ( oFrame.contentDocument ) |
sHtml = oFrame.contentDocument.body.innerHTML ; |
var oBody ; |
if ( oFrame.contentDocument ) |
oBody = oFrame.contentDocument.body ; |
else |
sHtml = oFrame.contentWindow.document.body.innerHTML ; |
oBody = oFrame.contentWindow.document.body ; |
sHtml = CleanWord( sHtml ) ; |
if ( sPastingType == 'Word' ) |
{ |
// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one |
if ( typeof( FCK.CustomCleanWord ) == 'function' ) |
sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ; |
else |
sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ; |
} |
else |
sHtml = oBody.innerHTML ; |
// Fix relative anchor URLs (IE automatically adds the current page URL). |
var re = new RegExp( window.location + "#", "g" ) ; |
sHtml = sHtml.replace( re, '#') ; |
} |
else |
{ |
var sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ; |
sHtml = sHtml.replace( /\n/g, '<BR>' ) ; |
sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ; |
sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ; |
// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :( |
// Use the marker method instead. It's primitive, but it works. |
var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ; |
var oDoc = oEditor.FCK.EditorDocument ; |
dialog.Selection.EnsureSelection() ; |
range.MoveToSelection() ; |
range.DeleteContents() ; |
var marker = [] ; |
for ( var i = 0 ; i < 5 ; i++ ) |
marker.push( parseInt(Math.random() * 100000, 10 ) ) ; |
marker = marker.join( "" ) ; |
range.InsertNode ( oDoc.createTextNode( marker ) ) ; |
var bookmark = range.CreateBookmark() ; |
// Now we've got a marker indicating the paste position in the editor document. |
// Find its position in the HTML code. |
var htmlString = oDoc.body.innerHTML ; |
var index = htmlString.indexOf( marker ) ; |
// Split it the HTML code up, add the code we generated, and put them back together. |
var htmlList = [] ; |
htmlList.push( htmlString.substr( 0, index ) ) ; |
htmlList.push( sHtml ) ; |
htmlList.push( htmlString.substr( index + marker.length ) ) ; |
htmlString = htmlList.join( "" ) ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
oEditor.FCK.SetInnerHtml( htmlString ) ; |
else |
oDoc.body.innerHTML = htmlString ; |
range.MoveToBookmark( bookmark ) ; |
range.Collapse( false ) ; |
range.Select() ; |
range.Release() ; |
return true ; |
} |
oEditor.FCK.InsertHtml( sHtml ) ; |
return true ; |
} |
function CleanUpBox() |
// This function will be called from the PasteFromWord dialog (fck_paste.html) |
// Input: oNode a DOM node that contains the raw paste from the clipboard |
// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog |
// Output: the cleaned string |
function CleanWord( oNode, bIgnoreFont, bRemoveStyles ) |
{ |
var oFrame = document.getElementById('frmData') ; |
if ( oFrame.contentDocument ) |
oFrame.contentDocument.body.innerHTML = '' ; |
else |
oFrame.contentWindow.document.body.innerHTML = '' ; |
} |
var html = oNode.innerHTML ; |
function CleanWord( html ) |
{ |
var bIgnoreFont = document.getElementById('chkRemoveFont').checked ; |
var bRemoveStyles = document.getElementById('chkRemoveStyles').checked ; |
html = html.replace(/<o:p>\s*<\/o:p>/g, '') ; |
html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, ' ') ; |
html = html.replace(/<o:p>\s*<\/o:p>/g, "") ; |
html = html.replace(/<o:p>.*?<\/o:p>/g, " ") ; |
// Remove mso-xxx styles. |
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ; |
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ; |
// Remove margin styles. |
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ; |
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ; |
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ; |
html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ; |
html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ; |
html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ; |
html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ; |
112,18 → 205,18 |
html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ; |
html = html.replace( /\s*tab-stops:[^;"]*;?/gi, "" ) ; |
html = html.replace( /\s*tab-stops:[^"]*/gi, "" ) ; |
html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ; |
html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ; |
// Remove FONT face attributes. |
if ( bIgnoreFont ) |
{ |
html = html.replace( /\s*face="[^"]*"/gi, "" ) ; |
html = html.replace( /\s*face=[^ >]*/gi, "" ) ; |
html = html.replace( /\s*face="[^"]*"/gi, '' ) ; |
html = html.replace( /\s*face=[^ >]*/gi, '' ) ; |
html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ; |
html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ; |
} |
// Remove Class attributes |
html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ; |
131,98 → 224,121 |
if ( bRemoveStyles ) |
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ; |
// Remove style, meta and link tags |
html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ; |
html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ; |
// Remove empty styles. |
html = html.replace( /\s*style="\s*"/gi, '' ) ; |
html = html.replace( /<SPAN\s*[^>]*>\s* \s*<\/SPAN>/gi, ' ' ) ; |
html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ; |
// Remove Lang attributes |
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; |
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ; |
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ; |
html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ; |
html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ; |
// Remove XML elements and declarations |
html = html.replace(/<\\?\?xml[^>]*>/gi, "") ; |
html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ; |
// Remove w: tags with contents. |
html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ; |
// Remove Tags with XML namespace declarations: <o:p><\/o:p> |
html = html.replace(/<\/?\w+:[^>]*>/gi, "") ; |
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ; |
// Remove comments [SF BUG-1481861]. |
html = html.replace(/<\!--.*-->/g, "") ; |
html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ; |
html = html.replace( /<(U|I|STRIKE)> <\/\1>/g, ' ' ) ; |
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ; |
html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ; |
html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ; |
html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ; |
html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ; |
html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ; |
html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ; |
// Remove "display:none" tags. |
html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ; |
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ; |
html = html.replace( /<(U|I|STRIKE)> <\/\1>/g, ' ' ) ; |
// Remove language tags |
html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ; |
// Remove empty tags (three times, just to be sure). |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
// Remove onmouseover and onmouseout events (from MS Word comments effect) |
html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ; |
html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ; |
// Transform <P> to <DIV> |
var re = new RegExp( "(<P)([^>]*>.*?)(<\/P>)", "gi" ) ; // Different because of a IE 5.0 error |
html = html.replace( re, "<div$2<\/div>" ) ; |
// Fix relative anchor URLs (IE automatically adds the current page URL). |
re = new RegExp( window.location + "#", "g" ) ; |
html = html.replace( re, '#') ; |
if ( FCKConfig.CleanWordKeepsStructure ) |
{ |
// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px"> |
html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ; |
// Word likes to insert extra <font> tags, when using MSIE. (Wierd). |
html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' ); |
html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' ); |
} |
else |
{ |
html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ; |
html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ; |
html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ; |
html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ; |
html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ; |
html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ; |
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ; |
// Transform <P> to <DIV> |
var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error |
html = html.replace( re, '<div$2<\/div>' ) ; |
// Remove empty tags (three times, just to be sure). |
// This also removes any empty anchor |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ; |
} |
return html ; |
} |
</script> |
</head> |
<body style="overflow: hidden"> |
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%"> |
<tr> |
<td> |
<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard |
(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span> |
<br /> |
|
<div id="xSecurityMsg" style="display: none"> |
<span fcklang="DlgPasteSec">Because of your browser security settings, |
the editor is not able to access your clipboard data directly. You are required |
to paste it again in this window.</span><br /> |
|
</div> |
<div> |
<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard |
(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br /> |
|
</div> |
</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"> |
<td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid"> |
<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none; |
width: 99%; height: 98%"></textarea> |
<iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0" |
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> |
<tr id="oWordCommands"> |
<td> |
<table border="0" cellpadding="0" cellspacing="0" width="100%"> |
<tr> |
<td nowrap="nowrap"> |
<input id="chkRemoveFont" type="checkbox" checked="checked" /> |
<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont"> |
Ignore Font Face definitions</label> |
<br /> |
<input id="chkRemoveStyles" type="checkbox" /> |
<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles"> |
Remove Styles definitions</label> |
</td> |
<td align="right" valign="top"> |
<input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" /> |
</td> |
</tr> |
</table> |
<input id="chkRemoveFont" type="checkbox" checked="checked" /> |
<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont"> |
Ignore Font Face definitions</label> |
<br /> |
<input id="chkRemoveStyles" type="checkbox" /> |
<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles"> |
Remove Styles definitions</label> |
</td> |
</tr> |
</table> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_textarea.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_textarea.html |
* Text Area dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Text Area dialog window. |
--> |
<html> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
window.onload = function() |
{ |
46,18 → 51,17 |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'TEXTAREA' ) ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
oActiveEl.name = GetE('txtName').value ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'TEXTAREA', {name: GetE('txtName').value} ) ; |
SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ; |
SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ; |
66,7 → 70,7 |
</script> |
</head> |
<body style='OVERFLOW: hidden' scroll='no'> |
<body style="overflow: hidden"> |
<table height="100%" width="100%"> |
<tr> |
<td align="center"> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_specialchar.html |
---|
1,34 → 1,39 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_specialchar.html |
* Special Chars Selector dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Special Chars Selector dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html> |
<head> |
<meta name="robots" content="noindex, nofollow"> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<style type="text/css"> |
.Hand |
{ |
.Hand |
{ |
cursor: pointer ; |
cursor: hand ; |
cursor: hand ; |
} |
.Sample { font-size: 24px; } |
</style> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
37,6 → 42,7 |
function insertChar(charValue) |
{ |
oEditor.FCKUndo.SaveUndoStep() ; |
oEditor.FCK.InsertHtml( charValue || "" ) ; |
window.parent.Cancel() ; |
} |
43,6 → 49,8 |
function over(td) |
{ |
if ( ! oSample ) |
return ; |
oSample.innerHTML = td.innerHTML ; |
td.className = 'LightBackground SpecialCharsOver Hand' ; |
} |
49,6 → 57,8 |
function out(td) |
{ |
if ( ! oSample ) |
return ; |
oSample.innerHTML = " " ; |
td.className = 'DarkBackground SpecialCharsOut Hand' ; |
} |
60,17 → 70,19 |
// First of all, translates the dialog box texts. |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
window.parent.SetAutoSize( true ) ; |
} |
</script> |
</HEAD> |
<BODY onload="setDefaults()" scroll="no"> |
</head> |
<body onload="setDefaults()" style="overflow: hidden"> |
<table cellpadding="0" cellspacing="0" width="100%" height="100%"> |
<tr> |
<td width="100%"> |
<table cellpadding="1" cellspacing="1" align="center" border="0" width="100%" height="100%"> |
<script type="text/javascript"> |
var aChars = ["!",""","#","$","%","&","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ","Œ","œ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"] ; |
var aChars = ["!",""","#","$","%","&","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"] ; |
var cols = 20 ; |
78,7 → 90,7 |
while (i < aChars.length) |
{ |
document.write("<TR>") ; |
for(var j = 0 ; j < cols ; j++) |
for(var j = 0 ; j < cols ; j++) |
{ |
if (aChars[i]) |
{ |
105,5 → 117,5 |
</td> |
</tr> |
</table> |
</BODY> |
</HTML> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_colorselector.html |
---|
1,22 → 1,26 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_colorselector.html |
* Color Selection dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Color Selection dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
30,8 → 34,9 |
#btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; } |
.ColorCell { height: 15px ; width: 15px ; } |
</style> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
function OnLoad() |
38,10 → 43,10 |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
CreateColorTable() ; |
window.parent.SetOkButton( true ) ; |
window.parent.SetOkButton( true ) ; |
window.parent.SetAutoSize( true ) ; |
} |
56,17 → 61,17 |
// 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 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] ) ; |
} |
} |
for ( var j = rangeB ; j < rangeB + 3 ; j++ ) |
{ |
for ( var n = 0 ; n < 6 ; n++ ) |
{ |
AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ; |
} |
} |
} |
} |
76,13 → 81,13 |
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 ; |
97,17 → 102,17 |
// 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] ) ; |
AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ; |
} |
// Fill the row with black cells. |
for ( var i = 0 ; i < 12 ; i++ ) |
{ |
AppendColorCell( oRow, '#000000' ) ; |
AppendColorCell( oRow, '#000000' ) ; |
} |
} |
131,8 → 136,8 |
function Ok() |
{ |
if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' ) |
window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ; |
if ( typeof(window.parent.Args().CustomValue) == 'function' ) |
window.parent.Args().CustomValue( document.getElementById('selcolor').value ) ; |
return true ; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_image.html |
---|
1,22 → 1,26 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_image.html |
* Image Properties dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Image Properties dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title>Image Properties</title> |
24,7 → 28,11 |
<meta name="robots" content="noindex, nofollow" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script src="fck_image/fck_image.js" type="text/javascript"></script> |
<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" /> |
<script type="text/javascript"> |
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; |
</script> |
</head> |
<body scroll="no" style="overflow: hidden"> |
<div id="divInfo"> |
156,7 → 164,9 |
<input id="txtUploadFile" style="width: 100%" type="file" size="40" name="NewFile" /><br /> |
<br /> |
<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" /> |
<iframe name="UploadWindow" style="display: none" src="../fckblank.html"></iframe> |
<script type="text/javascript"> |
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ; |
</script> |
</form> |
</div> |
<div id="divLink" style="display: none"> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_checkbox.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_checkbox.html |
* Checkbox dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Checkbox dialog window. |
--> |
<html> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
window.onload = function() |
{ |
46,21 → 51,17 |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; |
oActiveEl.type = 'checkbox' ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( GetE('txtName').value.length > 0 ) |
oActiveEl.name = GetE('txtName').value ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'checkbox' } ) ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
oActiveEl.value = GetE('txtValue').value ; |
else |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_spellerpages.html |
* Spell Check dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Spell Check dialog window. |
--> |
<html> |
<head> |
22,6 → 26,7 |
<title>Spell Check</title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<meta content="noindex, nofollow" name="robots"> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script src="fck_spellerpages/spellerpages/spellChecker.js"></script> |
<script type="text/javascript"> |
33,6 → 38,7 |
document.getElementById('txtHtml').value = oEditor.FCK.EditorDocument.body.innerHTML ; |
var oSpeller = new spellChecker( document.getElementById('txtHtml') ) ; |
oSpeller.spellCheckScript = oEditor.FCKConfig.SpellerPagesServerScript || 'server-scripts/spellchecker.php' ; |
oSpeller.OnFinished = oSpeller_OnFinished ; |
oSpeller.openChecker() ; |
} |
46,7 → 52,12 |
function oSpeller_OnFinished( numberOCorrections ) |
{ |
if ( numberOCorrections > 0 ) |
oEditor.FCK.SetHTML( document.getElementById('txtHtml').value ) ; |
{ |
oEditor.FCKUndo.SaveUndoStep() ; |
oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
oEditor.FCKSelection.Collapse( true ) ; |
} |
window.parent.Cancel() ; |
} |
54,6 → 65,6 |
</head> |
<body style="OVERFLOW: hidden" scroll="no" style="padding:0px;"> |
<input type="hidden" id="txtHtml" value=""> |
<iframe id="frmSpell" src="../fckblank.html" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe> |
<iframe id="frmSpell" src="javascript:void(0)" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_table.html |
---|
1,30 → 1,37 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_table.html |
* Table dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Table dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title>Table Properties</title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta name="robots" content="noindex, nofollow" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var dialogArguments = dialog.Args() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
31,7 → 38,7 |
// Gets the table if there is one selected. |
var table ; |
var e = oEditor.FCKSelection.GetSelectedElement() ; |
var e = dialog.Selection.GetSelectedElement() ; |
if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) ) |
e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ; |
57,7 → 64,7 |
if (iWidth.indexOf('%') >= 0) // Percentual = % |
{ |
iWidth = parseInt( iWidth.substr(0,iWidth.length - 1) ) ; |
iWidth = parseInt( iWidth.substr(0,iWidth.length - 1), 10 ) ; |
document.getElementById('selWidthType').value = "percent" ; |
} |
else if (iWidth.indexOf('px') >= 0) // Style Pixel = px |
65,27 → 72,31 |
iWidth = iWidth.substr(0,iWidth.length - 2); |
document.getElementById('selWidthType').value = "pixels" ; |
} |
if (iHeight && iHeight.indexOf('px') >= 0) // Style Pixel = px |
iHeight = iHeight.substr(0,iHeight.length - 2); |
document.getElementById('txtWidth').value = iWidth ; |
document.getElementById('txtHeight').value = iHeight ; |
document.getElementById('txtBorder').value = table.border ; |
document.getElementById('selAlignment').value = table.align ; |
document.getElementById('txtCellPadding').value = table.cellPadding ; |
document.getElementById('txtCellSpacing').value = table.cellSpacing ; |
document.getElementById('txtSummary').value = table.summary; |
document.getElementById('txtWidth').value = iWidth || '' ; |
document.getElementById('txtHeight').value = iHeight || '' ; |
document.getElementById('txtBorder').value = GetAttribute( table, 'border', '' ) ; |
document.getElementById('selAlignment').value = GetAttribute( table, 'align', '' ) ; |
document.getElementById('txtCellPadding').value = GetAttribute( table, 'cellPadding', '' ) ; |
document.getElementById('txtCellSpacing').value = GetAttribute( table, 'cellSpacing', '' ) ; |
document.getElementById('txtSummary').value = GetAttribute( table, 'summary', '' ) ; |
// document.getElementById('cmbFontStyle').value = table.className ; |
if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ; |
var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; |
if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ; |
document.getElementById('txtRows').disabled = true ; |
document.getElementById('txtColumns').disabled = true ; |
SelectField( 'txtWidth' ) ; |
} |
window.parent.SetOkButton( true ) ; |
window.parent.SetAutoSize( true ) ; |
else |
SelectField( 'txtRows' ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
} |
// Fired when the user press the OK button |
92,43 → 103,53 |
function Ok() |
{ |
var bExists = ( table != null ) ; |
if ( ! bExists ) |
{ |
table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ; |
} |
// Removes the Width and Height styles |
if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ; |
if ( bExists && table.style.height ) table.style.height = null ; //.removeAttribute("height") ; |
table.width = document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ; |
table.height = document.getElementById('txtHeight').value ; |
table.border = document.getElementById('txtBorder').value ; |
table.align = document.getElementById('selAlignment').value ; |
table.cellPadding = document.getElementById('txtCellPadding').value ; |
table.cellSpacing = document.getElementById('txtCellSpacing').value ; |
table.summary = document.getElementById('txtSummary').value ; |
// table.className = cmbFontStyle.value ; |
var sWidth = GetE('txtWidth').value ; |
if ( sWidth.length > 0 && GetE('selWidthType').value == 'percent' ) |
sWidth += '%' ; |
SetAttribute( table, 'width' , sWidth ) ; |
SetAttribute( table, 'height' , GetE('txtHeight').value ) ; |
SetAttribute( table, 'border' , GetE('txtBorder').value ) ; |
SetAttribute( table, 'align' , GetE('selAlignment').value ) ; |
SetAttribute( table, 'cellPadding' , GetE('txtCellPadding').value ) ; |
SetAttribute( table, 'cellSpacing' , GetE('txtCellSpacing').value ) ; |
SetAttribute( table, 'summary' , GetE('txtSummary').value ) ; |
var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; |
if ( document.getElementById('txtCaption').value != '') |
{ |
if (! table.caption) table.createCaption() ; |
table.caption.innerHTML = document.getElementById('txtCaption').value ; |
if ( !eCaption ) |
{ |
eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ; |
table.insertBefore( eCaption, table.firstChild ) ; |
} |
eCaption.innerHTML = document.getElementById('txtCaption').value ; |
} |
else if ( bExists && table.caption ) |
else if ( bExists && eCaption ) |
{ |
if ( document.all ) |
table.caption.innerHTML = '' ; // TODO: It causes an IE internal error if using removeChild. |
// TODO: It causes an IE internal error if using removeChild or |
// table.deleteCaption() (see #505). |
if ( oEditor.FCKBrowserInfo.IsIE ) |
eCaption.innerHTML = '' ; |
else |
table.caption.parentNode.removeChild( table.caption ) ; |
eCaption.parentNode.removeChild( eCaption ) ; |
} |
if (! bExists) |
{ |
var iRows = document.getElementById('txtRows').value ; |
var iCols = document.getElementById('txtColumns').value ; |
for ( var r = 0 ; r < iRows ; r++ ) |
{ |
var oRow = table.insertRow(-1) ; |
135,46 → 156,19 |
for ( var c = 0 ; c < iCols ; c++ ) |
{ |
var oCell = oRow.insertCell(-1) ; |
if ( oEditor.FCKBrowserInfo.IsGecko ) |
oCell.innerHTML = '<br _moz_editor_bogus_node="TRUE">' ; |
//oCell.innerHTML = " " ; |
if ( oEditor.FCKBrowserInfo.IsGeckoLike ) |
oEditor.FCKTools.AppendBogusBr( oCell ) ; |
} |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
// START iCM MODIFICATIONS |
// Amended to ensure that newly inserted tables are not incorrectly nested in P tags, etc |
// We insert the table first and then rectify any nestings afterwards so we can re-use the |
// FCKTablesProcessor function that corrects tables on SetHTML() |
/* |
table = oEditor.FCK.InsertElementAndGetIt( table ) ; |
if ( !oEditor.FCKConfig.UseBROnCarriageReturn ) |
{ |
oEditor.FCKTablesProcessor.CheckTableNesting( table ) ; |
} |
*/ |
// END iCM MODIFICATIONS |
oEditor.FCK.InsertElement( table ) ; |
} |
return 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 |
) ; |
} |
</script> |
</head> |
<body style="overflow: hidden"> |
280,18 → 274,6 |
</tr> |
</table> |
<table cellspacing="0" cellpadding="0" width="100%" border="0"> |
<!-- |
<tr> |
<td nowrap> |
<span fcklang="DlgClassName">Class Name</span>:</td> |
<td> </td> |
<td> |
<script type="text/javascript"> |
// var tbstyles = new TBCombo( "FontStyle" , "null" , "", oEditor.config.StyleNames, oEditor.config.StyleValues, 'CheckStyle("cmbFontStyle")'); |
// document.write(tbstyles.GetHTML()); |
</script></td> |
</tr> |
--> |
<tr> |
<td nowrap="nowrap"> |
<span fcklang="DlgTableCaption">Caption</span>: </td> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_tablecell.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_tablecell.html |
* Cell properties dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Cell properties dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
25,7 → 29,8 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
40,8 → 45,9 |
SetStartupValue() ; |
window.parent.SetOkButton( true ) ; |
window.parent.SetAutoSize( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtWidth' ) ; |
} |
function SetStartupValue() |
83,7 → 89,7 |
aCells[i].removeAttribute( 'width', 0 ) ; |
if ( GetE('selWordWrap').value == 'false' ) |
aCells[i].noWrap = true ; |
SetAttribute( aCells[i], 'noWrap', 'nowrap' ) ; |
else |
aCells[i].removeAttribute( 'noWrap' ) ; |
114,7 → 120,7 |
function SelectColor( wich ) |
{ |
oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ; |
oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ; |
} |
</script> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_textfield.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_textfield.html |
* Text field dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Text field dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
window.onload = function() |
{ |
44,13 → 49,13 |
GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ; |
GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ; |
GetE('txtType').value = oActiveEl.type ; |
GetE('txtType').disabled = true ; |
} |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
68,14 → 73,10 |
return false ; |
} |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; |
oActiveEl.type = GetE('txtType').value ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
oActiveEl.name = GetE('txtName').value ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ; |
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ; |
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ; |
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ; |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html |
---|
1,32 → 1,40 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_flash_preview.html |
* Preview page for the Flash dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Preview page for the Flash dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<html> |
<head> |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<meta name="robots" content="noindex, nofollow"> |
<link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" /> |
<script src="../common/fck_dialog_common.js" type="text/javascript"></script> |
<script language="javascript"> |
var FCKTools = window.parent.FCKTools ; |
var FCKConfig = window.parent.FCKConfig ; |
// Sets the Skin CSS |
document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; |
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ; |
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss( '../' ) ) ) ; |
if ( window.parent.FCKConfig.BaseHref.length > 0 ) |
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ; |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_flash/fck_flash.js |
---|
1,37 → 1,43 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_flash.js |
* Scripts related to the Flash dialog window (see fck_flash.html). |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Scripts related to the Flash dialog window (see fck_flash.html). |
*/ |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var FCKLang = oEditor.FCKLang ; |
var FCKConfig = oEditor.FCKConfig ; |
var FCKTools = oEditor.FCKTools ; |
//#### Dialog Tabs |
// Set the dialog tabs. |
window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ; |
dialog.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ; |
if ( FCKConfig.FlashUpload ) |
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; |
dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; |
if ( !FCKConfig.FlashDlgHideAdvanced ) |
window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ; |
dialog.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ; |
// Function called when a dialog tag is selected. |
function OnDialogTabChange( tabCode ) |
42,7 → 48,7 |
} |
// Get the selected flash embed (if available). |
var oFakeImage = FCK.Selection.GetSelectedElement() ; |
var oFakeImage = dialog.Selection.GetSelectedElement() ; |
var oEmbed ; |
if ( oFakeImage ) |
68,10 → 74,12 |
if ( FCKConfig.FlashUpload ) |
GetE('frmUpload').action = FCKConfig.FlashUploadURL ; |
window.parent.SetAutoSize( true ) ; |
dialog.SetAutoSize( true ) ; |
// Activate the "OK" button. |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
SelectField( 'txtUrl' ) ; |
} |
function LoadSelection() |
78,8 → 86,6 |
{ |
if ( ! oEmbed ) return ; |
var sUrl = GetAttribute( oEmbed, 'src', '' ) ; |
GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ; |
GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ; |
GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ; |
90,7 → 96,7 |
GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ; |
GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ; |
GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ; |
GetE('txtAttTitle').value = oEmbed.title ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
101,7 → 107,7 |
else |
{ |
GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ; |
GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ; |
GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) || '' ; |
} |
UpdatePreview() ; |
112,7 → 118,7 |
{ |
if ( GetE('txtUrl').value.length == 0 ) |
{ |
window.parent.SetSelectedTab( 'Info' ) ; |
dialog.SetSelectedTab( 'Info' ) ; |
GetE('txtUrl').focus() ; |
alert( oEditor.FCKLang.DlgAlertUrl ) ; |
120,6 → 126,7 |
return false ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( !oEmbed ) |
{ |
oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ; |
126,18 → 133,16 |
oFakeImage = null ; |
} |
UpdateEmbed( oEmbed ) ; |
if ( !oFakeImage ) |
{ |
oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ; |
oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ; |
oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; |
oFakeImage = FCK.InsertElement( oFakeImage ) ; |
} |
else |
oEditor.FCKUndo.SaveUndoStep() ; |
oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ; |
oEditor.FCKEmbedAndObjectProcessor.RefreshView( oFakeImage, oEmbed ) ; |
return true ; |
} |
146,15 → 151,15 |
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ; |
SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ; |
e.src = GetE('txtUrl').value ; |
SetAttribute( e, 'src', GetE('txtUrl').value ) ; |
SetAttribute( e, "width" , GetE('txtWidth').value ) ; |
SetAttribute( e, "height", GetE('txtHeight').value ) ; |
// Advances Attributes |
SetAttribute( e, 'id' , GetE('txtAttId').value ) ; |
SetAttribute( e, 'scale', GetE('cmbScale').value ) ; |
SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ; |
SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ; |
SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ; |
178,7 → 183,7 |
function SetPreviewElement( previewEl ) |
{ |
ePreview = previewEl ; |
if ( GetE('txtUrl').value.length > 0 ) |
UpdatePreview() ; |
} |
187,7 → 192,7 |
{ |
if ( !ePreview ) |
return ; |
while ( ePreview.firstChild ) |
ePreview.removeChild( ePreview.firstChild ) ; |
197,12 → 202,12 |
{ |
var oDoc = ePreview.ownerDocument || ePreview.document ; |
var e = oDoc.createElement( 'EMBED' ) ; |
e.src = GetE('txtUrl').value ; |
e.type = 'application/x-shockwave-flash' ; |
e.width = '100%' ; |
e.height = '100%' ; |
SetAttribute( e, 'src', GetE('txtUrl').value ) ; |
SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ; |
SetAttribute( e, 'width', '100%' ) ; |
SetAttribute( e, 'height', '100%' ) ; |
ePreview.appendChild( e ) ; |
} |
} |
217,20 → 222,24 |
function SetUrl( url, width, height ) |
{ |
GetE('txtUrl').value = url ; |
if ( width ) |
GetE('txtWidth').value = width ; |
if ( height ) |
if ( height ) |
GetE('txtHeight').value = height ; |
UpdatePreview() ; |
window.parent.SetSelectedTab( 'Info' ) ; |
dialog.SetSelectedTab( 'Info' ) ; |
} |
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) |
{ |
// Remove animation |
window.parent.Throbber.Hide() ; |
GetE( 'divUpload' ).style.display = '' ; |
switch ( errorNumber ) |
{ |
case 0 : // No errors |
251,6 → 260,9 |
case 203 : |
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; |
return ; |
case 500 : |
alert( 'The connector is disabled' ) ; |
break ; |
default : |
alert( 'Error on file upload. Error number: ' + errorNumber ) ; |
return ; |
266,13 → 278,13 |
function CheckUpload() |
{ |
var sFile = GetE('txtUploadFile').value ; |
if ( sFile.length == 0 ) |
{ |
alert( 'Please select a file to upload' ) ; |
return false ; |
} |
if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || |
( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) |
{ |
279,6 → 291,10 |
OnUploadCompleted( 202 ) ; |
return false ; |
} |
// Show animation |
window.parent.Throbber.Show( 100 ) ; |
GetE( 'divUpload' ).style.display = 'none' ; |
return true ; |
} |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_link/fck_link.js |
---|
1,41 → 1,48 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_link.js |
* Scripts related to the Link dialog window (see fck_link.html). |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Scripts related to the Link dialog window (see fck_link.html). |
*/ |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var FCKLang = oEditor.FCKLang ; |
var FCKConfig = oEditor.FCKConfig ; |
var FCKRegexLib = oEditor.FCKRegexLib ; |
var FCKTools = oEditor.FCKTools ; |
//#### Dialog Tabs |
// Set the dialog tabs. |
window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ; |
dialog.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ; |
if ( !FCKConfig.LinkDlgHideTarget ) |
window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ; |
dialog.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ; |
if ( FCKConfig.LinkUpload ) |
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ; |
dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ; |
if ( !FCKConfig.LinkDlgHideAdvanced ) |
window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; |
dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; |
// Function called when a dialog tag is selected. |
function OnDialogTabChange( tabCode ) |
45,76 → 52,223 |
ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; |
ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ; |
window.parent.SetAutoSize( true ) ; |
dialog.SetAutoSize( true ) ; |
} |
//#### Regular Expressions library. |
var oRegex = new Object() ; |
oRegex.UriProtocol = new RegExp('') ; |
oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ; |
oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ; |
oRegex.UrlOnChangeProtocol = new RegExp('') ; |
oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ; |
oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ; |
oRegex.UrlOnChangeTestOther = new RegExp('') ; |
//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ; |
oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ; |
oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ; |
oRegex.ReserveTarget = new RegExp('') ; |
oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ; |
oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ; |
oRegex.PopupUri = new RegExp('') ; |
oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ; |
oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ; |
oRegex.PopupFeatures = new RegExp('') ; |
oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ; |
// Accessible popups |
oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ; |
oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ; |
//#### Parser Functions |
var oParser = new Object() ; |
oParser.ParseEMailUrl = function( emailUrl ) |
// This method simply returns the two inputs in numerical order. You can even |
// provide strings, as the method would parseInt() the values. |
oParser.SortNumerical = function(a, b) |
{ |
return parseInt( a, 10 ) - parseInt( b, 10 ) ; |
} |
oParser.ParseEMailParams = function(sParams) |
{ |
// Initialize the oEMailParams object. |
var oEMailParams = new Object() ; |
oEMailParams.Subject = '' ; |
oEMailParams.Body = '' ; |
var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ; |
if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ; |
aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ; |
if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ; |
return oEMailParams ; |
} |
// This method returns either an object containing the email info, or FALSE |
// if the parameter is not an email link. |
oParser.ParseEMailUri = function( sUrl ) |
{ |
// Initializes the EMailInfo object. |
var oEMailInfo = new Object() ; |
oEMailInfo.Address = '' ; |
oEMailInfo.Subject = '' ; |
oEMailInfo.Body = '' ; |
oEMailInfo.Address = '' ; |
oEMailInfo.Subject = '' ; |
oEMailInfo.Body = '' ; |
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; |
if ( oParts ) |
var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ; |
if ( aLinkInfo && aLinkInfo[1] == 'mailto' ) |
{ |
// Set the e-mail address. |
oEMailInfo.Address = oParts[1] ; |
// This seems to be an unprotected email link. |
var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ; |
if ( aParts ) |
{ |
// Set the e-mail address. |
oEMailInfo.Address = aParts[1] ; |
// Look for the optional e-mail parameters. |
if ( oParts[2] ) |
// Look for the optional e-mail parameters. |
if ( aParts[2] ) |
{ |
var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ; |
oEMailInfo.Subject = oEMailParams.Subject ; |
oEMailInfo.Body = oEMailParams.Body ; |
} |
} |
return oEMailInfo ; |
} |
else if ( aLinkInfo && aLinkInfo[1] == 'javascript' ) |
{ |
// This may be a protected email. |
// Try to match the url against the EMailProtectionFunction. |
var func = FCKConfig.EMailProtectionFunction ; |
if ( func != null ) |
{ |
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; |
if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ; |
try |
{ |
// Escape special chars. |
func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ; |
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; |
if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ; |
// Define the possible keys. |
var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ; |
// Get the order of the keys (hold them in the array <pos>) and |
// the function replaced by regular expression patterns. |
var sFunc = func ; |
var pos = new Array() ; |
for ( var i = 0 ; i < keys.length ; i ++ ) |
{ |
var rexp = new RegExp( keys[i] ) ; |
var p = func.search( rexp ) ; |
if ( p >= 0 ) |
{ |
sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ; |
pos[pos.length] = p + ':' + keys[i] ; |
} |
} |
// Sort the available keys. |
pos.sort( oParser.SortNumerical ) ; |
// Replace the excaped single quotes in the url, such they do |
// not affect the regexp afterwards. |
aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ; |
// Create the regexp and execute it. |
var rFunc = new RegExp( '^' + sFunc + '$' ) ; |
var aMatch = rFunc.exec( aLinkInfo[2] ) ; |
if ( aMatch ) |
{ |
var aInfo = new Array(); |
for ( var i = 1 ; i < aMatch.length ; i ++ ) |
{ |
var k = pos[i-1].match(/^\d+:(.+)$/) ; |
aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ; |
} |
// Fill the EMailInfo object that will be returned |
oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ; |
oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ; |
oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ; |
return oEMailInfo ; |
} |
} |
catch (e) |
{ |
} |
} |
// Try to match the email against the encode protection. |
var aMatch = aLinkInfo[2].match( /^location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'$/ ) ; |
if ( aMatch ) |
{ |
// The link is encoded |
oEMailInfo.Address = eval( aMatch[1] ) ; |
if ( aMatch[2] ) |
{ |
var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ; |
oEMailInfo.Subject = oEMailParams.Subject ; |
oEMailInfo.Body = oEMailParams.Body ; |
} |
return oEMailInfo ; |
} |
} |
return oEMailInfo ; |
return false; |
} |
oParser.CreateEMailUri = function( address, subject, body ) |
{ |
// Switch for the EMailProtection setting. |
switch ( FCKConfig.EMailProtection ) |
{ |
case 'function' : |
var func = FCKConfig.EMailProtectionFunction ; |
if ( func == null ) |
{ |
if ( FCKConfig.Debug ) |
{ |
alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ; |
} |
return ''; |
} |
// Split the email address into name and domain parts. |
var aAddressParts = address.split( '@', 2 ) ; |
if ( aAddressParts[1] == undefined ) |
{ |
aAddressParts[1] = '' ; |
} |
// Replace the keys by their values (embedded in single quotes). |
func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ; |
func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ; |
func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ; |
func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ; |
return 'javascript:' + func ; |
case 'encode' : |
var aParams = [] ; |
var aAddressCode = [] ; |
if ( subject.length > 0 ) |
aParams.push( 'subject='+ encodeURIComponent( subject ) ) ; |
if ( body.length > 0 ) |
aParams.push( 'body=' + encodeURIComponent( body ) ) ; |
for ( var i = 0 ; i < address.length ; i++ ) |
aAddressCode.push( address.charCodeAt( i ) ) ; |
return 'javascript:location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\'' ; |
} |
// EMailProtection 'none' |
var sBaseUri = 'mailto:' + address ; |
var sParams = '' ; |
if ( subject.length > 0 ) |
sParams = '?subject=' + escape( subject ) ; |
sParams = '?subject=' + encodeURIComponent( subject ) ; |
if ( body.length > 0 ) |
{ |
sParams += ( sParams.length == 0 ? '?' : '&' ) ; |
sParams += 'body=' + escape( body ) ; |
sParams += 'body=' + encodeURIComponent( body ) ; |
} |
return sBaseUri + sParams ; |
123,7 → 277,7 |
//#### Initialization Code |
// oLink: The actual selected link in the editor. |
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; |
var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ; |
if ( oLink ) |
FCK.Selection.SelectNode( oLink ) ; |
151,8 → 305,27 |
if ( FCKConfig.LinkUpload ) |
GetE('frmUpload').action = FCKConfig.LinkUploadURL ; |
// Set the default target (from configuration). |
SetDefaultTarget() ; |
// Activate the "OK" button. |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
// Select the first field. |
switch( GetE('cmbLinkType').value ) |
{ |
case 'url' : |
SelectField( 'txtUrl' ) ; |
break ; |
case 'email' : |
SelectField( 'txtEMailAddress' ) ; |
break ; |
case 'anchor' : |
if ( GetE('divSelAnchor').style.display != 'none' ) |
SelectField( 'cmbAnchorName' ) ; |
else |
SelectField( 'cmbLinkType' ) ; |
} |
} |
var bHasAnchors ; |
159,31 → 332,39 |
function LoadAnchorNamesAndIds() |
{ |
// Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon |
// Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon |
// to edit them. So, we must look for that images now. |
var aAnchors = new Array() ; |
var i ; |
var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ; |
for( var i = 0 ; i < oImages.length ; i++ ) |
for( i = 0 ; i < oImages.length ; i++ ) |
{ |
if ( oImages[i].getAttribute('_fckanchor') ) |
aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ; |
} |
var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ; |
// Add also real anchors |
var oLinks = oEditor.FCK.EditorDocument.getElementsByTagName( 'A' ) ; |
for( i = 0 ; i < oLinks.length ; i++ ) |
{ |
if ( oLinks[i].name && ( oLinks[i].name.length > 0 ) ) |
aAnchors[ aAnchors.length ] = oLinks[i] ; |
} |
var aIds = FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ; |
bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ; |
for ( var i = 0 ; i < aAnchors.length ; i++ ) |
for ( i = 0 ; i < aAnchors.length ; i++ ) |
{ |
var sName = aAnchors[i].name ; |
if ( sName && sName.length > 0 ) |
oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ; |
FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ; |
} |
for ( var i = 0 ; i < aIds.length ; i++ ) |
for ( i = 0 ; i < aIds.length ; i++ ) |
{ |
oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ; |
FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ; |
} |
ShowE( 'divSelAnchor' , bHasAnchors ) ; |
199,8 → 380,8 |
// Get the actual Link href. |
var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; |
if ( sHRef == null ) |
sHRef = oLink.getAttribute( 'href' , 2 ) + '' ; |
sHRef = oLink.getAttribute( 'href' , 2 ) || '' ; |
// Look for a popup javascript link. |
var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ; |
if( oPopupMatch ) |
211,31 → 392,48 |
SetTarget( 'popup' ) ; |
} |
// Accessible popups, the popup data is in the onclick attribute |
if ( !oPopupMatch ) |
{ |
var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; |
if ( onclick ) |
{ |
// Decode the protected string |
onclick = decodeURIComponent( onclick ) ; |
oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ; |
if( oPopupMatch ) |
{ |
GetE( 'cmbTarget' ).value = 'popup' ; |
FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ; |
SetTarget( 'popup' ) ; |
} |
} |
} |
// Search for the protocol. |
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; |
if ( sProtocol ) |
// Search for a protected email link. |
var oEMailInfo = oParser.ParseEMailUri( sHRef ); |
if ( oEMailInfo ) |
{ |
sType = 'email' ; |
GetE('txtEMailAddress').value = oEMailInfo.Address ; |
GetE('txtEMailSubject').value = oEMailInfo.Subject ; |
GetE('txtEMailBody').value = oEMailInfo.Body ; |
} |
else if ( sProtocol ) |
{ |
sProtocol = sProtocol[0].toLowerCase() ; |
GetE('cmbLinkProtocol').value = sProtocol ; |
// Remove the protocol and get the remainig URL. |
// Remove the protocol and get the remaining URL. |
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; |
if ( sProtocol == 'mailto:' ) // It is an e-mail link. |
{ |
sType = 'email' ; |
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ; |
GetE('txtEMailAddress').value = oEMailInfo.Address ; |
GetE('txtEMailSubject').value = oEMailInfo.Subject ; |
GetE('txtEMailBody').value = oEMailInfo.Body ; |
} |
else // It is a normal link. |
{ |
sType = 'url' ; |
GetE('txtUrl').value = sUrl ; |
} |
sType = 'url' ; |
GetE('txtUrl').value = sUrl ; |
} |
else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. |
{ |
279,16 → 477,21 |
GetE('txtAttContentType').value = oLink.type ; |
GetE('txtAttCharSet').value = oLink.charset ; |
var sClass ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
GetE('txtAttClasses').value = oLink.getAttribute('className',2) || '' ; |
sClass = oLink.getAttribute('className',2) || '' ; |
// Clean up temporary classes for internal use: |
sClass = sClass.replace( FCKRegexLib.FCK_Class, '' ) ; |
GetE('txtAttStyle').value = oLink.style.cssText ; |
} |
else |
{ |
GetE('txtAttClasses').value = oLink.getAttribute('class',2) || '' ; |
GetE('txtAttStyle').value = oLink.getAttribute('style',2) ; |
sClass = oLink.getAttribute('class',2) || '' ; |
GetE('txtAttStyle').value = oLink.getAttribute('style',2) || '' ; |
} |
GetE('txtAttClasses').value = sClass ; |
// Update the Link type combo. |
GetE('cmbLinkType').value = sType ; |
302,16 → 505,16 |
ShowE('divLinkTypeEMail' , (linkType == 'email') ) ; |
if ( !FCKConfig.LinkDlgHideTarget ) |
window.parent.SetTabVisibility( 'Target' , (linkType == 'url') ) ; |
dialog.SetTabVisibility( 'Target' , (linkType == 'url') ) ; |
if ( FCKConfig.LinkUpload ) |
window.parent.SetTabVisibility( 'Upload' , (linkType == 'url') ) ; |
dialog.SetTabVisibility( 'Upload' , (linkType == 'url') ) ; |
if ( !FCKConfig.LinkDlgHideAdvanced ) |
window.parent.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ; |
dialog.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ; |
if ( linkType == 'email' ) |
window.parent.SetAutoSize( true ) ; |
dialog.SetAutoSize( true ) ; |
} |
//#### Target type selection. |
319,7 → 522,7 |
{ |
GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ; |
GetE('tdPopupName').style.display = |
GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ; |
GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ; |
switch ( targetType ) |
{ |
335,7 → 538,7 |
} |
if ( targetType == 'popup' ) |
window.parent.SetAutoSize( true ) ; |
dialog.SetAutoSize( true ) ; |
} |
//#### Called while the user types the URL. |
369,14 → 572,13 |
GetE('cmbTarget').value = 'frame' ; |
} |
//#### Builds the javascript URI to open a popup to the specified URI. |
function BuildPopupUri( uri ) |
// Accessible popups |
function BuildOnClickPopup() |
{ |
var oReg = new RegExp( "'", "g" ) ; |
var sWindowName = "'" + GetE('txtPopupName').value.replace(oReg, "\\'") + "'" ; |
var sWindowName = "'" + GetE('txtPopupName').value.replace(/\W/gi, "") + "'" ; |
var sFeatures = '' ; |
var aChkFeatures = document.getElementsByName('chkFeature') ; |
var aChkFeatures = document.getElementsByName( 'chkFeature' ) ; |
for ( var i = 0 ; i < aChkFeatures.length ; i++ ) |
{ |
if ( i > 0 ) sFeatures += ',' ; |
388,7 → 590,10 |
if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ; |
if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ; |
return ( "javascript:void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ; |
if ( sFeatures != '' ) |
sFeatures = sFeatures + ",status" ; |
return ( "window.open(this.href," + sWindowName + ",'" + sFeatures + "'); return false" ) ; |
} |
//#### Fills all Popup related fields. |
427,6 → 632,7 |
function Ok() |
{ |
var sUri, sInnerHtml ; |
oEditor.FCKUndo.SaveUndoStep() ; |
switch ( GetE('cmbLinkType').value ) |
{ |
441,18 → 647,6 |
sUri = GetE('cmbLinkProtocol').value + sUri ; |
if( GetE('cmbTarget').value == 'popup' ) |
{ |
// Check the window name, according to http://www.w3.org/TR/html4/types.html#type-frame-target (IE throw erros with spaces). |
if ( /(^[^a-zA-Z])|(\s)/.test( GetE('txtPopupName').value ) ) |
{ |
alert( FCKLang.DlnLnkMsgInvPopName ) ; |
return false ; |
} |
sUri = BuildPopupUri( sUri ) ; |
} |
break ; |
case 'email' : |
484,16 → 678,13 |
break ; |
} |
// No link selected, so try to create one. |
if ( !oLink ) |
oLink = oEditor.FCK.CreateLink( sUri ) ; |
if ( oLink ) |
sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL). |
else |
// If no link is selected, create a new one (it may result in more than one link creation - #220). |
var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri, true ) ; |
// If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26) |
var aHasSelection = ( aLinks.length > 0 ) ; |
if ( !aHasSelection ) |
{ |
// If no selection, use the uri as the link text (by dom, 2006-05-26) |
sInnerHtml = sUri; |
// Built a better text for empty links. |
519,47 → 710,85 |
} |
// Create a new (empty) anchor. |
oLink = oEditor.FCK.CreateElement( 'a' ) ; |
aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
for ( var i = 0 ; i < aLinks.length ; i++ ) |
{ |
oLink = aLinks[i] ; |
oLink.href = sUri ; |
SetAttribute( oLink, '_fcksavedurl', sUri ) ; |
if ( aHasSelection ) |
sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL). |
oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML |
oLink.href = sUri ; |
SetAttribute( oLink, '_fcksavedurl', sUri ) ; |
// Target |
if( GetE('cmbTarget').value != 'popup' ) |
SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; |
else |
SetAttribute( oLink, 'target', null ) ; |
var onclick; |
// Accessible popups |
if( GetE('cmbTarget').value == 'popup' ) |
{ |
onclick = BuildOnClickPopup() ; |
// Encode the attribute |
onclick = encodeURIComponent( " onclick=\"" + onclick + "\"" ) ; |
SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ; |
} |
else |
{ |
// Check if the previous onclick was for a popup: |
// In that case remove the onclick handler. |
onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; |
if ( onclick ) |
{ |
// Decode the protected string |
onclick = decodeURIComponent( onclick ) ; |
// Advances Attributes |
SetAttribute( oLink, 'id' , GetE('txtAttId').value ) ; |
SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; // No IE. Set but doesnt't update the outerHTML. |
SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ; |
SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ; |
SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; |
SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; |
SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ; |
SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ; |
SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ; |
if( oRegex.OnClickPopup.test( onclick ) ) |
SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ; |
} |
} |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
SetAttribute( oLink, 'className', GetE('txtAttClasses').value ) ; |
oLink.style.cssText = GetE('txtAttStyle').value ; |
oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML |
// Target |
if( GetE('cmbTarget').value != 'popup' ) |
SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; |
else |
SetAttribute( oLink, 'target', null ) ; |
// Let's set the "id" only for the first link to avoid duplication. |
if ( i == 0 ) |
SetAttribute( oLink, 'id', GetE('txtAttId').value ) ; |
// Advances Attributes |
SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; |
SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ; |
SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ; |
SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; |
SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; |
SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ; |
SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ; |
SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
var sClass = GetE('txtAttClasses').value ; |
// If it's also an anchor add an internal class |
if ( GetE('txtAttName').value.length != 0 ) |
sClass += ' FCK__AnchorC' ; |
SetAttribute( oLink, 'className', sClass ) ; |
oLink.style.cssText = GetE('txtAttStyle').value ; |
} |
else |
{ |
SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; |
SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; |
} |
} |
else |
{ |
SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; |
SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; |
} |
// Select the link. |
oEditor.FCKSelection.SelectNode(oLink); |
// Select the (first) link. |
oEditor.FCKSelection.SelectNode( aLinks[0] ); |
return true ; |
} |
570,13 → 799,17 |
function SetUrl( url ) |
{ |
document.getElementById('txtUrl').value = url ; |
GetE('txtUrl').value = url ; |
OnUrlChange() ; |
window.parent.SetSelectedTab( 'Info' ) ; |
dialog.SetSelectedTab( 'Info' ) ; |
} |
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) |
{ |
// Remove animation |
window.parent.Throbber.Hide() ; |
GetE( 'divUpload' ).style.display = '' ; |
switch ( errorNumber ) |
{ |
case 0 : // No errors |
597,6 → 830,9 |
case 203 : |
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; |
return ; |
case 500 : |
alert( 'The connector is disabled' ) ; |
break ; |
default : |
alert( 'Error on file upload. Error number: ' + errorNumber ) ; |
return ; |
612,13 → 848,13 |
function CheckUpload() |
{ |
var sFile = GetE('txtUploadFile').value ; |
if ( sFile.length == 0 ) |
{ |
alert( 'Please select a file to upload' ) ; |
return false ; |
} |
if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || |
( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) |
{ |
625,6 → 861,33 |
OnUploadCompleted( 202 ) ; |
return false ; |
} |
// Show animation |
window.parent.Throbber.Show( 100 ) ; |
GetE( 'divUpload' ).style.display = 'none' ; |
return true ; |
} |
} |
function SetDefaultTarget() |
{ |
var target = FCKConfig.DefaultLinkTarget || '' ; |
if ( oLink || target.length == 0 ) |
return ; |
switch ( target ) |
{ |
case '_blank' : |
case '_self' : |
case '_parent' : |
case '_top' : |
GetE('cmbTarget').value = target ; |
break ; |
default : |
GetE('cmbTarget').value = 'frame' ; |
break ; |
} |
GetE('txtTargetFrame').value = target ; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_radiobutton.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_radiobutton.html |
* Radio Button dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Radio Button dialog window. |
--> |
<html> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
window.onload = function() |
{ |
46,21 → 51,17 |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; |
oActiveEl.type = 'radio' ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( GetE('txtName').value.length > 0 ) |
oActiveEl.name = GetE('txtName').value ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'radio' } ) ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
oActiveEl.value = GetE('txtValue').value ; |
else |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_link.html |
---|
1,22 → 1,26 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_link.html |
* Link dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Link dialog window. |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<html> |
<head> |
<title>Link Properties</title> |
104,7 → 108,9 |
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br /> |
<br /> |
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> |
<iframe name="UploadWindow" style="DISPLAY: none" src="../fckblank.html"></iframe> |
<script type="text/javascript"> |
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ; |
</script> |
</form> |
</div> |
<div id="divTarget" style="DISPLAY: none"> |
144,21 → 150,21 |
<tr> |
<td valign="top" nowrap="nowrap" width="50%"> |
<input id="chkPopupResizable" name="chkFeature" value="resizable" type="checkbox" /><label for="chkPopupResizable" fckLang="DlgLnkPopResize">Resizable</label><br /> |
<input id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" /><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location |
<input id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" /><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location |
Bar</label><br /> |
<input id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu |
<input id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu |
Bar</label><br /> |
<input id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" /><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll |
<input id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" /><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll |
Bars</label> |
</td> |
<td></td> |
<td valign="top" nowrap="nowrap" width="50%"> |
<input id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" /><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status |
<input id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" /><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status |
Bar</label><br /> |
<input id="chkPopupToolbar" name="chkFeature" value="toolbar" type="checkbox" /><label for="chkPopupToolbar" fckLang="DlgLnkPopToolbar">Toolbar</label><br /> |
<input id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" /><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full |
<input id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" /><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full |
Screen (IE)</label><br /> |
<input id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" /><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent |
<input id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" /><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent |
(Netscape)</label> |
</td> |
</tr> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_flash.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_flash.html |
* Flash Properties dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Flash Properties dialog window. |
--> |
<html> |
<head> |
24,7 → 28,11 |
<meta content="noindex, nofollow" name="robots"> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script src="fck_flash/fck_flash.js" type="text/javascript"></script> |
<link href="common/fck_dialog_common.css" type="text/css" rel="stylesheet"> |
<script type="text/javascript"> |
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; |
</script> |
</head> |
<body scroll="no" style="OVERFLOW: hidden"> |
<div id="divInfo"> |
51,12 → 59,12 |
<TR> |
<TD nowrap> |
<span fckLang="DlgImgWidth">Width</span><br> |
<input id="txtWidth" class="FCK__FieldNumeric" type="text" size="3"> |
<input id="txtWidth" onkeypress="return IsDigit(event);" type="text" size="3"> |
</TD> |
<TD> </TD> |
<TD> |
<span fckLang="DlgImgHeight">Height</span><br> |
<input id="txtHeight" class="FCK__FieldNumeric" type="text" size="3"> |
<input id="txtHeight" onkeypress="return IsDigit(event);" type="text" size="3"> |
</TD> |
</TR> |
</table> |
88,7 → 96,9 |
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br /> |
<br /> |
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> |
<iframe name="UploadWindow" style="DISPLAY: none" src="../fckblank.html"></iframe> |
<script type="text/javascript"> |
document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ; |
</script> |
</form> |
</div> |
<div id="divAdvanced" style="DISPLAY: none"> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_hiddenfield.html |
---|
1,91 → 1,115 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_hiddenfield.html |
* Hidden Field dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Hidden Field dialog window. |
--> |
<html> |
<head> |
<title>Hidden Field Properties</title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<meta content="noindex, nofollow" name="robots"> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title>Hidden Field Properties</title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta content="noindex, nofollow" name="robots" /> |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oDOM = FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
// Get the selected flash embed (if available). |
var oFakeImage = dialog.Selection.GetSelectedElement() ; |
var oActiveEl ; |
if ( oFakeImage ) |
{ |
if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckinputhidden') ) |
oActiveEl = FCK.GetRealElement( oFakeImage ) ; |
else |
oFakeImage = null ; |
} |
window.onload = function() |
{ |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'hidden' ) |
if ( oActiveEl ) |
{ |
GetE('txtName').value = oActiveEl.name ; |
GetE('txtValue').value = oActiveEl.value ; |
} |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
} |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( !oActiveEl ) |
oEditor.FCKUndo.SaveUndoStep() ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'hidden' } ) ; |
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ; |
if ( !oFakeImage ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; |
oActiveEl.type = 'hidden' ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oActiveEl ) ; |
oFakeImage.setAttribute( '_fckinputhidden', 'true', 0 ) ; |
oActiveEl.parentNode.insertBefore( oFakeImage, oActiveEl ) ; |
oActiveEl.parentNode.removeChild( oActiveEl ) ; |
} |
oActiveEl.name = GetE('txtName').value ; |
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ; |
else |
oEditor.FCKUndo.SaveUndoStep() ; |
return true ; |
} |
</script> |
</head> |
<body style="OVERFLOW: hidden" scroll="no"> |
<table height="100%" width="100%"> |
<tr> |
<td align="center"> |
<table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%"> |
<tr> |
<td> |
<span fckLang="DlgHiddenName">Name</span><br> |
<input type="text" size="20" id="txtName" style="WIDTH: 100%"> |
</td> |
</tr> |
<tr> |
<td> |
<span fckLang="DlgHiddenValue">Value</span><br> |
<input type="text" size="30" id="txtValue" style="WIDTH: 100%"> |
</td> |
</tr> |
</table> |
</td> |
</tr> |
</table> |
</body> |
</script> |
</head> |
<body style="overflow: hidden" scroll="no"> |
<table height="100%" width="100%"> |
<tr> |
<td align="center"> |
<table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%"> |
<tr> |
<td> |
<span fcklang="DlgHiddenName">Name</span><br /> |
<input type="text" size="20" id="txtName" style="width: 100%" /> |
</td> |
</tr> |
<tr> |
<td> |
<span fcklang="DlgHiddenValue">Value</span><br /> |
<input type="text" size="30" id="txtValue" style="width: 100%" /> |
</td> |
</tr> |
</table> |
</td> |
</tr> |
</table> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/common/moz-bindings.xml |
---|
File deleted |
\ No newline at end of file |
/branches/livraison_aha/api/fckeditor/editor/dialog/common/fcknumericfield.htc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/common/fck_dialog_common.css |
---|
1,23 → 1,34 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_dialog_common.css |
* This is the CSS file used for interface details in some dialog |
* windows. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* This is the CSS file used for interface details in some dialog |
* windows. |
*/ |
/* ######### |
* WARNING |
* ######### |
* When changing this file, the minified version of it must be updated in the |
* fck_dialog_common.js file (see GetCommonDialogCss). |
*/ |
.ImagePreviewArea |
{ |
border: #000000 1px solid; |
72,8 → 83,3 |
cursor: pointer; |
cursor: hand; |
} |
.FCK__FieldNumeric |
{ |
behavior: url(common/fcknumericfield.htc) ; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/common/fck_dialog_common.js |
---|
1,22 → 1,66 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_dialog_common.js |
* Useful functions used by almost all dialog window pages. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Useful functions used by almost all dialog window pages. |
* Dialogs should link to this file as the very first script on the page. |
*/ |
// Automatically detect the correct document.domain (#123). |
(function() |
{ |
var d = document.domain ; |
while ( true ) |
{ |
// Test if we can access a parent property. |
try |
{ |
var test = window.parent.document.domain ; |
break ; |
} |
catch( e ) {} |
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... |
d = d.replace( /.*?(?:\.|$)/, '' ) ; |
if ( d.length == 0 ) |
break ; // It was not able to detect the domain. |
try |
{ |
document.domain = d ; |
} |
catch (e) |
{ |
break ; |
} |
} |
})() ; |
// Attention: FCKConfig must be available in the page. |
function GetCommonDialogCss( prefix ) |
{ |
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt). |
return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ; |
} |
// Gets a element by its Id. Used for shorter coding. |
function GetE( elementId ) |
{ |
45,41 → 89,67 |
if ( oAtt == null || !oAtt.specified ) |
return valueIfNull ? valueIfNull : '' ; |
var oValue ; |
if ( !( oValue = element.getAttribute( attName, 2 ) ) ) |
var oValue = element.getAttribute( attName, 2 ) ; |
if ( oValue == null ) |
oValue = oAtt.nodeValue ; |
return ( oValue == null ? valueIfNull : oValue ) ; |
} |
// Functions used by text fiels to accept numbers only. |
function IsDigit( e ) |
function SelectField( elementId ) |
{ |
if ( !e ) |
e = event ; |
var element = GetE( elementId ) ; |
element.focus() ; |
var iCode = ( e.keyCode || e.charCode ) ; |
return ( |
( iCode >= 48 && iCode <= 57 ) // Numbers |
|| (iCode >= 37 && iCode <= 40) // Arrows |
|| iCode == 8 // Backspace |
|| iCode == 46 // Delete |
) ; |
// element.select may not be available for some fields (like <select>). |
if ( element.select ) |
element.select() ; |
} |
String.prototype.trim = function() |
// Functions used by text fields to accept numbers only. |
var IsDigit = ( function() |
{ |
var KeyIdentifierMap = |
{ |
End : 35, |
Home : 36, |
Left : 37, |
Right : 39, |
'U+00007F' : 46 // Delete |
} ; |
return function ( e ) |
{ |
if ( !e ) |
e = event ; |
var iCode = ( e.keyCode || e.charCode ) ; |
if ( !iCode && e.keyIdentifier && ( e.keyIdentifier in KeyIdentifierMap ) ) |
iCode = KeyIdentifierMap[ e.keyIdentifier ] ; |
return ( |
( iCode >= 48 && iCode <= 57 ) // Numbers |
|| (iCode >= 35 && iCode <= 40) // Arrows, Home, End |
|| iCode == 8 // Backspace |
|| iCode == 46 // Delete |
|| iCode == 9 // Tab |
) ; |
} |
} )() ; |
String.prototype.Trim = function() |
{ |
return this.replace( /(^\s*)|(\s*$)/g, '' ) ; |
} |
String.prototype.startsWith = function( value ) |
String.prototype.StartsWith = function( value ) |
{ |
return ( this.substr( 0, value.length ) == value ) ; |
} |
String.prototype.remove = function( start, length ) |
String.prototype.Remove = function( start, length ) |
{ |
var s = '' ; |
95,12 → 165,12 |
String.prototype.ReplaceAll = function( searchArray, replaceArray ) |
{ |
var replaced = this ; |
for ( var i = 0 ; i < searchArray.length ; i++ ) |
{ |
replaced = replaced.replace( searchArray[i], replaceArray[i] ) ; |
} |
return replaced ; |
} |
107,7 → 177,7 |
function OpenFileBrowser( url, width, height ) |
{ |
// oEditor must be defined. |
var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ; |
var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ; |
117,32 → 187,125 |
sOptions += ",left=" + iLeft ; |
sOptions += ",top=" + iTop ; |
// The "PreserveSessionOnFileBrowser" because the above code could be |
// blocked by popup blockers. |
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE ) |
window.open( url, 'FCKBrowseWindow', sOptions ) ; |
} |
/** |
Utility function to create/update an element with a name attribute in IE, so it behaves properly when moved around |
It also allows to change the name or other special attributes in an existing node |
oEditor : instance of FCKeditor where the element will be created |
oOriginal : current element being edited or null if it has to be created |
nodeName : string with the name of the element to create |
oAttributes : Hash object with the attributes that must be set at creation time in IE |
Those attributes will be set also after the element has been |
created for any other browser to avoid redudant code |
*/ |
function CreateNamedElement( oEditor, oOriginal, nodeName, oAttributes ) |
{ |
var oNewNode ; |
// IE doesn't allow easily to change properties of an existing object, |
// so remove the old and force the creation of a new one. |
var oldNode = null ; |
if ( oOriginal && oEditor.FCKBrowserInfo.IsIE ) |
{ |
// The following change has been made otherwise IE will open the file |
// browser on a different server session (on some cases): |
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678 |
// by Simone Chiaretta. |
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ; |
if ( oWindow ) |
// Force the creation only if some of the special attributes have changed: |
var bChanged = false; |
for( var attName in oAttributes ) |
bChanged |= ( oOriginal.getAttribute( attName, 2) != oAttributes[attName] ) ; |
if ( bChanged ) |
{ |
// Detect Yahoo popup blocker. |
try |
oldNode = oOriginal ; |
oOriginal = null ; |
} |
} |
// If the node existed (and it's not IE), then we just have to update its attributes |
if ( oOriginal ) |
{ |
oNewNode = oOriginal ; |
} |
else |
{ |
// #676, IE doesn't play nice with the name or type attribute |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
var sbHTML = [] ; |
sbHTML.push( '<' + nodeName ) ; |
for( var prop in oAttributes ) |
{ |
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user. |
oWindow.opener = window ; |
sbHTML.push( ' ' + prop + '="' + oAttributes[prop] + '"' ) ; |
} |
catch(e) |
sbHTML.push( '>' ) ; |
if ( !oEditor.FCKListsLib.EmptyElements[nodeName.toLowerCase()] ) |
sbHTML.push( '</' + nodeName + '>' ) ; |
oNewNode = oEditor.FCK.EditorDocument.createElement( sbHTML.join('') ) ; |
// Check if we are just changing the properties of an existing node: copy its properties |
if ( oldNode ) |
{ |
alert( oEditor.FCKLang.BrowseServerBlocked ) ; |
CopyAttributes( oldNode, oNewNode, oAttributes ) ; |
oEditor.FCKDomTools.MoveChildren( oldNode, oNewNode ) ; |
oldNode.parentNode.removeChild( oldNode ) ; |
oldNode = null ; |
if ( oEditor.FCK.Selection.SelectionData ) |
{ |
// Trick to refresh the selection object and avoid error in |
// fckdialog.html Selection.EnsureSelection |
var oSel = oEditor.FCK.EditorDocument.selection ; |
oEditor.FCK.Selection.SelectionData = oSel.createRange() ; // Now oSel.type will be 'None' reflecting the real situation |
} |
} |
oNewNode = oEditor.FCK.InsertElement( oNewNode ) ; |
// FCK.Selection.SelectionData is broken by now since we've |
// deleted the previously selected element. So we need to reassign it. |
if ( oEditor.FCK.Selection.SelectionData ) |
{ |
var range = oEditor.FCK.EditorDocument.body.createControlRange() ; |
range.add( oNewNode ) ; |
oEditor.FCK.Selection.SelectionData = range ; |
} |
} |
else |
alert( oEditor.FCKLang.BrowseServerBlocked ) ; |
} |
else |
window.open( url, 'FCKBrowseWindow', sOptions ) ; |
} |
{ |
oNewNode = oEditor.FCK.InsertElement( nodeName ) ; |
} |
} |
// Set the basic attributes |
for( var attName in oAttributes ) |
oNewNode.setAttribute( attName, oAttributes[attName], 0 ) ; // 0 : Case Insensitive |
return oNewNode ; |
} |
// Copy all the attributes from one node to the other, kinda like a clone |
// But oSkipAttributes is an object with the attributes that must NOT be copied |
function CopyAttributes( oSource, oDest, oSkipAttributes ) |
{ |
var aAttributes = oSource.attributes ; |
for ( var n = 0 ; n < aAttributes.length ; n++ ) |
{ |
var oAttribute = aAttributes[n] ; |
if ( oAttribute.specified ) |
{ |
var sAttName = oAttribute.nodeName ; |
// We can set the type only once, so do it with the proper value, not copying it. |
if ( sAttName in oSkipAttributes ) |
continue ; |
var sAttValue = oSource.getAttribute( sAttName, 2 ) ; |
if ( sAttValue == null ) |
sAttValue = oAttribute.nodeValue ; |
oDest.setAttribute( sAttName, sAttValue, 0 ) ; // 0 : Case Insensitive |
} |
} |
// The style: |
oDest.style.cssText = oSource.style.cssText ; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_form.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_form.html |
* Form dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Form dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'FORM' ) ; |
var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( 'FORM' ) ; |
window.onload = function() |
{ |
37,7 → 42,7 |
// First of all, translate the dialog box texts |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
if ( oActiveEl ) |
if ( oActiveEl ) |
{ |
GetE('txtName').value = oActiveEl.name ; |
GetE('txtAction').value = oActiveEl.getAttribute( 'action', 2 ) ; |
46,7 → 51,9 |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
53,13 → 60,14 |
{ |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'FORM' ) ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
oActiveEl.innerHTML = ' ' ; |
oActiveEl = oEditor.FCK.InsertElement( 'form' ) ; |
if ( oEditor.FCKBrowserInfo.IsGeckoLike ) |
oEditor.FCKTools.AppendBogusBr( oActiveEl ) ; |
} |
oActiveEl.name = GetE('txtName').value ; |
SetAttribute( oActiveEl, 'action' , GetE('txtAction').value ) ; |
SetAttribute( oActiveEl, 'action', GetE('txtAction').value ) ; |
oActiveEl.method = GetE('txtMethod').value ; |
return true ; |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_about/lgpl.html |
---|
File deleted |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_anchor.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_anchor.html |
* Anchor dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Anchor dialog window. |
--> |
<html> |
<head> |
25,13 → 29,18 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var FCK = oEditor.FCK ; |
var FCKBrowserInfo = oEditor.FCKBrowserInfo ; |
var FCKTools = oEditor.FCKTools ; |
var FCKRegexLib = oEditor.FCKRegexLib ; |
var oFakeImage = FCK.Selection.GetSelectedElement() ; |
var oDOM = FCK.EditorDocument ; |
var oFakeImage = dialog.Selection.GetSelectedElement() ; |
var oAnchor ; |
if ( oFakeImage ) |
42,6 → 51,14 |
oFakeImage = null ; |
} |
//Search for a real anchor |
if ( !oFakeImage ) |
{ |
oAnchor = FCK.Selection.MoveToAncestorNode( 'A' ) ; |
if ( oAnchor ) |
FCK.Selection.SelectNode( oAnchor ) ; |
} |
window.onload = function() |
{ |
// First of all, translate the dialog box texts |
53,33 → 70,138 |
oAnchor = null ; |
window.parent.SetOkButton( true ) ; |
window.parent.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( GetE('txtName').value.length == 0 ) |
var sNewName = GetE('txtName').value ; |
// Remove any illegal character in a name attribute: |
// A name should start with a letter, but the validator passes anyway. |
sNewName = sNewName.replace( /[^\w-_\.:]/g, '_' ) ; |
if ( sNewName.length == 0 ) |
{ |
// Remove the anchor if the user leaves the name blank |
if ( oAnchor ) |
{ |
// Removes the current anchor from the document using the new command |
FCK.Commands.GetCommand( 'AnchorDelete' ).Execute() ; |
return true ; |
} |
alert( oEditor.FCKLang.DlgAnchorErrorName ) ; |
return false ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
oAnchor = FCK.EditorDocument.createElement( 'DIV' ) ; |
oAnchor.innerHTML = '<a name="' + GetE('txtName').value + '"><\/a>' ; |
oAnchor = oAnchor.firstChild ; |
oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor ) ; |
oFakeImage.setAttribute( '_fckanchor', 'true', 0 ) ; |
oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; |
if ( oAnchor ) // Modifying an existent anchor. |
{ |
ReadjustLinksToAnchor( oAnchor.name, sNewName ); |
// oEditor.FCK.InsertHtml( '<a name="' + GetE('txtName').value + '"><\/a>' ) ; |
// Buggy explorer, bad bad browser. http://alt-tag.com/blog/archives/2006/02/ie-dom-bugs/ |
// Instead of just replacing the .name for the existing anchor (in order to preserve the content), we must remove the .name |
// and assign .name, although it won't appear until it's specially processed in fckxhtml.js |
// We remove the previous name |
oAnchor.removeAttribute( 'name' ) ; |
// Now we set it, but later we must process it specially |
oAnchor.name = sNewName ; |
return true ; |
} |
// Create a new anchor preserving the current selection |
var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ; |
if ( aNewAnchors.length == 0 ) |
aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ; |
else |
{ |
// Remove the fake href |
for ( var i = 0 ; i < aNewAnchors.length ; i++ ) |
aNewAnchors[i].removeAttribute( 'href' ) ; |
} |
// More than one anchors may have been created, so interact through all of them (see #220). |
for ( var i = 0 ; i < aNewAnchors.length ; i++ ) |
{ |
oAnchor = aNewAnchors[i] ; |
// Set the name |
if ( FCKBrowserInfo.IsIE ) |
{ |
// Setting anchor names directly in IE will trash the HTML code stored |
// in FCKTempBin after undos. See #2263. |
var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' + |
FCKTools.HTMLEncode( sNewName ).replace( '"', '"' ) + '">' ) ; |
oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ; |
oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ; |
oAnchor = replaceAnchor ; |
} |
else |
oAnchor.name = sNewName ; |
// IE does require special processing to show the Anchor's image |
// Opera doesn't allow to select empty anchors |
if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera ) |
{ |
if ( oAnchor.innerHTML != '' ) |
{ |
if ( FCKBrowserInfo.IsIE ) |
oAnchor.className += ' FCK__AnchorC' ; |
} |
else |
{ |
// Create a fake image for both IE and Opera |
var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ; |
oImg.setAttribute( '_fckanchor', 'true', 0 ) ; |
oAnchor.parentNode.insertBefore( oImg, oAnchor ) ; |
oAnchor.parentNode.removeChild( oAnchor ) ; |
} |
} |
} |
return true ; |
} |
// Checks all the links in the current page pointing to the current name and changes them to the new name |
function ReadjustLinksToAnchor( sCurrent, sNew ) |
{ |
var oDoc = FCK.EditorDocument ; |
var aLinks = oDoc.getElementsByTagName( 'A' ) ; |
var sReference = '#' + sCurrent ; |
// The url of the document, so we check absolute and partial references. |
var sFullReference = oDoc.location.href.replace( /(#.*$)/, '') ; |
sFullReference += sReference ; |
var oLink ; |
var i = aLinks.length - 1 ; |
while ( i >= 0 && ( oLink = aLinks[i--] ) ) |
{ |
var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; |
if ( sHRef == null ) |
sHRef = oLink.getAttribute( 'href' , 2 ) || '' ; |
if ( sHRef == sReference || sHRef == sFullReference ) |
{ |
oLink.href = '#' + sNew ; |
SetAttribute( oLink, '_fcksavedurl', '#' + sNew ) ; |
} |
} |
} |
</script> |
</head> |
<body style="OVERFLOW: hidden" scroll="no"> |
<body style="overflow: hidden"> |
<table height="100%" width="100%"> |
<tr> |
<td align="center"> |
95,4 → 217,4 |
</tr> |
</table> |
</body> |
</html> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_button.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_button.html |
* Button dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Button dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
25,12 → 29,13 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
window.onload = function() |
{ |
42,25 → 47,21 |
GetE('txtName').value = oActiveEl.name ; |
GetE('txtValue').value = oActiveEl.value ; |
GetE('txtType').value = oActiveEl.type ; |
GetE('txtType').disabled = true ; |
} |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; |
oActiveEl.type = GetE('txtType').value ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
oActiveEl.name = GetE('txtName').value ; |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ; |
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ; |
return true ; |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_template.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_template.html |
* Template selection dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Template selection dialog window. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
63,9 → 67,9 |
// Translate the dialog box texts. |
oEditor.FCKLanguageManager.TranslatePage(document) ; |
GetE('xChkReplaceAll').checked = ( FCKConfig.TemplateReplaceAll !== false ) ; |
if ( FCKConfig.TemplateReplaceCheckbox !== false ) |
GetE('xReplaceBlock').style.display = '' ; |
76,6 → 80,8 |
function LoadTemplatesXml() |
{ |
var oTemplate ; |
if ( !FCK._Templates ) |
{ |
GetE('eLoading').style.display = '' ; |
96,28 → 102,28 |
for ( var i = 0 ; i < aTplNodes.length ; i++ ) |
{ |
var oNode = aTplNodes[i] |
var oNode = aTplNodes[i] ; |
var oTemplate = new Object() ; |
oTemplate = new Object() ; |
var oPart ; |
// Get the Template Title. |
if ( oPart = oNode.attributes.getNamedItem('title') ) |
if ( (oPart = oNode.attributes.getNamedItem('title')) ) |
oTemplate.Title = oPart.value ; |
else |
oTemplate.Title = 'Template ' + ( i + 1 ) ; |
// Get the Template Description. |
if ( oPart = oXml.SelectSingleNode( 'Description', oNode ) ) |
if ( (oPart = oXml.SelectSingleNode( 'Description', oNode )) ) |
oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ; |
// Get the Template Image. |
if ( oPart = oNode.attributes.getNamedItem('image') ) |
if ( (oPart = oNode.attributes.getNamedItem('image')) ) |
oTemplate.Image = sImagesBasePath + oPart.value ; |
// Get the Template HTML. |
if ( oPart = oXml.SelectSingleNode( 'Html', oNode ) ) |
if ( (oPart = oXml.SelectSingleNode( 'Html', oNode )) ) |
oTemplate.Html = oPart.text ? oPart.text : oPart.textContent ; |
else |
{ |
135,12 → 141,12 |
GetE('eEmpty').style.display = '' ; |
else |
{ |
for ( var i = 0 ; i < FCK._Templates.length ; i++ ) |
for ( var j = 0 ; j < FCK._Templates.length ; j++ ) |
{ |
var oTemplate = FCK._Templates[i] ; |
oTemplate = FCK._Templates[j] ; |
var oItemDiv = GetE('eList').appendChild( document.createElement( 'DIV' ) ) ; |
oItemDiv.TplIndex = i ; |
oItemDiv.TplIndex = j ; |
oItemDiv.className = 'TplItem' ; |
// Build the inner HTML of our new item DIV. |
157,7 → 163,7 |
sInner += '<\/td><\/tr><\/table>' ; |
oItemDiv.innerHTML = sInner ; |
oItemDiv.onmouseover = ItemDiv_OnMouseOver ; |
oItemDiv.onmouseout = ItemDiv_OnMouseOut ; |
oItemDiv.onclick = ItemDiv_OnClick ; |
185,7 → 191,7 |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( GetE('xChkReplaceAll').checked ) |
FCK.SetHTML( FCK._Templates[index].Html ) ; |
FCK.SetData( FCK._Templates[index].Html ) ; |
else |
FCK.InsertHtml( FCK._Templates[index].Html ) ; |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_select/fck_select.js |
---|
1,20 → 1,24 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_select.js |
* Scripts for the fck_select.html page. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Scripts for the fck_select.html page. |
*/ |
function Select( combo ) |
57,10 → 61,10 |
var oTxtText = document.getElementById( "txtText" ) ; |
var oTxtValue = document.getElementById( "txtValue" ) ; |
oListText.options[ iIndex ].innerHTML = oTxtText.value ; |
oListText.options[ iIndex ].innerHTML = HTMLEncode( oTxtText.value ) ; |
oListText.options[ iIndex ].value = oTxtText.value ; |
oListValue.options[ iIndex ].innerHTML = oTxtValue.value ; |
oListValue.options[ iIndex ].innerHTML = HTMLEncode( oTxtValue.value ) ; |
oListValue.options[ iIndex ].value = oTxtValue.value ; |
oTxtText.value = '' ; |
111,7 → 115,7 |
return ; |
var oOption = combo.options[ iActualIndex ] ; |
var sText = oOption.innerHTML ; |
var sText = HTMLDecode( oOption.innerHTML ) ; |
var sValue = oOption.value ; |
combo.remove( iActualIndex ) ; |
158,8 → 162,33 |
else |
combo.options.add( oOption ) ; |
oOption.innerHTML = optionText.length > 0 ? optionText : ' ' ; |
oOption.innerHTML = optionText.length > 0 ? HTMLEncode( optionText ) : ' ' ; |
oOption.value = optionValue ; |
return oOption ; |
} |
} |
function HTMLEncode( text ) |
{ |
if ( !text ) |
return '' ; |
text = text.replace( /&/g, '&' ) ; |
text = text.replace( /</g, '<' ) ; |
text = text.replace( />/g, '>' ) ; |
return text ; |
} |
function HTMLDecode( text ) |
{ |
if ( !text ) |
return '' ; |
text = text.replace( />/g, '>' ) ; |
text = text.replace( /</g, '<' ) ; |
text = text.replace( /&/g, '&' ) ; |
return text ; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_select.html |
---|
1,21 → 1,25 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_select.html |
* Select dialog window. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Select dialog window. |
--> |
<html> |
<head> |
26,12 → 30,13 |
<script type="text/javascript" src="fck_select/fck_select.js"></script> |
<script type="text/javascript"> |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
// Gets the document DOM |
var oDOM = oEditor.FCK.EditorDocument ; |
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; |
var oActiveEl = dialog.Selection.GetSelectedElement() ; |
var oListText ; |
var oListValue ; |
44,6 → 49,10 |
oListText = document.getElementById( 'cmbText' ) ; |
oListValue = document.getElementById( 'cmbValue' ) ; |
// Fix the lists widths. (Bug #970) |
oListText.style.width = oListText.offsetWidth ; |
oListValue.style.width = oListValue.offsetWidth ; |
if ( oActiveEl && oActiveEl.tagName == 'SELECT' ) |
{ |
GetE('txtName').value = oActiveEl.name ; |
54,7 → 63,7 |
// Load the actual options |
for ( var i = 0 ; i < oActiveEl.options.length ; i++ ) |
{ |
var sText = oActiveEl.options[i].innerHTML ; |
var sText = HTMLDecode( oActiveEl.options[i].innerHTML ) ; |
var sValue = oActiveEl.options[i].value ; |
AddComboOption( oListText, sText, sText ) ; |
64,22 → 73,21 |
else |
oActiveEl = null ; |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
dialog.SetAutoSize( true ) ; |
SelectField( 'txtName' ) ; |
} |
function Ok() |
{ |
oEditor.FCKUndo.SaveUndoStep() ; |
var sSize = GetE('txtLines').value ; |
if ( sSize == null || isNaN( sSize ) || sSize <= 1 ) |
sSize = '' ; |
if ( !oActiveEl ) |
{ |
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ; |
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; |
} |
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'SELECT', {name: GetE('txtName').value} ) ; |
SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ; |
SetAttribute( oActiveEl, 'size' , sSize ) ; |
oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ; |
108,7 → 116,7 |
</script> |
</head> |
<body style='OVERFLOW: hidden' scroll='no'> |
<body style="overflow: hidden"> |
<table width="100%" height="100%"> |
<tr> |
<td> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_image/fck_image_preview.html |
---|
1,40 → 1,49 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_image_preview.html |
* Preview page for the Image dialog window. |
* Curiosity: http://en.wikipedia.org/wiki/Lorem_ipsum |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Preview page for the Image dialog window. |
* |
* Curiosity: http://en.wikipedia.org/wiki/Lorem_ipsum |
--> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title></title> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
<meta name="robots" content="noindex, nofollow" /> |
<link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" /> |
<script src="../common/fck_dialog_common.js" type="text/javascript"></script> |
<script type="text/javascript"> |
// Sets the Skin CSS |
document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; |
var FCKTools = window.parent.FCKTools ; |
var FCKConfig = window.parent.FCKConfig ; |
// Set the preview CSS |
document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ; |
document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ; |
if ( window.parent.FCKConfig.BaseHref.length > 0 ) |
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ; |
window.onload = function() |
{ |
window.parent.SetPreviewElements( |
window.parent.SetPreviewElements( |
document.getElementById( 'imgPreview' ), |
document.getElementById( 'lnkPreview' ) ) ; |
} |
41,21 → 50,23 |
</script> |
</head> |
<body style="color: #000000; background-color: #ffffff"> |
<a id="lnkPreview" onclick="return false;" style="cursor: default"> |
<img id="imgPreview" onload="window.parent.UpdateOriginal();" style="display: none" /></a>Lorem |
ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. |
Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. |
Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis |
euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce |
mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. |
Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque |
egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, |
in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut |
placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy |
metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, |
ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris |
non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas |
elementum. Nunc imperdiet gravida mauris. |
<body> |
<div> |
<a id="lnkPreview" onclick="return false;" style="cursor: default"> |
<img id="imgPreview" onload="window.parent.UpdateOriginal();" |
style="display: none" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing |
elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus |
a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, |
nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed |
velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper |
nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices |
a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus |
faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget |
tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, |
tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis |
id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, |
eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur |
ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris. |
</div> |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_image/fck_image.js |
---|
1,27 → 1,33 |
/* |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 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/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: fck_image.js |
* Scripts related to the Image dialog window (see fck_image.html). |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* Scripts related to the Image dialog window (see fck_image.html). |
*/ |
var oEditor = window.parent.InnerDialogLoaded() ; |
var dialog = window.parent ; |
var oEditor = dialog.InnerDialogLoaded() ; |
var FCK = oEditor.FCK ; |
var FCKLang = oEditor.FCKLang ; |
var FCKConfig = oEditor.FCKConfig ; |
var FCKDebug = oEditor.FCKDebug ; |
var FCKTools = oEditor.FCKTools ; |
var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ; |
28,16 → 34,16 |
//#### Dialog Tabs |
// Set the dialog tabs. |
window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ; |
dialog.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ; |
if ( !bImageButton && !FCKConfig.ImageDlgHideLink ) |
window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ; |
dialog.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ; |
if ( FCKConfig.ImageUpload ) |
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; |
dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; |
if ( !FCKConfig.ImageDlgHideAdvanced ) |
window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; |
dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; |
// Function called when a dialog tag is selected. |
function OnDialogTabChange( tabCode ) |
49,13 → 55,13 |
} |
// Get the selected image (if available). |
var oImage = FCK.Selection.GetSelectedElement() ; |
var oImage = dialog.Selection.GetSelectedElement() ; |
if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) ) |
oImage = null ; |
// Get the active link. |
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; |
var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ; |
var oImageOriginal ; |
63,13 → 69,13 |
{ |
if ( !eImgPreview ) |
return ; |
if ( GetE('txtUrl').value.length == 0 ) |
{ |
oImageOriginal = null ; |
return ; |
} |
oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ; |
if ( resetSize ) |
107,10 → 113,12 |
if ( FCKConfig.ImageUpload ) |
GetE('frmUpload').action = FCKConfig.ImageUploadURL ; |
window.parent.SetAutoSize( true ) ; |
dialog.SetAutoSize( true ) ; |
// Activate the "OK" button. |
window.parent.SetOkButton( true ) ; |
dialog.SetOkButton( true ) ; |
SelectField( 'txtUrl' ) ; |
} |
function LoadSelection() |
131,24 → 139,26 |
var iWidth, iHeight ; |
var regexSize = /^\s*(\d+)px\s*$/i ; |
if ( oImage.style.width ) |
{ |
var aMatch = oImage.style.width.match( regexSize ) ; |
if ( aMatch ) |
var aMatchW = oImage.style.width.match( regexSize ) ; |
if ( aMatchW ) |
{ |
iWidth = aMatch[1] ; |
iWidth = aMatchW[1] ; |
oImage.style.width = '' ; |
SetAttribute( oImage, 'width' , iWidth ) ; |
} |
} |
if ( oImage.style.height ) |
{ |
var aMatch = oImage.style.height.match( regexSize ) ; |
if ( aMatch ) |
var aMatchH = oImage.style.height.match( regexSize ) ; |
if ( aMatchH ) |
{ |
iHeight = aMatch[1] ; |
iHeight = aMatchH[1] ; |
oImage.style.height = '' ; |
SetAttribute( oImage, 'height', iHeight ) ; |
} |
} |
160,21 → 170,26 |
GetE('cmbAttLangDir').value = oImage.dir ; |
GetE('txtAttLangCode').value = oImage.lang ; |
GetE('txtAttTitle').value = oImage.title ; |
GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ; |
GetE('txtLongDesc').value = oImage.longDesc ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
GetE('txtAttStyle').value = oImage.style.cssText ; |
{ |
GetE('txtAttClasses').value = oImage.className || '' ; |
GetE('txtAttStyle').value = oImage.style.cssText ; |
} |
else |
GetE('txtAttStyle').value = oImage.getAttribute('style',2) ; |
{ |
GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ; |
GetE('txtAttStyle').value = oImage.getAttribute('style',2) ; |
} |
if ( oLink ) |
{ |
var sUrl = oLink.getAttribute( '_fcksavedurl' ) ; |
if ( sUrl == null ) |
sUrl = oLink.getAttribute('href',2) ; |
GetE('txtLnkUrl').value = sUrl ; |
var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ; |
if ( sLinkUrl == null ) |
sLinkUrl = oLink.getAttribute('href',2) ; |
GetE('txtLnkUrl').value = sLinkUrl ; |
GetE('cmbLnkTarget').value = oLink.target ; |
} |
186,7 → 201,7 |
{ |
if ( GetE('txtUrl').value.length == 0 ) |
{ |
window.parent.SetSelectedTab( 'Info' ) ; |
dialog.SetSelectedTab( 'Info' ) ; |
GetE('txtUrl').focus() ; |
alert( FCKLang.DlgImgAlertUrl ) ; |
206,24 → 221,23 |
if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) ) |
oImage = null ; |
} |
oEditor.FCKUndo.SaveUndoStep() ; |
if ( !bHasImage ) |
{ |
if ( bImageButton ) |
{ |
oImage = FCK.EditorDocument.createElement( 'INPUT' ) ; |
oImage = FCK.EditorDocument.createElement( 'input' ) ; |
oImage.type = 'image' ; |
oImage = FCK.InsertElementAndGetIt( oImage ) ; |
oImage = FCK.InsertElement( oImage ) ; |
} |
else |
oImage = FCK.CreateElement( 'IMG' ) ; |
oImage = FCK.InsertElement( 'img' ) ; |
} |
else |
oEditor.FCKUndo.SaveUndoStep() ; |
UpdateImage( oImage ) ; |
var sLnkUrl = GetE('txtLnkUrl').value.trim() ; |
var sLnkUrl = GetE('txtLnkUrl').value.Trim() ; |
if ( sLnkUrl.length == 0 ) |
{ |
239,7 → 253,7 |
if ( !bHasImage ) |
oEditor.FCKSelection.SelectNode( oImage ) ; |
oLink = oEditor.FCK.CreateLink( sLnkUrl ) ; |
oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ; |
if ( !bHasImage ) |
{ |
275,13 → 289,18 |
SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ; |
SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ; |
SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; |
SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ; |
SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ; |
if ( oEditor.FCKBrowserInfo.IsIE ) |
{ |
e.className = GetE('txtAttClasses').value ; |
e.style.cssText = GetE('txtAttStyle').value ; |
} |
else |
{ |
SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ; |
SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; |
} |
} |
var eImgPreview ; |
294,7 → 313,7 |
UpdatePreview() ; |
UpdateOriginal() ; |
bPreviewInitialized = true ; |
} |
309,7 → 328,7 |
{ |
UpdateImage( eImgPreview, true ) ; |
if ( GetE('txtLnkUrl').value.trim().length > 0 ) |
if ( GetE('txtLnkUrl').value.Trim().length > 0 ) |
eImgPreviewLink.href = 'javascript:void(null);' ; |
else |
SetAttribute( eImgPreviewLink, 'href', '' ) ; |
338,11 → 357,11 |
// Fired when the width or height input texts change |
function OnSizeChanged( dimension, value ) |
{ |
// Verifies if the aspect ration has to be mantained |
// Verifies if the aspect ration has to be maintained |
if ( oImageOriginal && bLockRatio ) |
{ |
var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ; |
if ( value.length == 0 || isNaN( value ) ) |
{ |
e.value = '' ; |
365,6 → 384,11 |
function ResetSizes() |
{ |
if ( ! oImageOriginal ) return ; |
if ( oEditor.FCKBrowserInfo.IsGecko && !oImageOriginal.complete ) |
{ |
setTimeout( ResetSizes, 50 ) ; |
return ; |
} |
GetE('txtWidth').value = oImageOriginal.width ; |
GetE('txtHeight').value = oImageOriginal.height ; |
417,12 → 441,16 |
UpdatePreview() ; |
UpdateOriginal( true ) ; |
} |
window.parent.SetSelectedTab( 'Info' ) ; |
dialog.SetSelectedTab( 'Info' ) ; |
} |
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) |
{ |
// Remove animation |
window.parent.Throbber.Hide() ; |
GetE( 'divUpload' ).style.display = '' ; |
switch ( errorNumber ) |
{ |
case 0 : // No errors |
443,12 → 471,15 |
case 203 : |
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; |
return ; |
case 500 : |
alert( 'The connector is disabled' ) ; |
break ; |
default : |
alert( 'Error on file upload. Error number: ' + errorNumber ) ; |
return ; |
} |
sActualBrowser = '' |
sActualBrowser = '' ; |
SetUrl( fileUrl ) ; |
GetE('frmUpload').reset() ; |
} |
459,13 → 490,13 |
function CheckUpload() |
{ |
var sFile = GetE('txtUploadFile').value ; |
if ( sFile.length == 0 ) |
{ |
alert( 'Please select a file to upload' ) ; |
return false ; |
} |
if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || |
( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) |
{ |
472,6 → 503,10 |
OnUploadCompleted( 202 ) ; |
return false ; |
} |
// Show animation |
window.parent.Throbber.Show( 100 ) ; |
GetE( 'divUpload' ).style.display = 'none' ; |
return true ; |
} |
} |