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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
12f12b2d
Commit
12f12b2d
authored
Sep 04, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated subgadget rendering, removed dummy gadgets
parent
4314f44f
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
139 additions
and
1506 deletions
+139
-1506
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_interface_html.xml
...athTemplateItem/web_page_module/editor_interface_html.xml
+25
-15
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_html.xml
...hTemplateItem/web_page_module/editor_test_gadget_html.xml
+4
-6
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_js.xml
...athTemplateItem/web_page_module/editor_test_gadget_js.xml
+80
-62
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_correct_implemented_gadget_html.xml
...module/interface_test_correct_implemented_gadget_html.xml
+0
-353
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_correct_implemented_gadget_js.xml
...e_module/interface_test_correct_implemented_gadget_js.xml
+0
-349
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_multiple_interface_correct_gadget_html.xml
...interface_test_multiple_interface_correct_gadget_html.xml
+0
-354
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_multiple_interface_correct_gadget_js.xml
...e/interface_test_multiple_interface_correct_gadget_js.xml
+0
-358
bt5/erp5_web_editor_demo/SkinTemplateItem/portal_skins/erp5_rjs_interface_gadgets.xml
...nTemplateItem/portal_skins/erp5_rjs_interface_gadgets.xml
+26
-0
bt5/erp5_web_editor_demo/bt/template_keep_last_workflow_history_only_path_list
...emo/bt/template_keep_last_workflow_history_only_path_list
+1
-3
bt5/erp5_web_editor_demo/bt/template_keep_workflow_path_list
bt5/erp5_web_editor_demo/bt/template_keep_workflow_path_list
+1
-3
bt5/erp5_web_editor_demo/bt/template_path_list
bt5/erp5_web_editor_demo/bt/template_path_list
+1
-3
bt5/erp5_web_editor_demo/bt/template_skin_id_list
bt5/erp5_web_editor_demo/bt/template_skin_id_list
+1
-0
No files found.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_interface_html.xml
View file @
12f12b2d
...
...
@@ -10,11 +10,8 @@
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
...
...
@@ -27,6 +24,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -46,6 +44,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -53,11 +52,8 @@
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
...
...
@@ -122,13 +118,25 @@
<dt
data-parameter-required=
"required"
data-parameter-type=
"string"
>
content
</dt>
\n
<dd>
the content to be set in the text editor
</dd>
\n
</dl>
\n
</dd>
\n
<dt>
clearContent
</dt>
\n
<dd>
to clear the contect of the text editor
</dd>
\n
<dl></dl>
\n
<dt>
initSubGadget
</dt>
\n
<dd>
to initiate the current gadget
</dd>
\n
<dl></dl>
\n
<dt>
initStateTransfer
</dt>
\n
<dd>
to initiate state transfer before gadget switch
</dd>
\n
<dl></dl>
\n
<dt>
finishStateTransfer
</dt>
\n
<dd>
to finish state transfer after gadget switch
</dd>
\n
<dl>
\n
<dt
data-parameter-required=
"required"
data-parameter-type=
"string"
>
current_state
</dt>
\n
<dd>
the current state to be transfer to next gadget
</dd>
\n
</dl>
\n
</dl>
\n
</body>
\n
</html>
</html>
\n
]]>
</string>
</value>
</item>
...
...
@@ -194,11 +202,13 @@
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
1
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -220,7 +230,7 @@
</tuple>
<state>
<tuple>
<float>
14
38594082.15
</float>
<float>
14
41284333.1
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
@@ -229,7 +239,7 @@
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
<value>
<string>
draft
</string>
</value>
</item>
</dictionary>
</list>
...
...
@@ -265,7 +275,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
4.53144.2367.52957
</string>
</value>
<value>
<string>
94
5.32448.54149.26265
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -283,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>
14
39192630.9
</float>
<float>
14
41284657.06
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
@@ -342,7 +352,7 @@
</tuple>
<state>
<tuple>
<float>
14
38344898.3
</float>
<float>
14
41284333.1
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_html.xml
View file @
12f12b2d
...
...
@@ -120,9 +120,10 @@
<script
type=
"text/javascript"
src=
"jquery.js"
></script>
\n
<script
type=
"text/javascript"
src=
"rsvp.js"
></script>
\n
<script
type=
"text/javascript"
src=
"renderjs.js"
></script>
\n
<script
src=
"gadget_global.js"
></script>
\n
<script
type=
"text/javascript"
src=
"gadget_global.js"
></script>
\n
<script
type=
"text/javascript"
src=
"jquerymobile.js"
></script>
\n
<script
type=
"text/javascript"
src=
"i18next.js"
></script>
\n
<script
type=
"text/javascript"
src=
"gadget_interfaces.js"
></script>
\n
\n
<!-- specific script -->
\n
<script
type=
"text/javascript"
src=
"editor_test_gadget.js"
></script>
\n
...
...
@@ -139,9 +140,6 @@
<div
data-role=
"fieldcontain"
>
\n
<label
for=
"main_gadget_selector"
>
Main Gadget
</label>
\n
<select
name=
"main_gadget_selector"
class=
"select"
>
\n
<option
value=
"./bootstrap3-wysiwyg.html"
>
Text Editor 2
</option>
\n
<option
value=
"./interface_test_correct_implemented_gadget.html"
>
Dummy Gadget 1
</option>
\n
<option
value=
"./interface_test_multiple_interface_correct_gadget.html"
>
Dummy Gadget 2
</option>
\n
</select>
\n
</div>
\n
<input
data-inline=
"true"
type=
"submit"
value=
"Submit"
data-theme=
"b"
>
\n
...
...
@@ -296,7 +294,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.
2226.34067.1660
5
</string>
</value>
<value>
<string>
945.
32437.8689.3621
5
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -314,7 +312,7 @@
</tuple>
<state>
<tuple>
<float>
14
39471929.19
</float>
<float>
14
41290155.01
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_js.xml
View file @
12f12b2d
...
...
@@ -106,15 +106,8 @@
(function (window, document, rJS, promiseEventListener) {\n
"use strict";\n
\n
var DEFAULT_GADGET_URL = "./bootstrap3-wysiwyg.html",\n
INTERFACE_GADGET_URL = "./gadget_interfaces.html";\n
var DEFAULT_GADGET_URL = "interface_bootstrap3_wysiwyg.html";\n
\n
function declareInterfaceGadget(gadget) {\n
return gadget.declareGadget(INTERFACE_GADGET_URL, {\n
element: gadget.__element,\n
scope: "interface"\n
});\n
}\n
function declareSubGadget(gadget, sub_gadget_url) {\n
return gadget.declareGadget(sub_gadget_url, {\n
sandbox: \'iframe\',\n
...
...
@@ -130,35 +123,31 @@
for(i = 0; i < gadget_option_list.length; i += 1) {\n
gadget_list.push({\n
url: gadget_option_list[i].value,\n
display_name: gadget_option_list[i].inner
Text
\n
display_name: gadget_option_list[i].inner
HTML
\n
});\n
}\n
return gadget_list;\n
}\n
function filterSimilarSubGadgetList(gadget, sub_gadget_url) {\n
var
interface_gadge
t,\n
available_subgadget
_list;\n
var
available_subgadget_lis
t,\n
interface_url
_list;\n
return RSVP.Queue()\n
.push(function() {\n
return gadget.getDeclaredGadget("interface");\n
})\n
.push(function(i_gadget) {\n
interface_gadget = i_gadget;\n
return interface_gadget.getVerifyGadget(sub_gadget_url);\n
return gadget.getVerifyGadget(sub_gadget_url);\n
})\n
.push(function(sub_gadget) {\n
return RSVP.all([\n
interface_
gadget.getDeclaredGadgetInterfaceList(sub_gadget),\n
gadget.getDeclaredGadgetInterfaceList(sub_gadget),\n
getAvailableSubGadgetList(gadget)\n
]);\n
})\n
.push(function(result_data) {\n
var interface_url_list = result_data[0],\n
item,\n
var item,\n
status_list = [];\n
interface_url_list = result_data[0],\n
available_subgadget_list = result_data[1];\n
for(item in available_subgadget_list) {\n
status_list.push(
interface_gadget.verifyGadgetInterfaceList
Implementation(available_subgadget_list[item].url, interface_url_list));\n
status_list.push(
gadget.verifyGadgetInterface
Implementation(available_subgadget_list[item].url, interface_url_list));\n
}\n
return RSVP.all(status_list);\n
})\n
...
...
@@ -172,9 +161,9 @@
return filterSimilarSubGadgetList(gadget, sub_gadget_url);\n
})\n
.push(function(filtered_list) {\n
var select = gadget.props.content_element.querySelector(\'form.similar-gadget-select-form\').similar_gadget_selector;\n
var select = gadget.props.content_element.querySelector(\'form.similar-gadget-select-form\').similar_gadget_selector,\n
i;\n
select.innerHTML = "";\n
var i;\n
for(i = 0; i < filtered_list[1].length; i += 1) {\n
if(filtered_list[1][i]) {\n
var option = document.createElement("option");\n
...
...
@@ -183,10 +172,14 @@
select.appendChild(option);\n
}\n
}\n
select.value = filtered_list[0][0].url;\n
return;\n
});\n
}\n
function gadgetSwitchHandler(gadget) {\n
var current_state = "",\n
selected_gadget,\n
submit_source;\n
return new RSVP.Queue()\n
.push(function() {\n
return RSVP.any([\n
...
...
@@ -203,21 +196,32 @@
]);\n
})\n
.push(function(submit_event) {\n
var submit_source = submit_event.target.className;\n
submit_source = submit_event.target.className;\n
selected_gadget = submit_event.target[0].value;\n
gadget.props.content_element.querySelector("input[type=submit]")\n
.disabled = true;\n
gadget.props.content_element.querySelector("div.ui-content").innerHTML = "";\n
if(submit_source === \'main-gadget-select-form\') {\n
return RSVP.all([\n
declareSubGadget(gadget,submit_event.target[0].value),\n
updateSimilarGadgetOptionList(gadget, submit_event.target[0].value)\n
]);\n
return updateSimilarGadgetOptionList(gadget, selected_gadget);\n
} else {\n
return
declareSubGadget(gadget,submit_event.target[0].value
);\n
return
gadget.subgadget_initStateTransfer(
);\n
}\n
})\n
.push(function(form_data) {\n
gadget.props.content_element.querySelector("div.ui-content").innerHTML = "";\n
if(submit_source === \'similar-gadget-select-form\') {\n
current_state = form_data;\n
} \n
return declareSubGadget(gadget, selected_gadget);\n
})\n
.push(function() {\n
return gadget.subgadget_initSubGadget();\n
})\n
.push(function() {\n
return gadget.editor_setEditor();\n
if(submit_source === \'similar-gadget-select-form\') {\n
return gadget.subgadget_finishStateTransfer([current_state]);\n
} else {\n
return;\n
} \n
})\n
.push(function(){\n
gadget.props.content_element.querySelector("input[type=submit]")\n
...
...
@@ -226,68 +230,82 @@
});\n
}\n
\n
// block JQM auto-start\n
$(document)\n
.on("mobileinit", function () {\n
$.mobile.autoInitializePage = false;\n
});\n
\n
rJS(window)\n
\n
.ready(function (g) {\n
console.log("test gadget ready");\n
g.props = {};\n
return g.getElement()\n
.push(function (element) {\n
$(element).trigger("create");\n
g.props.element = element;\n
g.props.content_element = element.querySelector(\'.gadget-content\');\n
$.getJSON("gadget_info.json", function(data) {\n
var select = g.props.content_element.querySelector(\'form.main-gadget-select-form\').main_gadget_selector,\n
key;\n
select.innerHTML = "";\n
for(key in data) {\n
var option = document.createElement("option");\n
option.text = key;\n
option.value = data[key];\n
select.appendChild(option);\n
}\n
});\n
});\n
})\n
.declareMethod(\'render\', function () {\n
var gadget = this;\n
return new RSVP.Queue()\n
.push(function() {\n
return declareInterfaceGadget(gadget, DEFAULT_GADGET_URL);\n
})\n
.push(function() {\n
return declareSubGadget(gadget, DEFAULT_GADGET_URL);\n
})\n
.push(function() {\n
return gadget.
editor_setEditor
();\n
return gadget.
subgadget_initSubGadget
();\n
})\n
.push(function(){\n
.push(function()
{\n
return gadgetSwitchHandler(gadget);\n
});\n
})\n
\n
/* ============================
EDITOR
=============================== */\n
.declareMethod("
editor
_getContent", function (param_list) {\n
/* ============================
SUBGADGET
=============================== */\n
.declareMethod("
subgadget
_getContent", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (
editor
) {\n
return
editor.getContent.apply(editor
, param_list);\n
.then(function (
sub_gadget
) {\n
return
sub_gadget.getContent.apply(sub_gadget
, param_list);\n
});\n
})\n
.declareMethod("
editor
_setContent", function (param_list) {\n
.declareMethod("
subgadget
_setContent", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (
editor
) {\n
return
editor.setContent.apply(editor
, param_list);\n
.then(function (
sub_gadget
) {\n
return
sub_gadget.setContent.apply(sub_gadget
, param_list);\n
});\n
})\n
.declareMethod("
editor
_clearContent", function (param_list) {\n
.declareMethod("
subgadget
_clearContent", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (
editor
) {\n
return
editor.clearContent.apply(editor
, param_list);\n
.then(function (
sub_gadget
) {\n
return
sub_gadget.clearContent.apply(sub_gadget
, param_list);\n
});\n
})\n
.declareMethod("
editor_setEdito
r", function (param_list) {\n
.declareMethod("
subgadget_initStateTransfe
r", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (editor) {\n
return editor.setEditor.apply(editor, param_list);\n
.then(function (sub_gadget) {\n
return sub_gadget.initStateTransfer.apply(sub_gadget, param_list);\n
});\n
})\n
.declareMethod("subgadget_finishStateTransfer", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (sub_gadget) {\n
return sub_gadget.finishStateTransfer.apply(sub_gadget, param_list);\n
});\n
})\n
.declareMethod("subgadget_initSubGadget", function (param_list) {\n
return this.getDeclaredGadget("sub_gadget")\n
.then(function (sub_gadget) {\n
return sub_gadget.initSubGadget.apply(sub_gadget, param_list);\n
});\n
});\n
\n
}(window, document, rJS, promiseEventListener));
}(window, document, rJS, promiseEventListener));\n
]]>
</string>
</value>
</item>
...
...
@@ -424,7 +442,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.22
25.65299.39441
</string>
</value>
<value>
<string>
945.22
78.56594.14933
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -442,7 +460,7 @@
</tuple>
<state>
<tuple>
<float>
14
39471855.78
</float>
<float>
14
41290071.66
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_correct_implemented_gadget_html.xml
deleted
100644 → 0
View file @
4314f44f
This diff is collapsed.
Click to expand it.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_correct_implemented_gadget_js.xml
deleted
100644 → 0
View file @
4314f44f
This diff is collapsed.
Click to expand it.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_multiple_interface_correct_gadget_html.xml
deleted
100644 → 0
View file @
4314f44f
This diff is collapsed.
Click to expand it.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_test_multiple_interface_correct_gadget_js.xml
deleted
100644 → 0
View file @
4314f44f
This diff is collapsed.
Click to expand it.
bt5/erp5_web_editor_demo/SkinTemplateItem/portal_skins/erp5_rjs_interface_gadgets.xml
0 → 100644
View file @
12f12b2d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
erp5_rjs_interface_gadgets
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
erp5_rjs_interface_gadgets
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_editor_demo/bt/template_keep_last_workflow_history_only_path_list
View file @
12f12b2d
web_page_module/editor*
web_page_module/interface_gadget_interfaces*
web_page_module/interface_test_correct_implemented_gadget*
web_page_module/interface_test_multiple_interface_correct_gadget*
web_page_module/interface_gadget*
web_site_module/editor_demo
web_site_module/editor_demo/**
\ No newline at end of file
bt5/erp5_web_editor_demo/bt/template_keep_workflow_path_list
View file @
12f12b2d
web_page_module/editor*
web_page_module/interface_gadget_interfaces*
web_page_module/interface_test_correct_implemented_gadget*
web_page_module/interface_test_multiple_interface_correct_gadget*
web_page_module/interface_gadget*
web_site_module/editor_demo
web_site_module/editor_demo/**
\ No newline at end of file
bt5/erp5_web_editor_demo/bt/template_path_list
View file @
12f12b2d
web_page_module/editor*
web_page_module/interface_gadget_interfaces*
web_page_module/interface_test_correct_implemented_gadget*
web_page_module/interface_test_multiple_interface_correct_gadget*
web_page_module/interface_gadget*
web_site_module/editor_demo
web_site_module/editor_demo/**
\ No newline at end of file
bt5/erp5_web_editor_demo/bt/template_skin_id_list
0 → 100644
View file @
12f12b2d
erp5_rjs_interface_gadgets
\ No newline at end of file
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