Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773981
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 3, 1:16 AM
Size
25 KB
Mime Type
text/x-diff
Expires
Wed, Feb 5, 1:16 AM (24 m, 2 s)
Engine
blob
Format
Raw Data
Handle
557135
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_link.html
===================================================================
--- trunk/admin/editor/cmseditor/editor/dialog/fck_link.html (revision 2177)
+++ trunk/admin/editor/cmseditor/editor/dialog/fck_link.html (revision 2178)
@@ -1,189 +1,185 @@
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_link.html
* Link dialog window.
*
* Version: 2.0 RC3
* Modified: 2005-02-18 23:55:22
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Link 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 src="fck_link/fck_link.js" type="text/javascript"></script>
<script src="../filemanager/browser/default/js/fckxml.js" type="text/javascript"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<div id="divInfo">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><span fckLang="DlgLnkTo">Link To</span><br /></td>
<td> </td>
<td><div id="divNoMail1"><span fckLang="DlgLnkViewIn">View In</span><br /></div></td>
</tr>
<tr>
<td>
<select id="cmbLinkType" onchange="SetLinkType(this.value);">
- <option value="internal" fckLang="DlgLnkInternal">Internal Web Page</option>
- <option value="external" fckLang="DlgLnkEnternal">External Web Page</option>
- <option value="email" fckLang="DlgLnkTypeEMail">E-mail</option>
- <option value="Doc" fckLang="DlgLnkTypeFile">File</option>
</select>
</td>
<td> </td>
<td><div id="divNoMail2">
<select id="cmbTarget" onchange="SetTarget(this.value);">
<option value="" fckLang="DlgLnkTargetSelf">Same Window</option>
<option value="_blank" fckLang="DlgLnkTargetBlank">New Window</option>
<option value="popup" fckLang="DlgLnkTargetPopup"><popup window></option>
</select>
</div>
</td>
</tr>
</table>
<div id="divNoMail3">
<table cellspacing="0" cellpadding="0" border="0" style="WIDTH: 100%">
<tr>
<td><span fckLang="DlgLnkAltTxt">Alternative Text</span><br /></td>
</tr>
<tr>
<td><input id="txtAlt" style="WIDTH: 100%" type="text" /></td>
</tr>
</table>
</div>
</div>
<hr>
<div id="divLinkTypeExternal" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkProto">Type:</span><br />
<select id="cmbLinkProtocol">
<option value="http://" selected="selected">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
<option value="news://">news://</option>
<option value="" fckLang="DlgLnkProtoOther"><other></option>
</select>
</td>
</tr>
<tr>
<td nowrap="nowrap" width="100%">
<span fckLang="DlgLnkURL">Address:</span><br />
<input id="txtUrl" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />
</td>
</tr>
</table>
</div>
<div id="divLinkTypeInternal" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<span fckLang="DlgLnkInternalName">Internal Page Name:</span><br />
<select id="cmbImternalPagName" onchange="ChangeInternalUrl(this.value,this);">
</select><br />
</td>
</tr>
</table>
</div>
<div id="divLinkTypeFile" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!--
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkProto">Type:</span><br />
<select id="cmbLinkProtocol">
<option value="http://" selected="selected">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
</select>
</td>
</tr>
-->
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan='3'><span fckLang="DlgFileURL">File URL:</span></td>
</tr>
<tr>
<td><input id="fileUrl" style="WIDTH: 260px" type="text"></td>
<td> </td>
<td id="tdBrowse" nowrap>
<input id="btnBrowse2" onclick="BrowseServer('fileUrl'); " type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" NAME="btnBrowse">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divSelAnchor" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fckLang="DlgLnkAnchorSel">Select an Anchor:</span><br>
<select id="cmbAnchorName" style="WIDTH: 100%">
<option value="" selected="selected"></option>
</select>
</td>
</tr>
</table>
</div>
<div id="divNoAnchor" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fckLang="DlgLnkNoAnchors"><No anchors available in the document></span>
</td>
</tr>
</table>
</div>
<div id="divPopupSize" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr><td colspan='7'><img src='images/s.gif' width='1' height='5'></td></tr>
<tr>
<td><span fckLang="DlgLnkPopupWidth">PopUp Width:</span></td>
<td> </td>
<td><input id="txtPopupWidth" style="WIDTH: 30" type="text" /></td>
<td> </td>
<td><span fckLang="DlgLnkPopupHeight">PopUp Height:</span></td>
<td> </td>
<td><input id="txtPopupHeight" style="WIDTH: 30" type="text" /></td>
</tr>
</table>
</div>
<div id="divLinkTypeEMail" style="DISPLAY: none">
<span fckLang="DlgLnkEMail">E-Mail Address</span><br />
<input id="txtEMailAddress" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailSubject">Message Subject</span><br />
<input id="txtEMailSubject" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailBody">Message Body</span><br />
<textarea id="txtEMailBody" style="WIDTH: 100%" rows="3" cols="20"></textarea>
</div>
<iframe id="frmInternal" name="frmInternal" frameborder="0" scrolling="no" width='0' height='0' OnLoad="LoadAnchorNamesAndIds();" style="DISPLAY: none">
</iframe>
</body>
</html>
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_link.html
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js
===================================================================
--- trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (revision 2177)
+++ trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (revision 2178)
@@ -1,670 +1,670 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_link.js
* Scripts related to the Link dialog window (see fck_link.html).
*
* Version: 2.0 RC3
* Modified: 2005-02-09 13:53:13
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var ServerPath = '';
var from = '';
var anchor_ = '';
var links_path = new Array()
//#### Dialog Tabs
// Set the dialog tabs.
//window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
//window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
// TODO : Enable File Upload (1/3).
//window.parent.AddTab( 'Upload', 'Upload', true ) ;
//window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
// ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
// ShowE('divTarget' , ( tabCode == 'Target' ) ) ;
// TODO : Enable File Upload (2/3).
// ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
// ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ;
}
//#### Regular Expressions library.
var oRegex = new Object() ;
oRegex.UriProtocol = new RegExp('') ;
oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
oRegex.UrlOnChangeProtocol = new RegExp('') ;
oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
oRegex.UrlOnChangeTestOther = new RegExp('') ;
oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
oRegex.ReserveTarget = new RegExp('') ;
oRegex.ReserveTarget.compile( '^_(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.compile( "^javascript:openwincms\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*([^']*)\\s*,\\s*([^']*)\\s*\\)$" ) ;
oRegex.PopupFeatures = new RegExp('') ;
oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
//#### Parser Functions
var oParser = new Object() ;
oParser.ParseEMailUrl = function( emailUrl )
{
// Initializes the EMailInfo object.
var oEMailInfo = new Object() ;
oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ;
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
if ( oParts )
{
// Set the e-mail address.
oEMailInfo.Address = oParts[1] ;
// Look for the optional e-mail parameters.
if ( oParts[2] )
{
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ;
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ;
}
}
return oEMailInfo ;
}
oParser.CreateEMailUri = function( address, subject, body )
{
var sBaseUri = 'mailto:' + address ;
var sParams = '' ;
if ( subject.length > 0 )
sParams = '?subject=' + escape( subject ) ;
if ( body.length > 0 )
{
sParams += ( sParams.length == 0 ? '?' : '&' ) ;
sParams += 'body=' + escape( body ) ;
}
return sBaseUri + sParams ;
}
//#### Initialization Code
// oLink: The actual selected link in the editor.
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if ( oLink ) {
FCK.Selection.MoveToNode( oLink ) ;
//show_props(oLink.attributes, 'LINK: ')
}
function OnDialogTabChange( tabCode )
{
if (tabCode == 'Info') {
updateDataArray();
window.parent.document.getElementById('TitleArea').innerHTML = oEditor.FCKLang.DlgImgTitle;
}
}
function updateDataArray()
{
window.parent.parentData['linkTxtUrl'] = BuildUrlByType();
if (window.parent.parentData['linkTxtUrl'].length > 2) {
if (GetE('txtAlt')) {
window.parent.parentData['linkTxtAlt'] = GetE('txtAlt').value;
window.parent.parentData['linkTxtTitle'] = GetE('txtAlt').value;
}
window.parent.parentData['linkCmbTarget'] = GetE('cmbTarget').value;
window.parent.parentData['linkType'] = GetE('cmbLinkType').value;
window.location.href='dialog/fck_image.html?from';
}
}
window.onload = function()
{
CreateLinkTypes();
oEditor.FCKLanguageManager.TranslatePage(document) ;
LoadSelection() ;
GetE('divInfo').style.display = '' ;
window.parent.SetOkButton( true ) ;
}
var bHasAnchors ;
function CreateLinkTypes()
{
- if (typeof(oEditor.FCKConfig.LocalLinksEsists) != 'undefined')
+ if (typeof(oEditor.FCKConfig.InternalLinksEsists) != 'undefined')
{
- if (oEditor.FCKConfig.LocalLinksEsists != 'Off')
+ if (oEditor.FCKConfig.InternalLinksEsists != 'Off')
oEditor.FCKTools.AddSelectOption( document, GetE('cmbLinkType'), 'Internal Web Page', 'internal');
} else
oEditor.FCKTools.AddSelectOption( document, GetE('cmbLinkType'), 'Internal Web Page', 'internal');
oEditor.FCKTools.AddSelectOption( document, GetE('cmbLinkType'), 'External Web Page', 'external');
oEditor.FCKTools.AddSelectOption( document, GetE('cmbLinkType'), 'E-mail', 'email');
oEditor.FCKTools.AddSelectOption( document, GetE('cmbLinkType'), 'File', 'Doc');
}
function LoadAnchorNamesAndIds()
{
//alert('LoadAnchorNamesAndIds');
if (GetE('cmbLinkType').value != 'internal') {
ShowE( 'divNoAnchor' , 0 ) ;
return;
}
var aAnchors = window.frames["frmInternal"].document.anchors ;
//var aAnchors = oEditor.FCK.EditorDocument.anchors ;
//var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
if (aAnchors) {
bHasAnchors = ( aAnchors.length > 0) ;
if (GetE('cmbAnchorName').options.length > 0) {
GetE('cmbAnchorName').options.length = 0;
}
oEditor.FCKTools.AddSelectOption( document, GetE('cmbAnchorName'), '', '' ) ;
for ( var i = 0 ; i < aAnchors.length ; i++ )
{
var sName = aAnchors[i].name ;
if ( sName && sName.length > 0 ) {
oEditor.FCKTools.AddSelectOption( document, GetE('cmbAnchorName'), sName, sName ) ;
}
}
ShowE( 'divSelAnchor' , bHasAnchors ) ;
ShowE( 'divNoAnchor' , !bHasAnchors ) ;
for ( var i = 0 ; i < GetE('cmbAnchorName').length ; i++ )
{
if (anchor_ == GetE('cmbAnchorName').options[i].value)
GetE('cmbAnchorName').options[i].selected=1;
}
}
}
function LoadSelection()
{
var sHRef = '';
var sType = '';
if (window.parent.parentData['linkTxtUrl'])
{
sHRef = window.parent.parentData['linkTxtUrl'];
if (window.parent.parentData['linkTxtAlt'])
GetE('txtAlt').value = window.parent.parentData['linkTxtAlt'];
sType = GetE('cmbLinkType').value = window.parent.parentData['linkType'];
var sTarget = window.parent.parentData['linkCmbTarget'];
//alert('href: ' + sHRef + '\n'+'txtAlt: '+ GetE('txtAlt').value+'\n'+'sType: ' + sType+'\n'+'sTarget: ' + sTarget);
} else if ( !oLink ) {
SetLinkType('internal');
return ;
}
if (sHRef.length == 0)
{
// Get the actual Link href.
var sHRef = oLink.getAttribute('href',2) + '' ;
if (oLink.getAttribute('alt',2)) {
if(oLink.getAttribute('alt',2).length > 0)
GetE('txtAlt').value = oLink.getAttribute('alt',2) + '' ;
else
GetE('txtAlt').value = '';
}
// Look for a popup javascript link.
}
var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
if( oPopupMatch )
{
GetE('cmbTarget').value = 'popup' ;
sHRef = oPopupMatch[1] ;
GetE('txtPopupWidth').value = oPopupMatch[3];
GetE('txtPopupHeight').value = oPopupMatch[4];
SetTarget('popup');
}
// Search for the protocol.
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
if ( sProtocol )
{
sProtocol = sProtocol[0].toLowerCase() ;
GetE('cmbLinkProtocol').value = sProtocol ;
// Remove the protocol and get the remainig 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.
GetE('txtUrl').value = sUrl ;
}
else // It is another type of link.
{
GetE('cmbLinkProtocol').value = '' ;
GetE('txtUrl').value = sHRef ;
}
if (oLink) {
//if (!window.location.search)
if (sType.length == 0)
sType = GetAttribute( oLink, 'label', '' );
if (sType.length == 0)
sType = 'external';
}
if (sType == 'Doc' && sHRef.length > 2) {
GetE('fileUrl').value = sHRef ;
}
if (sType == 'internal' && sHRef.length > 2 && sHRef.indexOf('#') > 0) {
anchor_ = sHRef.slice(sHRef.lastIndexOf('#')+1);
sHRef = sHRef.slice(0,sHRef.lastIndexOf('#'));
GetE('txtUrl').value = sHRef ;
}
if ( !oPopupMatch )
{
// Get the target.
if (oLink)
var sTarget = oLink.target;
else if (window.parent.parentData['linkCmbTarget'])
var sTarget = window.parent.parentData['linkCmbTarget'];
if ( sTarget && sTarget.length > 0 )
{
if ( oRegex.ReserveTarget.test( sTarget ) )
{
sTarget = sTarget.toLowerCase() ;
GetE('cmbTarget').value = sTarget ;
}
else
GetE('cmbTarget').value = '' ;
}
}
GetE('cmbLinkType').value = sType ;
SetLinkType( sType );
}
//#### Link type selection.
function SetLinkType( linkType )
{
if (linkType == 'email') {
ShowE('divNoMail1',0);
ShowE('divNoMail2',0);
ShowE('divNoMail3',0);
} else {
ShowE('divNoMail1',1);
ShowE('divNoMail2',1);
ShowE('divNoMail3',1);
}
if (linkType != 'internal')
ShowE( 'divNoAnchor' , 0 ) ;
ShowE('divLinkTypeInternal' , (linkType == 'internal') ) ;
ShowE('divLinkTypeExternal' , (linkType == 'external') ) ;
ShowE('divLinkTypeEMail' , (linkType == 'email') ) ;
ShowE('divLinkTypeFile' , (linkType == 'Doc') ) ;
if(GetE('cmbTarget')) {
if (GetE('cmbTarget').value == 'popup' ) {
ShowE('divPopupSize',1);
} else
ShowE('divPopupSize',0);
} else
ShowE('divPopupSize',0);
if ( linkType == 'internal' ) {
LoadResources();
//LoadAnchorNamesAndIds();
}
if ( linkType == 'email')
window.parent.SetAutoSize( true ) ;
}
function LoadResources()
{
var oXML = new FCKXml() ;
var sConnUrl = 'filemanager/browser/default/connectors/php/connector.php?Command=GetCmsTree';
sConnUrl = window.location.href.replace( /dialog.*$/, '' ) + sConnUrl ;
oXML.LoadUrl(sConnUrl, GetCmsTreeCallBack ) ; // Asynchronous load.
}
function GetCmsTreeCallBack( fckXml )
{
//alert(show_props(fckXml, 'oNodes'));
var oNodes = fckXml.SelectNodes( 'Connector/CmsPages/CmsPage' ) ;
for ( var i = 0 ; i < oNodes.length ; i++ )
{
var sCmsPage = oNodes[i].attributes.getNamedItem('path').value ;
var sCmsId = oNodes[i].attributes.getNamedItem('st_id').value ;
var sTitle = oNodes[i].attributes.getNamedItem('title').value ;
ServerPath = oNodes[i].attributes.getNamedItem('serverpath').value;
if (LinkTypeID()) {
links_path[i] = sCmsPage;
GetE('cmbImternalPagName').options[i] = new Option(sTitle, SetIDtag(sCmsId));
}
else
GetE('cmbImternalPagName').options[i] = new Option(sTitle, sCmsPage);
if (GetE('txtUrl')) {
tmpUrl = GetE('txtUrl').value;
if (tmpUrl.length == 0 && i == 0) {
window.frames["frmInternal"].document.location.href = ServerPath + sCmsPage+GetAdmin();
}
//alert(tmpUrl+' === '+sCmsPage);
if (LinkTypeID())
{
if (tmpUrl == SetIDtag(sCmsId) || tmpUrl == SetIDtagAMP(sCmsId) || tmpUrl == SetIDtagNoLtQt(sCmsId)) {
GetE('cmbImternalPagName').options[i].selected=1;
//alert(ServerPath+sCmsPage+GetAdmin());
window.frames["frmInternal"].document.location.href = ServerPath+sCmsPage+GetAdmin();
}
} else {
if (tmpUrl.match(sCmsPage+'$')) {
GetE('cmbImternalPagName').options[i].selected=1;
//alert(tmpUrl+GetAdmin());
window.frames["frmInternal"].document.location.href = tmpUrl+GetAdmin();
}
}
}
}
}
function LinkTypeID()
{
if (typeof(oEditor.FCKConfig.LocalLinkType) != 'undefined')
{
if (oEditor.FCKConfig.LocalLinkType == 'ID')
return true;
}
return false;
}
function SetIDtagNoLtQt(id)
{
return "<%cms:GetBlockData id='"+id+"' field='href'%>";
}
function SetIDtag(id)
{
return "<%cms:GetBlockData id='"+id+"' field='href'%>";
}
function SetIDtagAMP(id)
{
return "&lt;%cms:GetBlockData id='"+id+"' field='href'%&gt;";
}
function ChangeInternalUrl(url,obj)
{
if(LinkTypeID()) {
for (var i=0; i < obj.options.length; i++) {
if (obj.options[i].value == url) {
url=links_path[i];
window.frames["frmInternal"].document.location.href = ServerPath + url + GetAdmin();
return;
}
}
} else
window.frames["frmInternal"].document.location.href = ServerPath + url+GetAdmin();
//window.frames["frmInternal"].document.location.onload = LoadAnchorNamesAndIds();
//LoadAnchorNamesAndIds();
}
function GetAdmin()
{
if (oEditor.FCKConfig.Admin == 1)
return "&admin=1";
}
function show_props(obj, objName) {
var result = "";
for (var i in obj) {
alert( objName + "." + i + " = " + obj[i] + " \n" );
}
}
//#### Target type selection.
function SetTarget( targetType )
{
switch ( targetType )
{
case "_blank" :
case "_self" :
case "_parent" :
case "_top" :
GetE('cmbTarget').value = targetType ;
break ;
case "" :
GetE('cmbTarget').value = '' ;
break ;
}
if ( targetType == 'popup' )
{
ShowE('divPopupSize',1);
window.parent.SetAutoSize( true ) ;
if (!GetE('txtPopupWidth').value)
GetE('txtPopupWidth').value = 800;
if (!GetE('txtPopupHeight').value)
GetE('txtPopupHeight').value = 600;
} else
ShowE('divPopupSize',0);
}
//#### Called while the user types the URL.
function OnUrlChange()
{
//alert("OnUrlChange "+ sUrl);
var sUrl = GetE('txtUrl').value ;
var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
if ( sProtocol )
{
sUrl = sUrl.substr( sProtocol[0].length ) ;
GetE('txtUrl').value = sUrl ;
GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ;
}
else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) )
{
GetE('cmbLinkProtocol').value = '' ;
}
}
//#### Called while the user types the target name.
function OnTargetNameChange()
{
}
//#### Builds the javascript URI to open a popup to the specified URI.
function BuildPopupUri( uri )
{
var ret = "javascript:openwincms('"+uri+"','popup',"+GetE('txtPopupWidth').value+","+GetE('txtPopupHeight').value+")";
return ret; //void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ;
}
//#### The OK button was hit.
function BuildUrlByType()
{
switch ( GetE('cmbLinkType').value )
{
case 'internal' :
if (LinkTypeID())
sUri = GetE('cmbImternalPagName').value
else
sUri = ServerPath+GetE('cmbImternalPagName').value;
//sUri = GetE('cmbLinkProtocol').value + sUri ;
//alert(sUri);
var cmbAnchorName = GetE('cmbAnchorName').value
if (cmbAnchorName.length > 0)
sUri = sUri+'#'+cmbAnchorName
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'Doc' :
sUri = GetE('fileUrl').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoUrl ) ;
return false ;
}
//sUri = sUri ;
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'external' :
sUri = GetE('txtUrl').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoUrl ) ;
return false ;
}
sUri = GetE('cmbLinkProtocol').value + sUri ;
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'email' :
sUri = GetE('txtEMailAddress').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoEMail ) ;
return false ;
}
sUri = oParser.CreateEMailUri(
sUri,
GetE('txtEMailSubject').value,
GetE('txtEMailBody').value ) ;
break ;
}
return sUri;
}
function Ok()
{
var sUri = BuildUrlByType();
if (sUri == false)
return false;
if (window.location.search.substr(1) == 'from') {
updateDataArray();
window.location.href='dialog/fck_image.html?create';
return ;
}
if ( oLink )
oLink.href = sUri ;
else
{
oLink = oEditor.FCK.CreateLink( sUri ) ;
if ( ! oLink )
return true ;
}
if( GetE('cmbTarget').value != 'popup' )
SetAttribute( oLink, 'target', GetE('cmbTarget').value ) ;
else
SetAttribute( oLink, 'target', null ) ;
if (GetE('txtAlt')) {
SetAttribute( oLink, 'alt', GetE('txtAlt').value) ;
SetAttribute( oLink, 'title', GetE('txtAlt').value) ;
}
SetAttribute( oLink, 'label', GetE('cmbLinkType').value)
/*
if ( oEditor.FCKBrowserInfo.IsIE )
oLink.style.cssText = GetE('txtAttStyle').value ;
else
SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
*/
return true ;
}
function show_props(obj, objName) {
var result = "";
for (var i in obj) {
result = objName + "." + i + " = " + obj[i] + " \n";
alert(result);
}
//return result;
}
function BrowseServer(field)
{
// Set the browser window feature
urlField = field;
var iWidth = oEditor.FCKConfig.ImageBrowserWindowWidth ;
var iHeight = oEditor.FCKConfig.ImageBrowserWindowHeight ;
var iLeft = (screen.width - iWidth) / 2 ;
var iTop = (screen.height - iHeight) / 2 ;
var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
sOptions += ",width=" + iWidth ;
sOptions += ",height=" + iHeight ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
// Open the browser window.
var oWindow = window.open( oEditor.FCKConfig.FilesBrowserURL, "FCKBrowseWindow", sOptions ) ;
}
function SetUrl( url, width, height, alt, fsize )
{
GetE(urlField).value = url ;
if ( alt )
GetE('txtAlt').value = alt;
}
\ No newline at end of file
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Event Timeline
Log In to Comment