Commits

Luke Plant committed 335c681

Button to open in new tab.

  • Participants
  • Parent commits 6496eb8

Comments (0)

Files changed (1)

semanticeditor/static/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

     var previewBoxId = idPrefix + 'previewbox';
     var hidePreviewButtonId = idPrefix + 'hidepreviewbutton';
     var cleanHtmlButtonId = idPrefix + 'cleanhtmlbutton';
+    var editorNewTabId = idPrefix + 'editornewtab';
     var self = this;
 
     // Create elements
             "<input type=\"submit\" id=\"" + showStylesButtonId + "\" /><br/>" +
             "<input type=\"submit\" value=\"Clean pasted HTML\" id=\"" + cleanHtmlButtonId  +  "\" /><br/>" +
             "<input type=\"submit\" value=\"Preview\" id=\"" + previewButtonId + "\" /><br/>" +
+            "<input type=\"submit\" value=\"Edit in new tab\" id=\"" + editorNewTabId + "\" /<br/>" +
             "<div class=\"prescontrolerror\" id=\"" + idPrefix + "errorbox" + "\"></div>" +
         "</div>");
 
     this.hidePreviewButton = jQuery('#' + hidePreviewButtonId);
     this.showStylesButton = jQuery('#' + showStylesButtonId);
     this.cleanHtmlButton = jQuery('#' + cleanHtmlButtonId);
+    this.editorNewTabButton = jQuery('#' + editorNewTabId);
 
     this.setupCssStorage();
 
                                    self.cleanHtml();
                                    return false;
                                });
+    this.editorNewTabButton.click(function(event) {
+                                      var url = self.wym._box.get(0).ownerDocument.URL;
+                                      window.open(url, '_blank');
+                                      return false;
+                                  });
     jQuery(this.wym._doc)
         .bind("keyup", function(evt) {
                   // this style of binding gives docKeyup