Delete trailing whitespaces

with-route-provider
David Cormier 12 years ago
parent cbf6bd9920
commit 6d5573a148
  1. 3
      js/localstorage.js
  2. 18
      js/models.js
  3. 4
      js/plugins.js
  4. 30
      js/websockets.js
  5. 26
      js/weechat.js

@ -1,6 +1,6 @@
var ls = angular.module('localStorage',[]); var ls = angular.module('localStorage',[]);
ls.factory("$store",function($parse){ ls.factory("$store",function($parse){
/** /**
* Global Vars * Global Vars
@ -110,4 +110,3 @@ ls.factory("$store",function($parse){
}; };
return publicMethods; return publicMethods;
}); });

@ -18,12 +18,12 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
var local_variables = message.local_vars; var local_variables = message.local_vars;
var notify = 3 // Default 3 == message var notify = 3 // Default 3 == message
var lines = [] var lines = []
var nicklist = {} var nicklist = {}
var flatnicklist = [] var flatnicklist = []
var history = [] var history = []
var historyPos = 0; var historyPos = 0;
var active = false var active = false
var notification = 0 var notification = 0
var unread = 0 var unread = 0
var lastSeen = -1 var lastSeen = -1
var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1"); var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1");
@ -44,7 +44,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
/* /*
* Adds a line to this buffer * Adds a line to this buffer
* *
* @param line the BufferLine object * @param line the BufferLine object
* @return undefined * @return undefined
*/ */
@ -91,7 +91,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
/* /*
* Maintain a cached version of a flat sorted nicklist * Maintain a cached version of a flat sorted nicklist
* *
*/ */
var getFlatNicklist = function() { var getFlatNicklist = function() {
var newlist = []; var newlist = [];
@ -99,7 +99,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
_.each(nickGroup.nicks, function(nickObj) { _.each(nickGroup.nicks, function(nickObj) {
newlist.push(nickObj.name); newlist.push(nickObj.name);
}); });
}); });
newlist.sort(function(a, b) { newlist.sort(function(a, b) {
return a.toLowerCase() < b.toLowerCase() ? -1 : 1; return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
}); });
@ -181,7 +181,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
} }
} }
/* /*
* BufferLine class * BufferLine class
*/ */
@ -331,13 +331,13 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
nicks: nicks nicks: nicks
} }
} }
var BufferList = [] var BufferList = []
activeBuffer = null; activeBuffer = null;
unreads = 0; unreads = 0;
notifications = 0; notifications = 0;
this.model = { 'buffers': {} } this.model = { 'buffers': {} }
/* /*
@ -387,7 +387,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
} }
var previousBuffer = this.getActiveBuffer(); var previousBuffer = this.getActiveBuffer();
activeBuffer = _.find(this.model.buffers, function(buffer) { activeBuffer = _.find(this.model.buffers, function(buffer) {
if (buffer[key] == bufferId) { if (buffer[key] == bufferId) {
return buffer; return buffer;

@ -11,7 +11,7 @@ plugins = angular.module('plugins', []);
* that parses a string and return any additional content. * that parses a string and return any additional content.
*/ */
var Plugin = function(contentForMessage) { var Plugin = function(contentForMessage) {
return { return {
contentForMessage: contentForMessage, contentForMessage: contentForMessage,
exclusive: false, exclusive: false,
@ -35,7 +35,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
* Defines the plugin manager object * Defines the plugin manager object
*/ */
var PluginManagerObject = function() { var PluginManagerObject = function() {
var plugins = []; var plugins = [];
/* /*

@ -205,7 +205,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
* Returns the current callback id * Returns the current callback id
*/ */
var getCurrentCallBackId = function() { var getCurrentCallBackId = function() {
currentCallBackId += 1; currentCallBackId += 1;
if (currentCallBackId > 1000) { if (currentCallBackId > 1000) {
@ -439,22 +439,22 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
} }
$rootScope.countWatchers = function () { $rootScope.countWatchers = function () {
var root = $(document.getElementsByTagName('body')); var root = $(document.getElementsByTagName('body'));
var watchers = []; var watchers = [];
var f = function (element) { var f = function (element) {
if (element.data().hasOwnProperty('$scope')) { if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function (watcher) { angular.forEach(element.data().$scope.$$watchers, function (watcher) {
watchers.push(watcher); watchers.push(watcher);
}); });
} }
angular.forEach(element.children(), function (childElement) { angular.forEach(element.children(), function (childElement) {
f($(childElement)); f($(childElement));
}); });
}; };
f(root); f(root);
console.log(watchers.length); console.log(watchers.length);
}; };
@ -489,13 +489,13 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// we will send a /buffer bufferName command every time // we will send a /buffer bufferName command every time
// the user switches a buffer. This will ensure that notifications // the user switches a buffer. This will ensure that notifications
// are cleared in the buffer the user switches to // are cleared in the buffer the user switches to
if($scope.hotlistsync && ab.fullName) { if($scope.hotlistsync && ab.fullName) {
connection.sendCoreCommand('/buffer ' + ab.fullName); connection.sendCoreCommand('/buffer ' + ab.fullName);
} }
// Clear search term on buffer change // Clear search term on buffer change
$scope.search = ''; $scope.search = '';
// Check if we should show nicklist or not // Check if we should show nicklist or not
$scope.showNicklist = $scope.updateShowNicklist(); $scope.showNicklist = $scope.updateShowNicklist();
}); });
@ -545,9 +545,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Save setting for syncing hotlist // Save setting for syncing hotlist
$store.bind($scope, "hotlistsync", true); $store.bind($scope, "hotlistsync", true);
// Save setting for displaying nicklist // Save setting for displaying nicklist
$store.bind($scope, "nonicklist", false); $store.bind($scope, "nonicklist", false);
// Save setting for displaying embeds // Save setting for displaying embeds
$store.bind($scope, "noembed", false); $store.bind($scope, "noembed", false);
// Save setting for channel ordering // Save setting for channel ordering
$store.bind($scope, "orderbyserver", false); $store.bind($scope, "orderbyserver", false);
// Save setting for displaying embeds in rootscope so it can be used from service // Save setting for displaying embeds in rootscope so it can be used from service
@ -642,14 +642,14 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
var notification = new Notification(title, {body:content, icon:'img/favicon.png'}); var notification = new Notification(title, {body:content, icon:'img/favicon.png'});
// Cancel notification automatically // Cancel notification automatically
notification.onshow = function() { notification.onshow = function() {
setTimeout(function() { setTimeout(function() {
notification.close(); notification.close();
}, timeout); }, timeout);
}; };
}; };
$scope.hasUnread = function(buffer) { $scope.hasUnread = function(buffer) {
// if search is set, return every buffer // if search is set, return every buffer
if($scope.search && $scope.search !== "") { if($scope.search && $scope.search !== "") {
return true; return true;
} }
@ -668,7 +668,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$scope.showNicklist = $scope.updateShowNicklist(); $scope.showNicklist = $scope.updateShowNicklist();
}); });
$scope.showNicklist = false; $scope.showNicklist = false;
// Utility function that template can use to check if nicklist should // Utility function that template can use to check if nicklist should
// be displayed for current buffer or not // be displayed for current buffer or not
// is called on buffer switch // is called on buffer switch
$scope.updateShowNicklist = function() { $scope.updateShowNicklist = function() {
@ -681,7 +681,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
return false; return false;
} }
// Use flat nicklist to check if empty // Use flat nicklist to check if empty
if(ab.flatNicklist().length === 0) { if(ab.flatNicklist().length === 0) {
return false; return false;
} }
return true; return true;
@ -725,7 +725,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}] }]
); );
weechat.config(['$routeProvider', weechat.config(['$routeProvider',
function($routeProvider) { function($routeProvider) {
$routeProvider.when('/', { $routeProvider.when('/', {
@ -791,7 +791,7 @@ weechat.directive('inputBar', function() {
if (!$rootScope.connected) { if (!$rootScope.connected) {
return true; return true;
} }
// Support different browser quirks // Support different browser quirks
var code = $event.keyCode ? $event.keyCode : $event.charCode; var code = $event.keyCode ? $event.keyCode : $event.charCode;

@ -138,7 +138,7 @@
} }
}; };
}; };
/** /**
* Gets the default style (default colors and attributes). * Gets the default style (default colors and attributes).
* *
@ -290,7 +290,7 @@
fn: function(m) { fn: function(m) {
var ret = {}; var ret = {};
var optionCode = parseInt(m[1]); var optionCode = parseInt(m[1]);
if (optionCode > 43) { if (optionCode > 43) {
// should never happen // should never happen
return { return {
@ -309,7 +309,7 @@
name: optionName, name: optionName,
override: {} override: {}
}; };
return ret; return ret;
} }
}, },
@ -335,7 +335,7 @@
var ret = { var ret = {
bgColor: null bgColor: null
}; };
if (m[2]) { if (m[2]) {
ret.attrs = WeeChatProtocol._attrsFromStr(m[1]); ret.attrs = WeeChatProtocol._attrsFromStr(m[1]);
ret.fgColor = WeeChatProtocol._getColorObj(m[2]); ret.fgColor = WeeChatProtocol._getColorObj(m[2]);
@ -343,7 +343,7 @@
ret.attrs = WeeChatProtocol._attrsFromStr(m[3]); ret.attrs = WeeChatProtocol._attrsFromStr(m[3]);
ret.fgColor = WeeChatProtocol._getColorObj(m[4]); ret.fgColor = WeeChatProtocol._getColorObj(m[4]);
} }
return ret; return ret;
} }
}, },
@ -369,7 +369,7 @@
regex: /^\*(?:([\x01\x02\x03\x04*!\/_|]*)(\d{2})|@([\x01\x02\x03\x04*!\/_|]*)(\d{5})),(\d{2}|@\d{5})/, regex: /^\*(?:([\x01\x02\x03\x04*!\/_|]*)(\d{2})|@([\x01\x02\x03\x04*!\/_|]*)(\d{5})),(\d{2}|@\d{5})/,
fn: function(m) { fn: function(m) {
var ret = {}; var ret = {};
if (m[2]) { if (m[2]) {
ret.attrs = WeeChatProtocol._attrsFromStr(m[1]); ret.attrs = WeeChatProtocol._attrsFromStr(m[1]);
ret.fgColor = WeeChatProtocol._getColorObj(m[2]); ret.fgColor = WeeChatProtocol._getColorObj(m[2]);
@ -378,7 +378,7 @@
ret.fgColor = WeeChatProtocol._getColorObj(m[4]); ret.fgColor = WeeChatProtocol._getColorObj(m[4]);
} }
ret.bgColor = WeeChatProtocol._getColorObj(m[5]); ret.bgColor = WeeChatProtocol._getColorObj(m[5]);
return ret; return ret;
} }
}, },
@ -401,7 +401,7 @@
regex: /^E/, regex: /^E/,
fn: function(m) { fn: function(m) {
var ret = {}; var ret = {};
ret.fgColor = { ret.fgColor = {
type: 'option', type: 'option',
name: 'emphasis' name: 'emphasis'
@ -411,12 +411,12 @@
name: 'emphasis', name: 'emphasis',
override: {} override: {}
}; };
return ret; return ret;
} }
} }
]; ];
// parse // parse
var ret = { var ret = {
fgColor: null, fgColor: null,
@ -431,10 +431,10 @@
ret.text = txt.substring(m[0].length); ret.text = txt.substring(m[0].length);
return true; return true;
} }
return false; return false;
}); });
return ret; return ret;
}; };
@ -469,7 +469,7 @@
var curAttrs = WeeChatProtocol._getDefaultAttributes(); var curAttrs = WeeChatProtocol._getDefaultAttributes();
var curSpecialToken = null; var curSpecialToken = null;
var curAttrsOnlyFalseOverrides = true; var curAttrsOnlyFalseOverrides = true;
return parts.map(function(p) { return parts.map(function(p) {
if (p.length === 0) { if (p.length === 0) {
return null; return null;

Loading…
Cancel
Save