Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
96288880
Commit
96288880
authored
Jul 10, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
7219176a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
39 deletions
+139
-39
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/demo_interface1_html.xml
...PathTemplateItem/web_page_module/demo_interface1_html.xml
+15
-13
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_html.xml
...emplateItem/web_page_module/gadget_interfacedemo_html.xml
+2
-2
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_js.xml
...hTemplateItem/web_page_module/gadget_interfacedemo_js.xml
+14
-3
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_html.xml
...mplateItem/web_page_module/rjs_gadget_interfaces_html.xml
+7
-5
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
...TemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
+101
-16
No files found.
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/demo_interface1_html.xml
View file @
96288880
...
...
@@ -110,25 +110,27 @@
<head>
\n
</head>
\n
<body>
\n
<h4>
interface1
</h4>
\n
<h1>
interface1
</h1>
\n
<h3>
description of interface1
</h3>
\n
<dl>
\n
<dt>
method1
</dt>
\n
<dd>
description of method1
</dd>
\n
<dl>
\n
<dt
>
param1
</dt>
\n
<dd>
description of param1
</dd>
\n
<dt
>
param2
</dt>
\n
<dd>
description of param2
</dd>
\n
</dl>
\n
<dl>
\n
<dt
class=
"required"
type=
"int"
>
param1
</dt>
\n
<dd>
description of param1
</dd>
\n
<dt
class=
"optional"
>
param2
</dt>
\n
<dd>
description of param2
</dd>
\n
</dl>
\n
<dt>
method2
</dt>
\n
<dd>
description of method2
</dd>
\n
<dl>
\n
<dt
>
param1
</dt>
\n
<dd>
description of param1
</dd>
\n
</dl>
\n
<dl>
\n
<dt
class=
"required"
type=
"boolean"
>
param1
</dt>
\n
<dd>
description of param1
</dd>
\n
</dl>
\n
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -268,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.1
3112.12198.45124
</string>
</value>
<value>
<string>
944.1
7297.14978.38758
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -286,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
1436
192235.83
</float>
<float>
1436
446773.66
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_html.xml
View file @
96288880
...
...
@@ -288,7 +288,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.1
5689.51638.7082
</string>
</value>
<value>
<string>
944.1
7439.65022.59426
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -306,7 +306,7 @@
</tuple>
<state>
<tuple>
<float>
1436
347422.24
</float>
<float>
1436
452642.01
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_js.xml
View file @
96288880
...
...
@@ -123,15 +123,17 @@
})\n
\n
.declareMethod("method1", function (param1, param2) {\n
console.log("RJS IDemo JS: declareMethod: method1");\n
return;\n
})\n
.declareMethod("method2", function (param1) {\n
console.log("RJS IDemo JS: declareMethod: method2");\n
return;\n
})\n
.declareMethod("method3", function () {\n
return;\n
})\n
\n
\n
.declareMethod("render", function () {\n
var gadget = this;\n
return new RSVP.Queue()\n
...
...
@@ -152,6 +154,15 @@
gadget.props.content_element.innerHTML =\n
gadget.props.interface_list_template(parameter);\n
$(gadget.props.element).trigger("create");\n
return parameter.interface_item;\n
})\n
.push(function (interface_items) {\n
// testing getInterfaceData.\n
return gadget.getInterfaceData(interface_items[0].interface_name);\n
})\n
.push(function (interface_data) {\n
console.log("interface_data", interface_data);\n
console.log("getPath", gadget.getPath());\n
});\n
});\n
\n
...
...
@@ -290,7 +301,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.1
5705.41379.358
</string>
</value>
<value>
<string>
944.1
7453.1344.10683
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -308,7 +319,7 @@
</tuple>
<state>
<tuple>
<float>
1436
347953.17
</float>
<float>
1436
453615.05
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_html.xml
View file @
96288880
...
...
@@ -112,11 +112,13 @@
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<title>
Interfaces Gadget
</title>
\n
\n
<script
src=
"renderjs.js"
></script>
\n
<script
src=
"rsvp.js"
></script>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
\n
<script
src=
"jquery.js"
type=
"text/javascript"
></script>
\n
\n
<!-- custom script -->
\n
<script
src=
"gadget_interfaces.js"
></script>
\n
<script
src=
"gadget_interfaces.js"
type=
"text/javascript"
></script>
\n
\n
</head>
\n
<body></body>
\n
...
...
@@ -257,7 +259,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.1
3142.48800.18295
</string>
</value>
<value>
<string>
944.1
7351.42412.2389
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -275,7 +277,7 @@
</tuple>
<state>
<tuple>
<float>
1436
257154.99
</float>
<float>
1436
452859.83
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
View file @
96288880
...
...
@@ -101,9 +101,54 @@
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*global window, rJS, RSVP */\n
;/*\n
* DOMParser HTML extension\n
* 2012-09-04\n
*\n
* By Eli Grey, http://eligrey.com\n
* Public domain.\n
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n
*/\n
/*! @source https://gist.github.com/1129031 */\n
(function (DOMParser) {\n
"use strict";\n
var DOMParser_proto = DOMParser.prototype,\n
real_parseFromString = DOMParser_proto.parseFromString;\n
\n
// Firefox/Opera/IE throw errors on unsupported types\n
try {\n
// WebKit returns null on unsupported types\n
if ((new DOMParser()).parseFromString("", "text/html")) {\n
// text/html parsing is natively supported\n
return;\n
}\n
} catch (ignore) {}\n
\n
DOMParser_proto.parseFromString = function (markup, type) {\n
var result, doc, doc_elt, first_elt;\n
if (/^\\s*text\\/html\\s*(?:;|$)/i.test(type)) {\n
doc = document.implementation.createHTMLDocument("");\n
doc_elt = doc.documentElement;\n
\n
doc_elt.innerHTML = markup;\n
first_elt = doc_elt.firstElementChild;\n
\n
if (doc_elt.childElementCount === 1\n
&& first_elt.localName.toLowerCase() === "html") {\n
doc.replaceChild(first_elt, doc_elt);\n
}\n
\n
result = doc;\n
} else {\n
result = real_parseFromString.apply(this, arguments);\n
}\n
return result;\n
};\n
}(DOMParser));\n
\n
;/*global window, rJS, RSVP */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, Handlebars, $, RSVP, loopEventListener) {\n
(function (window, rJS, Handlebars, $, RSVP, loopEventListener
, DOMParser
) {\n
"use strict";\n
\n
function verifyInterfaceDeclaration (gadget) {\n
...
...
@@ -132,28 +177,68 @@
name: "",\n
description: "",\n
methods: []\n
},\n
method = {\n
name: "",\n
description: "",\n
argument_list: []\n
};\n
if (window.File && window.FileReader && window.FileList && window.Blob) {\n
return "Great success! All the File APIs are supported.";\n
} else {\n
return "The File APIs are not fully supported in this browser.";\n
} \n
return RSVP.Queue()\n
.push(function() {\n
return jQuery.get(interface_name);\n
})\n
.push(function(file_data) {\n
var doc = (new DOMParser()).parseFromString(file_data, \'text/html\').body,\n
dl_list = doc.getElementsByTagName(\'dl\'),\n
dt_list = doc.getElementsByTagName(\'dt\'),\n
dd_list = doc.getElementsByTagName(\'dd\'),\n
method_len = dl_list.length - 1,\n
dt_count = 0, \n
dl_count = 1;\n
interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n
interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n
\n
for (var i=0; i<method_len; i+=1) {\n
var method = {\n
name: "",\n
description: "",\n
argument_list: []\n
};\n
method.name = dt_list[dt_count].innerText;\n
method.description = dd_list[dt_count].innerText;\n
var argument_len = dl_list[dl_count].getElementsByTagName(\'dt\').length;\n
dt_count += 1;\n
dl_count += 1;\n
for (var j=0; j<argument_len; j+=1) {\n
var argument_item = {\n
name: "",\n
description: "",\n
required: true,\n
type: ""\n
};\n
if(dt_list[dt_count].getAttribute("class") == "optional") {\n
argument_item.required = false;\n
}\n
argument_item.type = dt_list[dt_count].getAttribute("type");\n
argument_item.name = dt_list[dt_count].innerText;\n
argument_item.description = dd_list[dt_count].innerText;\n
dt_count += 1;\n
method.argument_list.push(argument_item);\n
}\n
interface_data.methods.push(method);\n
}\n
return interface_data;\n
});\n
\n
})\n
\n
.declareMethod("getDefinedInterfaceMethods", function (interface_name) {\n
return;\n
return this.getInterfaceData(interface_name)\n
.push(function(interface_data) {\n
return interface_data.methods;\n
});\n
})\n
\n
.declareMethod("verifyInterfaceImplementation", function (gadget, interface_name) {\n
return;\n
});\n
\n
}(window, rJS, Handlebars, jQuery, RSVP, loopEventListener));
}(window, rJS, Handlebars, jQuery, RSVP, loopEventListener
, DOMParser
));
]]>
</string>
</value>
</item>
...
...
@@ -290,7 +375,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.1
5705.12035.31027
</string>
</value>
<value>
<string>
944.1
7466.54680.49015
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -308,7 +393,7 @@
</tuple>
<state>
<tuple>
<float>
1436
347895.72
</float>
<float>
1436
453641.0
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment