~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/_source/internals/fcktools_ie.js

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
Import upstream version 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * FCKeditor - The text editor for internet
 
3
 * Copyright (C) 2003-2005 Frederico Caldeira Knabben
 
4
 * 
 
5
 * Licensed under the terms of the GNU Lesser General Public License:
 
6
 *              http://www.opensource.org/licenses/lgpl-license.php
 
7
 * 
 
8
 * For further information visit:
 
9
 *              http://www.fckeditor.net/
 
10
 * 
 
11
 * "Support Open Source software. What about a donation today?"
 
12
 * 
 
13
 * File Name: fcktools_ie.js
 
14
 *      Utility functions. (IE version).
 
15
 * 
 
16
 * File Authors:
 
17
 *              Frederico Caldeira Knabben (fredck@fckeditor.net)
 
18
 */
 
19
 
 
20
// Appends a CSS file to a document.
 
21
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrl )
 
22
{
 
23
        return documentElement.createStyleSheet( cssFileUrl ) ;
 
24
}
 
25
 
 
26
// Removes all attributes and values from the element.
 
27
FCKTools.ClearElementAttributes = function( element )
 
28
{
 
29
        element.clearAttributes() ;
 
30
}
 
31
 
 
32
FCKTools.GetAllChildrenIds = function( parentElement )
 
33
{
 
34
        var aIds = new Array() ;
 
35
        for ( var i = 0 ; i < parentElement.all.length ; i++ )
 
36
        {
 
37
                var sId = parentElement.all[i].id ;
 
38
                if ( sId && sId.length > 0 )
 
39
                        aIds[ aIds.length ] = sId ;
 
40
        }
 
41
        return aIds ;
 
42
}
 
43
 
 
44
FCKTools.RemoveOuterTags = function( e )
 
45
{
 
46
        e.insertAdjacentHTML( 'beforeBegin', e.innerHTML ) ;
 
47
        e.parentNode.removeChild( e ) ;
 
48
}
 
49
 
 
50
FCKTools.CreateXmlObject = function( object )
 
51
{
 
52
        var aObjs ;
 
53
        
 
54
        switch ( object )
 
55
        {
 
56
                case 'XmlHttp' :
 
57
                        aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;
 
58
                        break ;
 
59
                                
 
60
                case 'DOMDocument' :
 
61
                        aObjs = [ 'MSXML2.DOMDocument', 'Microsoft.XmlDom' ] ;
 
62
                        break ;
 
63
        }
 
64
 
 
65
        for ( var i = 0 ; i < 2 ; i++ )
 
66
        {
 
67
                try { return new ActiveXObject( aObjs[i] ) ; }
 
68
                catch (e) 
 
69
                {}
 
70
        }
 
71
        
 
72
        if ( FCKLang.NoActiveX )
 
73
        {
 
74
                alert( FCKLang.NoActiveX ) ;
 
75
                FCKLang.NoActiveX = null ;
 
76
        }
 
77
}
 
78
 
 
79
FCKTools.DisableSelection = function( element )
 
80
{
 
81
        element.unselectable = 'on' ;
 
82
 
 
83
        var e, i = 0 ;
 
84
        while ( e = element.all[ i++ ] )
 
85
        {
 
86
                switch ( e.tagName )
 
87
                {
 
88
                        case 'IFRAME' :
 
89
                        case 'TEXTAREA' :
 
90
                        case 'INPUT' :
 
91
                        case 'SELECT' :
 
92
                                /* Ignore the above tags */
 
93
                                break ;
 
94
                        default :
 
95
                                e.unselectable = 'on' ;
 
96
                }
 
97
        }
 
98
}
 
 
b'\\ No newline at end of file'