Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 1... Line 1...
1
/*
1
/*
2
 * FCKeditor - The text editor for internet
2
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
3
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
-
 
4
 *
-
 
5
 * == BEGIN LICENSE ==
4
 * 
6
 *
5
 * Licensed under the terms of the GNU Lesser General Public License:
7
 * Licensed under the terms of any of the following licenses at your
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
8
 * choice:
7
 * 
9
 *
8
 * For further information visit:
10
 *  - GNU General Public License Version 2 or later (the "GPL")
9
 * 		http://www.fckeditor.net/
11
 *    http://www.gnu.org/licenses/gpl.html
10
 * 
12
 *
11
 * "Support Open Source software. What about a donation today?"
13
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
-
 
14
 *    http://www.gnu.org/licenses/lgpl.html
12
 * 
15
 *
13
 * File Name: fck_link.js
16
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
14
 * 	Scripts related to the Link dialog window (see fck_link.html).
17
 *    http://www.mozilla.org/MPL/MPL-1.1.html
15
 * 
18
 *
16
 * File Authors:
19
 * == END LICENSE ==
-
 
20
 *
17
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
21
 * Scripts related to the Link dialog window (see fck_link.html).
18
 * 		Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de)
-
 
19
 */
22
 */
Line -... Line 23...
-
 
23
 
20
 
24
var dialog	= window.parent ;
-
 
25
var oEditor = dialog.InnerDialogLoaded() ;
21
var oEditor		= window.parent.InnerDialogLoaded() ;
26
 
22
var FCK			= oEditor.FCK ;
27
var FCK			= oEditor.FCK ;
23
var FCKLang		= oEditor.FCKLang ;
28
var FCKLang		= oEditor.FCKLang ;
-
 
29
var FCKConfig	= oEditor.FCKConfig ;
-
 
30
var FCKRegexLib	= oEditor.FCKRegexLib ;
Line 24... Line 31...
24
var FCKConfig	= oEditor.FCKConfig ;
31
var FCKTools	= oEditor.FCKTools ;
Line 25... Line 32...
25
 
32
 
26
//#### Dialog Tabs
33
//#### Dialog Tabs
Line 27... Line 34...
27
 
34
 
28
// Set the dialog tabs.
35
// Set the dialog tabs.
Line 29... Line 36...
29
window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
36
dialog.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
30
 
37
 
Line 31... Line 38...
31
if ( !FCKConfig.LinkDlgHideTarget )
38
if ( !FCKConfig.LinkDlgHideTarget )
32
	window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
39
	dialog.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
Line 33... Line 40...
33
 
40
 
34
if ( FCKConfig.LinkUpload )
41
if ( FCKConfig.LinkUpload )
35
	window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ;
42
	dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ;
36
 
43
 
37
if ( !FCKConfig.LinkDlgHideAdvanced )
44
if ( !FCKConfig.LinkDlgHideAdvanced )
38
	window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
45
	dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
39
 
46
 
Line 40... Line 47...
40
// Function called when a dialog tag is selected.
47
// Function called when a dialog tag is selected.
41
function OnDialogTabChange( tabCode )
48
function OnDialogTabChange( tabCode )
Line 42... Line 49...
42
{
49
{
43
	ShowE('divInfo'		, ( tabCode == 'Info' ) ) ;
50
	ShowE('divInfo'		, ( tabCode == 'Info' ) ) ;
Line 44... Line 51...
44
	ShowE('divTarget'	, ( tabCode == 'Target' ) ) ;
51
	ShowE('divTarget'	, ( tabCode == 'Target' ) ) ;
-
 
52
	ShowE('divUpload'	, ( tabCode == 'Upload' ) ) ;
45
	ShowE('divUpload'	, ( tabCode == 'Upload' ) ) ;
53
	ShowE('divAttribs'	, ( tabCode == 'Advanced' ) ) ;
Line 46... Line 54...
46
	ShowE('divAttribs'	, ( tabCode == 'Advanced' ) ) ;
54
 
47
 
-
 
Line 48... Line 55...
48
	window.parent.SetAutoSize( true ) ;
55
	dialog.SetAutoSize( true ) ;
49
}
-
 
50
 
-
 
Line 51... Line -...
51
//#### Regular Expressions library.
-
 
52
var oRegex = new Object() ;
56
}
Line 53... Line 57...
53
 
57
 
54
oRegex.UriProtocol = new RegExp('') ;
58
//#### Regular Expressions library.
Line 55... Line -...
55
oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
-
 
56
 
59
var oRegex = new Object() ;
Line 57... Line 60...
57
oRegex.UrlOnChangeProtocol = new RegExp('') ;
60
 
Line 58... Line 61...
58
oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
61
oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ;
Line -... Line 62...
-
 
62
 
-
 
63
oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ;
-
 
64
 
-
 
65
oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ;
-
 
66
 
-
 
67
oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ;
-
 
68
 
-
 
69
oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ;
-
 
70
 
-
 
71
// Accessible popups
-
 
72
oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ;
-
 
73
 
-
 
74
oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
-
 
75
 
-
 
76
//#### Parser Functions
-
 
77
 
-
 
78
var oParser = new Object() ;
-
 
