Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Feedback script loaded as callback

  • Loading branch information...
commit 324ce14950d503f997d66568f07a633dcf298d81 1 parent 33633c8
@jaseemabid jaseemabid authored
Showing with 52 additions and 56 deletions.
  1. +0 −46 feedback.html
  2. +52 −10 js/functions.js
View
46 feedback.html
@@ -17,49 +17,3 @@
</form>
</div>
</div>
-
-<script type="text/javascript">
-
-$('div#feedback ul.links li').click(function() {
- $(this).parent().children().removeClass('hilite');
- $(this).addClass('hilite');
- $('div#feedback div.content .panel').fadeOut("fast").fadeIn("");
- var numb = $("div#feedback ul.links li").index(this),
- type = $("div#feedback ul.links li").eq(numb).attr('type'),
- desc = $("div#feedback ul.links li").eq(numb).attr('desc');
- $('input#fType').attr('value',type);
- $('textarea#fDesc').attr('placeholder',desc);
-});
-$('span#feedbackFormSubmit')
- .click(function() {
- var fb = $(this).parent(),
- feedback = {} ;
- feedback.type = $('input#fType').attr('value');
- feedback.fname = $('input#fName').attr('value');
- feedback.desc = $('textarea#fDesc').attr('value');
- if( feedback.fname !=='' && feedback.desc !== '' ) {
- feedback.desc = feedback.fname + ' says ' + feedback.desc;
- delete feedback.fname;
- $.post("response/submitfeedback.php", feedback, function(data){
- setTimeout(function(){
- Paathshaala.hideFeedback();
- },2000);
- $('ul.links, div#blueLine').remove();
- if (data)
- $('div#feedback').html("<div style='font-size:19px; text-align:center; padding:100px 0px;'>" + data.status + "</div>");
- else
- fb.html("<div style='font-size:19px; text-align:center; padding:100px 0px;'>Error submitting feedback </div>");
- } , "json" );
- }
- });
-$('div#darkenScreenObject').click(function(){
- Paathshaala.hideFeedback();
-});
-
-$('span#cross').click(function(){
- Paathshaala.hideFeedback();
-});
-
-</script>
-
-<!-- </div> -->
View
62 js/functions.js
@@ -57,15 +57,6 @@
}
$(elem).html(data);
},
- showFeedback : function() {
- grayOut(true);
- $('div#feedback').show()
- $('div#feedback').load('feedback.html');
- },
- hideFeedback : function () {
- grayOut(false);
- $('div#feedback').hide();
- },
showEditProfile: function () {
grayOut(true);
$('div#editProfile').load('editprofile.html').fadeIn("slow");
@@ -356,9 +347,60 @@
$('span.news').click(function(){
$('div#indexMesssage').fadeOut("fast");
});
- }
+ }
};
+ Paathshaala.showFeedback = function() {
+ grayOut(true);
+ $('div#feedback').show()
+ $('div#feedback').load('feedback.html', function(){
+ $('div#feedback ul.links li').click(function() {
+ $(this).parent().children().removeClass('hilite');
+ $(this).addClass('hilite');
+ $('div#feedback div.content .panel').fadeOut("fast").fadeIn("");
+ var numb = $("div#feedback ul.links li").index(this),
+ type = $("div#feedback ul.links li").eq(numb).attr('type'),
+ desc = $("div#feedback ul.links li").eq(numb).attr('desc');
+ $('input#fType').attr('value',type);
+ $('textarea#fDesc').attr('placeholder',desc);
+ });
+ $('span#feedbackFormSubmit')
+ .click(function() {
+ var fb = $(this).parent(),
+ feedback = {
+ type : $('input#fType').attr('value'),
+ fname : $('input#fName').attr('value'),
+ desc : $('textarea#fDesc').attr('value')
+ };
+ if( feedback.fname !=='' && feedback.desc !== '' ) {
+ feedback.desc = feedback.fname + ' says ' + feedback.desc;
+ delete feedback.fname;
+ $.post("response/submitfeedback.php", feedback, function(data){
+ setTimeout(function(){
+ P.hideFeedback();
+ },2000);
+ $('ul.links, div#blueLine').remove();
+ if (data)
+ $('div#feedback').html("<div style='font-size:19px; text-align:center; padding:100px 0px;'>" + data.status + "</div>");
+ else
+ fb.html("<div style='font-size:19px; text-align:center; padding:100px 0px;'>Error submitting feedback </div>");
+ } , "json" );
+ }
+ });
+ $('div#darkenScreenObject').click(function(){
+ P.hideFeedback();
+ });
+
+ $('span#cross').click(function(){
+ P.hideFeedback();
+ });
+ });
+ };
+ Paathshaala.hideFeedback = function () {
+ grayOut(false);
+ $('div#feedback').hide();
+ };
+
Paathshaala.validateJoin = function () {
"use strict";
var input, data, id, i,
Please sign in to comment.
Something went wrong with that request. Please try again.