Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Replace in media/js/scripts.js
- function ask(_0) {
- if(!$("#response0").val()) {
- $("#response0").addClass("highlightRed").focus();
- return;
- }
- $("#response0").removeClass("highlightRed");
- $("#sendButton").attr("disabled", "disabled");
- $(".ask-button-text").hide();
- $("#sendIndicator").show();
- var _1 = $("#askForm").serialize();
- $.ajax({
- url: 'ajax/ask',
- async: true,
- type: "POST",
- data: _1 + "&username="+_0+"&ajax=1",
- success: function(_2){
- if(_2.response == 'success') {
- $("#response0").hide();
- $("#success").show();
- $("#sendButton").removeAttr('disabled');
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- else {
- $("#sendButton").removeAttr('disabled');
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- },
- error: function (_6) {
- alert('Error: '+_6);
- $("#sendButton").removeAttr('disabled');
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- });
- }
- //Into:
- function ask(_0) {
- if(!$("#response0").val()) {
- $("#response0").addClass("highlightRed").focus();
- return;
- }
- $("#response0").removeClass("highlightRed");
- $("#sendButton").attr("disabled", "disabled");
- $(".ask-button-text").hide();
- $("#sendIndicator").show();
- var _1 = $("#askForm").serialize();
- $.ajax({
- url: 'ajax/ask',
- async: true,
- type: "POST",
- data: _1 + "&username="+_0+"&ajax=1",
- success: function(_2){
- if(_2.response == 'success') {
- $("#response0").hide();
- $("#success").show();
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- else {
- $("#sendButton").removeAttr('disabled');
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- },
- error: function (_6) {
- alert('Error: '+_6);
- $("#sendButton").removeAttr('disabled');
- $("#sendIndicator").hide();
- $(".ask-button-text").show();
- }
- });
- }
- //And
- function askAgain() {
- $("#response0").val('');
- $("#success").hide();
- $("#response0").show();
- $("#response0").focus();
- }
- //Into
- function askAgain() {
- $("#sendButton").removeAttr('disabled');
- $("#response0").val('');
- $("#success").hide();
- $("#response0").show();
- $("#response0").focus();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement