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
f2744263
Commit
f2744263
authored
Aug 11, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
static version
parent
b4875f4e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
18 deletions
+33
-18
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.html
.../static/dream/Input_viewAvailableCapacitySpreadsheet.html
+1
-1
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.js
...rm/static/dream/Input_viewAvailableCapacitySpreadsheet.js
+3
-2
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.html
...m/static/dream/Input_viewRequiredCapacitySpreadsheet.html
+1
-1
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.js
...orm/static/dream/Input_viewRequiredCapacitySpreadsheet.js
+2
-3
dream/platform/static/fieldset/fieldset.js
dream/platform/static/fieldset/fieldset.js
+22
-9
dream/platform/static/jsplumb/index.html
dream/platform/static/jsplumb/index.html
+1
-1
dream/platform/static/jsplumb/jsplumb.js
dream/platform/static/jsplumb/jsplumb.js
+3
-1
No files found.
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.html
View file @
f2744263
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Edit
Available
Capacity Spreadsheet
</title>
<title>
Edit
Required
Capacity 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>
...
...
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.js
View file @
f2744263
...
...
@@ -19,7 +19,7 @@
});
}).
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
);
data
.
capacity_by_
project
_spreadsheet
=
JSON
.
parse
(
editor_data
);
data
.
capacity_by_
station
_spreadsheet
=
JSON
.
parse
(
editor_data
);
return
gadget
.
aq_putAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
,
...
...
@@ -44,7 +44,8 @@
_attachment
:
"
body.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
capacity_by_project_spreadsheet
),
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
capacity_by_station_spreadsheet
),
{
minSpareCols
:
1
,
minSpareRows
:
1
});
});
...
...
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.html
View file @
f2744263
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Edit
Required
Capacity Spreadsheet
</title>
<title>
Edit
Available
Capacity 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>
...
...
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.js
View file @
f2744263
...
...
@@ -19,7 +19,7 @@
});
}).
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
);
data
.
capacity_by_
station
_spreadsheet
=
JSON
.
parse
(
editor_data
);
data
.
capacity_by_
project
_spreadsheet
=
JSON
.
parse
(
editor_data
);
return
gadget
.
aq_putAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
,
...
...
@@ -44,8 +44,7 @@
_attachment
:
"
body.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
capacity_by_station_spreadsheet
),
{
minSpareCols
:
1
,
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
capacity_by_project_spreadsheet
),
{
minSpareRows
:
1
});
});
...
...
dream/platform/static/fieldset/fieldset.js
View file @
f2744263
...
...
@@ -9,16 +9,24 @@
// Precompile the templates while loading the first gadget instance
var
gadget_klass
=
rJS
(
window
),
source
=
gadget_klass
.
__template_element
.
getElementById
(
"
label-template
"
).
innerHTML
,
label_template
=
Handlebars
.
compile
(
source
);
initGadgetMixin
(
gadget_klass
);
gadget_klass
.
declareMethod
(
"
render
"
,
function
(
property_list
,
data
)
{
gadget_klass
.
declareMethod
(
"
render
"
,
function
(
property_list
,
data
,
key
)
{
var
gadget
=
this
,
queue
,
value
,
property
;
gadget
.
key
=
key
;
// used for recursive fieldsets
gadget
.
props
.
field_gadget_list
=
[];
function
addField
(
property
,
value
)
{
var
sub_gadget
;
queue
.
push
(
function
()
{
// XXX this is incorrect for recursive fieldsets.
// we should use nested fieldset with legend
gadget
.
props
.
element
.
insertAdjacentHTML
(
"
beforeend
"
,
label_template
({
"
for
"
:
property
.
id
,
name
:
property
.
name
||
property
.
id
}));
if
(
property
.
_class
===
"
Dream.PropertyList
"
)
{
// Create a recursive fieldset for this key.
return
gadget
.
declareGadget
(
"
../fieldset/index.html
"
);
}
if
(
property
.
type
===
"
number
"
)
{
return
gadget
.
declareGadget
(
"
../number_field/index.html
"
);
}
...
...
@@ -27,9 +35,13 @@
}
return
gadget
.
declareGadget
(
"
../string_field/index.html
"
);
}).
push
(
function
(
gg
)
{
var
choice
=
property
.
choice
||
[],
default_opt
=
choice
[
0
]
?
[
choice
[
0
][
1
]
]
:
[
""
];
sub_gadget
=
gg
;
var
choice
=
property
.
choice
||
[],
default_opt
=
choice
[
0
]
?
[
choice
[
0
][
1
]
]
:
[
""
];
value
=
data
[
property
.
id
]
===
undefined
?
value
:
data
[
property
.
id
];
if
(
gg
.
__title
===
"
Fieldset
"
)
{
// XXX there must be a better way instead of using __title ?
return
gg
.
render
(
property
.
property_list
,
value
,
property
.
id
);
}
return
sub_gadget
.
render
({
field_json
:
{
title
:
property
.
description
||
""
,
...
...
@@ -49,26 +61,27 @@
queue
=
new
RSVP
.
Queue
().
push
(
function
()
{
Object
.
keys
(
property_list
).
forEach
(
function
(
i
)
{
property
=
property_list
[
i
];
if
(
property
.
_class
===
"
Dream.Property
"
)
{
value
=
property
.
_default
||
""
;
addField
(
property
,
value
);
}
value
=
property
.
_default
||
""
;
addField
(
property
,
value
);
});
});
return
queue
;
}).
declareMethod
(
"
getContent
"
,
function
()
{
var
i
,
promise_list
=
[];
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
());
}
return
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
(
promise_list
);
}).
push
(
function
(
result_list
)
{
var
name
,
result
=
{};
var
name
,
result
=
{},
content
=
result
;
if
(
gadget
.
key
)
{
content
=
result
[
gadget
.
key
]
=
{};
}
for
(
i
=
0
;
i
<
result_list
.
length
;
i
+=
1
)
{
for
(
name
in
result_list
[
i
])
{
if
(
result_list
[
i
].
hasOwnProperty
(
name
))
{
resul
t
[
name
]
=
result_list
[
i
][
name
];
conten
t
[
name
]
=
result_list
[
i
][
name
];
}
}
}
...
...
dream/platform/static/jsplumb/index.html
View file @
f2744263
...
...
@@ -24,7 +24,7 @@
<template
id=
"popup-edit-template"
>
<div
id=
"node-edit-popup"
data-position-to=
"origin"
>
<div
data-role=
"header"
data-theme=
"a"
>
<h1>
Node edition
</h1>
<h1
class=
"node_class"
>
Node edition
</h1>
<a
href=
"#"
data-rel=
"back"
class=
"ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right"
>
Close
</a>
</div>
<br/>
...
...
dream/platform/static/jsplumb/jsplumb.js
View file @
f2744263
...
...
@@ -364,6 +364,8 @@
}
gadget
.
props
.
element
.
appendChild
(
document
.
importNode
(
popup_edit_template
.
content
,
true
).
children
[
0
]);
node_edit_popup
=
$
(
gadget
.
props
.
element
).
find
(
"
#node-edit-popup
"
);
// Set the name of the popup to the node class
node_edit_popup
.
find
(
"
.node_class
"
).
text
(
node_data
.
_class
);
fieldset_element
=
node_edit_popup
.
find
(
"
fieldset
"
)[
0
];
node_edit_popup
.
popup
();
node_data
.
id
=
node_id
;
...
...
@@ -442,7 +444,7 @@
"
class
"
:
element
.
_class
.
replace
(
"
.
"
,
"
-
"
),
element_id
:
element
.
element_id
,
title
:
element
.
name
||
element
.
id
,
name
:
element
.
name
name
:
element
.
name
||
element
.
id
}),
"
text/html
"
).
querySelector
(
"
.window
"
);
render_element
.
append
(
domElement
);
waitForNodeClick
(
gadget
,
domElement
,
configuration
);
...
...
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