dojox/editor/plugins/Preview.js

  • Provides:

    • dojox.editor.plugins.Preview
  • dojox.editor.plugins.Preview

    • type
      Function
    • chains:
      • dijit._editor._Plugin: (prototype)
      • dijit._editor._Plugin: (call)
    • summary
  • dojox.editor.plugins.Preview.useDefaultCommand

    • summary
  • dojox.editor.plugins.Preview.styles

    • tags: public
    • type
      String
    • summary
      A string of CSS styles to apply to the previewed content, if any.
  • dojox.editor.plugins.Preview.stylesheets

    • tags: public
    • type
      Array
    • summary
      An array of stylesheets to import into the preview, if any.
  • dojox.editor.plugins.Preview.iconClassPrefix

    • tags: const
    • type
      String
    • summary
      The CSS class name for the button node icon.
  • dojox.editor.plugins.Preview._initButton

    • type
      Function
    • source: [view]
        this._nlsResources = dojo.i18n.getLocalization("dojox.editor.plugins", "Preview");
        this.button = new dijit.form.Button({
         label: this._nlsResources["preview"],
         showLabel: false,
         iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "Preview",
         tabIndex: "-1",
         onClick: dojo.hitch(this, "_preview")
        });
    • summary
      Over-ride for creation of the preview button.
  • dojox.editor.plugins.Preview.setEditor

    • type
      Function
    • parameters:
      • editor: (typeof Object)
        The editor to configure for this plugin to use.
    • source: [view]
        this.editor = editor;
        this._initButton();
    • summary
      Over-ride for the setting of the editor.
  • dojox.editor.plugins.Preview.updateState

    • type
      Function
    • source: [view]
        this.button.set("disabled", this.get("disabled"));
    • summary
      Over-ride for button state control for disabled to work.
  • dojox.editor.plugins.Preview._preview

    • type
      Function
    • source: [view]
        try{
         var content = this.editor.get("value");
         var head = "\t\t\n";
         var i;
         // Apply the stylesheets, then apply the styles.
         if(this.stylesheets){
          for(i = 0; i < this.stylesheets.length; i++){
           head += "\t\t\n";
          }
         }
         if(this.styles){
          head += ("\t\t\n");
         }
         content = "\n\t\n" + head + "\t\n\t\n" + content + "\n\t\n";
         var win = window.open("javascript: ''", this._nlsResources["preview"], "status=1,menubar=0,location=0,toolbar=0");
         win.document.open();
         win.document.write(content);
         win.document.close();


        }catch(e){
         console.warn(e);
        }
    • summary
      Function to trigger previewing of the editor document
    • tags:
  • dojox.editor.plugins.Preview._nlsResources

    • summary
  • dojox.editor.plugins.Preview.button

    • summary
  • dojox.editor.plugins.Preview.editor

    • summary
  • dojox.editor.plugins.Preview.setEditor.editor

    • type
      Object
    • summary
      The editor to configure for this plugin to use.
  • name

    • summary
  • o.plugin

    • summary
  • dojox.editor.plugins

    • type
      Object
    • summary
  • dojox.editor

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary