Sha256: a9ecfbce9fe327fba54217fcb376b5e25eb5514e43bb9609a48cac665909be1a

Contents?: true

Size: 1.07 KB

Versions: 46

Compression:

Stored size: 1.07 KB

Contents

// This object provides dynamically generated Rails routes in Javascript.
// A little bit hacky, but the best solution so far. ^_^
<% self.class.instance_eval { include Alchemy::Engine.routes.url_helpers } %>

if (typeof(Alchemy) === 'undefined') {
  var Alchemy = {};
}

(function($) {

  var routes = {};
  $.extend(Alchemy, routes);

  Alchemy.routes = {

    admin_picture_path: function(id) {
      return '<%= admin_picture_path(:id => 1) %>'.replace(/1/, id);
    },

    admin_trash_path: function(page_id) {
      var url = '<%= admin_trash_path %>';
      if (page_id) url += '?page_id=' + page_id;
      return url;
    },

    fold_admin_element_path: function(id) {
      return '<%= fold_admin_element_path(:id => 1) %>'.replace(/1/, id);
    },

    list_admin_elements_path: '<%= list_admin_elements_path %>',
    order_admin_contents_path: '<%= order_admin_contents_path %>',
    order_admin_elements_path: '<%= order_admin_elements_path %>',
    order_admin_pages_path: '<%= order_admin_pages_path %>',
    link_admin_pages_path: '<%= link_admin_pages_path %>'

  }

})(jQuery);

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
alchemy_cms-2.9.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.9.0 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.8.3 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.5 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.3 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.4 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.8.2 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.8.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.3 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-3.0.0.rc5 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.2 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.7.0 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.2.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.2 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.0 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.6.0.rc5 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.5.3.1 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.5.3 app/assets/javascripts/alchemy/alchemy.routes.js.erb