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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bryan Kaperick
erp5
Commits
61f1419a
Commit
61f1419a
authored
Aug 04, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Fix pdf view, add parse on dataURI
parent
e54d1f4a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
21 deletions
+27
-21
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
...teItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
+7
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
...eItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_js.js
...lateItem/web_page_module/gadget_officejs_pdf_viewer_js.js
+16
-16
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_js.xml
...ateItem/web_page_module/gadget_officejs_pdf_viewer_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
View file @
61f1419a
...
...
@@ -76,7 +76,13 @@
return
jIO
.
util
.
readBlobAsDataURL
(
blob
);
})
.
push
(
function
(
result
)
{
data
=
result
.
target
.
result
;
if
(
result
.
target
.
result
.
split
(
'
data:
'
)[
1
]
===
''
)
{
data
=
''
;
}
else
{
data
=
result
.
target
.
result
.
split
(
/data:application
\/
.*;base64,/
)[
1
];
}
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
form_gadget
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
View file @
61f1419a
...
...
@@ -233,7 +233,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.1
0686.10882.5973
</string>
</value>
<value>
<string>
961.1
2114.30061.24797
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>
15018
55020.28
</float>
<float>
15018
61765.33
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_js.js
View file @
61f1419a
...
...
@@ -5,13 +5,6 @@
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
gadget
.
props
=
{};
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
props
.
element
=
element
;
});
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
[].
forEach
.
call
(
window
.
document
.
head
.
querySelectorAll
(
"
base
"
),
function
(
el
)
{
// XXX GadgetField adds <base> tag to fit to the parent page location, it's BAD to remove them.
...
...
@@ -20,10 +13,17 @@
// we break all dynamic links. So, deleting <base> is required.
window
.
document
.
head
.
removeChild
(
el
);
});
this
.
props
.
key
=
options
.
key
;
var
raw
=
window
.
atob
(
options
.
value
);
var
rawLength
=
raw
.
length
;
var
array
=
new
Uint8Array
(
new
ArrayBuffer
(
rawLength
));
return
this
.
changeState
({
value
:
options
.
value
,
key
:
options
.
key
});
})
.
onStateChange
(
function
()
{
var
gadget
=
this
,
raw
=
window
.
atob
(
gadget
.
state
.
value
),
rawLength
=
raw
.
length
,
array
=
new
Uint8Array
(
new
ArrayBuffer
(
rawLength
));
for
(
var
i
=
0
;
i
<
rawLength
;
i
++
)
{
array
[
i
]
=
raw
.
charCodeAt
(
i
);
...
...
@@ -32,14 +32,14 @@
webViewerLoad
(
array
);
// hide few buttons for now
this
.
props
.
element
.
querySelector
(
'
#viewBookmark
'
).
hidden
=
true
;
this
.
props
.
element
.
querySelector
(
'
#documentProperties
'
).
hidden
=
true
;
this
.
props
.
element
.
querySelector
(
'
#documentProperties
'
).
hidden
=
true
;
gadget
.
element
.
querySelector
(
'
#viewBookmark
'
).
hidden
=
true
;
gadget
.
element
.
querySelector
(
'
#documentProperties
'
).
hidden
=
true
;
gadget
.
element
.
querySelector
(
'
#documentProperties
'
).
hidden
=
true
;
return
;
})
.
declareMethod
(
"
getContent
"
,
function
()
{
var
form_data
=
{};
var
self
=
this
;
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
PDFViewerApplication
.
pdfDocument
)
{
...
...
@@ -61,7 +61,7 @@
});
})
.
push
(
function
(
evt
)
{
form_data
[
self
.
props
.
key
]
=
evt
.
target
.
result
;
form_data
[
gadget
.
state
.
key
]
=
evt
.
target
.
result
;
return
form_data
;
});
});
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_js.xml
View file @
61f1419a
...
...
@@ -233,7 +233,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
2133.47184.12219
</string>
</value>
<value>
<string>
961.
12202.20585.38980
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>
1501
257080.78
</float>
<float>
1501
861642.39
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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