Easter Eggs!

This commit is contained in:
Ken Elf Mathieu Sternberg 2012-07-17 13:15:15 -07:00
parent 68e30c0bb7
commit 470634b5d6
4 changed files with 14 additions and 5 deletions

BIN
assets/images/imperial.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
assets/images/rebel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -45,7 +45,9 @@
%p %p
To use: Just click on either header. A new entry will open To use: Just click on either header. A new entry will open
up in that list for you to fill out. Empty entries will be up in that list for you to fill out. Empty entries will be
deleted automatically. deleted automatically. <b>All data is stored in your
browser's local store; there are no servers, and your data
is never transmitted anywhere.</b>
%p %p
You can click on the gear icon in the lower You can click on the gear icon in the lower

View File

@ -64,10 +64,16 @@ require ['jquery', 'lawnchair'], ($) ->
$('.delete-priority-field', li).on 'click', deletePriority $('.delete-priority-field', li).on 'click', deletePriority
input.focus() input.focus()
save: -> easter: ->
@clean() force_re = new RegExp('(Force|Empire|Vader|Darth|Sith|Jedi|rebel)')
@repo.save {key: 'priorities', 'priorities': @priorities}, () => force = (1 for p in @priorities when force_re.test(p.name))
@render() if force.length > 0
console.log("Aroo?")
$('#prioritize').css('background-image', 'url(rebel.png)')
$('#ignorize').css('background-image', 'url(imperial.png)')
else
$('#prioritize').css('background-image', 'url(thumbsup.png)')
$('#ignorize').css('background-image', 'url(thumbsdown.png)')
clean: -> clean: ->
@priorities = ({name: p.name, cat: p.cat} for p in @priorities when p.name.trim() != "") @priorities = ({name: p.name, cat: p.cat} for p in @priorities when p.name.trim() != "")
@ -78,6 +84,7 @@ require ['jquery', 'lawnchair'], ($) ->
@render() @render()
render: => render: =>
@easter()
priority_enumerate = (cat) => priority_enumerate = (cat) =>
r = [] r = []
for i in [0...@priorities.length] for i in [0...@priorities.length]