Commit 1fb525c8 authored by Ivan Tyagov's avatar Ivan Tyagov

Ignore certaul editor files.

parent 4e6db9db
......@@ -21,3 +21,5 @@ apache2.conf
#vi
*.swp
*~
/*
ERP5 dynamic gadget loader
Issues:
- Browser allows load gadgets' file sonly from same origin (conisder use eval?)
-
*/
var ERP5={
load: function () {
// Load gadget layoyut by traversing DOM
application = $("#application")
gadget_list = application.find("[gadget]");
// load application gadget
ERP5.loadGadgetFromUrl(application);
// Load siblings
//gadget_list.each(function(i,v){ERP5.loadGadgetFromUrl($(this));});
},
save: function () {
// XXX: Save gadget layoyut by traversing DOM and using some kind of storage
console.log("save");
},
parse: function (data){
// XXX: Parse an HTML document and get out .js and .css
// $.ajax({url:"jquery-ui.js",
// type: "script"});
},
loadGadgetFromUrl: function(gadget) {
// Load gadget's SPECs from URL
url = gadget.attr("gadget")
$.ajax({url:url,
success: function (data) {
ERP5.parse (data);
gadget.append("<div>" + data + "</div>");
gadget.find("a").each(
function(){
$(this).click(
function(){
alert("disabled"); return false;})}
)
},
});
}
}
// init all when DOM is ready
$(document).ready(function() {
ERP5.load();
});
<html>
<head>
<title>Gadget POC</title>
<script src="jquery-1.7.1.js" type="text/javascript"></script>
<script src="erp5-spa.js" type="text/javascript"></script>
</head>
<body>
<div id="application" gadget="portal_gadgets/application/asOam"
gadget:property="{}">
<div id="navigation" gadget="portal_gadgets/menu/asOam"
gadget:property="{}"
gadget:visible="true"> Navigation </div>
<div id="main" gadget="portal_gadgets/mode/asOam"
gadget:property="{}"
gadget:visible="true">
<div id="tab" gadget:type="portal_gadgets/tab/asOam">
<div id="pad1" gadget:type="portal_gadgets/pad/asOam"
gadget:property="{}"> PAD1
<div id="column1" gadget:type="portal_gadgets/column/asOam"
gadget:property="{}">
<div id="box1" gadget:type="portal_gadgets/worklist/asOam"
gadget:property="{}"
gadget:movable="true"> Box1 </div>
<div id="box2" gadget:type="portal_gadgets/contact/asOam"
gadget:property="{}"
gadget:movable="true"> Box2 </div>
</div>
<div id="column2" gadget:type="portal_gadgets/column/asOam"
gadget:property="{}">
</div>
<div id="column3" gadget:type="portal_gadgets/proxy/asOam"
gadget:property="{"proxy_url": "web_page_module/default/asStrippedHTML",
"proxy_dom": "#application.#main.#tab2.#column1.#map" }">
</div>
</div>
<div id="pad2" gadget:type="portal_gadgets/pad/asOam"
gadget:property="{}"> PAD2
<div id="column1" gadget:type="portal_gadgets/column/asOam"
gadget:property="{}">
</div>
</div>
</div>
</div>
<div id="list" gadget="portal_gadgets/mode/asOam"
gadget:property="{}">
<div id="action" gadget="portal_gadgets/action/asOam"
gadget:property="{}">
</div>
<div id="list" gadget="portal_gadgets/list/asOam"
gadget:property="{}">
</div>
<div id="dialog" gadget="portal_gadgets/dialog/asOam"
gadget:property="{}">
</div>
</div>
<div id="view" gadget="portal_gadgets/mode/asOam"
gadget:property="{}">
<div id="action" gadget="portal_gadgets/action/asOam"
gadget:property="{}">
</div>
<div id="view" gadget="portal_gadgets/view/asOam"
gadget:property="{}">
</div>
<div id="dialog" gadget="portal_gadgets/dialog/asOam"
gadget:property="{}">
</div>
</div>
</div>
</body>
</html>
<html>
<head>
<title>Gadget POC</title>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js" type="text/javascript"></script>
</head>
<script>
$(function() {
$("#datepicker" ).datepicker();
});
</script>
<body>
<div id="datepicker">
<p>Simple <a href="http://www.apple.com/toto">body</a> ggg</p>
</div>
</body>
</html>
\ No newline at end of file
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