Commit bbb0be66 authored by Randall Leeds's avatar Randall Leeds

Remove unused notifications code

parent 63f5e956
......@@ -167,18 +167,6 @@ button, input[type=submit], .btn {
}
//Notifications///////////////////////////////
.notifications {
padding: 1em 0em 1em 1em;
.paper {
border: 1px solid #75b8f3;
}
}
//CLOSER////////////////////////////////
.close {
@extend .x-icon;
......
......@@ -39,32 +39,6 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
-webkit-overflow-scrolling: touch;
}
.bottombar {
position: fixed;
bottom: 0px;
left: 0;
height: 3.7em;
width: 100%;
.notif-list {
margin-right: 1em;
box-shadow: 1px 1px 9px #b5d4ff;
}
.top-padding {
padding-top: 8px;
}
.bottom-padding {
padding-bottom: 8px;
}
.notif-text {
font-family: $sansFontFamily;
position: relative;
bottom: 2px;
}
}
//SHEET////////////////////////////////
//This comes down from under the toolbar
......
......@@ -280,7 +280,6 @@ class App
$scope.reloadAnnotations = ->
return unless annotator.plugins.Store
$scope.new_updates = 0
$scope.$root.annotations = []
annotator.threading.thread []
annotator.threading.idTable = {}
......@@ -336,47 +335,6 @@ class App
cleanup (a for a in annotations when a.thread)
annotator.subscribe 'annotationsLoaded', cleanup
# Notifications
$scope.notifications = []
$scope.removeNotificationUpdate = ->
index = -1
for notif in $scope.notifications
if notif.type is 'update'
index = $scope.notifications.indexOf notif
break
if index > -1 then $scope.notifications.splice index,1
$scope.addUpdateNotification = ->
# Do not add an update notification twice
unless $scope.new_updates > 0
if $scope.new_updates < 2 then text = 'change.'
else text = 'changes.'
notification =
type: 'update'
text: 'Click to load ' + $scope.new_updates + ' ' + text
callback: =>
$scope.reloadAnnotations()
$scope.removeNotificationUpdate()
close: $scope.removeNotificationUpdate
$scope.notifications.unshift notification
$scope.$watch 'new_updates', (updates, oldUpdates) ->
return unless updates or oldUpdates
for notif in $scope.notifications
if notif.type is 'update'
if $scope.new_updates < 2 then text = 'change.'
else text = 'changes.'
notif.text = 'Click to load ' + updates + ' ' + text
for p in annotator.providers
p.channel.notify
method: 'updateNotificationCounter'
params: updates
$scope.$watch 'show_search', (value, old) ->
if value and not old
$timeout ->
......@@ -385,8 +343,6 @@ class App
$scope.initUpdater = ->
$scope.new_updates = 0
filter =
streamfilter
.setPastDataNone()
......@@ -423,8 +379,6 @@ class App
p = $scope.auth.persona
user = if p? then "acct:" + p.username + "@" + p.provider else ''
unless data instanceof Array then data = [data]
$scope.$apply =>
#if data.length > 0 then $scope.new_updates += 1
if $scope.socialView.name is 'single-player'
owndata = data.filter (d) -> d.user is user
......
......@@ -328,16 +328,6 @@ tags = ['$window', ($window) ->
restrict: 'C'
]
notification = ['$filter', ($filter) ->
controller: 'NotificationController'
require: '?ngModel'
restrict: 'C'
scope:
model: '=ngModel'
click: '&onClick'
close: '&onClose'
templateUrl: 'notification.html'
]
username = ['$filter', '$window', ($filter, $window) ->
link: (scope, elem, attr, ctrl) ->
......@@ -450,6 +440,5 @@ angular.module('h.directives', ['ngSanitize'])
.directive('username', username)
.directive('userPicker', userPicker)
.directive('repeatAnim', repeatAnim)
.directive('notification', notification)
.directive('streamviewer', streamviewer)
.directive('whenscrolled', whenscrolled)
......@@ -98,10 +98,6 @@ class Annotator.Host extends Annotator.Guest
Math.max.apply(Math, all)
)
.bind('updateNotificationCounter', (ctx, count) =>
this.publish 'updateNotificationCounter', count
)
.bind('showNotification', (ctx, n) =>
@_pendingNotice = @Annotator.showNotification n.message, n.type
)
......
......@@ -4,13 +4,10 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
events:
'.annotator-toolbar li:first-child mouseenter': 'show'
'.annotator-toolbar mouseleave': 'hide'
'updateNotificationCounter': 'onUpdateNotificationCounter'
'setTool': 'onSetTool'
'setVisibleHighlights': 'onSetVisibleHighlights'
html:
element: '<div class="annotator-toolbar annotator-hide"></div>'
notification: '<div class="annotator-notification-counter"></div>'
html: '<div class="annotator-toolbar annotator-hide"></div>'
options:
items: [
......@@ -51,15 +48,12 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
]
pluginInit: ->
@annotator.toolbar = @toolbar = $(@html.element)
@annotator.toolbar = @toolbar = $(@html)
if @options.container?
$(@options.container).append @toolbar
else
$(@element).append @toolbar
@notificationCounter = $(@html.notification)
@toolbar.append(@notificationCounter)
@buttons = @options.items.reduce (buttons, item) =>
anchor = $('<a></a>')
.attr('href', '')
......@@ -78,21 +72,6 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
hide: -> this.toolbar.addClass('annotator-hide')
onUpdateNotificationCounter: (count) ->
element = $(@buttons[0])
element.toggle('fg_highlight', {color: 'lightblue'})
setTimeout ->
element.toggle('fg_highlight', {color: 'lightblue'})
, 500
switch
when count > 9
@notificationCounter.text('>9')
when 0 < count <= 9
@notificationCounter.text("+#{count}")
else
@notificationCounter.text('')
onSetTool: (name) ->
if name is 'highlight'
$(@buttons[2]).addClass('pushed')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment