JR Utily

- JS script to manage include of tinymce lib just once

......@@ -19,15 +19,35 @@
<!-- content -->
<!-- <ui:define name="content">-->
<head>
<script type="text/javascript" src="resources/tinymce/tinymce.js"></script>
<script type="text/javascript">
<head jsf:id="head">
<script jsf:id="tinymce" jsf:target="head" type="text/javascript">
// Adding the script tag to the head as suggested before
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'resources/tinymce/tinymce.js';
var callback = function(){
tinymce.init({
selector: 'textarea.mytinymce'
});
};
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
script.onreadystatechange = callback;
script.onload = callback;
// Fire the loading
head.appendChild(script);
</script>
</head>
<body>
<body jsf:id="body">
<h2><h:outputText value="Cration " rendered="#{empty(updateUserBean.userId)}"/>
......