79
 
-
 
80
// This method simply returns the two inputs in numerical order. You can even
-
 
81
// provide strings, as the method would parseInt() the values.
-
 
82
oParser.SortNumerical = function(a, b)
-
 
83
{
-
 
84
	return parseInt( a, 10 ) - parseInt( b, 10 ) ;
-
 
85
}
-
 
86
 
59
 
87
oParser.ParseEMailParams = function(sParams)
60
oRegex.UrlOnChangeTestOther = new RegExp('') ;
88
{
61
//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
89
	// Initialize the oEMailParams object.
62
oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ; 
90
	var oEMailParams = new Object() ;
63
 
91
	oEMailParams.Subject = '' ;
64
oRegex.ReserveTarget = new RegExp('') ;
92
	oEMailParams.Body = '' ;
65
oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ;
93
 
-
 
94
	var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ;
-
 
95
	if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ;
-
 
96
 
-
 
97
	aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ;
-
 
98
	if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ;
-
 
99
 
-
 
100
	return oEMailParams ;
-
 
101
}
-
 
102
 
-
 
103
// This method returns either an object containing the email info, or FALSE
Line 66... Line 104...
66
 
104
// if the parameter is not an email link.
67
oRegex.PopupUri = new RegExp('') ;
105
oParser.ParseEMailUri = function( sUrl )
-
 
106
{
-
 
107
	// Initializes the EMailInfo object.
-
 
108
	var oEMailInfo = new Object() ;
-
 
109
	oEMailInfo.Address = '' ;
-
 
110
	oEMailInfo.Subject = '' ;
-
 
111
	oEMailInfo.Body = '' ;
-
 
112
 
-
 
113
	var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
-
 
114
	if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
68
oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ;
115
	{
69
 
116
		// This seems to be an unprotected email link.
70
oRegex.PopupFeatures = new RegExp('') ;
-
 
Line 71... Line 117...
71
oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
117
		var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
-
 
118
		if ( aParts )
72
 
119
		{
73
//#### Parser Functions
120
			// Set the e-mail address.
-
 
121
			oEMailInfo.Address = aParts[1] ;
-
 
122
 
-
 
123
			// Look for the optional e-mail parameters.
74
 
124
			if ( aParts[2] )
-
 
125
			{
-
 
126
				var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ;
75
var oParser = new Object() ;
127
				oEMailInfo.Subject = oEMailParams.Subject ;
Line -... Line 128...
-
 
128
				oEMailInfo.Body = oEMailParams.Body ;
-
 
129
			}
-
 
130
		}
-
 
131
		return oEMailInfo ;
-
 
132
	}
-
 
133
	else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )
-
 
