GetDeviceGroups in DataService. TypeScript rework.

This commit is contained in:
Jared Goodwin 2019-12-11 23:13:16 -08:00
parent 8189e237b3
commit ae57084eb2
46 changed files with 38674 additions and 68 deletions

View File

@ -90,7 +90,7 @@
@if (!string.IsNullOrWhiteSpace(Model.Invites[i].ResetUrl))
{
<br />
<a href="@Model.Invites[i].ResetUrl">Reset Password</a>
<a href="@Model.Invites[i].ResetUrl">Password Reset</a>
}
</label>
</td>

View File

@ -176,6 +176,13 @@ namespace Remotely.Server.Data
x.ID == deviceID);
}
public List<DeviceGroup> GetDeviceGroupsForUserName(string username)
{
var user = RemotelyContext.Users.FirstOrDefault(x => x.UserName == username);
return RemotelyContext.DeviceGroups.Where(x => x.OrganizationID == user.OrganizationID).ToList();
}
public RemotelyUser GetUserByID(string userID)
{
if (userID == null)
@ -349,7 +356,7 @@ namespace Remotely.Server.Data
.FirstOrDefault(x => x.UserName == requesterUserName);
var invite = requester.Organization.InviteLinks.FirstOrDefault(x => x.ID == inviteID);
var user = RemotelyContext.Users.FirstOrDefault(x => x.UserName == invite.InvitedUser);
if (string.IsNullOrWhiteSpace(user.PasswordHash))
if (user != null && string.IsNullOrWhiteSpace(user.PasswordHash))
{
RemotelyContext.Remove(user);
}

View File

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Remotely.Shared.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Remotely.Server.Pages
{
@ -19,13 +20,19 @@ namespace Remotely.Server.Pages
}
public string DefaultPrompt { get; set; }
public List<SelectListItem> DeviceGroups { get; set; } = new List<SelectListItem>();
public void OnGet()
{
if (User?.Identity?.IsAuthenticated == true)
{
DefaultPrompt = DataService.GetDefaultPrompt(User.Identity.Name);
var groups = DataService.GetDeviceGroupsForUserName(User.Identity.Name);
DeviceGroups.Add(new SelectListItem("All", null));
if (groups?.Any() == true)
{
DeviceGroups.AddRange(groups.Select(x => new SelectListItem(x.Name, x.ID)));
}
}
else
{

View File

@ -138,5 +138,10 @@
</footer>
<script type="module" src="~/scripts/RemoteControl/Main.js">
</script>
<script>
window.onload = () => {
RemoteControl.Init();
}
</script>
</body>
</html>

View File

@ -27,6 +27,7 @@
<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/popper.js/popper.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/lib/signalr/signalr.js"></script>
<script src="~/lib/signalr/msgpack5.js"></script>
@ -34,6 +35,7 @@
</environment>
<environment exclude="Development">
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/popper.js/popper.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="~/lib/signalr/signalr.min.js"></script>
<script src="~/lib/signalr/msgpack5.min.js"></script>

View File

@ -1,10 +1,18 @@
<div id="dataGridFrame" class="tab-pane fade">
@model IndexModel
<div id="dataGridFrame" class="tab-pane fade">
<div id="deviceGridWrapper">
<div id="gridControlsWrapper">
<button id="startRemoteControlButton" class="btn btn-sm btn-secondary">Remote Control</button>
<button id="toggleAllDevices" class="btn btn-sm btn-secondary">Select All</button>
<span>Filter:</span>
<input id="gridFilter" />
<div>
<label>Device Group:</label>
<select asp-items="Model.DeviceGroups" class="form-control" style="width: 200px"></select>
</div>
<div style="text-align: right">
<button id="startRemoteControlButton" class="btn btn-sm btn-secondary">Remote Control</button>
<button id="toggleAllDevices" class="btn btn-sm btn-secondary">Select All</button>
<span>Filter:</span>
<input id="gridFilter" />
</div>
</div>
<table id="deviceGrid" class="table table-responsive table-hover table-striped">
<thead>

View File

@ -82,7 +82,7 @@
</div>
</div>
</div>
<partial name="_DataGrid" />
<partial name="_DataGrid" model="Model" />
</div>
</div>
@ -90,3 +90,10 @@
</div>
<script src="~/scripts/Main.js" type="module"></script>
<script>
window.onload = (ev) => {
Remotely.Init();
document.querySelector(".loading-frame").remove();
document.querySelector(".work-area").classList.remove("hidden");
}
</script>

View File

@ -44,7 +44,6 @@
<Content Remove="wwwroot\scripts\Models\Point.ts" />
<Content Remove="wwwroot\scripts\Models\UserOptions.ts" />
<Content Remove="wwwroot\scripts\Pages\OrganizationManagement.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\Conductor.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\Main.ts" />
<Content Remove="wwwroot\scripts\RemoteControl\UI.ts" />
<Content Remove="wwwroot\scripts\ResultsParser.ts" />
@ -148,7 +147,6 @@
<TypeScriptCompile Include="wwwroot\scripts\Models\Parameter.ts" />
<TypeScriptCompile Include="wwwroot\scripts\Pages\OrganizationManagement.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\Main.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\Conductor.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\UI.ts" />
<TypeScriptCompile Include="wwwroot\scripts\ResultsParser.ts" />
<TypeScriptCompile Include="wwwroot\scripts\RemoteControl\RCBrowserSockets.ts" />

Binary file not shown.

Binary file not shown.

View File

@ -7,7 +7,8 @@
"target": "es2017",
"module": "ESNext",
"allowJs": false,
"moduleResolution": "Node"
"moduleResolution": "Node",
"typeRoots": [ "wwwroot/lib/@types/"]
},
"exclude": [
"node_modules",

View File

@ -68,7 +68,9 @@ h6 {
#gridControlsWrapper {
text-align: right;
display: grid;
grid-template-columns: auto 1fr;
grid-column-gap: 20px;
margin-bottom: 5px;
margin-right: 5px;
padding-top: 3px;

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/bootstrap`
# Summary
This package contains type definitions for Bootstrap (https://github.com/twbs/bootstrap/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bootstrap
Additional Details
* Last updated: Mon, 08 Jul 2019 21:09:27 GMT
* Dependencies: @types/popper.js, @types/jquery
* Global values: Bootstrap
# Credits
These definitions were written by denisname <https://github.com/denisname>.

View File

@ -0,0 +1,640 @@
// Type definitions for Bootstrap 4.3
// Project: https://github.com/twbs/bootstrap/, https://getbootstrap.com
// Definitions by: denisname <https://github.com/denisname>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery"/>
import * as Popper from "popper.js";
export as namespace Bootstrap;
// --------------------------------------------------------------------------
// Some Types and Interfaces
// --------------------------------------------------------------------------
export type Placement = "auto" | "top" | "bottom" | "left" | "right";
export type Trigger = "click" | "hover" | "focus" | "manual" |
"click hover" | "click focus" | "hover focus" |
"click hover focus";
export interface Delay {
show: number;
hide: number;
}
export interface TooltipInstance<T extends TooltipOption> {
config: T;
element: Element;
tip: HTMLElement;
}
export interface OffsetsExtend {
popper?: Partial<Popper.Offset>;
reference?: Partial<Popper.Offset>;
}
// --------------------------------------------------------------------------------------
// Options Interfaces
// --------------------------------------------------------------------------------------
export interface CarouselOption {
/**
* The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.
*
* @default 5000
*/
interval?: false | number;
/**
* Whether the carousel should react to keyboard events.
*
* @default true
*/
keyboard?: boolean;
/**
* Use to easily control the position of the carousel. It accepts the keywords prev or next, which alters the slide position
* relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel.
*
* @default false
*/
slide?: "next" | "prev" | false;
/**
* If set to "hover", pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`.
* If set to false, hovering over the carousel won't pause it.
*
* On touch-enabled devices, when set to "hover", cycling will pause on `touchend` (once the user finished interacting with the carousel)
* for two intervals, before automatically resuming. Note that this is in addition to the above mouse behavior.
*
* @default "hover"
*/
pause?: "hover" | false;
/**
* Whether the carousel should cycle continuously or have hard stops.
*
* @default true
*/
wrap?: boolean;
/**
* Whether the carousel should support left/right swipe interactions on touchscreen devices.
*
* @default true
*/
touch?: boolean;
}
export interface CollapseOption {
/**
* If parent is provided, then all collapsible elements under the specified parent will be closed when
* this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the card class).
* The attribute has to be set on the target collapsible area.
*
* @default ""
*/
parent?: string | JQuery | Element;
/**
* Toggles the collapsible element on invocation.
*
* @default true
*/
toggle?: boolean;
}
export interface DropdownOption {
/**
* Offset of the dropdown relative to its target.
* For more information refer to Popper.js's offset docs.
*
* @default 0
*/
offset?: number | string | ((this: DropdownOption, offset: OffsetsExtend) => OffsetsExtend);
/**
* Allow Dropdown to flip in case of an overlapping on the reference element.
* For more information refer to Popper.js's flip docs.
*
* @default true
*/
flip?: boolean;
/**
* Overflow constraint boundary of the dropdown menu.
* Accepts the values of 'viewport', 'window', 'scrollParent', or an HTMLElement reference (JavaScript only).
* For more information refer to Popper.js's preventOverflow docs.
*
* @default "scrollParent"
*/
boundary?: Popper.Boundary | HTMLElement;
/**
* Reference element of the dropdown menu. Accepts the values of 'toggle', 'parent', or an HTMLElement reference.
* For more information refer to Popper.js's referenceObject docs.
*
* @default "toggle"
*/
reference?: "toggle" | "parent" | HTMLElement;
/**
* By default, we use Popper.js for dynamic positioning. Disable this with 'static'.
*
* @default "dynamic"
*/
display?: "dynamic" | "static";
}
export interface ModalOption {
/**
* Includes a modal-backdrop element.
* Alternatively, specify `static` for a backdrop which doesn't close the modal on click.
*
* @default true
*/
backdrop?: boolean | "static";
/**
* Closes the modal when escape key is pressed.
*
* @default true
*/
keyboard?: boolean;
/**
* Puts the focus on the modal when initialized.
*
* @default true
*/
focus?: boolean;
/**
* Shows the modal when initialized.
*
* @default true
*/
show?: boolean;
}
export interface PopoverOption extends TooltipOption {
/**
* Default content value if `data-content` attribute isn't present.
* If a function is given, it will be called with its `this` reference
* set to the element that the popover is attached to.
*
* @default ""
*/
content?: string | Element | ((this: Element) => string | Element);
}
export interface ScrollspyOption {
/**
* Finds which section the spied element is in:
* * `auto` will choose the best method get scroll coordinates.
* * `offset` will use jQuery offset method to get scroll coordinates.
* * `position` will use jQuery position method to get scroll coordinates.
*
* @default "auto"
*/
method?: "auto" | "offset" | "position";
/**
* Pixels to offset from top when calculating position of scroll.
*
* @default 10
*/
offset?: number;
/**
* A selector of the parent element or the parent element itself
* of any Bootstrap `.nav` or `.list-group` component.
*
* @default ""
*/
target?: string | Element;
}
export interface ToastOption {
/**
* Apply a CSS fade transition to the toast.
*
* @default true
*/
animation?: boolean;
/**
* Auto hide the toast.
*
* @default true
*/
autohide?: boolean;
/**
* Delay hiding the toast in millisecond.
*
* @default 500
*/
delay?: number;
}
export interface TooltipOption {
/**
* Apply a CSS fade transition to the tooltip or popover.
*
* @default true
*/
animation?: boolean;
/**
* Appends the tooltip or popover to a specific element. Example: `container: 'body'`.
* This option is particularly useful in that it allows you to position the tooltip or popover
* in the flow of the document near the triggering element - which will prevent
* it from floating away from the triggering element during a window resize.
*
* @default false
*/
container?: string | Element | false;
/**
* Delay showing and hiding the tooltip or popover (ms) - does not apply to manual trigger type.
* If a number is supplied, delay is applied to both hide/show.
* Object structure is: `delay: { "show": 500, "hide": 100 }`.
*
* @default 0
*/
delay?: number | Delay;
/**
* Allow HTML in the tooltip or popover.
* If true, HTML tags will be rendered in the tooltip or popover.
* If false, jQuery's text method will be used to insert content into the DOM.
* Use text if you're worried about XSS attacks.
*
* @default false
*/
html?: boolean;
/**
* How to position the tooltip or popover - auto | top | bottom | left | right.
* When "auto" is specified, it will dynamically reorient the tooltip or popover.
*
* When a function is used to determine the placement, it is called with
* the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second.
* The `this` context is set to the tooltip or popover instance.
*
* @default tooltip: "top", popover: "right"
*/
placement?: Placement | ((this: TooltipInstance<this>, node: HTMLElement, trigger: Element) => Placement);
/**
* If a selector is provided, tooltip or popover objects will be delegated to the specified targets.
* In practice, this is used to enable dynamic HTML content to have popovers added.
*
* @default false
*/
selector?: string | false;
/**
* Base HTML to use when creating the tooltip or popover.
* The tooltip's (resp., popover's) title will be injected into the `.tooltip-inner` (resp., `.popover-header`).
* The `.arrow` will become the tooltip's (resp., popover's) arrow.
* The outermost wrapper element should have the `.tooltip` (resp., .popover) class and `role="tooltip"`.
*
* @default '<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
* @default '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'
*/
template?: string;
/**
* Default title value if title attribute isn't present.
* If a function is given, it will be called with its `this` reference set to the element
* that the tooltip or popover is attached to.
*
* @default ""
*/
title?: string | Element | ((this: Element) => string | Element);
/**
* How tooltip or popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.
* 'manual' indicates that the tooltip will be triggered programmatically; this value cannot be combined with any other trigger.
* 'hover' should only be used if alternative methods for conveying the same information for keyboard users is present.
*
* @default tooltip: "hover focus", popover: "click"
*/
trigger?: Trigger;
/**
* Offset of the tooltip or popover relative to its target.
* For more information refer to Popper.js's offset docs.
*
* @default 0
*/
offset?: number | string;
/**
* Allow to specify which position Popper will use on fallback.
* For more information refer to Popper.js's behavior docs.
*
* @default "flip"
*/
fallbackPlacement?: Popper.Behavior | ReadonlyArray<Popper.Behavior>;
/**
* Overflow constraint boundary of the tooltip or popover.
* Accepts the values of 'viewport', 'window', 'scrollParent',
* or an HTMLElement reference (JavaScript only).
* For more information refer to Popper.js's preventOverflow docs.
*
* @default "scrollParent"
*/
boundary?: Popper.Boundary | HTMLElement;
/**
* Enable or disable the sanitization. If activated 'template', 'content' and 'title' options will be sanitized.
*
* @default true
*/
sanitize?: boolean;
/**
* Object which contains allowed attributes and tags.
*/
whiteList?: {[key: string]: string[]};
/**
* Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization.
*
* @default null
*/
sanitizeFn?: null | ((input: string) => string);
}
// --------------------------------------------------------------------------------------
// Events
// --------------------------------------------------------------------------------------
export interface CarouselEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined, HTMLElement, HTMLElement> {
/**
* The carousel dom element.
*/
target: HTMLElement; // overridden only for better JsDoc
/**
* The direction in which the carousel is sliding.
*/
direction: "left" | "right";
/**
* The DOM element that is being slid into place as the active item.
*/
relatedTarget: HTMLElement;
/**
* The index of the current item.
*/
from: number;
/**
* The index of the next item.
*/
to: number;
}
export interface DropdownsEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined, HTMLElement, HTMLElement> {
/**
* The the dropdown's toggle and the dropdown menu container (the `.dropdown` element).
*/
target: HTMLElement; // overridden only for better JsDoc
/**
* The toggling anchor element.
*/
relatedTarget: HTMLElement;
}
export interface ModalEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined, HTMLElement, HTMLElement> {
/**
* The modal dom element.
*/
target: HTMLElement; // overridden only for better JsDoc
/**
* For `show.bs.modal` and `shown.bs.modal` is the clicked element, when caused by a _click_.
* Otherwise is undefined.
*/
relatedTarget: HTMLElement | undefined;
}
export interface TapEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined, HTMLElement, HTMLElement> {
/**
* * For `show.bs.tab` and `shown.bs.tab`, is the newly activated tab.
* * For `hide.bs.tab`, is the current active tab.
* * For `hidden.bs.tab`, is the previous active tab.
*/
target: HTMLElement; // overridden only for better JsDoc
/**
* * For `show.bs.tab` and `shown.bs.tab`, is the previous active tab.
* * For `hide.bs.tab`, is the new soon-to-be-active tab.
* * For `hidden.bs.tab`, is the new active tab.
*/
relatedTarget: HTMLElement;
}
export type AlertEvent = "close.bs.alert" | "closed.bs.alert";
export type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel";
export type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse";
export type DropdownEvent = "show.bs.dropdown" | "shown.bs.dropdown" | "hide.bs.dropdown" | "hidden.bs.dropdown";
export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | "hidden.bs.modal";
export type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover";
export type ScrollspyEvent = "activate.bs.scrollspy";
export type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab";
export type ToastEvent = "show.bs.toast" | "shown.bs.toast" | "hide.bs.toast" | "hidden.bs.toast";
export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.tooltip" | "hidden.bs.tooltip" | "inserted.bs.tooltip";
// --------------------------------------------------------------------------------------
// jQuery
// --------------------------------------------------------------------------------------
declare global {
interface JQuery<TElement = HTMLElement> {
/**
* If no _method_ is specified, makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute.
* (Not necessary when using the data-api's auto-initialization.)
* Otherwise, call the method on the alert element:
* * `close` Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed.
* * `dispose` Destroys an element's alert.
*/
alert(action?: "close" | "dispose"): this;
/**
* Call a method on the button element:
* * `toggle` Toggles push state. Gives the button the appearance that it has been activated.
* * `dispose` Destroys an element's button.
*/
button(action: "toggle" | "dispose"): this;
/**
* Call a method on the carousel element:
* * `cycle` Cycles through the carousel items from left to right.
* * `pause` Stops the carousel from cycling through items.
* * _number_ Cycles the carousel to a particular frame (0 based, similar to an array).
* * `prev` Cycles to the previous item.
* * `next` Cycles to the next item.
* * `dispose` Destroys an element's carousel.
*
* Returns to the caller before the target item has been shown (i.e. before the `slid.bs.carousel` event occurs).
*/
carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this;
/**
* Initializes the carousel and starts cycling through items.
*/
carousel(options?: CarouselOption): this;
/**
* Call a method on the collapsible element:
* * `toggle` Toggles a collapsible element to shown or hidden.
* * `show` Shows a collapsible element.
* * `hide` Hides a collapsible element.
* * `dispose` Destroys an element's collapse.
*
* Returns to the caller before the collapsible element has actually been shown or hidden (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs).
*/
collapse(action: "toggle" | "show" | "hide" | "dispose"): this;
/**
* Activates a content as a collapsible element.
*/
collapse(options?: CollapseOption): this;
/**
* Call a method on the dropdown element:
* * `toggle` Toggles the dropdown menu of a given navbar or tabbed navigation.
* * `show` Shows the dropdown menu of a given navbar or tabbed navigation.
* * `hide` Hides the dropdown menu of a given navbar or tabbed navigation.
* * `update` Updates the position of an element's dropdown.
* * `dispose` Destroys an element's dropdown.
*/
dropdown(action: "toggle" | "show" | "hide" | "update" | "dispose"): this;
/**
* Toggle contextual overlays for displaying lists of links.
*
* The data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element.
*/
dropdown(options?: DropdownOption): this;
/**
* Call a method on the modal element:
* * `toggle` Manually toggles a modal.
* * `show` Manually opens a modal.
* * `hide` Manually hides a modal.
* * `handleUpdate` Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears).
* * `dispose` Destroys an element's modal.
*
* Returns to the caller before the modal has actually been shown or hidden (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs).
*/
modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this;
/**
* Activates a content as a modal.
*/
modal(options?: ModalOption): this;
/**
* Call a method on the popover element:
* * `show` Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed.
* * `hide` Hides an element's popover.
* * `toggle` Toggles an element's popover.
* * `dispose` Hides and destroys an element's popover.
* Popovers that use delegation (which are created using the `selector` option) cannot be individually destroyed on descendant trigger elements.
* * `enable` Gives an element's popover the ability to be shown. Popovers are enabled by default.
* * `disable` Removes the ability for an element's popover to be shown. The popover will only be able to be shown if it is re-enabled.
* * `toggleEnabled` Toggles the ability for an element's popover to be shown or hidden.
* * `update` Updates the position of an element's popover.
*
* Returns to the caller before the popover has actually been shown or hidden (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs).
* This is considered a "manual" triggering of the popover.
*/
popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this;
/**
* Initializes popovers for an element collection.
*/
popover(options?: PopoverOption): this;
// tslint:disable:jsdoc-format
/**
* Call a method on the scrollspy element:
* * `refresh` When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh, see example.
* * `dispose` Destroys an element's scrollspy.
*
* @example
```javascript
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
})
```
*/
// tslint:enable:jsdoc-format
scrollspy(action: "refresh" | "dispose"): this;
/**
* Add scrollspy behavior to a topbar navigation.
*/
scrollspy(options?: ScrollspyOption): this;
/**
* Call a method on the list item or tab element:
* * `show` Selects the given list item or tab and shows its associated pane.
* Any other list item or tab that was previously selected becomes unselected and its associated pane is hidden.
* * `dispose` Destroys an element's tab.
*
* Returns to the caller before the tab pane has actually been shown (i.e. before the `shown.bs.tab` event occurs).
*/
tab(action: "show" | "dispose"): this;
/**
* Call a method on the toast element:
* * `show` Reveals an element's toast. You have to manually call this method, instead your toast won't show.
* * `hide` Hides an element's toast. You have to manually call this method if you made `autohide` to false.
* * `dispose` Hides an element's toast. Your toast will remain on the DOM but won't show anymore.
*
* Returns to the caller before the toast has actually been shown or hidden (i.e. before the `shown.bs.toast` or `hidden.bs.toast` event occurs).
*/
toast(action: "show" | "hide" | "dispose"): this;
/**
* Attaches a toast handler to an element collection.
*/
toast(options?: ToastOption): this;
/**
* Call a method on the tooltip element:
* * `show` Reveals an element's tooltip. Tooltips with zero-length titles are never displayed.
* * `hide` Hides an element's tooltip.
* * `toggle` Toggles an element's tooltip.
* * `dispose` Hides and destroys an element's tooltip.
* Tooltips that use delegation (which are created using `selector` option) cannot be individually destroyed on descendant trigger elements.
* * `enable` Gives an element's tooltip the ability to be shown. Tooltips are enabled by default.
* * `disable` Removes the ability for an element's tooltip to be shown. The tooltip will only be able to be shown if it is re-enabled.
* * `toggleEnabled` Toggles the ability for an element's tooltip to be shown or hidden.
* * `update` Updates the position of an element's tooltip.
*
* Returns to the caller before the tooltip has actually been shown or hidden (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs).
* This is considered a "manual" triggering of the tooltip.
*/
tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this;
/**
* Attaches a tooltip handler to an element collection.
*/
tooltip(options?: TooltipOption): this;
on(events: CarouselEvent, handler: JQuery.EventHandlerBase<TElement, CarouselEventHandler<TElement>>): this;
on(events: DropdownEvent, handler: JQuery.EventHandlerBase<TElement, DropdownsEventHandler<TElement>>): this;
on(events: ModalEvent, handler: JQuery.EventHandlerBase<TElement, ModalEventHandler<TElement>>): this;
on(events: TapEvent, handler: JQuery.EventHandlerBase<TElement, TapEventHandler<TElement>>): this;
on(
events: AlertEvent | CollapseEvent | PopoverEvent | ScrollspyEvent | ToastEvent | TooltipEvent,
handler: JQuery.EventHandler<TElement>
): this;
}
}

View File

@ -0,0 +1,56 @@
{
"_from": "@types/bootstrap@^4.3.1",
"_id": "@types/bootstrap@4.3.1",
"_inBundle": false,
"_integrity": "sha512-n7Zv7Y+C98Yv4oqbyqGn3alCvNRCya2xMYzOdVEnmnFlu04MXQk1ntVrBhXzDkiwhZZYNkNfBZn2yhTnEh/mHQ==",
"_location": "/@types/bootstrap",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/bootstrap@^4.3.1",
"name": "@types/bootstrap",
"escapedName": "@types%2fbootstrap",
"scope": "@types",
"rawSpec": "^4.3.1",
"saveSpec": null,
"fetchSpec": "^4.3.1"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-4.3.1.tgz",
"_shasum": "15fa89a4d275b114a4eceb90909d4eb8b90d43f5",
"_spec": "@types/bootstrap@^4.3.1",
"_where": "D:\\source\\repos\\Remotely\\Server",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "denisname",
"url": "https://github.com/denisname"
}
],
"dependencies": {
"@types/jquery": "*",
"popper.js": "^1.14.1"
},
"deprecated": false,
"description": "TypeScript definitions for Bootstrap",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/bootstrap",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/bootstrap"
},
"scripts": {},
"typeScriptVersion": "2.3",
"types": "index",
"typesPublisherContentHash": "4b0565169fc0c6fe3bf8da50a5d342621d05acc98962d4add778a13182bde0dc",
"version": "4.3.1"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/jquery`
# Summary
This package contains type definitions for jquery (https://jquery.com).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery
Additional Details
* Last updated: Mon, 05 Aug 2019 20:07:11 GMT
* Dependencies: @types/sizzle
* Global values: $, Symbol, jQuery
# Credits
These definitions were written by Leonard Thieu <https://github.com/leonard-thieu>, Boris Yankov <https://github.com/borisyankov>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly>, Dick van den Brink <https://github.com/DickvdBrink>, Thomas Schulz <https://github.com/King2500>, and Terry Mun <https://github.com/terrymun>.

View File

@ -0,0 +1,3 @@
/// <reference types="jquery" />
export = jQuery;

View File

@ -0,0 +1,34 @@
// Type definitions for jquery 3.3
// Project: https://jquery.com
// Definitions by: Leonard Thieu <https://github.com/leonard-thieu>
// Boris Yankov <https://github.com/borisyankov>
// Christian Hoffmeister <https://github.com/choffmeister>
// Steve Fenton <https://github.com/Steve-Fenton>
// Diullei Gomes <https://github.com/Diullei>
// Tass Iliopoulos <https://github.com/tasoili>
// Jason Swearingen <https://github.com/jasons-novaleaf>
// Sean Hill <https://github.com/seanski>
// Guus Goossens <https://github.com/Guuz>
// Kelly Summerlin <https://github.com/ksummerlin>
// Basarat Ali Syed <https://github.com/basarat>
// Nicholas Wolverson <https://github.com/nwolverson>
// Derek Cicerone <https://github.com/derekcicerone>
// Andrew Gaspar <https://github.com/AndrewGaspar>
// Seikichi Kondo <https://github.com/seikichi>
// Benjamin Jackman <https://github.com/benjaminjackman>
// Poul Sorensen <https://github.com/s093294>
// Josh Strobl <https://github.com/JoshStrobl>
// John Reilly <https://github.com/johnnyreilly>
// Dick van den Brink <https://github.com/DickvdBrink>
// Thomas Schulz <https://github.com/King2500>
// Terry Mun <https://github.com/terrymun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="sizzle" />
/// <reference path="JQueryStatic.d.ts" />
/// <reference path="JQuery.d.ts" />
/// <reference path="misc.d.ts" />
/// <reference path="legacy.d.ts" />
export = jQuery;

View File

@ -0,0 +1,204 @@
// tslint:disable:no-irregular-whitespace
// tslint:disable-next-line:no-empty-interface
interface JQueryCallback extends JQuery.Callbacks { }
interface JQueryDeferred<T> extends JQuery.Deferred<T> { }
// tslint:disable-next-line:no-empty-interface
interface JQueryEventConstructor extends JQuery.EventStatic { }
interface JQueryDeferred<T> extends JQuery.Deferred<T> { }
// tslint:disable-next-line:no-empty-interface
interface JQueryAjaxSettings extends JQuery.AjaxSettings { }
interface JQueryAnimationOptions extends JQuery.EffectsOptions<Element> { }
// tslint:disable-next-line:no-empty-interface
interface JQueryCoordinates extends JQuery.Coordinates { }
interface JQueryGenericPromise<T> extends JQuery.Thenable<T> { }
// tslint:disable-next-line:no-empty-interface
interface JQueryXHR extends JQuery.jqXHR { }
interface JQueryPromise<T> extends JQuery.Promise<T> { }
// tslint:disable-next-line:no-empty-interface
interface JQuerySerializeArrayElement extends JQuery.NameValuePair { }
/**
* @deprecated Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`.
*/
// tslint:disable-next-line:no-empty-interface
interface JQuerySupport extends JQuery.PlainObject { }
// Legacy types that are not represented in the current type definitions are marked deprecated.
/**
* @deprecated Deprecated. Use \`{@link JQuery.Deferred.Callback }\` or \`{@link JQuery.Deferred.CallbackBase }\`.
*/
interface JQueryPromiseCallback<T> {
// tslint:disable-next-line:callable-types
(value?: T, ...args: any[]): void;
}
/**
* @deprecated Deprecated. Use \`{@link JQueryStatic.param JQueryStatic&#91;'param'&#93;}\`.
*/
interface JQueryParam {
/**
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
* @param obj An array or object to serialize.
* @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
*/
// tslint:disable-next-line:callable-types
(obj: any, traditional?: boolean): string;
}
/**
* @deprecated Deprecated. Use \`{@link JQuery.Event }\`.
*/
interface BaseJQueryEventObject extends Event {
/**
* The current DOM element within the event bubbling phase.
* @see \`{@link https://api.jquery.com/event.currentTarget/ }\`
*/
currentTarget: Element;
/**
* An optional object of data passed to an event method when the current executing handler is bound.
* @see \`{@link https://api.jquery.com/event.data/ }\`
*/
data: any;
/**
* The element where the currently-called jQuery event handler was attached.
* @see \`{@link https://api.jquery.com/event.delegateTarget/ }\`
*/
delegateTarget: Element;
/**
* Returns whether event.preventDefault() was ever called on this event object.
* @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\`
*/
isDefaultPrevented(): boolean;
/**
* Returns whether event.stopImmediatePropagation() was ever called on this event object.
* @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\`
*/
isImmediatePropagationStopped(): boolean;
/**
* Returns whether event.stopPropagation() was ever called on this event object.
* @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\`
*/
isPropagationStopped(): boolean;
/**
* The namespace specified when the event was triggered.
* @see \`{@link https://api.jquery.com/event.namespace/ }\`
*/
namespace: string;
/**
* The browser's original Event object.
* @see \`{@link https://api.jquery.com/category/events/event-object/ }\`
*/
originalEvent: Event;
/**
* If this method is called, the default action of the event will not be triggered.
* @see \`{@link https://api.jquery.com/event.preventDefault/ }\`
*/
preventDefault(): any;
/**
* The other DOM element involved in the event, if any.
* @see \`{@link https://api.jquery.com/event.relatedTarget/ }\`
*/
relatedTarget: Element;
/**
* The last value returned by an event handler that was triggered by this event, unless the value was undefined.
* @see \`{@link https://api.jquery.com/event.result/ }\`
*/
result: any;
/**
* Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
* @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\`
*/
stopImmediatePropagation(): void;
/**
* Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
* @see \`{@link https://api.jquery.com/event.stopPropagation/ }\`
*/
stopPropagation(): void;
/**
* The DOM element that initiated the event.
* @see \`{@link https://api.jquery.com/event.target/ }\`
*/
target: Element;
/**
* The mouse position relative to the left edge of the document.
* @see \`{@link https://api.jquery.com/event.pageX/ }\`
*/
pageX: number;
/**
* The mouse position relative to the top edge of the document.
* @see \`{@link https://api.jquery.com/event.pageY/ }\`
*/
pageY: number;
/**
* For key or mouse events, this property indicates the specific key or button that was pressed.
* @see \`{@link https://api.jquery.com/event.which/ }\`
*/
which: number;
/**
* Indicates whether the META key was pressed when the event fired.
* @see \`{@link https://api.jquery.com/event.metaKey/ }\`
*/
metaKey: boolean;
}
/**
* @deprecated Deprecated. Use \`{@link JQuery.Event }\`.
*/
interface JQueryInputEventObject extends BaseJQueryEventObject {
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
shiftKey: boolean;
}
/**
* @deprecated Deprecated. Use \`{@link JQuery.Event }\`.
*/
interface JQueryMouseEventObject extends JQueryInputEventObject {
button: number;
clientX: number;
clientY: number;
offsetX: number;
offsetY: number;
pageX: number;
pageY: number;
screenX: number;
screenY: number;
}
/**
* @deprecated Deprecated. Use \`{@link JQuery.Event }\`.
*/
interface JQueryKeyEventObject extends JQueryInputEventObject {
/** @deprecated */
char: string;
/** @deprecated */
charCode: number;
key: string;
/** @deprecated */
keyCode: number;
}
/**
* @deprecated Deprecated. Use \`{@link JQuery.Event }\`.
*/
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { }
/**
* @deprecated Deprecated.
*/
interface JQueryPromiseOperator<T, U> {
// tslint:disable-next-line:callable-types
(callback1: JQuery.TypeOrArray<JQueryPromiseCallback<T>>,
...callbacksN: Array<JQuery.TypeOrArray<JQueryPromiseCallback<any>>>): JQueryPromise<U>;
}
/**
* @deprecated Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`.
*/
interface JQueryEasingFunction {
// tslint:disable-next-line:callable-types
(percent: number): number;
}
/**
* @deprecated Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`.
*/
interface JQueryEasingFunctions {
[name: string]: JQueryEasingFunction;
linear: JQueryEasingFunction;
swing: JQueryEasingFunction;
}

6661
Server/wwwroot/lib/@types/jquery/misc.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,140 @@
{
"_from": "@types/jquery@^3.3.31",
"_id": "@types/jquery@3.3.31",
"_inBundle": false,
"_integrity": "sha512-Lz4BAJihoFw5nRzKvg4nawXPzutkv7wmfQ5121avptaSIXlDNJCUuxZxX/G+9EVidZGuO0UBlk+YjKbwRKJigg==",
"_location": "/@types/jquery",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/jquery@^3.3.31",
"name": "@types/jquery",
"escapedName": "@types%2fjquery",
"scope": "@types",
"rawSpec": "^3.3.31",
"saveSpec": null,
"fetchSpec": "^3.3.31"
},
"_requiredBy": [
"#DEV:/",
"/@types/bootstrap"
],
"_resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.31.tgz",
"_shasum": "27c706e4bf488474e1cb54a71d8303f37c93451b",
"_spec": "@types/jquery@^3.3.31",
"_where": "D:\\source\\repos\\Remotely\\Server",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Leonard Thieu",
"url": "https://github.com/leonard-thieu"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov"
},
{
"name": "Christian Hoffmeister",
"url": "https://github.com/choffmeister"
},
{
"name": "Steve Fenton",
"url": "https://github.com/Steve-Fenton"
},
{
"name": "Diullei Gomes",
"url": "https://github.com/Diullei"
},
{
"name": "Tass Iliopoulos",
"url": "https://github.com/tasoili"
},
{
"name": "Jason Swearingen",
"url": "https://github.com/jasons-novaleaf"
},
{
"name": "Sean Hill",
"url": "https://github.com/seanski"
},
{
"name": "Guus Goossens",
"url": "https://github.com/Guuz"
},
{
"name": "Kelly Summerlin",
"url": "https://github.com/ksummerlin"
},
{
"name": "Basarat Ali Syed",
"url": "https://github.com/basarat"
},
{
"name": "Nicholas Wolverson",
"url": "https://github.com/nwolverson"
},
{
"name": "Derek Cicerone",
"url": "https://github.com/derekcicerone"
},
{
"name": "Andrew Gaspar",
"url": "https://github.com/AndrewGaspar"
},
{
"name": "Seikichi Kondo",
"url": "https://github.com/seikichi"
},
{
"name": "Benjamin Jackman",
"url": "https://github.com/benjaminjackman"
},
{
"name": "Poul Sorensen",
"url": "https://github.com/s093294"
},
{
"name": "Josh Strobl",
"url": "https://github.com/JoshStrobl"
},
{
"name": "John Reilly",
"url": "https://github.com/johnnyreilly"
},
{
"name": "Dick van den Brink",
"url": "https://github.com/DickvdBrink"
},
{
"name": "Thomas Schulz",
"url": "https://github.com/King2500"
},
{
"name": "Terry Mun",
"url": "https://github.com/terrymun"
}
],
"dependencies": {
"@types/sizzle": "*"
},
"deprecated": false,
"description": "TypeScript definitions for jquery",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/jquery",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/jquery"
},
"scripts": {},
"typeScriptVersion": "2.3",
"types": "index",
"typesPublisherContentHash": "6f3ac74aa9f284b3450b4dcbcabc842bfc2a70fa2d92e745851044d2bb78e94b",
"version": "3.3.31"
}

