Add missing semicolons
This commit is contained in:
parent
6d5573a148
commit
e2a84470ce
2 changed files with 52 additions and 52 deletions
84
js/models.js
84
js/models.js
|
@ -10,22 +10,22 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
*/
|
*/
|
||||||
this.Buffer = function(message) {
|
this.Buffer = function(message) {
|
||||||
// weechat properties
|
// weechat properties
|
||||||
var fullName = message.full_name
|
var fullName = message.full_name;
|
||||||
var shortName = message.short_name
|
var shortName = message.short_name;
|
||||||
var title = message.title
|
var title = message.title;
|
||||||
var number = message.number
|
var number = message.number;
|
||||||
var pointer = message.pointers[0]
|
var pointer = message.pointers[0];
|
||||||
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");
|
||||||
|
|
||||||
var indent = function(predicate) {
|
var indent = function(predicate) {
|
||||||
|
@ -35,7 +35,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Buffer opened message does not include notify level
|
// Buffer opened message does not include notify level
|
||||||
if( message.notify != undefined ) {
|
if( message.notify != undefined ) {
|
||||||
|
@ -50,7 +50,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
*/
|
*/
|
||||||
var addLine = function(line) {
|
var addLine = function(line) {
|
||||||
lines.push(line);
|
lines.push(line);
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds a nick to nicklist
|
* Adds a nick to nicklist
|
||||||
|
@ -58,13 +58,13 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
var addNick = function(group, nick) {
|
var addNick = function(group, nick) {
|
||||||
nicklist[group].nicks.push(nick);
|
nicklist[group].nicks.push(nick);
|
||||||
flatnicklist = getFlatNicklist();
|
flatnicklist = getFlatNicklist();
|
||||||
}
|
};
|
||||||
/*
|
/*
|
||||||
* Deletes a nick from nicklist
|
* Deletes a nick from nicklist
|
||||||
*/
|
*/
|
||||||
var delNick = function(group, nick) {
|
var delNick = function(group, nick) {
|
||||||
var group = nicklist[group];
|
var group = nicklist[group];
|
||||||
group.nicks = _.filter(group.nicks, function(n) { return n.name != nick.name});
|
group.nicks = _.filter(group.nicks, function(n) { return n.name != nick.name;});
|
||||||
flatnicklist = getFlatNicklist();
|
flatnicklist = getFlatNicklist();
|
||||||
/*
|
/*
|
||||||
for(i in group.nicks) {
|
for(i in group.nicks) {
|
||||||
|
@ -74,7 +74,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
};
|
||||||
/*
|
/*
|
||||||
* Updates a nick in nicklist
|
* Updates a nick in nicklist
|
||||||
*/
|
*/
|
||||||
|
@ -87,7 +87,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flatnicklist = getFlatNicklist();
|
flatnicklist = getFlatNicklist();
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maintain a cached version of a flat sorted nicklist
|
* Maintain a cached version of a flat sorted nicklist
|
||||||
|
@ -104,11 +104,11 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
|
return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
|
||||||
});
|
});
|
||||||
return newlist;
|
return newlist;
|
||||||
}
|
};
|
||||||
|
|
||||||
var flatNicklist = function() {
|
var flatNicklist = function() {
|
||||||
return flatnicklist;
|
return flatnicklist;
|
||||||
}
|
};
|
||||||
|
|
||||||
var addToHistory = function(line) {
|
var addToHistory = function(line) {
|
||||||
var result = "";
|
var result = "";
|
||||||
|
@ -119,7 +119,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
history.push(line);
|
history.push(line);
|
||||||
historyPos = history.length; // Go to end of history
|
historyPos = history.length; // Go to end of history
|
||||||
return result;
|
return result;
|
||||||
}
|
};
|
||||||
|
|
||||||
var getHistoryUp = function(currentLine) {
|
var getHistoryUp = function(currentLine) {
|
||||||
if (historyPos >= history.length) {
|
if (historyPos >= history.length) {
|
||||||
|
@ -135,7 +135,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
var line = history[historyPos];
|
var line = history[historyPos];
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
var getHistoryDown = function(currentLine) {
|
var getHistoryDown = function(currentLine) {
|
||||||
if (historyPos < 0 || historyPos >= history.length) {
|
if (historyPos < 0 || historyPos >= history.length) {
|
||||||
|
@ -152,7 +152,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
return history[historyPos];
|
return history[historyPos];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: pointer,
|
id: pointer,
|
||||||
|
@ -178,9 +178,9 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
addToHistory: addToHistory,
|
addToHistory: addToHistory,
|
||||||
getHistoryUp: getHistoryUp,
|
getHistoryUp: getHistoryUp,
|
||||||
getHistoryDown: getHistoryDown
|
getHistoryDown: getHistoryDown
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BufferLine class
|
* BufferLine class
|
||||||
|
@ -259,9 +259,9 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
displayed: displayed,
|
displayed: displayed,
|
||||||
text: rtext,
|
text: rtext,
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
function nickGetColorClasses(nickMsg, propName) {
|
function nickGetColorClasses(nickMsg, propName) {
|
||||||
if (propName in nickMsg && nickMsg[propName] && nickMsg[propName].length > 0) {
|
if (propName in nickMsg && nickMsg[propName] && nickMsg[propName].length > 0) {
|
||||||
|
@ -315,8 +315,8 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
name: name,
|
name: name,
|
||||||
prefixClasses: colorClasses.prefix,
|
prefixClasses: colorClasses.prefix,
|
||||||
nameClasses: colorClasses.name
|
nameClasses: colorClasses.name
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
/*
|
/*
|
||||||
* Nicklist Group class
|
* Nicklist Group class
|
||||||
*/
|
*/
|
||||||
|
@ -329,16 +329,16 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
name: name,
|
name: name,
|
||||||
visible: visible,
|
visible: visible,
|
||||||
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': {} };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds a buffer to the list
|
* Adds a buffer to the list
|
||||||
|
@ -352,7 +352,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
activeBuffer = buffer.id;
|
activeBuffer = buffer.id;
|
||||||
}
|
}
|
||||||
this.model.buffers[buffer.id] = buffer;
|
this.model.buffers[buffer.id] = buffer;
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getBufferByIndex = function(index) {
|
this.getBufferByIndex = function(index) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
@ -363,7 +363,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the current active buffer
|
* Returns the current active buffer
|
||||||
|
@ -372,7 +372,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
*/
|
*/
|
||||||
this.getActiveBuffer = function() {
|
this.getActiveBuffer = function() {
|
||||||
return activeBuffer;
|
return activeBuffer;
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the buffer specifiee by bufferId as active.
|
* Sets the buffer specifiee by bufferId as active.
|
||||||
|
@ -414,14 +414,14 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
$rootScope.$emit('activeBufferChanged');
|
$rootScope.$emit('activeBufferChanged');
|
||||||
$rootScope.$emit('notificationChanged');
|
$rootScope.$emit('notificationChanged');
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the buffer list
|
* Returns the buffer list
|
||||||
*/
|
*/
|
||||||
this.getBuffers = function() {
|
this.getBuffers = function() {
|
||||||
return BufferList;
|
return BufferList;
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a specific buffer object
|
* Returns a specific buffer object
|
||||||
|
@ -435,7 +435,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Closes a weechat buffer. Sets the first buffer
|
* Closes a weechat buffer. Sets the first buffer
|
||||||
|
@ -451,5 +451,5 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
this.setActiveBuffer(firstBuffer);
|
this.setActiveBuffer(firstBuffer);
|
||||||
}
|
}
|
||||||
delete(this.model.buffers[bufferId.id]);
|
delete(this.model.buffers[bufferId.id]);
|
||||||
}
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -16,8 +16,8 @@ var Plugin = function(contentForMessage) {
|
||||||
contentForMessage: contentForMessage,
|
contentForMessage: contentForMessage,
|
||||||
exclusive: false,
|
exclusive: false,
|
||||||
name: "additional content"
|
name: "additional content"
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This service provides access to the plugin manager
|
* This service provides access to the plugin manager
|
||||||
|
@ -47,7 +47,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
||||||
for (var i = 0; i < userPlugins.length; i++) {
|
for (var i = 0; i < userPlugins.length; i++) {
|
||||||
plugins.push(userPlugins[i]);
|
plugins.push(userPlugins[i]);
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterates through all the registered plugins
|
* Iterates through all the registered plugins
|
||||||
|
@ -69,7 +69,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
||||||
var pluginContent = {'visible': visible,
|
var pluginContent = {'visible': visible,
|
||||||
'content': $sce.trustAsHtml(pluginContent),
|
'content': $sce.trustAsHtml(pluginContent),
|
||||||
'nsfw': nsfw,
|
'nsfw': nsfw,
|
||||||
'name': plugins[i].name }
|
'name': plugins[i].name };
|
||||||
|
|
||||||
message.metadata.push(pluginContent);
|
message.metadata.push(pluginContent);
|
||||||
|
|
||||||
|
@ -81,13 +81,13 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
registerPlugins: registerPlugins,
|
registerPlugins: registerPlugins,
|
||||||
contentForMessage: contentForMessage
|
contentForMessage: contentForMessage
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
// Instanciates and registers the plugin manager.
|
// Instanciates and registers the plugin manager.
|
||||||
this.PluginManager = new PluginManagerObject();
|
this.PluginManager = new PluginManagerObject();
|
||||||
|
@ -134,7 +134,7 @@ plugins.factory('userPlugins', function() {
|
||||||
ret += addMatch(message.match(/open.spotify.com\/track\/([a-zA-Z-0-9]{22})/g));
|
ret += addMatch(message.match(/open.spotify.com\/track\/([a-zA-Z-0-9]{22})/g));
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
spotifyPlugin.name = 'Spotify track'
|
spotifyPlugin.name = 'Spotify track';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* YouTube Embedded Player
|
* YouTube Embedded Player
|
||||||
|
@ -210,7 +210,7 @@ plugins.factory('userPlugins', function() {
|
||||||
|
|
||||||
/* A fukung.net URL may end by an image extension but is not a direct link. */
|
/* A fukung.net URL may end by an image extension but is not a direct link. */
|
||||||
if (url.indexOf("fukung.net/v/") != -1) {
|
if (url.indexOf("fukung.net/v/") != -1) {
|
||||||
url = url.replace(/.*\//, "http://media.fukung.net/imgs/")
|
url = url.replace(/.*\//, "http://media.fukung.net/imgs/");
|
||||||
}
|
}
|
||||||
|
|
||||||
content = '<a target="_blank" href="'+url+'"><img class="embed" src="' + url + '"></a>';
|
content = '<a target="_blank" href="'+url+'"><img class="embed" src="' + url + '"></a>';
|
||||||
|
@ -268,5 +268,5 @@ plugins.factory('userPlugins', function() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin]
|
plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin]
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue