~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/javascript/comment.js

  • Committer: Robert Collins
  • Date: 2011-02-27 19:45:44 UTC
  • mfrom: (12475 launchpad)
  • mto: This revision was merged to the branch mainline in revision 12481.
  • Revision ID: robert@canonical.com-20110227194544-wt0gq1zm7b4s9piw
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    initializer: function() {
22
22
        this.submit_button = this.get_submit();
23
23
        this.comment_input = Y.one('[id="field.comment"]');
24
 
        this.lp_client = new LP.client.Launchpad();
25
 
        this.error_handler = new LP.client.ErrorHandler();
 
24
        this.lp_client = new Y.lp.client.Launchpad();
 
25
        this.error_handler = new Y.lp.client.ErrorHandler();
26
26
        this.error_handler.clearProgressUI = bind(this.clearProgressUI, this);
27
27
        this.error_handler.showError = bind(function (error_msg) {
28
28
            Y.lp.app.errors.display_error(this.submit_button, error_msg);
111
111
            parameters: {content: this.comment_input.get('value')}
112
112
        };
113
113
        this.lp_client.named_post(
114
 
            LP.client.cache.bug.self_link, 'newMessage', config);
 
114
            LP.cache.bug.self_link, 'newMessage', config);
115
115
    },
116
116
    /**
117
117
     * Retrieve the HTML of the specified message entry.
125
125
            on: {
126
126
                success: callback
127
127
            },
128
 
            accept: LP.client.XHTML
 
128
            accept: Y.lp.client.XHTML
129
129
        };
130
130
        // Randomize the URL to fake out bad XHR caching.
131
131
        var randomness = '?' + Math.random();
290
290
            config.parameters.parent = this.in_reply_to.get('self_link');
291
291
        }
292
292
        this.lp_client.named_post(
293
 
            LP.client.cache.context.self_link, 'createComment', config);
 
293
            LP.cache.context.self_link, 'createComment', config);
294
294
    },
295
295
    /**
296
296
     * Retrieve the HTML of the specified message entry.
317
317
     */
318
318
    reply_clicked: function(e){
319
319
        e.halt();
320
 
        var reply_link = LP.client.normalize_uri(e.target.get('href'));
 
320
        var reply_link = Y.lp.client.normalize_uri(e.target.get('href'));
321
321
        var root_url = reply_link.substr(0,
322
322
            reply_link.length - '+reply'.length);
323
323
        var object_url = '/api/devel' + root_url;
410
410
                    var target = Y.one('#votes-target');
411
411
                    target.set('innerHTML', response.responseText);
412
412
 
413
 
                    var username = LP.client.links.me.substring(2);
 
413
                    var username = LP.links.me.substring(2);
414
414
                    var new_reviewer = Y.one('#review-' + username);
415
415
                    if (Y.Lang.isValue(new_reviewer)) {
416
416
                        var anim = Y.lazr.anim.green_flash({
425
425
});
426
426
namespace.CodeReviewComment = CodeReviewComment;
427
427
 
428
 
}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client.plugins", "lp.app.errors"]});
 
428
}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client",
 
429
                       "lp.client.plugins", "lp.app.errors"]});