1;/* FilePath: /home/aasaam/xcms/core-common/webroot-alias/common-js/classes/PollForm.js */ 2/** 3 * Create Poll Handler 4 * @param {Object} formObject 5 * @param {Object} parameters 6 * @param {Object} callbacks 7 * @returns {PollForm} 8 */ 9function PollForm(formObject, callbacks) { 10 11 // instance 12 var instance = this; 13 14 // callbacks 15 this.callbacks = { 16 onSubmit : function(){}, 17 onError : function(){}, 18 onSuccess : function(){} 19 }; 20 21 // merge 22 this.callbacks = $.extend(this.callbacks, callbacks); 23 24 // submit callback 25 $(formObject).submit(function(){ 26 27 // callback on submit 28 instance.callbacks.onSubmit(); 29 30 // ajax 31 $.ajax({ 32 url : masterConfig.baseUrl + 'polls/submit/', 33 type : 'post', 34 data : { 35 BHT : masterConfig.blackHoleToken, 36 pId : $('input[name=poll_id]', $(formObject)).val(), 37 optId : $('input[name=poll_option]:checked', $(formObject)).val() 38 }, 39 error : function() { 40 // on error 41 instance.callbacks.onError(); 42 }, 43 success: function() { 44 // callback on submit 45 instance.callbacks.onSuccess(); 46 } 47 }); 48 49 // return 50 return false; 51 }); 52 53 $("[data-statistic]").click(function(){ 54 // ajax 55 $.ajax({ 56 url : masterConfig.baseUrl + 'polls/statistics/', 57 type : 'post', 58 data : { 59 pId : $(this).data('statistic') 60 }, 61 success: function(data) { 62 $(formObject).setTemplateURL("/templates/pollStatistics.thtml?v=" + masterConfig.v); 63 $(formObject).processTemplate({ 64 i18n : window.i18n, 65 rows: data 66 }); 67 } 68 }); 69 }); 70};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.