This commit is contained in:
Xuan Sang LE 2018-02-21 11:55:44 +01:00
commit 879c977fb2
6 changed files with 41 additions and 6 deletions

4
TODO
View File

@ -1 +1,3 @@
add require function that allows load shared library between application
# add version number
# bug tracking app
# packages manager (restricted mode)

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-slate

View File

@ -156,6 +156,13 @@ self.OS.GUI =
app.appmenu = ($ "[data-id = 'appmenu']", "#syspanel")[0]
app.init()
enterFullscreen: () ->
el = ($ "body")[0]
return el.requestFullscreen() if el.requestFullscreen
return el.mozRequestFullScreen() if el.mozRequestFullScreen
return el.webkitRequestFullscreen() if el.webkitRequestFullscreen
return el.msRequestFullscreen() if el.msRequestFullscreen
undock: (app) ->
($ "#sysdock").get(0).removeapp app
@ -289,12 +296,17 @@ self.OS.GUI =
}
]
menu.child = menu.child.concat (v for k, v of _OS.setting.system.menu)
menu.child.push
text: "Full screen",
dataid: "os-fullsize",
iconclass: "fa fa-tv"
menu.child.push
text: "Log out",
dataid: "sys-logout",
iconclass: "fa fa-user-times"
menu.onmenuselect = (d) ->
return _API.handler.logout() if d.item.data.dataid is "sys-logout"
return _GUI.enterFullscreen() if d.item.data.dataid is "os-fullsize"
_GUI.launch d.item.data.app unless d.item.data.dataid
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", [menu]

View File

@ -1,5 +1,6 @@
<afx-app-window data-id = "blogger-cv-sec-win" apptitle="Porforlio section" width="450" height="400">
<afx-vbox >
<div data-height="5"></div>
<afx-hbox data-height = "30" >
<afx-label data-width= "70" text = "Title*:"></afx-label>
<input type = "text" name="title" input-class = "user-input"/>
@ -18,9 +19,11 @@
<afx-label text = "To:" style="text-align:center;" data-width= "70"></afx-label>
<input type = "text" name="end" input-class = "user-input"/>
</afx-hbox>
<afx-label data-height = "30" text = "Content:" style = "margin-left:5px;"/>
<textarea name="content" input-class = "user-input" style = "margin-left:5px; margin-right:5px;" />
<afx-hbox data-height = "30">
<afx-label data-height = "30" text = "Content*:" style = "margin-left:5px;"/>
<div data-id="editor-container">
<textarea name="content" data-id = "contentarea" />
</div>
<afx-hbox data-height = "35">
<div></div>
<afx-button iconclass = "fa fa-save" data-id = "bt-cv-sec-save" data-width="60" text = "Save"/>
</afx-hbox>

View File

@ -58,16 +58,32 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
main: () ->
me = @
@scheme.set "apptitle", @title
@editor = new SimpleMDE
element: @find "contentarea"
status: false
toolbar: false
($ (@select '[class = "CodeMirror-scroll"]')[0]).css "min-height", "50px"
($ (@select '[class="CodeMirror cm-s-paper CodeMirror-wrap"]')[0]).css "min-height", "50px"
@on "vboxchange", () ->
me.resizeContent()
console.log "resize content"
inputs = me.select "[input-class='user-input']"
(($ v).val me.data[v.name] for v in inputs ) if me.data
@editor.value me.data.content if me.data and me.data.content
(@find "bt-cv-sec-save").set "onbtclick", (e) ->
data = {}
console.log inputs
data[v.name] = ($ v).val() for v in inputs
data.content = me.editor.value()
return me.notify "Title must not be blank" if data.title is ""
#return me.notify "Content must not be blank" if data.content is ""
data.id = me.data.id if me.data and me.data.id
me.handler data if me.handler
me.quit()
me.resizeContent()
resizeContent: () ->
container = @find "editor-container"
children = ($ container).children()
cheight = ($ container).height() - 30
($ children[1]).css("height", cheight + "px")
this.OS.register "BloggerCVSectionDiaglog", BloggerCVSectionDiaglog

View File

@ -41,7 +41,8 @@ afx-app-window[data-id="blogger-win"] afx-hbox[data-id="cv-container"] afx-labe
}
afx-app-window[data-id="blogger-cv-sec-win"] afx-hbox{
padding:5px;
padding-left:5px;
padding-right:5px;
}
afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] > div.list-container > ul > li{
padding-bottom: 10px;