summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js')
-rwxr-xr-xStoneIsland/www/js/lib/auth/SignupView.js24
-rwxr-xr-xStoneIsland/www/js/lib/blogs/StoryView.js2
-rw-r--r--StoneIsland/www/js/lib/etc/accessibility.js4
-rwxr-xr-xStoneIsland/www/js/lib/nav/CurtainView.js2
-rwxr-xr-xStoneIsland/www/js/lib/nav/NavView.js8
-rwxr-xr-xStoneIsland/www/js/lib/view/Serializable.js9
-rw-r--r--StoneIsland/www/js/vendor/imageviewer.js11
7 files changed, 39 insertions, 21 deletions
diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js
index 66d8f239..b16ff887 100755
--- a/StoneIsland/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/www/js/lib/auth/SignupView.js
@@ -114,19 +114,19 @@ var SignupView = FormView.extend({
},
error: function(data){
- try {
- data = JSON.parse(data.responseText)
- app.signup.show_errors([[ 'Name', data['Error']['Description'] ]])
- }
- catch (e) {
- switch (data.status) {
- case 409:
- app.signup.show_errors([[ 'Email', "Email is already in use." ]])
- break
- default:
+ switch (data.status) {
+ case 409:
+ app.signup.show_errors([[ 'Email', "Email is already in use." ]])
+ break
+ default:
+ try {
+ data = JSON.parse(data.responseText)
+ app.signup.show_errors([[ 'Name', data['Error']['Description'] ]])
+ }
+ catch (e) {
app.signup.show_errors([[ 'Name', "There was an unknown error." ]])
- break
- }
+ }
+ break
}
},
diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js
index 0b3b17d7..71f1cc0c 100755
--- a/StoneIsland/www/js/lib/blogs/StoryView.js
+++ b/StoneIsland/www/js/lib/blogs/StoryView.js
@@ -40,7 +40,7 @@ var StoryView = ScrollableView.extend({
.replace(/{{body}}/, row.body.replace(/\n/g, "<br>"))
var li = document.createElement("li")
li.dataset.id = row.id
- li.innerHTML = row.title
+ li.innerHTML = "<div>" + row.title + "</div>"
li.setAttribute('role', "link")
this.sections[row.id] = row
this.$links.append(li)
diff --git a/StoneIsland/www/js/lib/etc/accessibility.js b/StoneIsland/www/js/lib/etc/accessibility.js
index 31ddaf23..c66143cc 100644
--- a/StoneIsland/www/js/lib/etc/accessibility.js
+++ b/StoneIsland/www/js/lib/etc/accessibility.js
@@ -30,8 +30,8 @@ var accessibility = (function() {
MobileAccessibility.getTextZoom(function getTextZoomCallback(textZoom) {
console.log('WebView text should be scaled to the preferred value ' + textZoom + '%')
if (textZoom > 100) {
- app.accessible = true
- $("html").addClass('accessible')
+ // app.accessible = true
+ // $("html").addClass('accessible')
}
});
MobileAccessibility.isVoiceOverRunning(function(state){
diff --git a/StoneIsland/www/js/lib/nav/CurtainView.js b/StoneIsland/www/js/lib/nav/CurtainView.js
index ddb6bc19..d444fd60 100755
--- a/StoneIsland/www/js/lib/nav/CurtainView.js
+++ b/StoneIsland/www/js/lib/nav/CurtainView.js
@@ -28,7 +28,7 @@ var CurtainView = View.extend({
},
click: function(){
- if (document.body.classList.contains("nav") && !app.accessible) {
+ if (document.body.classList.contains("nav")) {
app.nav.hide()
}
if (app.selector.visible) {
diff --git a/StoneIsland/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js
index 1655b7f8..a9a1938e 100755
--- a/StoneIsland/www/js/lib/nav/NavView.js
+++ b/StoneIsland/www/js/lib/nav/NavView.js
@@ -37,6 +37,8 @@ var NavView = View.extend({
"click .insta": "insta",
"click .tw": "tw",
"click .yt": "yt",
+
+ "click .close": "close",
},
initialize: function(){
@@ -161,7 +163,7 @@ var NavView = View.extend({
fb: function(){
- window.open(is_ios ? "facebook://profile/231623463406" : "https://www.facebook.com/StoneIsland", '_system')
+ window.open("https://www.facebook.com/StoneIsland", '_system')
},
insta: function(){
window.open("https://instagram.com/stoneisland_official", '_system')
@@ -173,4 +175,8 @@ var NavView = View.extend({
window.open("https://www.youtube.com/user/StoneIslandOfficial", '_system')
},
+ close: function(){
+ this.hide()
+ },
+
})
diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js
index 3181fddd..08802fa9 100755
--- a/StoneIsland/www/js/lib/view/Serializable.js
+++ b/StoneIsland/www/js/lib/view/Serializable.js
@@ -104,6 +104,7 @@ var SerializableView = View.extend({
console.log("showing errors")
console.log(errors)
var msgs = []
+ this.$('.err_heading').addClass('error_visible')
this.$('.error_hilite').removeClass('error_hilite')
this.$('.err').html('')
errors.forEach(function(e, i){
@@ -114,6 +115,9 @@ var SerializableView = View.extend({
if (el && el.nodeName === 'SELECT') {
$el.parent().addClass('error_hilite')
$el.parent().next('.err').html(e[1])
+ } else if (el && el.type === 'date') {
+ $el.parent().addClass('error_hilite')
+ $el.parent().next('.err').html(e[1])
} else {
$el.addClass('error_hilite')
$el.next('.err').html(e[1])
@@ -123,6 +127,9 @@ var SerializableView = View.extend({
}.bind(this))
// this.$msg.html(msgs.join("<br>"))
this.$msg.addClass('alert-notice')
+ if (app.view.scroller) {
+ app.view.scroller.scrollTo(0, 0)
+ }
},
hide_errors: function(){
@@ -137,6 +144,8 @@ var SerializableView = View.extend({
save: function(e){
e && e.preventDefault()
+ this.$('.err_heading').removeClass('error_visible')
+
var valid = this.validate()
if (valid.errors.length) {
this.show_errors(valid.errors)
diff --git a/StoneIsland/www/js/vendor/imageviewer.js b/StoneIsland/www/js/vendor/imageviewer.js
index 847c6070..d80ae7ed 100644
--- a/StoneIsland/www/js/vendor/imageviewer.js
+++ b/StoneIsland/www/js/vendor/imageviewer.js
@@ -85,7 +85,7 @@
//add a full screen view
$(function () {
if(!$body.length) $body = $('body');
- $body.append('<div id="iv-container">' + imageViewHtml + '<div class="iv-close"></div><div>');
+ $body.append('<div id="iv-container">' + imageViewHtml + '<div class="iv-close" role="button" aria-label="Close this image."></div><div>');
imageViewHtml = null
});
@@ -674,10 +674,10 @@
height: handleHeight + '%'
});
},
- show: function (image, hiResImg) {
+ show: function (image, hiResImg, message) {
if (this._fullPage) {
this.container.show();
- if (image) this.load(image, hiResImg);
+ if (image) this.load(image, hiResImg, message);
}
},
hide: function () {
@@ -701,9 +701,10 @@
$window.off(eventSuffix);
return null;
},
- load: function (image, hiResImgSrc) {
+ load: function (image, hiResImgSrc, message) {
var self = this,
container = this.container;
+ message = message || 'Viewing high-resolution image. Pinch to zoom or tap to close.'
container.find('.iv-snap-image,.iv-large-image').remove();
var snapImageWrap = this.container.find('.iv-snap-image-wrap');
@@ -711,9 +712,11 @@
var snapImage = new Image
snapImage.className = 'iv-snap-image'
snapImage.src = image
+ snapImage.setAttribute('aria-label', message)
var largeImage = new Image
largeImage.className = 'iv-large-image'
+ largeImage.setAttribute('aria-label', message)
var hiResImg;