~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/FCK/_samples/html/sample03.html

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
2
<!--
 
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
4
 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
 
5
 *
 
6
 * == BEGIN LICENSE ==
 
7
 *
 
8
 * Licensed under the terms of any of the following licenses at your
 
9
 * choice:
 
10
 *
 
11
 *  - GNU General Public License Version 2 or later (the "GPL")
 
12
 *    http://www.gnu.org/licenses/gpl.html
 
13
 *
 
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 
15
 *    http://www.gnu.org/licenses/lgpl.html
 
16
 *
 
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 
19
 *
 
20
 * == END LICENSE ==
 
21
 *
 
22
 * Sample page.
 
23
-->
 
24
<html xmlns="http://www.w3.org/1999/xhtml">
 
25
<head>
 
26
        <title>FCKeditor - Sample</title>
 
27
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
28
        <meta name="robots" content="noindex, nofollow" />
 
29
        <link href="../sample.css" rel="stylesheet" type="text/css" />
 
30
        <script type="text/javascript" src="../../fckeditor.js"></script>
 
31
        <script type="text/javascript">
 
32
 
 
33
var bIsLoaded = false ;
 
34
 
 
35
function FCKeditor_OnComplete( editorInstance )
 
36
{
 
37
        if ( bIsLoaded )
 
38
                return ;
 
39
 
 
40
        var oCombo = document.getElementById( 'cmbLanguages' ) ;
 
41
 
 
42
        var aLanguages = new Array() ;
 
43
 
 
44
        for ( code in editorInstance.Language.AvailableLanguages )
 
45
                aLanguages.push( { Code : code, Name : editorInstance.Language.AvailableLanguages[code] } ) ;
 
46
 
 
47
        aLanguages.sort( SortLanguage ) ;
 
48
 
 
49
        for ( var i = 0 ; i < aLanguages.length ; i++ )
 
50
                AddComboOption( oCombo, aLanguages[i].Name + ' (' + aLanguages[i].Code + ')', aLanguages[i].Code ) ;
 
51
 
 
52
        oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
 
53
 
 
54
        document.getElementById('eNumLangs').innerHTML = '(' + aLanguages.length + ' languages available!)' ;
 
55
 
 
56
        bIsLoaded = true ;
 
57
}
 
58
 
 
59
function SortLanguage( langA, langB )
 
60
{
 
61
        return ( langA.Name < langB.Name ? -1 : langA.Name > langB.Name ? 1 : 0 ) ;
 
62
}
 
63
 
 
64
function AddComboOption(combo, optionText, optionValue)
 
65
{
 
66
        var oOption = document.createElement("OPTION") ;
 
67
 
 
68
        combo.options.add(oOption) ;
 
69
 
 
70
        oOption.innerHTML = optionText ;
 
71
        oOption.value     = optionValue ;
 
72
 
 
73
        return oOption ;
 
74
}
 
75
 
 
76
function ChangeLanguage( languageCode )
 
77
{
 
78
        window.location.href = window.location.pathname + "?" + languageCode ;
 
79
}
 
80
        </script>
 
81
</head>
 
82
<body>
 
83
        <h1>
 
84
                FCKeditor - JavaScript - Sample 3</h1>
 
85
        <div>
 
86
                This sample shows the editor in all its available languages.
 
87
        </div>
 
88
        <hr />
 
89
        <table cellpadding="0" cellspacing="0" border="0">
 
90
                <tr>
 
91
                        <td>
 
92
                                Select a language:&nbsp;
 
93
                        </td>
 
94
                        <td>
 
95
                                <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
 
96
                                </select>
 
97
                        </td>
 
98
                        <td>
 
99
                                &nbsp;<span id="eNumLangs"></span>
 
100
                        </td>
 
101
                </tr>
 
102
        </table>
 
103
        <br />
 
104
        <form action="sampleposteddata.asp" method="post" target="_blank">
 
105
                <script type="text/javascript">
 
106
<!--
 
107
// Automatically calculates the editor base path based on the _samples directory.
 
108
// This is usefull only for these samples. A real application should use something like this:
 
109
// oFCKeditor.BasePath = '/fckeditor/' ;        // '/fckeditor/' is the default value.
 
110
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
 
111
 
 
112
var sLang ;
 
113
if ( document.location.search.length > 1 )
 
114
        sLang = document.location.search.substr(1) ;
 
115
 
 
116
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
 
117
oFCKeditor.BasePath     = sBasePath ;
 
118
if ( sLang == null )
 
119
{
 
120
        oFCKeditor.Config["AutoDetectLanguage"] = true ;
 
121
        oFCKeditor.Config["DefaultLanguage"]    = "en" ;
 
122
}
 
123
else
 
124
{
 
125
        oFCKeditor.Config["AutoDetectLanguage"] = false ;
 
126
        oFCKeditor.Config["DefaultLanguage"]    = sLang ;
 
127
}
 
128
oFCKeditor.Value        = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
 
129
oFCKeditor.Create() ;
 
130
//-->
 
131
                </script>
 
132
                <br />
 
133
                <input type="submit" value="Submit" />
 
134
        </form>
 
135
</body>
 
136
</html>