Sha256: 209f7fabc78b670d10c515e9a35c22dab7f601db5e7998a2273e2262990ef033

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

/*
---
 
script: File.js
 
description: Multi file uploader
 
license: Public domain (http://unlicense.org).

authors: Yaroslaff Fedin
 
requires:
  - LSD.Widget.Input
  - LSD/LSD.Mixin.Uploader
  
provides:
  - LSD.Widget.Input.File
  
...
*/


LSD.Widget.Input.File = new Class({
  options: {
    tag: 'input',
    attributes: {
      type: 'file'
    },
    uploader: {
      path: '/flashes/Swiff.Uploader.swf',
      url: '/blobs.json',
      fieldName: 'blob'
    },
    pseudos: Array.fast('uploader', 'focusable', 'form-associated', 'value'),
    layout: Array.fast('::list'),
    proxies: {
      files: {
        condition: function(widget) {
          return (widget.tagName == 'file');
        },
        container: function() {
          return this.list;
        }
      }
    },
    has: {
      one: {
        list: {
          source: 'filelist',
          selector: 'filelist'
        }
      }
    }
  },
  
  canElementHoldValue: function() {
    return false
  },
  
  getRawValue: function() {
    if (this.attributes.blobs) return JSON.decode(this.attributes.blobs)
  }
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lsd_rails-0.1.2 Packages/lsd-widgets/Source/Input/File.js
lsd_rails-0.1.1 Packages/lsd-widgets/Source/Input/File.js
lsd_rails-0.1 Packages/lsd-widgets/Source/Input/File.js