Generating the underlying markup
In this task, we'll add an initialization method to our plugin which will generate the required markup that the widget requires.
Engage Thrusters
First of all we should add the following code directly after the Up()
constructor function in uploader.js
:
Up.prototype.init = function() { var widget = this, strings = widget.config.strings, container = $("<article/>", { "class": "up" }), heading = $("<header/>").appendTo(container), title = $("<h1/>", { text: strings.title }).appendTo(heading), drop = $("<div/>", { "class": "up-drop-target", html: $("<h2/>", { text: strings.dropText }) }).appendTo(container), alt = $("<h3/>", { text: strings.altText }).appendTo(container), upload = $("<input/>", { type: "file" }).prop("multiple", true).appendTo(container), select = $("<a/>...