Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save methyl/5598191 to your computer and use it in GitHub Desktop.
Save methyl/5598191 to your computer and use it in GitHub Desktop.
From d02dd19687fef34e31813139ba81f355d8fdfac5 Mon Sep 17 00:00:00 2001
From: Jan Dudek <[email protected]>
Date: Sun, 5 May 2013 21:27:26 +0200
Subject: [PATCH 01/21] Fixed incorrect namespaces, moved files in wrong
locations, added explicit require
---
src/app.coffee | 117 ++++++
src/app/plugin/PullRefresh.js | 405 ---------------------
src/app/templates/opinionListTemplate.coffee | 17 -
src/app/view/MapModal.coffee | 30 --
src/app/view/Notifications.coffee | 40 ++
src/app/view/mandala/AbstractMandala.coffee | 2 +-
src/app/view/mandala/InputMandala.coffee | 2 +-
src/app/view/mandala/ResultsMandala.coffee | 2 +-
src/app/view/mandala/TopicMandala.coffee | 2 +-
src/app/view/notifications/Notifications.coffee | 40 --
src/app/view/places/PlaceList.coffee | 2 +-
src/app/view/places/Places.coffee | 2 +-
src/app/view/squerb/DraggableNewSquerb.coffee | 2 +-
src/app/view/squerb/MyTopics.coffee | 2 +-
src/app/view/squerb/NewSquerb.coffee | 2 +-
src/app/view/squerb/PopularTopics.coffee | 2 +-
src/app/view/squerb/RecentTopics.coffee | 2 +-
src/app/view/topic/OpinionsByAuthor.coffee | 20 +-
.../topic/overall/AbstractMandalaWrapper.coffee | 2 +-
src/app/view/topic/overall/Comments.coffee | 2 +-
src/app/view/topic/overall/Freesquerb.coffee | 2 +-
src/app/view/topic/overall/Picture.coffee | 2 +-
src/app/view/topic/overall/PicturesOverlay.coffee | 2 +-
src/app/view/topic/overall/Place.coffee | 2 +-
src/app/view/topic/overall/Scrollable.coffee | 2 +-
src/app/view/topic/overall/Webpage.coffee | 2 +-
src/app/view/topic/place/MapModal.coffee | 30 ++
28 files changed, 630 insertions(+), 512 deletions(-)
create mode 100644 app/plugin/DataviewPullRefresh.js
delete mode 100644 src/app/plugin/PullRefresh.js
delete mode 100644 src/app/templates/opinionListTemplate.coffee
delete mode 100644 src/app/view/MapModal.coffee
create mode 100644 src/app/view/Notifications.coffee
delete mode 100644 src/app/view/notifications/Notifications.coffee
create mode 100644 src/app/view/topic/place/MapModal.coffee
diff --git a/src/app/templates/opinionListTemplate.coffee b/src/app/templates/opinionListTemplate.coffee
deleted file mode 100644
index db701e1..0000000
--- a/src/app/templates/opinionListTemplate.coffee
+++ /dev/null
@@ -1,17 +0,0 @@
-Templates.opinionListTemplate = new Ext.XTemplate(
- '
- <table>
- <tr>
- <td class="author"><img src="{pictureUrl}" class="author" /></td>
- <td class="name">{[values.fullName.replace(/ /g, "&nbsp;")]} squerbed the…</td>
- <td class="date">{[moment(values.createdAt).format("MMM D")]}</td>
- </tr>
- <tpl for="opinions">
- <tr>
- <td class="aspectIcon"><img class="aspect-icon" src="{aspect.iconUrl}" /></td>
- <td colspan="2" class="aspect"><strong>{aspect.name}</strong> as {feeling.name} &amp; {nuance.name}</td>
- </tr>
- </tpl>
- </table>
- '
-)
\ No newline at end of file
diff --git a/src/app/view/MapModal.coffee b/src/app/view/MapModal.coffee
deleted file mode 100644
index 4482591..0000000
--- a/src/app/view/MapModal.coffee
+++ /dev/null
@@ -1,30 +0,0 @@
-Ext.define 'Squerb.view.topic.place.MapModal',
- extend: 'Ext.Container'
- alias: 'widget.mapModal'
-
- config:
- cls: 'mapModal'
- hidden: true
- items: [
- {
- xtype: 'titlebar'
- title: 'Map'
- ui: 'grey'
- style: 'z-index: 6'
- height: 38
- items:
- xtype: 'button'
- text: 'Close'
- action: 'closeMap'
- }
- ]
-
- control:
- '[action=closeMap]':
- tap: 'hide'
-
- listeners:
- updatedata: (el, data) ->
- @add Ext.widget 'googleMap',
- data:
- location: data.location
\ No newline at end of file
diff --git a/src/app/view/Notifications.coffee b/src/app/view/Notifications.coffee
new file mode 100644
index 0000000..c5d474a
--- /dev/null
+++ b/src/app/view/Notifications.coffee
@@ -0,0 +1,40 @@
+Ext.define 'Squerb.view.Notifications',
+ extend: 'Ext.Container'
+ alias: 'widget.notifications'
+
+ config:
+ cls: 'notifications'
+
+ listeners:
+ initialize: 'prepare'
+
+ prepare: ->
+ countObserver = new Squerb.NotificationCountObserver(getPusher, currentUser)
+ notificationsArea = new Squerb.NotificationsArea($(@element.dom), countObserver)
+ notificationsArea.reloadList()
+
+ scrollable = Ext.widget 'container', scrollable: direction: 'vertical'
+ element = new Ext.Element(notificationsArea.el.find('ul')[0])
+ scrollable.setContentEl(element)
+ notificationsArea.el.find('.list').append(scrollable.element.dom)
+ notificationsArea.bind 'loaded', ->
+ scrollable.setHeight Math.min(notificationsArea.el.find('ul').height(), 240)
+ notificationsArea.el.find('a').click (e) -> e.preventDefault()
+
+ notificationsArea.bind 'notification-clicked', (href) =>
+ notificationsArea.hideList()
+ @fireEvent 'notificationclicked', href
+
+ @notificationsArea = notificationsArea
+ @setWidth()
+
+ hide: ->
+ @notificationsArea.hideList()
+
+ setWidth: ->
+ el = $(@element.dom)
+ el.find('.list').width(@getWidth())
+
+ getWidth: ->
+ width = window.innerWidth * 0.835
+ Math.min(Math.floor(width), 350) + 40
\ No newline at end of file
diff --git a/src/app/view/mandala/AbstractMandala.coffee b/src/app/view/mandala/AbstractMandala.coffee
index c62d04d..b480d55 100644
--- a/src/app/view/mandala/AbstractMandala.coffee
+++ b/src/app/view/mandala/AbstractMandala.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.AbstractMandala',
+Ext.define 'Squerb.view.mandala.AbstractMandala',
extend: 'Ext.Container'
alias: 'widget.abstractMandala'
diff --git a/src/app/view/mandala/InputMandala.coffee b/src/app/view/mandala/InputMandala.coffee
index d048309..0e2bad7 100644
--- a/src/app/view/mandala/InputMandala.coffee
+++ b/src/app/view/mandala/InputMandala.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.InputMandala',
+Ext.define 'Squerb.view.mandala.InputMandala',
extend: 'Ext.Container'
mixins: ['Ext.mixin.Observable']
alias: 'widget.inputMandala'
diff --git a/src/app/view/mandala/ResultsMandala.coffee b/src/app/view/mandala/ResultsMandala.coffee
index c1d2874..bf075d4 100644
--- a/src/app/view/mandala/ResultsMandala.coffee
+++ b/src/app/view/mandala/ResultsMandala.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.ResultsMandala',
+Ext.define 'Squerb.view.mandala.ResultsMandala',
extend: 'Ext.Container'
alias: 'widget.resultsMandala'
diff --git a/src/app/view/mandala/TopicMandala.coffee b/src/app/view/mandala/TopicMandala.coffee
index f62ebb2..a71fc4d 100644
--- a/src/app/view/mandala/TopicMandala.coffee
+++ b/src/app/view/mandala/TopicMandala.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.TopicMandala',
+Ext.define 'Squerb.view.mandala.TopicMandala',
extend: 'Ext.Container'
alias: 'widget.topicMandala'
diff --git a/src/app/view/notifications/Notifications.coffee b/src/app/view/notifications/Notifications.coffee
deleted file mode 100644
index c5d474a..0000000
--- a/src/app/view/notifications/Notifications.coffee
+++ /dev/null
@@ -1,40 +0,0 @@
-Ext.define 'Squerb.view.Notifications',
- extend: 'Ext.Container'
- alias: 'widget.notifications'
-
- config:
- cls: 'notifications'
-
- listeners:
- initialize: 'prepare'
-
- prepare: ->
- countObserver = new Squerb.NotificationCountObserver(getPusher, currentUser)
- notificationsArea = new Squerb.NotificationsArea($(@element.dom), countObserver)
- notificationsArea.reloadList()
-
- scrollable = Ext.widget 'container', scrollable: direction: 'vertical'
- element = new Ext.Element(notificationsArea.el.find('ul')[0])
- scrollable.setContentEl(element)
- notificationsArea.el.find('.list').append(scrollable.element.dom)
- notificationsArea.bind 'loaded', ->
- scrollable.setHeight Math.min(notificationsArea.el.find('ul').height(), 240)
- notificationsArea.el.find('a').click (e) -> e.preventDefault()
-
- notificationsArea.bind 'notification-clicked', (href) =>
- notificationsArea.hideList()
- @fireEvent 'notificationclicked', href
-
- @notificationsArea = notificationsArea
- @setWidth()
-
- hide: ->
- @notificationsArea.hideList()
-
- setWidth: ->
- el = $(@element.dom)
- el.find('.list').width(@getWidth())
-
- getWidth: ->
- width = window.innerWidth * 0.835
- Math.min(Math.floor(width), 350) + 40
\ No newline at end of file
diff --git a/src/app/view/places/PlaceList.coffee b/src/app/view/places/PlaceList.coffee
index 8553f9b..cd2642b 100644
--- a/src/app/view/places/PlaceList.coffee
+++ b/src/app/view/places/PlaceList.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.PlaceList',
+Ext.define 'Squerb.view.places.PlaceList',
extend: 'Ext.dataview.DataView'
alias: 'widget.placeList'
diff --git a/src/app/view/places/Places.coffee b/src/app/view/places/Places.coffee
index d0ef6a5..95d3259 100644
--- a/src/app/view/places/Places.coffee
+++ b/src/app/view/places/Places.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.squerb.Places',
+Ext.define 'Squerb.view.places.Places',
extend: 'Ext.Container'
alias: 'widget.places'
diff --git a/src/app/view/squerb/DraggableNewSquerb.coffee b/src/app/view/squerb/DraggableNewSquerb.coffee
index 3a703ab..fac0380 100644
--- a/src/app/view/squerb/DraggableNewSquerb.coffee
+++ b/src/app/view/squerb/DraggableNewSquerb.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.squerb.place.DraggableNewSquerb',
+Ext.define 'Squerb.view.squerb.DraggableNewSquerb',
extend: 'Squerb.view.Draggable'
alias: 'widget.draggableNewSquerb'
diff --git a/src/app/view/squerb/MyTopics.coffee b/src/app/view/squerb/MyTopics.coffee
index 80f7ede..789173d 100644
--- a/src/app/view/squerb/MyTopics.coffee
+++ b/src/app/view/squerb/MyTopics.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.MyTopics',
+Ext.define 'Squerb.view.squerb.MyTopics',
extend: 'Ext.Container'
alias: 'widget.myTopics'
diff --git a/src/app/view/squerb/NewSquerb.coffee b/src/app/view/squerb/NewSquerb.coffee
index a24afa7..94bcd15 100644
--- a/src/app/view/squerb/NewSquerb.coffee
+++ b/src/app/view/squerb/NewSquerb.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.squerb.place.NewSquerb',
+Ext.define 'Squerb.view.squerb.NewSquerb',
extend: 'Ext.Container'
alias: 'widget.newSquerb'
diff --git a/src/app/view/squerb/PopularTopics.coffee b/src/app/view/squerb/PopularTopics.coffee
index a84c609..987f87d 100644
--- a/src/app/view/squerb/PopularTopics.coffee
+++ b/src/app/view/squerb/PopularTopics.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.PopularTopics',
+Ext.define 'Squerb.view.squerb.PopularTopics',
extend: 'Ext.Container'
alias: 'widget.popularTopics'
diff --git a/src/app/view/squerb/RecentTopics.coffee b/src/app/view/squerb/RecentTopics.coffee
index 34666cc..ea6c299 100644
--- a/src/app/view/squerb/RecentTopics.coffee
+++ b/src/app/view/squerb/RecentTopics.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.RecentTopics',
+Ext.define 'Squerb.view.squerb.RecentTopics',
extend: 'Ext.Container'
alias: 'widget.recentTopics'
diff --git a/src/app/view/topic/OpinionsByAuthor.coffee b/src/app/view/topic/OpinionsByAuthor.coffee
index f4d230e..e05844a 100644
--- a/src/app/view/topic/OpinionsByAuthor.coffee
+++ b/src/app/view/topic/OpinionsByAuthor.coffee
@@ -1,10 +1,28 @@
+opinionListTemplate = new Ext.XTemplate(
+ '
+ <table>
+ <tr>
+ <td class="author"><img src="{pictureUrl}" class="author" /></td>
+ <td class="name">{[values.fullName.replace(/ /g, "&nbsp;")]} squerbed the…</td>
+ <td class="date">{[moment(values.createdAt).format("MMM D")]}</td>
+ </tr>
+ <tpl for="opinions">
+ <tr>
+ <td class="aspectIcon"><img class="aspect-icon" src="{aspect.iconUrl}" /></td>
+ <td colspan="2" class="aspect"><strong>{aspect.name}</strong> as {feeling.name} &amp; {nuance.name}</td>
+ </tr>
+ </tpl>
+ </table>
+ '
+)
+
Ext.define 'Squerb.view.topic.OpinionsByAuthor',
extend: 'Ext.dataview.DataView'
xtype: 'opinionsByAuthor'
config:
cls: 'opinionsByAuthor'
- itemTpl: @Templates.opinionListTemplate
+ itemTpl: opinionListTemplate
store: 'opinionsByAuthorStore'
prepare: (data) ->
diff --git a/src/app/view/topic/overall/AbstractMandalaWrapper.coffee b/src/app/view/topic/overall/AbstractMandalaWrapper.coffee
index bc7fa9a..c8c96d3 100644
--- a/src/app/view/topic/overall/AbstractMandalaWrapper.coffee
+++ b/src/app/view/topic/overall/AbstractMandalaWrapper.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.AbstractMandalaWrapper',
+Ext.define 'Squerb.view.topic.overall.AbstractMandalaWrapper',
extend: 'Ext.Container'
alias: 'widget.abstractMandalaWrapper'
diff --git a/src/app/view/topic/overall/Comments.coffee b/src/app/view/topic/overall/Comments.coffee
index bbe5843..6b309a1 100644
--- a/src/app/view/topic/overall/Comments.coffee
+++ b/src/app/view/topic/overall/Comments.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Comments',
+Ext.define 'Squerb.view.topic.overall.Comments',
extend: 'Ext.DataView'
alias: 'widget.comments'
diff --git a/src/app/view/topic/overall/Freesquerb.coffee b/src/app/view/topic/overall/Freesquerb.coffee
index 54d4db0..b37d429 100644
--- a/src/app/view/topic/overall/Freesquerb.coffee
+++ b/src/app/view/topic/overall/Freesquerb.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Freesquerb',
+Ext.define 'Squerb.view.topic.overall.Freesquerb',
extend: 'Ext.Container'
alias: 'widget.freesquerb'
diff --git a/src/app/view/topic/overall/Picture.coffee b/src/app/view/topic/overall/Picture.coffee
index f374075..b657079 100644
--- a/src/app/view/topic/overall/Picture.coffee
+++ b/src/app/view/topic/overall/Picture.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Picture',
+Ext.define 'Squerb.view.topic.overall.Picture',
extend: 'Ext.Container'
alias: 'widget.topicPicture'
diff --git a/src/app/view/topic/overall/PicturesOverlay.coffee b/src/app/view/topic/overall/PicturesOverlay.coffee
index 1e1131b..1dc144a 100644
--- a/src/app/view/topic/overall/PicturesOverlay.coffee
+++ b/src/app/view/topic/overall/PicturesOverlay.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.picturesOverlay',
+Ext.define 'Squerb.view.topic.overall.PicturesOverlay',
extend: 'Ext.Container'
alias: 'widget.topicPicturesOverlay'
diff --git a/src/app/view/topic/overall/Place.coffee b/src/app/view/topic/overall/Place.coffee
index f5299e1..e0a29b6 100644
--- a/src/app/view/topic/overall/Place.coffee
+++ b/src/app/view/topic/overall/Place.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Place',
+Ext.define 'Squerb.view.topic.overall.Place',
extend: 'Ext.Container'
alias: 'widget.place'
diff --git a/src/app/view/topic/overall/Scrollable.coffee b/src/app/view/topic/overall/Scrollable.coffee
index 4fd40cb..f80849c 100644
--- a/src/app/view/topic/overall/Scrollable.coffee
+++ b/src/app/view/topic/overall/Scrollable.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Scrollable',
+Ext.define 'Squerb.view.topic.overall.Scrollable',
extend: 'Ext.Container'
alias: 'widget.topicScrollable'
diff --git a/src/app/view/topic/overall/Webpage.coffee b/src/app/view/topic/overall/Webpage.coffee
index bbfa014..6d3689e 100644
--- a/src/app/view/topic/overall/Webpage.coffee
+++ b/src/app/view/topic/overall/Webpage.coffee
@@ -1,4 +1,4 @@
-Ext.define 'Squerb.view.topic.Webpage',
+Ext.define 'Squerb.view.topic.overall.Webpage',
extend: 'Ext.Container'
alias: 'widget.webpage'
diff --git a/src/app/view/topic/place/MapModal.coffee b/src/app/view/topic/place/MapModal.coffee
new file mode 100644
index 0000000..4482591
--- /dev/null
+++ b/src/app/view/topic/place/MapModal.coffee
@@ -0,0 +1,30 @@
+Ext.define 'Squerb.view.topic.place.MapModal',
+ extend: 'Ext.Container'
+ alias: 'widget.mapModal'
+
+ config:
+ cls: 'mapModal'
+ hidden: true
+ items: [
+ {
+ xtype: 'titlebar'
+ title: 'Map'
+ ui: 'grey'
+ style: 'z-index: 6'
+ height: 38
+ items:
+ xtype: 'button'
+ text: 'Close'
+ action: 'closeMap'
+ }
+ ]
+
+ control:
+ '[action=closeMap]':
+ tap: 'hide'
+
+ listeners:
+ updatedata: (el, data) ->
+ @add Ext.widget 'googleMap',
+ data:
+ location: data.location
\ No newline at end of file
--
1.8.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment