mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-13 05:04:22 +02:00
add calendar view & stuff
This commit is contained in:
@ -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 = [{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user