Commit 1165fa81 authored by michael.simon's avatar michael.simon
Browse files

Add Code mirror to edit Javascript from primefaces extensions

parent 17155e1d
......@@ -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>
......
......@@ -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);
}
......
......@@ -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>
......
......@@ -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"/>
......
......@@ -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}">
......
......@@ -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;
}
Markdown is supported
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