From 98bed4c09162f003e1130c7799dd7856bb9d059d Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 16 Sep 2021 12:37:23 +0300 Subject: [PATCH] remove unused js libs --- libs/dropins.min.js | 2 - libs/pell.js | 157 -------------------------------------------- 2 files changed, 159 deletions(-) delete mode 100644 libs/dropins.min.js delete mode 100644 libs/pell.js diff --git a/libs/dropins.min.js b/libs/dropins.min.js deleted file mode 100644 index 0745ea4f..00000000 --- a/libs/dropins.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see dropins_sdk_v2.js.LICENSE */ -!function(e,o){for(var t in o)e[t]=o[t]}(window,function(e){var o={};function t(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var i in e)t.d(n,i,function(o){return e[o]}.bind(null,i));return n},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=3)}([function(e,o,t){"use strict";t.d(o,"i",function(){return n}),t.d(o,"g",function(){return i}),t.d(o,"e",function(){return r}),t.d(o,"j",function(){return a}),t.d(o,"b",function(){return p}),t.d(o,"d",function(){return u}),t.d(o,"c",function(){return d}),t.d(o,"f",function(){return f}),t.d(o,"k",function(){return h}),t.d(o,"a",function(){return b}),t.d(o,"h",function(){return m});var n,i,r,s=t(1);function a(e,o){return"width="+e+",height="+o+",left="+(window.screenX+((window.outerWidth||document.documentElement.offsetWidth)-e)/2)+",top="+(window.screenY+((window.outerHeight||document.documentElement.offsetHeight)-o)/2)}function c(e,o,t){return""+e+(-1===e.indexOf("?")?"?":"&")+o+"="+t}function l(e){return c(e,"version",encodeURIComponent(Dropbox.VERSION))}function p(e,o){var t,n,i=encodeURIComponent(window.location.protocol+"//"+window.location.host),r=encodeURIComponent(Dropbox.appKey),s=Dropbox.productKey?encodeURIComponent(Dropbox.productKey):null,a=encodeURIComponent(e.linkType||""),p=encodeURIComponent(e._trigger||"js"),u=Boolean(e.multiselect),d=encodeURIComponent(b(e.extensions,"join",function(e){return e.join(" ")})||""),f=Boolean(e.folderselect);o=Boolean(o);var h=Dropbox.baseUrl+"/chooser?origin="+i+"&app_key="+r+"&link_type="+a+"&trigger="+p+"&multiselect="+u+"&extensions="+d+"&folderselect="+f+"&iframe="+o;return void 0!==e.fileselect&&(h=c(h,"fileselect",Boolean(e.fileselect))),void 0!==e.sizeLimit&&(h=c(h,"size_limit",e.sizeLimit)),null!=e.initialNavigation&&(null!=e.initialNavigation.mode&&(h=c(h,"initial_navigation_mode",encodeURIComponent(e.initialNavigation.mode))),null!=e.initialNavigation.role&&(h=c(h,"initial_navigation_role",encodeURIComponent(e.initialNavigation.role))),e.initialNavigation.cursor&&(h=c(h,"initial_navigation_cursor",encodeURIComponent(e.initialNavigation.cursor)))),null!=e.initialViewType&&(h=c(h,"initial_view_type",encodeURIComponent(e.initialViewType))),null!=e.fields&&(h=c(h,"fields",encodeURIComponent("function"==typeof e.fields.join?e.fields.join(" "):void 0))),!1===e.showSignOut&&(h=c(h,"show_sign_out","false")),e.initialNavigationPath&&(h=c(h,"initial_navigation_path",encodeURIComponent(e.initialNavigationPath))),e.requiredPermissions&&(h=c(h,"required_permissions",encodeURIComponent(b(e.requiredPermissions,"join",function(e){return e.join(" ")})||""))),s&&(h=c(h,"product_key",s)),(null===(t=e.suggestions)||void 0===t?void 0:t.experimentGroup)&&(h=c(h,"suggestions_experiment_group",encodeURIComponent(null===(n=e.suggestions)||void 0===n?void 0:n.experimentGroup))),l(h)}function u(){/\bTrident\b/.test(navigator.userAgent)&&null!=document.body&&null==i&&((i=document.createElement("iframe")).setAttribute("id","dropbox_xcomm"),i.setAttribute("src",Dropbox.baseUrl+"/static/api/1/xcomm.html"),i.style.display="none",document.body.appendChild(i))}function d(e){var o={options:Object(s.a)(Object(s.a)({},e),{success:function(t,n){"function"==typeof e.success&&e.success(t,n),r===o&&(r=null)},cancel:function(t){"function"==typeof e.cancel&&e.cancel(t),r===o&&(r=null)}})};return r=o,o}function f(e,o,t){var r,s=JSON.parse(e.data);switch(r=null!=i&&t._popup?i.contentWindow:e.source,void 0!==s.sequence_number&&r.postMessage(JSON.stringify({method:"ack",sequence_number:s.sequence_number}),Dropbox.baseUrl),s.method){case"origin_request":e.source.postMessage(JSON.stringify({method:"origin"}),Dropbox.baseUrl);break;case"ready":if(null!=t.files){var a=void 0;if(t._fetch_url_on_save){for(var c=[],l=0;l0))throw new Error("Old style url as callback is only supported for single files.");r.filename||(r.filename=l(r.url))}}return t};Dropbox.save=function(){for(var e=[],i=0;i=0||i.className.indexOf("dropbox-dropin-default")>=0||i.className.indexOf("dropbox-dropin-disabled")>=0){var o=("function"==typeof n.files?n.files():void 0)||n.files;if(!(null!=o?o.length:void 0))return i.className="dropbox-dropin-btn dropbox-dropin-error",void("function"==typeof n.error&&n.error("Missing files"));Dropbox.save({files:o,success:function(){i.className="dropbox-dropin-btn dropbox-dropin-success","function"==typeof n.success&&n.success()},progress:function(e){i.className="dropbox-dropin-btn dropbox-dropin-progress","function"==typeof n.progress&&n.progress(e)},cancel:function(){"function"==typeof n.cancel&&n.cancel()},error:function(e){i.className="dropbox-dropin-btn dropbox-dropin-error","function"==typeof n.error&&n.error(e)}})}}),i};var u=function(e,o){return" background: "+e+";\n background: -moz-linear-gradient(top, "+e+" 0%, "+o+" 100%);\n background: -webkit-linear-gradient(top, "+e+" 0%, "+o+" 100%);\n background: linear-gradient(to bottom, "+e+" 0%, "+o+" 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='"+e+"', endColorstr='"+o+"',GradientType=0); "},d=document.createElement("style");d.type="text/css";var f=' @-webkit-keyframes rotate {\n from { -webkit-transform: rotate(0deg); }\n to { -webkit-transform: rotate(360deg); }\n }\n\n @keyframes rotate {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n .dropbox-dropin-btn, .dropbox-dropin-btn:link, .dropbox-dropin-btn:hover {\n display: inline-block;\n height: 14px;\n font-family: "Lucida Grande", "Segoe UI", "Tahoma", "Helvetica Neue", "Helvetica", sans-serif;\n font-size: 11px;\n font-weight: 600;\n color: #636363;\n text-decoration: none;\n padding: 1px 7px 5px 3px;\n border: 1px solid #ebebeb;\n border-radius: 2px;\n border-bottom-color: #d4d4d4;\n '+u("#fcfcfc","#f5f5f5")+"\n }\n\n .dropbox-dropin-default:hover, .dropbox-dropin-error:hover {\n border-color: #dedede;\n border-bottom-color: #cacaca;\n "+u("#fdfdfd","#f5f5f5")+"\n }\n\n .dropbox-dropin-default:active, .dropbox-dropin-error:active {\n border-color: #d1d1d1;\n box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);\n }\n\n .dropbox-dropin-btn .dropin-btn-status {\n display: inline-block;\n width: 15px;\n height: 14px;\n vertical-align: bottom;\n margin: 0 5px 0 2px;\n background: transparent url('"+Dropbox.baseUrl+"/static/images/widgets/dbx-saver-status.png') no-repeat;\n position: relative;\n top: 2px;\n }\n\n .dropbox-dropin-default .dropin-btn-status {\n background-position: 0px 0px;\n }\n\n .dropbox-dropin-progress .dropin-btn-status {\n width: 18px;\n margin: 0 4px 0 0;\n background: url('"+Dropbox.baseUrl+"/static/images/widgets/dbx-progress.png') no-repeat center center;\n -webkit-animation-name: rotate;\n -webkit-animation-duration: 1.7s;\n -webkit-animation-iteration-count: infinite;\n -webkit-animation-timing-function: linear;\n animation-name: rotate;\n animation-duration: 1.7s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n .dropbox-dropin-success .dropin-btn-status {\n background-position: -15px 0px;\n }\n\n .dropbox-dropin-disabled {\n background: #e0e0e0;\n border: 1px #dadada solid;\n border-bottom: 1px solid #ccc;\n box-shadow: none;\n }\n\n .dropbox-dropin-disabled .dropin-btn-status {\n background-position: -30px 0px;\n }\n\n .dropbox-dropin-error .dropin-btn-status {\n background-position: -45px 0px;\n }\n\n @media only screen and (-webkit-min-device-pixel-ratio: 1.4) {\n .dropbox-dropin-btn .dropin-btn-status {\n background-image: url('"+Dropbox.baseUrl+"/static/images/widgets/dbx-saver-status-2x.png');\n background-size: 60px 14px;\n -webkit-background-size: 60px 14px;\n }\n\n .dropbox-dropin-progress .dropin-btn-status {\n background: url('"+Dropbox.baseUrl+"/static/images/widgets/dbx-progress-2x.png') no-repeat center center;\n background-size: 20px 20px;\n -webkit-background-size: 20px 20px;\n }\n }\n\n .dropbox-saver:hover, .dropbox-chooser:hover {\n text-decoration: none;\n cursor: pointer;\n }\n\n .dropbox-chooser, .dropbox-dropin-btn {\n line-height: 11px !important;\n text-decoration: none !important;\n box-sizing: content-box !important;\n -webkit-box-sizing: content-box !important;\n -moz-box-sizing: content-box !important;\n }\n ";d.styleSheet?d.styleSheet.cssText=f:d.textContent=f,document.getElementsByTagName("head")[0].appendChild(d),setTimeout(n.d,0);var h=function(){document.removeEventListener?document.removeEventListener("DOMContentLoaded",h,!1):document.detachEvent&&document.detachEvent("onreadystatechange",h),Object(n.d)(),s.init()};"interactive"===document.readyState||"complete"===document.readyState?setTimeout(h,0):document.addEventListener?document.addEventListener("DOMContentLoaded",h,!1):document.attachEvent("onreadystatechange",h)}},function(e,o,t){"use strict";t.r(o);var n=t(1),i=t(0),r=function(){function e(e,o){var t=this;this.popupWindow=e,this.onClose=o,this.stopInterval=function(){clearInterval(t.intervalId)},this.isWindowClosedByUser=function(){try{return t.popupWindow.closed}catch(e){}return!1},this.messagingWindow=function(){return void 0!==i.g&&null!==i.g?i.g.contentWindow:t.popupWindow},this.handleInterval=function(){t.isWindowClosedByUser()&&(t.onClose(),t.stopInterval())},this.intervalId=setInterval(this.handleInterval,100)}return e.open=function(o,t,n){var r=Object(i.j)(t.width,t.height)+",resizable,scrollbars",s=window.open(o,"_blank",r);if(null===s)throw new Error("Failed to open the window. Dropbox popups may only be attached to a user-triggered event handler such as a tap or click event.");return s.focus(),new e(s,n)},e}();function s(e){return function(){for(var o=0,t=e;o=0;o--){var t=e[o],n=(t.getAttribute("class")||"").split(" ");n.indexOf("dropbox-saver")>=0?function(e){Dropbox.createSaveButton({files:function(){return[{url:e.getAttribute("data-url")||e.href,filename:e.getAttribute("data-filename")||Object(p.b)(e.pathname)}]}},e)}(t):n.indexOf("dropbox-embed")>=0&&function(e){var o=e.getAttribute("data-url")||e.href;if(o&&e.parentElement){var t=e.getAttribute("data-file-zoom")||void 0,n=e.getAttribute("data-folder-view")||void 0,i=e.getAttribute("data-folder-header-size")||void 0,r=document.createElement("div");r.classList.add("dropbox-embed-container"),r.style.height=e.getAttribute("data-height")||"100%",r.style.width=e.getAttribute("data-width")||"100%",e.parentElement.replaceChild(r,e),Dropbox.embed({link:o,file:{zoom:t},folder:{view:n,headerSize:i}},r)}}(t)}}}();var x=function(){},_=window.Dropbox}])); \ No newline at end of file diff --git a/libs/pell.js b/libs/pell.js deleted file mode 100644 index c13589a0..00000000 --- a/libs/pell.js +++ /dev/null @@ -1,157 +0,0 @@ -"use strict"; - -window.Pell = (function () { - const defaultParagraphSeparatorString = "defaultParagraphSeparator"; - const formatBlock = "formatBlock"; - const addEventListener = (parent, type, listener) => parent.addEventListener(type, listener); - const appendChild = (parent, child) => parent.appendChild(child); - const createElement = tag => document.createElement(tag); - const queryCommandState = command => document.queryCommandState(command); - const queryCommandValue = command => document.queryCommandValue(command); - const exec = (command, value = null) => document.execCommand(command, false, value); - - const defaultActions = { - bold: { - icon: "B", - title: "Bold", - state: () => queryCommandState("bold"), - result: () => exec("bold") - }, - italic: { - icon: "I", - title: "Italic", - state: () => queryCommandState("italic"), - result: () => exec("italic") - }, - underline: { - icon: "U", - title: "Underline", - state: () => queryCommandState("underline"), - result: () => exec("underline") - }, - strikethrough: { - icon: "S", - title: "Strike-through", - state: () => queryCommandState("strikeThrough"), - result: () => exec("strikeThrough") - }, - heading1: { - icon: "H1", - title: "Heading 1", - result: () => exec(formatBlock, "

") - }, - heading2: { - icon: "H2", - title: "Heading 2", - result: () => exec(formatBlock, "

") - }, - paragraph: { - icon: "¶", - title: "Paragraph", - result: () => exec(formatBlock, "

") - }, - quote: { - icon: "“ ”", - title: "Quote", - result: () => exec(formatBlock, "

") - }, - olist: { - icon: "#", - title: "Ordered List", - result: () => exec("insertOrderedList") - }, - ulist: { - icon: "•", - title: "Unordered List", - result: () => exec("insertUnorderedList") - }, - code: { - icon: "</>", - title: "Code", - result: () => exec(formatBlock, "
")
-    },
-    line: {
-      icon: "―",
-      title: "Horizontal Line",
-      result: () => exec("insertHorizontalRule")
-    },
-    link: {
-      icon: "🔗",
-      title: "Link",
-      result: () => navigator.clipboard.readText().then(url => exec("createLink", url))
-    },
-    image: {
-      icon: "📷",
-      title: "Image",
-      result: () => {
-        navigator.clipboard.readText().then(url => exec("insertImage", url));
-        exec("enableObjectResizing");
-      }
-    }
-  };
-
-  const defaultClasses = {
-    actionbar: "pell-actionbar",
-    button: "pell-button",
-    content: "pell-content",
-    selected: "pell-button-selected"
-  };
-
-  const init = settings => {
-    const actions = settings.actions
-      ? settings.actions.map(action => {
-          if (typeof action === "string") return defaultActions[action];
-          else if (defaultActions[action.name]) return {...defaultActions[action.name], ...action};
-          return action;
-        })
-      : Object.keys(defaultActions).map(action => defaultActions[action]);
-
-    const classes = {...defaultClasses, ...settings.classes};
-
-    const defaultParagraphSeparator = settings[defaultParagraphSeparatorString] || "div";
-
-    const actionbar = createElement("div");
-    actionbar.className = classes.actionbar;
-    appendChild(settings.element, actionbar);
-
-    const content = (settings.element.content = createElement("div"));
-    content.contentEditable = true;
-    content.className = classes.content;
-    content.oninput = ({target: {firstChild}}) => {
-      if (firstChild && firstChild.nodeType === 3) exec(formatBlock, `<${defaultParagraphSeparator}>`);
-      else if (content.innerHTML === "
") content.innerHTML = ""; - settings.onChange(content.innerHTML); - }; - content.onkeydown = event => { - if (event.key === "Enter" && queryCommandValue(formatBlock) === "blockquote") { - setTimeout(() => exec(formatBlock, `<${defaultParagraphSeparator}>`), 0); - } - }; - appendChild(settings.element, content); - - actions.forEach(action => { - const button = createElement("button"); - button.className = classes.button; - button.innerHTML = action.icon; - button.title = action.title; - button.setAttribute("type", "button"); - button.onclick = () => action.result() && content.focus(); - - if (action.state) { - const handler = () => button.classList[action.state() ? "add" : "remove"](classes.selected); - addEventListener(content, "keyup", handler); - addEventListener(content, "mouseup", handler); - addEventListener(button, "click", handler); - } - - appendChild(actionbar, button); - }); - - if (settings.styleWithCSS) exec("styleWithCSS"); - exec(defaultParagraphSeparatorString, defaultParagraphSeparator); - - return settings.element; - }; - - return {exec, init}; -})();