From 48a145a8ed341c1f28f941be2eaab053c172e3f1 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Feb 2015 15:52:12 -0800 Subject: add the required js file --- view/js/ratings.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 view/js/ratings.js (limited to 'view/js') diff --git a/view/js/ratings.js b/view/js/ratings.js new file mode 100644 index 000000000..3d48ecca5 --- /dev/null +++ b/view/js/ratings.js @@ -0,0 +1,34 @@ + +var ratingVal = 0; +var ratingText = ''; +var currentHash = ''; + +function fetchRatings(hash) { + $.get('prate/'+hash, function(data) { + if(typeof(data.rating) !== 'undefined') { + ratingVal = data.rating; + ratingText = data.rating_text; + } + buildRatingForm(hash); + }); +} + + +function doRatings(hash) { + fetchRatings(hash); +} + +function buildRatingForm(hash) { + var html = '
'+aStr['rating_desc']+'
'+aStr['rating_text']+'
'; + + $.colorbox({maxwidth: "50%", maxHeight: "50%", html: html, close: 'X' }); + currentHash = hash; +} + +function postRatings() { + $.post('prate',$('#ratings_form').serialize(),function(data) { + $.colorbox.remove(); + $('#edited-'+currentHash).show(); + },'json'); +} + -- cgit v1.2.3