gluttonberg/lib/gluttonberg/helpers/admin.rb
# Creates a link tag that shows the AssetBrowser popup
Creates a link tag that shows the AssetBrowser popup
Creates a link tag that shows the AssetBrowser popup
def link_to_asset_browser(name, opts={})
        add_asset_url = slice_url(:add_asset_to_collection, opts[:collection].id)
        js_code = <<JAVASCRIPT_CODE
showAssetBrowser({rootUrl: '#{url(:gluttonberg_asset_browser)}', onSelect: function(assetId){writeAssetToAssetCollection(assetId,'#{add_asset_url}')}}); return false;
JAVASCRIPT_CODE
        opts[:onclick] = opts[:onclick] || js_code
        link_to(name, '#', opts)
      end
def link_to_asset_browser ( name , opts = { } ) add_asset_url = slice_url ( :add_asset_to_collection , opts [ :collection ] . id ) js_code = <<JAVASCRIPT_CODE 
showAssetBrowser({rootUrl: ' #{ url ( :gluttonberg_asset_browser ) } ', onSelect: function(assetId){writeAssetToAssetCollection(assetId,' #{ add_asset_url } ')}}); return false;
 JAVASCRIPT_CODE opts [ :onclick ] = opts [ :onclick ] || js_code link_to ( name , '#' , opts ) end
Creates a link tag that shows the AssetBrowser popup
Creates a link tag that shows the AssetBrowser popup
# work out the updating url for the collection from opts[:collection]
name
opts