|
|
|
@ -19,9 +19,30 @@ if (EXPO.profile){ |
|
|
|
$waiter; |
|
|
|
$waiter; |
|
|
|
|
|
|
|
|
|
|
|
//private
|
|
|
|
//private
|
|
|
|
// factory for on page form objects
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Rating functional. Object stores data, HTML Instance of rating field, and can refresh its value |
|
|
|
|
|
|
|
* @param {Object} opt - options for rating instance, like HTML Id and other |
|
|
|
|
|
|
|
* @constructor |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function Rating(opt){ |
|
|
|
|
|
|
|
this.opt = opt; |
|
|
|
|
|
|
|
this.$inst = $('#'+opt.id); |
|
|
|
|
|
|
|
this.value = this.$inst.text; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Rating.prototype = { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* refreshes value of HTML instance with new. |
|
|
|
|
|
|
|
* @param {number} newRating - new profile rating value |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
refresh: function (newRating) { |
|
|
|
|
|
|
|
this.value = newRating; |
|
|
|
|
|
|
|
this.$inst.text(this.value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
function Forms(){}; |
|
|
|
function Forms(){}; |
|
|
|
// methods to perform ajax responses to send and receive data from the server
|
|
|
|
// methods to perform ajax responses to send and receive data from the server
|
|
|
|
|
|
|
|
// factory for on page form objects
|
|
|
|
Forms.prototype = { |
|
|
|
Forms.prototype = { |
|
|
|
// ajax request realization
|
|
|
|
// ajax request realization
|
|
|
|
getajax: function (dataToSend) { |
|
|
|
getajax: function (dataToSend) { |
|
|
|
@ -37,6 +58,9 @@ if (EXPO.profile){ |
|
|
|
contentType: false, |
|
|
|
contentType: false, |
|
|
|
success: function(data) { |
|
|
|
success: function(data) { |
|
|
|
self.pullHandler(data); |
|
|
|
self.pullHandler(data); |
|
|
|
|
|
|
|
if(data.success){ |
|
|
|
|
|
|
|
EXPO.profile.rating.refresh(data.rating); |
|
|
|
|
|
|
|
} |
|
|
|
$('#wait-ajax').fadeOut(); |
|
|
|
$('#wait-ajax').fadeOut(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -107,6 +131,7 @@ if (EXPO.profile){ |
|
|
|
this.$editable.removeClass('hidden'); |
|
|
|
this.$editable.removeClass('hidden'); |
|
|
|
this.$description.addClass('hidden'); |
|
|
|
this.$description.addClass('hidden'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
Forms.factory = function (type, ajaxpath) { |
|
|
|
Forms.factory = function (type, ajaxpath) { |
|
|
|
@ -425,6 +450,7 @@ if (EXPO.profile){ |
|
|
|
$(selector).inputmasks(maskOpts); |
|
|
|
$(selector).inputmasks(maskOpts); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
this.rating = new Rating(this.opt.rating); |
|
|
|
this.forms = {}; |
|
|
|
this.forms = {}; |
|
|
|
$(function () { |
|
|
|
$(function () { |
|
|
|
var $editables = $('.'+self.opt.editableClass); |
|
|
|
var $editables = $('.'+self.opt.editableClass); |
|
|
|
|