Skip to content

Instantly share code, notes, and snippets.

@Darkry

Darkry/soubor.js Secret

Created July 12, 2011 13:54
Show Gist options
  • Save Darkry/68c0a95434174b7b2271 to your computer and use it in GitHub Desktop.
Save Darkry/68c0a95434174b7b2271 to your computer and use it in GitHub Desktop.
<script>
new MFUFallbackController(document.getElementById("frmaddRacerForm-pokus1"),[{"id":"frmaddRacerForm-pokus1-MFUInterface-MFUUIUploadify","init":"(function($){\n\n\tvar queue = $(\"#frmaddRacerForm-pokus1-uploadifyBox-queue\");\n\tvar uploadify = $(\"#frmaddRacerForm-pokus1-uploadifyBox\");\n\tvar box = uploadify.parents(\"div.withJS\");\n\n\t\/\/ TODO: add this to stylesheet\n\t$(\"span.button\",box)\n\t.addClass(\"ui-state-default ui-corner-all\")\n\t.css(\"cursor\",\"pointer\")\n\t.css(\"padding\",\"3px\")\n\t.css(\"font-size\",\"12px\")\n\t.css(\"font-family\",\"Constantia,Palatino,'palatino linotype',Georgia,'New York CE',utopia,serif\");\n\n\tuploadify.uploadify({\n\t\twidth: 70,\n\t\theight: 22,\n\t\twmode: \"transparent\",\n\t\tauto: false,\n\t\tmulti: true,\n\t\tqueueID: \"frmaddRacerForm-pokus1-uploadifyBox\"+\"-queue\",\n\t\tbuttonImg: \"http:\\\/\\\/127.0.0.1:8888\\\/scooter\\\/images\\\/MultipleFileUpload\\\/uploadify\\\/uploadifyButton.png\",\n\t\tuploader: \"http:\\\/\\\/127.0.0.1:8888\\\/scooter\\\/swf\\\/MultipleFileUpload\\\/uploadify\\\/uploadify.allglyphs.swf\",\n\t\tcancelImg: \"http:\\\/\\\/127.0.0.1:8888\\\/scooter\\\/images\\\/MultipleFileUpload\\\/uploadify\\\/cancel.png\",\n\t\tqueueSizeLimit: 20,\n\t\tsizeLimit: 2097152,\n\t\tscript: \"\\\/scooter\\\/pridat-jezdca?do=addRacerForm-submit\",\n\t\tsimUploadLimit: 5,\n\t\tscriptData: {\n\t\t\ttoken: \"32704e1c50c9bed09\",\n\t\t\tsender: \"MFU-Uploadify\"\n\t\t},\n\t\tonInit: function(){\n\t\t\t\/\/box.parent().parent().find(\".withoutJS\").hide();\n\t\t},\n\t\tonComplete: function(event, ID, fileObj, response, data){\n\t\t\tjQuery(\"#\" + \"frmaddRacerForm-pokus1-uploadifyBox\" + ID).hide();\n\t\t\treturn false;\n\t\t},\n\t\tonSelect: function(event,queueID,fileObj){\n\t\t\tif(fileObj.size > uploadify.uploadifySettings(\"sizeLimit\")) {\n\t\t\t\tuploadify.trigger({\n\t\t\t\t\ttype: \"sizeLimitExcessed\",\n\t\t\t\t\tfileObj: fileObj,\n\t\t\t\t\tqueueID: queueID\n\t\t\t\t});\n\t\t\t\tuploadify.uploadifyCancel(queueID);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(fileObj.size == 0) {\n\t\t\t\tuploadify.trigger({\n\t\t\t\t\ttype: \"emptyFile\",\n\t\t\t\t\tfileObj: fileObj,\n\t\t\t\t\tqueueID: queueID\n\t\t\t\t});\n\t\t\t\tuploadify.uploadifyCancel(queueID);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tonSelectOnce: function(){\n\t\t\tvar queue = $(\"#\"+$(this).attr(\"id\")+\"-queue\");\n\t\t\t$(\"#\"+$(this).attr(\"id\")+\"ClearQueue\").fadeIn(500);\n\t\t\tqueue.slideDown(1000,function(){\n\t\t\t\t$(\"div.uploadifyQueueItem:first\",queue).livequery(function(){\n\t\t\t\t\t$(this).animate({ marginTop:\"0px\"},200);\n\t\t\t\t});\n\t\t\t});\n\t\t\t$(\"#\"+$(this).attr(\"id\")+\"Count\").text(uploadify.uploadifySettings(\"queueSize\")+\" vybran\u00fdch soubor\u016f\");\n\t\t\treturn false;\n\t\t}\n\t});\n\n\tuploadify.bind(\"sizeLimitExcessed\",function(event){\n\t\talert(\"soubor '\"+event.fileObj.name+\"' je moc velk\u00fd! Bude p\u0159esko\u010den.\");\n\t});\n\n\tuploadify.bind(\"emptyFile\",function(event){\n\t\talert(\"soubor '\"+event.fileObj.name+\"' je pr\u00e1zdn\u00fd! Bude p\u0159esko\u010den.\");\n\t});\n\n\treturn true; \/\/ OK\n\n})(jQuery);","destruct":"(function(){\n\treturn true;\n})();"},{"id":"frmaddRacerForm-pokus1-MFUInterface-MFUUIHTML4SingleUpload","init":"(function() {\n\tjQuery(\"#\"+this.activeUI.id).parents(\"form\").disableAjaxSubmit(); \/\/ @see nette-ajax-form.js\n\treturn true;\n}).call(this);","destruct":true}]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment