Sha256: 167bff2f38c7b366cbaf04617965b831513b11f7f985d8561d1fd5dca7bf174f

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

// This object provides dynamically generated Rails routes in Javascript.
// A little bit hacky, but the best solution so far. ^_^
<% self.class.send(: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

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc13 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc11 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc8 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc7 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc6 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc3 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc2 app/assets/javascripts/alchemy/alchemy.routes.js.erb
alchemy_cms-2.2.rc1 app/assets/javascripts/alchemy/alchemy.routes.js.erb