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 ; |
} |
} |
|