From c4fe3ba41515b263ed22cd7a2d1e48b3ed3be1e2 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Thu, 17 Aug 2017 00:42:05 +0200 Subject: [PATCH] add calendar view & stuff --- Makefile | 32 ++----------- src/core/BaseApplication.coffee | 2 +- src/core/BaseModel.coffee | 7 ++- src/core/schemes/notifications.html | 10 +++- src/core/tags/afx-button.js | 10 ++-- src/core/tags/afx-feed.js | 26 ++++++++--- src/core/tags/afx-grid-view.js | 18 +++----- src/core/tags/afx-list-view.js | 69 ++++++++++++++++++++-------- src/index.html | 1 + src/packages/DummyApp/scheme.html | 10 ++-- src/packages/NotePad/main.coffee | 31 +++++++++---- src/packages/NotePad/main.css | 4 +- src/packages/NotePad/scheme.html | 1 + src/services/PushNotification.coffee | 18 ++++---- src/themes/antos/afx-grid-view.css | 1 + 15 files changed, 143 insertions(+), 97 deletions(-) diff --git a/Makefile b/Makefile index 4372df6..c348794 100644 --- a/Makefile +++ b/Makefile @@ -13,34 +13,8 @@ coffees= src/core/core.coffee\ src/core/BaseService.coffee\ src/core/BaseEvent.coffee\ src/antos.coffee + -tags= src/core/tags/afx-button.js\ - src/core/tags/afx-menu.js\ - src/core/tags/afx-sys-panel.js\ - src/core/tags/afx-apps-dock.js\ - src/core/tags/afx-app-window.js\ - src/core/tags/afx-vbox.js\ - src/core/tags/afx-hbox.js\ - src/core/tags/afx-list-view.js\ - src/core/tags/afx-tree-view.js \ - src/core/tags/afx-overlay.js\ - src/core/tags/afx-dummy.js\ - src/core/tags/afx-feed.js\ - src/core/tags/afx-grid-view.js - -antos_themes = src/themes/antos/font-awesome.css\ - src/themes/antos/ubuntu-regular.css\ - src/themes/antos/hermit-light.css\ - src/themes/antos/antos.css\ - src/themes/antos/afx-button.css\ - src/themes/antos/afx-menu.css\ - src/themes/antos/afx-sys-panel.css\ - src/themes/antos/afx-dock.css\ - src/themes/antos/afx-list-view.css\ - src/themes/antos/afx-tree-view.css\ - src/themes/antos/afx-grid-view.css\ - src/themes/antos/afx-feed.css\ - src/themes/antos/afx-app-window.css @@ -76,7 +50,7 @@ build_tags: @echo "=======$(BLUE)Building tag files=======$(NC)" -mkdir $(BUILDDIR)/resources -rm $(BUILDDIR)/resources/antos_tags.js - for f in $(tags); do (cat "$${f}"; echo) >> $(BUILDDIR)/resources/antos_tags.js; done + for f in src/core/tags/*; do (cat "$${f}"; echo) >> $(BUILDDIR)/resources/antos_tags.js; done build_themes: antos_themes_build @@ -85,7 +59,7 @@ antos_themes_build: @echo "=======$(BLUE)Building themes name: antos=======$(NC)" -rm -rf $(BUILDDIR)/resources/themes/antos/* -mkdir -p $(BUILDDIR)/resources/themes/antos - for f in $(antos_themes); do (cat "$${f}"; echo) >> $(BUILDDIR)/resources/themes/antos/antos.css; done + for f in src/themes/antos/*.css; do (cat "$${f}"; echo) >> $(BUILDDIR)/resources/themes/antos/antos.css;done -mkdir -p $(BUILDDIR)/resources/themes/antos/fonts cp -rf src/themes/antos/fonts/* $(BUILDDIR)/resources/themes/antos/fonts cp src/themes/antos/wallpaper.jpg $(BUILDDIR)/resources/themes/antos/ diff --git a/src/core/BaseApplication.coffee b/src/core/BaseApplication.coffee index ea6b0a7..ec99f8f 100644 --- a/src/core/BaseApplication.coffee +++ b/src/core/BaseApplication.coffee @@ -45,7 +45,7 @@ class BaseApplication extends this.OS.GUI.BaseModel if not evt.prevent @.appmenu.set "items", [] if @.pid == @.appmenu.pid ($ @scheme).remove() - + meta: () -> _APP[@name].meta baseMenu: -> mn = [{ diff --git a/src/core/BaseModel.coffee b/src/core/BaseModel.coffee index cd3cddd..3f986f7 100644 --- a/src/core/BaseModel.coffee +++ b/src/core/BaseModel.coffee @@ -6,7 +6,6 @@ _GUI = self.OS.GUI class BaseModel constructor: (@name) -> @observable = riot.observable() - @pid = 0 @_api = self.OS.API me = @ @on "exit", () -> me.quit() @@ -31,16 +30,20 @@ class BaseModel trigger: (e, d) -> @observable.trigger e, d subscribe: (e, f) -> _MAIL.on e, f, @ - meta: () -> _APP[@name].meta + publish: (t, m) -> mt = @meta() _MAIL.trigger t, { id: @pid, name: @name, data: { m: m, icon: mt.icon, iconclass: mt.iconclass } } + notify: (m) -> @publish "notification", m + warn: (m) -> @publish "warning", m + error: (m) -> @publish "error", m + fail: (m) -> @publish "fail", m diff --git a/src/core/schemes/notifications.html b/src/core/schemes/notifications.html index 336806a..b1e3ede 100644 --- a/src/core/schemes/notifications.html +++ b/src/core/schemes/notifications.html @@ -1,5 +1,6 @@ + - +