diff --git a/OpenPage/assets/OpenPage.md b/OpenPage/assets/OpenPage.md new file mode 100644 index 0000000..d9dfca7 --- /dev/null +++ b/OpenPage/assets/OpenPage.md @@ -0,0 +1,14 @@ +![](https://os.lxsang.me/repo/OpenPage/OpenPage.png) +# OpenPage: ODT (Open Document Text) editor alpha +**OpenPage** is an AntOS application developed in-browser using AntOSDK. It is a Pure Javascript based rich text editor compatible with Open Document Format. + +**Feature:** +* Open, view and edit *.odt* documents +* Offer various formatting style to text +* Define and apply paragraph styles +* Insert link, image +* Embeded fonts +* Save documents as ODF format so that it can be compatible with desktop applications like Open Office + +**Credit:** +OpenPage is heavily based on the WebODF javascript library: https://webodf.org \ No newline at end of file diff --git a/OpenPage/assets/icon.png b/OpenPage/assets/icon.png new file mode 100644 index 0000000..ad142f9 Binary files /dev/null and b/OpenPage/assets/icon.png differ diff --git a/OpenPage/build/debug/README.md b/OpenPage/build/debug/README.md deleted file mode 100644 index 9dcf530..0000000 --- a/OpenPage/build/debug/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# OpenPage -This is an example project, generated by AntOS Development Kit - -## Howto - -1. Open the project.apj file with AntOSDK (simply double Click on it) -2. Modify the UI in *assets/scheme.html* -3. Modify application code in *coffees/main.coffee* -4. Modify CSS style in *css/main.css* -5. Other files need to be copied: put in to assets - -## Set up build target - -Click **Menu> Build > Build Option** or simply hit **ALT-Y** - -In the build options dialog, add or remove files that need to be -included into the build - -Click **Save** - -## Build application -* To build: **Menu > Build > Build** or **ALT-C** -* To build and run: **Menu > Build > Build and Run** or **CTRL-R** -* To release: **Menu > Build > Build release** or **ALT-P** \ No newline at end of file diff --git a/OpenPage/build/debug/blank.odt b/OpenPage/build/debug/blank.odt deleted file mode 100644 index 2414e6f..0000000 Binary files a/OpenPage/build/debug/blank.odt and /dev/null differ diff --git a/OpenPage/build/debug/main.css b/OpenPage/build/debug/main.css deleted file mode 100644 index 2dc7edf..0000000 --- a/OpenPage/build/debug/main.css +++ /dev/null @@ -1,109 +0,0 @@ - -@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0); -afx-app-window[data-id="OpenPage"] div[data-id="container"] -{ - overflow: auto; - margin:0px; - padding:0px; - padding-top: 10px; - padding-bottom: 10px; - text-align: center; - background-color: #f2f1f0; - /*position: relative;*/ -} - -/* -@media screen, print, handheld, projection -{ - office|body{ - display: inline !important; - } -}*/ - - -/* -Fix annotation problem not showing -*/ -/* -afx-app-window[data-id="OpenPage"] document, afx-app-window[data-id="OpenPage"] office:body{ - display: inline !important; -} -afx-app-window[data-id="OpenPage"] .annotationsPane{ - right: 0 !important; - top: 0 !important; - position: absolute !important; -}*/ -afx-app-window[data-id="OpenPage"] div[data-id="odfcanvas"] -{ - cursor: text; - margin:auto; - box-shadow: 1px 1px 3px 3px #9f9F9F; - /*added*/ - transform-origin: top center; - -webkit-transform-origin: top center; - -moz-transform-origin: top center; - -o-transform-origin: top center; - overflow: hidden; -} - -afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] -{ - background-color: #f5f5f5; - border: 1px solid #eaeaea; - box-shadow: 3px 3px 3px #9f9F9F; -} -afx-app-window[data-id="OpenPage"] afx-hbox[data-id="status-bar"] -{ - background-color: #f5f5f5; - border: 1px solid #eaeaea; - box-shadow: -3px -3px 3px #9f9F9F; -} -afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button, afx-app-window[data-id="OpenPage"] afx-button[data-id="btzoomfix"] button -{ - border: 1px solid #f5f5f5; - background-color: transparent; - width:100%; - height: 100%; -} - -afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button:hover, afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button.btactive, afx-app-window[data-id="OpenPage"] afx-button[data-id="btzoomfix"] button:hover -{ - border: 1px solid #759DC0; - background-color: transparent; - border-radius:5px; - color:#759DC0; -} - - -afx-app-window[data-id="HyperLinkDialog"] afx-label.header span -{ - font-weight: bold; -} -afx-app-window[data-id="FormatDialog"] afx-label.header -{ - padding-left: 5px; - border-bottom: 1px solid #a6a6a6; -} -afx-app-window[data-id="FormatDialog"] afx-label.header span -{ - font-weight: bold; -} -afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="aligmentbox"] afx-label span, -afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="spacingbox"] afx-label span, -afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="stylebox"] afx-label span, -afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="font-box"] > div > afx-label span -{ - display: block; - padding-top: 7px; -} - -afx-app-window[data-id="FormatDialog"] div[data-id="preview"] -{ - border: 1px solid #a6a6a6; -} -afx-app-window[data-id="FormatDialog"] div[data-id="txtcolor"], -afx-app-window[data-id="FormatDialog"] div[data-id="bgcolor"] -{ - border:1px solid #a6a6a6; - display: block; -} \ No newline at end of file diff --git a/OpenPage/build/debug/package.json b/OpenPage/build/debug/package.json deleted file mode 100644 index a6530c0..0000000 --- a/OpenPage/build/debug/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "app":"OpenPage", - "name":"OpenPage", - "description":"", - "info":{ - "author": "", - "email": "" - }, - "version":"0.0.1-a", - "category":"Other", - "iconclass":"fa fa-adn", - "mimes":["application/vnd.oasis.opendocument.text"] -} \ No newline at end of file diff --git a/OpenPage/build/debug/scheme.html b/OpenPage/build/debug/scheme.html deleted file mode 100644 index 3f16689..0000000 --- a/OpenPage/build/debug/scheme.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - -
- -
- -
-
-
-
-
-
-
- -
- -
- -
- -
- -
- -
-
\ No newline at end of file diff --git a/OpenPage/build/debug/main.js b/OpenPage/build/release/OpenPage.zip similarity index 77% rename from OpenPage/build/debug/main.js rename to OpenPage/build/release/OpenPage.zip index b614da1..882e08b 100644 Binary files a/OpenPage/build/debug/main.js and b/OpenPage/build/release/OpenPage.zip differ diff --git a/OpenPage/coffees/main.coffee b/OpenPage/coffees/main.coffee index 1daf7b8..6f1ef05 100644 --- a/OpenPage/coffees/main.coffee +++ b/OpenPage/coffees/main.coffee @@ -95,6 +95,7 @@ class OpenPage extends this.OS.GUI.BaseApplication me.notify __("File {0} saved", me.currfile.basename) me.scheme.set "apptitle", me.currfile.basename me.currfile.dirty = false + me.editorFocus() , (err) -> @error __("Cannot create byte array from container: {0}", err|| "") @@ -429,7 +430,7 @@ class OpenPage extends this.OS.GUI.BaseApplication return , __("Add/Modify paragraph format"), @resource - closeDocument: () -> + closeDocument: (f) -> # finish editing return unless @editorSession and @session me = @ @@ -462,6 +463,7 @@ class OpenPage extends this.OS.GUI.BaseApplication core.Async.destroyAll [me.canvas.destroy], (e) -> return me.error __("Cannot destroy canvas {0}", e) if e me.notify "Document closed" + f() if f me.session = undefined me.annotationController = undefined me.directFormattingCtl = undefined @@ -476,10 +478,15 @@ class OpenPage extends this.OS.GUI.BaseApplication me.styleAdded = undefined me.basictool.fonts.set "selected", -1 me.basictool.styles.set "selected", -1 + # cleanup: (e) -> - @closeDocument() + me = @ + if @editorSession + e.preventDefault() + me.closeDocument ()-> + me.quit() this.OS.register "OpenPage", OpenPage \ No newline at end of file diff --git a/OpenPage/package.json b/OpenPage/package.json index a6530c0..cd58c36 100644 --- a/OpenPage/package.json +++ b/OpenPage/package.json @@ -1,13 +1,13 @@ { "app":"OpenPage", "name":"OpenPage", - "description":"", + "description":"Open Document Format (ODF) text editor using WebODF", "info":{ - "author": "", - "email": "" + "author": "Xuan Sang LE", + "email": "xsang.le@gmail.com" }, "version":"0.0.1-a", "category":"Other", - "iconclass":"fa fa-adn", + "icon":"icon.png", "mimes":["application/vnd.oasis.opendocument.text"] } \ No newline at end of file diff --git a/OpenPage/project.apj b/OpenPage/project.apj index 55c2ed8..a45c821 100644 --- a/OpenPage/project.apj +++ b/OpenPage/project.apj @@ -1 +1 @@ -{"name":"OpenPage","root":"home://myws/antosdk-apps/OpenPage","css":["css/main.css","css/dialog.css"],"javascripts":["javascripts/webodf.js","javascripts/EditorSession.js"],"coffees":["coffees/main.coffee","coffees/dialogs.coffee"],"copies":["assets/scheme.html","package.json","README.md"]} \ No newline at end of file +{"name":"OpenPage","root":"home://Documents/workspace/antosdk-apps/OpenPage","css":["css/main.css","css/dialog.css"],"javascripts":["javascripts/webodf.js","javascripts/EditorSession.js"],"coffees":["coffees/main.coffee","coffees/dialogs.coffee"],"copies":["assets/scheme.html","package.json","assets/OpenPage.md","assets/icon.png"]} \ No newline at end of file