This repository has been archived by the owner on Oct 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/switch-feedback-off'
* hotfix/switch-feedback-off: Remove template from generated plugin Updated dependencies Changed to the new variable partials Turn plugin off
- Loading branch information
Showing
4 changed files
with
81 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,82 @@ | ||
(function(Hiof, undefined) { | ||
// Setup client information in the view | ||
Hiof.view.setupClientInformationInOptions(); | ||
// Setup client information in the view | ||
//Hiof.view.setupClientInformationInOptions(); | ||
|
||
Hiof.setupFeedbackForm = function(ln) { | ||
Hiof.setupFeedbackForm = function(ln) { | ||
|
||
$.getJSON("/assets/js/data/i18n.json", function(data) { | ||
var myData = data[ln]["feedback-form"]; | ||
$.getJSON("/assets/js/data/i18n.json", function(data) { | ||
var myData = data[ln]["feedback-form"]; | ||
|
||
var clientOptions = Hiof.options.client; | ||
var clientOptions = Hiof.options.client; | ||
|
||
myData.clientLanguage = ln; | ||
myData.clientUrl = clientOptions.url; | ||
myData.clientBrowserName = clientOptions.browserName; | ||
myData.clientBrowserVersion = clientOptions.browserVersion; | ||
myData.clientOsName = clientOptions.osName; | ||
myData.clientOsVersion = clientOptions.osVersion; | ||
myData.clientViewportWidth = clientOptions.viewportWidth; | ||
myData.clientViewportHeight = clientOptions.viewportHeight; | ||
myData.clientLanguage = ln; | ||
myData.clientUrl = clientOptions.url; | ||
myData.clientBrowserName = clientOptions.browserName; | ||
myData.clientBrowserVersion = clientOptions.browserVersion; | ||
myData.clientOsName = clientOptions.osName; | ||
myData.clientOsVersion = clientOptions.osVersion; | ||
myData.clientViewportWidth = clientOptions.viewportWidth; | ||
myData.clientViewportHeight = clientOptions.viewportHeight; | ||
|
||
|
||
Hiof.appendFeedbackForm(myData); | ||
}); | ||
//return feedbackForm; | ||
}; | ||
Hiof.appendFeedbackForm = function(data) { | ||
let templateSource = Hiof.Templates['forms/feedback'], | ||
markup = templateSource(data); | ||
|
||
$('#main').append(markup); | ||
var formHeight = $('.feedback-form').height(); | ||
$('.feedback').css('height', formHeight + 'px'); | ||
}; | ||
|
||
|
||
$(function() { | ||
var lang; | ||
if ($('#main').attr('data-page-category') === "page") { | ||
|
||
lang = $('html').attr('lang'); | ||
|
||
Hiof.setupFeedbackForm(lang); | ||
|
||
} else if ($('#content').attr('data-page-category') === "page") { | ||
lang = $('html').attr('lang'); | ||
|
||
Hiof.setupFeedbackForm(lang); | ||
} | ||
|
||
|
||
$('body').on('submit', '.feedback-form', function(e) { | ||
e.preventDefault(); | ||
|
||
var formData = $('.feedback-form').serialize(); | ||
$.ajax({ | ||
url: "http://hiof.no/api/v1/feedback/", | ||
type: "POST", | ||
data: formData, | ||
beforeSend: function() { | ||
$('.feedback-form fieldset').attr('disabled', 'disabled'); | ||
}, | ||
success: function(data, textStatus, jqXHR) { | ||
//data - response from server | ||
//debug('success:' + data); | ||
$('.feedback-form').slideToggle(); | ||
$('.feedback-form-success').slideToggle(); | ||
}, | ||
error: function(jqXHR, textStatus, errorThrown) { | ||
$('.feedback-form fieldset').prop('disabled', false); | ||
//data - response from server | ||
//debug('error: ' + jqXHR + textStatus + errorThrown); | ||
//debug(textStatus); | ||
|
||
} | ||
}); | ||
|
||
|
||
}); | ||
|
||
Hiof.appendFeedbackForm(myData); | ||
}); | ||
//return feedbackForm; | ||
}; | ||
Hiof.appendFeedbackForm = function(data) { | ||
let templateSource = Hiof.Templates['forms/feedback'], | ||
markup = templateSource(data); | ||
|
||
$('#main').append(markup); | ||
var formHeight = $('.feedback-form').height(); | ||
$('.feedback').css('height', formHeight + 'px'); | ||
}; | ||
|
||
|
||
//$(function() { | ||
// var lang; | ||
// if ($('#main').attr('data-page-category') === "page") { | ||
// | ||
// lang = $('html').attr('lang'); | ||
// | ||
// Hiof.setupFeedbackForm(lang); | ||
// | ||
// } else if ($('#content').attr('data-page-category') === "page") { | ||
// lang = $('html').attr('lang'); | ||
// | ||
// Hiof.setupFeedbackForm(lang); | ||
// } | ||
// | ||
// | ||
// $('body').on('submit', '.feedback-form', function(e) { | ||
// e.preventDefault(); | ||
// | ||
// var formData = $('.feedback-form').serialize(); | ||
// $.ajax({ | ||
// url: "http://hiof.no/api/v1/feedback/", | ||
// type: "POST", | ||
// data: formData, | ||
// beforeSend: function() { | ||
// $('.feedback-form fieldset').attr('disabled', 'disabled'); | ||
// }, | ||
// success: function(data, textStatus, jqXHR) { | ||
// //data - response from server | ||
// //debug('success:' + data); | ||
// $('.feedback-form').slideToggle(); | ||
// $('.feedback-form-success').slideToggle(); | ||
// }, | ||
// error: function(jqXHR, textStatus, errorThrown) { | ||
// $('.feedback-form fieldset').prop('disabled', false); | ||
// //data - response from server | ||
// //debug('error: ' + jqXHR + textStatus + errorThrown); | ||
// //debug(textStatus); | ||
// | ||
// } | ||
// }); | ||
// | ||
// | ||
// }); | ||
// | ||
//}); | ||
|
||
})(window.Hiof = window.Hiof || {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "feedback-form", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "HiØ, Kenneth Lindbeck-Dahlstrøm <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
|
@@ -28,15 +28,15 @@ | |
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-eslint": "^19.0.0", | ||
"grunt-sass": "^2.0.0", | ||
"grunt-ssh": "^0.11.1", | ||
"grunt-ssh": "^0.12.9", | ||
"grunt-static-versioning": "^0.2.1", | ||
"matchdep": "*", | ||
"moment": "^2.17.1", | ||
"react-tools": "^0.13.3", | ||
"time-grunt": "^1.4.0" | ||
}, | ||
"dependencies": { | ||
"bower": "1.3.9" | ||
"bower": "^1.8.0" | ||
}, | ||
"license": "GPL-3.0" | ||
} |