134
	{
-
 
135
		// This may be a protected email.
-
 
136
 
-
 
137
		// Try to match the url against the EMailProtectionFunction.
-
 
138
		var func = FCKConfig.EMailProtectionFunction ;
-
 
139
		if ( func != null )
-
 
140
		{
-
 
141
			try
-
 
142
			{
-
 
143
				// Escape special chars.
-
 
144
				func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;
-
 
145
 
-
 
146
				// Define the possible keys.
-
 
147
				var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;
-
 
148
 
-
 
149
				// Get the order of the keys (hold them in the array <pos>) and
-
 
150
				// the function replaced by regular expression patterns.
-
 
151
				var sFunc = func ;
-
 
152
				var pos = new Array() ;
-
 
153
				for ( var i = 0 ; i < keys.length ; i ++ )
-
 
154
				{
-
 
155
					var rexp = new RegExp( keys[i] ) ;
-
 
156
					var p = func.search( rexp ) ;
-
 
157
					if ( p >= 0 )
76
 
158
					{
-
 
159
						sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;
-
 
160
						pos[pos.length] = p + ':' + keys[i] ;
-
 
161
					}
-
 
162
				}
-
 
163
 
-
 
164
				// Sort the available keys.
77
oParser.ParseEMailUrl = function( emailUrl )
165
				pos.sort( oParser.SortNumerical ) ;
-
 
166
 
-
 
167
				// Replace the excaped single quotes in the url, such they do
-
 
168
				// not affect the regexp afterwards.
-
 
169
				aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;
-
 
170
 
-
 
171
				// Create the regexp and execute it.
-
 
172
				var rFunc = new RegExp( '^' + sFunc + '$' ) ;
78
{
173
				var aMatch = rFunc.exec( aLinkInfo[2] ) ;
79
	// Initializes the EMailInfo object.
-
 
Line -... Line 174...
-
 
174
				if ( aMatch )
-
 
175
				{
-
 
176
					var aInfo = new Array();
-
 
177
					for ( var i = 1 ; i < aMatch.length ; i ++ )
-
 
178
					{
-
 
179
						var k = pos[i-1].match(/^\d+:(.+)$/) ;
-
 
180
						aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;
-
 
181
					}
-
 
182
 
-
 
183
					// Fill the EMailInfo object that will be returned
-
 
184
					oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;
-
 
185
					oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;
80
	var oEMailInfo = new Object() ;
186
					oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;
-
 
187
 
-
 
188
					return oEMailInfo ;
-
 
189
				}
81
	oEMailInfo.Address	= '' ;
190
			}
Line 82... Line 191...
82
	oEMailInfo.Subject	= '' ;
191
			catch (e)
83
	oEMailInfo.Body		= '' ;
192
			{
-
 
193
			}
-
 
194
		}
-
 
195
 
-
 
196
		// Try to match the email against the encode protection.
-
 
197
		var aMatch = aLinkInfo[2].match( /^location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'$/ ) ;
-
 
198
		if ( aMatch )
-
 
199
		{
-
 
200
			// The link is encoded
-
 
201
			oEMailInfo.Address = eval( aMatch[1] ) ;
-
 
202
			if ( aMatch[2] )
-
 
203
			{
-
 
204
				var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ;
-
 
205
				oEMailInfo.Subject = oEMailParams.Subject ;
-
 
206
				oEMailInfo.Body = oEMailParams.Body ;
-
 
207
			}
-
 
208
			return oEMailInfo ;
-
 
209
		}
-
 
210
	}
-
 
211
	return false;
-
 
212
}
-
 
213
 
-
 
214
oParser.CreateEMailUri = function( address, subject, body )
-
 
215
{
-
 
216
	// Switch for the EMailProtection setting.
-
 
217
	switch ( FCKConfig.EMailProtection )
-
 
218
	{
-
 
219
		case 'function' :
-
 
220
			var func = FCKConfig.EMailProtectionFunction ;
-
 
221
			if ( func == null )
-
 
222
			{
-
 
223
				if ( FCKConfig.Debug )
-
 
224
				{
-
 
225
					alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ;
-
 
226
				}
-
 
227
				return '';
-
 
228
			}
-
 
229
 
-
 
230
			// Split the email address into name and domain parts.
-
 
231
			var aAddressParts = address.split( '@', 2 ) ;
-
 
232
			if ( aAddressParts[1] == undefined )
-
 
233
			{
-
 
234
				aAddressParts[1] = '' ;
-
 
235
			}
-
 
236
 
-
 
237
			// Replace the keys by their values (embedded in single quotes).
84
 
238
			func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ;
Line 85... Line 239...
85
	var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
239
			func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ;
Line 86... Line 240...
86
	if ( oParts )
240
			func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ;
87
	{
241
			func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ;
Line 88... Line 242...
88
		// Set the e-mail address.
242
 
89
		oEMailInfo.Address = oParts[1] ;
243
			return 'javascript:' + func ;
90
 
244
 
91
		// Look for the optional e-mail parameters.
245
		case 'encode' :
92
		if ( oParts[2] )
246
			var aParams = [] ;
Line 93... Line 247...
93
		{
247
			var aAddressCode = [] ;
94
			var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
248
 
Line 95... Line 249...
95
			if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ;
249
			if ( subject.length > 0 )
Line 96... Line 250...
96
 
250
				aParams.push( 'subject='+ encodeURIComponent( subject ) ) ;
97
			oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
251
			if ( body.length > 0 )
98
			if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ;
252
				aParams.push( 'body=' + encodeURIComponent( body ) ) ;
99
		}
253
			for ( var i = 0 ; i < address.length ; i++ )
Line 100... Line 254...
100
	}
254
				aAddressCode.push( address.charCodeAt( i ) ) ;
101
 
255
 
Line 149... Line 303...
149
 
303
 
150
	// Set the actual uploader URL.
304
	// Set the actual uploader URL.
151
	if ( FCKConfig.LinkUpload )
305
	if ( FCKConfig.LinkUpload )
Line -... Line 306...
-
 
306
		GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
-
 
307
 
-
 
308
	// Set the default target (from configuration).
152
		GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
309
	SetDefaultTarget() ;
153
 
310
 
-
 
311
	// Activate the "OK" button.
-
 
312
	dialog.SetOkButton( true ) ;
-
 
313
 
-
 
314
	// Select the first field.
-
 
315
	switch( GetE('cmbLinkType').value )
-
 
316
	{
-
 
317
		case 'url' :
-
 
318
			SelectField( 'txtUrl' ) ;
-
 
319
			break ;
-
 
320
		case 'email' :
-
 
321
			SelectField( 'txtEMailAddress' ) ;
-
 
322
			break ;
-
 
323
		case 'anchor' :
-
 
324
			if ( GetE('divSelAnchor').style.display != 'none' )
-
 
325
				SelectField( 'cmbAnchorName' ) ;
-
 
326
			else
154
	// Activate the "OK" button.
327
				SelectField( 'cmbLinkType' ) ;
Line 155... Line 328...
155
	window.parent.SetOkButton( true ) ;
328
	}
Line 156... Line 329...
156
}
329
}
157
 
330
 
158
var bHasAnchors ;
331
var bHasAnchors ;
159
 
332
 
160
function LoadAnchorNamesAndIds()
333
function LoadAnchorNamesAndIds()
161
{
334
{
162
	// Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon 
335
	// Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon
163
	// to edit them. So, we must look for that images now.
336
	// to edit them. So, we must look for that images now.
164
	var aAnchors = new Array() ;
337
	var aAnchors = new Array() ;
165
	
338
	var i ;
166
	var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ;
339
	var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ;
167
	for( var i = 0 ; i < oImages.length ; i++ )
340
	for( i = 0 ; i < oImages.length ; i++ )
168
	{
341
	{
-
 
342
		if ( oImages[i].getAttribute('_fckanchor') )
-
 
343
			aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ;
-
 
344
	}
-
 
345
 
-
 
346
	// Add also real anchors
-
 
347
	var oLinks = oEditor.FCK.EditorDocument.getElementsByTagName( 'A' ) ;
-
 
348
	for( i = 0 ; i < oLinks.length ; i++ )
-
 
349
	{
169
		if ( oImages[i].getAttribute('_fckanchor') )
350
		if ( oLinks[i].name && ( oLinks[i].name.length > 0 ) )
Line 170... Line 351...
170
			aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ;
351
			aAnchors[ aAnchors.length ] = oLinks[i] ;
Line 171... Line 352...
171
	}
352
	}
172
	
353
 
173
	var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
354
	var aIds = FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
174
 
355
 
175
	bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
356
	bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
176
 
357
 
Line 177... Line 358...
177
	for ( var i = 0 ; i < aAnchors.length ; i++ )
358
	for ( i = 0 ; i < aAnchors.length ; i++ )
178
	{
359
	{
179
		var sName = aAnchors[i].name ;
360
		var sName = aAnchors[i].name ;
180
		if ( sName && sName.length > 0 )
361
		if ( sName && sName.length > 0 )
Line 181... Line 362...
181
			oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
362
			FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
182
	}
363
	}
183
 
364
 
Line 197... Line 378...
197
	var sType = 'url' ;
378
	var sType = 'url' ;
Line 198... Line 379...
198
 
379
 
199
	// Get the actual Link href.
380
	// Get the actual Link href.
200
	var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
381
	var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
201
	if ( sHRef == null )
382
	if ( sHRef == null )
202
		sHRef = oLink.getAttribute( 'href' , 2 ) + '' ;
383
		sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
203
	
384
 
204
	// Look for a popup javascript link.
385
	// Look for a popup javascript link.
205
	var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
386
	var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
206
	if( oPopupMatch )
387
	if( oPopupMatch )
207
	{
388
	{
208
		GetE('cmbTarget').value = 'popup' ;
389
		GetE('cmbTarget').value = 'popup' ;
209
		sHRef = oPopupMatch[1] ;
390
		sHRef = oPopupMatch[1] ;
210
		FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ;
391
		FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ;
211
		SetTarget( 'popup' ) ;
392
		SetTarget( 'popup' ) ;
Line -... Line 393...
-
 
393
	}
-
 
394
 
-
 
395
	// Accessible popups, the popup data is in the onclick attribute
-
 
396
	if ( !oPopupMatch )
-
 
397
	{
-
 
398
		var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
-
 
399
		if ( onclick )
-
 
400
		{
-
 
401
			// Decode the protected string
-
 
402
			onclick = decodeURIComponent( onclick ) ;
-
 
403
 
-
 
404
			oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
-
 
405
			if( oPopupMatch )
-
 
406
			{
-
 
407
				GetE( 'cmbTarget' ).value = 'popup' ;
-
 
408
				FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ;
-
 
409
				SetTarget( 'popup' ) ;
-
 
410
			}
-
 
411
		}
212
	}
412
	}
213
 
413
 
Line -... Line 414...
-
 
414
	// Search for the protocol.
-
 
415
	var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
-
 
416
 
-
 
417
	// Search for a protected email link.
-
 
418
	var oEMailInfo = oParser.ParseEMailUri( sHRef );
-
 
419
 
-
 
420
	if ( oEMailInfo )
-
 
421
	{
-
 
422
		sType = 'email' ;
-
 
423
 
-
 
424
		GetE('txtEMailAddress').value = oEMailInfo.Address ;
214
	// Search for the protocol.
425
		GetE('txtEMailSubject').value = oEMailInfo.Subject ;
215
	var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
426
		GetE('txtEMailBody').value    = oEMailInfo.Body ;
216
 
427
	}
217
	if ( sProtocol )
428
	else if ( sProtocol )
Line 218... Line 429...
218
	{
429
	{
219
		sProtocol = sProtocol[0].toLowerCase() ;
430
		sProtocol = sProtocol[0].toLowerCase() ;
220
		GetE('cmbLinkProtocol').value = sProtocol ;
-
 
221
 
-
 
222
		// Remove the protocol and get the remainig URL.
-
 
223
		var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
-
 
224
 
-
 
225
		if ( sProtocol == 'mailto:' )	// It is an e-mail link.
-
 
226
		{
-
 
227
			sType = 'email' ;
-
 
228
 
-
 
229
			var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
-
 
230
			GetE('txtEMailAddress').value	= oEMailInfo.Address ;
-
 
231
			GetE('txtEMailSubject').value	= oEMailInfo.Subject ;
-
 
232
			GetE('txtEMailBody').value		= oEMailInfo.Body ;
431
		GetE('cmbLinkProtocol').value = sProtocol ;
233
		}
432
 
234
		else				// It is a normal link.
-
 
235
		{
433
		// Remove the protocol and get the remaining URL.
236
			sType = 'url' ;
434
		var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
237
			GetE('txtUrl').value = sUrl ;
435
		sType = 'url' ;
238
		}
436
		GetE('txtUrl').value = sUrl ;
239
	}
437
	}
Line 277... Line 475...
277
	GetE('txtAttTabIndex').value	= oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
475
	GetE('txtAttTabIndex').value	= oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
278
	GetE('txtAttTitle').value		= oLink.title ;
476
	GetE('txtAttTitle').value		= oLink.title ;
279
	GetE('txtAttContentType').value	= oLink.type ;
477
	GetE('txtAttContentType').value	= oLink.type ;
280
	GetE('txtAttCharSet').value		= oLink.charset ;
478
	GetE('txtAttCharSet').value		= oLink.charset ;
Line -... Line 479...
-
 
479
 
281
 
480
	var sClass ;
282
	if ( oEditor.FCKBrowserInfo.IsIE )
481
	if ( oEditor.FCKBrowserInfo.IsIE )
283
	{
482
	{
-
 
483
		sClass	= oLink.getAttribute('className',2) || '' ;
-
 
484
		// Clean up temporary classes for internal use:
-
 
485
		sClass = sClass.replace( FCKRegexLib.FCK_Class, '' ) ;
284
		GetE('txtAttClasses').value	= oLink.getAttribute('className',2) || '' ;
486
 
285
		GetE('txtAttStyle').value	= oLink.style.cssText ;
487
		GetE('txtAttStyle').value	= oLink.style.cssText ;
286
	}
488
	}
287
	else
489
	else
288
	{
490
	{
289
		GetE('txtAttClasses').value	= oLink.getAttribute('class',2) || '' ;
491
		sClass	= oLink.getAttribute('class',2) || '' ;
290
		GetE('txtAttStyle').value	= oLink.getAttribute('style',2) ;
492
		GetE('txtAttStyle').value	= oLink.getAttribute('style',2) || '' ;
-
 
493
	}
Line 291... Line 494...
291
	}
494
	GetE('txtAttClasses').value	= sClass ;
292
 
495
 
293
	// Update the Link type combo.
496
	// Update the Link type combo.
Line 300... Line 503...
300
	ShowE('divLinkTypeUrl'		, (linkType == 'url') ) ;
503
	ShowE('divLinkTypeUrl'		, (linkType == 'url') ) ;
301
	ShowE('divLinkTypeAnchor'	, (linkType == 'anchor') ) ;
504
	ShowE('divLinkTypeAnchor'	, (linkType == 'anchor') ) ;
302
	ShowE('divLinkTypeEMail'	, (linkType == 'email') ) ;
505
	ShowE('divLinkTypeEMail'	, (linkType == 'email') ) ;
Line 303... Line 506...
303
 
506
 
304
	if ( !FCKConfig.LinkDlgHideTarget )
507
	if ( !FCKConfig.LinkDlgHideTarget )
Line 305... Line 508...
305
		window.parent.SetTabVisibility( 'Target'	, (linkType == 'url') ) ;
508
		dialog.SetTabVisibility( 'Target'	, (linkType == 'url') ) ;
306
 
509
 
Line 307... Line 510...
307
	if ( FCKConfig.LinkUpload )
510
	if ( FCKConfig.LinkUpload )
308
		window.parent.SetTabVisibility( 'Upload'	, (linkType == 'url') ) ;
511
		dialog.SetTabVisibility( 'Upload'	, (linkType == 'url') ) ;
Line 309... Line 512...
309
 
512
 
310
	if ( !FCKConfig.LinkDlgHideAdvanced )
513
	if ( !FCKConfig.LinkDlgHideAdvanced )
311
		window.parent.SetTabVisibility( 'Advanced'	, (linkType != 'anchor' || bHasAnchors) ) ;
514
		dialog.SetTabVisibility( 'Advanced'	, (linkType != 'anchor' || bHasAnchors) ) ;
Line 312... Line 515...
312
 
515
 
313
	if ( linkType == 'email' )
516
	if ( linkType == 'email' )
314
		window.parent.SetAutoSize( true ) ;
517
		dialog.SetAutoSize( true ) ;
315
}
518
}
316
 
519
 
317
//#### Target type selection.
520
//#### Target type selection.
Line 318... Line 521...
318
function SetTarget( targetType )
521
function SetTarget( targetType )
319
{
522
{
320
	GetE('tdTargetFrame').style.display	= ( targetType == 'popup' ? 'none' : '' ) ;
523
	GetE('tdTargetFrame').style.display	= ( targetType == 'popup' ? 'none' : '' ) ;
321
	GetE('tdPopupName').style.display	=
524
	GetE('tdPopupName').style.display	=
Line 333... Line 536...
333
			GetE('txtTargetFrame').value = '' ;
536
			GetE('txtTargetFrame').value = '' ;
334
			break ;
537
			break ;
335
	}
538
	}
Line 336... Line 539...
336
 
539
 
337
	if ( targetType == 'popup' )
540
	if ( targetType == 'popup' )
338
		window.parent.SetAutoSize( true ) ;
541
		dialog.SetAutoSize( true ) ;
Line 339... Line 542...
339
}
542
}
340
 
