Dynamic JS loading and UI updates

pull/210/head
Michael Jett 12 years ago
parent 2311cdf1f2
commit 48941f1713

@ -1,4 +1,4 @@
<%@attribute name="loadapp" required="false" type="java.lang.Boolean" %> <%@attribute name="js" required="false" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- Le javascript <!-- Le javascript
@ -8,8 +8,8 @@
<script type="text/javascript" src="resources/js/underscore-min.js"></script> <script type="text/javascript" src="resources/js/underscore-min.js"></script>
<script type="text/javascript" src="resources/js/backbone-min.js"></script> <script type="text/javascript" src="resources/js/backbone-min.js"></script>
<script type="text/javascript" src="resources/js/backbone.validations.js"></script> <script type="text/javascript" src="resources/js/backbone.validations.js"></script>
<c:if test="${loadapp == null || loadapp == Boolean.TRUE}"> <c:if test="${js != null || js != ''}">
<script type="text/javascript" src="resources/js/app.js"></script> <script type="text/javascript" src="${js}"></script>
</c:if> </c:if>
</body> </body>
</html> </html>

@ -10,13 +10,15 @@
<div class="row-fluid"> <div class="row-fluid">
<o:sidebar/> <o:sidebar/>
<div class="span10"> <div class="span10">
<div class="content"> <div class="content span12">
<o:breadcrumbs crumb="Manage Clients"/> <o:breadcrumbs crumb="Manage Clients"/>
<div class="progress">
<div class="bar" style="width: 60%;"></div>
</div>
<span id="content"></span> <span id="content"></span>
<o:copyright/> <o:copyright/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<o:footer/> <o:footer js="resources/js/admin.js"/>

@ -1,4 +1,6 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700'); @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700');
html {overflow-y: scroll;}
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
audio:not([controls]){display:none;} audio:not([controls]){display:none;}
@ -176,7 +178,7 @@ input:focus:required:invalid,textarea:focus:required:invalid,select:focus:requir
.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#eeeeee;border-top:1px solid #ddd;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";} .form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#eeeeee;border-top:1px solid #ddd;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";}
.form-actions:after{clear:both;} .form-actions:after{clear:both;}
.uneditable-input{overflow:hidden;white-space:nowrap;cursor:not-allowed;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);} .uneditable-input{overflow:hidden;white-space:nowrap;cursor:not-allowed;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);}
:-moz-placeholder{color:#999999;} :-moz-placeholder{color:#d7d7d7;}
::-webkit-input-placeholder{color:#999999;} ::-webkit-input-placeholder{color:#999999;}
.help-block,.help-inline{color:#888888;} .help-block,.help-inline{color:#888888;}
.help-block{display:block;margin-bottom:9px;} .help-block{display:block;margin-bottom:9px;}

@ -554,7 +554,8 @@
"clients":"listClients", "clients":"listClients",
"client/new":"newClient", "client/new":"newClient",
"client/:id":"editClient", "client/:id":"editClient",
"white_list":"whiteList" "white_list":"whiteList",
'*path': 'listClients'
}, },
initialize:function () { initialize:function () {
@ -667,8 +668,7 @@
}; };
// load templates and append them to the body // load templates and append them to the body
$.get('resources/template/client.html', _load); $.get('resources/template/admin.html', _load);
$.get('resources/template/list.html', _load);
jQuery.ajaxSetup({async:true}); jQuery.ajaxSetup({async:true});
app = new AppRouter(); app = new AppRouter();

@ -1,10 +0,0 @@
<script type="text/html" id="tmpl-url-list">
<div class="well">
<label>White list
<textarea class="span7" rows="5" id="textarea" class="input-xlarge"></textarea></label>
<span class="help-block">Enter URLs separated by a newline.</span>
<button class="btn">Save</button>
</div>
</script>
Loading…
Cancel
Save