Sha256: 362e6d248fb3ec3742d0ac0aac6dccb14377bd2e2d31272210b4a771474b3d34

Contents?: true

Size: 1.06 KB

Versions: 16

Compression:

Stored size: 1.06 KB

Contents

<% self.class.include RailsAdminImageManager::Engine.routes.url_helpers %>

// Direct asset picker

var rails_admin_image_manager = rails_admin_image_manager || {};
rails_admin_image_manager.AssetPicker = function(){

};

rails_admin_image_manager.AssetPicker.prototype = {

	showFinder: function(dom_id, options, file_id){
		// open a popup
		var params = {};
		params.CKEditor = 'picker'; // this is not CKEditor

		if (file_id > 0) {
			params.selectImage = file_id;
		}

		var url = addQueryString('<%= image_manager_index_path %>', params);
		window.open(url, 'filebrowser', "resizable=yes,scrollbars=yes,width=1024,height=700")
  },

	setAsset: function(dom_id, asset, id, type){
		var split_field_name = $(dom_id).attr('id').split('_')
		if (split_field_name[split_field_name.length - 1] == "id") {
			$(dom_id).val(id);
		} else {
			$(dom_id).val(asset);
		}

    if (type=='image') {
		  $(dom_id).siblings('img.rich-image-preview').first().attr({src: asset});
    }
  }

};

// RailsAdminImageManager Asset input
var assetPicker = new rails_admin_image_manager.AssetPicker();

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.34 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.33 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.31 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.30 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.3 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.29 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.28 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.27 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.26 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.25 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.24 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.23 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.22 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.21 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.20 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb
rails_admin_image_manager-0.1.15 app/assets/javascripts/rails_admin_image_manager/editor/image_manager_picker.js.erb