Do you want to support the development of this extension?
169 | Buy me a beer 170 | Amazon Affiliate 171 | 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /src/src/html/toast.html: -------------------------------------------------------------------------------- 1 |' + message + '
'); 22 | setTimeout(function () { 23 | $('#status').html(''); 24 | }, 2000); 25 | } 26 | 27 | function restore() { 28 | chrome.storage.sync.get(null, 29 | function (items) { 30 | $('input,select').each(function (index, element) { 31 | let key = $(element).attr('name'); 32 | let type = $(element).attr('type'); 33 | if (items[key]) { 34 | if (type === 'checkbox') { 35 | $(element).prop('checked', items[key]); 36 | } else { 37 | $(element).val(items[key]); 38 | } 39 | } 40 | }); 41 | }); 42 | } 43 | 44 | document.addEventListener('DOMContentLoaded', restore); 45 | document.getElementById('save').addEventListener('click', save); -------------------------------------------------------------------------------- /src/src/js/scripts/utility.js: -------------------------------------------------------------------------------- 1 | function injectCss(file) { 2 | document.head.insertAdjacentHTML('beforeend', 3 | '' 5 | ); 6 | } 7 | 8 | function showLoadingIcon() { 9 | if ($('.loader').length === 0) { 10 | $.ajax({ 11 | url: chrome.extension.getURL("src/html/loading.html"), 12 | dataType: "html", 13 | success: function (data) { 14 | $('body').append(data); 15 | $('.loader').show(); 16 | } 17 | }); 18 | } else { 19 | $('.loader').show(); 20 | } 21 | } 22 | 23 | function hideLoadingIcon() { 24 | $('.loader').hide(); 25 | } 26 | 27 | function showSuccessMessage(message, subtitle) { 28 | showMessage(message, subtitle, 5, 'green'); 29 | } 30 | 31 | function showInfoMessage(message, subtitle) { 32 | showMessage(message, subtitle, 10, 'blue'); 33 | } 34 | 35 | function showErrorMessage(message, subtitle) { 36 | showMessage(message, subtitle, 10, 'red'); 37 | } 38 | 39 | function showMessage(message, subtitle, timeout, color) { 40 | $.ajax({ 41 | url: chrome.extension.getURL("src/html/toast.html"), 42 | dataType: "html", 43 | success: function (data) { 44 | let toast = $.parseHTML(data); 45 | $(toast).find('.toast').addClass('toast--' + color); 46 | $(toast).find('.toast__type').html(message); 47 | $(toast).find('.toast__message').html(subtitle); 48 | 49 | if ($('.toast__cell').length === 1) { 50 | $('.toast__cell').append($(toast).find('.toast')); 51 | } else { 52 | $('body').append(toast); 53 | } 54 | 55 | $('.toast__close').one('click', function (e) { 56 | e.preventDefault(); 57 | let parent = $(this).parent('.toast'); 58 | parent.fadeOut("slow", function () { 59 | $(this).remove(); 60 | }); 61 | }); 62 | 63 | setTimeout(function () { 64 | $('.toast').fadeOut(); 65 | }, timeout * 1000); 66 | } 67 | }); 68 | } 69 | 70 | function setDefaultSettings() { 71 | chrome.storage.sync.get(null, 72 | function (items) { 73 | if (items === undefined) { 74 | let settings = { 75 | autologin: false, 76 | defaultPopularCategory: true, 77 | defaultPopularSearch: true, 78 | enhancedThingFiles: true, 79 | exploreFilter: true, 80 | fixedHeader: true, 81 | flappeningContentBox: true, 82 | flatdesign: true, 83 | fullWidthFiles: true, 84 | gallery: true, 85 | infinitescrolling: true, 86 | itemsPerPage: 33, 87 | scrollThreshold: 700 88 | }; 89 | chrome.storage.sync.set(settings, function () { 90 | }); 91 | } 92 | } 93 | ); 94 | } 95 | -------------------------------------------------------------------------------- /src/src/js/vendor/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n