543
 
341
//#### Called while the user types the URL.
544
//#### Called while the user types the URL.
Line 367... Line 570...
367
		GetE('cmbTarget').value = sFrame.toLowerCase() ;
570
		GetE('cmbTarget').value = sFrame.toLowerCase() ;
368
	else
571
	else
369
		GetE('cmbTarget').value = 'frame' ;
572
		GetE('cmbTarget').value = 'frame' ;
370
}
573
}
Line 371... Line 574...
371
 
574
 
372
//#### Builds the javascript URI to open a popup to the specified URI.
575
// Accessible popups
373
function BuildPopupUri( uri )
576
function BuildOnClickPopup()
374
{
-
 
375
	var oReg = new RegExp( "'", "g" ) ;
577
{
Line 376... Line 578...
376
	var sWindowName = "'" + GetE('txtPopupName').value.replace(oReg, "\\'") + "'" ;
578
	var sWindowName = "'" + GetE('txtPopupName').value.replace(/\W/gi, "") + "'" ;
377
 
579
 
378
	var sFeatures = '' ;
580
	var sFeatures = '' ;
379
	var aChkFeatures = document.getElementsByName('chkFeature') ;
581
	var aChkFeatures = document.getElementsByName( 'chkFeature' ) ;
380
	for ( var i = 0 ; i < aChkFeatures.length ; i++ )
582
	for ( var i = 0 ; i < aChkFeatures.length ; i++ )
381
	{
583
	{
382
		if ( i > 0 ) sFeatures += ',' ;
584
		if ( i > 0 ) sFeatures += ',' ;
Line 386... Line 588...
386
	if ( GetE('txtPopupWidth').value.length > 0 )	sFeatures += ',width=' + GetE('txtPopupWidth').value ;
588
	if ( GetE('txtPopupWidth').value.length > 0 )	sFeatures += ',width=' + GetE('txtPopupWidth').value ;
387
	if ( GetE('txtPopupHeight').value.length > 0 )	sFeatures += ',height=' + GetE('txtPopupHeight').value ;
589
	if ( GetE('txtPopupHeight').value.length > 0 )	sFeatures += ',height=' + GetE('txtPopupHeight').value ;
388
	if ( GetE('txtPopupLeft').value.length > 0 )	sFeatures += ',left=' + GetE('txtPopupLeft').value ;
590
	if ( GetE('txtPopupLeft').value.length > 0 )	sFeatures += ',left=' + GetE('txtPopupLeft').value ;
389
	if ( GetE('txtPopupTop').value.length > 0 )		sFeatures += ',top=' + GetE('txtPopupTop').value ;
591
	if ( GetE('txtPopupTop').value.length > 0 )		sFeatures += ',top=' + GetE('txtPopupTop').value ;
Line -... Line 592...
-
 
592
 
-
 
593
	if ( sFeatures != '' )
-
 
594
		sFeatures = sFeatures + ",status" ;
390
 
595
 
391
	return ( "javascript:void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ;
596
	return ( "window.open(this.href," + sWindowName + ",'" + sFeatures + "'); return false" ) ;
Line 392... Line 597...
392
}
597
}
393
 
598
 
394
//#### Fills all Popup related fields.
599
//#### Fills all Popup related fields.
Line 425... Line 630...
425
 
630
 
426
//#### The OK button was hit.
631
//#### The OK button was hit.
427
function Ok()
632
function Ok()
428
{
633
{
-
 
634
	var sUri, sInnerHtml ;
Line 429... Line 635...
429
	var sUri, sInnerHtml ;
635
	oEditor.FCKUndo.SaveUndoStep() ;
430
 
636
 
431
	switch ( GetE('cmbLinkType').value )
637
	switch ( GetE('cmbLinkType').value )
432
	{
638
	{
Line 439... Line 645...
439
				return false ;
645
				return false ;
440
			}
646
			}
Line 441... Line 647...
441
 
647
 
Line 442... Line -...
442
			sUri = GetE('cmbLinkProtocol').value + sUri ;
-
 
443
 
-
 
444
			if( GetE('cmbTarget').value == 'popup' )
-
 
445
			{
-
 
446
				// Check the window name, according to http://www.w3.org/TR/html4/types.html#type-frame-target (IE throw erros with spaces).
-
 
447
				if ( /(^[^a-zA-Z])|(\s)/.test( GetE('txtPopupName').value ) )
-
 
448
				{
-
 
449
					alert( FCKLang.DlnLnkMsgInvPopName ) ;
-
 
450
					return false ;
-
 
451
				}
-
 
452
				
-
 
453
				sUri = BuildPopupUri( sUri ) ;
-
 
454
			}
648
			sUri = GetE('cmbLinkProtocol').value + sUri ;
Line 455... Line 649...
455
 
649
 
456
			break ;
650
			break ;
Line 482... Line 676...
482
 
676
 
483
			sUri = '#' + sAnchor ;
677
			sUri = '#' + sAnchor ;
484
			break ;
678
			break ;
Line 485... Line 679...
485
	}
679
	}
486
 
-
 
487
	// No link selected, so try to create one.
680
 
488
	if ( !oLink )
-
 
489
		oLink = oEditor.FCK.CreateLink( sUri ) ;
-
 
490
	
-
 
491
	if ( oLink )
-
 
492
		sInnerHtml = oLink.innerHTML ;		// Save the innerHTML (IE changes it if it is like an URL).
-
 
493
	else
-
 
Line -... Line 681...
-
 
681
	// If no link is selected, create a new one (it may result in more than one link creation - #220).
-
 
682
	var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri, true ) ;
-
 
683
 
-
 
684
	// If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26)
494
	{
685
	var aHasSelection = ( aLinks.length > 0 ) ;
Line 495... Line 686...
495
		// If no selection, use the uri as the link text (by dom, 2006-05-26)
686
	if ( !aHasSelection )
496
 
687
	{
497
		sInnerHtml = sUri;
688
		sInnerHtml = sUri;
Line 517... Line 708...
517
				sInnerHtml = GetE('txtEMailAddress').value ;
708
				sInnerHtml = GetE('txtEMailAddress').value ;
518
				break ;
709
				break ;
519
		}
710
		}
Line 520... Line 711...
520
 
711
 
521
		// Create a new (empty) anchor.
712
		// Create a new (empty) anchor.
522
		oLink = oEditor.FCK.CreateElement( 'a' ) ;
713
		aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ;
Line -... Line 714...
-
 
714
	}
-
 
715
 
523
	}
