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
0e6d6eca
Commit
0e6d6eca
authored
Jan 20, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
a0b568dd
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1117 additions
and
1758 deletions
+1117
-1758
dream/platform/static/dream/InputModule_viewInputList.js
dream/platform/static/dream/InputModule_viewInputList.js
+0
-2
dream/platform/static/dream/Input_viewResultList.js
dream/platform/static/dream/Input_viewResultList.js
+1
-1
dream/platform/static/dream/index.html
dream/platform/static/dream/index.html
+2
-3
dream/platform/static/dream/index.js
dream/platform/static/dream/index.js
+138
-158
dream/platform/static/fieldset/fieldset.js
dream/platform/static/fieldset/fieldset.js
+6
-81
dream/platform/static/jsplumb/jsplumb.js
dream/platform/static/jsplumb/jsplumb.js
+18
-329
dream/platform/static/lib/handlebars.min.js
dream/platform/static/lib/handlebars.min.js
+3
-3
dream/platform/static/lib/jio.js
dream/platform/static/lib/jio.js
+1
-24
dream/platform/static/lib/qunit.css
dream/platform/static/lib/qunit.css
+7
-7
dream/platform/static/lib/qunit.js
dream/platform/static/lib/qunit.js
+929
-1136
dream/platform/static/toolbox/toolbox.js
dream/platform/static/toolbox/toolbox.js
+12
-14
No files found.
dream/platform/static/dream/InputModule_viewInputList.js
View file @
0e6d6eca
...
...
@@ -11,8 +11,6 @@
gadget_klass
.
declareAcquiredMethod
(
"
aq_allDocs
"
,
"
jio_allDocs
"
).
declareAcquiredMethod
(
"
pleaseRedirectMyHash
"
,
"
pleaseRedirectMyHash
"
).
declareAcquiredMethod
(
"
whoWantsToDisplayThisDocument
"
,
"
whoWantsToDisplayThisDocument
"
).
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
;
return
gadget
.
aq_allDocs
({
include_docs
:
true
,
query
:
'
type:= "Dream"
'
,
select_list
:
[
"
title
"
,
"
modified
"
]
}).
push
(
function
(
document_list
)
{
var
result_list
=
[],
doc
,
i
;
...
...
dream/platform/static/dream/Input_viewResultList.js
View file @
0e6d6eca
...
...
@@ -21,7 +21,7 @@
}
throw
error
;
}).
push
(
function
(
sim_json
)
{
var
document
=
JSON
.
parse
(
sim_json
),
document_list
=
[]
,
result_list
=
[],
i
;
var
document
_list
=
JSON
.
parse
(
sim_json
)
,
result_list
=
[],
i
;
if
(
document
.
result
)
{
if
(
document
.
result
.
result_list
)
{
document_list
=
document
.
result
.
result_list
;
...
...
dream/platform/static/dream/index.html
View file @
0e6d6eca
...
...
@@ -18,9 +18,8 @@
<script
id=
"panel-template"
type=
"text/x-handlebars-template"
>
<
ul
data
-
role
=
"
listview
"
>
<
li
><
a
class
=
"
pre_input_link ui-btn ui-icon-grid ui-btn-icon-left
"
data
-
icon
=
"
grid
"
>
Documents
<
/a></
li
>
<!--
li
><
a
class
=
"
home_link ui-btn ui-icon-home ui-btn-icon-left
"
data
-
icon
=
"
home
"
>
Documents
<
/a></
li
-->
<!--
li
><
a
class
=
"
fast_input_link ui-btn ui-icon-plus ui-btn-icon-left
"
data
-
icon
=
"
plus
"
>
New
Document
<
/a></
li
-->
<
li
><
a
class
=
"
home_link ui-btn ui-icon-home ui-btn-icon-left
"
data
-
icon
=
"
home
"
>
Documents
<
/a></
li
>
<
li
><
a
class
=
"
fast_input_link ui-btn ui-icon-plus ui-btn-icon-left
"
data
-
icon
=
"
plus
"
>
New
Document
<
/a></
li
>
{{
#
navigationlist
}}
<
li
><
a
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
{{
/
navigationlist
}}
...
...
dream/platform/static/dream/index.js
View file @
0e6d6eca
This diff is collapsed.
Click to expand it.
dream/platform/static/fieldset/fieldset.js
View file @
0e6d6eca
/*global rJS, RSVP, jQuery, Handlebars,
promiseEventListener, initGadgetMixin
, console
*/
promiseEventListener, initGadgetMixin*/
/*jslint nomen: true */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
initGadgetMixin
)
{
"
use strict
"
;
...
...
@@ -13,9 +13,6 @@
// XXX node_id is added like a property so that one can change the node
// id
var
gadget
=
this
,
queue
;
console
.
log
(
"
FIELDSET RENDER 1
"
);
console
.
log
(
options
);
console
.
log
(
node_id
);
gadget
.
props
.
key
=
options
.
key
;
// used for recursive fieldsets
gadget
.
props
.
field_gadget_list
=
[];
...
...
@@ -24,27 +21,10 @@
queue
.
push
(
function
()
{
// XXX this is incorrect for recursive fieldsets.
// we should use nested fieldset with legend
console
.
log
(
"
insertingAdjacentHTML for:
"
+
property_id
);
gadget
.
props
.
element
.
insertAdjacentHTML
(
"
beforeend
"
,
label_template
({
"
for
"
:
property_id
,
name
:
property_definition
.
name
||
property_id
name
:
property_definition
.
name
||
property_
definition
.
description
||
property_
id
}));
console
.
log
(
"
....................
"
);
console
.
log
(
property_id
);
console
.
log
(
property_definition
);
console
.
log
(
value
);
// XXX maybe type should be used instead
if
(
property_definition
.
allOf
)
{
// if there is type property then remove it
if
(
property_definition
.
allOf
[
0
].
type
)
{
delete
property_definition
.
allOf
[
0
].
type
;
}
return
gadget
.
declareGadget
(
"
../expandable_field/index.html
"
);
}
if
(
property_definition
.
properties
)
{
// Create a recursive fieldset for this key.
return
gadget
.
declareGadget
(
"
../fieldset/index.html
"
);
}
if
(
property_definition
.
type
===
"
object
"
)
{
// Create a recursive fieldset for this key.
return
gadget
.
declareGadget
(
"
../fieldset/index.html
"
);
...
...
@@ -71,63 +51,22 @@
});
}
queue
=
new
RSVP
.
Queue
().
push
(
function
()
{
var
reserved_keys
=
[];
if
(
node_id
)
{
addField
(
"
id
"
,
{
type
:
"
string
"
},
node_id
);
}
Object
.
keys
(
options
.
property_definition
.
properties
).
forEach
(
function
(
property_name
)
{
var
property_definition
=
options
.
property_definition
.
properties
[
property_name
],
value
,
i
=
0
,
property
,
index
;
if
(
property_definition
)
{
value
=
property_definition
.
default
||
{};
if
(
property_definition
.
allOf
)
{
if
(
property_definition
.
allOf
[
0
].
properties
)
{
for
(
property
in
property_definition
.
allOf
[
0
].
properties
)
{
if
(
property_definition
.
allOf
[
0
].
properties
.
hasOwnProperty
(
property
))
{
i
+=
1
;
if
(
i
>
1
)
{
console
.
log
(
"
something is wrong!
"
);
}
value
=
property_definition
.
allOf
[
0
].
properties
[
property
].
default
;
}
}
}
}
}
console
.
log
(
"
TRYING TO FIND A VALUE!!!!
"
);
console
.
log
(
options
);
console
.
log
(
options
.
value
);
console
.
log
(
property_name
);
// XXX if the field is complex then the value may be complex
// eg options.value > "time_to_failure":{},"time_to_repair":{}...
// while the property_names are abstract as allOf_1 corresponding
// to (for example) time_to_failure
if
(
options
.
property_definition
.
properties
[
property_name
].
allOf
)
{
if
((
options
.
value
||
{})[
property_name
]
===
undefined
)
{
if
(
typeof
options
.
value
===
"
object
"
)
{
if
(
Object
.
keys
(
options
.
value
).
length
>
0
)
{
for
(
index
=
0
;
index
<
Object
.
keys
(
options
.
value
).
length
-
1
;
index
+=
1
)
{
if
(
!
(
reserved_keys
.
indexOf
(
Object
.
keys
(
options
.
value
)[
index
])
>
-
1
))
{
reserved_keys
.
push
(
Object
.
keys
(
options
.
value
)[
index
]);
value
=
options
.
value
[
Object
.
keys
(
options
.
value
)[
index
]];
break
;
}
}
}
}
}
}
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
?
value
:
options
.
value
[
property_name
];
if
(
property_name
!==
"
coordinate
"
&&
property_name
!==
"
_class
"
&&
property_name
!==
"
id
"
)
{
console
.
log
(
"
ADDING FIELD FOR
"
+
property_name
+
"
!!!!!!!
"
);
var
property_definition
=
options
.
property_definition
.
properties
[
property_name
],
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
?
property_definition
.
_default
:
options
.
value
[
property_name
];
// XXX some properties are not editable
// XXX should not be defined here
if
(
property_name
!==
"
coordinate
"
&&
property_name
!==
"
_class
"
)
{
addField
(
property_name
,
property_definition
,
value
);
}
});
});
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
());
...
...
@@ -135,8 +74,6 @@
return
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
(
promise_list
);
}).
push
(
function
(
result_list
)
{
console
.
log
(
"
(*)(/)(*)
"
);
console
.
log
(
result_list
);
var
name
,
result
=
{},
content
=
result
;
if
(
gadget
.
props
.
key
)
{
content
=
result
[
gadget
.
props
.
key
]
=
{};
...
...
@@ -148,19 +85,7 @@
}
}
}
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 @
0e6d6eca
This diff is collapsed.
Click to expand it.
dream/platform/static/lib/handlebars.min.js
View file @
0e6d6eca
This diff is collapsed.
Click to expand it.
dream/platform/static/lib/jio.js
View file @
0e6d6eca
...
...
@@ -2915,9 +2915,6 @@ function restCommandRejecter(param, args) {
if
(
arg
.
columnNumber
!==
undefined
&&
arg
.
columnNumber
!==
null
)
{
current_priority
.
columnNumber
=
arg
.
columnNumber
;
}
if
(
arg
.
fileName
!==
undefined
&&
arg
.
fileName
!==
null
)
{
current_priority
.
fileName
=
arg
.
fileName
;
}
if
(
arg
.
filename
!==
undefined
&&
arg
.
filename
!==
null
)
{
current_priority
.
filename
=
arg
.
filename
;
}
...
...
@@ -4150,7 +4147,7 @@ function enableRestParamChecker(jio, shared) {
}
});
[
"
removeAttachment
"
].
forEach
(
function
(
method
)
{
[
"
getAttachment
"
,
"
removeAttachment
"
].
forEach
(
function
(
method
)
{
shared
.
on
(
method
,
function
(
param
)
{
if
(
!
checkId
(
param
))
{
checkAttachmentId
(
param
);
...
...
@@ -4158,26 +4155,6 @@ function enableRestParamChecker(jio, shared) {
});
});
[
"
getAttachment
"
].
forEach
(
function
(
method
)
{
shared
.
on
(
method
,
function
(
param
)
{
if
(
param
.
storage_spec
.
type
!==
"
indexeddb
"
&&
param
.
storage_spec
.
type
!==
"
dav
"
&&
(
param
.
kwargs
.
_start
!==
undefined
||
param
.
kwargs
.
_end
!==
undefined
))
{
restCommandRejecter
(
param
,
[
'
bad_request
'
,
'
unsupport
'
,
'
_start, _end not support
'
]);
return
false
;
}
if
(
!
checkId
(
param
))
{
checkAttachmentId
(
param
);
}
});
});
[
"
check
"
,
"
repair
"
].
forEach
(
function
(
method
)
{
shared
.
on
(
method
,
function
(
param
)
{
if
(
param
.
kwargs
.
_id
!==
undefined
)
{
...
...
dream/platform/static/lib/qunit.css
View file @
0e6d6eca
/*!
* QUnit 1.1
5
.0
* QUnit 1.1
4
.0
* http://qunitjs.com/
*
* Copyright 201
4
jQuery Foundation and other contributors
* Copyright 201
3
jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-0
8-08T16:0
0Z
* Date: 2014-0
1-31T16:4
0Z
*/
/** Font Family and Sizes */
...
...
@@ -62,14 +62,14 @@
}
#qunit-testrunner-toolbar
{
padding
:
0.5em
1em
0.5em
1
em
;
padding
:
0.5em
0
0.5em
2
em
;
color
:
#5E740B
;
background-color
:
#EEE
;
overflow
:
hidden
;
}
#qunit-userAgent
{
padding
:
0.5em
1em
0.5em
1
em
;
padding
:
0.5em
0
0.5em
2.5
em
;
background-color
:
#2B81AF
;
color
:
#FFF
;
text-shadow
:
rgba
(
0
,
0
,
0
,
0.5
)
2px
2px
1px
;
...
...
@@ -86,7 +86,7 @@
}
#qunit-tests
li
{
padding
:
0.4em
1em
0.4em
1
em
;
padding
:
0.4em
0.5em
0.4em
2.5
em
;
border-bottom
:
1px
solid
#FFF
;
list-style-position
:
inside
;
}
...
...
@@ -215,7 +215,7 @@
/** Result */
#qunit-testresult
{
padding
:
0.5em
1em
0.5em
1
em
;
padding
:
0.5em
0.5em
0.5em
2.5
em
;
color
:
#2B81AF
;
background-color
:
#D2E0E6
;
...
...
dream/platform/static/lib/qunit.js
View file @
0e6d6eca
This diff is collapsed.
Click to expand it.
dream/platform/static/toolbox/toolbox.js
View file @
0e6d6eca
...
...
@@ -30,21 +30,19 @@
*/
tools_container
.
className
=
"
tools-container
"
;
Object
.
keys
(
data
.
class_definition
).
forEach
(
function
(
key
)
{
var
_class
_object
=
data
.
class_definition
[
key
],
tool
;
var
_class
=
data
.
class_definition
[
key
],
tool
;
// XXX "expand" the json schema "allOF" etc
if
(
_class_object
.
allOf
)
{
if
(
_class_object
.
allOf
[
0
].
$ref
===
"
#/node
"
)
{
tool
=
document
.
createElement
(
"
div
"
);
// XXX maybe allow to configure the class name ?
tool
.
className
=
"
tool
"
+
key
;
tool
.
textContent
=
_class_object
.
name
||
key
;
tool
.
draggable
=
true
;
tool
.
dataset
.
class_name
=
JSON
.
stringify
(
key
);
Object
.
keys
(
_class_object
.
css
||
{}).
forEach
(
function
(
k
)
{
tool
.
style
[
k
]
=
_class_object
.
css
[
k
];
});
tools_container
.
appendChild
(
tool
);
}
if
(
_class
.
_class
===
"
node
"
)
{
tool
=
document
.
createElement
(
"
div
"
);
// XXX maybe allow to configure the class name ?
tool
.
className
=
"
tool
"
+
key
;
tool
.
textContent
=
_class
.
name
||
key
;
tool
.
draggable
=
true
;
tool
.
dataset
.
class_name
=
JSON
.
stringify
(
key
);
Object
.
keys
(
_class
.
css
||
{}).
forEach
(
function
(
k
)
{
tool
.
style
[
k
]
=
_class
.
css
[
k
];
});
tools_container
.
appendChild
(
tool
);
}
});
this
.
props
.
element
.
querySelector
(
"
.tools
"
).
appendChild
(
tools_container
);
...
...
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