Skip to content

Commit

Permalink
Queue all
Browse files Browse the repository at this point in the history
  • Loading branch information
muan committed Aug 1, 2013
1 parent 4531425 commit d7a7c48
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
11 changes: 8 additions & 3 deletions _assets/speedy.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ $.fn.speedy = (result_selector) ->
result_selector ?= ".result"

search = (keyword) ->
$(".add-all").toggle( !!keyword )

unless window.speedy_keyword == keyword
window.speedy_keyword = keyword
if keyword.length
Expand All @@ -18,15 +20,18 @@ $.fn.speedy = (result_selector) ->
$(result_selector).show()

$input.on "search keyup", ->
search( $(this).val() )
location.hash = $(this).val()
search( $(this).val() )
location.hash = $(this).val()

$(".group").click ->
search $(this).attr("href").substr(1)

if location.hash.length
search $input.val(location.hash.substr(1)).val()
else
search ""

$(".speedy-remover").click ->
$input.val("")
$(result_selector).show()
$(result_selector).show()
search (location.hash = "")
9 changes: 7 additions & 2 deletions _assets/stuff.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ $ ->
i.selectionStart = 0
i.selectionEnd = i.value.length

$("li img").on "click", ->
$(".add-all").click ->
$("li:visible img").click()

$.fn.addToStoryLine = ->
$(this).clone().appendTo(".story").click ->
$(this).remove()
$(".queue").val $.map( $(".story img"), (e) -> ":" + $(e).attr("title") + ":" ).join("")
$(".queue").val $.map( $(".story img"), (e) -> ":" + $(e).attr("title") + ":" ).join("")
$(".queue").val $.map( $(".story img"), (e) -> ":" + $(e).attr("title") + ":" ).join("")

$("li img").on "click", -> $(this).addToStoryLine()
16 changes: 9 additions & 7 deletions _assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ header, footer {
}

section {
background-color: #f6f6f6;
width: 100%;
max-width: 900px;
margin: 0 auto;
text-align: center;
padding: 20px 0;
padding: 20px;
&.list {
}
&.tell-me-a-story {
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
Expand All @@ -33,19 +37,17 @@ section {

a {
text-decoration: none;
cursor: pointer;
color: #469;
padding: 0 10px;
font-weight: bold;
img { width: 16px; height: 16px; }
}

ul {
width: 100%;
margin: 0 auto;
text-align: left;
max-width: 900px;
padding: 0 20px;
}

.plain {
@include appearance(none);
border: 0;
Expand All @@ -59,7 +61,7 @@ ul {
li {
@include inline-block;
margin: 0;
width: 140px;
width: 160px;
padding: 8px 0;
overflow: hidden;
white-space: nowrap;
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<a class="speedy-remover"><img src="/emojis/x.png" /></a>
</section>
<section class="list">
<a class="add-all">Queue all</a>
<ul>
{% for emoji in site.emojis %}
<li class="result">
Expand Down
6 changes: 5 additions & 1 deletion javascripts/speedy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion javascripts/stuff.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ header, footer {
text-align: center; }

section {
background-color: #f6f6f6;
width: 100%;
max-width: 900px;
margin: 0 auto;
text-align: center;
padding: 20px 0; }
padding: 20px; }
section.tell-me-a-story {
border-bottom: 1px solid #ddd;
padding-bottom: 5px; }

a {
text-decoration: none;
cursor: pointer;
color: #469;
padding: 0 10px;
font-weight: bold; }
Expand All @@ -40,11 +43,7 @@ a {
height: 16px; }

ul {
width: 100%;
margin: 0 auto;
text-align: left;
max-width: 900px;
padding: 0 20px; }
text-align: left; }

.plain {
-webkit-appearance: none;
Expand All @@ -66,7 +65,7 @@ li {
*display: inline;
*vertical-align: auto;
margin: 0;
width: 140px;
width: 160px;
padding: 8px 0;
overflow: hidden;
white-space: nowrap; }
Expand Down

0 comments on commit d7a7c48

Please sign in to comment.