716
	for ( var i = 0 ; i < aLinks.length ; i++ )
Line 524... Line 717...
524
 
717
	{
525
	oEditor.FCKUndo.SaveUndoStep() ;
718
		oLink = aLinks[i] ;
Line -... Line 719...
-
 
719
 
526
 
720
		if ( aHasSelection )
Line 527... Line 721...
527
	oLink.href = sUri ;
721
			sInnerHtml = oLink.innerHTML ;		// Save the innerHTML (IE changes it if it is like an URL).
-
 
722
 
528
	SetAttribute( oLink, '_fcksavedurl', sUri ) ;
723
		oLink.href = sUri ;
-
 
724
		SetAttribute( oLink, '_fcksavedurl', sUri ) ;
-
 
725
 
-
 
726
		var onclick;
-
 
727
		// Accessible popups
529
 
728
		if( GetE('cmbTarget').value == 'popup' )
-
 
729
		{
530
	oLink.innerHTML = sInnerHtml ;		// Set (or restore) the innerHTML
730
			onclick = BuildOnClickPopup() ;
-
 
731
			// Encode the attribute
-
 
732
			onclick = encodeURIComponent( " onclick=\"" + onclick + "\"" )  ;
-
 
733
			SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ;
531
 
734
		}
-
 
735
		else
-
 
736
		{
-
 
737
			// Check if the previous onclick was for a popup:
-
 
738
			// In that case remove the onclick handler.
Line 532... Line -...
532
	// Target
-
 
533
	if( GetE('cmbTarget').value != 'popup' )
739
			onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
534
		SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ;
-
 
535
	else
-
 
536
		SetAttribute( oLink, 'target', null ) ;
-
 
537
 
-
 
538
	// Advances Attributes
-
 
539
	SetAttribute( oLink, 'id'		, GetE('txtAttId').value ) ;
740
			if ( onclick )
540
	SetAttribute( oLink, 'name'		, GetE('txtAttName').value ) ;		// No IE. Set but doesnt't update the outerHTML.
-
 
541
	SetAttribute( oLink, 'dir'		, GetE('cmbAttLangDir').value ) ;
-
 
-
 
741
			{
-
 
742
				// Decode the protected string
Line -... Line 743...
-
 
743
				onclick = decodeURIComponent( onclick ) ;
-
 
744
 
-
 
745
				if( oRegex.OnClickPopup.test( onclick ) )
-
 
746
					SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ;
-
 
747
			}
-
 
748
		}
-
 
749
 
-
 
750
		oLink.innerHTML = sInnerHtml ;		// Set (or restore) the innerHTML
-
 
751
 
-
 
752
		// Target
-
 
753
		if( GetE('cmbTarget').value != 'popup' )
-
 
754
			SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ;
-
 
755
		else
-
 
756
			SetAttribute( oLink, 'target', null ) ;
-
 
757
 
-
 
758
		// Let's set the "id" only for the first link to avoid duplication.
-
 
759
		if ( i == 0 )
-
 
760
			SetAttribute( oLink, 'id', GetE('txtAttId').value ) ;
-
 
761
 
-
 
762
		// Advances Attributes
-
 
763
		SetAttribute( oLink, 'name'		, GetE('txtAttName').value ) ;
-
 
764
		SetAttribute( oLink, 'dir'		, GetE('cmbAttLangDir').value ) ;
542
	SetAttribute( oLink, 'lang'		, GetE('txtAttLangCode').value ) ;
765
		SetAttribute( oLink, 'lang'		, GetE('txtAttLangCode').value ) ;
543
	SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
766
		SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
-
 
767
		SetAttribute( oLink, 'tabindex'	, ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
-
 
768
		SetAttribute( oLink, 'title'	, GetE('txtAttTitle').value ) ;
-
 
769
		SetAttribute( oLink, 'type'		, GetE('txtAttContentType').value ) ;
-
 
770
		SetAttribute( oLink, 'charset'	, GetE('txtAttCharSet').value ) ;
544
	SetAttribute( oLink, 'tabindex'	, ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
771
 
-
 
772
		if ( oEditor.FCKBrowserInfo.IsIE )
545
	SetAttribute( oLink, 'title'	, GetE('txtAttTitle').value ) ;
773
		{
546
	SetAttribute( oLink, 'type'		, GetE('txtAttContentType').value ) ;
774
			var sClass = GetE('txtAttClasses').value ;
547
	SetAttribute( oLink, 'charset'	, GetE('txtAttCharSet').value ) ;
775
			// If it's also an anchor add an internal class
548
 
776
			if ( GetE('txtAttName').value.length != 0 )
549
	if ( oEditor.FCKBrowserInfo.IsIE )
777
				sClass += ' FCK__AnchorC' ;
550
	{
778
			SetAttribute( oLink, 'className', sClass ) ;
-
 
779
 
551
		SetAttribute( oLink, 'className', GetE('txtAttClasses').value ) ;
780
			oLink.style.cssText = GetE('txtAttStyle').value ;
Line 552... Line 781...
552
		oLink.style.cssText = GetE('txtAttStyle').value ;
781
		}
553
	}
782
		else
554
	else
783
		{
555
	{
784
			SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ;
556
		SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ;
785
			SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
Line 557... Line 786...
557
		SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
786
		}
558
	}
787
	}
559
 
788
 
560
	// Select the link.
789
	// Select the (first) link.
Line 561... Line 790...
561
	oEditor.FCKSelection.SelectNode(oLink);
790
	oEditor.FCKSelection.SelectNode( aLinks[0] );
562
	
791
 
563
	return true ;
792
	return true ;
564
}
793
}
565
 
