diff --git a/Makefile b/Makefile index 628e4f4..b2802f1 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ coffees= src/core/core.coffee\ -packages = NotePad wTerm ActivityMonitor DummyApp +packages = NotePad wTerm ActivityMonitor DummyApp Files services = PushNotification Spotlight Calendar main: clean build_coffees build_tags build_themes schemes libs build_services build_packages diff --git a/src/core/BaseDialog.coffee b/src/core/BaseDialog.coffee index fff5004..5ed47c5 100644 --- a/src/core/BaseDialog.coffee +++ b/src/core/BaseDialog.coffee @@ -44,13 +44,14 @@ class BasicDialog extends BaseDialog " html += "<#{@conf.tag} data-id = 'content'>" html += "
" - html += "" for k,v of @conf.buttons + html += "" for k,v of @conf.buttons html += "
" #render the html _GUI.htmlToScheme html, @, @host main: () -> @scheme.set "minimizable", false + @scheme.set "resizable", @conf.resizable if @conf.resizable isnt undefined me = @ f = (_v) -> () -> _v.onclick me # bind action to button @@ -64,6 +65,7 @@ class CalendarDialog extends BasicDialog tag: 'afx-calendar-view', width: 300, height: 220, + resizable: false, buttons: [ { label: 'Ok', @@ -83,3 +85,28 @@ class CalendarDialog extends BasicDialog } this.OS.register "CalendarDialog", CalendarDialog +class ColorPickerDialog extends BasicDialog + constructor: () -> + super "ColorPickerDialog", { + tag: 'afx-color-picker', + width: 313, + height: 220, + resizable: false, + buttons: [ + { + label: 'Ok', + onclick: (d) -> + c = (d.find "content").get "selectedColor" + if c + d.handler c if d.handler + d.quit() + else + d.notify "Please select a color" + }, + { + label: 'Cancel', + onclick: (d) -> d.quit() + } + ] + } +this.OS.register "ColorPickerDialog", ColorPickerDialog \ No newline at end of file diff --git a/src/core/tags/afx-app-window.js b/src/core/tags/afx-app-window.js index 8d38950..7c6cec6 100644 --- a/src/core/tags/afx-app-window.js +++ b/src/core/tags/afx-app-window.js @@ -3,20 +3,20 @@
-
+
+ \ No newline at end of file diff --git a/src/core/tags/afx-file-view.js b/src/core/tags/afx-file-view.js new file mode 100644 index 0000000..f3be14a --- /dev/null +++ b/src/core/tags/afx-file-view.js @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/src/packages/DummyApp/main.coffee b/src/packages/DummyApp/main.coffee index ce801f6..351e7f5 100644 --- a/src/packages/DummyApp/main.coffee +++ b/src/packages/DummyApp/main.coffee @@ -6,7 +6,7 @@ class DummyApp extends this.OS.GUI.BaseApplication self = @ @on "btclick", (e)-> #_GUI.pushService "Budgy" - self.openDialog "CalendarDialog", (d) -> console.log d + self.openDialog "ColorPickerDialog", (d) -> console.log d @on "resize", (w,h)-> console.log "#{self.name}: resize" #@on "listselect", (i)-> diff --git a/src/packages/DummyApp/scheme.html b/src/packages/DummyApp/scheme.html index 8e02afd..8ffc815 100644 --- a/src/packages/DummyApp/scheme.html +++ b/src/packages/DummyApp/scheme.html @@ -1,12 +1,12 @@ - + - + - - + + \ No newline at end of file diff --git a/src/packages/Files/Makefile b/src/packages/Files/Makefile new file mode 100644 index 0000000..09641f6 --- /dev/null +++ b/src/packages/Files/Makefile @@ -0,0 +1,33 @@ +coffee_files = main.coffee + +jsfiles = + +cssfiles = main.css + +copyfiles = scheme.html package.json + + +BLUE=\033[1;34m +NC=\033[0m + +main: title clean js css copy + +title: + @echo "$(BLUE)======= Package Files =======$(NC)" + +coffee: + - mkdir build + for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done + for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done + - rm build/*.coffee.js + +js: coffee + for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done + +css: + for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done + +copy: + cp -rf $(copyfiles) build/ +clean: + - rm -rf build/* \ No newline at end of file diff --git a/src/packages/Files/main.coffee b/src/packages/Files/main.coffee new file mode 100644 index 0000000..3069360 --- /dev/null +++ b/src/packages/Files/main.coffee @@ -0,0 +1,17 @@ +_GUI = this.OS.GUI +class Files extends this.OS.GUI.BaseApplication + constructor: () -> + super "Files" + main: () -> + me = @ + @scheme.set "apptitle", "Files manager" + @view = @find "fileview" + @scheme.contextmenuHandler = (e, m) -> + mdata = [ { text: " Child 1" }, { text: "child2", child: [{text: "sub child", child:[{text:"sub sub child"}] }]}] + m.set "items", mdata + m.show(e) + + samples: () -> + + +this.OS.register "Files",Files \ No newline at end of file diff --git a/src/packages/Files/main.css b/src/packages/Files/main.css new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/Files/package.json b/src/packages/Files/package.json new file mode 100644 index 0000000..a3b1239 --- /dev/null +++ b/src/packages/Files/package.json @@ -0,0 +1,12 @@ +{ + "app":"Files", + "name":"Files manager", + "description":"System files manager", + "author":{ + "name": "Xuan Sang LE", + "email": "xsang.le@gmail.com" + }, + "category":"System", + "iconclass":"fa fa-archive", + "mimes":["*"] +} \ No newline at end of file diff --git a/src/packages/Files/scheme.html b/src/packages/Files/scheme.html new file mode 100644 index 0000000..64dc595 --- /dev/null +++ b/src/packages/Files/scheme.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/services/PushNotification.coffee b/src/services/PushNotification.coffee index a39b92f..be43ebb 100644 --- a/src/services/PushNotification.coffee +++ b/src/services/PushNotification.coffee @@ -31,7 +31,7 @@ class PushNotification extends this.OS.GUI.BaseService pushout: (s, o, mfeed) -> d = { - text: "#{o.name} (#{o.id}) - #{s}: #{o.data.m}", + text: "[#{s}] #{o.name} (#{o.id}): #{o.data.m}", icon: o.data.icon, iconclass: o.data.iconclass, closable: true } diff --git a/src/themes/antos/afx-color-picker.css b/src/themes/antos/afx-color-picker.css new file mode 100644 index 0000000..7b653cd --- /dev/null +++ b/src/themes/antos/afx-color-picker.css @@ -0,0 +1,4 @@ +afx-color-picker canvas.color-palette, afx-color-picker div.color-sample{ + border: 1px solid #a6a6a6; + /*border-radius: 3px;*/ +} \ No newline at end of file diff --git a/src/themes/antos/antos.css b/src/themes/antos/antos.css index b36b6d5..e378508 100644 --- a/src/themes/antos/antos.css +++ b/src/themes/antos/antos.css @@ -40,4 +40,16 @@ html,body{ user-select:none; cursor: default; padding:0px; +} +input { + outline: none; + padding: 2px; + height:23px; + border: 1px solid #a6a6a6; + background-color: white; + color: #414339; + border-radius: 5px; + box-sizing: border-box; + font-family: "Ubuntu"; + font-size: 13px; } \ No newline at end of file