How to use the bootstrap.Deferred function in bootstrap

To help you get started, we’ve selected a few bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / friendlycode / index.html View on Github external
define("main", function(require) {
      var $ = require("bootstrap");
      var badgeTemplate = require("template!badge");
      var achievementTemplate = require("template!achievement");
      var FriendlycodeEditor = require("friendlycode");
      var HtmlBadges = require("html-badges");
      var Gapingbadger = require("badges/gapingbadger");
      var getWikiBadges = require("badges/get-wiki-badges");
      var badger = Gapingbadger("http://gapingbadger.toolness.org");
      var wikiBadges = {};
      var fc = FriendlycodeEditor({
        publishURL: "https://webpagemaker-dev.allizom.org",
        container: $("#fc")
      });
      var wikiReq = $.Deferred();
      var userBadgesReq = $.Deferred();
      var readyToAwardBadges = $.when(wikiReq, userBadgesReq, fc.ready);

      /* Scrape available badges from the Mozilla wiki. */

      getWikiBadges('/Webmakers/SampleBadges', function(badges) {
        $.extend(wikiBadges, badges);
        wikiReq.resolve();
      });

      /* Manage BrowserID-based authentication semantics. */

      badger.checkLogin({
        success: function() {
          $("html").removeClass("logged-out").addClass("logged-in");
          $(".email").text(badger.email);
          badger.fetch(function(err) {
github mozilla / friendlycode / index.html View on Github external
define("main", function(require) {
      var $ = require("bootstrap");
      var badgeTemplate = require("template!badge");
      var achievementTemplate = require("template!achievement");
      var FriendlycodeEditor = require("friendlycode");
      var HtmlBadges = require("html-badges");
      var Gapingbadger = require("badges/gapingbadger");
      var getWikiBadges = require("badges/get-wiki-badges");
      var badger = Gapingbadger("http://gapingbadger.toolness.org");
      var wikiBadges = {};
      var fc = FriendlycodeEditor({
        publishURL: "https://webpagemaker-dev.allizom.org",
        container: $("#fc")
      });
      var wikiReq = $.Deferred();
      var userBadgesReq = $.Deferred();
      var readyToAwardBadges = $.when(wikiReq, userBadgesReq, fc.ready);

      /* Scrape available badges from the Mozilla wiki. */

      getWikiBadges('/Webmakers/SampleBadges', function(badges) {
        $.extend(wikiBadges, badges);
        wikiReq.resolve();
      });

      /* Manage BrowserID-based authentication semantics. */

      badger.checkLogin({
        success: function() {
          $("html").removeClass("logged-out").addClass("logged-in");
          $(".email").text(badger.email);