use Addthis, some other attempts at fixing the weird bug

This commit is contained in:
Tyler Renelle 2012-08-08 09:57:32 -04:00
parent 73e857049e
commit b2cd9c0d0f
4 changed files with 15 additions and 10 deletions

View file

@ -114,8 +114,11 @@ module.exports.tally = function(model) {
todoTally = 0;
_.each(user.get('tasks'), function(taskObj, taskId, list) {
var absVal, completed, task, type, value, _ref;
if (taskObj.id == null) {
return;
}
_ref = [taskObj.type, taskObj.value, taskObj.completed], type = _ref[0], value = _ref[1], completed = _ref[2];
task = model.at("_user.tasks." + taskId);
task = user.at("tasks." + taskId);
if (type === 'todo' || type === 'daily') {
if (!completed) {
score({

View file

@ -10,7 +10,7 @@ schema = require('./schema')
helpers = require('./helpers')
helpers.viewHelpers(view)
# $ = require('jQuery')
# _ = require('underscore')
# und = require('underscore') # node.js uses _
# ========== ROUTES ==========
@ -69,7 +69,7 @@ get '/:uidParam?', (page, model, {uidParam}) ->
ready (model) ->
model.set '_purl', window.location.origin + '/' + model.get('_userId')
model.set('_purl', (window.location.origin + '/' + model.get('_userId')))
$('[rel=popover]').popover()
#TODO: this isn't very efficient, do model.on set for specific attrs for popover

View file

@ -102,8 +102,10 @@ module.exports.tally = (model) ->
user = model.at '_user'
todoTally = 0
_.each user.get('tasks'), (taskObj, taskId, list) ->
#FIXME is it hiccuping here? taskId == "$_65255f4e-3728-4d50-bade-3b05633639af_2", & taskObj.id = undefined
return unless taskObj.id? #this shouldn't be happening, some tasks seem to be corrupted
[type, value, completed] = [taskObj.type, taskObj.value, taskObj.completed]
task = model.at("_user.tasks.#{taskId}")
task = user.at("tasks.#{taskId}")
if type in ['todo', 'daily']
# Deduct experience for missed Daily tasks,
# but not for Todos (just increase todo's value)

View file

@ -172,12 +172,12 @@
<td>
<!-- AddThis Button BEGIN -->
<!--<div class="addthis_toolbox addthis_default_style ">
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
</div>-->
</div>
<!-- AddThis Button END -->
<a href="https://twitter.com/share" class="twitter-share-button" data-via="lefnire">Tweet</a>
<!--<a href="https://twitter.com/share" class="twitter-share-button" data-via="lefnire">Tweet</a>-->
</td>
{/}
@ -318,8 +318,8 @@
</script>
<!-- Addthis -->
<!--<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire"></script>-->
{#unless _mobileDevice}<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire"></script>{/}
<!-- Twitter -->
{#unless _mobileDevice}<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>{/}
<!--{#unless _mobileDevice}<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>{/}-->