Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c8690fb
feat: Add GitHub Actions workflow for GitHub Pages deployment
google-labs-jules[bot] Oct 10, 2025
04cc2fd
Merge pull request #1 from erseco/add-gh-pages-pipeline
erseco Oct 10, 2025
7352091
Bump dojox
dependabot[bot] Oct 10, 2025
94edfb8
Bump dojo
dependabot[bot] Oct 10, 2025
4a32f4b
Merge pull request #4 from erseco/dependabot/npm_and_yarn/programs/ed…
erseco Oct 10, 2025
4355d83
Merge pull request #2 from erseco/dependabot/npm_and_yarn/programs/ed…
erseco Oct 10, 2025
1bfc8f6
Fix CI build failure due to missing git history
google-labs-jules[bot] Oct 10, 2025
1f9a165
Bump dijit
dependabot[bot] Oct 10, 2025
180c3c4
Merge pull request #5 from erseco/fix-ci-versioning-error
erseco Oct 10, 2025
e45e3e7
Merge pull request #3 from erseco/dependabot/npm_and_yarn/programs/ed…
erseco Oct 10, 2025
876ea73
Configure GitHub Actions to run on pull requests and set up Dependabot.
google-labs-jules[bot] Oct 10, 2025
751ef44
Merge pull request #6 from erseco/feature/configure-ci-and-dependabot
erseco Oct 10, 2025
69dd59e
Bump actions/checkout from 2 to 5
dependabot[bot] Oct 10, 2025
e36a92e
Bump peaceiris/actions-gh-pages from 3 to 4
dependabot[bot] Oct 10, 2025
053ed4b
Merge pull request #7 from erseco/dependabot/github_actions/actions/c…
erseco Oct 10, 2025
b200782
Merge pull request #8 from erseco/dependabot/github_actions/peaceiris…
erseco Oct 10, 2025
7133517
Fix build and add caching to CI workflow
google-labs-jules[bot] Oct 10, 2025
134550f
Merge pull request #10 from erseco/add-caching-and-fix-build
erseco Oct 10, 2025
4633352
feat: Implement dynamic versioning in CI
google-labs-jules[bot] Oct 10, 2025
49a8dde
Merge pull request #11 from erseco/feature/build-versioning
erseco Oct 10, 2025
2970578
I have restructured the `viewer/index.html` file with a new Bootstrap…
google-labs-jules[bot] Oct 11, 2025
6b1ca1e
Merge pull request #12 from erseco/better-sample-paage
erseco Oct 11, 2025
7184f15
Create .keep
erseco Oct 11, 2025
c2082ba
Add files via upload
erseco Oct 11, 2025
67f21b3
Fix
erseco Oct 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Determine version
id: determine_version
run: |
if [[ ${GITHUB_REF} == refs/tags/v* ]]; then
echo "version_arg=" >> $GITHUB_OUTPUT
else
commit_hash=$(git rev-parse --short HEAD)
echo "version_arg=-DOVERRULED_WEBODF_VERSION=0.0.0-build${commit_hash}" >> $GITHUB_OUTPUT
fi

- name: Cache build directory
id: cache-build
uses: actions/cache@v4
with:
path: build
key: build-v1-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ steps.determine_version.outputs.version_arg }}
restore-keys: |
build-v1-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}-

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake default-jdk libqt5webkit5-dev

- name: Build webodf.js
run: |
mkdir -p build
cd build
cmake .. ${{ steps.determine_version.outputs.version_arg }}
make webodf.js-target

- name: Prepare deployment
if: github.event_name == 'push'
run: |
mkdir -p deploy/webodf
cp build/webodf/webodf.js deploy/webodf/
cp viewer/index.html deploy/
# Include example ODT files for the demo viewer
cp -r examples deploy/

