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
427593de
Commit
427593de
authored
Dec 12, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static
parent
f5363e77
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
429 additions
and
123 deletions
+429
-123
dream/platform/static/dream/Input_viewSpreadsheet.html
dream/platform/static/dream/Input_viewSpreadsheet.html
+23
-0
dream/platform/static/dream/Input_viewSpreadsheet.js
dream/platform/static/dream/Input_viewSpreadsheet.js
+67
-0
dream/platform/static/expandable_field/expandablefield.js
dream/platform/static/expandable_field/expandablefield.js
+312
-114
dream/platform/static/fieldset/fieldset.js
dream/platform/static/fieldset/fieldset.js
+13
-0
dream/platform/static/jsplumb/jsplumb.js
dream/platform/static/jsplumb/jsplumb.js
+14
-9
No files found.
dream/platform/static/dream/Input_viewSpreadsheet.html
0 → 100644
View file @
427593de
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Edit Shift Spreadsheet
</title>
<script
src=
"../lib/rsvp.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/renderjs.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/jquery.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/jquerymobile.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_gadget.js"
type=
"text/javascript"
></script>
<script
src=
"Input_viewShiftSpreadsheet.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
data-gadget-url=
"../handsontable/index.html"
data-gadget-scope=
"tableeditor"
></div>
<form
class=
"save_form"
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right"
>
Save
</button>
</form>
</body>
</html>
dream/platform/static/dream/Input_viewSpreadsheet.js
0 → 100644
View file @
427593de
/*global rJS, RSVP, initGadgetMixin, loopEventListener */
(
function
(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
)
{
"
use strict
"
;
function
saveSpreadsheet
(
evt
)
{
var
gadget
=
this
,
editor_data
,
editor_gadget
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
// Prevent double click
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
}).
push
(
function
(
tablegadget
)
{
editor_gadget
=
tablegadget
;
return
editor_gadget
.
getData
();
}).
push
(
function
(
data
)
{
editor_data
=
data
;
// Always get a fresh version, to prevent deleting spreadsheet & co
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
});
}).
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
);
data
.
shift_spreadsheet
=
JSON
.
parse
(
editor_data
);
return
gadget
.
aq_putAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
,
_data
:
JSON
.
stringify
(
data
,
null
,
2
),
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
return
loopEventListener
(
gadget
.
props
.
element
.
getElementsByClassName
(
"
save_form
"
)[
0
],
"
submit
"
,
false
,
saveSpreadsheet
.
bind
(
gadget
));
}
var
gadget_klass
=
rJS
(
window
);
initGadgetMixin
(
gadget_klass
);
gadget_klass
.
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
).
declareAcquiredMethod
(
"
aq_putAttachment
"
,
"
jio_putAttachment
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
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
),
{
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
var
gadget
=
this
;
return
this
.
getDeclaredGadget
(
"
tableeditor
"
).
push
(
function
(
tableeditor
)
{
return
RSVP
.
all
([
tableeditor
.
startService
(),
waitForSave
(
gadget
)
]);
});
});
})(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
);
\ No newline at end of file
dream/platform/static/expandable_field/expandablefield.js
View file @
427593de
This diff is collapsed.
Click to expand it.
dream/platform/static/fieldset/fieldset.js
View file @
427593de
...
...
@@ -100,6 +100,7 @@
});
return
queue
;
}).
declareMethod
(
"
getContent
"
,
function
()
{
console
.
log
(
"
GET CONTENT SIMPLE FIELDSET
"
);
var
i
,
promise_list
=
[],
gadget
=
this
;
for
(
i
=
0
;
i
<
this
.
props
.
field_gadget_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
this
.
props
.
field_gadget_list
[
i
].
getContent
());
...
...
@@ -118,7 +119,19 @@
}
}
}
console
.
log
(
"
GET CONTENT SIMPLE FIELDSET 2
"
);
console
.
log
(
result
);
return
result
;
});
}).
declareMethod
(
"
startService
"
,
function
()
{
console
.
log
(
"
startservice FIElDSET 1
"
);
var
gadget
=
this
,
i
,
promise_list
=
[];
for
(
i
=
0
;
i
<
gadget
.
props
.
field_gadget_list
.
length
;
i
+=
1
)
{
if
(
gadget
.
props
.
field_gadget_list
[
i
].
startService
)
{
promise_list
.
push
(
gadget
.
props
.
field_gadget_list
[
i
].
startService
());
}
}
console
.
log
(
"
there are
"
+
promise_list
.
length
+
"
subgadget promises
"
);
return
RSVP
.
all
(
promise_list
);
});
})(
window
,
rJS
,
RSVP
,
Handlebars
,
initGadgetMixin
);
\ No newline at end of file
dream/platform/static/jsplumb/jsplumb.js
View file @
427593de
...
...
@@ -470,19 +470,24 @@
property_definition
:
schema
},
node_id
)
]);
}).
push
(
function
(
fieldset_gadget
)
{
node_edit_popup
.
enhanceWithin
();
node_edit_popup
.
popup
(
"
open
"
);
return
fieldset_gadget
[
0
];
console
.
log
(
fieldset_gadget
[
0
]);
return
RSVP
.
Queue
().
push
(
function
()
{
console
.
log
(
fieldset_gadget
[
0
]);
fieldset_gadget
[
0
].
startService
();
}).
push
(
function
()
{
console
.
log
(
"
:::::::::::::::::::::::::::
"
);
console
.
log
(
fieldset_gadget
);
console
.
log
(
"
:::::::::::::::::::::::::::
"
);
node_edit_popup
.
enhanceWithin
();
node_edit_popup
.
popup
(
"
open
"
);
return
fieldset_gadget
[
0
];
});
}).
push
(
function
(
fieldset_gadget
)
{
// Expose the dialog handling promise so that we can wait for it in
// test.
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
=======:::::::::::::::::::=======
"
);
console
.
log
(
fieldset_gadget
);
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
:::::::::::::::::::2
"
);
console
.
log
(
"
=======:::::::::::::::::::=======
"
);
gadget
.
props
.
dialog_promise
=
RSVP
.
any
([
save_promise
(
fieldset_gadget
,
node_id
),
delete_promise
]);
return
gadget
.
props
.
dialog_promise
;
}).
push
(
function
()
{
...
...
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