Sha256: bfa44dfa4823af9c9985d7794d62bab4ee8c8f0373c431d10f4e3a53a9463620

Contents?: true

Size: 1.27 KB

Versions: 14

Compression:

Stored size: 1.27 KB

Contents

/* ___ file or text ___ */

var enableFileOrTextToggling = function() {
  $('div.hidden').hide();

  $('span.alt').click(function(event) {
    event.preventDefault();

    if ($("div#file-selector").is(":hidden")) {
      $("div#text-selector").slideUp("normal", function() {
        $("div#file-selector").slideDown();
        $("input#theme_asset_performing_plain_text").val(false);
      });
    } else {
      $("div#file-selector").slideUp("normal", function() {
        $("div#text-selector").slideDown();
        $("input#theme_asset_performing_plain_text").val(true);
      });
    }
  });
}

$(document).ready(function() {
  enableFileOrTextToggling();

  $('code.stylesheet textarea').each(function() {
    addCodeMirrorEditor(null, $(this), ["tokenizejavascript.js", "parsejavascript.js", "parsecss.js"]);
  });
  $('code.javascript textarea').each(function() {
    addCodeMirrorEditor(null, $(this), ["parsecss.js", "tokenizejavascript.js", "parsejavascript.js"]);
  });

  $('select#theme_asset_content_type').bind('change', function() {
    var editor = CodeMirrorEditors[0].editor;
    editor.setParser($(this).val() == 'stylesheet' ? 'CSSParser' : 'JSParser');
  });

  $('a#image-picker-link').imagepicker({
    insertFn: function(link) {
      return link.attr('href');
    }
  });
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 public/javascripts/admin/theme_assets.js
locomotive_cms-1.0.0.beta public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta12 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta11 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta10 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta9 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta8 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta7 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta5 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta4 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta3 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta2 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4.beta1 public/javascripts/admin/theme_assets.js
locomotive_cms-0.0.4 public/javascripts/admin/theme_assets.js