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
c036000b
Commit
c036000b
authored
Feb 25, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
62a9d57f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
43 deletions
+35
-43
dream/platform/static/dream/Input_viewResultComparison.js
dream/platform/static/dream/Input_viewResultComparison.js
+33
-26
dream/platform/static/handsontable/handsontable.js
dream/platform/static/handsontable/handsontable.js
+2
-17
No files found.
dream/platform/static/dream/Input_viewResultComparison.js
View file @
c036000b
...
...
@@ -5,7 +5,7 @@
var
gadget_klass
=
rJS
(
window
);
initGadgetMixin
(
gadget_klass
);
gadget_klass
.
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
).
declareAcquiredMethod
(
"
whoWantsToDisplayThisResult
"
,
"
whoWantsToDisplayThisResult
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
order_lateness
=
{};
var
gadget
=
this
,
order_lateness
=
{}
,
general_json
;
this
.
props
.
jio_key
=
options
.
id
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
...
...
@@ -17,7 +17,8 @@
}
throw
error
;
}).
push
(
function
(
sim_json
)
{
var
result
=
JSON
.
parse
(
sim_json
).
result
,
result_list
=
[],
document_list
=
[],
i
;
var
json
=
JSON
.
parse
(
sim_json
),
result
=
json
.
result
,
result_list
=
[],
document_list
=
[],
i
;
general_json
=
result
;
if
(
result
&&
result
.
result_list
)
{
document_list
=
result
.
result_list
;
}
...
...
@@ -26,39 +27,41 @@
}
return
RSVP
.
all
(
result_list
);
}).
push
(
function
(
result_list
)
{
var
i
,
link
,
result
,
calculateOrderLateness
=
function
(
order_id
)
{
var
i
,
link
,
result
,
scenario_id
,
calculateOrderLateness
=
function
(
order_id
)
{
var
order
=
result
.
order_lateness
[
order_id
];
order
.
link
=
link
;
if
(
!
order_lateness
[
order_id
])
{
order_lateness
[
order_id
]
=
[]
;
order_lateness
[
order_id
]
=
{}
;
}
order_lateness
[
order_id
]
.
push
(
order
)
;
order_lateness
[
order_id
]
[
scenario_id
]
=
order
;
};
for
(
i
=
0
;
i
<
result_list
.
length
;
i
+=
1
)
{
scenario_id
=
result_list
[
i
][
1
].
name
||
i
;
link
=
result_list
[
i
][
0
];
result
=
result_list
[
i
][
1
];
Object
.
keys
(
result
.
order_lateness
).
forEach
(
calculateOrderLateness
);
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
}).
push
(
function
(
tableeditor
)
{
var
i
,
data
=
[],
colHeaders
=
[
"
Project
"
],
columns
=
[
{
data
:
0
var
i
,
data
=
{},
data_list
=
[],
colHeaders
=
[
"
Project
"
],
columns
=
[
{
data
:
"
id
"
}
];
Object
.
keys
(
order_lateness
).
forEach
(
function
(
order_id
)
{
var
order
=
order_lateness
[
order_id
];
order
.
unshift
(
order_id
)
;
data
.
push
(
order
)
;
order
.
id
=
order_id
;
data
[
order_id
]
=
order
;
});
/*jslint unparam: true */
function
orderHtmlRenderer
(
instance
,
td
,
row
,
col
,
prop
,
value
,
cellProperties
)
{
var
a
,
color
=
"
yellow
"
;
if
(
value
)
{
if
(
value
.
delay
<
.
5
)
{
color
=
"
green
"
;
}
if
(
value
.
delay
>
.
5
)
{
color
=
"
red
"
;
}
$
(
td
).
css
({
$
(
td
).
text
(
""
).
css
({
"
background-color
"
:
color
});
a
=
$
(
"
<a>
"
).
attr
(
"
href
"
,
value
.
link
).
text
(
value
.
completionDate
+
"
\n
"
+
(
value
.
delay
||
0
).
toFixed
(
0
)).
css
({
...
...
@@ -66,16 +69,20 @@
"
text-shadow
"
:
"
none
"
});
a
.
appendTo
(
td
);
}
return
td
;
}
for
(
i
=
1
;
i
<
data
[
0
]
.
length
;
i
+=
1
)
{
colHeaders
.
push
(
"
Solution #
"
+
i
);
for
(
i
=
0
;
i
<
general_json
.
result_list
.
length
;
i
+=
1
)
{
colHeaders
.
push
(
general_json
.
result_list
[
i
].
name
||
"
Solution #
"
+
(
i
+
1
)
);
columns
.
push
({
data
:
i
,
data
:
general_json
.
result_list
[
i
].
name
||
i
,
renderer
:
orderHtmlRenderer
});
}
return
tableeditor
.
render
(
JSON
.
stringify
(
data
),
{
Object
.
keys
(
data
).
forEach
(
function
(
order_id
)
{
data_list
.
push
(
order_lateness
[
order_id
]);
});
return
tableeditor
.
render
(
JSON
.
stringify
(
data_list
),
{
colHeaders
:
colHeaders
,
columns
:
columns
,
readOnly
:
true
...
...
dream/platform/static/handsontable/handsontable.js
View file @
c036000b
...
...
@@ -2,25 +2,10 @@
(
function
(
window
,
$
,
rJS
,
JSON
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
).
declareMethod
(
"
render
"
,
function
(
content
,
options
)
{
var
data
=
JSON
.
parse
(
content
),
i
,
ctrlflag
=
true
,
def
=
[];
// if the content is not an array of arrays then create one
// from the content
for
(
i
=
0
;
i
<=
data
.
length
-
1
;
i
+=
1
)
{
if
(
!
(
data
[
i
].
constructor
===
Array
))
{
def
.
push
(
data
[
i
].
name
);
}
else
{
// otherwise do not modify anything
def
=
data
;
ctrlflag
=
false
;
break
;
}
}
if
(
ctrlflag
)
{
def
=
[
def
];
}
var
data
=
JSON
.
parse
(
content
);
return
this
.
getElement
().
push
(
function
(
element
)
{
$
(
element
).
find
(
"
.table-container
"
).
handsontable
(
$
.
extend
({
data
:
d
ef
,
data
:
d
ata
,
stretchH
:
"
all
"
},
options
||
{}));
});
...
...
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