diff --git a/view/js/main.js b/view/js/main.js index 4921ea94f7..d1976fdaa9 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -682,21 +682,26 @@ function dosubthread(ident) { liking = 1; } -function dostar(ident) { +function doStar(ident) { ident = ident.toString(); $('#like-rotator-' + ident).show(); - $.get('starred/' + ident, function(data) { - if (data.match(/1/)) { - $('#starred-' + ident).addClass('starred'); - $('#starred-' + ident).removeClass('unstarred'); + $.get('starred/' + ident) + .then(function(data) { + if (data.state === 1) { + $('#starred-' + ident) + .addClass('starred') + .removeClass('unstarred'); $('#star-' + ident).addClass('hidden'); $('#unstar-' + ident).removeClass('hidden'); } else { - $('#starred-' + ident).addClass('unstarred'); - $('#starred-' + ident).removeClass('starred'); + $('#starred-' + ident) + .addClass('unstarred') + .removeClass('starred'); $('#star-' + ident).removeClass('hidden'); $('#unstar-' + ident).addClass('hidden'); } + }) + .always(function () { $('#like-rotator-' + ident).hide(); }); } diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index 7dcdb15a5d..0d2561869f 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -105,7 +105,7 @@ {{/if}} {{if $item.star}} - + {{/if}} {{if $item.tagger}} diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl index 6e76f23d6a..bcd957396b 100644 --- a/view/theme/frio/templates/search_item.tpl +++ b/view/theme/frio/templates/search_item.tpl @@ -206,8 +206,8 @@ {{if $item.star}}
  • -  {{$item.star.do}} -  {{$item.star.undo}} +  {{$item.star.do}} +  {{$item.star.undo}}
  • {{/if}} diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index f632b0bba1..34d2a73747 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -358,8 +358,8 @@ as the value of $top_child_total (this is done at the end of this file) {{if $item.star}}
  • -  {{$item.star.do}} -  {{$item.star.undo}} +  {{$item.star.do}} +  {{$item.star.undo}}
  • {{/if}} @@ -523,8 +523,8 @@ as the value of $top_child_total (this is done at the end of this file) {{if $item.star}}
  • -  {{$item.star.do}} -  {{$item.star.undo}} +  {{$item.star.do}} +  {{$item.star.undo}}
  • {{/if}} diff --git a/view/theme/quattro/templates/photo_item.tpl b/view/theme/quattro/templates/photo_item.tpl index 182607ab35..4a43d2cb81 100644 --- a/view/theme/quattro/templates/photo_item.tpl +++ b/view/theme/quattro/templates/photo_item.tpl @@ -33,8 +33,8 @@
    {{if $star}} - {{$star.do}} - {{$star.undo}} + {{$star.do}} + {{$star.undo}} {{$star.tagger}} {{/if}} diff --git a/view/theme/quattro/templates/search_item.tpl b/view/theme/quattro/templates/search_item.tpl index 70aa2ed863..3793cb1033 100644 --- a/view/theme/quattro/templates/search_item.tpl +++ b/view/theme/quattro/templates/search_item.tpl @@ -52,8 +52,8 @@
    {{if $item.star}} - {{$item.star.do}} - {{$item.star.undo}} + {{$item.star.do}} + {{$item.star.undo}} {{$item.star.tagger}} {{/if}} diff --git a/view/theme/quattro/templates/wall_thread.tpl b/view/theme/quattro/templates/wall_thread.tpl index 671b7643f3..e3ed4f26ca 100644 --- a/view/theme/quattro/templates/wall_thread.tpl +++ b/view/theme/quattro/templates/wall_thread.tpl @@ -102,8 +102,8 @@ {{$item.pin.undo}} {{/if}} {{if $item.star}} - {{$item.star.do}} - {{$item.star.undo}} + {{$item.star.do}} + {{$item.star.undo}} {{/if}} {{if $item.ignore}} {{$item.ignore.do}} diff --git a/view/theme/smoothly/templates/wall_thread.tpl b/view/theme/smoothly/templates/wall_thread.tpl index 4f70ea6d5b..53f918813f 100644 --- a/view/theme/smoothly/templates/wall_thread.tpl +++ b/view/theme/smoothly/templates/wall_thread.tpl @@ -117,7 +117,7 @@ {{/if}} {{if $item.star}} - + {{/if}} {{if $item.tagger}} diff --git a/view/theme/vier/templates/photo_item.tpl b/view/theme/vier/templates/photo_item.tpl index aafadae911..069bd22296 100644 --- a/view/theme/vier/templates/photo_item.tpl +++ b/view/theme/vier/templates/photo_item.tpl @@ -40,8 +40,8 @@
    {{if $star}} - {{$star.do}} - {{$star.undo}} + {{$star.do}} + {{$star.undo}} {{$star.tagger}} {{/if}} diff --git a/view/theme/vier/templates/search_item.tpl b/view/theme/vier/templates/search_item.tpl index 7a4c332d08..063e0e9433 100644 --- a/view/theme/vier/templates/search_item.tpl +++ b/view/theme/vier/templates/search_item.tpl @@ -57,8 +57,8 @@
    {{if $item.star}} - {{$item.star.do}} - {{$item.star.undo}} + {{$item.star.do}} + {{$item.star.undo}} {{$item.star.tagger}} {{/if}} diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index 1e4806c9e0..73997e7c53 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -140,8 +140,8 @@ {{$item.pin.undo}} {{/if}} {{if $item.star}} - {{$item.star.do}} - {{$item.star.undo}} + {{$item.star.do}} + {{$item.star.undo}} {{/if}} {{if $item.ignore}} {{$item.ignore.do}}