aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/mod_directory.js
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2015-03-15 22:18:59 +0100
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2015-03-15 23:56:32 +0100
commit792e475a78ffb1f1facd615b00511c9107d0ac5a (patch)
tree9a42d3038e50ee5445c501457b7f5b8af42f6591 /view/js/mod_directory.js
parentfdcbb61bcb61a980a7a9171432498a9cac6e0965 (diff)
downloadvolse-hubzilla-792e475a78ffb1f1facd615b00511c9107d0ac5a.tar.gz
volse-hubzilla-792e475a78ffb1f1facd615b00511c9107d0ac5a.tar.bz2
volse-hubzilla-792e475a78ffb1f1facd615b00511c9107d0ac5a.zip
Some JavaScript cleanups.
Adding some missing and remove some unnecessary semicolons. Change some comparing operators. Changed access to objects with dot operator.
Diffstat (limited to 'view/js/mod_directory.js')
-rw-r--r--view/js/mod_directory.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/view/js/mod_directory.js b/view/js/mod_directory.js
index 861900704..90942f9ac 100644
--- a/view/js/mod_directory.js
+++ b/view/js/mod_directory.js
@@ -1,17 +1,15 @@
function dirdetails(hash) {
-
$.get('dirprofile' + '?f=&hash=' + hash, function( data ) {
$.colorbox({ maxWidth: "80%", maxHeight: "75%", scrolling: false, html: data });
});
}
-
var ratingVal = 0;
var ratingText = '';
var currentHash = '';
function fetchRatings(hash) {
- $.get('prate/'+hash, function(data) {
+ $.get('prate/' + hash, function(data) {
if(typeof(data.rating) !== 'undefined') {
ratingVal = data.rating;
ratingText = data.rating_text;
@@ -20,22 +18,21 @@ function fetchRatings(hash) {
});
}
-
function doRatings(hash) {
fetchRatings(hash);
}
function buildRatingForm(hash) {
- var html = '<form id="ratings_form" action="prate" method="post"><input type="hidden" name="target" value="'+hash+'" /><div class="rating-desc">'+aStr['rating_desc']+'</div><input id="dir-rating-range" class="directory-slider" type="text" value="'+ratingVal+'" name="rating" style="display: none;" /><div class="rating-text-label">'+aStr['rating_text']+'<input type="text" name="rating_text" class="directory-rating-text" value="'+ratingText+'" /><br /><input name="submit" class="directory-rating-submit" type="submit" value="'+aStr['submit']+'" onclick="postRatings(); return false;"></form><div class="clear"></div><script>$("#dir-rating-range").jRange({ from: -10, to: 10, step: 1, showLabels: false, showScale: true, scale : [ "-10","-5","0","5","10" ], onstatechange: function(v) { $("#dir-rating-range").val(v); } });</script>';
+ var html = '<form id="ratings_form" action="prate" method="post"><input type="hidden" name="target" value="'+hash+'" /><div class="rating-desc">' + aStr.rating_desc + '</div><input id="dir-rating-range" class="directory-slider" type="text" value="' + ratingVal + '" name="rating" style="display: none;" /><div class="rating-text-label">' + aStr.rating_text + '<input type="text" name="rating_text" class="directory-rating-text" value="' + ratingText + '" /><br /><input name="submit" class="directory-rating-submit" type="submit" value="' + aStr.submit + '" onclick="postRatings(); return false;"></form><div class="clear"></div><script>$("#dir-rating-range").jRange({ from: -10, to: 10, step: 1, showLabels: false, showScale: true, scale: [ "-10","-5","0","5","10" ], onstatechange: function(v) { $("#dir-rating-range").val(v); } });</script>';
$.colorbox({maxwidth: "50%", maxHeight: "50%", scrolling: false, html: html, close: 'X' });
currentHash = hash;
}
function postRatings() {
- $.post('prate',$('#ratings_form').serialize(),function(data) {
+ $.post('prate', $('#ratings_form').serialize(), function(data) {
$.colorbox.remove();
- $('#edited-'+currentHash).show();
+ $('#edited-' + currentHash).show();
},'json');
}