~zubairassad89/sahana-eden/vms_gsoc

« back to all changes in this revision

Viewing changes to static/scripts/S3/S3.js

  • Committer: Patricia Tressel
  • Date: 2010-07-30 11:17:48 UTC
  • mfrom: (768.1.145 eden)
  • Revision ID: tressel@phobos-20100730111748-jrg6lo32oqjf3h84
Merge from trunk.
Two conflicts resolved with change to trunk:
00_utils.py shn_rheader_tabs:
  Don't put _next into jr.request.vars where some downstream use might find it.
01_crud.py shn_read:
  Put vars in delete, edit, and redirect urls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
function openPopup(url) {
4
4
    if ( !popupWin || popupWin.closed ) {
5
 
        popupWin = window.open( url, "popupWin", "width=640,height=480" );
 
5
        popupWin = window.open( url, 'popupWin', 'width=640,height=480' );
6
6
    } else popupWin.focus();
7
7
}
8
8
$(document).ready(function() {
14
14
    $('.information').click(function() { $(this).fadeOut('slow'); return false; });
15
15
    $('.confirmation').hide().slideDown('slow')
16
16
    $('.confirmation').click(function() { $(this).fadeOut('slow'); return false; });
17
 
    $("input.date").datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', isRTL: false });
 
17
    $('input.date').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', isRTL: false });
18
18
    $('a.colorbox').click(function(){
19
19
        // Function to Add a Resource from within a form
20
20
        $(this).attr('href', function() {
21
21
            // Add the caller to the URL vars so that the popup knows which field to refresh/set
22
22
            var url_in = $(this).attr('href');
23
 
            var caller = $(this).parents('tr').attr('id').replace(/__row/, '');
 
23
            var caller = '';
 
24
            try {
 
25
                caller = $(this).parents('tr').attr('id').replace(/__row/, '');
 
26
            } catch(e) {
 
27
                if(caller == "") return url_in;  
 
28
            }
24
29
            var url_out = url_in;
25
 
            if (url_out.indexOf("&caller=") == -1){
 
30
            if (url_out.indexOf('&caller=') == -1){
26
31
                url_out = url_out + '&caller=' + caller;
27
32
            }
28
33
            return url_out;
178
183
    var _I = this;
179
184
    var _sb = null;
180
185
    // options
181
 
    this.elementId = "_showstatus";
 
186
    this.elementId = '_showstatus';
182
187
    this.prependMultiline = true;
183
188
    this.showCloseButton = false;
184
189
    this.afterTimeoutText = null;
185
190
 
186
 
    this.cssClass = "statusbar";
187
 
    this.highlightClass = "statusbarhighlight";
188
 
    this.errorClass = "statusbarerror";
189
 
    this.closeButtonClass = "statusbarclose";
 
191
    this.cssClass = 'statusbar';
 
192
    this.highlightClass = 'statusbarhighlight';
 
193
    this.errorClass = 'statusbarerror';
 
194
    this.closeButtonClass = 'statusbarclose';
190
195
    this.additive = false;
191
196
    $.extend(this, options);
192
197
    if (sel)
201
206
                .show();
202
207
    }
203
208
    //if (_I.showCloseButton)
204
 
        $("." + _I.cssClass).click(function(e) { $(_sb).hide(); });
 
209
        $('.' + _I.cssClass).click(function(e) { $(_sb).hide(); });
205
210
    this.show = function(message, timeout, additive, isError)
206
211
    {
207
212
        if (additive || ((additive == undefined) && _I.additive))
208
213
        {
209
 
            var html = "<div style='margin-bottom: 2px;' >" + message + "</div>";
 
214
            var html = "<div style='margin-bottom: 2px;' >" + message + '</div>';
210
215
            if (_I.prependMultiline)
211
216
                _sb.prepend(html);
212
217
            else
218
223
                _sb.text(message);
219
224
            else
220
225
            {
221
 
                var t = _sb.find("div.statusbarclose");
 
226
                var t = _sb.find('div.statusbarclose');
222
227
                _sb.text(message).prepend(t);
223
228
            }
224
229
        }