Skip to content

Instantly share code, notes, and snippets.

@prawnsalad
Created April 3, 2013 19:39
Show Gist options
  • Save prawnsalad/5304559 to your computer and use it in GitHub Desktop.
Save prawnsalad/5304559 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// kiwi.plugins.load("/assets/file_upload.html")
$script("//api.filepicker.io/v1/filepicker.js", function () {
var network = kiwi.components.Network();
var control = kiwi.components.ControlInput();
filepicker.setKey("AY8oiDSeTdaugLaTPYNBVz");
function uploaded(files) {
var area = $("#kiwi #controlbox textarea")
for (var i = 0; files.length>i; i++) {
area.val(area.val() + " " + files[i].url);
}
}
filepicker.makeDropPane($("#kiwi #panels")[0], { onSuccess: uploaded });
var $icon = $("<a class=\"upload\" title=\"Send File\"><i class=\"icon-upload-alt\"></i></a>");
$icon.click(function () { filepicker.pickMultiple(uploaded); });
control.addPluginIcon($icon);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment