Commit ca5fcc74 authored by Ivan Tyagov's avatar Ivan Tyagov

Use proper name for .js library.

parent 4a8de7e4
var ERP5={ var RenderJs={
bootstrap: function (root){ bootstrap: function (root){
// load application gadget // initial load application gadget
ERP5.load(root); RenderJs.load(root);
}, },
load: function (root) { load: function (root) {
// Load gadget layout by traversing DOM // Load gadget layout by traversing DOM
gadget_list = root.find("[gadget]"); gadget_list = root.find("[gadget]");
// Load siblings // Load chilren
gadget_list.each(function(i,v){ERP5.loadGadgetFromUrl($(this));}); gadget_list.each(function(i,v){RenderJs.loadGadgetFromUrl($(this));});
}, },
loadGadgetFromUrl: function(gadget) { loadGadgetFromUrl: function(gadget) {
...@@ -18,10 +19,10 @@ var ERP5={ ...@@ -18,10 +19,10 @@ var ERP5={
//console.log(url); //console.log(url);
$.ajax({url:url, $.ajax({url:url,
success: function (data) { success: function (data) {
ERP5.parse (data); RenderJs.parse (data);
gadget.append(data); gadget.append(data);
// a gadget may contain sub gadgets // a gadget may contain sub gadgets
ERP5.load(gadget); RenderJs.load(gadget);
//console.log(url+ data); //console.log(url+ data);
gadget.find("a").each( gadget.find("a").each(
function(){ function(){
...@@ -36,27 +37,25 @@ var ERP5={ ...@@ -36,27 +37,25 @@ var ERP5={
}, },
// XXX: finish below // XXX: finish below
save: function () {
// XXX: Save gadget layoyut by traversing DOM and using some kind of storage
console.log("XXX: save");
},
parse: function (data){ parse: function (data){
// XXX: Parse an HTML document and get out .js and .css // XXX: Parse an HTML document and get out .js and .css
// XXX: load .css // XXX: load .css
// XXX: load .jss (see requirejs) // XXX: load .jss (see requirejs)
// $.ajax({url:"jquery-ui.js", // $.ajax({url:"jquery-ui.js",
// type: "script"}); // type: "script"});
}, },
save: function () {
// XXX: Save gadget layoyut by traversing DOM and using some kind of storage
console.log("XXX: save");
},
} }
// init all when DOM is ready // init all when DOM is ready
$(document).ready(function() { $(document).ready(function() {
ERP5.bootstrap($("#application")); RenderJs.bootstrap($("#application"));
}); });
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<script src="_/js/functions.js"></script> <script src="_/js/functions.js"></script>
<!-- Gadget library goes here --> <!-- Gadget library goes here -->
<script src="_/js/renderjs/render.js"></script> <script src="_/js/renderjs/renderjs.js"></script>
<!-- Asynchronous google analytics; this is the official snippet. <!-- Asynchronous google analytics; this is the official snippet.
......
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