Sha256: a3cfd4b63b44b37248ef0847d7a784fc792be1a1eff23c12bd4ba08b3055d963

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

this.visual_editor_init_interface_hook = (function(_this) {
  return function() {
    return $("textarea.wymeditor, textarea.visual_editor").each(function() {
      var instance, next, prev, textarea;
      textarea = $(this);
      if ((instance = WYMeditor.INSTANCES[$((textarea.next(".visual_editor_box").find("iframe").attr("id") || "").split("_")).last().get(0)]) != null) {
        if (((next = textarea.parent().next()) != null) && next.length > 0) {
          next.find("input, textarea").keydown($.proxy(function(e) {
            var shiftHeld;
            shiftHeld = e.shiftKey;
            if (shiftHeld && e.keyCode === $.ui.keyCode.TAB) {
              this._iframe.contentWindow.focus();
              return e.preventDefault();
            }
          }, instance)).keyup(function(e) {
            var shiftHeld;
            return shiftHeld = false;
          });
        }
        if (((prev = textarea.parent().prev()) != null) && prev.length > 0) {
          return prev.find("input, textarea").keydown($.proxy(function(e) {
            if (e.keyCode === $.ui.keyCode.TAB) {
              this._iframe.contentWindow.focus();
              return e.preventDefault();
            }
          }, instance));
        }
      }
    });
  };
})(this);

this.visual_editor_update = (function(_this) {
  return function() {
    $.each(WYMeditor.INSTANCES, function(index, wym) {
      wym.update();
    });
  }
})(this);

this.visual_editor_init = (function(_this) {
  return function() {
    return WYMEditor.init();
  };
})(this);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
refinerycms-wymeditor-1.0.0 app/assets/javascripts/wymeditor/init_interface.js