-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.js
More file actions
112 lines (97 loc) · 3.01 KB
/
page.js
File metadata and controls
112 lines (97 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Generated by CoffeeScript 1.6.3
var appContext,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
require.config({
paths: {
jquery: "//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min",
batman: "batmanjs/batman",
bootstrap: "//netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/js/bootstrap.min",
dropbox: "//dropbox.com/static/api/1/dropins"
},
shim: {
batman: {
deps: ["jquery"],
exports: "Batman"
},
bootstrap: {
deps: ["jquery"]
},
dropbox: {
exports: "Dropbox"
}
},
waitSeconds: 30
});
appContext = void 0;
define("Batman", ["batman"], function(Batman) {
return Batman.DOM.readers.batmantarget = Batman.DOM.readers.target && delete Batman.DOM.readers.target && Batman;
});
require(["jquery", "Batman", "dropbox", "bootstrap"], function($, Batman, Dropbox) {
var AppContext, File, SavetoDropB, _ref, _ref1;
File = (function(_super) {
__extends(File, _super);
function File() {
_ref = File.__super__.constructor.apply(this, arguments);
return _ref;
}
return File;
})(Batman.Model);
AppContext = (function(_super) {
__extends(AppContext, _super);
function AppContext() {
AppContext.__super__.constructor.apply(this, arguments);
Dropbox.appKey = "2nvimyu9eugsqm9";
this.set("files", new Batman.Set);
this.set("pageLoaded", false);
}
AppContext.prototype.addFile = function() {
var thisFile,
_this = this;
thisFile = new File({
url: this.get("newFileUrl"),
css: "width: 0%;"
});
this.set("newFileUrl", "");
return Dropbox.save({
files: [
{
url: thisFile.get("url")
}
],
success: function() {
return thisFile.set("uploadSuccess", true);
},
progress: function(progress) {
if (!_this.get("files").has(thisFile)) {
_this.get("files").add(thisFile);
}
return thisFile.set("css", "width: " + (progress * 100) + "%;");
},
cancel: function() {
if (_this.get("files").has(thisFile)) {
return _this.get("files").remove(thisFile);
}
},
error: function(err) {
console.error(err);
return thisFile.set("uploadFailure", true);
}
});
};
return AppContext;
})(Batman.Model);
SavetoDropB = (function(_super) {
__extends(SavetoDropB, _super);
function SavetoDropB() {
_ref1 = SavetoDropB.__super__.constructor.apply(this, arguments);
return _ref1;
}
SavetoDropB.appContext = appContext = new AppContext;
return SavetoDropB;
})(Batman.App);
SavetoDropB.run();
return $(function() {
return appContext.set("pageLoaded", true);
});
});