Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
20e18380
Commit
20e18380
authored
Aug 09, 2017
by
Benjamin Fischer
Browse files
Visap: fixed showFeedbackDialog
parent
e9a8e1b1
Changes
1
Show whitespace changes
Inline
Side-by-side
vispa/static/js/vispa.js
View file @
20e18380
...
...
@@ -492,15 +492,12 @@ define([
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
();
uaText
+=
"
URL:
"
+
window
.
location
.
href
+
"
\n
"
;
var
self
=
this
;
return
new
Dialog
({
data
:
{
body
:
true
,
feedback
:
uaText
,
anonymous
:
false
,
rootClass
:
"
feedback
"
,
...
...
@@ -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
+=
"
\n
href:
"
+
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
)
{
window
.
setTimeout
(
callback
,
delay
||
0
);
return
this
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment