add calendar view & stuff

This commit is contained in:
Xuan Sang LE
2017-08-17 00:42:05 +02:00
parent 1a054dbc9c
commit c4fe3ba415
15 changed files with 143 additions and 97 deletions

View File

@ -1,14 +1,12 @@
<afx-app-window apptitle="Preview" width="600" height="400">
<afx-app-window apptitle="Preview" width="600" height="600">
<afx-vbox>
<afx-tree-view data-id="mytree"> </afx-tree-view>
<afx-hbox>
<afx-button data-height="50" text="Read more" iconclass="fa fa-camera-retro fa-lg" id="button">
</afx-button>
<afx-list-view data-id = "mylist" dropdown = "true" width="200"></afx-list-view>
<div data-height="100" style=" vertical-align: top; width:100%;height:100%;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
<afx-calendar-view></afx-calendar-view>
<afx-list-view data-id = "mylist" dropdown = "true" width="200" data-height = "50"></afx-list-view>
</afx-hbox>
</afx-vbox>
</afx-app-window>

View File

@ -8,8 +8,6 @@ class NotePad extends this.OS.GUI.BaseApplication
div = @find "datarea"
ace.require "ace/ext/language_tools"
@.editor = ace.edit div
@.editor.setTheme "ace/theme/monokai"
@.editor.getSession().setMode 'ace/mode/text'
@.editor.setOptions {
enableBasicAutocompletion: true,
enableSnippets: true,
@ -22,22 +20,39 @@ class NotePad extends this.OS.GUI.BaseApplication
list = @find "modelist"
@modes = ace.require "ace/ext/modelist"
ldata = []
ldata.push {text:m.name, mode:m.mode} for m in @modes.modes
list.set "items",ldata
list.set "onlistselect", (e)->
ldata.push {
text: m.name,
mode: m.mode,
selected: if m.mode is 'ace/mode/text' then true else false
} for m in @modes.modes
list.set "items", ldata
list.set "onlistselect", (e) ->
me.editor.session.setMode e.data.mode
themelist = @find "themelist"
themes = ace.require "ace/ext/themelist"
ldata = []
ldata.push {
text: m.caption,
mode: m.theme,
selected: if m.theme is "ace/theme/monokai" then true else false
} for k, m of themes.themesByName
console.log themes.themesByName
themelist.set "items", ldata
themelist.set "onlistselect", (e) ->
me.editor.setTheme e.data.mode
stat = @find "editorstat"
#status
stup = (e)->
stup = (e) ->
c = me.editor.session.selection.getCursor()
l = me.editor.session.getLength()
$(stat).html "Row #{c.row}, col #{c.column}, lines: #{l}"
stup(0)
@.editor.getSession().selection.on "changeCursor", (e)->stup(e)
@on "resize", ()-> me.editor.resize()
@on "focus", ()->me.editor.focus()
@on "resize", () -> me.editor.resize()
@on "focus", () -> me.editor.focus()
menu: ()->
menu = [{

View File

@ -1,9 +1,9 @@
afx-app-window[data-id="notepad"] afx-list-view[data-id="modelist"] {
afx-app-window[data-id="notepad"] afx-list-view {
margin: 2px;
margin-right: 5px;
}
afx-app-window[data-id="notepad"] afx-list-view[data-id="modelist"] div.list-container{
afx-app-window[data-id="notepad"] afx-list-view div.list-container{
z-index: 10;
}

View File

@ -17,6 +17,7 @@
<div data-id="datarea"></div>
<afx-vbox data-height="30" data-id="bottom-vbox">
<div ><span data-id = "editorstat"></span></div>
<afx-list-view data-width="170" data-id = "themelist" dropdown = "true" width="150"></afx-list-view>
<afx-list-view data-width="170" data-id = "modelist" dropdown = "true" width="150"></afx-list-view>
</afx-vbox>