Sha256: 38eabb2ab0791aecd2cb8e2d86c3a21569240ee9799a5629ae0bf277b7ca6899

Contents?: true

Size: 981 Bytes

Versions: 82

Compression:

Stored size: 981 Bytes

Contents

function AjaxImageUploader(asset_title, upload_button_id) {

  new AjaxUpload(upload_button_id,
      {
        action: $("#async_create_asset_path").attr('value'),
        name: 'asset[asset]',
        data: {
          page : $("#page_id").attr('value'),
          authenticity_token: $("#auth_token").attr('value'),
          "asset[title]": asset_title
        },

        onSubmit : function(file, ext) {
          if (! (ext && /^(jpg|png|jpeg|gif)$/i.test(ext))) {
            alert('You are only allowed to upload image files');
            return false;
          }
          $("#edit_page").bind("submit.asset_upload", function() {
            alert("Please wait until the image has completed uploading.");
            return false;
          });
        },

        onComplete: function(file, response) {
          $("#edit_page").unbind("submit.asset_upload");
          $("#" + asset_title + "_icons").html("<img src='" + response + "'></img>");
        }
      });
}

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.6.2 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.6.1 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.6 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.19 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.18 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.17 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.16 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.15 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.14 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.13 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.12 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.11 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.10 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.9 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.8 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.7 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.6 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.5 app/assets/javascripts/admin/pages/ajax_image_uploader.js
trusty-festivity-extension-2.5.4 app/assets/javascripts/admin/pages/ajax_image_uploader.js