Merge pull request #1266 from glowing-bear/lorenz/underscore-cleanup
Revert version number increase & clean up underscore cleanup
This commit is contained in:
commit
6cd59b76d7
|
@ -6,5 +6,3 @@ build/
|
||||||
|
|
||||||
# IntelliJ / WebStorm
|
# IntelliJ / WebStorm
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
src-tauri/target
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "glowing-bear",
|
"name": "glowing-bear",
|
||||||
"version": "0.11.0",
|
"version": "0.10.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "glowing-bear",
|
"name": "glowing-bear",
|
||||||
"version": "0.11.0",
|
"version": "0.10.0",
|
||||||
"license": "GPLv3",
|
"license": "GPLv3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "^1.8.3",
|
"angular": "^1.8.3",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "glowing-bear",
|
"name": "glowing-bear",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.11.0",
|
"version": "0.10.0",
|
||||||
"description": "A web client for Weechat",
|
"description": "A web client for Weechat",
|
||||||
"repository": "https://github.com/glowing-bear/glowing-bear",
|
"repository": "https://github.com/glowing-bear/glowing-bear",
|
||||||
"license": "GPLv3",
|
"license": "GPLv3",
|
||||||
|
|
|
@ -991,7 +991,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glowing-bear"
|
name = "glowing-bear"
|
||||||
version = "0.11.0"
|
version = "0.10.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "glowing-bear"
|
name = "glowing-bear"
|
||||||
version = "0.11.0" #sync to ../package.json
|
version = "0.10.0" #sync to ../package.json
|
||||||
description = "A web client for WeeChat"
|
description = "A web client for WeeChat"
|
||||||
authors = ["glowing-bear-contributors"]
|
authors = ["glowing-bear-contributors"]
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "glowing-bear",
|
"productName": "glowing-bear",
|
||||||
"version": "0.11.0"
|
"version": "0.10.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|
|
@ -432,7 +432,7 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" ng-click="closeModal($event)" aria-hidden="true">×</button>
|
<button type="button" class="close" ng-click="closeModal($event)" aria-hidden="true">×</button>
|
||||||
<span class="pull-right version">Glowing Bear version 0.11.0</span>
|
<span class="pull-right version">Glowing Bear version 0.10.0</span>
|
||||||
<h4 class="modal-title">Settings</h4>
|
<h4 class="modal-title">Settings</h4>
|
||||||
<p>Settings will be stored in your browser.</p>
|
<p>Settings will be stored in your browser.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import * as Favico from "favico.js";
|
||||||
|
|
||||||
|
|
||||||
import { connectionFactory } from './connection';
|
import { connectionFactory } from './connection';
|
||||||
|
import { sortBy } from './misc';
|
||||||
|
|
||||||
/* debounce helper so we dont have to use underscore.js */
|
/* debounce helper so we dont have to use underscore.js */
|
||||||
const debounce = function (func, wait, immediate) {
|
const debounce = function (func, wait, immediate) {
|
||||||
|
@ -19,10 +20,6 @@ const debounce = function (func, wait, immediate) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const sortBy = (key) => {
|
|
||||||
return (a, b) => (a[key] > b[key]) ? 1 : ((b[key] > a[key]) ? -1 : 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
var weechat = angular.module('weechat', ['ngRoute', 'localStorage', 'weechatModels', 'bufferResume', 'plugins', 'IrcUtils', 'ngSanitize', 'ngWebsockets', 'ngTouch'], ['$compileProvider', function($compileProvider) {
|
var weechat = angular.module('weechat', ['ngRoute', 'localStorage', 'weechatModels', 'bufferResume', 'plugins', 'IrcUtils', 'ngSanitize', 'ngWebsockets', 'ngTouch'], ['$compileProvider', function($compileProvider) {
|
||||||
// hacky way to be able to find out if we're in debug mode
|
// hacky way to be able to find out if we're in debug mode
|
||||||
weechat.compileProvider = $compileProvider;
|
weechat.compileProvider = $compileProvider;
|
||||||
|
|
|
@ -104,7 +104,7 @@ weechat.directive('inputBar', function() {
|
||||||
var completion_suffix = models.wconfig['weechat.completion.nick_completer'];
|
var completion_suffix = models.wconfig['weechat.completion.nick_completer'];
|
||||||
var add_space = models.wconfig['weechat.completion.nick_add_space'];
|
var add_space = models.wconfig['weechat.completion.nick_add_space'];
|
||||||
var nickComp = IrcUtils.completeNick(input, caretPos, $scope.iterCandidate,
|
var nickComp = IrcUtils.completeNick(input, caretPos, $scope.iterCandidate,
|
||||||
activeBuffer.getNicklistByTime(),
|
activeBuffer.getNicklistByTime().reverse(),
|
||||||
completion_suffix, add_space);
|
completion_suffix, add_space);
|
||||||
|
|
||||||
// remember iteration candidate
|
// remember iteration candidate
|
||||||
|
|
|
@ -16,19 +16,6 @@ IrcUtils.service('IrcUtils', [function() {
|
||||||
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a new version of a nick list
|
|
||||||
*
|
|
||||||
* @param nickList Original nick list
|
|
||||||
* @return list of nick names
|
|
||||||
*/
|
|
||||||
var _ciNickList = function(nickList) {
|
|
||||||
|
|
||||||
let newList = nickList.map((el) => el.name);
|
|
||||||
|
|
||||||
return newList;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completes a single nick.
|
* Completes a single nick.
|
||||||
*
|
*
|
||||||
|
@ -118,7 +105,7 @@ IrcUtils.service('IrcUtils', [function() {
|
||||||
var addSpaceChar = (addSpace === undefined || addSpace === 'on') ? ' ' : '';
|
var addSpaceChar = (addSpace === undefined || addSpace === 'on') ? ' ' : '';
|
||||||
|
|
||||||
// new nick list to search in
|
// new nick list to search in
|
||||||
var searchNickList = _ciNickList(nickList);
|
var searchNickList = nickList.map((el) => el.name);
|
||||||
|
|
||||||
// text before and after caret
|
// text before and after caret
|
||||||
var beforeCaret = text.substring(0, caretPos);
|
var beforeCaret = text.substring(0, caretPos);
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
export const sortBy = (key) => {
|
||||||
|
return (a, b) => (a[key] > b[key]) ? 1 : ((b[key] > a[key]) ? -1 : 0);
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
import * as weeChat from './weechat';
|
import * as weeChat from './weechat';
|
||||||
|
import { sortBy } from './misc';
|
||||||
|
|
||||||
var models = angular.module('weechatModels', []);
|
var models = angular.module('weechatModels', []);
|
||||||
|
|
||||||
|
@ -219,9 +220,10 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
|
||||||
}
|
}
|
||||||
for (let groupIdx in nicklist) {
|
for (let groupIdx in nicklist) {
|
||||||
let nicks = nicklist[groupIdx].nicks;
|
let nicks = nicklist[groupIdx].nicks;
|
||||||
for (let nickIdx in nicks) {
|
for (let curr_nick of nicks) {
|
||||||
if (nicks[nickIdx].name === nick) {
|
if (curr_nick.name === nick) {
|
||||||
nicks[nickIdx].spokeAt = Date.now();
|
curr_nick.spokeAt = Date.now();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,15 +237,10 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
|
||||||
var getNicklistByTime = function() {
|
var getNicklistByTime = function() {
|
||||||
var newlist = [];
|
var newlist = [];
|
||||||
for (let groupIdx in nicklist) {
|
for (let groupIdx in nicklist) {
|
||||||
let nicks = nicklist[groupIdx].nicks;
|
newlist = newlist.concat(nicklist[groupIdx].nicks);
|
||||||
for (let nickIdx in nicks) {
|
|
||||||
newlist.push(nicks[nickIdx]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newlist.sort(function(a, b) {
|
newlist.sort(sortBy('spokeAt'));
|
||||||
return a.spokeAt < b.spokeAt;
|
|
||||||
});
|
|
||||||
|
|
||||||
return newlist;
|
return newlist;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Glowing Bear",
|
"name": "Glowing Bear",
|
||||||
"description": "WeeChat Web frontend",
|
"description": "WeeChat Web frontend",
|
||||||
"version": "0.11.0",
|
"version": "0.10.0",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"icons": {
|
"icons": {
|
||||||
"32": "assets/img/favicon.png",
|
"32": "assets/img/favicon.png",
|
||||||
|
|
|
@ -25,5 +25,5 @@
|
||||||
"desktop-notification":{}
|
"desktop-notification":{}
|
||||||
},
|
},
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"version": "0.11.0"
|
"version": "0.10.0"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue