Commit 77d513dc authored by Boris Kocherov's avatar Boris Kocherov

load schema remove jquery dependence

parent f2431d1b
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="URI.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="tv4.min.js" type="text/javascript"></script> <script src="tv4.min.js" type="text/javascript"></script>
<script src="URI.js" type="text/javascript"></script>
<script src="jio.js" type="text/javascript"></script> <script src="jio.js" type="text/javascript"></script>
<script src="gadget_erp5_page_slap_load_schema.js" type="text/javascript"></script> <script src="gadget_erp5_page_slap_load_schema.js" type="text/javascript"></script>
</head> </head>
......
/*jslint nomen: true, maxlen: 200, indent: 2*/ /*jslint nomen: true, maxlen: 200, indent: 2*/
/*global window, rJS, console, RSVP, jQuery, jIO, tv4, URI, JSON, $ */ /*global window, rJS, console, RSVP, jIO, tv4, URI, JSON*/
(function (window, rJS, $, RSVP) { (function (window, rJS, RSVP, URI, jIO, tv4) {
"use strict"; "use strict";
function extend(obj, obj1) {
for (var i in obj1) {
if (obj1.hasOwnProperty(i)) {
obj[i] = obj1[i];
}
}
}
function getJSON(url) { function getJSON(url) {
var protocol = URI(url).protocol(); var protocol = URI(url).protocol();
if (protocol === "http" || protocol === "https") { if (protocol === "http" || protocol === "https") {
...@@ -96,7 +104,7 @@ ...@@ -96,7 +104,7 @@
base_url base_url
); );
}).push(function (referencedx) { }).push(function (referencedx) {
$.extend(expanded_json_schema, referencedx); extend(expanded_json_schema, referencedx);
delete expanded_json_schema.$ref; delete expanded_json_schema.$ref;
return true; return true;
}); });
...@@ -119,7 +127,7 @@ ...@@ -119,7 +127,7 @@
base_url base_url
) )
.push(function (referencedx) { .push(function (referencedx) {
$.extend(expanded_json_schema.properties[p], referencedx); extend(expanded_json_schema.properties[p], referencedx);
if (json_schema.properties[p].$ref) { if (json_schema.properties[p].$ref) {
delete expanded_json_schema.properties[p].$ref; delete expanded_json_schema.properties[p].$ref;
} }
...@@ -149,13 +157,13 @@ ...@@ -149,13 +157,13 @@
base_url base_url
).push(function (referencedx) { ).push(function (referencedx) {
if (referencedx.properties) { if (referencedx.properties) {
$.extend( extend(
expanded_json_schema.properties, expanded_json_schema.properties,
referencedx.properties referencedx.properties
); );
delete referencedx.properties; delete referencedx.properties;
} }
$.extend(expanded_json_schema, referencedx); extend(expanded_json_schema, referencedx);
}); });
} }
...@@ -275,4 +283,4 @@ ...@@ -275,4 +283,4 @@
}); });
}); });
}(window, rJS, $, RSVP)); }(window, rJS, RSVP, URI, jIO, tv4));
\ No newline at end of file \ 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