From dad5f3f0c3c13e8334a6a0ea522c5a2bfe8cd830 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 9 Nov 2015 00:30:45 -0500 Subject: faq view and other structure --- StoneIsland/www/css/blogs.css | 7 ++++++- StoneIsland/www/css/nav.css | 2 +- StoneIsland/www/index.html | 10 ++++++++++ StoneIsland/www/js/index.js | 8 ++++++++ StoneIsland/www/js/lib/_router.js | 3 ++- StoneIsland/www/js/lib/account/LoginView.js | 3 --- StoneIsland/www/js/lib/account/LogoutView.js | 24 ++++++++++++++++++++++++ StoneIsland/www/js/lib/account/PaymentView.js | 2 +- StoneIsland/www/js/lib/blogs/BlogView.js | 1 + StoneIsland/www/js/lib/blogs/FaqView.js | 23 +++++++++++++++++++++++ StoneIsland/www/js/lib/nav/SearchView.js | 16 ++++++++++++++++ 11 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 StoneIsland/www/js/lib/account/LogoutView.js create mode 100644 StoneIsland/www/js/lib/blogs/FaqView.js create mode 100644 StoneIsland/www/js/lib/nav/SearchView.js diff --git a/StoneIsland/www/css/blogs.css b/StoneIsland/www/css/blogs.css index 5d0f90fd..b498fc7d 100644 --- a/StoneIsland/www/css/blogs.css +++ b/StoneIsland/www/css/blogs.css @@ -36,4 +36,9 @@ .archive #archive { display: block } #archive { display: none; -} \ No newline at end of file +} + +.faq #faq { display: block } +#faq { + display: none; +} diff --git a/StoneIsland/www/css/nav.css b/StoneIsland/www/css/nav.css index 4a54df2a..89d62ca1 100644 --- a/StoneIsland/www/css/nav.css +++ b/StoneIsland/www/css/nav.css @@ -226,7 +226,7 @@ /* CONTENT */ -#story, #hub, #archive, #collection, #product, #cart { +#story, #hub, #archive, #collection, #product, #cart, #faq, #search { position: absolute; top: 43px; height: -webkit-calc(100% - 43px); diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 8cd643cb..a063f0c3 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -143,6 +143,13 @@ +
+
+

FAQ

+
+
+
+
@@ -359,9 +366,11 @@ + + @@ -375,6 +384,7 @@ + diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 1beaa708..5023873c 100644 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -39,7 +39,15 @@ var app = (function(){ app.nav = new NavView () app.login = new LoginView () + app.logout = new LogoutView () + app.signup = new SignupView () + app.profile = new ProfileView () + app.payment = new PaymentView () + app.shipping = new ShippingView () + app.intro = new IntroView () + app.faq = new FaqView () + app.search = new SearchView () app.product = new ProductView () app.collection = new CollectionView () diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 344755e8..1e01ce96 100644 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -17,7 +17,7 @@ var SiteRouter = Router.extend({ '/account/logout': 'logout', '/account/signup': 'signup', '/account/profile': 'profile', - '/account/billing': 'billing', + '/account/payment': 'payment', '/account/shipping': 'shipping', '/faq': 'faq', @@ -60,3 +60,4 @@ var SiteRouter = Router.extend({ }, }) + diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js index 40cc29ba..3b409b3d 100644 --- a/StoneIsland/www/js/lib/account/LoginView.js +++ b/StoneIsland/www/js/lib/account/LoginView.js @@ -6,8 +6,6 @@ var LoginView = View.extend({ "submit form": "submit", }, - mode: null, - initialize: function(){ this.$form = this.$("form") }, @@ -18,7 +16,6 @@ var LoginView = View.extend({ }, hide: function(){ - app.curtain.hide() document.body.classList.remove("login") }, diff --git a/StoneIsland/www/js/lib/account/LogoutView.js b/StoneIsland/www/js/lib/account/LogoutView.js new file mode 100644 index 00000000..fffe661a --- /dev/null +++ b/StoneIsland/www/js/lib/account/LogoutView.js @@ -0,0 +1,24 @@ +var LogoutView = View.extend({ + + el: "#logout", + + events: { + }, + + show: function(){ + document.body.classList.add("logout") + }, + + hide: function(){ + document.body.classList.remove("logout") + }, + + submit: function(e){ + e.preventDefault() + }, + + success: function(){ + // change login in ui to logout or whatever + }, + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/PaymentView.js b/StoneIsland/www/js/lib/account/PaymentView.js index 1ce91283..74727648 100644 --- a/StoneIsland/www/js/lib/account/PaymentView.js +++ b/StoneIsland/www/js/lib/account/PaymentView.js @@ -30,5 +30,5 @@ var AddressView = View.extend({ serialize: function(){ }, - + }) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index 59cf25b2..357698f5 100644 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/www/js/lib/blogs/BlogView.js @@ -28,6 +28,7 @@ var BlogView = View.extend({ this.loader.preloadImage(data.story[0].image.uri, function(img){ app.story.populate(data.story) }) + app.faq.populate(data.page[0]) }, }) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/blogs/FaqView.js b/StoneIsland/www/js/lib/blogs/FaqView.js new file mode 100644 index 00000000..bce83d88 --- /dev/null +++ b/StoneIsland/www/js/lib/blogs/FaqView.js @@ -0,0 +1,23 @@ +var FaqView = ScrollableView.extend({ + + el: "#faq", + + events: { + }, + + initialize: function(){ + this.$content = this.$(".content") + this.$loader = this.$(".loader") + this.scroller = new IScroll('#faq', app.iscroll_optionsx) + }, + + show: function(){ + this.deferScrollToTop() + document.body.className = "faq" + }, + + populate: function(data){ + this.$content.html(data.body.replace(/\n/g, "
")) + } + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/nav/SearchView.js b/StoneIsland/www/js/lib/nav/SearchView.js new file mode 100644 index 00000000..8739f088 --- /dev/null +++ b/StoneIsland/www/js/lib/nav/SearchView.js @@ -0,0 +1,16 @@ +var SearchView = View.extend({ + + el: "#search", + + events: { + }, + + show: function(){ + document.body.classList.add("search") + }, + + hide: function(){ + document.body.classList.remove("search") + }, + +}) \ No newline at end of file -- cgit v1.2.3-70-g09d2