From 0c21d5aca5446c01c4571073fe54ec213892f06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 26 Mar 2020 11:14:41 +0100 Subject: [PATCH 01/40] Bump version number to 0.9.0 --- bower.json | 2 +- index.html | 2 +- manifest.json | 2 +- manifest.webapp | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index 4bd05c4..84d39a2 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "glowing-bear", "description": "A webclient for WeeChat", - "version": "0.8.0", + "version": "0.9.0", "homepage": "https://github.com/glowing-bear/glowing-bear", "license": "GPLv3", "private": true, diff --git a/index.html b/index.html index 4ae19fd..1928512 100644 --- a/index.html +++ b/index.html @@ -442,7 +442,7 @@ npm run build-electron-{windows, darwin, linux} -
  • -
    -
    - -
    -
    -
  • diff --git a/js/filters.js b/js/filters.js index 61f13c0..193abcf 100644 --- a/js/filters.js +++ b/js/filters.js @@ -184,24 +184,6 @@ weechat.filter('getBufferQuickKeys', function () { }; }); -// Emojifis the string using https://github.com/Ranks/emojione -weechat.filter('emojify', function() { - return function(text, enable_JS_Emoji) { - if (enable_JS_Emoji === true && window.emojione !== undefined) { - // Emoji live in the D800-DFFF surrogate plane; only bother passing - // this range to CPU-expensive unicodeToImage(); - var emojiRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - if (emojiRegex.test(text)) { - return emojione.unicodeToImage(text); - } else { - return(text); - } - } else { - return(text); - } - }; -}); - weechat.filter('latexmath', function() { return function(text, selector, enabled) { if (!enabled || typeof(katex) === "undefined") { diff --git a/js/glowingbear.js b/js/glowingbear.js index 04519bb..2f1909c 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -59,7 +59,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', 'fontsize': '14px', 'fontfamily': (utils.isMobileUi() ? 'sans-serif' : 'Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace'), 'readlineBindings': false, - 'enableJSEmoji': !utils.isMobileUi(), 'enableMathjax': false, 'enableQuickKeys': true, 'customCSS': '', @@ -119,13 +118,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', (["localhost", "127.0.0.1", "::1"].indexOf(window.location.hostname) === -1) && !window.is_electron && !utils.isCordova(); - if (window.is_electron) { - // Use packaged emojione sprite in the electron app - emojione.imageType = 'svg'; - emojione.sprites = true; - emojione.imagePathSVGSprites = './3rdparty/emojione.sprites.svg'; - } - $rootScope.isWindowFocused = function() { if (typeof $scope.documentHidden === "undefined") { // Page Visibility API not supported, assume yes From 696c08200bf1f6ba76273da77190c07783128223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 4 May 2020 17:01:30 +0200 Subject: [PATCH 27/40] Split toasts into short (5s) and long (15s) toasts --- css/glowingbear.css | 9 ++++++++- js/inputbar.js | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 3bbbf6a..1aac1f8 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -704,7 +704,14 @@ li.buffer.indent.private a { border-radius: 3px; padding: 10px 15px; z-index: 100; - animation: fadein 0.5s, fadeout 0.5s 4.5s; +} + +.toast-short { + animation: fadein 0.5s, fadeout 0.5s 4.5s; +} + +.toast-long { + animation: fadein 0.5s, fadeout 0.5s 14.5s; } @keyframes fadein { diff --git a/js/inputbar.js b/js/inputbar.js index 3444fde..f84afac 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -283,7 +283,7 @@ weechat.directive('inputBar', function() { var deleteCallback = function () { // Image got sucessfully deleted. // Show toast with delete link - var toastDeleted = $compile('
    Successfully deleted.
    ')($scope)[0]; + var toastDeleted = $compile('
    Successfully deleted.
    ')($scope)[0]; document.body.appendChild(toastDeleted); setTimeout(function() { document.body.removeChild(toastDeleted); }, 5000); } @@ -363,7 +363,7 @@ weechat.directive('inputBar', function() { if (buffer.type === 'channel' && !is_online) { // show a toast that the user left var toast = document.createElement('div'); - toast.className = "toast"; + toast.className = "toast toast-short"; toast.innerHTML = nick + " has left the room"; document.body.appendChild(toast); setTimeout(function() { document.body.removeChild(toast); }, 5000); @@ -774,9 +774,9 @@ weechat.directive('inputBar', function() { } // Show toast with delete link - var toastImgur = $compile('
    Image uploaded to Imgur. Delete?
    ')($scope)[0]; + var toastImgur = $compile('
    Image uploaded to Imgur. Delete?
    ')($scope)[0]; document.body.appendChild(toastImgur); - setTimeout(function() { document.body.removeChild(toastImgur); }, 10000); + setTimeout(function() { document.body.removeChild(toastImgur); }, 15000); // Log the delete hash to the console in case the toast was missed. console.log('An image was uploaded to imgur, delete it with $scope.imgurDelete(\'' + deleteHash + '\')'); From 6214e1373cf0715be01de1837daf73cfc5043c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 4 May 2020 17:13:17 +0200 Subject: [PATCH 28/40] Remove deletion toast after deletion --- js/imgur.js | 2 +- js/inputbar.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/js/imgur.js b/js/imgur.js index f743bc3..3162cbc 100644 --- a/js/imgur.js +++ b/js/imgur.js @@ -153,7 +153,7 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting xhttp.onload = function() { // Check state and response status if(xhttp.status === 200) { - callback(); + callback(deletehash); } else { showErrorMsg(); } diff --git a/js/inputbar.js b/js/inputbar.js index f84afac..b2725f9 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -280,12 +280,20 @@ weechat.directive('inputBar', function() { } }; - var deleteCallback = function () { + var deleteCallback = function (deleteHash) { // Image got sucessfully deleted. // Show toast with delete link var toastDeleted = $compile('
    Successfully deleted.
    ')($scope)[0]; document.body.appendChild(toastDeleted); setTimeout(function() { document.body.removeChild(toastDeleted); }, 5000); + + // Try to remove the toast with the deletion link (it stays 15s + // instead of the 5 of the deletion notification, so it could + // come back beneath it, which would be confusing) + var pasteToast = document.querySelector("[data-imgur-deletehash='" + deleteHash + "']"); + if (!!pasteToast) { + document.body.removeChild(pasteToast); + } } $scope.imgurDelete = function (deleteHash) { @@ -774,7 +782,7 @@ weechat.directive('inputBar', function() { } // Show toast with delete link - var toastImgur = $compile('
    Image uploaded to Imgur. Delete?
    ')($scope)[0]; + var toastImgur = $compile('
    Image uploaded to Imgur. Delete?
    ')($scope)[0]; document.body.appendChild(toastImgur); setTimeout(function() { document.body.removeChild(toastImgur); }, 15000); From 2a5d7cf0f49a12a89799235271636dc7c180d144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 5 May 2020 10:02:55 +0200 Subject: [PATCH 29/40] Add missing semicolons --- js/inputbar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/inputbar.js b/js/inputbar.js index b2725f9..6aed63d 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -207,7 +207,7 @@ weechat.directive('inputBar', function() { commandCompletionBaseWord = replacedWord + suffix; previousInput = $scope.command + activeBuffer.id; commandCompletionPosition = newCursorPos; - } + }; // Check if we have requested this completion info before if (input + activeBuffer.id !== previousInput) { @@ -219,7 +219,7 @@ weechat.directive('inputBar', function() { // Save the list of completion object, we will only request is once // and cycle through it as long as the input doesn't change commandCompletionList = completionObject.list; - commandCompletionAddSpace = completionObject.add_space + commandCompletionAddSpace = completionObject.add_space; commandCompletionBaseWord = completionObject.base_word; commandCompletionPosition = caretPos; commandCompletionPositionInList = 0; @@ -294,7 +294,7 @@ weechat.directive('inputBar', function() { if (!!pasteToast) { document.body.removeChild(pasteToast); } - } + }; $scope.imgurDelete = function (deleteHash) { imgur.deleteImage( deleteHash, deleteCallback ); From 67a19c3bab2f912ad48ad076dce8020a6bfedbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 5 May 2020 10:08:37 +0200 Subject: [PATCH 30/40] imgur: factor out & deduplicate authentication logic --- js/imgur.js | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/js/imgur.js b/js/imgur.js index 3162cbc..1a5ba6a 100644 --- a/js/imgur.js +++ b/js/imgur.js @@ -24,20 +24,23 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting }; - // Upload image to imgur from base64 - var upload = function( base64img, callback ) { + var authenticate = function(xhr) { // API authorization, either via Client ID (anonymous) or access token // (add to user's imgur account), see also: // https://github.com/glowing-bear/glowing-bear/wiki/Getting-an-imgur-token-&-album-hash var accessToken = "164efef8979cd4b"; - var isClientID = true; // Check whether the user has provided an access token if (settings.iToken.length > 37){ - accessToken = settings.iToken; - isClientID = false; + xhr.setRequestHeader("Authorization", "Bearer " + settings.iToken); + } else { + xhr.setRequestHeader("Authorization", "Client-ID " + accessToken); } + }; + + // Upload image to imgur from base64 + var upload = function( base64img, callback ) { // Progress bars container var progressBars = document.getElementById("imgur-upload-progress"), @@ -65,13 +68,7 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Post request to imgur api xhttp.open("POST", "https://api.imgur.com/3/image", true); - - // Set headers - if (isClientID) { - xhttp.setRequestHeader("Authorization", "Client-ID " + accessToken); - } else { - xhttp.setRequestHeader("Authorization", "Bearer " + accessToken); - } + authenticate(xhttp); xhttp.setRequestHeader("Accept", "application/json"); // Handler for response @@ -123,30 +120,12 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Delete an image from imgur with the deletion link var deleteImage = function( deletehash, callback ) { - // API authorization, either via Client ID (anonymous) or access token - // (add to user's imgur account), see also: - // https://github.com/glowing-bear/glowing-bear/wiki/Getting-an-imgur-token-&-album-hash - var accessToken = "164efef8979cd4b"; - var isClientID = true; - - // Check whether the user has provided an access token - if (settings.iToken.length > 37){ - accessToken = settings.iToken; - isClientID = false; - } - // Create new XMLHttpRequest var xhttp = new XMLHttpRequest(); // Post request to imgur api xhttp.open("DELETE", "https://api.imgur.com/3/image/" + deletehash, true); - - // Set headers - if (isClientID) { - xhttp.setRequestHeader("Authorization", "Client-ID " + accessToken); - } else { - xhttp.setRequestHeader("Authorization", "Bearer " + accessToken); - } + authenticate(xhttp); xhttp.setRequestHeader("Accept", "application/json"); // Handler for response From 703bde5d540fa68e977e48f6939bd40cd06f4cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 5 May 2020 10:08:56 +0200 Subject: [PATCH 31/40] imgur: clean up the module a bit --- js/imgur.js | 52 ++++++++++++++-------------------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/js/imgur.js b/js/imgur.js index 1a5ba6a..6164568 100644 --- a/js/imgur.js +++ b/js/imgur.js @@ -6,11 +6,9 @@ var weechat = angular.module('weechat'); weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, settings) { var process = function(image, callback) { - // Is it an image? if (!image || !image.type.match(/image.*/)) return; - // New file reader var reader = new FileReader(); // When image is read @@ -18,21 +16,18 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting var image = event.target.result.split(',')[1]; upload(image, callback); }; - - // Read image as data url reader.readAsDataURL(image); - }; - var authenticate = function(xhr) { // API authorization, either via Client ID (anonymous) or access token // (add to user's imgur account), see also: // https://github.com/glowing-bear/glowing-bear/wiki/Getting-an-imgur-token-&-album-hash var accessToken = "164efef8979cd4b"; - // Check whether the user has provided an access token - if (settings.iToken.length > 37){ + // Check whether the user has configured a bearer token, if so, use it + // to add the image to the user's account + if (settings.iToken.length >= 38){ xhr.setRequestHeader("Authorization", "Bearer " + settings.iToken); } else { xhr.setRequestHeader("Authorization", "Client-ID " + accessToken); @@ -41,74 +36,57 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Upload image to imgur from base64 var upload = function( base64img, callback ) { - // Progress bars container var progressBars = document.getElementById("imgur-upload-progress"), currentProgressBar = document.createElement("div"); - - // Set progress bar attributes currentProgressBar.className='imgur-progress-bar'; currentProgressBar.style.width = '0'; - // Append progress bar progressBars.appendChild(currentProgressBar); - // Create new form data + // Assemble the form data for the upload var fd = new FormData(); - fd.append("image", base64img); // Append the file - fd.append("type", "base64"); // Set image type to base64 + fd.append("image", base64img); + fd.append("type", "base64"); // Add the image to the provided album if configured to do so - if (!isClientID && settings.iAlb.length >= 6) { + if (settings.iToken.length >= 38 && settings.iAlb.length >= 6) { fd.append("album", settings.iAlb); } - // Create new XMLHttpRequest - var xhttp = new XMLHttpRequest(); - // Post request to imgur api + var xhttp = new XMLHttpRequest(); xhttp.open("POST", "https://api.imgur.com/3/image", true); authenticate(xhttp); xhttp.setRequestHeader("Accept", "application/json"); // Handler for response xhttp.onload = function() { - // Remove progress bar - currentProgressBar.parentNode.removeChild(currentProgressBar); + progressBars.removeChild(currentProgressBar); // Check state and response status - if(xhttp.status === 200) { - - // Get response text + if (xhttp.status === 200) { var response = JSON.parse(xhttp.responseText); // Send link as message - if( response.data && response.data.link ) { - + if (response.data && response.data.link) { if (callback && typeof(callback) === "function") { callback(response.data.link.replace(/^http:/, "https:"), response.data.deletehash); } - } else { showErrorMsg(); } - } else { showErrorMsg(); } - }; - if( "upload" in xhttp ) { - // Set progress + if ("upload" in xhttp) { + // Update the progress bar if we can compute progress xhttp.upload.onprogress = function (event) { - // Check if we can compute progress if (event.lengthComputable) { - // Complete in percent var complete = (event.loaded / event.total * 100 | 0); - - // Set progress bar width currentProgressBar.style.width = complete + '%'; } }; @@ -119,8 +97,6 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Delete an image from imgur with the deletion link var deleteImage = function( deletehash, callback ) { - - // Create new XMLHttpRequest var xhttp = new XMLHttpRequest(); // Post request to imgur api @@ -131,7 +107,7 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Handler for response xhttp.onload = function() { // Check state and response status - if(xhttp.status === 200) { + if (xhttp.status === 200) { callback(deletehash); } else { showErrorMsg(); From 700f322273928b1014fac668918f3adfc9df2130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 13 May 2020 14:57:28 +0200 Subject: [PATCH 32/40] Update README with new URLs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8fe7de..07ad20a 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Now you can point your browser to [http://localhost:8000](http://localhost:8000) Remember that **you don't need to host Glowing Bear yourself to use it**, you can just use [our hosted version](https://www.glowing-bear.org) powered by GitHub pages, and we'll take care of updates for you. Your browser connects to WeeChat directly, so it does not matter where Glowing Bear is hosted. -You can also use the latest and greatest development version of Glowing Bear at [https://latest.glowing-bear.org/](https://latest.glowing-bear.org/). Branches of this repository are available as [https://latest.glowing-bear.org/**branchname**/](https://latest.glowing-bear.org/branchname/), and pull requests as [https://latest.glowing-bear.org/pull/**123**/](https://latest.glowing-bear.org/pull/123/)—note the trailing slashes. +You can also use the latest and greatest development version of Glowing Bear at [https://latest.glowing-bear.org/](https://latest.glowing-bear.org/). For developers, branches of this repository are available at [https://pull.glowing-bear.org/**branchname**/](https://pull.glowing-bear.org/branchname/), and pull requests at [https://pull.glowing-bear.org/**123**/](https://pull.glowing-bear.org/123/)—note the trailing slashes. ### Running the tests Glowing Bear uses Karma and Jasmine to run its unit tests. To run the tests locally, you will first need to install `npm` on your machine. Check out the wonderful [nvm](https://github.com/creationix/nvm) if you don't know it already, it's highly recommended. From 73ecf2cf190e73e6c7b664dbfb2c4d58777392a3 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Thu, 14 May 2020 19:48:49 +0200 Subject: [PATCH 33/40] Fix unable to use history when input bar empty --- js/inputbar.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/js/inputbar.js b/js/inputbar.js index 6aed63d..6947a05 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -632,9 +632,12 @@ weechat.directive('inputBar', function() { // Arrow up -> go up in history if ($event.type === "keydown" && code === 38 && document.activeElement === inputNode) { - caretPos = inputNode.selectionStart; - if (!$scope.command || $scope.command.slice(0, caretPos).indexOf("\n") !== -1) { - return false; + // In case of multiline we don't want to do this unless at the first line + if ($scope.command) { + caretPos = inputNode.selectionStart; + if ($scope.command.slice(0, caretPos).indexOf("\n") !== -1) { + return false; + } } $scope.command = models.getActiveBuffer().getHistoryUp($scope.command); // Set cursor to last position. Need 0ms timeout because browser sets cursor @@ -649,9 +652,12 @@ weechat.directive('inputBar', function() { // Arrow down -> go down in history if ($event.type === "keydown" && code === 40 && document.activeElement === inputNode) { - caretPos = inputNode.selectionStart; - if (!$scope.command || $scope.command.slice(caretPos).indexOf("\n") !== -1) { - return false; + // In case of multiline we don't want to do this + if ($scope.command) { + caretPos = inputNode.selectionStart; + if ( $scope.command.slice(caretPos).indexOf("\n") !== -1) { + return false; + } } $scope.command = models.getActiveBuffer().getHistoryDown($scope.command); // We don't need to set the cursor to the rightmost position here, the browser does that for us From 1e05a2d2090accb29fc98f3173e4ac8360d82acb Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Thu, 14 May 2020 19:50:40 +0200 Subject: [PATCH 34/40] Improve comment --- js/inputbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/inputbar.js b/js/inputbar.js index 6947a05..96e4c2f 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -652,7 +652,7 @@ weechat.directive('inputBar', function() { // Arrow down -> go down in history if ($event.type === "keydown" && code === 40 && document.activeElement === inputNode) { - // In case of multiline we don't want to do this + // In case of multiline we don't want to do this unless it's the last line if ($scope.command) { caretPos = inputNode.selectionStart; if ( $scope.command.slice(caretPos).indexOf("\n") !== -1) { From 5697105264da6fb51a6051650df3856f7b7e3440 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Mon, 18 May 2020 21:02:24 +0200 Subject: [PATCH 35/40] Set cursor at end fix for firefox --- js/inputbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/inputbar.js b/js/inputbar.js index 96e4c2f..304bc93 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -646,7 +646,7 @@ weechat.directive('inputBar', function() { if ($scope.command) { inputNode.setSelectionRange($scope.command.length, $scope.command.length); } - }, 0); + }, 1); return true; } From 2fd9adfc9ad94707885ad59bb5d6fd79f3dda6fd Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Mon, 18 May 2020 21:05:01 +0200 Subject: [PATCH 36/40] Correct comments --- js/inputbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/inputbar.js b/js/inputbar.js index 304bc93..d6ea251 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -640,8 +640,8 @@ weechat.directive('inputBar', function() { } } $scope.command = models.getActiveBuffer().getHistoryUp($scope.command); - // Set cursor to last position. Need 0ms timeout because browser sets cursor - // position to the beginning after this key handler returns. + // Set cursor to last position. Need 1ms (0ms works for chrome) timeout because + // browser sets cursor position to the beginning after this key handler returns. setTimeout(function() { if ($scope.command) { inputNode.setSelectionRange($scope.command.length, $scope.command.length); From 21e075bbc1b8d48644d79bdcdcad66c165d24ff4 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Fri, 22 May 2020 13:12:10 +0200 Subject: [PATCH 37/40] Add audo that plays on connect to enable autoplay --- assets/audio/silence.mp3 | Bin 0 -> 504 bytes index.html | 1 + js/glowingbear.js | 5 ++--- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 assets/audio/silence.mp3 diff --git a/assets/audio/silence.mp3 b/assets/audio/silence.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..69f7c373cdc365ba936a73ef1de83e9a1df8b848 GIT binary patch literal 504 zcmezW*n@=u9Ykd2r31zIftZEHNEM@ip(QtPX3KoPs$Q)yIa}d%*vq0vgQNbJl Do~MWm literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 8bace4f..47ca999 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,7 @@ +

    Upload error: Image upload failed.

    diff --git a/js/glowingbear.js b/js/glowingbear.js index 2f1909c..2888d4b 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -78,7 +78,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $log.debug($rootScope.$$watchersCount); }; - // Detect page visibility attributes (function() { // Sadly, the page visibility API still has a lot of vendor prefixes @@ -721,7 +720,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }; $scope.connect = function() { - + document.getElementById('audioNotificationInitializer').play(); // Plays some silence, this will enable autoplay for notifications notifications.requestNotificationPermission(); $rootScope.sslError = false; $rootScope.securityError = false; @@ -730,7 +729,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.connectbutton = 'Connecting'; $scope.connectbuttonicon = 'glyphicon-refresh glyphicon-spin'; connection.connect(settings.host, settings.port, settings.path, $scope.password, settings.ssl, settings.useTotp, $scope.totp); - $scope.totp = "";//clear for next time + $scope.totp = ""; // Clear for next time }; $scope.disconnect = function() { From f12ea8b3042a3277f2f4abb857d0a66212a94642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Fri, 22 May 2020 15:15:13 +0200 Subject: [PATCH 38/40] Inline audio also compressed it a bit more (mono instead of stereo, 8kbps) --- assets/audio/silence.mp3 | Bin 504 -> 0 bytes index.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 assets/audio/silence.mp3 diff --git a/assets/audio/silence.mp3 b/assets/audio/silence.mp3 deleted file mode 100644 index 69f7c373cdc365ba936a73ef1de83e9a1df8b848..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmezW*n@=u9Ykd2r31zIftZEHNEM@ip(QtPX3KoPs$Q)yIa}d%*vq0vgQNbJl Do~MWm diff --git a/index.html b/index.html index 47ca999..620233a 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,7 @@ - +

    Upload error: Image upload failed.

    From 736d3f2ced01bc5b0c4bb5c920cf6b5a8ad5b32e Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 21 Jun 2020 11:26:36 +0200 Subject: [PATCH 39/40] Improve Tik Tok Embed Apply tiktok embed for shortened links Make embed wider so desktop styling is applied --- js/plugins.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index 8218f78..9d76376 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -558,8 +558,8 @@ plugins.factory('userPlugins', function() { * Very similar to twitter */ var tikTokPlugin = new UrlPlugin('TikTok', function(url) { - var regex = /^https?:\/\/(www\.)?tiktok\.com\/@(.+)\/video\/(.+)/i, - match = url.match(regex); + var regex = /^https?:\/\/(?:www\.)?tiktok\.com\/@(?:.+)\/video\/(?:.+)\/?$|^https?:\/\/vm\.tiktok\.com\/[a-zA-Z1-9]{7}\/?$/i; + var match = url.match(regex); if (match) { @@ -571,12 +571,12 @@ plugins.factory('userPlugins', function() { return response.json(); }) .then(function(data) { - // separate the HTML into content and script tag + // Separate the HTML into content and script tag var scriptIndex = data.html.indexOf("