diff --git a/gazelle-proxy-war/src/main/webapp/js/activeModal.js b/gazelle-proxy-war/src/main/webapp/js/activeModal.js new file mode 100644 index 0000000000000000000000000000000000000000..7157f7eae9ddcaef9cfc178189936e2c38538c72 --- /dev/null +++ b/gazelle-proxy-war/src/main/webapp/js/activeModal.js @@ -0,0 +1,12 @@ +/** + * select active modal + * + * @author Guillaume Thomazon + */ + +var ActiveModal = new function() { + this.activeModalPanel = null; + this.setActiveModalPanel = function(a) { + this.activeModalPanel = a; + }; +}; \ No newline at end of file diff --git a/gazelle-proxy-war/src/main/webapp/js/autofocus.js b/gazelle-proxy-war/src/main/webapp/js/autofocus.js new file mode 100644 index 0000000000000000000000000000000000000000..7481760e8dd2e06addde872783f71980932a4e9f --- /dev/null +++ b/gazelle-proxy-war/src/main/webapp/js/autofocus.js @@ -0,0 +1,11 @@ +/** + * autofocus on modalpanels + * @author Abderrazek Boufahja + */ + +function autofocus(containerId) { + var element = jQuery(":input:not(:button):visible:enabled:first", '#'+containerId); + if (element != null) { + element.focus().select(); + } +} \ No newline at end of file diff --git a/gazelle-proxy-war/src/main/webapp/layout/footer.xhtml b/gazelle-proxy-war/src/main/webapp/layout/footer.xhtml index 1c8f2a06135babf4143cd79c16bc926b0172ca78..d661567968886b2bd9adc1a453f61a8a271f4c2e 100644 --- a/gazelle-proxy-war/src/main/webapp/layout/footer.xhtml +++ b/gazelle-proxy-war/src/main/webapp/layout/footer.xhtml @@ -47,51 +47,60 @@ <!-- Modal Panel : About the Proxy --> <!-- ******************************************* --> - <rich:modalPanel id="about" minHeight="150" minWidth="450" height="300" - width="500" zindex="2000"> + <rich:modalPanel id="about" + onbeforeshow="ActiveModal.setActiveModalPanel('about')" + minHeight="150" minWidth="450" height="300" width="500" zindex="2000"> <f:facet name="header"> <h:outputText value="#{messages['net.ihe.gazelle.proxy.AboutProxy']}" /> </f:facet> <f:facet name="controls"> - <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" value="/img/close.gif" - style="cursor:pointer" onclick="Richfaces.hideModalPanel('about')" /> + <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" + value="/img/close.gif" style="cursor:pointer" + onclick="Richfaces.hideModalPanel('about')" /> </f:facet> <h1> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.GazelleProxy']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.GazelleProxy']}" /> </h1> <h2> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.IHEIntegratingTheHeathcareEnterprise']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.IHEIntegratingTheHeathcareEnterprise']}" /> </h2> <h3> - <i> <h:outputText value="#{messages['net.ihe.gazelle.proxy.ChangingTheWayHealthcareConnects']}" /> + <i> <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ChangingTheWayHealthcareConnects']}" /> </i> </h3> - <a href="http://www.ihe.net"> <h:outputText value="#{messages['net.ihe.gazelle.proxy.Wwwihenet']}" /> + <a href="http://www.ihe.net"> <h:outputText + value="#{messages['net.ihe.gazelle.proxy.Wwwihenet']}" /> </a> <p> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.ProxyVersion']} " /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ProxyVersion']} " /> <h:outputText id="versionDetails" value="${version}" /> </p> <p> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.ReleaseDate']} " /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ReleaseDate']} " /> <h:outputText value="${build.date.full}" /> </p> <p> - <a - href="#{applicationConfigurationManager.releaseNoteUrl}">#{messages['net.ihe.gazelle.proxy.ReleaseNotes']}</a> + <a href="#{applicationConfigurationManager.releaseNoteUrl}">#{messages['net.ihe.gazelle.proxy.ReleaseNotes']}</a> </p> <p> <a href="#{applicationConfigurationManager.documentation}">#{messages['net.ihe.gazelle.proxy.Documentation']}</a> </p> <p> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.DevelopedForIHEByIHE']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.DevelopedForIHEByIHE']}" /> </p> <p> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.ThanksToUseThisApplication']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ThanksToUseThisApplication']}" /> </p> <p align="right"> <a href="javascript:Richfaces.hideModalPanel('about')"> <h:outputText @@ -106,37 +115,45 @@ <!-- ******************************************* --> <!-- Modal Panel : Contact Us --> <!-- ******************************************* --> - <rich:modalPanel id="contactUs" minHeight="200" minWidth="400" - height="200" width="420" zindex="2000"> + <rich:modalPanel id="contactUs" + onbeforeshow="ActiveModal.setActiveModalPanel('contactUs')" + minHeight="200" minWidth="400" height="200" width="420" zindex="2000"> <f:facet name="header"> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.ContactUs_2']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ContactUs_2']}" /> </f:facet> <f:facet name="controls"> - <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" value="/img/close.gif" - style="cursor:pointer" + <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" + value="/img/close.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('contactUs')" /> </f:facet> <h1> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.GazelleProxy']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.GazelleProxy']}" /> </h1> <h2> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.IHEIntegratingTheHeathcareEnterprise']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.IHEIntegratingTheHeathcareEnterprise']}" /> </h2> <h3> - <i> <h:outputText value="#{messages['net.ihe.gazelle.proxy.ChangingTheWayHealthcareConnects']}" /> + <i> <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ChangingTheWayHealthcareConnects']}" /> </i> </h3> - <a href="http://www.ihe.net"> <h:outputText value="#{messages['net.ihe.gazelle.proxy.Wwwihenet']}" /> + <a href="http://www.ihe.net"> <h:outputText + value="#{messages['net.ihe.gazelle.proxy.Wwwihenet']}" /> </a> <p></p> <p> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.PleaseEmailQuestionsToIHEEUManager']} (" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.PleaseEmailQuestionsToIHEEUManager']} (" /> <a href="mailto:eric.poiseau@inria.fr}"> <h:outputText value="#{messages['net.ihe.gazelle.proxy.EricPoiseau']}" /> </a> - <h:outputText value="), #{messages['net.ihe.gazelle.proxy.AndHeWillGuideYouThroughTheProcess']}" /> + <h:outputText + value="), #{messages['net.ihe.gazelle.proxy.AndHeWillGuideYouThroughTheProcess']}" /> </p> <p> <a href="javascript:Richfaces.hideModalPanel('contactUs')"> <h:outputText @@ -151,14 +168,16 @@ <!-- ******************************************* --> <!-- Modal Panel : Issue Tracker --> <!-- ******************************************* --> - <rich:modalPanel id="issueTracker" minHeight="200" minWidth="540" - height="200" width="540" zindex="2000"> + <rich:modalPanel id="issueTracker" + onbeforeshow="ActiveModal.setActiveModalPanel('issueTracker')" + minHeight="200" minWidth="540" height="200" width="540" zindex="2000"> <f:facet name="header"> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.IssueTracker_2']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.IssueTracker_2']}" /> </f:facet> <f:facet name="controls"> - <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" value="/img/close.gif" - style="cursor:pointer" + <h:graphicImage alt="#{messages['net.ihe.gazelle.proxy.Close']}" + value="/img/close.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('issueTracker')" /> </f:facet> <p /> @@ -170,7 +189,8 @@ <h:outputText value="#{messages['net.ihe.gazelle.proxy.ADevelopmentTeamWorksEachDayToImproveThisApplica']}" /> <p /> - <h:outputText value="#{messages['net.ihe.gazelle.proxy.ClickOnThatLinkToReportAProblem']}" /> + <h:outputText + value="#{messages['net.ihe.gazelle.proxy.ClickOnThatLinkToReportAProblem']}" /> <a href="#{applicationConfigurationManager.issueTracker}"> <h:outputText value="#{applicationConfigurationManager.issueTracker}" /> </a> diff --git a/gazelle-proxy-war/src/main/webapp/layout/template.xhtml b/gazelle-proxy-war/src/main/webapp/layout/template.xhtml index 93af7288c17710b8c09e0c526098a17817e4ca45..9cc91d6548cd45dcff892a1cde8fcd25c8159988 100644 --- a/gazelle-proxy-war/src/main/webapp/layout/template.xhtml +++ b/gazelle-proxy-war/src/main/webapp/layout/template.xhtml @@ -15,6 +15,9 @@ <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico" /> <a:loadStyle src="resource:///stylesheet/theme.xcss" /> <a:loadStyle src="/stylesheet/theme-simu.css" /> +<a:loadScript src="/js/autofocus.js" /> +<a:loadScript src="/js/activeModal.js" /> + <ui:insert name="head" /> </head> <body>