{"size": 954, "ext": "js", "max_stars_repo_path": "examples/developer-guide/inter-mojit/mojits/ReceiverMojit/binders/index.js", "max_stars_repo_name": "Ankita-Palekar/mojito", "max_stars_repo_stars_event_min_datetime": "2015-11-06T01:45:20.000Z", "max_stars_repo_stars_event_max_datetime": "2015-11-06T01:45:20.000Z", "max_issues_repo_path": "examples/developer-guide/inter-mojit/mojits/ReceiverMojit/binders/index.js", "max_issues_repo_name": "michaelBenin/mojito", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "examples/developer-guide/inter-mojit/mojits/ReceiverMojit/binders/index.js", "max_forks_repo_name": "michaelBenin/mojito", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.7741935484, "max_line_length": 85, "alphanum_fraction": 0.5649895178}
YUI.add('ReceiverMojitBinderIndex', function(Y, NAME) {
  Y.namespace('mojito.binders')[NAME] = {
    init: function(mojitProxy) {
      var self = this;
      this.mojitProxy = mojitProxy;
      this.mojitProxy.listen('broadcast-link', function(payload) {
        Y.log('Intercepted broadcast-link event: ' + payload.data.url, 'info', NAME);
        // Fire an event to the mojit to reload
        // with the correct URL
        var params = {
          url: {
            url: payload.data.url
          }
        };
        mojitProxy.invoke('show', { params: params }, function(err, markup) {
          self.node.setContent(markup);
        });
      });
    },
    /**
    * The binder method, invoked to allow the
    * mojit to attach DOM event handlers.
    * @param node {Node} The DOM node to which
    * this mojit is attached.
    **/
    bind: function(node) {
      this.node = node;
    }
  };
}, '0.0.1', {requires: ['mojito-client']});