794
 
566
function BrowseServer()
795
function BrowseServer()
Line 567... Line 796...
567
{
796
{
568
	OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ;
797
	OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ;
-
 
798
}
-
 
799
 
-
 
800
function SetUrl( url )
-
 
801
{
569
}
802
	GetE('txtUrl').value = url ;
570
 
803
	OnUrlChange() ;
571
function SetUrl( url )
804
	dialog.SetSelectedTab( 'Info' ) ;
572
{
805
}
573
	document.getElementById('txtUrl').value = url ;
806
 
Line 595... Line 828...
595
			alert( 'Invalid file type' ) ;
828
			alert( 'Invalid file type' ) ;
596
			return ;
829
			return ;
597
		case 203 :
830
		case 203 :
598
			alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
831
			alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
599
			return ;
832
			return ;
-
 
833
		case 500 :
-
 
834
			alert( 'The connector is disabled' ) ;
-
 
835
			break ;
600
		default :
836
		default :
601
			alert( 'Error on file upload. Error number: ' + errorNumber ) ;
837
			alert( 'Error on file upload. Error number: ' + errorNumber ) ;
602
			return ;
838
			return ;
603
	}
839
	}
Line 610... Line 846...
610
var oUploadDeniedExtRegex	= new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ;
846
var oUploadDeniedExtRegex	= new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ;
Line 611... Line 847...
611
 
