Fix UI
This commit is contained in:
1 parent
b8ab66cd78
commit
3f61d82ec5
5 files changed
+63
-26
No files matched your search
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slLine truncated
|
||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["elementMap","Map","Data","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete","TRANSITION_END","parseSelector","selector","window","CSS","escape","replace","match","id","triggerTransitionEnd","dispatchEvent","Event","isElement","object","jquery","nodeType","getElement","length","document","querySelector","isVisible","getClientRects","elementIsVisible","getComputedStyle","getPropertyValue","closedDetails","closest","summary","parentNode","isDisabled","Node","ELEMENT_NODE","classList","contains","disabled","hasAttribute","getAttribute","findShadowRoot","documentElement","attachShadow","getRootNode","root","ShadowRoot","noop","reflow","offsetHeight","getjQuery","jQuery","body","DOMContentLoadedCallbacks","isRTL","dir","defineJQueryPlugin","plugin","callback","$","name","NAME","JQUERY_NO_CONFLICT","fn","jQueryInterface","Constructor","noConflict","readyState","addEventListener","push","execute","possibleCallback","args","defaultValue","executeAfterTransition","transitionElement","waitForTransition","emulatedDuration","transitionDuration","transitionDelay","floatTransitionDuration","Number","parseFloat","floatTransitionDelay","split","getTransitionDurationFromElement","called","handler","target","removeEventListener","setTimeout","getNextActiveElement","list","activeElement","shouldGetNext","isCycleAllowed","listLength","index","indexOf","Math","max","min","namespaceRegex","stripNameRegex","stripUidRegex","eventRegistry","uidEvent","customEvents","mouseenter","mouseleave","nativeEvents","Set","makeEventUid","uid","getElementEvents","findHandler","events","callable","delegationSelector","Object","values","find","event","normalizeParameters","originalTypeEvent","delegationFunction","isDelegated","typeEvent","getTypeEvent","addHandler","oneOff","wrapFunction","relatedTarget","delegateTarget","call","this","handlers","previousFunction","domElements","querySelectorAll","domElement","hydrateObj","EventHandler","off","type","apply","bootstrapDelegationHandler","bootstrapHandler","removeHandler","Boolean","removeNamespacedHandlers","namespace","storeElementEvent","handlerKey","entries","includes","on","one","inNamespace","isNamespace","startsWith","elementEvent","slice","keyHandlers","trigger","jQueryEvent","bubbles","nativeDispatch","defaultPrevented","isPropagationStopped","isImmediatePropagationStopped","isDefaultPrevented","evt","cancelable","preventDefault","obj","meta","value","_unused","defineProperty","configurable","normalizeData","toString","JSON","parse","decodeURIComponent","normalizeDataKey","chr","toLowerCase","Manipulator","setDataAttribute","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","bsKeys","dataset","filter","pureKey","charAt","getDataAttribute","Config","Default","DefaultType","Error","_getConfig","config","_mergeConfigObj","_configAfterMerge","_typeCheckConfig","jsonConfig","constructor","configTypes","property","expectedTypes","valueType","prototype","RegExp","test","TypeError","toUpperCase","BaseComponent","super","_element","_config","DATA_KEY","dispose","EVENT_KEY","propertyName","getOwnPropertyNames","_queueCallback","isAnimated","getInstance","getOrCreateInstance","VERSION","eventName","getSelector","hrefAttribute","trim","map","sel","join","SelectorEngine","concat","Element","findOne","children","child","matches","parents","ancestor","prev","previous","previousElementSibling","next","nextElementSibling","focusableChildren","focusables","el","getSelectorFromElement","getElementFromSelector","getMultipleElementsFromSelector","enableDismissTrigger","component","method","clickEvent","tagName","EVENT_CLOSE","EVENT_CLOSED","Alert","close","_destroyElement","each","data","undefined","SELECTOR_DATA_TOGGLE","Button","toggle","button","EVENT_TOUCHSTART","EVENT_TOUCHMOVE","EVENT_TOUCHEND","EVENT_POINTERDOWN","EVENT_POINTERUP","endCallback","leftCallback","rightCallback","Swipe","isSupported","_deltaX","_supportPointerEvents","PointerEvent","_initEvents","_start","_eventIsPointerPenTouch","clientX","touches","_end","_handleSwipe","_move","absDeltaX","abs","direction","add","pointerType","navigator","maxTouchPoints","DATA_API_KEY","ORDER_NEXT","ORDER_PREV","DIRECTION_LEFT","DIRECTION_RIGHT","EVENT_SLIDE","EVENT_SLID","EVENT_KEYDOWN","EVENT_MOUSEENTER","EVENT_MOUSELEAVE","EVENT_DRAG_START","EVENT_LOAD_DATA_API","EVENT_CLICK_DATA_API","CLASS_NAME_CAROUSEL","CLASS_NAME_ACTIVE","SELECTOR_ACTIVE","SELECTOR_ITEM","SELECTOR_ACTIVE_ITEM","KEY_TO_DIRECTION","ArrowLeft","ArrowRight","interval","keyboard","pause","ride","touch","wrap","Carousel","_interval","_activeElement","_isSliding","touchTimeout","_swipeHelper","_indicatorsElement","_addEventListeners","cycle","_slide","nextWhenVisible","hidden","_clearInterval","_updateInterval","setInterval","_maybeEnableCycle","to","items","_getItems","activeIndex","_getItemIndex","_getActive","order","defaultInterval","_keydown","_addTouLine truncated
|
||||
+37
-19
@@ -11,7 +11,7 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3 style="white-space: nowrap;">not-a-rescheduler<br><span id="version"></span></h3>
|
||||
<h3 style="white-space: nowrap;">not-a-rescheduler <span id="version"></span></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -23,28 +23,45 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" class="form-control" id="username" placeholder="Username">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" class="form-control" id="password" placeholder="Password">
|
||||
<button type="button" id="showPassword" class="btn btn-link btn-sm">Show password</button>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<button type="button mb-2" class="btn btn-primary" id="saveButton">Save credentials</button>
|
||||
<span id="saveStatus">Saved!</span>
|
||||
</div>
|
||||
<div class="col form-group">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" class="form-control" id="username" placeholder="Username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" class="form-control" id="password" placeholder="Password"><button type="button" id="showPassword" class="btn btn-link btn-sm">Show</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mb-2">
|
||||
<input type="range" id="frequency" name="frequency" min="1" max="10" step="1">
|
||||
<label for="frequency">Frequency of checks<br>(every <span id="frequency_info">1</span> minutes)</label>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" id="saveButton">Save credentials</button>
|
||||
<span id="saveStatus">Saved!</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="frequency" class="form-label">Frequency (minutes)</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="number" class="form-control" id="frequency" placeholder="minutes">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="deltaAppt">Appointment delta (days)</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="number" class="form-control" id="deltaAppt" placeholder="days">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="deltaNow">Preparation time (days)</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="number" class="form-control" id="deltaNow" placeholder="days">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -53,6 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="bootstrap.bundle.min.js"></script>
|
||||
<script src="popup.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
+11
-4
@@ -8,13 +8,14 @@
|
||||
document.getElementById("username").value = items["__username"] || "";
|
||||
document.getElementById("password").value = items["__password"] || "";
|
||||
document.getElementById("frequency").value = items["__frequency"] || 1;
|
||||
document.getElementById("frequency_info").innerText = items["__frequency"] || 1;
|
||||
document.getElementById("status").innerText = items["__status"] || "unknown";
|
||||
document.getElementById("deltaAppt").value = items["__deltaAppt"] || 1;
|
||||
document.getElementById("deltaNow").value = items["__deltaNow"] || 1;
|
||||
});
|
||||
|
||||
chrome.storage.onChanged.addListener((changes, area) => {
|
||||
if (changes.__frequency)
|
||||
document.getElementById("frequency_info").innerText = changes.__frequency.newValue;
|
||||
document.getElementById("frequency_info").innerText = changes.__frequency.newValue;
|
||||
});
|
||||
|
||||
// activate checkbox
|
||||
@@ -62,9 +63,15 @@
|
||||
passwordField.type = "password";
|
||||
});
|
||||
|
||||
// frequency range slider
|
||||
document.getElementById("frequency").addEventListener("change", function() {
|
||||
// range sliders
|
||||
document.getElementById("frequency").addEventListener("input", function() {
|
||||
chrome.storage.local.set({ __frequency: this.value });
|
||||
});
|
||||
document.getElementById("deltaAppt").addEventListener("input", function() {
|
||||
chrome.storage.local.set({ __deltaAppt: this.value });
|
||||
});
|
||||
document.getElementById("deltaNow").addEventListener("change", function() {
|
||||
chrome.storage.local.set({ __deltaNow: this.value });
|
||||
});
|
||||
|
||||
})();
|
||||
+7
-3
@@ -18,6 +18,8 @@ let config = {
|
||||
apptDate: null,
|
||||
signinAttempts: null,
|
||||
consulates: null,
|
||||
deltaAppt: null,
|
||||
deltaNow: null,
|
||||
};
|
||||
let isRunning = false;
|
||||
|
||||
@@ -164,6 +166,8 @@ async function runner() {
|
||||
config.apptId = result['__apptId'] || null;
|
||||
config.apptDate = result['__apptDate'] || null;
|
||||
config.consulates = result['__consulates'] || null;
|
||||
config.deltaAppt = result['__deltaAppt'] || 1;
|
||||
config.deltaNow = result['__deltaNow'] || 1;
|
||||
|
||||
if (prev_config.activate === null) {
|
||||
console.log('Reading config: ' + JSON.stringify(config));
|
||||
@@ -229,7 +233,7 @@ async function runner() {
|
||||
|
||||
if (config.countdown > 0) {
|
||||
config.countdown -= 1;
|
||||
if (config.countdown % 10 === 0 || config.countdown <= 5) {
|
||||
if (config.countdown % 30 === 0 || config.countdown <= 5) {
|
||||
console.log(`Countdown: ${config.countdown}s`);
|
||||
}
|
||||
await chrome.storage.local.set({ "__countdown": config.countdown });
|
||||
@@ -369,7 +373,7 @@ async function runner() {
|
||||
|
||||
// if empty list, either we're banned or non operational hours or dead consulate
|
||||
if (availDates.length == 0) {
|
||||
console.log('No available dates in ' + consulate);
|
||||
console.log(`No available dates in ${consulate}, probably banned`);
|
||||
await chrome.storage.local.set({ "__status": "no dates in " + consulate });
|
||||
config.countdown = SOFT_BAN_COUNTDOWN;
|
||||
await chrome.storage.local.set({ "__countdown": config.countdown });
|
||||
@@ -382,7 +386,7 @@ async function runner() {
|
||||
await chrome.storage.local.set({ "__consulates": config.consulates });
|
||||
|
||||
// filter dates with our requests
|
||||
let filteredDates = await filterDates(availDates, config.apptDate, 30, 3);
|
||||
let filteredDates = await filterDates(availDates, config.apptDate, config.deltaAppt, config.deltaNow);
|
||||
if (!filteredDates.length) {
|
||||
console.log('Nothing interesting found in ' + consulate);
|
||||
await chrome.storage.local.set({ "__status": `Nothing in ${consulate}, best date ${availDates[0]}`});
|
||||
|
||||
Reference in new issue
Block a user