1/*global jhInstance, jQuery*/ 2 3(function(jh){ 4 'use strict'; 5 6 var $this; 7 $this = jh.init(jhForms, 'file', {}); 8 9 jhDom.onload(function(content){ 10 11 $this.loadSelectForm(content); 12 13 }, $this.opt.prefix); 14 15 $this.template = '' 16 + '<div>' 17 + 'Size: <span class="' + $this.opt.prefix + '-size">' 18 + '</div>' 19 ; 20 21 $this.loadSelectForm = function(content){ 22 23 jhDom.selDataOnce(content, 'input', 'select_file', function(field){ 24 25 field.data_select_file = field.data_select_file || {}; 26 var select_opt = field.data_select_file; 27 28 select_opt.template = jhTemplate(select_opt.template || $this.template); 29 select_opt.template = jQuery(select_opt.template).get(0); 30 31 jQuery(field).after(select_opt.template); 32 33 jQuery(field).change(function(){ 34 35 var vars = {} 36 , file = field.files !== undefined ? field.files[0] || null : null 37 ; 38 39 if(file){ vars.size = file.size; } 40 41 jhTemplate.setElsHtml(select_opt.template, $this.opt.prefix + '-', vars); 42 43 }); 44 45 }); 46 47 }; 48 49 50}(jhInstance));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.