Sha256: 9a11ce5a3fa61f812bc124904472f46299eba222225dbfa6a1733472ac6f9154

Contents?: true

Size: 1.72 KB

Versions: 4

Compression:

Stored size: 1.72 KB

Contents

= form_for [forgeos_core, :admin, Attachment.new], :html => { :multipart => true } do |f|
  #imageUploadDialog.upload-lightbox-container.white
    #imageUpload
      = f.file_field :uploaded_data
      = hidden_field_tag :target, params[:target]
      = hidden_field_tag :target_id, params[:target_id]
      = f.submit I18n.t('save').capitalize

:javascript
  function initImageUpload(link) {
    jQuery('#imageUploadDialog').dialog('open');
    jQuery('#imageUploadDialog').html('<div id="imageUpload"></div>');
    var uploadify_datas = {
      "parent_id": jQuery('#parent_id_tmp').val(),
      "format": "json"
    };
    uploadify_datas[window._forgeos_js_vars.session_key] = window._forgeos_js_vars.session;

    jQuery('#imageUpload').uploadify({
      "uploader": '/assets/forgeos/uploadify/uploadify.swf',
      "cancelImg": '/assets/forgeos/admin/big-icons/delete-icon.png',
      "script": "#{forgeos_core.admin_pictures_path}",
      "buttonImg": '/assets/forgeos/uploadify/upload-#{file_type}_#{I18n.locale}.png',
      "width": "154",
      "height": "24",
      "scriptData": uploadify_datas,
      "ScriptAccess": "always",
      "multi": "true",
      "displayData": "speed",
      "onComplete": function(e,queueID,fileObj,response,data) {
        if(typeof JSON=="object" && typeof JSON.parse=="function") {
          result = JSON.parse(response);
        } else{
          result = eval('(' + response + ')');
        }
        if (result.result == 'success'){
          oTable.fnDraw();
          jQuery.tree.focused().refresh();
        } else {
          display_notification_message('error',result.error);
        }
      },
      "onAllComplete": function() {
        jQuery('#imageUploadDialog').dialog('close');
      }
    });
  }

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
forgeos_core-1.9.5.rc2 app/views/admin/attachments/_attachments_popup.html.haml
forgeos_core-1.9.5.rc1 app/views/admin/attachments/_attachments_popup.html.haml
forgeos_core-1.9.4 app/views/admin/attachments/_attachments_popup.html.haml
forgeos_core-1.9.3 app/views/admin/attachments/_attachments_popup.html.haml