Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
1165fa81
Commit
1165fa81
authored
Jun 10, 2021
by
michael.simon
Browse files
Add Code mirror to edit Javascript from primefaces extensions
parent
17155e1d
Changes
6
Hide whitespace changes
Inline
Side-by-side
bwreg-ear/pom.xml
View file @
1165fa81
...
...
@@ -121,6 +121,10 @@
<groupId>
org.primefaces
</groupId>
<artifactId>
primefaces
</artifactId>
</dependency>
<dependency>
<groupId>
org.primefaces.extensions
</groupId>
<artifactId>
primefaces-extensions
</artifactId>
</dependency>
<dependency>
<groupId>
commons-fileupload
</groupId>
<artifactId>
commons-fileupload
</artifactId>
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/impl/UserUpdater.java
View file @
1165fa81
...
...
@@ -194,7 +194,7 @@ public class UserUpdater implements Serializable {
if
(
updateHook
!=
null
)
{
try
{
updateHook
.
preUpdateUser
(
user
,
user
.
getGenericStore
(),
attributeMap
,
executor
,
service
,
debugLog
);
updateHook
.
preUpdateUser
(
user
,
user
.
getIdp
().
getGenericStore
(),
attributeMap
,
executor
,
service
,
debugLog
);
}
catch
(
UserUpdateHookException
e
)
{
logger
.
warn
(
"An exception happened while calling UserUpdateHook!"
,
e
);
}
...
...
@@ -318,7 +318,7 @@ public class UserUpdater implements Serializable {
if
(
updateHook
!=
null
)
{
try
{
updateHook
.
postUpdateUser
(
user
,
user
.
getGenericStore
(),
attributeMap
,
executor
,
service
,
debugLog
);
updateHook
.
postUpdateUser
(
user
,
user
.
getIdp
().
getGenericStore
(),
attributeMap
,
executor
,
service
,
debugLog
);
}
catch
(
UserUpdateHookException
e
)
{
logger
.
warn
(
"An exception happened while calling UserUpdateHook!"
,
e
);
}
...
...
bwreg-webapp/pom.xml
View file @
1165fa81
...
...
@@ -52,6 +52,11 @@
<artifactId>
primefaces
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.primefaces.extensions
</groupId>
<artifactId>
primefaces-extensions
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.primefaces.themes
</groupId>
<artifactId>
all-themes
</artifactId>
...
...
bwreg-webapp/src/main/webapp/admin/business-rule/edit-script.xhtml
View file @
1165fa81
...
...
@@ -5,7 +5,8 @@
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:bw=
"http://www.scc.kit.edu/bwfacelets"
xmlns:p=
"http://primefaces.org/ui"
>
xmlns:p=
"http://primefaces.org/ui"
xmlns:pe=
"http://primefaces.org/ui/extensions"
>
<head>
<title></title>
</head>
...
...
@@ -39,11 +40,15 @@
<bw:inputText
id=
"scriptTypeField"
label=
"#{messages.script_type}"
value=
"#{editScriptBean.entity.scriptType}"
required=
"true"
/>
<h:outputText
value=
"#{messages.script}:"
/>
<p:inputTextarea
value=
"#{editScriptBean.entity.script}"
style=
"width: 600px; height: 300px;"
autoResize=
"false"
/>
<p:outputPanel
style=
"width: 600px;"
>
<pe:codeMirror
id=
"codeMirror"
mode=
"javascript"
theme=
"eclipse"
value=
"#{editScriptBean.entity.script}"
keyMap=
"default"
lineNumbers=
"true"
matchBrackets=
"true"
extraKeys=
"{ 'Ctrl-Space': function(cm) {CodeMirror.showHint(cm, CodeMirror.hint.javascriptHint);}}"
/>
</p:outputPanel>
</p:panelGrid>
<p:commandButton
id=
"save"
action=
"#{editScriptBean.save}"
value=
"#{messages.save}"
/>
<p:commandButton
id=
"cancel"
action=
"#{editScriptBean.cancel}"
value=
"#{messages.cancel}"
immediate=
"true"
/>
...
...
bwreg-webapp/src/main/webapp/admin/business-rule/show-script.xhtml
View file @
1165fa81
...
...
@@ -5,7 +5,8 @@
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:bw=
"http://www.scc.kit.edu/bwfacelets"
xmlns:p=
"http://primefaces.org/ui"
>
xmlns:p=
"http://primefaces.org/ui"
xmlns:pe=
"http://primefaces.org/ui/extensions"
>
<head>
<title></title>
</head>
...
...
@@ -41,12 +42,11 @@
<h:outputText
value=
"#{showScriptBean.entity.scriptType}"
/>
<h:outputText
value=
"#{messages.script}:"
/>
<h:panelGroup>
<div
style=
"font-family: 'Courier New', monospace; white-space: pre; font-size: 70%;"
>
<h:outputText
value=
"#{showScriptBean.entity.script}"
/>
</div>
</h:panelGroup>
<p:outputPanel
style=
"width: 640px;"
>
<pe:codeMirror
id=
"codeMirror"
mode=
"javascript"
theme=
"eclipse"
value=
"#{showScriptBean.entity.script}"
keyMap=
"default"
lineNumbers=
"true"
matchBrackets=
"true"
readonly=
"true"
lineWrapping=
"true"
/>
</p:outputPanel>
</p:panelGrid>
<h:link
outcome=
"edit-script.xhtml"
value=
"#{messages.edit}"
>
...
...
bwreg-webapp/src/main/webapp/resources/css/std-admin.css
View file @
1165fa81
...
...
@@ -3,12 +3,12 @@ html {
}
body
{
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
height
:
100%
;
background
:
white
;
}
*
{
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
margin
:
0
;
padding
:
0
;
}
...
...
@@ -288,3 +288,7 @@ div.serviceBlockLink {
.ui-panel
{
margin-bottom
:
16px
;
}
.CodeMirror
{
resize
:
both
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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