summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--site/public/assets/javascripts/_env.js36
-rw-r--r--site/templates/all.liquid22
-rw-r--r--site/templates/index.liquid8
-rw-r--r--themes/okadmin/public/js/app.js9
4 files changed, 48 insertions, 27 deletions
diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js
index 2c183aa..8871602 100644
--- a/site/public/assets/javascripts/_env.js
+++ b/site/public/assets/javascripts/_env.js
@@ -43,16 +43,14 @@ environment.ready = function(){
$("nav a").click(function(e){
e.preventDefault()
- var hash = "#" + $(this).data("hash")
+ var page = "/" + $(this).data("type") + "/" + $(this).data("id")
+ var hash = "#" + page
if (done_loading && window.location.hash == hash) return
window.location.hash = hash
$("nav a.active").removeClass("active")
$(this).addClass("active")
open_entry()
-
- var page = $(this).attr("href")
- if (page.indexOf("#") !== -1) page = "#"
$("#entry_container").removeClass("visible")
@@ -66,8 +64,8 @@ environment.ready = function(){
$("nav .about").click(function(e){
e.preventDefault()
- if (done_loading && window.location.hash == "#about") return
- window.location.hash = "#about"
+ if (done_loading && window.location.hash == "#/about") return
+ window.location.hash = "#/about"
$("nav a.active").removeClass("active")
open_entry()
@@ -81,8 +79,8 @@ environment.ready = function(){
$("nav .contact").click(function(e){
e.preventDefault()
- if (done_loading && window.location.hash == "#contact") return
- window.location.hash = "#contact"
+ if (done_loading && window.location.hash == "#/contact") return
+ window.location.hash = "#/contact"
$("nav a.active").removeClass("active")
open_entry()
@@ -96,8 +94,8 @@ environment.ready = function(){
$("nav .index").click(function(e){
e.preventDefault()
- if (done_loading && window.location.hash == "#index") return
- window.location.hash = "#index"
+ if (done_loading && window.location.hash == "#/index") return
+ window.location.hash = "#/index"
$("nav a.active").removeClass("active")
open_entry()
@@ -107,13 +105,13 @@ environment.ready = function(){
$loader.load("all .entry", function(){
display_entry($loader.children()[0])
})
- })
+ })
$(".toggleRapper").click(toggle_menu)
$(".toplogo").click(hide_entry)
$(document).on("click", ".project", function(){
- var hash = as_hash( $(this).find("span").text() )
- load_hash(hash)
+ var page = "/" + $(this).data("type") + "/" + $(this).data("id")
+ load_hash(page)
})
$(window).mousedown(function(e){
@@ -146,13 +144,13 @@ environment.ready = function(){
var current_hash = window.location.hash.replace("#","")
$("nav a").each(function(){
- var key = as_hash(this.innerHTML)
- hashes[key] = this
- $(this).data("hash", key)
+ var page = "/" + $(this).data("type") + "/" + $(this).data("id")
+ hashes[page] = this
+ $(this).data("hash", page)
})
- hashes['about'] = $("nav .about")
- hashes['contact'] = $("nav .contact")
- hashes['index'] = $("nav .index")
+ hashes['/about'] = $("nav .about")
+ hashes['/contact'] = $("nav .contact")
+ hashes['/index'] = $("nav .index")
if (current_hash in hashes) {
toggle_menu()
diff --git a/site/templates/all.liquid b/site/templates/all.liquid
index 852137f..01ddc3a 100644
--- a/site/templates/all.liquid
+++ b/site/templates/all.liquid
@@ -1,6 +1,24 @@
<div class="entry all">
- {% for project in projects %}
- <div class="project" data-id="{{ project.id }}">
+ {% for project in retails %}
+ <div class="project" data-id="{{ project.id }}" data-type="retail">
+ <img src="{{ project.images[0].uri }}">
+ <span>{{ project.shortname }}</span>
+ </div>
+ {% endfor %}
+ {% for project in advertisings %}
+ <div class="project" data-id="{{ project.id }}" data-type="advertising">
+ <img src="{{ project.images[0].uri }}">
+ <span>{{ project.shortname }}</span>
+ </div>
+ {% endfor %}
+ {% for project in experientials %}
+ <div class="project" data-id="{{ project.id }}" data-type="experiential">
+ <img src="{{ project.images[0].uri }}">
+ <span>{{ project.shortname }}</span>
+ </div>
+ {% endfor %}
+ {% for project in contents %}
+ <div class="project" data-id="{{ project.id }}" data-type="content">
<img src="{{ project.images[0].uri }}">
<span>{{ project.shortname }}</span>
</div>
diff --git a/site/templates/index.liquid b/site/templates/index.liquid
index 0bd6b7d..19bdf88 100644
--- a/site/templates/index.liquid
+++ b/site/templates/index.liquid
@@ -88,25 +88,25 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
<div class="cat">retail</div>
<div class="sub">
{% for project in retails %}
- <a href="/retail/{{ project.id }}">{{ project.shortname }}</a>
+ <a href="#" data-type="retail" data-id="{{ project.id }}">{{ project.shortname }}</a>
{% endfor %}
</div>
<div class="cat">advertising</div>
<div class="sub">
{% for project in advertisings %}
- <a href="/advertising/{{ project.id }}">{{ project.shortname }}</a>
+ <a href="#" data-type="advertising" data-id="{{ project.id }}">{{ project.shortname }}</a>
{% endfor %}
</div>
<div class="cat">experiential</div>
<div class="sub">
{% for project in experientials %}
- <a href="/experiential/{{ project.id }}">{{ project.shortname }}</a>
+ <a href="#" data-type="experiential" data-id="{{ project.id }}">{{ project.shortname }}</a>
{% endfor %}
</div>
<div class="cat">content</div>
<div class="sub">
{% for project in contents %}
- <a href="/content/{{ project.id }}">{{ project.shortname }}</a>
+ <a href="#" data-type="content" data-id="{{ project.id }}">{{ project.shortname }}</a>
{% endfor %}
</div>
</div>
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js
index 009fe4c..b53d21f 100644
--- a/themes/okadmin/public/js/app.js
+++ b/themes/okadmin/public/js/app.js
@@ -51,7 +51,7 @@ var OKAdmin = function(){
// fix post indexing in list-driven inputs
$(".main.resource form").submit(function(e){
- var $id = $("[name=id]"), $title = $("[name=title]")
+ var $id = $("[name=id]"), $title = $("[name=title]"), $shortname = $("[name=shortname]")
if ($title.length && ! $title.val()) {
alert("Please enter a title")
@@ -60,6 +60,11 @@ var OKAdmin = function(){
return
}
+ if ($shortname.length && ! $shortname.val()) {
+ $shortname.val( $title.val() )
+ return
+ }
+
var slug = slugify( $title.val() )
$id.val( slug )
@@ -136,4 +141,4 @@ $(function(){
})
-function slugify (s){ return (s || "").toLowerCase().replace(/\s/g,"-").replace(/[^-_a-zA-Z0-9]/g, '-').replace(/-+/g,"-") }
+function slugify (s){ return (s || "").toLowerCase().replace(/\s/g,"-").replace(/[^-_a-zA-Z0-9]/g, '-').replace(/-+/g, "-") }