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
9cab121a
Commit
9cab121a
authored
Jun 19, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
2aa28a74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
7 deletions
+65
-7
dream/platform/static/dream/index.js
dream/platform/static/dream/index.js
+39
-4
dream/platform/static/fieldset/fieldset.js
dream/platform/static/fieldset/fieldset.js
+25
-2
dream/platform/static/manifest.appcache
dream/platform/static/manifest.appcache
+1
-1
No files found.
dream/platform/static/dream/index.js
View file @
9cab121a
/*global console, jQuery, rJS, RSVP, alert, Handlebars, initGadgetMixin */
/*global console, jQuery, rJS, RSVP, alert, Handlebars, initGadgetMixin
, confirm
*/
/*jslint nomen: true */
(
function
(
window
,
$
,
rJS
,
RSVP
,
Handlebars
,
initGadgetMixin
)
{
"
use strict
"
;
...
...
@@ -9,10 +9,25 @@
$
.
mobile
.
linkBindingEnabled
=
false
;
$
.
mobile
.
hashListeningEnabled
=
false
;
$
.
mobile
.
pushStateEnabled
=
false
;
// Prompt user to reload after manifest update.
// from http://www.html5rocks.com/en/tutorials/appcache/beginner/#toc-updating-cache
window
.
addEventListener
(
"
load
"
,
function
()
{
if
(
window
.
applicationCache
)
{
window
.
applicationCache
.
addEventListener
(
"
updateready
"
,
function
()
{
if
(
window
.
applicationCache
.
status
===
window
.
applicationCache
.
UPDATEREADY
)
{
// Browser downloaded a new app cache.
// Swap it in and reload the page to get the new hotness.
window
.
applicationCache
.
swapCache
();
if
(
confirm
(
"
A new version of this site is available. Load it?
"
))
{
window
.
location
.
reload
();
}
}
},
false
);
}
},
false
);
/////////////////////////////////////////////////////////////////
// Minimalistic ERP5's like portal type configuration
/////////////////////////////////////////////////////////////////
// XXX we should use lists instead to keep ordering
var
portal_types
=
{
"
Input Module
"
:
{
view
:
{
...
...
@@ -109,17 +124,37 @@
var
nav_html
,
action
;
if
(
portal_types
[
portal_type
][
options
.
action
].
type
===
"
object_view
"
)
{
return
new
RSVP
.
Queue
().
push
(
function
()
{
var
url_list
=
[],
key2
;
var
url_list
=
[],
action_item_list
=
[],
i
,
key2
;
for
(
key2
in
portal_types
[
portal_type
])
{
if
(
portal_types
[
portal_type
].
hasOwnProperty
(
key2
))
{
action
=
portal_types
[
portal_type
][
key2
];
if
(
action
.
type
===
"
object_view
"
)
{
if
(
action
.
condition
===
undefined
||
action
.
condition
(
gadget
))
{
url_list
.
push
(
calculateTabHTML
(
gadget
,
options
,
key2
,
action
.
title
,
key2
===
options
.
action
)
);
action_item_list
.
push
([
key2
,
action
]
);
}
}
}
}
/*
* Sort actions so that higher priorities are displayed first.
* If no priority is defined, sort by action id to have stable order.
*/
action_item_list
.
sort
(
function
(
a
,
b
)
{
var
key_a
=
a
[
0
],
value_a
=
a
[
1
],
key_b
=
b
[
0
],
value_b
=
b
[
1
];
if
(
!
isNaN
(
value_a
.
priority
))
{
if
(
!
isNaN
(
value_b
.
priority
))
{
return
value_b
.
priority
-
value_a
.
priority
;
}
return
-
1
;
}
if
(
!
isNaN
(
value_b
.
priority
))
{
return
1
;
}
return
key_a
<
key_b
?
-
1
:
key_a
>
key_b
?
1
:
0
;
});
for
(
i
=
0
;
i
<
action_item_list
.
length
;
i
+=
1
)
{
url_list
.
push
(
calculateTabHTML
(
gadget
,
options
,
action_item_list
[
i
][
0
],
action_item_list
[
i
][
1
].
title
,
action_item_list
[
i
][
0
]
===
options
.
action
));
}
return
RSVP
.
all
(
url_list
);
}).
push
(
function
(
entry_list
)
{
var
i
;
...
...
dream/platform/static/fieldset/fieldset.js
View file @
9cab121a
...
...
@@ -64,6 +64,7 @@
});
}
queue
=
new
RSVP
.
Queue
().
push
(
function
()
{
var
property_item_list
=
[],
i
,
property_name
,
property_definition
,
value
;
//gadget.props.fieldset_element = document.createElement("fieldset");
//gadget.props.element.appendChild(gadget.props.fieldset_element);
gadget
.
props
.
fieldset_element
=
gadget
.
props
.
element
;
...
...
@@ -77,13 +78,35 @@
},
node_id
);
}
Object
.
keys
(
options
.
property_definition
.
properties
).
forEach
(
function
(
property_name
)
{
var
property_definition
=
options
.
property_definition
.
properties
[
property_name
],
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
?
property_definition
.
default
:
options
.
value
[
property_name
];
property_item_list
.
push
([
property_name
,
options
.
property_definition
.
properties
[
property_name
]
]);
});
/*
* Sort properties so that higher priorities are displayed first.
* If no priority is defined, sort by property id to have stable order.
*/
property_item_list
.
sort
(
function
(
a
,
b
)
{
var
key_a
=
a
[
0
],
value_a
=
a
[
1
],
key_b
=
b
[
0
],
value_b
=
b
[
1
];
if
(
!
isNaN
(
value_a
.
priority
))
{
if
(
!
isNaN
(
value_b
.
priority
))
{
return
value_b
.
priority
-
value_a
.
priority
;
}
return
-
1
;
}
if
(
!
isNaN
(
value_b
.
priority
))
{
return
1
;
}
return
key_a
<
key_b
?
-
1
:
key_a
>
key_b
?
1
:
0
;
});
for
(
i
=
0
;
i
<
property_item_list
.
length
;
i
+=
1
)
{
property_name
=
property_item_list
[
i
][
0
];
property_definition
=
property_item_list
[
i
][
1
];
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
"
&&
property_name
!==
"
id
"
)
{
addField
(
property_name
,
property_definition
,
value
);
}
}
);
}
});
return
queue
;
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/manifest.appcache
View file @
9cab121a
CACHE MANIFEST
# This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator
# Time:
Wed May 27 2015 12:36:48
GMT+0200 (CEST)
# Time:
Fri Jun 19 2015 08:50:17
GMT+0200 (CEST)
CACHE:
dream/InputModule_viewAddDocumentDialog.js
...
...
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