Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
de35a2d2
Commit
de35a2d2
authored
Jul 27, 2017
by
Andrey Lugovskiy
Browse files
- fixed missing javascript
parent
a98587c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/sourceapp/1/js/crophub.js
View file @
de35a2d2
/**
* Copyright 2015 Global Crop Diversity Trust
*
* Copyright 2015 Global Crop Diversity Trust
*
* jQuery $ and $.ajax() required.
*/
'
use strict
'
;
...
...
@@ -651,6 +651,31 @@ var GenesysFilter = {
};
/* jshint ignore:start */
var
XUtil
=
{
x01
:
function
(
path
,
handler
,
object
)
{
$
.
ajax
(
path
,
$
.
extend
({},
{
type
:
'
POST
'
,
dataType
:
'
json
'
,
contentType
:
'
application/json; charset=utf-8
'
,
data
:
(
object
===
null
?
null
:
JSON
.
stringify
(
object
)),
beforeSend
:
function
()
{
},
success
:
function
(
respObject
)
{
document
.
console
.
log
(
respObject
);
},
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
document
.
console
.
log
(
textStatus
);
document
.
console
.
log
(
errorThrown
);
}
},
handler
));
}
};
/* jshint ignore:end */
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
$
(
'
#navigation-menu
'
))
&&
!
$
(
e
.
target
).
is
(
$
(
'
.humburger-btn
'
)))
{
if
(
$
(
'
#navbar
'
).
hasClass
(
'
in
'
))
{
...
...
@@ -786,7 +811,7 @@ $('.twitter-follow-button').click(function(e) {
});
/**
* Share on LinkedIn
* Share on LinkedIn
*/
$
(
'
.linkedin-share-button
'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
...
...
src/main/webapp/WEB-INF/jsp/admin/users/profile.jsp
View file @
de35a2d2
...
...
@@ -110,52 +110,42 @@
<content
tag=
"javascript"
>
<security:authorize
access=
"isAuthenticated()"
>
<script
src=
"
<c:url
value=
"/html/js/main.js"
/>
"
></script>
<script
src=
"
<c:url
value=
"/html/js/jsonclient.js"
/>
"
></script>
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
<security:authorize
access=
"principal.id == #user.id"
>
$
(
"
#new-team-form input[type=submit]
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/me/teams"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
$
(
this
.
form
).
serializeObject
());
});
$
(
"
a[x-team-id]
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/me/teams/"
/>
"
+
$
(
this
).
attr
(
'
x-team-id
'
)
+
"
/leave
"
,
{
success
:
function
(
e
)
{
BrowseUtil
.
x01
(
"
<c:url
value=
"/json/v0/me/teams/"
/>
"
+
$
(
this
).
attr
(
'
x-team-id
'
)
+
"
/leave
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}});
}
});
});
</security:authorize>
<security:authorize
access=
"hasRole('ADMINISTRATOR')"
>
$
(
"
button#acccount-enable
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
true
);
});
$
(
"
button#acccount-disable
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
false
);
});
$
(
"
button#acccount-lock
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
true
);
});
$
(
"
button#acccount-unlock
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
false
);
});
...
...
@@ -165,4 +155,4 @@
</security:authorize>
</content>
</body>
</html>
\ No newline at end of file
</html>
src/main/webapp/WEB-INF/jsp/user/profile.jsp
View file @
de35a2d2
...
...
@@ -103,33 +103,33 @@
<content
tag=
"javascript"
>
<security:authorize
access=
"isAuthenticated()"
>
<script
src=
"
<c:url
value=
"/html/js/main.js"
/>
"
></script>
<script
src=
"
<c:url
value=
"/html/js/jsonclient.js"
/>
"
></script>
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
<security:authorize
access=
"hasRole('ADMINISTRATOR')"
>
$
(
"
button#acccount-enable
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
true
);
});
$
(
"
button#acccount-disable
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/enabled"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
false
);
});
$
(
"
button#acccount-lock
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
true
);
});
$
(
"
button#acccount-unlock
"
).
on
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
XUtil
.
x01
(
"
<c:url
value=
"/json/v0/user/${user.uuid}/locked"
/>
"
,
{
success
:
function
(
e
)
{
window
.
location
.
reload
();
}},
false
);
});
...
...
@@ -139,4 +139,4 @@
</security:authorize>
</content>
</body>
</html>
\ No newline at end of file
</html>
Write
Preview
Markdown
is supported
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