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
Mikolaï Krol
erp5
Commits
9da14a5d
Commit
9da14a5d
authored
Sep 08, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated spreadsheet data model. made state-transfer methods same for all type of gadgets.
parent
65d0dbd8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
82 deletions
+91
-82
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_bootstrap3_wysiwyg_js.xml
...eb_page_module/interface_gadget_bootstrap3_wysiwyg_js.xml
+2
-2
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_chartistjs_js.xml
...teItem/web_page_module/interface_gadget_chartistjs_js.xml
+5
-5
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_chartjs_js.xml
...plateItem/web_page_module/interface_gadget_chartjs_js.xml
+4
-4
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_handsontable_js.xml
...Item/web_page_module/interface_gadget_handsontable_js.xml
+43
-44
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_slickgrid_js.xml
...ateItem/web_page_module/interface_gadget_slickgrid_js.xml
+37
-27
No files found.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_bootstrap3_wysiwyg_js.xml
View file @
9da14a5d
...
@@ -288,7 +288,7 @@
...
@@ -288,7 +288,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.325
16.10981.40311
</string>
</value>
<value>
<string>
945.325
51.59996.17425
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -306,7 +306,7 @@
...
@@ -306,7 +306,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1441
288577.91
</float>
<float>
1441
714251.16
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_chartistjs_js.xml
View file @
9da14a5d
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
var current_state = {},\n
var current_state = {},\n
gadget = this;\n
gadget = this;\n
return RSVP.Queue()\n
return RSVP.Queue()\n
.push(function(){\n
.push(function()
{\n
return gadget.getContent();\n
return gadget.getContent();\n
})\n
})\n
.push(function(content) {\n
.push(function(content) {\n
...
@@ -148,8 +148,8 @@
...
@@ -148,8 +148,8 @@
});\n
});\n
})\n
})\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
return this.setContent(current_state.content);\n
return this.setContent(current_state.content);\n
})\n
})\n
.declareMethod(\'initSubGadget\', function () {\n
.declareMethod(\'initSubGadget\', function () {\n
var data = {\n
var data = {\n
labels: [\'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\'],\n
labels: [\'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\'],\n
...
@@ -303,7 +303,7 @@
...
@@ -303,7 +303,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.3
3714.48637.10274
</string>
</value>
<value>
<string>
945.3
9610.42841.21043
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -321,7 +321,7 @@
...
@@ -321,7 +321,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1441
361996.21
</float>
<float>
1441
714262.07
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_chartjs_js.xml
View file @
9da14a5d
...
@@ -141,7 +141,7 @@
...
@@ -141,7 +141,7 @@
var current_state = {},\n
var current_state = {},\n
gadget = this;\n
gadget = this;\n
return RSVP.Queue()\n
return RSVP.Queue()\n
.push(function(){\n
.push(function()
{\n
return gadget.getContent();\n
return gadget.getContent();\n
})\n
})\n
.push(function(content) {\n
.push(function(content) {\n
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
});\n
});\n
})\n
})\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
return this.setContent(current_state.content);\n
return this.setContent(current_state.content);\n
})\n
})\n
.declareMethod(\'initSubGadget\', function () {\n
.declareMethod(\'initSubGadget\', function () {\n
var gadget = this,\n
var gadget = this,\n
...
@@ -319,7 +319,7 @@
...
@@ -319,7 +319,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.3378
1.46058.13073
</string>
</value>
<value>
<string>
945.3378
8.56308.37819
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -337,7 +337,7 @@
...
@@ -337,7 +337,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1441
364931.54
</float>
<float>
1441
714291.87
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_handsontable_js.xml
View file @
9da14a5d
...
@@ -109,10 +109,46 @@
...
@@ -109,10 +109,46 @@
\n
\n
rJS(window)\n
rJS(window)\n
.declareMethod(\'getContent\', function () {\n
.declareMethod(\'getContent\', function () {\n
var gadget = this;\n
var gadget = this,\n
return gadget.props.hot.getData();\n
temp_data = gadget.props.hot.getData(),\n
temp_columns = gadget.props.hot.getColHeader(),\n
data = [],\n
columns = [],\n
content = {},\n
i, j;\n
for(i = 0; i < temp_columns.length; i += 1) {\n
var title = (temp_columns[i] === null ? \'\' : temp_columns[i]);\n
columns.push({\n
title: title\n
});\n
}\n
for(i = 0; i < temp_data.length; i += 1) {\n
var d = (data[i] = {}),\n
temp_row = temp_data[i];\n
for(j = 0; j < temp_row.length; j += 1) { \n
d[j] = temp_row[j];\n
}\n
}\n
content.columns = columns;\n
content.data = data;\n
return content;\n
})\n
})\n
.declareMethod(\'setContent\', function (content) {\n
.declareMethod(\'setContent\', function (content) {\n
var gadget = this,\n
temp_columns = content.columns,\n
temp_data = content.data,\n
hot = gadget.props.hot,\n
data = [],\n
temp_row = [],\n
i, j;\n
for(i = 0; i < temp_data.length; i += 1) {\n
var d = (data[i] = []);\n
temp_row = temp_data[i];\n
for(j = 0; j < Object.keys(temp_row).length; j += 1) {\n
d.push(temp_row[j]);\n
}\n
}\n
hot.loadData(data);\n
return;\n
return;\n
})\n
})\n
.declareMethod(\'clearContent\', function () {\n
.declareMethod(\'clearContent\', function () {\n
...
@@ -126,52 +162,15 @@
...
@@ -126,52 +162,15 @@
return gadget.getContent();\n
return gadget.getContent();\n
})\n
})\n
.push(function(content) {\n
.push(function(content) {\n
var columns = [],\n
current_state.content = content;\n
data = [],\n
temp_columns = content[0],\n
temp_row, \n
i, j;\n
for(i = 0; i < temp_columns.length; i += 1) {\n
var title = (temp_columns[i] === null ? \'\' : temp_columns[i]);\n
columns.push({\n
title: title\n
});\n
}\n
for(i = 1; i < content.length; i += 1) {\n
var d = (data[i - 1] = {});\n
temp_row = content[i];\n
for(j = 0; j < temp_row.length; j += 1) { \n
d[j] = temp_row[j];\n
}\n
}\n
current_state.columns = columns;\n
current_state.content = data;\n
return current_state;\n
return current_state;\n
});\n
});\n
})\n
})\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
.declareMethod(\'finishStateTransfer\', function (current_state) {\n
var gadget = this,\n
return this.setContent(current_state.content);\n
content = current_state.content,\n
temp_columns = current_state.columns,\n
hot = gadget.props.hot,\n
data = [],\n
temp_row = [],\n
i, j;\n
for(i = 0; i < temp_columns.length; i += 1) {\n
temp_row.push(temp_columns[i].title);\n
}\n
data.push(temp_row);\n
for(i = 0; i < content.length; i += 1) {\n
var d = (data[i + 1] = []);\n
temp_row = content[i];\n
for(j = 0; j < Object.keys(temp_row).length; j += 1) {\n
d.push(temp_row[j]);\n
}\n
}\n
hot.loadData(data);\n
return;\n
})\n
})\n
.declareMethod(\'initSubGadget\', function () {\n
.declareMethod(\'initSubGadget\', function () {\n
// hard coded data for demo purpose.\n
var data = [["", "Ford", "Volvo", "Toyota", "Honda"],\n
var data = [["", "Ford", "Volvo", "Toyota", "Honda"],\n
["2014", 10, 11, 12, 13],\n
["2014", 10, 11, 12, 13],\n
["2015", 20, 11, 14, 13],\n
["2015", 20, 11, 14, 13],\n
...
@@ -329,7 +328,7 @@
...
@@ -329,7 +328,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.3
2551.63779.1708
3
</string>
</value>
<value>
<string>
945.3
9661.40347.6386
3
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -347,7 +346,7 @@
...
@@ -347,7 +346,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1441
293672.51
</float>
<float>
1441
717677.15
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/interface_gadget_slickgrid_js.xml
View file @
9da14a5d
...
@@ -102,10 +102,10 @@
...
@@ -102,10 +102,10 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*jslint indent: 2 */\n
/*jslint indent: 2 */\n
/*global window, jQuery, rJS, Slick*/\n
/*global window, jQuery, rJS,
RSVP,
Slick*/\n
"use strict";\n
"use strict";\n
\n
\n
(function (window, $, rJS, Slick) {\n
(function (window, $, rJS,
RSVP,
Slick) {\n
\n
\n
function requiredFieldValidator(value) {\n
function requiredFieldValidator(value) {\n
if (value === null || value === undefined || !value.length) {\n
if (value === null || value === undefined || !value.length) {\n
...
@@ -123,27 +123,15 @@
...
@@ -123,27 +123,15 @@
} else {\n
} else {\n
return letter;\n
return letter;\n
}\n
}\n
}\n
}\n
\n
\n
rJS(window).\n
rJS(window).\n
declareMethod(\'getContent\', function () {\n
declareMethod(\'getContent\', function () {\n
return this.props.grid.getData();\n
})\n
\n
.declareMethod(\'setContent\', function (content) {\n
return;\n
})\n
\n
.declareMethod(\'clearContent\', function () {\n
return;\n
})\n
\n
.declareMethod(\'initStateTransfer\', function () {\n
var gadget = this,\n
var gadget = this,\n
current_state = {},\n
grid = gadget.props.grid,\n
grid = gadget.props.grid,\n
temp_data = grid.getData(),\n
temp_data = grid.getData(),\n
temp_columns = grid.getColumns(),\n
temp_columns = grid.getColumns(),\n
content = {},\n
columns = [],\n
columns = [],\n
data = [],\n
data = [],\n
column_index_dict = {},\n
column_index_dict = {},\n
...
@@ -165,15 +153,15 @@
...
@@ -165,15 +153,15 @@
d[column_index_dict[item]]
=
temp_row[item];\n
d[column_index_dict[item]]
=
temp_row[item];\n
}\n
}\n
}\n
}\n
c
urrent_state
.columns =
columns;\n
c
ontent
.columns =
columns;\n
c
urrent_state.content
=
data;\n
c
ontent.data
=
data;\n
return
c
urrent_state
;\n
return
c
ontent
;\n
})\n
})\n
\n
\n
.declareMethod(\'
finishStateTransfer\',
function
(current_state
)
{\n
.declareMethod(\'
setContent\',
function
(content
)
{\n
var
gadget =
this,\n
var
gadget =
this,\n
content =
current_state.content
,\n
temp_columns =
content.columns
,\n
temp_
columns =
current_state.columns
,\n
temp_
data =
content.data
,\n
grid =
gadget.props.grid,\n
grid =
gadget.props.grid,\n
columns =
[],\n
columns =
[],\n
data =
[],\n
data =
[],\n
...
@@ -188,9 +176,9 @@
...
@@ -188,9 +176,9 @@
"editor":
Slick.Editors.Text
\n
"editor":
Slick.Editors.Text
\n
});\n
});\n
}\n
}\n
for(
i =
0;
i
<
content
.length;
i
+=
1)
{\n
for(
i =
0;
i
<
temp_data
.length;
i
+=
1)
{\n
var
d =
(data[i]
=
{});\n
var
d =
(data[i]
=
{});\n
temp_row =
content
[i];\n
temp_row =
temp_data
[i];\n
for(
j =
0;
j
<
Object.keys(temp_row).length;
j
+=
1)
{\n
for(
j =
0;
j
<
Object.keys(temp_row).length;
j
+=
1)
{\n
d[columns[j].field]
=
temp_row[j];\n
d[columns[j].field]
=
temp_row[j];\n
}\n
}\n
...
@@ -200,6 +188,28 @@
...
@@ -200,6 +188,28 @@
grid.render();\n
grid.render();\n
return;\n
return;\n
})\n
})\n
\n
.declareMethod(\'clearContent\',
function
()
{\n
return;\n
})\n
\n
.declareMethod(\'initStateTransfer\',
function
()
{\n
var
current_state =
{},\n
gadget =
this;\n
return
RSVP.Queue()\n
.push(function()
{\n
return
gadget.getContent();\n
})\n
.push(function(content)
{\n
current_state.content =
content;\n
return
current_state;\n
});\n
})\n
\n
.declareMethod(\'finishStateTransfer\',
function
(current_state)
{\n
return
this.setContent(current_state.content);\n
})\n
\n
.declareMethod(\'initSubGadget\',
function
()
{\n
.declareMethod(\'initSubGadget\',
function
()
{\n
var
gadget =
this;\n
var
gadget =
this;\n
var
grid,\n
var
grid,\n
...
@@ -242,7 +252,7 @@
...
@@ -242,7 +252,7 @@
g.props =
{};\n
g.props =
{};\n
});\n
});\n
\n
\n
}(window,
jQuery,
rJS,
Slick));\n
}(window,
jQuery,
rJS,
RSVP,
Slick));\n
]]
></string>
</value>
]]
></string>
</value>
...
@@ -380,7 +390,7 @@
...
@@ -380,7 +390,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.3
3860.24768.49083
</string>
</value>
<value>
<string>
945.3
9646.6878.42018
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -398,7 +408,7 @@
...
@@ -398,7 +408,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1441
369486.01
</float>
<float>
1441
716413.3
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</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