~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to MoinMoin/web/static/htdocs/applets/FCKeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
////////////////////////////////////////////////////
 
2
// controlWindow object
 
3
////////////////////////////////////////////////////
 
4
function controlWindow( controlForm ) {
 
5
        // private properties
 
6
        this._form = controlForm;
 
7
 
 
8
        // public properties
 
9
        this.windowType = "controlWindow";
 
10
//      this.noSuggestionSelection = "- No suggestions -";      // by FredCK
 
11
        this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ;
 
12
        // set up the properties for elements of the given control form
 
13
        this.suggestionList  = this._form.sugg;
 
14
        this.evaluatedText   = this._form.misword;
 
15
        this.replacementText = this._form.txtsugg;
 
16
        this.undoButton      = this._form.btnUndo;
 
17
 
 
18
        // public methods
 
19
        this.addSuggestion = addSuggestion;
 
20
        this.clearSuggestions = clearSuggestions;
 
21
        this.selectDefaultSuggestion = selectDefaultSuggestion;
 
22
        this.resetForm = resetForm;
 
23
        this.setSuggestedText = setSuggestedText;
 
24
        this.enableUndo = enableUndo;
 
25
        this.disableUndo = disableUndo;
 
26
}
 
27
 
 
28
function resetForm() {
 
29
        if( this._form ) {
 
30
                this._form.reset();
 
31
        }
 
32
}
 
33
 
 
34
function setSuggestedText() {
 
35
        var slct = this.suggestionList;
 
36
        var txt = this.replacementText;
 
37
        var str = "";
 
38
        if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) {
 
39
                str = slct.options[slct.selectedIndex].text;
 
40
        }
 
41
        txt.value = str;
 
42
}
 
43
 
 
44
function selectDefaultSuggestion() {
 
45
        var slct = this.suggestionList;
 
46
        var txt = this.replacementText;
 
47
        if( slct.options.length == 0 ) {
 
48
                this.addSuggestion( this.noSuggestionSelection );
 
49
        } else {
 
50
                slct.options[0].selected = true;
 
51
        }
 
52
        this.setSuggestedText();
 
53
}
 
54
 
 
55
function addSuggestion( sugg_text ) {
 
56
        var slct = this.suggestionList;
 
57
        if( sugg_text ) {
 
58
                var i = slct.options.length;
 
59
                var newOption = new Option( sugg_text, 'sugg_text'+i );
 
60
                slct.options[i] = newOption;
 
61
         }
 
62
}
 
63
 
 
64
function clearSuggestions() {
 
65
        var slct = this.suggestionList;
 
66
        for( var j = slct.length - 1; j > -1; j-- ) {
 
67
                if( slct.options[j] ) {
 
68
                        slct.options[j] = null;
 
69
                }
 
70
        }
 
71
}
 
72
 
 
73
function enableUndo() {
 
74
        if( this.undoButton ) {
 
75
                if( this.undoButton.disabled == true ) {
 
76
                        this.undoButton.disabled = false;
 
77
                }
 
78
        }
 
79
}
 
80
 
 
81
function disableUndo() {
 
82
        if( this.undoButton ) {
 
83
                if( this.undoButton.disabled == false ) {
 
84
                        this.undoButton.disabled = true;
 
85
                }
 
86
        }
 
87
}