Exemplo n.º 1
0
 function toggleTheme() {
   if(bramble.getTheme() === "dark-theme") {
     setTheme("light-theme");
     analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Theme Changed", label : "Light Theme" });
   } else {
     setTheme("dark-theme");
     analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Theme Changed", label : "Dark Theme" });
   }
 }
Exemplo n.º 2
0
 $("#line-wrap-toggle").click(function() {
   // Toggle current value
   setWordWrap(!bramble.getWordWrap());
   var mode = !bramble.getWordWrap() ? "Enabled" : "Disabled";
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Word Wrap Toggle", label : mode });
   return false;
 });
 Project.setTitle(context.titleBar.val(), function(err) {
   if (err) {
     console.error("[Bramble] Failed to update the project internally: ", err);
     return;
   }
   editingComplete(context);
   analytics.event("ProjectRenamed");
 });
Exemplo n.º 4
0
    $("#allow-scripts-toggle").click(function() {
      // Toggle current value
      var $allowScriptsToggle = $("#allow-scripts-toggle");
      var toggle = !($allowScriptsToggle.hasClass("switch-enabled"));

      if(toggle) {
        $allowScriptsToggle.addClass("switch-enabled");
        bramble.enableJavaScript();
        analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Toggle JavaScript", label : "Enabled" });
      } else {
        $allowScriptsToggle.removeClass("switch-enabled");
        bramble.disableJavaScript();
        analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Toggle JavaScript", label : "Disabled" });
      }

      return false;
    });
Exemplo n.º 5
0
    $("div.snippets-preview > button").click(function() {
      var snippetID = $(this).parent().data("snippet-id") || false;
      if(snippetID){
        analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Insert Snippet", label : snippetID });
      }
      bramble.addCodeSnippet($(this).siblings("pre").text());
      menu.close();

      return false;
    });
Exemplo n.º 6
0
      }, currURL, function(err, info) {
        if (err) {
          publishDialog.stop().hide();
          modals.showErrorDialog({
            text: Localized.get('publish-err') + " " + err.responseText
          });
          publishErrorOccurred = true;
          analytics.event("Error", {
            label: "Error Publishing",
            nonInteraction: true
          });
        } else {
          var viewURL = info.url;
          var remixURL = baseRemixURL.replace("{{VIEW_URL}}",
                                              escape(info.path));
          viewLink.attr('href', viewURL).text(viewURL);
          remixLink.attr('href', remixURL).text(remixURL);

          shareResult.bind('click.hotLoad', makeSharingHotLoader({
            urlToShare: viewURL,
            socialMedia: socialMedia
          }));

          // If the user has selected the sharing accordion while
          // we were publishing, hot-load the sharing UI immediately.
          if (!shareResult.hasClass("collapsed"))
            shareResult.click();

          // The user is now effectively remixing the page they just
          // published.
          currURL = viewURL;

          publishDialog.removeClass("is-publishing");
          self.trigger("publish", {
            viewURL: viewURL,
            remixURL: remixURL,
            path: info.path
          });

          analytics.event("Publish");
        }
      });
Exemplo n.º 7
0
 $downloadZip.click(function() {
   menu.close();
   bramble.export();
   analytics.event({ category : analytics.eventCategories.PROJECT_ACTIONS, action : "Export ZIP"});
   return false;
 });
Exemplo n.º 8
0
 $addUpload.click(function() {
   menu.close();
   bramble.showUploadFilesDialog();
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Upload File Dialog Shown"});
 });
Exemplo n.º 9
0
 $addFolder.click(function() {
   menu.close();
   bramble.addNewFolder();
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Add New Folder"});
 });
Exemplo n.º 10
0
 downloadFileToFilesystem("/tutorial/tutorial.html", {filename: "tutorial.html"}, function(err) {
   if (err) {
     console.log("[Brackets] Failed to insert tutorial.html", err);
   }
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Add File", label : "Tutorial" });
 });
Exemplo n.º 11
0
 downloadFileToFilesystem("/default-files/js.txt", options, function(err) {
   if (err) {
     console.log("[Brackets] Failed to insert default JS file", err);
   }
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Add File", label : "JS" });
 });
Exemplo n.º 12
0
 bramble.increaseFontSize(function() {
   var fontSize = bramble.getFontSize();
   analytics.event({ category : analytics.eventCategories.EDITOR_UI, action : "Font Size Changed", label : "Increased to " + fontSize });
 });