847
 
612
function CheckUpload()
848
function CheckUpload()
613
{
849
{
614
	var sFile = GetE('txtUploadFile').value ;
850
	var sFile = GetE('txtUploadFile').value ;
615
	
851
 
616
	if ( sFile.length == 0 )
852
	if ( sFile.length == 0 )
617
	{
853
	{
618
		alert( 'Please select a file to upload' ) ;
854
		alert( 'Please select a file to upload' ) ;
619
		return false ;
855
		return false ;
620
	}
856
	}
621
	
857
 
622
	if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
858
	if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
623
		( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
859
		( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
624
	{
860
	{
625
		OnUploadCompleted( 202 ) ;
861
		OnUploadCompleted( 202 ) ;
626
		return false ;
862
		return false ;
627
	}
863
	}
-
 
864
 
-
 
865
	// Show animation
-
 
866
	window.parent.Throbber.Show( 100 ) ;
-
 
867
	GetE( 'divUpload' ).style.display  = 'none' ;
628
	
868
 
629
	return true ;
-
 
630
}
869
	return true ;
-
 
870
}
-
 
871
 
-
 
872
function SetDefaultTarget()
-
 
873
{
-
 
874
	var target = FCKConfig.DefaultLinkTarget || '' ;
-
 
875
 
-
 
876
	if ( oLink || target.length == 0 )
-
 
877
		return ;
-
 
878
 
-
 
879
	switch ( target )
-
 
880
	{
-
 
881
		case '_blank' :
-
 
882
		case '_self' :
-
 
883
		case '_parent' :
-
 
884
		case '_top' :
-
 
885
			GetE('cmbTarget').value = target ;
-
 
886
			break ;
-
 
887
		default :
-
 
888
			GetE('cmbTarget').value = 'frame' ;
-
 
889
			break ;
-
 
890
	}
-
 
891
 
-
 
892
	GetE('txtTargetFrame').value = target ;
-
 
893
}