minor fix

This commit is contained in:
lxsang 2018-09-16 20:26:49 +02:00
parent e72f48d424
commit 56d24a53d4
11 changed files with 28 additions and 200 deletions

View File

@ -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

BIN
OpenPage/assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -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**

Binary file not shown.

View File

@ -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;
}

View File

@ -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"]
}

View File

@ -1,47 +0,0 @@
<afx-app-window apptitle="Open Page" width="650" height="500" data-id="OpenPage">
<afx-hbox >
<afx-vbox>
<afx-hbox data-id="toolbox" data-height="28">
<div data-width="5"></div>
<afx-button data-width = "25" data-id="btundo" iconclass = "fa fa-undo"></afx-button>
<afx-button data-width = "25" data-id="btredo" iconclass = "fa fa-rotate-right" ></afx-button>
<afx-button data-width = "25" data-id="btbold" iconclass = "fa fa-bold"></afx-button>
<afx-button data-width = "25" data-id="btitalic" iconclass = "fa fa-italic"></afx-button>
<afx-button data-width = "25" data-id="btunderline" iconclass = "fa fa-underline"></afx-button>
<afx-button data-width = "25" data-id="btstrike" iconclass = "fa fa-strikethrough"></afx-button>
<afx-button data-width = "25" data-id="btnote" iconclass = "fa fa-sticky-note"></afx-button>
<afx-button data-width = "25" data-id="btlink" iconclass = "fa fa-link"></afx-button>
<afx-button data-width = "25" data-id="btunlink" iconclass = "fa fa-unlink"></afx-button>
<afx-button data-width = "25" data-id="btimage" iconclass = "fa fa-image"></afx-button>
<afx-button data-width = "25" data-id="btac" iconclass = "fa fa-align-center"></afx-button>
<afx-button data-width = "25" data-id="btal" iconclass = "fa fa-align-left" ></afx-button>
<afx-button data-width = "25" data-id="btar" iconclass = "fa fa-align-right"></afx-button>
<afx-button data-width = "25" data-id="btaj" iconclass = "fa fa-align-justify"></afx-button>
<afx-button data-width = "25" data-id="btindent" iconclass = "fa fa-indent"></afx-button>
<afx-button data-width = "25" data-id="btoutdent" iconclass = "fa fa-outdent"></afx-button>
<afx-button data-width = "25" data-id="btformat" iconclass = "fa fa-paint-brush"></afx-button>
<afx-list-view dropdown = "true" data-width="100" data-id="format-list"></afx-list-view>
<div data-width="5"></div>
<afx-nspinner data-width = "50" data-id="font-size" ></afx-nspinner>
<div data-width="5"></div>
<afx-list-view dropdown = "true" data-width="150" data-id="font-list"></afx-list-view>
<div data-width="5"></div>
</afx-hbox>
<div data-height="5"></div>
<div data-id="container">
<div data-id="odfcanvas"></div>
</div>
<div data-height="5"></div>
<afx-hbox data-id="status-bar" data-height="28">
<div></div>
<afx-button data-width = "25" data-id="btzoomfix" iconclass = "fa fa-arrows-alt"></afx-button>
<div data-width="5"></div>
<afx-slider data-id="slzoom" data-width="150" max="400"></afx-slider>
<div data-width="5"></div>
<afx-label data-id = "lbzoom" data-width="40"></afx-label>
</afx-hbox>
</afx-vbox>
</afx-hbox>
</afx-app-window>

View File

@ -95,6 +95,7 @@ class OpenPage extends this.OS.GUI.BaseApplication
me.notify __("File {0} saved", me.currfile.basename) me.notify __("File {0} saved", me.currfile.basename)
me.scheme.set "apptitle", me.currfile.basename me.scheme.set "apptitle", me.currfile.basename
me.currfile.dirty = false me.currfile.dirty = false
me.editorFocus()
, (err) -> , (err) ->
@error __("Cannot create byte array from container: {0}", err|| "") @error __("Cannot create byte array from container: {0}", err|| "")
@ -429,7 +430,7 @@ class OpenPage extends this.OS.GUI.BaseApplication
return return
, __("Add/Modify paragraph format"), @resource , __("Add/Modify paragraph format"), @resource
closeDocument: () -> closeDocument: (f) ->
# finish editing # finish editing
return unless @editorSession and @session return unless @editorSession and @session
me = @ me = @
@ -462,6 +463,7 @@ class OpenPage extends this.OS.GUI.BaseApplication
core.Async.destroyAll [me.canvas.destroy], (e) -> core.Async.destroyAll [me.canvas.destroy], (e) ->
return me.error __("Cannot destroy canvas {0}", e) if e return me.error __("Cannot destroy canvas {0}", e) if e
me.notify "Document closed" me.notify "Document closed"
f() if f
me.session = undefined me.session = undefined
me.annotationController = undefined me.annotationController = undefined
me.directFormattingCtl = undefined me.directFormattingCtl = undefined
@ -476,10 +478,15 @@ class OpenPage extends this.OS.GUI.BaseApplication
me.styleAdded = undefined me.styleAdded = undefined
me.basictool.fonts.set "selected", -1 me.basictool.fonts.set "selected", -1
me.basictool.styles.set "selected", -1 me.basictool.styles.set "selected", -1
# #
cleanup: (e) -> cleanup: (e) ->
@closeDocument() me = @
if @editorSession
e.preventDefault()
me.closeDocument ()->
me.quit()
this.OS.register "OpenPage", OpenPage this.OS.register "OpenPage", OpenPage

View File

@ -1,13 +1,13 @@
{ {
"app":"OpenPage", "app":"OpenPage",
"name":"OpenPage", "name":"OpenPage",
"description":"", "description":"Open Document Format (ODF) text editor using WebODF",
"info":{ "info":{
"author": "", "author": "Xuan Sang LE",
"email": "" "email": "xsang.le@gmail.com"
}, },
"version":"0.0.1-a", "version":"0.0.1-a",
"category":"Other", "category":"Other",
"iconclass":"fa fa-adn", "icon":"icon.png",
"mimes":["application/vnd.oasis.opendocument.text"] "mimes":["application/vnd.oasis.opendocument.text"]
} }

View File

@ -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"]} {"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"]}