Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vivek
erp5
Commits
bd43f063
Commit
bd43f063
authored
Nov 18, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gadget_interface_validator: implemented form interface.
parent
50f1c236
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
58 deletions
+93
-58
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_appcache.xml
...m/web_page_module/gadget_interface_validator_appcache.xml
+5
-4
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_interface_form_html.xml
...module/gadget_interface_validator_interface_form_html.xml
+23
-17
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_form_html.xml
...page_module/gadget_interface_validator_page_form_html.xml
+5
-3
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_form_js.xml
...b_page_module/gadget_interface_validator_page_form_js.xml
+60
-34
No files found.
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_appcache.xml
View file @
bd43f063
...
@@ -126,7 +126,8 @@ gadget_interface_validator_page_report.html\n
...
@@ -126,7 +126,8 @@ gadget_interface_validator_page_report.html\n
gadget_interface_validator_page_report.js\n
gadget_interface_validator_page_report.js\n
gadget_interface_validator_panel.html\n
gadget_interface_validator_panel.html\n
gadget_interface_validator_panel.js\n
gadget_interface_validator_panel.js\n
gadget_interface_validator_reportpage_interface.html\n
gadget_interface_validator_interface_report.html\n
gadget_interface_validator_interface_form.html\n
gadget_interface_validator_router.html\n
gadget_interface_validator_router.html\n
gadget_interface_validator_router.js\n
gadget_interface_validator_router.js\n
NETWORK:\n
NETWORK:\n
...
@@ -265,7 +266,7 @@ NETWORK:\n
...
@@ -265,7 +266,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
946.
46348.9104.1143
</string>
</value>
<value>
<string>
946.
50480.64807.43622
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -283,8 +284,8 @@ NETWORK:\n
...
@@ -283,8 +284,8 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6024817.39
</float>
<float>
144
7779918.05
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_
reportpage_interface
_html.xml
→
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_
interface_form
_html.xml
View file @
bd43f063
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_interface_validator_
reportpage_interface
.html
</string>
</value>
<value>
<string>
gadget_interface_validator_
interface_form
.html
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_interface_validator_
reportpage_interface
_html
</string>
</value>
<value>
<string>
gadget_interface_validator_
interface_form
_html
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
language
</string>
</key>
<key>
<string>
language
</string>
</key>
...
@@ -108,17 +108,23 @@
...
@@ -108,17 +108,23 @@
<!DOCTYPE html>
\n
<!DOCTYPE html>
\n
<html>
\n
<html>
\n
<head>
\n
<head>
\n
<title>
Gadget Interface Validator
Reportpage
Interface
</title>
\n
<title>
Gadget Interface Validator
Form
Interface
</title>
\n
</head>
\n
</head>
\n
<body>
\n
<body>
\n
<h1>
Gadget Interface Validator
Reportpage
Interface
</h1>
\n
<h1>
Gadget Interface Validator
Form
Interface
</h1>
\n
<h3>
Interface
to display the interface validation report of an
application.
</h3>
\n
<h3>
Interface
for the form page of an interface validator
application.
</h3>
\n
<dl>
\n
<dl>
\n
<dt>
reportPageDummyMethod1
</dt>
\n
<dt>
initiateForm
</dt>
\n
<dd>
Defining the prototype for a report page dummy method
</dd>
\n
<dd>
A method to initiate the form with required fields and messages as per the options provided.
</dd>
\n
<dl>
\n
<dl>
\n
<dt
data-parameter-required=
"required"
data-parameter-type=
"int"
>
param1
</dt>
\n
<dt
data-parameter-required=
"required"
>
options
</dt>
\n
<dd>
An integer parameter
</dd>
\n
<dd>
An object containing the display message and other parameters.
</dd>
\n
</dl>
\n
<dt>
submitForm
</dt>
\n
<dd>
A method to call after submitting the form. It should fetch and process the form data, and render the next page accordingly.
</dd>
\n
<dl>
\n
<dt
data-parameter-required=
"required"
>
options
</dt>
\n
<dd>
An object containing the submitted form data.
</dd>
\n
</dl>
\n
</dl>
\n
</dl>
\n
</dl>
\n
</body>
\n
</body>
\n
...
@@ -128,7 +134,7 @@
...
@@ -128,7 +134,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Gadget Interface Validator
Reportpage
Interface
</string>
</value>
<value>
<string>
Gadget Interface Validator
Form
Interface
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
...
@@ -214,8 +220,8 @@
...
@@ -214,8 +220,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
5963728.87
</float>
<float>
144
7742425.98
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
@@ -259,7 +265,7 @@
...
@@ -259,7 +265,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.46338.32164.1607
6
</string>
</value>
<value>
<string>
94
7.10448.28405.2160
6
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -277,8 +283,8 @@
...
@@ -277,8 +283,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
5963711.9
8
</float>
<float>
144
7781423.5
8
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
@@ -334,8 +340,8 @@
...
@@ -334,8 +340,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
5963404.93
</float>
<float>
144
7740382.86
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_form_html.xml
View file @
bd43f063
...
@@ -112,6 +112,8 @@
...
@@ -112,6 +112,8 @@
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<title>
Gadget Interface Validator Formpage
</title>
\n
<title>
Gadget Interface Validator Formpage
</title>
\n
\n
\n
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"gadget_interface_validator_interface_form.html"
/>
\n
\n
<!-- renderjs -->
\n
<!-- renderjs -->
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
...
@@ -284,7 +286,7 @@
...
@@ -284,7 +286,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.46342.43288.2629
9
</string>
</value>
<value>
<string>
94
7.10814.41583.2257
9
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -302,8 +304,8 @@
...
@@ -302,8 +304,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
5964472.82
</float>
<float>
144
7779998.07
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_form_js.xml
View file @
bd43f063
...
@@ -157,6 +157,10 @@
...
@@ -157,6 +157,10 @@
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
\n
\n
.declareMethod("render", function (options) {\n
.declareMethod("render", function (options) {\n
return this.initiateForm(options);\n
})\n
\n
.declareMethod("initiateForm", function(options) {\n
var gadget = this;\n
var gadget = this;\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function() {\n
.push(function() {\n
...
@@ -174,7 +178,59 @@
...
@@ -174,7 +178,59 @@
gadget.props.content_element.querySelector("input[type=text]")\n
gadget.props.content_element.querySelector("input[type=text]")\n
.focus();\n
.focus();\n
});\n
});\n
})\n
\n
\n
.declareMethod("submitForm", function(options) {\n
var gadget = this,\n
interface_gadget,\n
appcache_url,\n
required_interface,\n
page_type,\n
gadget_source_url = \'gadget_interface_validator.appcache\';\n
return new RSVP.Queue()\n
.push(function () {\n
gadget.props.content_element.querySelector("input[type=submit]")\n
.disabled = true;\n
return options.target[0].value;\n
})\n
.push(function(submit_url) {\n
appcache_url = submit_url;\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
})\n
.push(function(i_gadget) {\n
required_interface = \'gadget_interface_validator_interface_report.html\';\n
interface_gadget = i_gadget;\n
return interface_gadget.getGadgetListImplementingInterface(required_interface, gadget_source_url);\n
})\n
.push(function(gadget_list) {\n
if(gadget_list.length > 0) {\n
page_type = fetchPageType(gadget_list[0]);\n
return gadget.redirect({\n
page: page_type,\n
appcache_url: appcache_url\n
});\n
} else {\n
required_interface = \'gadget_interface_validator_interface_form.html\';\n
return new RSVP.Queue()\n
.push(function() {\n
return interface_gadget.getGadgetListImplementingInterface(required_interface, gadget_source_url);\n
})\n
.push(function(gadget_list) {\n
console.log("gadget_list");\n
if(gadget_list.length > 0) {\n
page_type = fetchPageType(gadget_list[0]);\n
return gadget.redirect({\n
page: page_type,\n
found: false\n
});\n
} else {\n
return gadget.redirect({\n
found: false\n
});\n
}\n
});\n
}\n
});\n
})\n
})\n
\n
\n
.declareService(function () {\n
.declareService(function () {\n
...
@@ -183,37 +239,7 @@
...
@@ -183,37 +239,7 @@
////////////////////////////////////\n
////////////////////////////////////\n
var gadget = this;\n
var gadget = this;\n
function formSubmit(submit_event) {\n
function formSubmit(submit_event) {\n
var interface_gadget,\n
return gadget.submitForm(submit_event);\n
appcache_url;\n
return new RSVP.Queue()\n
.push(function () {\n
gadget.props.content_element.querySelector("input[type=submit]")\n
.disabled = true;\n
return submit_event.target[0].value;\n
})\n
.push(function(submit_url) {\n
appcache_url = submit_url;\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
})\n
.push(function(i_gadget) {\n
var required_interface = \'gadget_interface_validator_reportpage_interface.html\',\n
gadget_source_url = \'gadget_interface_validator.appcache\';\n
interface_gadget = i_gadget;\n
return interface_gadget.getGadgetListImplementingInterface(required_interface, gadget_source_url);\n
})\n
.push(function(gadget_list) {\n
if(gadget_list.length > 0) {\n
var page_type = fetchPageType(gadget_list[0]);\n
return gadget.redirect({\n
page: page_type,\n
appcache_url: appcache_url\n
});\n
} else {\n
return gadget.redirect({\n
found: false\n
});\n
}\n
});\n
}\n
}\n
// Listen to form submit\n
// Listen to form submit\n
return loopEventListener(\n
return loopEventListener(\n
...
@@ -361,7 +387,7 @@
...
@@ -361,7 +387,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.54877.22908.40635
</string>
</value>
<value>
<string>
94
7.11076.45303.33126
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -379,8 +405,8 @@
...
@@ -379,8 +405,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6717901.46
</float>
<float>
144
7781632.75
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
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