hl198181/neptune · jquery.plupload.queue.js
javascript logo
function(i, file) {
						inputHTML = '';

						if (file.status == plupload.DONE) {
							if (file.target_name) {
								inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
							}

							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_status" value="' + (file.status == plupload.DONE ? 'done' : 'failed') + '" />';
	
							inputCount++;

							$('#' + id + '_count').val(inputCount);
						}

						fileList.append(
							'<li id="' + file.id + '">' +
								'<div class="plupload_file_name"><span>' + file.name + '</span></div>' +
								'<div class="plupload_file_action"><a href="#"></a></div>' +
								'<div class="plupload_file_status">' + file.percent + '%</div>' +
								'<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' +
								'<div class="plupload_clearer">&nbsp;</div>' +
								inputHTML +
							'</li>'
						);

						handleStatus(file);

						$('#' + file.id + '.plupload_delete a').click(function(e) {
							$('#' + file.id).remove();
							uploader.removeFile(file);

							e.preventDefault();
						});
					}
Similar code snippets
1.
hl198181/neptune · jquery.plupload.queue.js
Match rating: 80.74% · See similar code snippets
javascript logo
function updateList() {
					var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML;

					$.each(uploader.files, function(i, file) {
						inputHTML = '';

						if (file.status == plupload.DONE) {
							if (file.target_name) {
								inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
							}

							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
							inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_status" value="' + (file.status == plupload.DONE ? 'done' : 'failed') + '" />';
	
							inputCount++;

							$('#' + id + '_count').val(inputCount);
						}

						fileList.append(
							'<li id="' + file.id + '">' +
								'<div class="plupload_file_name"><span>' + file.name + '</span></div>' +
								'<div class="plupload_file_action"><a href="#"></a></div>' +
								'<div class="plupload_file_status">' + file.percent + '%</div>' +
								'<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' +
								'<div class="plupload_clearer">&nbsp;</div>' +
								inputHTML +
							'</li>'
						);

						handleStatus(file);

						$('#' + file.id + '.plupload_delete a').click(function(e) {
							$('#' + file.id).remove();
							uploader.removeFile(file);

							e.preventDefault();
						});
					});

					$('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size));

					if (uploader.total.queued === 0) {
						$('span.plupload_add_text', target).html(_('Add Files'));
					} else {
						$('span.plupload_add_text', target).html(o.sprintf(_('%d files queued'), uploader.total.queued));
					}

					$('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));

					// Scroll to end of file list
					fileList[0].scrollTop = fileList[0].scrollHeight;

					updateTotalProgress();

					// Re-add drag message if there is no files
					if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) {
						$('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
					}
				}
2.
hl198181/neptune · jquery.ui.plupload.js
Match rating: 79.34% · See similar code snippets
javascript logo
function() {
		var self = this;

		// re-add from fresh
		$('.plupload_file_fields', this.filelist).html('');

		plupload.each(this.uploader.files, function(file, count) {
			var fields = ''
			, id = self.id + '_' + count
			;

			if (file.target_name) {
				fields += '<input type="hidden" name="' + id + '_tmpname" value="'+plupload.xmlEncode(file.target_name)+'" />';
			}
			fields += '<input type="hidden" name="' + id + '_name" value="'+plupload.xmlEncode(file.name)+'" />';
			fields += '<input type="hidden" name="' + id + '_status" value="' + (file.status === plupload.DONE ? 'done' : 'failed') + '" />';

			$('#' + file.id).find('.plupload_file_fields').html(fields);
		});

		this.counter.val(this.uploader.files.length);
	}
3.
hl198181/neptune · jquery.ui.plupload.js
Match rating: 79.07% · See similar code snippets
javascript logo
function(file, count) {
			var fields = ''
			, id = self.id + '_' + count
			;

			if (file.target_name) {
				fields += '<input type="hidden" name="' + id + '_tmpname" value="'+plupload.xmlEncode(file.target_name)+'" />';
			}
			fields += '<input type="hidden" name="' + id + '_name" value="'+plupload.xmlEncode(file.name)+'" />';
			fields += '<input type="hidden" name="' + id + '_status" value="' + (file.status === plupload.DONE ? 'done' : 'failed') + '" />';

			$('#' + file.id).find('.plupload_file_fields').html(fields);
		}
4.
hl198181/neptune · jquery.plupload.queue.min.js
Match rating: 72.48% · See similar code snippets
javascript logo
function(t,r){s="",r.status==plupload.DONE&&(r.target_name&&(s+='<input type="hidden" name="'+f+"_"+i+'_tmpname" value="'+plupload.xmlEncode(r.target_name)+'" />'),s+='<input type="hidden" name="'+f+"_"+i+'_name" value="'+plupload.xmlEncode(r.name)+'" />',s+='<input type="hidden" name="'+f+"_"+i+'_status" value="'+(r.status==plupload.DONE?"done":"failed")+'" />',i++,e("#"+f+"_count").val(i)),n.append('<li id="'+r.id+'">'+'<div class="plupload_file_name"><span>'+r.name+"</span></div>"+'<div class="plupload_file_action"><a href="#"></a></div>'+'<div class="plupload_file_status">'+r.percent+"%</div>"+'<div class="plupload_file_size">'+plupload.formatSize(r.size)+"</div>"+'<div class="plupload_clearer">&nbsp;</div>'+s+"</li>"),c(r),e("#"+r.id+".plupload_delete a").click(function(t){e("#"+r.id).remove(),u.removeFile(r),t.preventDefault()})}
5.
ArchimediaZerogroup/alchemy-custom-model · elfinder.min.js
Match rating: 56.59% · See similar code snippets
javascript logo
function(){return i<1?d.reject():(u.append('<input type="hidden" name="'+(s.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+s.id+'"/>').append(e(l).attr("name","upload[]")),y.length>0&&(e.each(y,function(e,t){u.append('<input type="hidden" name="renames[]" value="'+s.escape(t)+'"/>')}),u.append('<input type="hidden" name="suffix" value="'+n.options.backupSuffix+'"/>')),w&&e.each(y,function(e,t){u.append('<input type="hidden" name="['+e+']" value="'+s.escape(t)+'"/>')}),0===t.overwrite&&u.append('<input type="hidden" name="overwrite" value="0"/>'),e.each(s.options.onlyMimes||[],function(e,t){u.append('<input type="hidden" name="mimes[]" value="'+s.escape(t)+'"/>')}),e.each(s.customData,function(e,t){u.append('<input type="hidden" name="'+e+'" value="'+s.escape(t)+'"/>')}),u.appendTo("body"),void m.appendTo("body"))}
6.
jsbin/jsbin · save.js
Match rating: 52.69% · See similar code snippets
javascript logo
function setupform(method) {
var $form = $('form#saveform').empty()
    .append('<input type="hidden" name="javascript" />')
    .append('<input type="hidden" name="html" />')
    .append('<input type="hidden" name="css" />')
    .append('<input type="hidden" name="method" />')
    .append('<input type="hidden" name="_csrf" value="' + jsbin.state.token + '" />')
    .append('<input type="hidden" name="settings" />')
    .append('<input type="hidden" name="checksum" />');

  var settings = {};

  if (jsbin.state.processors) {
    settings.processors = jsbin.state.processors;
  }

  // this prevents new revisions forking off the welcome bin
  // because it's looking silly!
  if (jsbin.state.code === 'welcome') {
    $form.attr('action', '/save');
  }

  $form.find('input[name=settings]').val(JSON.stringify(settings));
  $form.find('input[name=javascript]').val(editors.javascript.getCode());
  $form.find('input[name=css]').val(editors.css.getCode());
  $form.find('input[name=html]').val(editors.html.getCode());
  $form.find('input[name=method]').val(method);
  $form.find('input[name=checksum]').val(jsbin.state.checksum);

  return $form;
}
7.
ariatemplates/hashspace · plunker.js
Match rating: 47.96% · See similar code snippets
javascript logo
function plunkerExport(event, playground) {
  var form = createElement('<form style="display: none;" method="post" action="http://plnkr.co/edit/#/?p=preview" target="_blank"></form>');
  var addField = function(name, value) {
    var input = createElement('<input type="hidden" name="' + name + '">');
    input.setAttribute('value', value);
    form.appendChild(input);
  };


  addField('description', playground.data.sampleTitle + "\n" + window.location);
  addField('tags[]', "hashspace");
  addField('files[index.html]', [
    '<!doctype html>',
    '<html>',
    '  <head>',
    '    <link rel="stylesheet" type="text/css" href="http://hashspace.ariatemplates.com/css/samples.css" />',
    '    <script src="http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js" type="text/javascript">',
    '    {',
    '      packaging: {',
    '        preprocessors: [{',
    '          pattern: /\\.hsp$/,',
    '          module: "hsp/compiler/compile"',
    '        }, {',
    '          pattern: /\\.js$/,',
    '          module: "hsp/transpiler/transpile"',
    '        }]',
    '      }',
    '    }',
    '    </script>',
    '    <script src="http://hashspace.ariatemplates.com/dist/' + window.hashspace_version + '/hashspace-noder.js"></script>',
    '    <script src="http://hashspace.ariatemplates.com/dist/' + window.hashspace_version + '/hashspace-noder-compiler.js"></script>',
    '  </head>',
    '  <body>\n',
    '    <div id="sample"></div>',
    '',
    '    <script type="application/x-noder">',
    '      var sample = require("./sample.hsp"),',
    '          template = sample.template,',
    '          data = sample.data || [];',
    '',
    '      if (typeof data === "function") {',
    '        data = data.call(sample);',
    '      }',
    '      template.apply(sample, data).render("sample");',
    '    </script>',
    '  </body>',
    '</html>'
  ].join('\n'));
  addField('files[sample.hsp]', [
    playground.editor.getValue()
  ].join('\n'));

  document.body.appendChild(form);
  form.submit();
  document.body.removeChild(form);
  event.preventDefault();
}
8.
ariatemplates/hashspace · plunker.js
Match rating: 47.51% · See similar code snippets
javascript logo
function(name, value) {
    var input = createElement('<input type="hidden" name="' + name + '">');
    input.setAttribute('value', value);
    form.appendChild(input);
  }
9.
ansman/validate.js · validate-helpers-spec.js
Match rating: 47.49% · See similar code snippets
javascript logo
function() {
      var form = document.createElement("form");
      form.innerHTML = '' +
        '<input type="text" name="text" value="example text">' +
        '<input type="text" name="empty-text">' +
        '<input type="email" name="email" value="example@email.com">' +
        '<input type="password" name="password" value="password!">' +
        '<input type="checkbox" name="selected-checkbox" value="checkbox" checked>' +
        '<input type="checkbox" name="deselected-checkbox" value="checkbox">' +
        '<input type="date" name="date" value="2015-03-08">' +
        '<input type="hidden" name="hidden" value="hidden">' +
        '<input type="number" name="number" value="4711">' +
        '<input type="url" name="url" value="http://validatejs.org">' +
        '<input type="radio" name="single-checked-radio" value="radio" checked>' +
        '<input type="radio" name="single-unchecked-radio" value="radio">' +
        '<radiogroup>' +
        '  <input type="radio" name="checked-radio" value="radio1">' +
        '  <input type="radio" name="checked-radio" value="radio2" checked>' +
        '  <input type="radio" name="checked-radio" value="radio3">' +
        '</radiogroup>' +
        '<radiogroup>' +
        '  <input type="radio" name="unchecked-radio" value="radio1">' +
        '  <input type="radio" name="unchecked-radio" value="radio2">' +
        '  <input type="radio" name="unchecked-radio" value="radio3">' +
        '</radiogroup>' +
        '<select name="selected-dropdown">' +
        '  <option>' +
        '  <option value="option1">' +
        '  <option value="option2" selected>' +
        '</select>' +
        '<select name="unselected-dropdown">' +
        '  <option>' +
        '  <option value="option1">' +
        '  <option value="option2">' +
        '</select>' +
        '<textarea name="textarea-ignored" data-ignored>the textarea</textarea>'+
        '<textarea name="textarea">the textarea</textarea>';

      expect(validate.collectFormValues(form)).toEqual({
        text: "example text",
        "empty-text": null,
        email: "example@email.com",
        password: "password!",
        "selected-checkbox": "checkbox",
        "deselected-checkbox": null,
        date: "2015-03-08",
        hidden: "hidden",
        number: 4711,
        url: "http://validatejs.org",
        "single-checked-radio": "radio",
        "single-unchecked-radio": null,
        "checked-radio": "radio2",
        "unchecked-radio": null,
        "selected-dropdown": "option2",
        "unselected-dropdown": null,
        "textarea": "the textarea"
        });
    }
10.
easysoft/zui · kindeditor.js
Match rating: 47.08% · See similar code snippets
javascript logo
function() {
            var html = ['<div style="padding:20px;">',
                '<div class="ke-dialog-row">',
                '<label for="keName">' + lang.name + '</label>',
                '<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" />',
                '</div>',
                '</div>'
            ].join('');
            var dialog = self.createDialog({
                name: name,
                width: 300,
                title: self.lang(name),
                body: html,
                yesBtn: {
                    name: self.lang('yes'),
                    click: function(e) {
                        self.insertHtml('<a name="' + nameBox.val() + '">').hideDialog().focus();
                    }
                }
            });
            var div = dialog.div,
                nameBox = K('input[name="name"]', div);
            var img = self.plugin.getSelectedAnchor();
            if(img) {
                nameBox.val(unescape(img.attr('data-ke-name')));
            }
            nameBox[0].focus();
            nameBox[0].select();
        }