Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Sebastien Robin
erp5
Commits
31b87a7c
Commit
31b87a7c
authored
Oct 03, 2016
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs: continue app handling task
parent
a053bedc
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
473 additions
and
54 deletions
+473
-54
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_planning_html.html
...m/web_page_module/gadget_officejs_page_planning_html.html
+4
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_planning_js.js
...eItem/web_page_module/gadget_officejs_page_planning_js.js
+41
-6
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_task_appcache.xml
...ateItem/web_page_module/gadget_officejs_task_appcache.xml
+411
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_widget_planning_html.html
...web_page_module/gadget_officejs_widget_planning_html.html
+1
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_widget_planning_js.js
...tem/web_page_module/gadget_officejs_widget_planning_js.js
+16
-46
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_planning_html.html
View file @
31b87a7c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS
Text Editor List
</title>
<title>
OfficeJS
Planning
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"renderjs.js"
></script>
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
</head>
</head>
<body>
<body>
<div
data-gadget-url=
"gadget_officejs_widget_planning.html"
data-gadget-scope=
"planning"
></div>
<div
class=
'document-content'
></div>
</body>
</body>
</html>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_planning_js.js
View file @
31b87a7c
/*globals window, RSVP, rJS*/
/*globals window, RSVP, rJS
, console
*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(
function
(
window
,
RSVP
,
rJS
)
{
(
function
(
window
,
RSVP
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
return
g
.
getElement
()
return
g
.
getElement
()
.
push
(
function
(
element
)
{
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
g
.
props
.
element
=
element
;
g
.
props
.
deferred
=
RSVP
.
defer
();
});
});
})
})
.
ready
(
function
(
g
)
{
.
ready
(
function
(
g
)
{
...
@@ -78,12 +79,40 @@
...
@@ -78,12 +79,40 @@
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
planning
"
);
return
gadget
.
props
.
deferred
.
resolve
();
});
})
/////////////////////////////////////////
// Render text content gadget
/////////////////////////////////////////
.
declareService
(
function
()
{
var
gadget
=
this
,
text_gadget
=
null
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
props
.
deferred
.
promise
;
})
.
push
(
function
()
{
return
gadget
.
declareGadget
(
"
gadget_officejs_widget_planning.html
"
,
{
scope
:
"
planning
"
,
sandbox
:
"
iframe
"
,
element
:
gadget
.
props
.
element
.
querySelector
(
"
.document-content
"
)
}
);
})
})
.
push
(
function
(
planning
)
{
.
push
(
function
(
planning_gadget
)
{
return
planning
.
render
({
var
iframe
=
gadget
.
props
.
element
.
querySelector
(
'
iframe
'
);
iframe
.
setAttribute
(
'
style
'
,
'
width:100%; border: 0 none; height: 600px
'
);
text_gadget
=
planning_gadget
;
return
planning_gadget
.
render
({
search_page
:
'
planning
'
,
search_page
:
'
planning
'
,
search
:
options
.
search
,
column_list
:
[{
column_list
:
[{
select
:
'
title
'
,
select
:
'
title
'
,
title
:
'
Title
'
title
:
'
Title
'
...
@@ -111,7 +140,13 @@
...
@@ -111,7 +140,13 @@
sort_on
:
[[
"
modification_date
"
,
"
descending
"
]]
sort_on
:
[[
"
modification_date
"
,
"
descending
"
]]
}
}
});
});
})
.
push
(
function
()
{
return
text_gadget
.
getElement
();
});
});
});
});
}(
window
,
RSVP
,
rJS
));
}(
window
,
RSVP
,
rJS
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_task_appcache.xml
0 → 100644
View file @
31b87a7c
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_widget_planning_html.html
View file @
31b87a7c
...
@@ -26,3 +26,4 @@
...
@@ -26,3 +26,4 @@
</div>
</div>
</body>
</body>
</html>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_widget_planning_js.js
View file @
31b87a7c
/*global window, rJS, RSVP, Handlebars,
loopEventListener,
vis, console */
/*global window, rJS, RSVP, Handlebars, vis, console */
/*jslint nomen: true, indent: 2 */
/*jslint nomen: true, indent: 2 */
(
function
(
window
,
rJS
,
RSVP
,
vis
,
loopEventListener
)
{
(
function
(
window
,
rJS
,
RSVP
,
vis
)
{
"
use strict
"
;
"
use strict
"
;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
// ready
// ready
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
ready
(
function
(
gadget
)
{
.
ready
(
function
(
gadget
)
{
console
.
log
(
"
widget_planning, ready
"
);
gadget
.
property_dict
=
{
gadget
.
property_dict
=
{
render_deferred
:
RSVP
.
defer
()
render_deferred
:
RSVP
.
defer
()
};
};
...
@@ -54,7 +53,6 @@
...
@@ -54,7 +53,6 @@
search_list
=
[],
search_list
=
[],
translated_column_list
=
[],
translated_column_list
=
[],
all_docs_result
;
all_docs_result
;
console
.
log
(
"
widget_planning, render
"
);
// store initial configuration
// store initial configuration
gadget
.
property_dict
.
option_dict
=
option_dict
;
gadget
.
property_dict
.
option_dict
=
option_dict
;
...
@@ -76,7 +74,7 @@
...
@@ -76,7 +74,7 @@
}
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
(
link_list
)
{
.
push
(
function
(
link_list
)
{
var
row_list
=
[],
var
row_list
=
[],
cell_list
,
cell_list
,
...
@@ -94,15 +92,6 @@
...
@@ -94,15 +92,6 @@
type
:
{
start
:
'
ISODate
'
,
end
:
'
ISODate
'
}
type
:
{
start
:
'
ISODate
'
,
end
:
'
ISODate
'
}
});
});
// add items to the DataSet
/*items.add([
{id: 1, content: 'item 1<br>start', start: '2014-01-23'},
{id: 2, content: 'item 2', start: '2014-01-18'},
{id: 3, content: 'item 3', start: '2014-01-21'},
{id: 4, content: 'item 4', start: '2014-01-19', end: '2014-01-24'},
{id: 5, content: 'item 5', start: '2014-01-28', type: 'point'},
{id: 6, content: 'item 6', start: '2014-01-26'}
]);*/
// log changes to the console
// log changes to the console
items
.
on
(
'
*
'
,
function
(
event
,
properties
)
{
items
.
on
(
'
*
'
,
function
(
event
,
properties
)
{
...
@@ -113,9 +102,9 @@
...
@@ -113,9 +102,9 @@
container
=
gadget
.
property_dict
.
element
.
querySelector
(
"
.planning-widget
"
);
container
=
gadget
.
property_dict
.
element
.
querySelector
(
"
.planning-widget
"
);
var
options
=
{
var
options
=
{
start
:
'
2016-09-10
'
,
//
start: '2016-09-10',
end
:
'
2016-09-30
'
,
//
end: '2016-09-30',
height
:
'
3
00px
'
,
height
:
'
5
00px
'
,
// allow selecting multiple items using ctrl+click, shift+click, or hold.
// allow selecting multiple items using ctrl+click, shift+click, or hold.
multiselect
:
true
,
multiselect
:
true
,
...
@@ -131,7 +120,8 @@
...
@@ -131,7 +120,8 @@
showCurrentTime
:
true
showCurrentTime
:
true
};
};
// XXX We must not hardcode what is used for start and end, it must be
// parameters of this render method
for
(
j
=
0
,
j_len
=
all_docs_result
.
data
.
total_rows
;
j
<
j_len
;
j
+=
1
)
{
for
(
j
=
0
,
j_len
=
all_docs_result
.
data
.
total_rows
;
j
<
j_len
;
j
+=
1
)
{
item
=
{};
item
=
{};
link
=
link_list
[
j
];
link
=
link_list
[
j
];
...
@@ -139,8 +129,7 @@
...
@@ -139,8 +129,7 @@
item
.
id
=
j
;
item
.
id
=
j
;
item
.
content
=
task
.
title
;
item
.
content
=
task
.
title
;
item
.
start
=
task
.
start_date
;
item
.
start
=
task
.
start_date
;
//item.end = task.end_date;
item
.
end
=
task
.
stop_date
;
console
.
log
(
"
adding item
"
,
item
);
item_list
.
push
(
item
);
item_list
.
push
(
item
);
}
}
console
.
log
(
"
item_list
"
,
item_list
);
console
.
log
(
"
item_list
"
,
item_list
);
...
@@ -151,31 +140,12 @@
...
@@ -151,31 +140,12 @@
items
.
add
(
item_list
);
items
.
add
(
item_list
);
timeline
=
new
vis
.
Timeline
(
container
,
items
,
options
);
timeline
=
new
vis
.
Timeline
(
container
,
items
,
options
);
});
});
})
/////////////////////////////////////////////////////////////////
// declared service
/////////////////////////////////////////////////////////////////
.
declareService
(
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
property_dict
.
render_deferred
.
promise
;
})
.
push
(
function
()
{
return
loopEventListener
(
gadget
.
property_dict
.
element
.
querySelector
(
'
form
'
),
'
submit
'
,
false
,
function
(
evt
)
{
return
gadget
.
redirect
({
jio_key
:
gadget
.
property_dict
.
option_dict
.
jio_key
||
''
,
page
:
gadget
.
property_dict
.
option_dict
.
search_page
||
''
,
search
:
evt
.
target
[
0
].
value
});
}
);
});
});
});
}(
window
,
rJS
,
RSVP
,
vis
,
loopEventListener
));
}(
window
,
rJS
,
RSVP
,
vis
));
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