- name: Deploy to gh-pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ endif()
ExternalProject_Add(
Dojo
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL "http://download.dojotoolkit.org/release-1.8.1/dojo-release-1.8.1-src.tar.gz"
URL_MD5 9b80b9a736b81c336accd832f3c3aea2
URL "https://download.dojotoolkit.org/release-1.10.4/dojo-release-1.10.4-src.tar.gz"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
1 change: 1 addition & 0 deletions examples/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added examples/sample1.odt
Binary file not shown.
Binary file added examples/sample2.odt
Binary file not shown.
Binary file added examples/sample3.odt
Binary file not shown.
6 changes: 3 additions & 3 deletions programs/editor/dojo-deps/src/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "1.0",
"main": "main",
"dependencies": {
"dojo": "1.8.0",
"dijit": "1.8.0",
"dojox": "1.8.0",
"dojo": "1.16.5",
"dijit": "1.13.8",
"dojox": "1.14.6",
"util": "1.8.0"
},
"description": "Dojo Boilerplate Example Application. A quick-start application that demonstrates basic usage of the Dojo Toolkit. This package.json file is a CommonJS Packages/1.0 manifest, with a special `dojoBuild` property to point to the build file for this package.",
Expand Down
1 change: 1 addition & 0 deletions viewer/examples/sample1.odt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>File Examples | Download redirect...</title> <meta name="description" content="Download redirect page." > <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet"> <style>h2{font-family: Catamaran,Helvetica,Arial,sans-serif; font-weight: 200; font-size: 50px; color: #333;}section{padding-top: 10%; max-width:100%; text-align: center;}a{color: #00CC66;}a:focus{outline:none; outline-offset:inherit;}@media (max-device-width: 1027px){body{text-align:center; font-size:larger;}section{max-width: 90%;}}@media (max-device-width: 640px){section{max-width: 97%;}}</style></head><body> <section> <h2>Downloading...</h2> <em>Please wait a moment</em><br/><br/><script>document.write('<a href="http://file-examples.com/">[Go Back]</a>');</script></section><script>document.addEventListener('DOMContentLoaded', function(){setTimeout(function (){url=window.location.href.replace('file-examples.com/wp-content/storage/','file-examples.com/storage/fe31f1e28268e987f9547fc/'); window.location.replace(url);}, 3000);}, false);</script><script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'98c9f4ec3aa4d95e',t:'MTc2MDEzOTU2Mg=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body></html>
1 change: 1 addition & 0 deletions viewer/examples/sample2.odt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>File Examples | Download redirect...</title> <meta name="description" content="Download redirect page." > <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet"> <style>h2{font-family: Catamaran,Helvetica,Arial,sans-serif; font-weight: 200; font-size: 50px; color: #333;}section{padding-top: 10%; max-width:100%; text-align: center;}a{color: #00CC66;}a:focus{outline:none; outline-offset:inherit;}@media (max-device-width: 1027px){body{text-align:center; font-size:larger;}section{max-width: 90%;}}@media (max-device-width: 640px){section{max-width: 97%;}}</style></head><body> <section> <h2>Downloading...</h2> <em>Please wait a moment</em><br/><br/><script>document.write('<a href="http://file-examples.com/">[Go Back]</a>');</script></section><script>document.addEventListener('DOMContentLoaded', function(){setTimeout(function (){url=window.location.href.replace('file-examples.com/wp-content/storage/','file-examples.com/storage/fe31f1e28268e987f9547fc/'); window.location.replace(url);}, 3000);}, false);</script><script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'98c9f4ef79e5c474',t:'MTc2MDEzOTU2Mw=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body></html>
1 change: 1 addition & 0 deletions viewer/examples/sample3.odt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>File Examples | Download redirect...</title> <meta name="description" content="Download redirect page." > <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet"> <style>h2{font-family: Catamaran,Helvetica,Arial,sans-serif; font-weight: 200; font-size: 50px; color: #333;}section{padding-top: 10%; max-width:100%; text-align: center;}a{color: #00CC66;}a:focus{outline:none; outline-offset:inherit;}@media (max-device-width: 1027px){body{text-align:center; font-size:larger;}section{max-width: 90%;}}@media (max-device-width: 640px){section{max-width: 97%;}}</style></head><body> <section> <h2>Downloading...</h2> <em>Please wait a moment</em><br/><br/><script>document.write('<a href="http://file-examples.com/">[Go Back]</a>');</script></section><script>document.addEventListener('DOMContentLoaded', function(){setTimeout(function (){url=window.location.href.replace('file-examples.com/wp-content/storage/','file-examples.com/storage/fe31f1e28268e987f9547fc/'); window.location.replace(url);}, 3000);}, false);</script><script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'98c9f4f2b9f2251b',t:'MTc2MDEzOTU2Mw=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body></html>
94 changes: 94 additions & 0 deletions viewer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebODF Viewer Demo</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="webodf/webodf.js"></script>
<style>
body {
padding-top: 5rem;
}
#sidebar {
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 250px;
padding: 1rem;
background: #f8f9fa;
border-right: 1px solid #dee2e6;
}
#viewer-container {
margin-left: 250px;
padding: 1rem;
}
#drop-zone {
border: 2px dashed #ccc;
padding: 2rem;
text-align: center;
margin-bottom: 1rem;
}
</style>
</head>
<body>

<div id="sidebar">
<h5>Sample ODT Files</h5>
<ul class="list-group">
<li class="list-group-item"><a href="#" data-url="examples/sample1.odt">Sample 1</a></li>
<li class="list-group-item"><a href="#" data-url="examples/sample2.odt">Sample 2</a></li>
<li class="list-group-item"><a href="#" data-url="examples/sample3.odt">Sample 3</a></li>
</ul>
<hr>
<div id="drop-zone">
Drag and drop an ODT file here
</div>
</div>

<div id="viewer-container">
<div id="odf-viewer"></div>
</div>

<script>
const odfViewer = document.getElementById('odf-viewer');
const odfCanvas = new odf.OdfCanvas(odfViewer);

document.querySelectorAll('.list-group-item a').forEach(item => {
item.addEventListener('click', event => {
event.preventDefault();
const url = event.target.getAttribute('data-url');
odfCanvas.load(url);
});
});

const dropZone = document.getElementById('drop-zone');

dropZone.addEventListener('dragover', event => {
event.preventDefault();
dropZone.style.backgroundColor = '#e9ecef';
});

dropZone.addEventListener('dragleave', event => {
event.preventDefault();
dropZone.style.backgroundColor = 'transparent';
});

dropZone.addEventListener('drop', event => {
event.preventDefault();
dropZone.style.backgroundColor = 'transparent';
const file = event.dataTransfer.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
const arrayBuffer = e.target.result;
const blob = new Blob([arrayBuffer], { type: 'application/vnd.oasis.opendocument.text' });
const url = URL.createObjectURL(blob);
odfCanvas.load(url);
};
reader.readAsArrayBuffer(file);
}
});
</script>
</body>
</html>
7 changes: 6 additions & 1 deletion webodf/tools/updateJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,12 @@ function Main(cmakeListPath) {
// The file has no errors, save it so it will be skipped at the
// next run.
mkdir(pathModule.dirname(lpath));
fs.writeFile(lpath, contents);
fs.writeFile(lpath, contents, function (err) {
if (err) {
console.log(err);
exitCode = 1;
}
});
} else {
errors = jslint.errors;
for (i = 0; i < errors.length && errors[i]; i += 1) {
Expand Down