Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
nexedi
dream
Commits
666bc534
Commit
666bc534
authored
Jun 05, 2014
by
Romain Courteaud
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display spreadsheet with handsontable.
parent
1d3ff25a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
23 deletions
+60
-23
Gruntfile.js
Gruntfile.js
+2
-2
dream/platform/src/index.html
dream/platform/src/index.html
+0
-4
dream/platform/src/src/dream_launcher.js
dream/platform/src/src/dream_launcher.js
+6
-6
dream/platform/src2/dream/edit_table.html
dream/platform/src2/dream/edit_table.html
+2
-1
dream/platform/src2/dream/edit_table.js
dream/platform/src2/dream/edit_table.js
+22
-6
dream/platform/src2/handsontable/handsontable.js
dream/platform/src2/handsontable/handsontable.js
+28
-4
No files found.
Gruntfile.js
View file @
666bc534
...
...
@@ -198,13 +198,13 @@ module.exports = function (grunt) {
},
handsontablejs
:
{
src
:
'
https://raw.githubusercontent.com/warpech/
'
+
'
jquery-handsontable/v0.10.5/dist/jquery.handsontable.js
'
,
'
jquery-handsontable/v0.10.5/dist/jquery.handsontable.
full.
js
'
,
relative_dest
:
'
lib/handsontable.js
'
,
dest
:
'
<%= global_config.dest %>/<%= curl.handsontablejs.relative_dest %>
'
},
handsontablecss
:
{
src
:
'
https://raw.githubusercontent.com/warpech/
'
+
'
jquery-handsontable/v0.10.5/dist/jquery.handsontable.css
'
,
'
jquery-handsontable/v0.10.5/dist/jquery.handsontable.
full.
css
'
,
relative_dest
:
'
lib/handsontable.css
'
,
dest
:
'
<%= global_config.dest %>/<%= curl.handsontablecss.relative_dest %>
'
// },
...
...
dream/platform/src/index.html
View file @
666bc534
...
...
@@ -8,7 +8,6 @@
<link
rel=
"stylesheet"
href=
"css/skeleton_wide.css"
>
<link
rel=
"stylesheet"
href=
"css/layout.css"
>
<link
rel=
"stylesheet"
href=
"css/jquery-ui-1.10.3.custom.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/jquery.handsontable.full.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"lib/dhtmlxgantt/dhtmlxgantt.css"
>
<link
rel=
"stylesheet"
href=
"css/demo-new.css"
>
<link
rel=
"stylesheet"
href=
"css/font-awesome.css"
>
...
...
@@ -132,9 +131,6 @@
<script
type=
"text/javascript"
src=
"lib/jquery.flot.js"
></script>
<script
type=
"text/javascript"
src=
"lib/jquery.flot.stack.js"
></script>
<!-- spreadsheet -->
<script
type=
"text/javascript"
src=
"lib/jquery.handsontable.full.js"
></script>
<!-- gantt chart -->
<script
type=
"text/javascript"
src=
"lib/dhtmlxgantt/dhtmlxgantt.js"
></script>
...
...
dream/platform/src/src/dream_launcher.js
View file @
666bc534
...
...
@@ -75,12 +75,12 @@
}
try
{
// spreadsheets
var
shift_spreadsheet_data
=
data
.
shift_spreadsheet
;
if
(
shift_spreadsheet_data
!==
undefined
)
{
var
spreadsheet
=
$
(
'
#shift_spreadsheet
'
);
spreadsheet
.
handsontable
(
'
populateFromArray
'
,
0
,
0
,
shift_spreadsheet_data
);
}
//
// spreadsheets
//
var shift_spreadsheet_data = data.shift_spreadsheet;
//
if (shift_spreadsheet_data !== undefined) {
//
var spreadsheet = $('#shift_spreadsheet');
//
spreadsheet.handsontable('populateFromArray', 0, 0, shift_spreadsheet_data);
//
}
var
wip_part_spreadsheet_data
=
data
.
wip_part_spreadsheet
;
if
(
wip_part_spreadsheet_data
!==
undefined
)
{
var
spreadsheet
=
$
(
'
#wip_part_spreadsheet
'
);
...
...
dream/platform/src2/dream/edit_table.html
View file @
666bc534
...
...
@@ -11,6 +11,7 @@
<script
src=
"edit_table.js"
type=
"text/javascript"
></script>
</head>
<body>
<section
class=
"document_list"
></section>
<div
data-gadget-url=
"../handsontable/index.html"
data-gadget-scope=
"tableeditor"
></div>
</body>
</html>
dream/platform/src2/dream/edit_table.js
View file @
666bc534
...
...
@@ -33,12 +33,28 @@
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
return
gadget
.
aq_getAttachment
({
"
_id
"
:
jio_key
,
"
_attachment
"
:
"
body.json
"
})
.
push
(
function
(
result
)
{
gadget
.
props
.
element
.
textContent
=
result
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
aq_getAttachment
({
"
_id
"
:
jio_key
,
"
_attachment
"
:
"
body.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
})
.
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
shift_spreadsheet
)
);
});
})
.
declareMethod
(
"
startService
"
,
function
()
{
return
this
.
getDeclaredGadget
(
"
tableeditor
"
)
.
push
(
function
(
tableeditor
)
{
return
tableeditor
.
startService
();
});
});
}(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
));
dream/platform/src2/handsontable/handsontable.js
View file @
666bc534
/*global jQuery, rJS, window, JSON */
/*global jQuery, rJS, window, JSON
, RSVP
*/
(
function
(
window
,
$
,
rJS
,
JSON
)
{
(
function
(
window
,
$
,
rJS
,
JSON
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -9,7 +9,14 @@
return
this
.
getElement
()
.
push
(
function
(
element
)
{
$
(
element
).
find
(
'
.table-container
'
)
.
handsontable
({
data
:
data
});
.
handsontable
({
data
:
data
,
minSpareRows
:
1
,
stretchH
:
'
all
'
// afterChange: function () {
// priv.onDataChange();
// }
});
});
})
...
...
@@ -20,5 +27,22 @@
.
handsontable
(
'
getData
'
);
return
JSON
.
stringify
(
data
);
});
})
.
declareMethod
(
"
startService
"
,
function
()
{
var
gadget_element
;
return
this
.
getElement
()
.
push
(
function
(
element
)
{
gadget_element
=
element
;
$
(
element
).
find
(
'
.table-container
'
).
handsontable
(
"
render
"
);
})
.
push
(
function
()
{
// Infinite wait, until cancelled
return
(
new
RSVP
.
defer
()).
promise
;
})
.
push
(
undefined
,
function
(
error
)
{
$
(
gadget_element
).
find
(
'
.table-container
'
).
handsontable
(
"
destroy
"
);
throw
error
;
});
});
}(
window
,
jQuery
,
rJS
,
JSON
));
}(
window
,
jQuery
,
rJS
,
JSON
,
RSVP
));
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