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
-
 
8
 * choice:
-
 
9
 *
-
 
10
 *  - GNU General Public License Version 2 or later (the "GPL")
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
11
 *    http://www.gnu.org/licenses/gpl.html
7
 * 
12
 *
8
 * For further information visit:
13
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
9
 * 		http://www.fckeditor.net/
14
 *    http://www.gnu.org/licenses/lgpl.html
10
 * 
15
 *
11
 * "Support Open Source software. What about a donation today?"
16
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
-
 
17
 *    http://www.mozilla.org/MPL/MPL-1.1.html
12
 * 
18
 *
13
 * File Name: common.js
19
 * == END LICENSE ==
-
 
20
 *
14
 * 	Common objects and functions shared by all pages that compose the
21
 * Common objects and functions shared by all pages that compose the
15
 * 	File Browser dialog window.
22
 * File Browser dialog window.
16
 * 
-
 
17
 * File Authors:
-
 
18
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
-
 
19
 */
23
 */
Line -... Line 24...
-
 
24
 
-
 
25
// Automatically detect the correct document.domain (#1919).
-
 
26
(function()
-
 
27
{
-
 
28
	var d = document.domain ;
-
 
29
 
-
 
30
	while ( true )
-
 
31
	{
-
 
32
		// Test if we can access a parent property.
-
 
33
		try
-
 
34
		{
-
 
35
			var test = window.top.opener.document.domain ;
-
 
36
			break ;
-
 
37
		}
-
 
38
		catch( e )
-
 
39
		{}
-
 
40
 
-
 
41
		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
-
 
42
		d = d.replace( /.*?(?:\.|$)/, '' ) ;
-
 
43
 
-
 
44
		if ( d.length == 0 )
-
 
45
			break ;		// It was not able to detect the domain.
-
 
46
 
-
 
47
		try
-
 
48
		{
-
 
49
			document.domain = d ;
-
 
50
		}
-
 
51
		catch (e)
-
 
52
		{
-
 
53
			break ;
-
 
54
		}
-
 
55
	}
-
 
56
})() ;
20
 
57
 
21
function AddSelectOption( selectElement, optionText, optionValue )
58
function AddSelectOption( selectElement, optionText, optionValue )
22
{
59
{
Line 23... Line 60...
23
	var oOption = document.createElement("OPTION") ;
60
	var oOption = document.createElement("OPTION") ;
24
 
61
 
Line 25... Line 62...
25
	oOption.text	= optionText ;
62
	oOption.text	= optionText ;
Line 26... Line 63...
26
	oOption.value	= optionValue ;	
63
	oOption.value	= optionValue ;
27
 
64
 
Line 46... Line 83...
46
}
83
}
Line 47... Line 84...
47
 
84
 
48
StringBuilder.prototype.ToString = function()
85
StringBuilder.prototype.ToString = function()
49
{
86
{
50
    return this._Strings.join( '' ) ;
-
 
51
}
87
    return this._Strings.join( '' ) ;
-
 
88
}