View File

@ -0,0 +1,179 @@
/**
* @fileoverview This file only declares the public portions of the API.
* It should not define internal pieces such as utils or modifier details.
*
* Original definitions by: edcarroll <https://github.com/edcarroll>, ggray <https://github.com/giladgray>, rhysd <https://rhysd.github.io>, joscha <https://github.com/joscha>, seckardt <https://github.com/seckardt>, marcfallows <https://github.com/marcfallows>
*/
/**
* This kind of namespace declaration is not necessary, but is kept here for backwards-compatibility with
* popper.js 1.x. It can be removed in 2.x so that the default export is simply the Popper class
* and all the types / interfaces are top-level named exports.
*/
declare namespace Popper {
export type Position = 'top' | 'right' | 'bottom' | 'left';
export type Placement = 'auto-start'
| 'auto'
| 'auto-end'
| 'top-start'
| 'top'
| 'top-end'
| 'right-start'
| 'right'
| 'right-end'
| 'bottom-end'
| 'bottom'
| 'bottom-start'
| 'left-end'
| 'left'
| 'left-start';
export type Boundary = 'scrollParent' | 'viewport' | 'window';
export type Behavior = 'flip' | 'clockwise' | 'counterclockwise';
export type ModifierFn = (data: Data, options: Object) => Data;
export interface Attributes {
'x-out-of-boundaries': '' | false;
'x-placement': Placement;
}
export interface Padding {
top?: number,
bottom?: number,
left?: number,
right?: number,
}
export interface BaseModifier {
order?: number;
enabled?: boolean;
fn?: ModifierFn;
}
export interface Modifiers {
shift?: BaseModifier;
offset?: BaseModifier & {
offset?: number | string,
};
preventOverflow?: BaseModifier & {
priority?: Position[],
padding?: number | Padding,
boundariesElement?: Boundary | Element,
escapeWithReference?: boolean
};
keepTogether?: BaseModifier;
arrow?: BaseModifier & {
element?: string | Element,
};
flip?: BaseModifier & {
behavior?: Behavior | Position[],
padding?: number | Padding,
boundariesElement?: Boundary | Element,
flipVariations?: boolean,
flipVariationsByContent?: boolean,
};
inner?: BaseModifier;
hide?: BaseModifier;
applyStyle?: BaseModifier & {
onLoad?: Function,
gpuAcceleration?: boolean,
};
computeStyle?: BaseModifier & {
gpuAcceleration?: boolean;
x?: 'bottom' | 'top',
y?: 'left' | 'right'
};
[name: string]: (BaseModifier & Record<string, any>) | undefined;
}
export interface Offset {
top: number;
left: number;
width: number;
height: number;
}
export interface Data {
instance: Popper;
placement: Placement;
originalPlacement: Placement;
flipped: boolean;
hide: boolean;
arrowElement: Element;
styles: CSSStyleDeclaration;
arrowStyles: CSSStyleDeclaration;
attributes: Attributes;
boundaries: Object;
offsets: {
popper: Offset,
reference: Offset,
arrow: {
top: number,
left: number,
},
};
}
export interface PopperOptions {
placement?: Placement;
positionFixed?: boolean;
eventsEnabled?: boolean;
modifiers?: Modifiers;
removeOnDestroy?: boolean;
onCreate?(data: Data): void;
onUpdate?(data: Data): void;
}
export interface ReferenceObject {
clientHeight: number;
clientWidth: number;
referenceNode?: Node;
getBoundingClientRect(): ClientRect;
}
}
// Re-export types in the Popper namespace so that they can be accessed as top-level named exports.
// These re-exports should be removed in 2.x when the "declare namespace Popper" syntax is removed.
export type Padding = Popper.Padding;
export type Position = Popper.Position;
export type Placement = Popper.Placement;
export type Boundary = Popper.Boundary;
export type Behavior = Popper.Behavior;
export type ModifierFn = Popper.ModifierFn;
export type BaseModifier = Popper.BaseModifier;
export type Modifiers = Popper.Modifiers;
export type Offset = Popper.Offset;
export type Data = Popper.Data;
export type PopperOptions = Popper.PopperOptions;
export type ReferenceObject = Popper.ReferenceObject;
declare class Popper {
static modifiers: (BaseModifier & { name: string })[];
static placements: Placement[];
static Defaults: PopperOptions;
options: PopperOptions;
popper: Element;
reference: Element | ReferenceObject;
constructor(reference: Element | ReferenceObject, popper: Element, options?: PopperOptions);
destroy(): void;
update(): void;
scheduleUpdate(): void;
enableEventListeners(): void;
disableEventListeners(): void;
}
export default Popper;

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/sizzle`
# Summary
This package contains type definitions for sizzle (https://sizzlejs.com).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sizzle
Additional Details
* Last updated: Sat, 06 Oct 2018 20:51:02 GMT
* Dependencies: none
* Global values: Sizzle
# Credits
These definitions were written by Leonard Thieu <https://github.com/leonard-thieu>.

View File

@ -0,0 +1,92 @@
// Type definitions for sizzle 2.3
// Project: https://sizzlejs.com
// Definitions by: Leonard Thieu <https://github.com/leonard-thieu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export as namespace Sizzle;
declare const Sizzle: SizzleStatic;
export = Sizzle;
interface SizzleStatic {
selectors: Sizzle.Selectors;
<TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
(selector: string, context?: Element | Document | DocumentFragment): Element[];
// tslint:disable-next-line:ban-types
compile(selector: string): Function;
matchSelector(element: Element, selector: string): boolean;
matches(selector: string, elements: Element[]): Element[];
}
declare namespace Sizzle {
interface Selectors {
cacheLength: number;
match: Selectors.Matches;
find: Selectors.FindFunctions;
preFilter: Selectors.PreFilterFunctions;
filter: Selectors.FilterFunctions;
attrHandle: Selectors.AttrHandleFunctions;
pseudos: Selectors.PseudoFunctions;
setFilters: Selectors.SetFilterFunctions;
createPseudo(fn: Selectors.CreatePseudoFunction): Selectors.PseudoFunction;
}
namespace Selectors {
interface Matches {
[name: string]: RegExp;
}
interface FindFunction {
(match: RegExpMatchArray, context: Element | Document, isXML: boolean): Element[] | void;
}
interface FindFunctions {
[name: string]: FindFunction;
}
interface PreFilterFunction {
(match: RegExpMatchArray): string[];
}
interface PreFilterFunctions {
[name: string]: PreFilterFunction;
}
interface FilterFunction {
(element: string, ...matches: string[]): boolean;
}
interface FilterFunctions {
[name: string]: FilterFunction;
}
interface AttrHandleFunction {
(elem: any, casePreservedName: string, isXML: boolean): string;
}
interface AttrHandleFunctions {
[name: string]: AttrHandleFunction;
}
interface PseudoFunction {
(elem: Element): boolean;
}
interface PseudoFunctions {
[name: string]: PseudoFunction;
}
interface SetFilterFunction {
(elements: Element[], argument: number, not: boolean): Element[];
}
interface SetFilterFunctions {
[name: string]: SetFilterFunction;
}
interface CreatePseudoFunction {
(...args: any[]): PseudoFunction;
}
}
}

View File

@ -0,0 +1,51 @@
{
"_from": "@types/sizzle@*",
"_id": "@types/sizzle@2.3.2",
"_inBundle": false,
"_integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
"_location": "/@types/sizzle",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/sizzle@*",
"name": "@types/sizzle",
"escapedName": "@types%2fsizzle",
"scope": "@types",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/@types/jquery"
],
"_resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
"_shasum": "a811b8c18e2babab7d542b3365887ae2e4d9de47",
"_spec": "@types/sizzle@*",
"_where": "D:\\source\\repos\\Remotely\\Server\\node_modules\\@types\\jquery",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Leonard Thieu",
"url": "https://github.com/leonard-thieu"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for sizzle",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/sizzle",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"typeScriptVersion": "2.3",
"typesPublisherContentHash": "8d6f2e333bcb6c7fa99469e7e62dcef4c794dc432ce09634cae186cbcc333d0e",
"version": "2.3.2"
}

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

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,156 @@
// @flow
export type Position = 'top' | 'right' | 'bottom' | 'left';
export type Placement =
| 'auto-start'
| 'auto'
| 'auto-end'
| 'top-start'
| 'top'
| 'top-end'
| 'right-start'
| 'right'
| 'right-end'
| 'bottom-end'
| 'bottom'
| 'bottom-start'
| 'left-end'
| 'left'
| 'left-start';
export type Offset = {
top: number,
left: number,
width: number,
height: number,
position: Position,
};
export type Boundary = 'scrollParent' | 'viewport' | 'window';
export type Behavior = 'flip' | 'clockwise' | 'counterclockwise';
export type Data = {
instance: Popper,
placement: Placement,
originalPlacement: Placement,
flipped: boolean,
hide: boolean,
arrowElement: Element,
styles: CSSStyleDeclaration,
arrowStyles: CSSStyleDeclaration,
boundaries: Object,
offsets: {
popper: Offset,
reference: Offset,
arrow: {
top: number,
left: number,
},
},
};
export type ModifierFn = (data: Data, options: Object) => Data;
export type Padding = {
top?: number,
bottom?: number,
left?: number,
right?: number,
};
export type BaseModifier = {
order?: number,
enabled?: boolean,
fn?: ModifierFn,
};
export type Modifiers = {
shift?: BaseModifier,
offset?: BaseModifier & {
offset?: number | string,
},
preventOverflow?: BaseModifier & {
priority?: Position[],
padding?: number | Padding,
boundariesElement?: Boundary | Element,
escapeWithReference?: boolean,
},
keepTogether?: BaseModifier,
arrow?: BaseModifier & {
element?: string | Element | null,
},
flip?: BaseModifier & {
behavior?: Behavior | Position[],
padding?: number | Padding,
boundariesElement?: Boundary | Element,
flipVariations?: boolean,
flipVariationsByContent?: boolean,
},
inner?: BaseModifier,
hide?: BaseModifier,
applyStyle?: BaseModifier & {
onLoad?: Function,
gpuAcceleration?: boolean,
},
computeStyle?: BaseModifier & {
gpuAcceleration?: boolean,
x?: 'bottom' | 'top',
y?: 'left' | 'right',
},
[name: string]: (BaseModifier & { [string]: * }) | null,
};
export type Options = {
placement?: Placement,
positionFixed?: boolean,
eventsEnabled?: boolean,
modifiers?: Modifiers,
removeOnDestroy?: boolean,
onCreate?: (data: Data) => void,
onUpdate?: (data: Data) => void,
};
export type ReferenceObject = {
+clientHeight: number,
+clientWidth: number,
+referenceNode?: Node,
getBoundingClientRect():
| ClientRect
| {
width: number,
height: number,
top: number,
right: number,
bottom: number,
left: number,
},
};
export type Instance = {
destroy: () => void,
scheduleUpdate: () => void,
update: () => void,
enableEventListeners: () => void,
disableEventListeners: () => void,
};
declare class Popper {
static placements: Placement;
popper: Element;
reference: Element | ReferenceObject;
constructor(
reference: Element | ReferenceObject,
popper: Element,
options?: Options
): Instance;
}
declare export default typeof Popper;

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 one or more lines are too long

View File

@ -13,6 +13,7 @@ export function AddOrUpdateDevices(devices: Array<Device>) {
AddOrUpdateDevice(x);
});
}
export function AddOrUpdateDevice(device: Device) {
var existingIndex = DataSource.findIndex(x => x.ID == device.ID);
if (existingIndex > -1) {

View File

@ -36,10 +36,4 @@ var remotely = {
}
export const Main = remotely;
window["Remotely"] = remotely;
window.onload = (ev) => {
remotely.Init();
document.querySelector(".loading-frame").remove();
document.querySelector(".work-area").classList.remove("hidden");
}
window["Remotely"] = remotely;

View File

@ -1,16 +0,0 @@
import { RCBrowserSockets } from "./RCBrowserSockets.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
export class Conductor {
constructor(rcBrowserSockets: RCBrowserSockets, clientID: string, serviceID: string, requesterName:string) {
this.RCBrowserSockets = rcBrowserSockets;
this.ClientID = clientID;
this.ServiceID = serviceID;
this.RequesterName = requesterName;
}
RCBrowserSockets: RCBrowserSockets;
ClientID: string = "";
ServiceID : string = "";
Mode: RemoteControlMode;
RequesterName: string = "";
}

View File

@ -2,39 +2,43 @@
import { RCBrowserSockets } from "./RCBrowserSockets.js";
import * as UI from "./UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
import { Conductor } from "./Conductor.js";
var queryString = Utilities.ParseSearchString();
var rcBrowserSockets = new RCBrowserSockets();
export const RemoteControl = new Conductor(rcBrowserSockets,
queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "",
queryString["serviceID"] ? decodeURIComponent(queryString["serviceID"]) : "",
queryString["requesterName"] ? decodeURIComponent(queryString["requesterName"]) : "");
export const RemoteControl = {
export function ConnectToClient() {
UI.ConnectButton.disabled = true;
RemoteControl.ClientID = UI.SessionIDInput.value.split(" ").join("");
RemoteControl.RequesterName = UI.RequesterNameInput.value;
RemoteControl.Mode = RemoteControlMode.Normal;
RemoteControl.RCBrowserSockets.Connect();
UI.StatusMessage.innerHTML = "Sending connection request...";
RCBrowserSockets: new RCBrowserSockets(),
ClientID: queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "",
ServiceID: queryString["serviceID"] ? decodeURIComponent(queryString["serviceID"]) : "",
RequesterName: queryString["requesterName"] ? decodeURIComponent(queryString["requesterName"]) : "",
Mode: RemoteControlMode.None,
Init: () => {
UI.ApplyInputHandlers(rcBrowserSockets);
if (queryString["clientID"]) {
RemoteControl.Mode = RemoteControlMode.Unattended;
UI.ConnectBox.style.display = "none";
RemoteControl.RCBrowserSockets.Connect();
}
else if (queryString["sessionID"]) {
UI.SessionIDInput.value = decodeURIComponent(queryString["sessionID"]);
if (queryString["requesterName"]) {
UI.RequesterNameInput.value = decodeURIComponent(queryString["requesterName"]);
this.ConnectToClient();
}
}
},
ConnectToClient: () => {
UI.ConnectButton.disabled = true;
RemoteControl.ClientID = UI.SessionIDInput.value.split(" ").join("");
RemoteControl.RequesterName = UI.RequesterNameInput.value;
RemoteControl.Mode = RemoteControlMode.Normal;
RemoteControl.RCBrowserSockets.Connect();
UI.StatusMessage.innerHTML = "Sending connection request...";
}
}
window.onload = () => {
UI.ApplyInputHandlers(rcBrowserSockets);
if (queryString["clientID"]) {
RemoteControl.Mode = RemoteControlMode.Unattended;
UI.ConnectBox.style.display = "none";
RemoteControl.RCBrowserSockets.Connect();
}
else if (queryString["sessionID"]) {
UI.SessionIDInput.value = decodeURIComponent(queryString["sessionID"]);
if (queryString["requesterName"]) {
UI.RequesterNameInput.value = decodeURIComponent(queryString["requesterName"]);
ConnectToClient();
}
}
}
window["RemoteControl"] = RemoteControl;

View File

@ -7,7 +7,12 @@ import { Sound } from "../Sound.js";
var signalR = window["signalR"];
export class RCBrowserSockets {
Connection: any;
Connection = {
start: async () => { },
closedCallbacks: [],
invoke: (...rest) => { },
stop: () => { }
};
Connect() {
this.Connection = new signalR.HubConnectionBuilder()

View File

@ -1,6 +1,6 @@
import { RCBrowserSockets } from "./RCBrowserSockets.js";
import { GetDistanceBetween } from "../Utilities.js";
import { ConnectToClient, RemoteControl } from "./Main.js";
import { RemoteControl } from "./Main.js";
import { PopupMessage } from "../UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
import { Point } from "../Models/Point.js";
@ -73,7 +73,7 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
PopupMessage("Clipboard sent!");
});
ConnectButton.addEventListener("click", (ev) => {
ConnectToClient();
RemoteControl.ConnectToClient();
});
CtrlAltDelButton.addEventListener("click", (ev) => {
if (!RemoteControl.ServiceID) {
@ -90,7 +90,7 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
x.addEventListener("keypress", (ev: KeyboardEvent) => {
if (ev.key.toLowerCase() == "enter") {
ConnectToClient();
RemoteControl.ConnectToClient();
}
})
});

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.Json.Serialization;
namespace Remotely.Shared.Models
{
@ -12,6 +13,7 @@ namespace Remotely.Shared.Models
public string InvitedUser { get; set; }
public bool IsAdmin { get; set; }
public DateTime DateSent { get; set; }
[JsonIgnore]
public virtual Organization Organization { get; set; }
public string ResetUrl { get; set; }
}