summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-08-13 17:56:31 -0400
committerJules Laplace <jules@okfoc.us>2014-08-13 17:56:31 -0400
commitc4c45b64c2c0fc109f4c21effe7f73f5c46a1ae9 (patch)
treef6e5e703af41a53fe3a9daa3de23e671a1c6ab74 /public/assets/javascripts/ui/lib
parent466ccfdccd2d761f31ba78a74a40544b77b358e5 (diff)
parentb7b881a00a9b73ba54cc3a62edc402a903ec9142 (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/lib')
-rw-r--r--public/assets/javascripts/ui/lib/ModalView.js7
-rw-r--r--public/assets/javascripts/ui/lib/Parser.js4
-rw-r--r--public/assets/javascripts/ui/lib/Router.js21
3 files changed, 21 insertions, 11 deletions
diff --git a/public/assets/javascripts/ui/lib/ModalView.js b/public/assets/javascripts/ui/lib/ModalView.js
index 957a54d..937c1e9 100644
--- a/public/assets/javascripts/ui/lib/ModalView.js
+++ b/public/assets/javascripts/ui/lib/ModalView.js
@@ -11,9 +11,10 @@ var ModalView = View.extend({
},
show: function(){
- $(".mediaDrawer").removeClass("active");
- this.$el.addClass("active");
- $("body").addClass("noOverflow");
+ $(".mediaDrawer").removeClass("active")
+ $(".fileUpload").removeClass("active")
+ this.$el.addClass("active")
+ $("body").addClass("noOverflow")
},
hide: function(){
diff --git a/public/assets/javascripts/ui/lib/Parser.js b/public/assets/javascripts/ui/lib/Parser.js
index dfff7b2..1cf0418 100644
--- a/public/assets/javascripts/ui/lib/Parser.js
+++ b/public/assets/javascripts/ui/lib/Parser.js
@@ -86,6 +86,10 @@ var Parser = {
success: function(result){
if (result.length == 0) { return done(id, "", 640, 360) }
var res = result[0]
+ if (res.embed_privacy != "anywhere") {
+ AlertModal.alert("Sorry, the author of this video has marked it private, preventing it from being embedded.", function(){})
+ return
+ }
done({
token: id,
thumbnail: res.thumbnail_large,
diff --git a/public/assets/javascripts/ui/lib/Router.js b/public/assets/javascripts/ui/lib/Router.js
index 5877f93..0b6385c 100644
--- a/public/assets/javascripts/ui/lib/Router.js
+++ b/public/assets/javascripts/ui/lib/Router.js
@@ -4,7 +4,8 @@ var Router = View.extend({
this.originalPath = window.location.pathname
- var pathname = window.location.pathname,
+ var routes = is_mobile ? this.mobileRoutes : this.routes,
+ pathname = window.location.pathname,
path = pathname.split("/");
for (var i = 0; i < path.length; i++) {
@@ -13,7 +14,7 @@ var Router = View.extend({
}
}
- if (pathname in this.routes) {
+ if (pathname in routes) {
this[this.routes[pathname]](null)
}
@@ -21,35 +22,39 @@ var Router = View.extend({
path.pop()
}
- for (var route in this.routes) {
+ for (var route in routes) {
var routePath = route.split("/")
if (routePath[1] == path[1]) {
if (routePath[2] && routePath[2].indexOf(":") !== -1 && path[2] && (path[3] === routePath[3]) ) {
this[this.routes[route]](null, path[2])
- break;
+ return
}
else if (routePath[2] == path[2]) {
if (routePath[3] && path[3]) {
if (routePath[3].indexOf(":") !== -1) {
this[this.routes[route]](null, path[3])
- break;
+ return
}
else if (routePath[3] == path[3]) {
this[this.routes[route]](null)
- break;
+ return
}
}
else if (! routePath[3] && ! path[3]) {
this[this.routes[route]](null)
- break;
+ return
}
}
else if (! routePath[2] && (! path[2].length || ! path[2])) {
this[this.routes[route]](null)
- break;
+ return
}
}
}
+
+ if (is_mobile) {
+ window.location.href = "/"
+ }
}
})