~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/javascript/filebug_dupefinder.js

  • Committer: Ian Booth
  • Date: 2011-04-25 14:07:13 UTC
  • mto: This revision was merged to the branch mainline in revision 12983.
  • Revision ID: ian.booth@canonical.com-20110425140713-d85ics3gcvuycxft
Start new tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    DISPLAY = 'display',
13
13
    EXPANDER_COLLAPSED = '/@@/treeCollapsed',
14
14
    EXPANDER_EXPANDED = '/@@/treeExpanded',
15
 
    INLINE = 'inline',
16
15
    INNER_HTML = 'innerHTML',
17
 
    LAZR_CLOSED = 'lazr-closed',
18
16
    NONE = 'none',
19
17
    SRC = 'src',
20
18
    UNSEEN = 'unseen';
22
20
var namespace = Y.namespace('lp.bugs.filebug_dupefinder');
23
21
 
24
22
/*
 
23
 * The IO provider to use. A stub may be used for testing.
 
24
 */    
 
25
var YIO = Y;
 
26
/*
25
27
 * The NodeList of possible duplicates.
26
28
 */
27
29
var bug_already_reported_expanders;
238
240
    form_fade_out.on('end', function() {
239
241
        var config = {on: {success: on_success,
240
242
                       failure: show_failure_message}};
241
 
        Y.io(search_url, config);
 
243
        YIO.io(search_url, config);
242
244
    });
243
245
    form_fade_out.run();
244
246
}
364
366
 
365
367
    set_product_urls();
366
368
    // Reload the filebug form.
367
 
    Y.io(filebug_form_url, config);
 
369
    YIO.io(filebug_form_url, config);
368
370
}
369
371
 
370
372
/**
398
400
    search_button.set('value', 'Next');
399
401
 
400
402
    // Set up the handler for the search form.
401
 
    search_form = Y.one('#filebug-search-form');
 
403
    var search_form = Y.one('#filebug-search-form');
402
404
    search_form.on('submit', function(e) {
403
405
        // Prevent the event from propagating; we don't want to reload
404
406
        // the page.
515
517
        if (Y.Lang.isValue(filebug_form_url_element)) {
516
518
            filebug_form_url = filebug_form_url_element.getAttribute(
517
519
                'href');
518
 
            Y.io(filebug_form_url, config);
 
520
            YIO.io(filebug_form_url, config);
519
521
        }
520
522
    });
521
523
};
522
524
 
 
525
/**
 
526
 * Set up and configure the module.
 
527
 */
 
528
 namespace.setup_config = function(config) {
 
529
    if (config.yio !== undefined) {
 
530
        //We can be given an alternative IO provider for use in tests.
 
531
        YIO = config.yio;
 
532
    }
 
533
};
 
534
 
523
535
}, "0.1", {"requires": [
524
536
    "base", "io", "oop", "node", "event", "lazr.formoverlay",
525
537
    "lazr.effects"]});