Commit 20e18380 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Visap: fixed showFeedbackDialog

parent e9a8e1b1
...@@ -492,15 +492,12 @@ define([ ...@@ -492,15 +492,12 @@ define([
if (dd.vendor) { if (dd.vendor) {
uaText += "Device: " + dd.vendor + " " + dd.type + " (" + dd.model + ")\n"; uaText += "Device: " + dd.vendor + " " + dd.type + " (" + dd.model + ")\n";
} }
uaText += "URL: " + window.location.href + "\n";
var ta = $body.find("textarea").html(uaText).get(0);
ta.focus();
ta.setSelectionRange(0, 13);
ta.focus();
var self = this; var self = this;
return new Dialog({ return new Dialog({
data: { data: {
body: true,
feedback: uaText, feedback: uaText,
anonymous: false, anonymous: false,
rootClass: "feedback", rootClass: "feedback",
...@@ -565,70 +562,6 @@ define([ ...@@ -565,70 +562,6 @@ define([
}); });
}, },
showFeedbackDialog: function() {
var self = this;
if (!this.args.global.useFeedback) {
return this;
}
var $body = $(bodyTmpl);
var $footer = $(footerTmpl);
vispa.messenger.dialog({
header: "<i class='glyphicon glyphicon-comment'></i> Feedback",
body: $body,
footer: $footer,
wrapFooter: false,
onRender: function() {
var dialog = this;
// cancel
$footer.find("button#cancel").click(this.close.bind(this));
// send
$footer.find("button#send").click(function() {
var content = $body.find("textarea").val();
if (content) {
content += "\nhref: " + window.location.href + "\n";
var anonymous = $body.find("input").prop("checked");
self.POST(vispa.url.dynamic("ajax/feedback"), {
content: content,
anonymous: anonymous
});
}
dialog.close();
});
// acquire data from user agent
var uaData = (new UAParser()).getResult();
var bd = uaData.browser;
var ed = uaData.engine;
var od = uaData.os;
var dd = uaData.device;
var uaText = "Your feedback\n\n";
if (bd.name) {
uaText += "Browser: " + bd.name + " " + bd.major + " (" + bd.version + ")\n";
}
if (ed.name) {
uaText += "Engine: " + ed.name + " (" + ed.version + ")\n";
}
if (od.name) {
uaText += "OS: " + od.name + " (" + od.version + ")\n";
}
if (dd.vendor) {
uaText += "Device: " + dd.vendor + " " + dd.type + " (" + dd.model + ")\n";
}
var ta = $body.find("textarea").html(uaText).get(0);
ta.focus();
ta.setSelectionRange(0, 13);
ta.focus();
}
});
return this;
},
nextTick: function(callback, delay) { nextTick: function(callback, delay) {
window.setTimeout(callback, delay || 0); window.setTimeout(callback, delay || 0);
return this; return this;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment