More JS improvements

This commit is contained in:
Floorb 2021-11-04 11:35:36 -04:00
parent 7aea081da2
commit 92814b33b2
26 changed files with 105 additions and 22013 deletions

View file

@ -377,11 +377,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<!-- End Footer -->
</div>
<!-- End content -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-select.js"></script>
<script>
function show() {
document.getElementById('smtp_pass').setAttribute('type', 'text');

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,348 +0,0 @@
/* jshint expr: true */
!(function ($, wysi) {
'use strict';
var templates = function (key, locale, options) {
return wysi.tpl[key]({locale: locale, options: options});
};
var Wysihtml5 = function (el, options) {
this.el = el;
var toolbarOpts = options || defaultOptions;
for (var t in toolbarOpts.customTemplates) {
wysi.tpl[t] = toolbarOpts.customTemplates[t];
}
this.toolbar = this.createToolbar(el, toolbarOpts);
this.editor = this.createEditor(options);
window.editor = this.editor;
$('iframe.wysihtml5-sandbox').each(function (i, el) {
$(el.contentWindow).off('focus.wysihtml5').on({
'focus.wysihtml5': function () {
$('li.dropdown').removeClass('open');
}
});
});
};
Wysihtml5.prototype = {
constructor: Wysihtml5,
createEditor: function (options) {
options = options || {};
// Add the toolbar to a clone of the options object so multiple instances
// of the WYISYWG don't break because 'toolbar' is already defined
options = $.extend(true, {}, options);
options.toolbar = this.toolbar[0];
var editor = new wysi.Editor(this.el[0], options);
if (options && options.events) {
for (var eventName in options.events) {
editor.on(eventName, options.events[eventName]);
}
}
return editor;
},
createToolbar: function (el, options) {
var self = this;
var toolbar = $('<ul/>', {
'class': 'wysihtml5-toolbar',
'style': 'display:none'
});
var culture = options.locale || defaultOptions.locale || 'en';
for (var key in defaultOptions) {
var value = false;
if (options[key] !== undefined) {
if (options[key] === true) {
value = true;
}
} else {
value = defaultOptions[key];
}
if (value === true) {
toolbar.append(templates(key, locale[culture], options));
if (key === 'html') {
this.initHtml(toolbar);
}
if (key === 'link') {
this.initInsertLink(toolbar);
}
if (key === 'image') {
this.initInsertImage(toolbar);
}
}
}
if (options.toolbar) {
for (key in options.toolbar) {
toolbar.append(options.toolbar[key]);
}
}
toolbar.find('a[data-wysihtml5-command="formatBlock"]').click(function (e) {
var target = e.target || e.srcElement;
var el = $(target);
self.toolbar.find('.current-font').text(el.html());
});
toolbar.find('a[data-wysihtml5-command="foreColor"]').click(function (e) {
var target = e.target || e.srcElement;
var el = $(target);
self.toolbar.find('.current-color').text(el.html());
});
this.el.before(toolbar);
return toolbar;
},
initHtml: function (toolbar) {
var changeViewSelector = 'a[data-wysihtml5-action="change_view"]';
toolbar.find(changeViewSelector).click(function (e) {
toolbar.find('a.btn').not(changeViewSelector).toggleClass('disabled');
});
},
initInsertImage: function (toolbar) {
var self = this;
var insertImageModal = toolbar.find('.bootstrap-wysihtml5-insert-image-modal');
var urlInput = insertImageModal.find('.bootstrap-wysihtml5-insert-image-url');
var insertButton = insertImageModal.find('a.btn-primary');
var initialValue = urlInput.val();
var caretBookmark;
var insertImage = function () {
var url = urlInput.val();
urlInput.val(initialValue);
self.editor.currentView.element.focus();
if (caretBookmark) {
self.editor.composer.selection.setBookmark(caretBookmark);
caretBookmark = null;
}
self.editor.composer.commands.exec('insertImage', url);
};
urlInput.keypress(function (e) {
if (e.which == 13) {
insertImage();
insertImageModal.modal('hide');
}
});
insertButton.click(insertImage);
insertImageModal.on('shown', function () {
urlInput.focus();
});
insertImageModal.on('hide', function () {
self.editor.currentView.element.focus();
});
toolbar.find('a[data-wysihtml5-command=insertImage]').click(function () {
var activeButton = $(this).hasClass('wysihtml5-command-active');
if (!activeButton) {
self.editor.currentView.element.focus(false);
caretBookmark = self.editor.composer.selection.getBookmark();
insertImageModal.appendTo('body').modal('show');
insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function (e) {
e.stopPropagation();
});
return false;
} else {
return true;
}
});
},
initInsertLink: function (toolbar) {
var self = this;
var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal');
var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url');
var targetInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-target');
var insertButton = insertLinkModal.find('a.btn-primary');
var initialValue = urlInput.val();
var caretBookmark;
var insertLink = function () {
var url = urlInput.val();
urlInput.val(initialValue);
self.editor.currentView.element.focus();
if (caretBookmark) {
self.editor.composer.selection.setBookmark(caretBookmark);
caretBookmark = null;
}
var newWindow = targetInput.prop('checked');
self.editor.composer.commands.exec('createLink', {
'href': url,
'target': (newWindow ? '_blank' : '_self'),
'rel': (newWindow ? 'nofollow' : '')
});
};
var pressedEnter = false;
urlInput.keypress(function (e) {
if (e.which == 13) {
insertLink();
insertLinkModal.modal('hide');
}
});
insertButton.click(insertLink);
insertLinkModal.on('shown', function () {
urlInput.focus();
});
insertLinkModal.on('hide', function () {
self.editor.currentView.element.focus();
});
toolbar.find('a[data-wysihtml5-command=createLink]').click(function () {
var activeButton = $(this).hasClass('wysihtml5-command-active');
if (!activeButton) {
self.editor.currentView.element.focus(false);
caretBookmark = self.editor.composer.selection.getBookmark();
insertLinkModal.appendTo('body').modal('show');
insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function (e) {
e.stopPropagation();
});
return false;
} else {
return true;
}
});
}
};
// these define our public api
var methods = {
resetDefaults: function () {
$.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache);
},
bypassDefaults: function (options) {
return this.each(function () {
var $this = $(this);
$this.data('wysihtml5', new Wysihtml5($this, options));
});
},
shallowExtend: function (options) {
var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data());
var that = this;
return methods.bypassDefaults.apply(that, [settings]);
},
deepExtend: function (options) {
var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {});
var that = this;
return methods.bypassDefaults.apply(that, [settings]);
},
init: function (options) {
var that = this;
return methods.shallowExtend.apply(that, [options]);
}
};
$.fn.wysihtml5 = function (method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.wysihtml5');
}
};
$.fn.wysihtml5.Constructor = Wysihtml5;
var defaultOptions = $.fn.wysihtml5.defaultOptions = {
'font-styles': true,
'color': false,
'emphasis': true,
'lists': true,
'html': false,
'link': true,
'image': true,
events: {},
parserRules: {
classes: {
'wysiwyg-color-silver': 1,
'wysiwyg-color-gray': 1,
'wysiwyg-color-white': 1,
'wysiwyg-color-maroon': 1,
'wysiwyg-color-red': 1,
'wysiwyg-color-purple': 1,
'wysiwyg-color-fuchsia': 1,
'wysiwyg-color-green': 1,
'wysiwyg-color-lime': 1,
'wysiwyg-color-olive': 1,
'wysiwyg-color-yellow': 1,
'wysiwyg-color-navy': 1,
'wysiwyg-color-blue': 1,
'wysiwyg-color-teal': 1,
'wysiwyg-color-aqua': 1,
'wysiwyg-color-orange': 1
},
tags: {
'b': {},
'i': {},
'strong': {},
'em': {},
'p': {},
'br': {},
'ol': {},
'ul': {},
'li': {},
'h1': {},
'h2': {},
'h3': {},
'h4': {},
'h5': {},
'h6': {},
'blockquote': {},
'u': 1,
'img': {
'check_attributes': {
'width': 'numbers',
'alt': 'alt',
'src': 'url',
'height': 'numbers'
}
},
'a': {
check_attributes: {
'href': 'url' // important to avoid XSS
},
'set_attributes': {
'target': '_blank',
'rel': 'nofollow'
}
},
'span': 1,
'div': 1,
// to allow save and edit files with code tag hacks
'code': 1,
'pre': 1
}
},
locale: 'en'
};
if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') {
$.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions);
}
var locale = $.fn.wysihtml5.locale = {};
})(window.jQuery, window.wysihtml5);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,7 @@
const $ = function(selector) {
return document.querySelector(selector);
};
const $$ = function(selector) {
return document.querySelectorAll(selector) || [];
};
@ -16,6 +20,14 @@ const clearEl = function(el) {
}
};
const toggleEl = function(el) {
if (el.classList.contains('is-hidden')) {
el.classList.remove('is-hidden');
} else {
el.classList.add('is-hidden');
}
};
const escape = function(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
@ -295,6 +307,44 @@ const setupSite = function() {
});
table.attach();
}
const signupButton = $('[data-target~="#signin"],[data-target~="#signup"]');
if (signupButton) {
signupButton.addEventListener('click', () => {
$('.modal').classList.add('is-active');
});
$('.modal-button-close').addEventListener('click', () => {
$('.modal').classList.remove('is-active');
});
}
const embedButton = $('.panel-tools .embed-tool');
if (embedButton){
embedButton.addEventListener('click', (evt) => {
if (evt.target && evt.target.closest('.panel-tools')) {
toggleEl(evt.target.closest('.panel-tools').querySelector('.panel-embed'));
}
});
}
const expandButton = $('.expand-tool');
if (expandButton) {
expandButton.addEventListener('click', (evt) => {
if (evt.target && evt.target.closest('.panel')) {
const panel = evt.target.closest('.panel');
if (panel.classList.contains('panel-fullsize')) {
panel.classList.remove('panel-fullsize');
} else {
panel.classList.add('panel-fullsize');
}
}
});
}
};
if (document.readyState !== 'loading') {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -20,6 +20,14 @@ const clearEl = function(el) {
}
};
const toggleEl = function(el) {
if (el.classList.contains('is-hidden')) {
el.classList.remove('is-hidden');
} else {
el.classList.add('is-hidden');
}
};
const escape = function(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
@ -30,4 +38,4 @@ const escape = function(unsafe) {
}
export { $, $$, makeEl, clearEl, escape };
export { $, $$, makeEl, clearEl, toggleEl, escape };

View file

@ -1,4 +1,4 @@
import { $$, escape } from './dom';
import { $, $$, escape, toggleEl } from './dom';
import { TagsInput } from "./tag_input";
import { DataTable } from "./data_tables";
@ -41,6 +41,44 @@ const setupSite = function() {
});
table.attach();
}
const signupButton = $('[data-target~="#signin"],[data-target~="#signup"]');
if (signupButton) {
signupButton.addEventListener('click', () => {
$('.modal').classList.add('is-active');
});
$('.modal-button-close').addEventListener('click', () => {
$('.modal').classList.remove('is-active');
});
}
const embedButton = $('.panel-tools .embed-tool');
if (embedButton){
embedButton.addEventListener('click', (evt) => {
if (evt.target && evt.target.closest('.panel-tools')) {
toggleEl(evt.target.closest('.panel-tools').querySelector('.panel-embed'));
}
});
}
const expandButton = $('.expand-tool');
if (expandButton) {
expandButton.addEventListener('click', (evt) => {
if (evt.target && evt.target.closest('.panel')) {
const panel = evt.target.closest('.panel');
if (panel.classList.contains('panel-fullsize')) {
panel.classList.remove('panel-fullsize');
} else {
panel.classList.add('panel-fullsize');
}
}
});
}
};
if (document.readyState !== 'loading') {

View file

@ -33,10 +33,8 @@ $flashes = getFlashes();
<link href="//<?= $baseurl ?>/theme/bulma/css/table-responsive.css" rel="stylesheet"/>
<link href="//<?= $baseurl ?>/theme/bulma/css/table-row-orders.css" rel="stylesheet"/>
<script src="//<?= $baseurl ?>/theme/bulma/js/jquery.min.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/jquery-ui.min.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/paste.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/modal-fx.min.js"></script>
<script src="//<?= $baseurl ?>/assets/<?= PP_DEBUG ? 'bundle.js' : 'bundle.min.js' ?>"></script>
<script src="//<?= $baseurl ?>/assets/bundle/<?= PP_DEBUG ? 'bundle.js' : 'bundle.min.js' ?>"></script>
</head>
<body>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,173 +0,0 @@
.tokenize > .tokens-container {
position: relative;
list-style: none;
padding: 0 0 5px 5px;
height: auto;
min-height: 34px;
cursor: text;
}
.tokenize > .tokens-container.disabled {
background-color: #eee;
cursor: not-allowed;
}
.tokenize.focus > .tokens-container {
outline: 0;
border-color: #66afe9;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}
.tokenize > .tokens-container.input-sm {
padding: 0 0 4px 4px;
min-height: 30px;
}
.tokenize > .tokens-container.input-lg {
padding: 0 0 9px 9px;
min-height: 46px;
}
.tokenize > .tokens-container > .token {
padding: 0 1.2em 0 5px;
background-color: #eff2f7;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.tokenize > .tokens-container > .token,
.tokenize > .tokens-container > .placeholder,
.tokenize > .tokens-container > .token-search {
border: 1px solid #cdd5e3;
display: inline-block;
margin: 5px 5px 0 0;
position: relative;
vertical-align: middle;
}
.tokenize > .tokens-container > .token-search {
min-width: 10px;
}
.tokenize.sortable > .tokens-container > .token {
cursor: move;
}
.tokenize.sortable > .tokens-container > .token.dragged {
position: absolute;
z-index: 2000;
}
.tokenize.single > .tokens-container > .token {
display: block;
border-color: #fff;
background-color: transparent;
}
.tokenize.sortable > .tokens-container > .token.shadow {
border-color: #ccc;
background-color: #ccc;
filter: alpha(opacity=50);
opacity: .2;
}
.tokenize > .tokens-container > .placeholder,
.tokenize > .tokens-container > .token-search {
padding: 0;
border-color: #fff;
}
.tokenize > .tokens-container > .placeholder {
color: #ccc;
}
.tokenize > .tokens-container > .token-search > input {
padding: 0;
margin: 0;
line-height: 1em;
border: 1px solid #fff;
background: transparent;
border-left: none;
border-right: none;
outline: none;
width: 100%;
}
.tokenize > .tokens-container > .token-search > input::-ms-clear {
display: none;
}
.tokenize > .tokens-container.input-sm > .placeholder,
.tokenize > .tokens-container.input-sm > .token-search,
.tokenize > .tokens-container.input-sm > .token {
margin: 4px 4px 0 0;
}
.tokenize > .tokens-container.input-lg > .placeholder,
.tokenize > .tokens-container.input-lg > .token-search,
.tokenize > .tokens-container.input-lg > .token {
margin: 9px 9px 0 0;
}
.tokenize > .tokens-container > .token.pending-delete {
background-color: #5b72a4;
border-color: #425c96;
color: #fff
}
.tokenize > .tokens-container > .token > .dismiss {
position: absolute;
right: 5px;
color: #a9b9d8;
text-decoration: none;
cursor: pointer;
}
.tokenize > .tokens-container > .token > .dismiss:after {
content: "×";
}
.tokenize > .tokens-container > .token.pending-delete > .dismiss {
color: #aaa;
}
.tokenize-dropdown {
position: absolute;
display: none;
}
.tokenize-dropdown > .dropdown-menu {
min-height: 10px;
width: 100%;
display: block;
margin: -1px 0 0 0;
visibility: visible;
opacity: 1;
}
.tokenize-dropdown > .dropdown-menu li {
cursor: pointer;
}
.tokenize-dropdown > .dropdown-menu li > a .tokenize-highlight {
font-weight: bold;
}
.tokenize-dropdown > .dropdown-menu li.locked {
padding: 3px 20px;
color: #333;
white-space: nowrap;
}
.tokenize-dropdown > .dropdown-menu li.locked,
.tokenize-dropdown > .dropdown-menu li > a {
text-overflow: ellipsis;
overflow-x: hidden;
}
.tokenize-dropdown > .dropdown-menu li:not(.active) a:hover,
.tokenize-dropdown > .dropdown-menu li:not(.active) a:focus {
background-color: transparent;
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
!function(){var t,n,e,o,l,c,a,d,i,m,u,s;(t="data-target",n="is-active",e=".modal-button",o=".modal-close",l=".modal-button-close",c=".modal-background",a=function(e,t){document.querySelectorAll(e).forEach(function(e){e.addEventListener("click",t)})},d=function(){document.querySelectorAll("."+n).forEach(function(e){e.classList.remove(n)}),s()},i=function(){var e=this.getAttribute(t);u(),document.getElementById(e).classList.add(n)},m=function(){var e=this.parentElement.id;document.getElementById(e).classList.remove(n),s()},u=function(){document.getElementsByTagName("html")[0].style.overflow="hidden",document.getElementsByTagName("body")[0].style.overflowY="scroll"},s=function(){document.getElementsByTagName("html")[0].style.overflow="",document.getElementsByTagName("body")[0].style.overflowY=""},{init:function(){a(e,i),a(o,m),a(l,d),a(c,m),document.addEventListener("keyup",function(e){27==e.keyCode&&d()})}}).init()}();

File diff suppressed because one or more lines are too long

View file

@ -1,91 +1,3 @@
function preloaderFadeOutInit() {
$('.preloader').fadeOut('slow');
$('main').attr('id', '');
}
// Window load function
jQuery(window).on('load', function () {
(function ($) {
preloaderFadeOutInit();
})(jQuery);
});
$(document).ready(function () {
// PANEL TOOLS
$(".panel-tools .minimise-tool").click(function (event) {
$(this).parents(".panel").find(".panel-body").slideToggle(100);
return false;
});
$(".panel-tools .closed-tool").click(function (event) {
$(this).parents(".panel").fadeToggle(400);
return false;
});
// Search
$(".panel-tools .search-tool").click(function (event) {
$(this).parents(".panel").find(".panel-search").toggle(100);
return false;
});
// Embed
$(".panel-tools .embed-tool").click(function (event) {
$(this).parents(".panel").find(".panel-embed").toggle(100);
return false;
});
// Expand
$(".panel-tools .expand-tool").on("click", function () {
if ($(this).parents(".panel").hasClass("panel-fullsize")) {
$(this).parents(".panel").removeClass("panel-fullsize");
} else {
$(this).parents(".panel").addClass("panel-fullsize");
}
});
// Widget tools
$(".widget-tools .closed-tool").click(function (event) {
$(this).parents(".widget").fadeToggle(400);
return false;
});
$(".widget-tools .expand-tool").on("click", function () {
if ($(this).parents(".widget").hasClass("widget-fullsize")) {
$(this).parents(".widget").removeClass("widget-fullsize");
} else {
$(this).parents(".widget").addClass("widget-fullsize");
}
});
$(".paste-alert .closed").click(function (event) {
$(this).parents(".paste-alert").fadeToggle(350);
return false;
});
$(".paste-alert-click").click(function (event) {
$(this).fadeToggle(350);
return false;
});
$('[data-target~="#signin"],[data-target~="#signup"]').click(function () {
$(".modal").addClass("is-active");
});
$(".modal-close").click(function () {
$(".modal").removeClass("is-active");
});
});
function selectText(e) {
if (document.selection) {
var t = document.body.createTextRange();
@ -98,18 +10,6 @@ function selectText(e) {
}
}
function checkTab(e) {
if (document.all && 9 == event.keyCode) {
e.selection = document.selection.createRange();
setTimeout("processTab('" + e.id + "')", 0);
}
}
function processTab(e) {
document.all[e].selection.text = String.fromCharCode(9);
document.all[e].focus();
}
function setSelectionRange(e, t, n) {
if (e.setSelectionRange) {
e.focus();

File diff suppressed because it is too large Load diff

View file

@ -1,28 +0,0 @@
/*!
*
* The MIT License (MIT)
*
* Copyright © 2020 Taufik Nurrohman
*
* <https://github.com/taufik-nurrohman/tag-picker>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the Software), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
!function(){"use strict";function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function e(t,n){return(e=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,n,o){return(u=r()?Reflect.construct:function(t,n,r){var u=[null];u.push.apply(u,n);var o=new(Function.bind.apply(t,u));return r&&e(o,r.prototype),o}).apply(null,arguments)}function o(t){var r="function"==typeof Map?new Map:void 0;return(o=function(t){if(null===t||(o=t,-1===Function.toString.call(o).indexOf("[native code]")))return t;var o;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,i)}function i(){return u(t,arguments,n(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e(i,t)})(t)}var i=function(t){return Array.isArray(t)},c=function(t,n){return void 0===n&&(n=!0),"object"==typeof t&&(!n||function(t,n){return t&&f(n)&&t instanceof n}(t,Object))},f=function(t){return function(t){return void 0!==t}(t)&&!function(t){return null===t}(t)},a=function(t){return"string"==typeof t},l=function t(n){if(i(n))return n.map((function(e){return t(n)}));if(c(n)){for(var e in n)n[e]=t(n[e]);return n}return!1===n?"false":null===n?"null":!0===n?"true":""+n},s=function t(n){if(i(n))return n.map((function(n){return t(n)}));if(function(t){return/^-?(?:\d*.)?\d+$/.test(t+"")}(n))return function(t,n){return void 0===n&&(n=10),parseInt(t,n)}(n);if(c(n)){for(var e in n)n[e]=t(n[e]);return n}return{false:!1,null:null,true:!0}[n]||n},p=document,d=window,y=function(t,n,e){if(void 0===e&&(e=!0),!v(t,n))return null;var r=t.getAttribute(n);return e?s(r):r},v=function(t,n){return t.hasAttribute(n)},b=function(t,n){return t.removeAttribute(n),t},h=function(t,n){return delete t[n],t},m=function(t,n,e){return!0===e&&(e=n),t.setAttribute(n,l(e)),t},O=function(t,n,e){return t=a(t)?p.createElement(t):t,c(n)&&(e=n,n=!1),a(n)&&k(t,n),c(e)&&function(t,n){var e;for(var r in n)(e=n[r])||""===e||0===e?m(t,r,e):b(t,r)}(t,e),t},k=function(t,n,e){if(void 0===e&&(e=!0),null===n)return t;var r="innerHTML";return function(t,n){return n in t}(t,r)&&(t[r]=e?n.trim():n),t},g=function(t,n,e){return t[n]=e,t},_=function(n){var e,r;function u(){var t;return(t=n.call(this)||this).attachShadow({mode:"open"}),t.source=O("input"),t}r=n,(e=u).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r;var o,i,c,f=u.prototype;return f.connectedCallback=function(){var t,n,e,r,u=this,o=u.shadowRoot;O(u.source,{name:y(u,"name"),placeholder:y(u,"placeholder"),type:"hidden",value:y(u,"value")}),function(t,n){var e;for(var r in n)(e=n[r])||""===e||0===e?g(t,r,n[r]):h(t,r)}(u.source,{disabled:v(u,"disabled"),readOnly:v(u,"readonly")}),e=o.host,r=u.source,function(t){return t.parentNode||null}(e).insertBefore(r,e),u.picker=new TP(u.source,{max:null!=(t=y(u,"max"))?t:TP.state.max,min:null!=(n=y(u,"min"))?n:TP.state.min})},f.blur=function(){return this.picker.blur()},f.click=function(){return this.picker.click()},f.focus=function(){return this.picker.focus()},o=u,(i=[{key:"disabled",get:function(){return this.source.disabled},set:function(t){return this.source.disabled=t,this.picker}},{key:"readOnly",get:function(){return this.source.readOnly},set:function(t){return this.source.readOnly=t,this.picker}},{key:"value",get:function(){return this.source.value},set:function(t){return this.picker.value(t)}}])&&t(o.prototype,i),c&&t(o,c),u}(o(HTMLElement));d.customElements.define("tag-picker",_)}();

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,4 @@
<link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/>
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
<script>
function setupTagsInput() {
const tagsInput = document.getElementById('tags-with-source');
@ -63,7 +62,7 @@
// Window load function
jQuery(window).on('load', function () {
(function ($) {
preloaderFadeOutInit();
// preloaderFadeOutInit();
})(jQuery);
});
</script>
@ -98,8 +97,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
overflow: hidden !important;
}
</style>
<main class="bd-main" id="stop-scrolling">
<div class="preloader"></div>
<main class="bd-main" id="dstop-scrolling">
<!-- <div class="preloader"></div> -->
<div class="bd-side-background"></div>
<div class="bd-main-container container">
<div class="bd-duo">
@ -201,7 +200,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
title="Embed This Paste"></i></a>
<a class="icon tool-icon expand-tool"><i class="fas fa-expand-alt has-text-grey"
title="Full Screen"></i></a>
<div class="panel-embed my-5" style="display:none;">
<div class="panel-embed my-5 is-hidden">
<input type="text" class="input has-background-white-ter has-text-grey"
value='<?php echo '<script src="' . $protocol . $baseurl . '/';
if (PP_MOD_REWRITE) {
@ -465,40 +464,4 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
}
}
</script>
<script>
$("#reportpaste").submit(function (e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this);
var url = form.attr('action');
$.ajax({
type: "POST",
url: "report.php",
data: form.serialize(), // serializes the form's elements.
success: function (data) {
document.getElementById("reportbutton").innerHTML = '<input disabled class="button is-danger is-fullwidth" type="submit" name="reportpaste" id="report" value="Reported" />';
}
});
});
</script>
<?php if ($current_user) { ?>
<script>
$(document).ready(function () {
$('#favorite').on('click', null, function () {
var _this = $(this);
var post_id = _this.data('fid');
$.ajax({
type: 'POST',
url: 'fav.php',
dataType: 'json',
data: 'fid=' + post_id,
});
location.reload(true)
});
});
</script>
<?php } ?>