-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lennart
committed
May 16, 2010
1 parent
3f73da6
commit e95cb00
Showing
24 changed files
with
620 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
<ul class="replies"> | ||
|
||
</ul> | ||
<p>Leave a reply:</p> | ||
<form> | ||
<textarea name="body" cols="80" rows="3"></textarea> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
evently/tasks/recent/selectors/ul/_changes/selectors/a[href=#addTrack]/click.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
function() { | ||
var li = $(this).parents("li"); | ||
var app = $$(this).app; | ||
$("div.tracks",li).evently(app.ddoc.evently.replies, app); | ||
return false; | ||
var li = $(this).parents("li"); | ||
var app = $$(this).app; | ||
$("div.tracks",li).evently(app.ddoc.evently.replies, app); | ||
return false; | ||
} | ||
|
37 changes: 19 additions & 18 deletions
37
evently/tasks/recent/selectors/ul/_changes/selectors/a[href=#done]/click.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
function() { | ||
var li = $(this).parents("li"); | ||
var task_id = li.attr("data-id"); | ||
var app = $$(this).app; | ||
app.db.openDoc(task_id, { | ||
success : function(doc) { | ||
doc.state = "done"; | ||
doc.done_by = $("#account").attr("data-name"); | ||
doc.done_at = new Date(); | ||
app.db.saveDoc(doc, { | ||
success : function() { | ||
li.addClass("done"); | ||
li.slideUp("slow"); | ||
} | ||
}); | ||
} | ||
}); | ||
return false; | ||
} | ||
var li = $(this).parents("li"); | ||
var task_id = li.attr("data-id"); | ||
var app = $$(this).app; | ||
app.db.openDoc(task_id, { | ||
success: function(doc) { | ||
doc.state = "done"; | ||
doc.done_by = $("#account").attr("data-name"); | ||
doc.done_at = new Date(); | ||
app.db.saveDoc(doc, { | ||
success: function() { | ||
li.addClass("done"); | ||
li.slideUp("slow"); | ||
} | ||
}); | ||
} | ||
}); | ||
return false; | ||
} | ||
|
11 changes: 6 additions & 5 deletions
11
evently/tasks/recent/selectors/ul/_changes/selectors/a[href=#reply]/click.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
function() { | ||
var li = $(this).parents("li"); | ||
var app = $$(this).app; | ||
$("div.replies",li).evently(app.ddoc.evently.replies, app); | ||
return false; | ||
} | ||
var li = $(this).parents("li"); | ||
var app = $$(this).app; | ||
$("div.replies", li).evently(app.ddoc.evently.replies, app); | ||
return false; | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
evently/tasks/recent/selectors/ul/_changes/selectors/ul/_changes/data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
function(r) { | ||
var v = r.value; | ||
var app = $$(this).app; | ||
|
||
var qid = v.qid; | ||
Playdar.client.register_results_handler(function(response, lastPoll) { | ||
console.log('Polling ' + response.qid); | ||
if (lastPoll) { | ||
// Take a look at the final response. | ||
console.dir(response); | ||
var newTrack = $.extend(v, response); | ||
app.db.saveDoc(newTrack, { success : function() { | ||
if (response.solved) { | ||
$("#"+r.id).html("resolved"); | ||
} else { | ||
$("#"+r.id).html("unresolved"); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
},qid); | ||
Playdar.client.resolve(v.query.artist,v.query.track,null,qid); | ||
return { | ||
avatar_url : v.authorProfile && v.authorProfile.gravatar_url, | ||
body : $.linkify($.mustache.escape(r.value.body)), | ||
name : v.authorProfile && v.authorProfile.name, | ||
name_uri : v.authorProfile && encodeURIComponent(v.authorProfile.name), | ||
futon_path : "/_utils/document.html?"+[app.db.name,r.id].map(encodeURIComponent).join('/'), | ||
id : encodeURIComponent(r.id), | ||
solved : v.solved | ||
// todo this should be handled in dom-land / evently | ||
// we can use this id as a handle for automatically updating non-top rows | ||
// based on changes from documents | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.