Skip to content
Snippets Groups Projects
Commit f204e8e2 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

handle all javascript loading in head

parent 0c895d38
Branches master
No related tags found
No related merge requests found
......@@ -18,6 +18,74 @@
<script src="[% app.cdn_url %]/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="[% app.cdn_url %]/libs/jquery-ui/1.13.3/jquery-ui.min.js"></script>
<script src="[% app.cdn_url %]/libs/jquery-validation/1.19.5/jquery.validate.min.js"></script>
<script src="[% app.cdn_url %]/libs/foundation/6.8.1/js/vendor/what-input.js"></script>
<script src="[% app.cdn_url %]/libs/foundation/6.8.1/js/vendor/foundation.min.js"></script>
<script src="js/menu.js"></script>
<script>
$(document).foundation();
var Help = new Array();
Help['Help Entry 1'] = 'Text for Help Entry 1 goes in here';
Help['Help Entry 2'] = 'Text for Help Entry 2 goes in here';
function openHelp($helpTrigger){
var helpId = $helpTrigger.attr('data-help_id');
$help = $('#help_dialog');
$help.html('<p>' + Help[helpId] + '</p>');
$help.dialog('option', 'title', helpId);
$help.dialog('option', { position: { my: "left top", at: "right bottom", of: $helpTrigger } });
$help.dialog('open');
}
$(function(){
var $footer = $('footer');
var $body = $("body");
$body.css('margin-top', 0);
$body.css('margin-bottom', 0);
// function to set the height on fly
function autoHeight() {
// $('#wrap').css('min-height', 0);
$('#wrap').css('min-height', (
$(document).outerHeight()
- $('header').outerHeight()
+ $('#wrap').height()
- $('#wrap').outerHeight()
- $footer.height()
));
}
// onDocumentReady function bind
$(document).ready(function() {
autoHeight();
$("button").mouseout(function(){
this.blur();
})
});
// onResize bind of the function
$(window).resize(function() {
autoHeight();
});
$footer.css('visibility', 'visible');
$('#help_dialog').dialog({
autoOpen: false
});
$('.help').click(function(e){
e.preventDefault();
var $helpTrigger = $(this);
openHelp($helpTrigger);
});
});
</script>
<title>[% app.name %]</title>
</head>
......@@ -92,73 +160,5 @@
</div>
</footer>
<script src="foundation/js/vendor/what-input.js"></script>
<script src="foundation/js/vendor/foundation.min.js"></script>
<script src="js/menu.js"></script>
<script>
$(document).foundation();
var Help = new Array();
Help['Help Entry 1'] = 'Text for Help Entry 1 goes in here';
Help['Help Entry 2'] = 'Text for Help Entry 2 goes in here';
function openHelp($helpTrigger){
var helpId = $helpTrigger.attr('data-help_id');
$help = $('#help_dialog');
$help.html('<p>' + Help[helpId] + '</p>');
$help.dialog('option', 'title', helpId);
$help.dialog('option', { position: { my: "left top", at: "right bottom", of: $helpTrigger } });
$help.dialog('open');
}
$(function(){
var $footer = $('footer');
var $body = $("body");
$body.css('margin-top', 0);
$body.css('margin-bottom', 0);
// function to set the height on fly
function autoHeight() {
// $('#wrap').css('min-height', 0);
$('#wrap').css('min-height', (
$(document).outerHeight()
- $('header').outerHeight()
+ $('#wrap').height()
- $('#wrap').outerHeight()
- $footer.height()
));
}
// onDocumentReady function bind
$(document).ready(function() {
autoHeight();
$("button").mouseout(function(){
this.blur();
})
});
// onResize bind of the function
$(window).resize(function() {
autoHeight();
});
$footer.css('visibility', 'visible');
$('#help_dialog').dialog({
autoOpen: false
});
$('.help').click(function(e){
e.preventDefault();
var $helpTrigger = $(this);
openHelp($helpTrigger);
});
});
</script>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment