diff --git a/docker/Dockerfile b/docker/Dockerfile index 9d8dd4f..85118d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,6 +38,12 @@ COPY elemento-gui-new/ /usr/share/nginx/html/ COPY elemento-gui-new/electros/configs/atomosFlags.json /usr/share/nginx/html/electros/configs/flags.json COPY elemento-gui-new/electros/electrosOnAtomos.html /usr/share/nginx/html/electros/electros.html COPY docker/startup.sh /opt/app/startup.sh +COPY ./docker/follow_log.sh /opt/app/follow_log.sh +COPY ./docker/logger_stream.sh /opt/app/logger_stream.sh + +RUN apt update +RUN apt install -y socat +RUN rm -rf /var/cache/apt/archives /var/lib/apt/lists/* RUN chmod +x /opt/daemons/* RUN chmod +x /opt/app/startup.sh diff --git a/docker/arm_Dockerfile b/docker/arm_Dockerfile index b58cb98..fe66938 100644 --- a/docker/arm_Dockerfile +++ b/docker/arm_Dockerfile @@ -37,7 +37,14 @@ COPY ./docker/nginx.conf /etc/nginx/nginx.conf COPY electros-daemons/linux/arm64/* /opt/daemons/ COPY elemento-gui-new/ /usr/share/nginx/html/ COPY elemento-gui-new/electros/configs/atomosFlags.json /usr/share/nginx/html/electros/configs/flags.json +COPY elemento-gui-new/electros/electrosOnAtomos.html /usr/share/nginx/html/electros/electros.html COPY ./docker/arm_startup.sh /opt/app/startup.sh +COPY ./docker/follow_log.sh /opt/app/follow_log.sh +COPY ./docker/logger_stream.sh /opt/app/logger_stream.sh + +RUN apt update +RUN apt install -y socat +RUN rm -rf /var/cache/apt/archives /var/lib/apt/lists/* RUN chmod +x /opt/daemons/* RUN chmod +x /opt/app/startup.sh diff --git a/docker/arm_startup.sh b/docker/arm_startup.sh index 03570a2..a127df4 100644 --- a/docker/arm_startup.sh +++ b/docker/arm_startup.sh @@ -30,7 +30,8 @@ # start background daemons #/opt/daemons/Elemento_Daemons_linux_x86 > /var/log/elemento/elemento_daemons.log 2>&1 & -/opt/daemons/Elemento_Daemons_linux_arm >/var/log/elemento/elemento_daemons.log 2>&1 & +/opt/daemons/elemento_daemons_linux_arm >/var/log/elemento/elemento_daemons.log 2>&1 & +/opt/app/logger_stream.sh >/dev/null & # run the project diff --git a/docker/follow_log.sh b/docker/follow_log.sh new file mode 100755 index 0000000..2072706 --- /dev/null +++ b/docker/follow_log.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +LOG_FILE=/var/log/elemento/elemento_daemons.log + +trap '' PIPE + +# Read and discard HTTP request headers +while IFS= read -r line; do + [ "$line" = $'\r' ] && break +done + +# Send HTTP headers +printf "HTTP/1.1 200 OK\r\n" +printf "Content-Type: text/plain\r\n" +printf "Transfer-Encoding: chunked\r\n" +printf "Cache-Control: no-cache\r\n" +printf "Connection: keep-alive\r\n" +printf "\r\n" + +# Send last 1000 lines +tail -n 1000 "$LOG_FILE" | while IFS= read line; do + chunk="${line}\n" + len=$(printf "%s" "$chunk" | wc -c) + printf "%x\r\n%s\r\n" "$len" "$chunk" || break +done + +# Follow file +# shellcheck disable=SC2162 +tail -n 0 -F "$LOG_FILE" | while IFS= read line; do + chunk="${line}\n" + len=$(printf "%s" "$chunk" | wc -c) + printf "%x\r\n%s\r\n" "$len" "$chunk" || break +done + + diff --git a/docker/logger_stream.sh b/docker/logger_stream.sh new file mode 100755 index 0000000..2ff3e4f --- /dev/null +++ b/docker/logger_stream.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +PORT=5142 + +socat TCP-LISTEN:"$PORT",reuseaddr,fork SYSTEM:'bash -c /opt/app/follow_log.sh' diff --git a/docker/nginx.conf b/docker/nginx.conf index 6b8e5e5..dde8139 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -99,60 +99,118 @@ http { # Daemon statuses handlers location /authStatus { proxy_pass $authenticate/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /computeStatus { proxy_pass $compute/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /storageStatus { proxy_pass $storage/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /networksStatus { proxy_pass $network/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /servicesStatus { proxy_pass $services/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /targetsStatus { proxy_pass $targets/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } # Daemon handlers location /api/v1/authenticate/ { proxy_pass $authenticate; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/client/backups/ { proxy_pass $compute; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/client/vm/ { proxy_pass $compute; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } # special case for network attach/detach for a VM location ~ ^/api/v1.0/client/network/(attach|detach) { proxy_pass $compute; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/client/volume/ { proxy_pass $storage; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/client/network/ { proxy_pass $network; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/service/ { proxy_pass $services; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; } location /api/v1.0/client/target/ { proxy_pass $targets; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + } + + # WebSocket passthrough + location ~ ^/api/v1.0/client/vnc/(.*)$ { + proxy_pass http://127.0.0.1:$1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + } + + location /api/logs { + proxy_pass http://localhost:5142; + proxy_buffering off; + proxy_cache off; } } } diff --git a/docker/startup.sh b/docker/startup.sh index 02581b5..9a4ec08 100644 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -28,6 +28,7 @@ # start background daemons /opt/daemons/elemento_daemons_linux_x86 >/var/log/elemento/elemento_daemons.log 2>&1 & +/opt/app/logger_stream.sh >/dev/null & # run the project diff --git a/electros-eel/.gitignore b/electros-eel/.gitignore deleted file mode 100644 index 8fa5b33..0000000 --- a/electros-eel/.gitignore +++ /dev/null @@ -1 +0,0 @@ -env \ No newline at end of file diff --git a/electros-eel/electros.py b/electros-eel/electros.py deleted file mode 100644 index a308806..0000000 --- a/electros-eel/electros.py +++ /dev/null @@ -1,95 +0,0 @@ -import eel -import requests -import os -import json - -# Set web files folder -eel.init('electros') - -def read_configurations(): - config_path = os.path.join(os.path.expanduser('~'), '.elemento', 'settings') - hosts_path = os.path.join(os.path.expanduser('~'), '.elemento', 'hosts') - - config = {} - hosts = [] - - # Read settings - if os.path.exists(config_path): - try: - with open(config_path, 'r') as f: - config = json.load(f) - except json.JSONDecodeError: - print(f"Error: Invalid JSON in {config_path}") - except IOError: - print(f"Error: Unable to read {config_path}") - - # Read hosts - if os.path.exists(hosts_path): - try: - with open(hosts_path, 'r') as f: - hosts = f.read().splitlines() - except IOError: - print(f"Error: Unable to read {hosts_path}") - - return config, hosts - -@eel.expose -def get_configurations(): - config, hosts = read_configurations() - return {'config': config, 'hosts': hosts} - -@eel.expose -def modify_configurations(new_config, new_hosts): - - print('New Config:', new_config) - print('New Hosts:', new_hosts) - - config_path = os.path.join(os.path.expanduser('~'), '.elemento', 'settings') - hosts_path = os.path.join(os.path.expanduser('~'), '.elemento', 'hosts') - - # Update and save settings - try: - with open(config_path, 'w') as f: - json.dump(new_config, f, indent=4) - except IOError: - print(f"Error: Unable to write to {config_path}") - return False - - # Update and save hosts - try: - with open(hosts_path, 'w') as f: - f.write('\n'.join(new_hosts)) - except IOError: - print(f"Error: Unable to write to {hosts_path}") - return False - - return True - -@eel.expose -def update_configurations(config_updates, hosts_updates): - current_config, current_hosts = read_configurations() - - # Update config - current_config.update(config_updates) - - # Update hosts - current_hosts = list(set(current_hosts + hosts_updates)) - - print('Current Config:', current_config) - print('Current Hosts:', current_hosts) - - # Save the updated configurations - return modify_configurations(current_config, current_hosts) - -# Start the app with custom mode and flags -eel.start( - 'electros.html', - size=(800, 600), - mode='kiosk', # or 'chrome-app' if you prefer - port=8888, # Use any available port - cmdline_args=[ - '--disable-gpu', - '--disable-dev-shm-usage', - '--disable-frame-rate-limit' - ] -) \ No newline at end of file diff --git a/electros-eel/index.html b/electros-eel/index.html deleted file mode 100644 index a00daaa..0000000 --- a/electros-eel/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Redirecting... - - -

If you are not redirected automatically, click here.

- - diff --git a/electros-eel/requirements.txt b/electros-eel/requirements.txt deleted file mode 100644 index 9a38173..0000000 --- a/electros-eel/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -eel -requests diff --git a/electros-eel/setup.sh b/electros-eel/setup.sh deleted file mode 100755 index 11b3fba..0000000 --- a/electros-eel/setup.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -# Create and activate virtual environment -python3 -m venv env -source env/bin/activate - -# Install requirements -pip install --upgrade pip -pip install -r requirements.txt -deactivate diff --git a/electros-eel/start.sh b/electros-eel/start.sh deleted file mode 100755 index c6b0450..0000000 --- a/electros-eel/start.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/bash - -# Activate virtual environment -source env/bin/activate - -# Run the project -python3 electros.py - -deactivate diff --git a/electros-electron/common/Daemons.js b/electros-electron/common/Daemons.js index 75de9ae..92ec4b8 100644 --- a/electros-electron/common/Daemons.js +++ b/electros-electron/common/Daemons.js @@ -22,13 +22,13 @@ export class Daemons { static Launch(platform, __dirname) { if (app.commandLine.hasSwitch("no-daemons")) { console.log("Daemons have been disabled by `--no-daemons`"); - Terminal.Write("Elemento Client Daemons have been disabled by `--no-daemons`."); + Terminal.Write("[INFO] Elemento Client Daemons have been disabled by `--no-daemons`."); throw new DaemonsNotEnabledError(); } if (!app.isPackaged) { - Terminal.Write("Electros is not packaged. Daemons might have to be manually started.") - console.log("Electros is not packaged. Daemons might have to be manually started.") + Terminal.Write("[WARNING] Electros is not packaged. Daemons might have to be manually started.") + console.warn("Electros is not packaged. Daemons might have to be manually started.") } const execPath = Daemons._GetCommand(platform, __dirname); diff --git a/electros-electron/main.js b/electros-electron/main.js index e1e531a..2978b9f 100644 --- a/electros-electron/main.js +++ b/electros-electron/main.js @@ -1,6 +1,6 @@ const {app, BrowserWindow, ipcMain, Menu, nativeTheme, shell, safeStorage} = require('electron'); -app.commandLine.appendSwitch('disable-zoom-level-persistence'); +app.commandLine.appendSwitch('force-device-scale-factor', '1'); const path = require('path'); const {spawn} = require('child_process'); const net = require('net'); @@ -447,3 +447,10 @@ ipcMain.handle("safestorage-decrypt", async (event, { value }) => { return safeStorage.decryptString(value) }); + +ipcMain.handle("app-version", () => { + return { + version: app.getVersion(), + node: process.versions + }; +}); diff --git a/electros-electron/package.json b/electros-electron/package.json index c4c7a61..233017e 100644 --- a/electros-electron/package.json +++ b/electros-electron/package.json @@ -133,7 +133,8 @@ }, "dependencies": { "@xterm/addon-fit": "latest", - "@xterm/xterm": "^5.5.0", + "@xterm/addon-webgl": "^0.19.0", + "@xterm/xterm": "^6.0.0", "cors": "^2.8.5", "express": "^4.21.2", "socket.io": "^4.8.1", diff --git a/electros-electron/preload.js b/electros-electron/preload.js index 658beab..a4cc989 100644 --- a/electros-electron/preload.js +++ b/electros-electron/preload.js @@ -19,7 +19,10 @@ contextBridge.exposeInMainWorld('electron', { 'os-prefers-dark-theme', 'os-prefers-reduced-transparency', 'open-browser', - 'open-dot-config' + 'open-dot-config', + 'app-version', + 'safestorage-encrypt', + 'safestorage-decrypt' ]; if (validChannels.includes(channel)) { return ipcRenderer.invoke(channel, ...args); diff --git a/electros-electron/terminal/terminal.html b/electros-electron/terminal/terminal.html index cc6d71d..91d7998 100644 --- a/electros-electron/terminal/terminal.html +++ b/electros-electron/terminal/terminal.html @@ -2,21 +2,37 @@ - - - - -
- -

Ultralight v1.3.0 Release Notes

- -

Changelog

-

Major Improvements

- -

Major API Changes

- -

Major Bugfixes

- - - - - -

Useful Links

-
-
Website
-
ultralig.ht
-
Support Docs
-
docs.ultralig.ht
-
C++ API
-
github.com/ultralight-ux/Ultralight-API
-
- -
- -

- Ultralight Team

-
- - - \ No newline at end of file diff --git a/electros-ultralight/archive/browser/assets/requirements.txt b/electros-ultralight/archive/browser/assets/requirements.txt deleted file mode 100644 index 9a38173..0000000 --- a/electros-ultralight/archive/browser/assets/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -eel -requests diff --git a/electros-ultralight/archive/browser/assets/spinner.svg b/electros-ultralight/archive/browser/assets/spinner.svg deleted file mode 100644 index 466ff9c..0000000 --- a/electros-ultralight/archive/browser/assets/spinner.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/electros-ultralight/archive/browser/assets/ui.css b/electros-ultralight/archive/browser/assets/ui.css deleted file mode 100644 index cb85cff..0000000 --- a/electros-ultralight/archive/browser/assets/ui.css +++ /dev/null @@ -1,73 +0,0 @@ -* { - overflow: hidden; - user-select: none; - -webkit-user-select: none; -} - -body { - margin: 0; - padding: 0; - font-family: "Segoe UI", -apple-system, Ubuntu, Arial, sans-serif; - font-size: 14px; - background: #16151d; - color: #c4c2d0; -} - -#bar { - background: #232330; - background: linear-gradient(0deg, #232330, #282836); - height: 32px; - padding: 4px 9px; - border-bottom: 0.8px solid #252532; - cursor: default; - display: flex; -} - -#address { - border-radius: 24px; - border: none; - height: 32px; - flex: 1; - font-size: 14px; - color: #c4c2d0; - background-color: #16151d; - display: inline-block; - padding: 2px 16px 2px 16px; - margin-top: 0px; - margin-left: 9px; - margin-right: 9px; - user-select: auto !important; - -webkit-user-select: text !important; -} - -#address:focus { - background-color: #16151d; - color: #FFF; -} - -.icon { - cursor: default; - fill: rgba(200, 200, 200, 1.0); - vertical-align: top; - margin-top: -1px; - padding: 5px; - height: 22px; -} - -#back { - margin-left: 0px; -} - -.icon.disabled { - - fill: rgb(99 96 116); -} - -svg#icon_defs path { - fill: inherit; -} - -.icon:not(.disabled):hover { - background-color: #343446; - border-radius: 100%; -} \ No newline at end of file diff --git a/electros-ultralight/archive/browser/assets/ui.html b/electros-ultralight/archive/browser/assets/ui.html deleted file mode 100644 index 6cf0f60..0000000 --- a/electros-ultralight/archive/browser/assets/ui.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - \ No newline at end of file diff --git a/electros-ultralight/archive/browser/assets/ui.js b/electros-ultralight/archive/browser/assets/ui.js deleted file mode 100644 index fa77f8e..0000000 --- a/electros-ultralight/archive/browser/assets/ui.js +++ /dev/null @@ -1,27 +0,0 @@ -function updateBack(enable) { - if (enable) - document.getElementById("back").classList.remove("disabled"); - else - document.getElementById("back").classList.add("disabled"); -} - -function updateForward(enable) { - if (enable) - document.getElementById("forward").classList.remove("disabled"); - else - document.getElementById("forward").classList.add("disabled"); -} - -function updateLoading(is_loading) { - if (is_loading) { - document.getElementById("refresh").style.display = "none"; - document.getElementById("stop").style.display = "inline-block"; - } else { - document.getElementById("refresh").style.display = "inline-block"; - document.getElementById("stop").style.display = "none"; - } -} - -function updateURL(url) { - document.getElementById('address').value = url; -} \ No newline at end of file diff --git a/electros-ultralight/archive/browser/cmake/Electros.cmake b/electros-ultralight/archive/browser/cmake/Electros.cmake deleted file mode 100644 index 2bf6dbb..0000000 --- a/electros-ultralight/archive/browser/cmake/Electros.cmake +++ /dev/null @@ -1,122 +0,0 @@ -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) - -set(SDK_ROOT "${CMAKE_BINARY_DIR}/SDK/") -set(ULTRALIGHT_INCLUDE_DIR "${SDK_ROOT}/include") -set(ULTRALIGHT_BINARY_DIR "${SDK_ROOT}/bin") -set(ULTRALIGHT_RESOURCES_DIR "${SDK_ROOT}/resources") -set(ULTRALIGHT_INSPECTOR_DIR "${SDK_ROOT}/inspector") - -if (NOT PLATFORM) - if (UNIX) - if (APPLE) - set(PORT UltralightMac) - set(PLATFORM "mac") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - else () - set(PORT UltralightLinux) - set(PLATFORM "linux") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - endif () - elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") - set(PORT UltralightWin) - set(PLATFORM "win") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/lib") - else () - message(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'") - endif () -else () - if (PLATFORM MATCHES "mac") - set(PORT UltralightMac) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - elseif (PLATFORM MATCHES "linux") - set(PORT UltralightLinux) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - elseif (PLATFORM MATCHES "win") - set(PORT UltralightWin) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/lib") - else () - message(FATAL_ERROR "Unknown platform '${PLATFORM}'") - endif () -endif () - -if (NOT ARCHITECTURE) - set(ARCHITECTURE "arm64") -endif() - -if(NOT VERSION) - set(VERSION "1.4.0b") -endif() - -if(NOT BASE_URL) - set(BASE_URL "ultralight-files.sfo3.cdn.digitaloceanspaces.com") -endif() - -ExternalProject_Add(UltralightSDK - URL https://${BASE_URL}/ultralight-sdk-${VERSION}-${PLATFORM}-${ARCHITECTURE}.7z - SOURCE_DIR "${SDK_ROOT}" - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) - -MACRO(ADD_APP source_list) - set(APP_NAME ${CMAKE_PROJECT_NAME}) - - include_directories("${ULTRALIGHT_INCLUDE_DIR}") - link_directories("${ULTRALIGHT_LIBRARY_DIR}") - link_libraries(UltralightCore AppCore Ultralight WebCore) - - if (PORT MATCHES "UltralightLinux") - SET(CMAKE_SKIP_BUILD_RPATH FALSE) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - SET(CMAKE_INSTALL_RPATH "$\{ORIGIN\}") - endif () - - if (PORT MATCHES "UltralightMac") - SET(CMAKE_SKIP_BUILD_RPATH FALSE) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - SET(CMAKE_INSTALL_RPATH "@executable_path/") - endif () - - add_executable(${APP_NAME} WIN32 MACOSX_BUNDLE ${source_list}) - - if (APPLE) - # Enable High-DPI on macOS through our custom Info.plist template - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Info.plist.in) - endif() - - if (MSVC) - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup") - endif() - - # Copy all binaries to target directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $) - - # Set the assets path to "/assets" or "/../Resources/assets" on macOS - if (APPLE) - set(ASSETS_PATH "$/../Resources/assets") - else () - set(ASSETS_PATH "$/assets") - endif () - - # Copy assets to assets path - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}") - - if(${ENABLE_INSPECTOR}) - # Copy inspector to assets directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_INSPECTOR_DIR}" "${ASSETS_PATH}/inspector") - endif () - - # Copy resources to assets directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources") - - add_dependencies(${APP_NAME} UltralightSDK) -ENDMACRO() \ No newline at end of file diff --git a/electros-ultralight/archive/browser/cmake/Info.plist.in b/electros-ultralight/archive/browser/cmake/Info.plist.in deleted file mode 100644 index b782d3b..0000000 --- a/electros-ultralight/archive/browser/cmake/Info.plist.in +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - true - - diff --git a/electros-ultralight/archive/browser/src/Browser.cpp b/electros-ultralight/archive/browser/src/Browser.cpp deleted file mode 100644 index bc7069c..0000000 --- a/electros-ultralight/archive/browser/src/Browser.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "Browser.h" -#include -#include -#include - -Browser::Browser() { - Settings settings; - Config config; - config.scroll_timer_delay = 1.0 / 90.0; - app_ = App::Create(settings, config); - - window_ = Window::Create(app_->main_monitor(), 1800, 1200, false, - kWindowFlags_Resizable | kWindowFlags_Titled | kWindowFlags_Maximizable); - window_->SetTitle("Elemento Electros"); - - // Create the UI - ui_.reset(new UI(window_)); - window_->set_listener(ui_.get()); -} - -Browser::~Browser() { - window_->set_listener(nullptr); - - ui_.reset(); - - window_ = nullptr; - app_ = nullptr; -} - -void Browser::Run() { - app_->Run(); -} diff --git a/electros-ultralight/archive/browser/src/Browser.h b/electros-ultralight/archive/browser/src/Browser.h deleted file mode 100644 index 8b23e14..0000000 --- a/electros-ultralight/archive/browser/src/Browser.h +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include "UI.h" - -using namespace ultralight; - -class Browser { -public: - Browser(); - virtual ~Browser(); - - virtual void Run(); - -protected: - RefPtr app_; - RefPtr window_; - std::unique_ptr ui_; -}; diff --git a/electros-ultralight/archive/browser/src/Tab.cpp b/electros-ultralight/archive/browser/src/Tab.cpp deleted file mode 100644 index 2a3c8f7..0000000 --- a/electros-ultralight/archive/browser/src/Tab.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "Tab.h" -#include "UI.h" -#include -#include - -#define INSPECTOR_DRAG_HANDLE_HEIGHT 10 - -Tab::Tab(UI* ui, uint64_t id, uint32_t width, uint32_t height, int x, int y) - : ui_(ui), id_(id), container_width_(width), container_height_(height) { - overlay_ = Overlay::Create(ui->window_, width, height, x, y); - view()->set_view_listener(this); - view()->set_load_listener(this); -} - -Tab::~Tab() { - view()->set_view_listener(nullptr); - view()->set_load_listener(nullptr); -} - -void Tab::Show() { - overlay_->Show(); - overlay_->Focus(); - - if (inspector_overlay_) - inspector_overlay_->Show(); -} - -void Tab::Hide() { - overlay_->Hide(); - overlay_->Unfocus(); - - if (inspector_overlay_) - inspector_overlay_->Hide(); -} - -void Tab::ToggleInspector() { - if (!inspector_overlay_) { - view()->CreateLocalInspectorView(); - } else { - if (inspector_overlay_->is_hidden()) { - inspector_overlay_->Show(); - } else { - inspector_overlay_->Hide(); - } - } - - // Force resize to update layout -} - - -bool Tab::IsInspectorShowing() const { - if (!inspector_overlay_) - return false; - - return !inspector_overlay_->is_hidden(); -} - -IntRect Tab::GetInspectorResizeDragHandle() const { - if (!IsInspectorShowing()) - return IntRect::MakeEmpty(); - - int drag_handle_height_px = (uint32_t)std::round(INSPECTOR_DRAG_HANDLE_HEIGHT * ui_->window()->scale()); - - // This drag handle should span the width of the UI and be centered vertically at the boundary between - // the page overlay and inspector overlay. - - int drag_handle_x = (int)inspector_overlay_->x(); - int drag_handle_y = (int)inspector_overlay_->y() - drag_handle_height_px / 2; - - return { drag_handle_x, drag_handle_y, drag_handle_x + (int)inspector_overlay_->width(), - drag_handle_y + drag_handle_height_px }; -} - -int Tab::GetInspectorHeight() const { - if (inspector_overlay_) - return inspector_overlay_->height(); - - return 0; -} - -void Tab::SetInspectorHeight(int height) { - if (height > 2) { - inspector_overlay_->Resize(inspector_overlay_->width(), height); - - // Trigger a resize to perform re-layout / re-size of content overlay - Resize(container_width_, container_height_); - } -} - -void Tab::Resize(uint32_t width, uint32_t height) { - container_width_ = width; - container_height_ = height; - - uint32_t content_height = container_height_; - if (inspector_overlay_ && !inspector_overlay_->is_hidden()) { - content_height -= inspector_overlay_->height(); - } - - if (content_height < 1) - content_height = 1; - - overlay_->Resize(container_width_, content_height); - - if (inspector_overlay_ && !inspector_overlay_->is_hidden()) { - inspector_overlay_->MoveTo(0, overlay_->y() + overlay_->height()); - inspector_overlay_->Resize(container_width_, inspector_overlay_->height()); - } -} - -void Tab::OnChangeTitle(View* caller, const String& title) { - ui_->UpdateTabTitle(id_, title); -} - -void Tab::OnChangeURL(View* caller, const String& url) { - ui_->UpdateTabURL(id_, url); -} - -void Tab::OnChangeTooltip(View* caller, const String& tooltip) {} - -void Tab::OnChangeCursor(View* caller, Cursor cursor) { - if (id_ == ui_->active_tab_id_) - ui_->SetCursor(cursor); -} - -void Tab::OnAddConsoleMessage(View* caller, const ConsoleMessage& msg) { -} - -RefPtr Tab::OnCreateChildView(ultralight::View* caller, - const String& opener_url, const String& target_url, - bool is_popup, const IntRect& popup_rect) { - return ui_->CreateNewTabForChildView(target_url); -} - -RefPtr Tab::OnCreateInspectorView(ultralight::View* caller, bool is_local, - const String& inspected_url) { - if (inspector_overlay_) - return nullptr; - - inspector_overlay_ = Overlay::Create(ui_->window_, container_width_, container_height_ / 2, 0, 0); - - // Force resize to update layout - Resize(container_width_, container_height_); - inspector_overlay_->Show(); - - return inspector_overlay_->view(); -} - -void Tab::OnBeginLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} - -void Tab::OnFinishLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} - -void Tab::OnFailLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url, - const String& description, const String& error_domain, int error_code) { - if (is_main_frame) { - char error_code_str[16]; - sprintf(error_code_str,"%d", error_code); - - String html_string = ""; - html_string += "

A Network Error was Encountered

"; - html_string += "
"; - html_string += "
URL
" + url + "
"; - html_string += "
Description
" + description + "
"; - html_string += "
Error Domain
" + error_domain + "
"; - html_string += "
Error Code
" + String(error_code_str) + "
"; - html_string += "
"; - - view()->LoadHTML(html_string); - } -} - -void Tab::OnUpdateHistory(View* caller) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} diff --git a/electros-ultralight/archive/browser/src/Tab.h b/electros-ultralight/archive/browser/src/Tab.h deleted file mode 100644 index 9e4b66c..0000000 --- a/electros-ultralight/archive/browser/src/Tab.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once -#include -#include - -class UI; -using namespace ultralight; - -/** -* Browser Tab UI implementation. Renders the actual page content in bottom pane. -*/ -class Tab : public ViewListener, - public LoadListener { -public: - Tab(UI* ui, uint64_t id, uint32_t width, uint32_t height, int x, int y); - ~Tab(); - - void set_ready_to_close(bool ready) { ready_to_close_ = ready; } - bool ready_to_close() { return ready_to_close_; } - - RefPtr view() { return overlay_->view(); } - - void Show(); - - void Hide(); - - void ToggleInspector(); - - bool IsInspectorShowing() const; - - IntRect GetInspectorResizeDragHandle() const; - - int GetInspectorHeight() const; - - void SetInspectorHeight(int height); - - void Resize(uint32_t width, uint32_t height); - - // Inherited from Listener::View - virtual void OnChangeTitle(View* caller, const String& title) override; - virtual void OnChangeURL(View* caller, const String& url) override; - virtual void OnChangeTooltip(View* caller, const String& tooltip) override; - virtual void OnChangeCursor(View* caller, Cursor cursor) override; - virtual void OnAddConsoleMessage(View* caller, const ConsoleMessage& msg) override; - virtual RefPtr OnCreateChildView(ultralight::View* caller, - const String& opener_url, const String& target_url, - bool is_popup, const IntRect& popup_rect) override; - virtual RefPtr OnCreateInspectorView(ultralight::View* caller, bool is_local, - const String& inspected_url) override; - - // Inherited from Listener::Load - virtual void OnBeginLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - virtual void OnFinishLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - virtual void OnFailLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url, const String& description, - const String& error_domain, int error_code) override; - virtual void OnUpdateHistory(View* caller) override; - -protected: - UI* ui_; - RefPtr overlay_; - RefPtr inspector_overlay_; - uint64_t id_; - bool ready_to_close_ = false; - uint32_t container_width_, container_height_; -}; diff --git a/electros-ultralight/archive/browser/src/UI.cpp b/electros-ultralight/archive/browser/src/UI.cpp deleted file mode 100644 index 9da970e..0000000 --- a/electros-ultralight/archive/browser/src/UI.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#include "UI.h" - -static UI* g_ui = 0; - -#define UI_HEIGHT 80 - -UI::UI(RefPtr window) : window_(window), cur_cursor_(Cursor::kCursor_Pointer), -is_resizing_inspector_(false), is_over_inspector_resize_drag_handle_(false) { - uint32_t window_width = window_->width(); - ui_height_ = (uint32_t)std::round(UI_HEIGHT * window_->scale()); - overlay_ = Overlay::Create(window_, window_width, ui_height_, 0, 0); - g_ui = this; - - view()->set_load_listener(this); - view()->set_view_listener(this); - view()->LoadURL("file:///ui.html"); -} - -UI::~UI() { - view()->set_load_listener(nullptr); - view()->set_view_listener(nullptr); - g_ui = nullptr; -} - -bool UI::OnKeyEvent(const ultralight::KeyEvent& evt) { - return true; -} - -bool UI::OnMouseEvent(const ultralight::MouseEvent& evt) { - if (active_tab() && active_tab()->IsInspectorShowing()) { - float x_px = std::round(evt.x * window()->scale()); - float y_px = std::round(evt.y * window()->scale()); - - if (is_resizing_inspector_) { - int resize_delta = inspector_resize_begin_mouse_y_ - y_px; - int new_inspector_height = inspector_resize_begin_height_ + resize_delta; - active_tab()->SetInspectorHeight(new_inspector_height); - - if (evt.type == MouseEvent::kType_MouseUp) { - is_resizing_inspector_ = false; - } - - return false; - } - - IntRect drag_handle = active_tab()->GetInspectorResizeDragHandle(); - - bool over_drag_handle = drag_handle.Contains(Point(x_px, y_px)); - - if (over_drag_handle && !is_over_inspector_resize_drag_handle_) { - // We entered the drag area - window()->SetCursor(Cursor::kCursor_NorthSouthResize); - is_over_inspector_resize_drag_handle_ = true; - } else if (!over_drag_handle && is_over_inspector_resize_drag_handle_) { - // We left the drag area, restore previous cursor - window()->SetCursor(cur_cursor_); - is_over_inspector_resize_drag_handle_ = false; - } - - if (over_drag_handle && evt.type == MouseEvent::kType_MouseDown && !is_resizing_inspector_) { - is_resizing_inspector_ = true; - inspector_resize_begin_mouse_y_ = y_px; - inspector_resize_begin_height_ = active_tab()->GetInspectorHeight(); - } - - return !over_drag_handle; - } - - return true; -} - -void UI::OnClose(ultralight::Window* window) { - App::instance()->Quit(); -} - -void UI::OnResize(ultralight::Window* window, uint32_t width, uint32_t height) { - int tab_height = window->height() - ui_height_; - - if (tab_height < 1) - tab_height = 1; - - overlay_->Resize(window->width(), ui_height_); - - for (auto& tab : tabs_) { - if (tab.second) - tab.second->Resize(window->width(), (uint32_t)tab_height); - } -} - -void UI::OnDOMReady(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - // Set the context for all subsequent JS* calls - RefPtr locked_context = view()->LockJSContext(); - SetJSContext(locked_context->ctx()); - - JSObject global = JSGlobalObject(); - updateBack = global["updateBack"]; - updateForward = global["updateForward"]; - updateLoading = global["updateLoading"]; - updateURL = global["updateURL"]; - addTab = global["addTab"]; - updateTab = global["updateTab"]; - closeTab = global["closeTab"]; - - global["OnBack"] = BindJSCallback(&UI::OnBack); - global["OnForward"] = BindJSCallback(&UI::OnForward); - global["OnRefresh"] = BindJSCallback(&UI::OnRefresh); - global["OnStop"] = BindJSCallback(&UI::OnStop); - global["OnToggleTools"] = BindJSCallback(&UI::OnToggleTools); - global["OnRequestNewTab"] = BindJSCallback(&UI::OnRequestNewTab); - global["OnRequestTabClose"] = BindJSCallback(&UI::OnRequestTabClose); - global["OnActiveTabChange"] = BindJSCallback(&UI::OnActiveTabChange); - global["OnRequestChangeURL"] = BindJSCallback(&UI::OnRequestChangeURL); - - CreateNewTab(); -} - -void UI::OnBack(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->GoBack(); -} - -void UI::OnForward(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->GoForward(); -} - -void UI::OnRefresh(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->Reload(); -} - -void UI::OnStop(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->Stop(); -} - -void UI::OnToggleTools(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->ToggleInspector(); -} - -void UI::OnRequestNewTab(const JSObject& obj, const JSArgs& args) { - CreateNewTab(); -} - -void UI::OnRequestTabClose(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - uint64_t id = args[0]; - - auto& tab = tabs_[id]; - if (!tab) - return; - - if (tabs_.size() == 1 && App::instance()) - App::instance()->Quit(); - - if (id != active_tab_id_) { - tabs_[id].reset(); - tabs_.erase(id); - } - else { - tab->set_ready_to_close(true); - } - - RefPtr lock(view()->LockJSContext()); - closeTab({ id }); - } -} - -void UI::OnActiveTabChange(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - uint64_t id = args[0]; - - if (id == active_tab_id_) - return; - - auto& tab = tabs_[id]; - if (!tab) - return; - - tabs_[active_tab_id_]->Hide(); - - if (tabs_[active_tab_id_]->ready_to_close()) { - tabs_[active_tab_id_].reset(); - tabs_.erase(active_tab_id_); - } - - active_tab_id_ = id; - tabs_[active_tab_id_]->Show(); - - auto tab_view = tabs_[active_tab_id_]->view(); - SetLoading(tab_view->is_loading()); - SetCanGoBack(tab_view->CanGoBack()); - SetCanGoForward(tab_view->CanGoBack()); - SetURL(tab_view->url()); - } -} - -void UI::OnRequestChangeURL(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - ultralight::String url = args[0]; - - if (!tabs_.empty()) { - auto& tab = tabs_[active_tab_id_]; - tab->view()->LoadURL(url); - } - } -} - -void UI::CreateNewTab() { - uint64_t id = tab_id_counter_++; - RefPtr window = window_; - int tab_height = window->height() - ui_height_; - if (tab_height < 1) - tab_height = 1; - tabs_[id].reset(new Tab(this, id, window->width(), (uint32_t)tab_height, 0, ui_height_)); - tabs_[id]->view()->LoadURL("file:///electros/electros.html"); - - RefPtr lock(view()->LockJSContext()); - addTab({ id, "New Tab", "", tabs_[id]->view()->is_loading() }); -} - -RefPtr UI::CreateNewTabForChildView(const String& url) { - uint64_t id = tab_id_counter_++; - RefPtr window = window_; - int tab_height = window->height() - ui_height_; - if (tab_height < 1) - tab_height = 1; - tabs_[id].reset(new Tab(this, id, window->width(), (uint32_t)tab_height, 0, ui_height_)); - - RefPtr lock(view()->LockJSContext()); - addTab({ id, "", url, tabs_[id]->view()->is_loading() }); - - return tabs_[id]->view(); -} - -void UI::UpdateTabTitle(uint64_t id, const ultralight::String& title) { - RefPtr lock(view()->LockJSContext()); - updateTab({ id, title, "", tabs_[id]->view()->is_loading() }); -} - -void UI::UpdateTabURL(uint64_t id, const ultralight::String& url) { - if (id == active_tab_id_ && !tabs_.empty()) - SetURL(url); -} - -void UI::UpdateTabNavigation(uint64_t id, bool is_loading, bool can_go_back, bool can_go_forward) { - if (tabs_.empty()) - return; - - RefPtr lock(view()->LockJSContext()); - updateTab({ id, tabs_[id]->view()->title(), "", tabs_[id]->view()->is_loading() }); - - if (id == active_tab_id_) { - SetLoading(is_loading); - SetCanGoBack(can_go_back); - SetCanGoForward(can_go_forward); - } -} - -void UI::SetLoading(bool is_loading) { - RefPtr lock(view()->LockJSContext()); - updateLoading({ is_loading }); -} - -void UI::SetCanGoBack(bool can_go_back) { - RefPtr lock(view()->LockJSContext()); - updateBack({ can_go_back }); -} - -void UI::SetCanGoForward(bool can_go_forward) { - RefPtr lock(view()->LockJSContext()); - updateForward({ can_go_forward }); -} - -void UI::SetURL(const ultralight::String& url) { - RefPtr lock(view()->LockJSContext()); - updateURL({ url }); -} - -void UI::SetCursor(ultralight::Cursor cursor) { - if (App::instance()) - window_->SetCursor(cursor); -} diff --git a/electros-ultralight/archive/browser/src/UI.h b/electros-ultralight/archive/browser/src/UI.h deleted file mode 100644 index 3944903..0000000 --- a/electros-ultralight/archive/browser/src/UI.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once -#include -#include "Tab.h" -#include -#include - -using ultralight::JSObject; -using ultralight::JSArgs; -using ultralight::JSFunction; -using namespace ultralight; - -class Console; - -/** -* Browser UI implementation. Renders the toolbar/addressbar/tabs in top pane. -*/ -class UI : public WindowListener, - public LoadListener, - public ViewListener { - public: - UI(RefPtr window); - ~UI(); - - // Inherited from WindowListener - virtual bool OnKeyEvent(const ultralight::KeyEvent& evt) override; - virtual bool OnMouseEvent(const ultralight::MouseEvent& evt) override; - virtual void OnClose(ultralight::Window* window) override; - virtual void OnResize(ultralight::Window* window, uint32_t width, uint32_t height) override; - - // Inherited from LoadListener - virtual void OnDOMReady(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - - // Inherited from ViewListener - virtual void OnChangeCursor(ultralight::View* caller, Cursor cursor) override { SetCursor(cursor); } - - // Called by UI JavaScript - void OnBack(const JSObject& obj, const JSArgs& args); - void OnForward(const JSObject& obj, const JSArgs& args); - void OnRefresh(const JSObject& obj, const JSArgs& args); - void OnStop(const JSObject& obj, const JSArgs& args); - void OnToggleTools(const JSObject& obj, const JSArgs& args); - void OnRequestNewTab(const JSObject& obj, const JSArgs& args); - void OnRequestTabClose(const JSObject& obj, const JSArgs& args); - void OnActiveTabChange(const JSObject& obj, const JSArgs& args); - void OnRequestChangeURL(const JSObject& obj, const JSArgs& args); - - RefPtr window() { return window_; } - -protected: - void CreateNewTab(); - RefPtr CreateNewTabForChildView(const String& url); - void UpdateTabTitle(uint64_t id, const String& title); - void UpdateTabURL(uint64_t id, const String& url); - void UpdateTabNavigation(uint64_t id, bool is_loading, bool can_go_back, bool can_go_forward); - - void SetLoading(bool is_loading); - void SetCanGoBack(bool can_go_back); - void SetCanGoForward(bool can_go_forward); - void SetURL(const String& url); - void SetCursor(Cursor cursor); - - Tab* active_tab() { return tabs_.empty() ? nullptr : tabs_[active_tab_id_].get(); } - - RefPtr view() { return overlay_->view(); } - - RefPtr window_; - RefPtr overlay_; - int ui_height_; - int tab_height_; - float scale_; - - std::map> tabs_; - uint64_t active_tab_id_ = 0; - uint64_t tab_id_counter_ = 0; - Cursor cur_cursor_; - bool is_resizing_inspector_; - bool is_over_inspector_resize_drag_handle_; - int inspector_resize_begin_height_; - int inspector_resize_begin_mouse_y_; - - JSFunction updateBack; - JSFunction updateForward; - JSFunction updateLoading; - JSFunction updateURL; - JSFunction addTab; - JSFunction updateTab; - JSFunction closeTab; - - friend class Tab; -}; diff --git a/electros-ultralight/archive/browser/src/main.cpp b/electros-ultralight/archive/browser/src/main.cpp deleted file mode 100644 index c556b90..0000000 --- a/electros-ultralight/archive/browser/src/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Browser.h" - -#define ENABLE_PAUSE_FOR_DEBUGGER 0 - -#if defined(_WIN32) && ENABLE_PAUSE_FOR_DEBUGGER -#include -void PauseForDebugger() { MessageBoxA(NULL, "Pause", "Caption", MB_OKCANCEL); } -#else -void PauseForDebugger() { } -#endif - -int main() { - PauseForDebugger(); - - Browser browser; - browser.Run(); - return 0; -} diff --git a/electros-ultralight/assets/README.md b/electros-ultralight/assets/README.md deleted file mode 100644 index 16a18a4..0000000 --- a/electros-ultralight/assets/README.md +++ /dev/null @@ -1 +0,0 @@ -# elemento-new-app-tests \ No newline at end of file diff --git a/electros-ultralight/assets/about.html b/electros-ultralight/assets/about.html deleted file mode 100644 index e69de29..0000000 diff --git a/electros-ultralight/assets/anchorme.js b/electros-ultralight/assets/anchorme.js deleted file mode 100644 index d78de1b..0000000 --- a/electros-ultralight/assets/anchorme.js +++ /dev/null @@ -1,468 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.anchorme = factory()); -}(this, (function () { 'use strict'; - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var tlds = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TLDs = "(AAA|AARP|ABARTH|ABB|ABBOTT|ABBVIE|ABC|ABLE|ABOGADO|ABUDHABI|AC|ACADEMY|ACCENTURE|ACCOUNTANT|ACCOUNTANTS|ACO|ACTOR|AD|ADAC|ADS|ADULT|AE|AEG|AERO|AETNA|AF|AFAMILYCOMPANY|AFL|AFRICA|AG|AGAKHAN|AGENCY|AI|AIG|AIGO|AIRBUS|AIRFORCE|AIRTEL|AKDN|AL|ALFAROMEO|ALIBABA|ALIPAY|ALLFINANZ|ALLSTATE|ALLY|ALSACE|ALSTOM|AM|AMERICANEXPRESS|AMERICANFAMILY|AMEX|AMFAM|AMICA|AMSTERDAM|ANALYTICS|ANDROID|ANQUAN|ANZ|AO|AOL|APARTMENTS|APP|APPLE|AQ|AQUARELLE|AR|ARAB|ARAMCO|ARCHI|ARMY|ARPA|ART|ARTE|AS|ASDA|ASIA|ASSOCIATES|AT|ATHLETA|ATTORNEY|AU|AUCTION|AUDI|AUDIBLE|AUDIO|AUSPOST|AUTHOR|AUTO|AUTOS|AVIANCA|AW|AWS|AX|AXA|AZ|AZURE|BA|BABY|BAIDU|BANAMEX|BANANAREPUBLIC|BAND|BANK|BAR|BARCELONA|BARCLAYCARD|BARCLAYS|BAREFOOT|BARGAINS|BASEBALL|BASKETBALL|BAUHAUS|BAYERN|BB|BBC|BBT|BBVA|BCG|BCN|BD|BE|BEATS|BEAUTY|BEER|BENTLEY|BERLIN|BEST|BESTBUY|BET|BF|BG|BH|BHARTI|BI|BIBLE|BID|BIKE|BING|BINGO|BIO|BIZ|BJ|BLACK|BLACKFRIDAY|BLOCKBUSTER|BLOG|BLOOMBERG|BLUE|BM|BMS|BMW|BN|BNPPARIBAS|BO|BOATS|BOEHRINGER|BOFA|BOM|BOND|BOO|BOOK|BOOKING|BOSCH|BOSTIK|BOSTON|BOT|BOUTIQUE|BOX|BR|BRADESCO|BRIDGESTONE|BROADWAY|BROKER|BROTHER|BRUSSELS|BS|BT|BUDAPEST|BUGATTI|BUILD|BUILDERS|BUSINESS|BUY|BUZZ|BV|BW|BY|BZ|BZH|CA|CAB|CAFE|CAL|CALL|CALVINKLEIN|CAM|CAMERA|CAMP|CANCERRESEARCH|CANON|CAPETOWN|CAPITAL|CAPITALONE|CAR|CARAVAN|CARDS|CARE|CAREER|CAREERS|CARS|CASA|CASE|CASEIH|CASH|CASINO|CAT|CATERING|CATHOLIC|CBA|CBN|CBRE|CBS|CC|CD|CEB|CENTER|CEO|CERN|CF|CFA|CFD|CG|CH|CHANEL|CHANNEL|CHARITY|CHASE|CHAT|CHEAP|CHINTAI|CHRISTMAS|CHROME|CHURCH|CI|CIPRIANI|CIRCLE|CISCO|CITADEL|CITI|CITIC|CITY|CITYEATS|CK|CL|CLAIMS|CLEANING|CLICK|CLINIC|CLINIQUE|CLOTHING|CLOUD|CLUB|CLUBMED|CM|CN|CO|COACH|CODES|COFFEE|COLLEGE|COLOGNE|COM|COMCAST|COMMBANK|COMMUNITY|COMPANY|COMPARE|COMPUTER|COMSEC|CONDOS|CONSTRUCTION|CONSULTING|CONTACT|CONTRACTORS|COOKING|COOKINGCHANNEL|COOL|COOP|CORSICA|COUNTRY|COUPON|COUPONS|COURSES|CPA|CR|CREDIT|CREDITCARD|CREDITUNION|CRICKET|CROWN|CRS|CRUISE|CRUISES|CSC|CU|CUISINELLA|CV|CW|CX|CY|CYMRU|CYOU|CZ|DABUR|DAD|DANCE|DATA|DATE|DATING|DATSUN|DAY|DCLK|DDS|DE|DEAL|DEALER|DEALS|DEGREE|DELIVERY|DELL|DELOITTE|DELTA|DEMOCRAT|DENTAL|DENTIST|DESI|DESIGN|DEV|DHL|DIAMONDS|DIET|DIGITAL|DIRECT|DIRECTORY|DISCOUNT|DISCOVER|DISH|DIY|DJ|DK|DM|DNP|DO|DOCS|DOCTOR|DOG|DOMAINS|DOT|DOWNLOAD|DRIVE|DTV|DUBAI|DUCK|DUNLOP|DUPONT|DURBAN|DVAG|DVR|DZ|EARTH|EAT|EC|ECO|EDEKA|EDU|EDUCATION|EE|EG|EMAIL|EMERCK|ENERGY|ENGINEER|ENGINEERING|ENTERPRISES|EPSON|EQUIPMENT|ER|ERICSSON|ERNI|ES|ESQ|ESTATE|ESURANCE|ET|ETISALAT|EU|EUROVISION|EUS|EVENTS|EXCHANGE|EXPERT|EXPOSED|EXPRESS|EXTRASPACE|FAGE|FAIL|FAIRWINDS|FAITH|FAMILY|FAN|FANS|FARM|FARMERS|FASHION|FAST|FEDEX|FEEDBACK|FERRARI|FERRERO|FI|FIAT|FIDELITY|FIDO|FILM|FINAL|FINANCE|FINANCIAL|FIRE|FIRESTONE|FIRMDALE|FISH|FISHING|FIT|FITNESS|FJ|FK|FLICKR|FLIGHTS|FLIR|FLORIST|FLOWERS|FLY|FM|FO|FOO|FOOD|FOODNETWORK|FOOTBALL|FORD|FOREX|FORSALE|FORUM|FOUNDATION|FOX|FR|FREE|FRESENIUS|FRL|FROGANS|FRONTDOOR|FRONTIER|FTR|FUJITSU|FUJIXEROX|FUN|FUND|FURNITURE|FUTBOL|FYI|GA|GAL|GALLERY|GALLO|GALLUP|GAME|GAMES|GAP|GARDEN|GAY|GB|GBIZ|GD|GDN|GE|GEA|GENT|GENTING|GEORGE|GF|GG|GGEE|GH|GI|GIFT|GIFTS|GIVES|GIVING|GL|GLADE|GLASS|GLE|GLOBAL|GLOBO|GM|GMAIL|GMBH|GMO|GMX|GN|GODADDY|GOLD|GOLDPOINT|GOLF|GOO|GOODYEAR|GOOG|GOOGLE|GOP|GOT|GOV|GP|GQ|GR|GRAINGER|GRAPHICS|GRATIS|GREEN|GRIPE|GROCERY|GROUP|GS|GT|GU|GUARDIAN|GUCCI|GUGE|GUIDE|GUITARS|GURU|GW|GY|HAIR|HAMBURG|HANGOUT|HAUS|HBO|HDFC|HDFCBANK|HEALTH|HEALTHCARE|HELP|HELSINKI|HERE|HERMES|HGTV|HIPHOP|HISAMITSU|HITACHI|HIV|HK|HKT|HM|HN|HOCKEY|HOLDINGS|HOLIDAY|HOMEDEPOT|HOMEGOODS|HOMES|HOMESENSE|HONDA|HORSE|HOSPITAL|HOST|HOSTING|HOT|HOTELES|HOTELS|HOTMAIL|HOUSE|HOW|HR|HSBC|HT|HU|HUGHES|HYATT|HYUNDAI|IBM|ICBC|ICE|ICU|ID|IE|IEEE|IFM|IKANO|IL|IM|IMAMAT|IMDB|IMMO|IMMOBILIEN|IN|INC|INDUSTRIES|INFINITI|INFO|ING|INK|INSTITUTE|INSURANCE|INSURE|INT|INTEL|INTERNATIONAL|INTUIT|INVESTMENTS|IO|IPIRANGA|IQ|IR|IRISH|IS|ISMAILI|IST|ISTANBUL|IT|ITAU|ITV|IVECO|JAGUAR|JAVA|JCB|JCP|JE|JEEP|JETZT|JEWELRY|JIO|JLL|JM|JMP|JNJ|JO|JOBS|JOBURG|JOT|JOY|JP|JPMORGAN|JPRS|JUEGOS|JUNIPER|KAUFEN|KDDI|KE|KERRYHOTELS|KERRYLOGISTICS|KERRYPROPERTIES|KFH|KG|KH|KI|KIA|KIM|KINDER|KINDLE|KITCHEN|KIWI|KM|KN|KOELN|KOMATSU|KOSHER|KP|KPMG|KPN|KR|KRD|KRED|KUOKGROUP|KW|KY|KYOTO|KZ|LA|LACAIXA|LAMBORGHINI|LAMER|LANCASTER|LANCIA|LAND|LANDROVER|LANXESS|LASALLE|LAT|LATINO|LATROBE|LAW|LAWYER|LB|LC|LDS|LEASE|LECLERC|LEFRAK|LEGAL|LEGO|LEXUS|LGBT|LI|LIDL|LIFE|LIFEINSURANCE|LIFESTYLE|LIGHTING|LIKE|LILLY|LIMITED|LIMO|LINCOLN|LINDE|LINK|LIPSY|LIVE|LIVING|LIXIL|LK|LLC|LLP|LOAN|LOANS|LOCKER|LOCUS|LOFT|LOL|LONDON|LOTTE|LOTTO|LOVE|LPL|LPLFINANCIAL|LR|LS|LT|LTD|LTDA|LU|LUNDBECK|LUPIN|LUXE|LUXURY|LV|LY|MA|MACYS|MADRID|MAIF|MAISON|MAKEUP|MAN|MANAGEMENT|MANGO|MAP|MARKET|MARKETING|MARKETS|MARRIOTT|MARSHALLS|MASERATI|MATTEL|MBA|MC|MCKINSEY|MD|ME|MED|MEDIA|MEET|MELBOURNE|MEME|MEMORIAL|MEN|MENU|MERCKMSD|METLIFE|MG|MH|MIAMI|MICROSOFT|MIL|MINI|MINT|MIT|MITSUBISHI|MK|ML|MLB|MLS|MM|MMA|MN|MO|MOBI|MOBILE|MODA|MOE|MOI|MOM|MONASH|MONEY|MONSTER|MORMON|MORTGAGE|MOSCOW|MOTO|MOTORCYCLES|MOV|MOVIE|MP|MQ|MR|MS|MSD|MT|MTN|MTR|MU|MUSEUM|MUTUAL|MV|MW|MX|MY|MZ|NA|NAB|NAGOYA|NAME|NATIONWIDE|NATURA|NAVY|NBA|NC|NE|NEC|NET|NETBANK|NETFLIX|NETWORK|NEUSTAR|NEW|NEWHOLLAND|NEWS|NEXT|NEXTDIRECT|NEXUS|NF|NFL|NG|NGO|NHK|NI|NICO|NIKE|NIKON|NINJA|NISSAN|NISSAY|NL|NO|NOKIA|NORTHWESTERNMUTUAL|NORTON|NOW|NOWRUZ|NOWTV|NP|NR|NRA|NRW|NTT|NU|NYC|NZ|OBI|OBSERVER|OFF|OFFICE|OKINAWA|OLAYAN|OLAYANGROUP|OLDNAVY|OLLO|OM|OMEGA|ONE|ONG|ONL|ONLINE|ONYOURSIDE|OOO|OPEN|ORACLE|ORANGE|ORG|ORGANIC|ORIGINS|OSAKA|OTSUKA|OTT|OVH|PA|PAGE|PANASONIC|PARIS|PARS|PARTNERS|PARTS|PARTY|PASSAGENS|PAY|PCCW|PE|PET|PF|PFIZER|PG|PH|PHARMACY|PHD|PHILIPS|PHONE|PHOTO|PHOTOGRAPHY|PHOTOS|PHYSIO|PICS|PICTET|PICTURES|PID|PIN|PING|PINK|PIONEER|PIZZA|PK|PL|PLACE|PLAY|PLAYSTATION|PLUMBING|PLUS|PM|PN|PNC|POHL|POKER|POLITIE|PORN|POST|PR|PRAMERICA|PRAXI|PRESS|PRIME|PRO|PROD|PRODUCTIONS|PROF|PROGRESSIVE|PROMO|PROPERTIES|PROPERTY|PROTECTION|PRU|PRUDENTIAL|PS|PT|PUB|PW|PWC|PY|QA|QPON|QUEBEC|QUEST|QVC|RACING|RADIO|RAID|RE|READ|REALESTATE|REALTOR|REALTY|RECIPES|RED|REDSTONE|REDUMBRELLA|REHAB|REISE|REISEN|REIT|RELIANCE|REN|RENT|RENTALS|REPAIR|REPORT|REPUBLICAN|REST|RESTAURANT|REVIEW|REVIEWS|REXROTH|RICH|RICHARDLI|RICOH|RIGHTATHOME|RIL|RIO|RIP|RMIT|RO|ROCHER|ROCKS|RODEO|ROGERS|ROOM|RS|RSVP|RU|RUGBY|RUHR|RUN|RW|RWE|RYUKYU|SA|SAARLAND|SAFE|SAFETY|SAKURA|SALE|SALON|SAMSCLUB|SAMSUNG|SANDVIK|SANDVIKCOROMANT|SANOFI|SAP|SARL|SAS|SAVE|SAXO|SB|SBI|SBS|SC|SCA|SCB|SCHAEFFLER|SCHMIDT|SCHOLARSHIPS|SCHOOL|SCHULE|SCHWARZ|SCIENCE|SCJOHNSON|SCOR|SCOT|SD|SE|SEARCH|SEAT|SECURE|SECURITY|SEEK|SELECT|SENER|SERVICES|SES|SEVEN|SEW|SEX|SEXY|SFR|SG|SH|SHANGRILA|SHARP|SHAW|SHELL|SHIA|SHIKSHA|SHOES|SHOP|SHOPPING|SHOUJI|SHOW|SHOWTIME|SHRIRAM|SI|SILK|SINA|SINGLES|SITE|SJ|SK|SKI|SKIN|SKY|SKYPE|SL|SLING|SM|SMART|SMILE|SN|SNCF|SO|SOCCER|SOCIAL|SOFTBANK|SOFTWARE|SOHU|SOLAR|SOLUTIONS|SONG|SONY|SOY|SPACE|SPORT|SPOT|SPREADBETTING|SR|SRL|SS|ST|STADA|STAPLES|STAR|STATEBANK|STATEFARM|STC|STCGROUP|STOCKHOLM|STORAGE|STORE|STREAM|STUDIO|STUDY|STYLE|SU|SUCKS|SUPPLIES|SUPPLY|SUPPORT|SURF|SURGERY|SUZUKI|SV|SWATCH|SWIFTCOVER|SWISS|SX|SY|SYDNEY|SYMANTEC|SYSTEMS|SZ|TAB|TAIPEI|TALK|TAOBAO|TARGET|TATAMOTORS|TATAR|TATTOO|TAX|TAXI|TC|TCI|TD|TDK|TEAM|TECH|TECHNOLOGY|TEL|TEMASEK|TENNIS|TEVA|TF|TG|TH|THD|THEATER|THEATRE|TIAA|TICKETS|TIENDA|TIFFANY|TIPS|TIRES|TIROL|TJ|TJMAXX|TJX|TK|TKMAXX|TL|TM|TMALL|TN|TO|TODAY|TOKYO|TOOLS|TOP|TORAY|TOSHIBA|TOTAL|TOURS|TOWN|TOYOTA|TOYS|TR|TRADE|TRADING|TRAINING|TRAVEL|TRAVELCHANNEL|TRAVELERS|TRAVELERSINSURANCE|TRUST|TRV|TT|TUBE|TUI|TUNES|TUSHU|TV|TVS|TW|TZ|UA|UBANK|UBS|UG|UK|UNICOM|UNIVERSITY|UNO|UOL|UPS|US|UY|UZ|VA|VACATIONS|VANA|VANGUARD|VC|VE|VEGAS|VENTURES|VERISIGN|VERSICHERUNG|VET|VG|VI|VIAJES|VIDEO|VIG|VIKING|VILLAS|VIN|VIP|VIRGIN|VISA|VISION|VIVA|VIVO|VLAANDEREN|VN|VODKA|VOLKSWAGEN|VOLVO|VOTE|VOTING|VOTO|VOYAGE|VU|VUELOS|WALES|WALMART|WALTER|WANG|WANGGOU|WATCH|WATCHES|WEATHER|WEATHERCHANNEL|WEBCAM|WEBER|WEBSITE|WED|WEDDING|WEIBO|WEIR|WF|WHOSWHO|WIEN|WIKI|WILLIAMHILL|WIN|WINDOWS|WINE|WINNERS|WME|WOLTERSKLUWER|WOODSIDE|WORK|WORKS|WORLD|WOW|WS|WTC|WTF|XBOX|XEROX|XFINITY|XIHUAN|XIN|XN--11B4C3D|XN--1CK2E1B|XN--1QQW23A|XN--2SCRJ9C|XN--30RR7Y|XN--3BST00M|XN--3DS443G|XN--3E0B707E|XN--3HCRJ9C|XN--3OQ18VL8PN36A|XN--3PXU8K|XN--42C2D9A|XN--45BR5CYL|XN--45BRJ9C|XN--45Q11C|XN--4GBRIM|XN--54B7FTA0CC|XN--55QW42G|XN--55QX5D|XN--5SU34J936BGSG|XN--5TZM5G|XN--6FRZ82G|XN--6QQ986B3XL|XN--80ADXHKS|XN--80AO21A|XN--80AQECDR1A|XN--80ASEHDB|XN--80ASWG|XN--8Y0A063A|XN--90A3AC|XN--90AE|XN--90AIS|XN--9DBQ2A|XN--9ET52U|XN--9KRT00A|XN--B4W605FERD|XN--BCK1B9A5DRE4C|XN--C1AVG|XN--C2BR7G|XN--CCK2B3B|XN--CG4BKI|XN--CLCHC0EA0B2G2A9GCD|XN--CZR694B|XN--CZRS0T|XN--CZRU2D|XN--D1ACJ3B|XN--D1ALF|XN--E1A4C|XN--ECKVDTC9D|XN--EFVY88H|XN--FCT429K|XN--FHBEI|XN--FIQ228C5HS|XN--FIQ64B|XN--FIQS8S|XN--FIQZ9S|XN--FJQ720A|XN--FLW351E|XN--FPCRJ9C3D|XN--FZC2C9E2C|XN--FZYS8D69UVGM|XN--G2XX48C|XN--GCKR3F0F|XN--GECRJ9C|XN--GK3AT1E|XN--H2BREG3EVE|XN--H2BRJ9C|XN--H2BRJ9C8C|XN--HXT814E|XN--I1B6B1A6A2E|XN--IMR513N|XN--IO0A7I|XN--J1AEF|XN--J1AMH|XN--J6W193G|XN--JLQ61U9W7B|XN--JVR189M|XN--KCRX77D1X4A|XN--KPRW13D|XN--KPRY57D|XN--KPU716F|XN--KPUT3I|XN--L1ACC|XN--LGBBAT1AD8J|XN--MGB9AWBF|XN--MGBA3A3EJT|XN--MGBA3A4F16A|XN--MGBA7C0BBN0A|XN--MGBAAKC7DVF|XN--MGBAAM7A8H|XN--MGBAB2BD|XN--MGBAH1A3HJKRD|XN--MGBAI9AZGQP6J|XN--MGBAYH7GPA|XN--MGBBH1A|XN--MGBBH1A71E|XN--MGBC0A9AZCG|XN--MGBCA7DZDO|XN--MGBCPQ6GPA1A|XN--MGBERP4A5D4AR|XN--MGBGU82A|XN--MGBI4ECEXP|XN--MGBPL2FH|XN--MGBT3DHD|XN--MGBTX2B|XN--MGBX4CD0AB|XN--MIX891F|XN--MK1BU44C|XN--MXTQ1M|XN--NGBC5AZD|XN--NGBE9E0A|XN--NGBRX|XN--NODE|XN--NQV7F|XN--NQV7FS00EMA|XN--NYQY26A|XN--O3CW4H|XN--OGBPF8FL|XN--OTU796D|XN--P1ACF|XN--P1AI|XN--PBT977C|XN--PGBS0DH|XN--PSSY2U|XN--Q7CE6A|XN--Q9JYB4C|XN--QCKA1PMC|XN--QXA6A|XN--QXAM|XN--RHQV96G|XN--ROVU88B|XN--RVC1E0AM3E|XN--S9BRJ9C|XN--SES554G|XN--T60B56A|XN--TCKWE|XN--TIQ49XQYJ|XN--UNUP4Y|XN--VERMGENSBERATER-CTB|XN--VERMGENSBERATUNG-PWB|XN--VHQUV|XN--VUQ861B|XN--W4R85EL8FHU5DNRA|XN--W4RS40L|XN--WGBH1C|XN--WGBL6A|XN--XHQ521B|XN--XKC2AL3HYE2A|XN--XKC2DL3A5EE0H|XN--Y9A3AQ|XN--YFRO4I67O|XN--YGBI2AMMX|XN--ZFR164B|XXX|XYZ|YACHTS|YAHOO|YAMAXUN|YANDEX|YE|YODOBASHI|YOGA|YOKOHAMA|YOU|YOUTUBE|YT|YUN|ZA|ZAPPOS|ZARA|ZERO|ZIP|ZM|ZONE|ZUERICH|ZW|TEST)"; - }); - - unwrapExports(tlds); - var tlds_1 = tlds.TLDs; - - var dictionary = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - - exports.openingParenthesis = "([\"'{"; - exports.closingParenthesis = ")]\"'}"; - exports.parenthesis = exports.openingParenthesis - .split("") - .map(function (x, i) { return "" + x + exports.closingParenthesis.charAt(i); }); - exports.htmlAttributes = [ - "src", - "data", - "href", - "cite", - "formaction", - "icon", - "manifest", - "poster", - "codebase", - "background", - "profile", - "usemap", - "itemtype", - "action", - "longdesc", - "classid", - "archive" - ]; - exports.nonLatinAlphabetRanges = "\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC"; - exports.TLDs = tlds.TLDs; - }); - - unwrapExports(dictionary); - var dictionary_1 = dictionary.openingParenthesis; - var dictionary_2 = dictionary.closingParenthesis; - var dictionary_3 = dictionary.parenthesis; - var dictionary_4 = dictionary.htmlAttributes; - var dictionary_5 = dictionary.nonLatinAlphabetRanges; - var dictionary_6 = dictionary.TLDs; - - var transform_1 = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - function applyOption(string, props, option) { - // conditional - if (typeof option === "function") { - return option(string, props); - } - // all - else { - return option; - } - } - function transform(input, options) { - var protocol = ""; - var truncation = Infinity; - var attributes = {}; - var truncateFromTheMiddle = false; - // special transformation - if (options && options.specialTransform) { - for (var index = 0; index < options.specialTransform.length; index++) { - var transformer = options.specialTransform[index]; - if (transformer.test.test(input.string)) { - return transformer.transform(input.string, input); - } - } - } - // exclude - if (options && options.exclude) { - if (applyOption(input.string, input, options.exclude)) - { return input.string; } - } - // protocol - if (options && options.protocol) { - protocol = applyOption(input.string, input, options.protocol); - } - if (input.protocol) { - protocol = ""; - } - else if (!protocol) { - protocol = input.isEmail - ? "mailto:" - : input.isFile - ? "file:///" - : "http://"; - } - // truncation - if (options && options.truncate) { - truncation = applyOption(input.string, input, options.truncate); - } - if (options && options.middleTruncation) { - truncateFromTheMiddle = applyOption(input.string, input, options.middleTruncation); - } - // attributes - if (options && options.attributes) { - attributes = applyOption(input.string, input, options.attributes); - } - return "" + (input.string.length > truncation - ? truncateFromTheMiddle - ? input.string.substring(0, Math.floor(truncation / 2)) + - "…" + - input.string.substring(input.string.length - Math.ceil(truncation / 2), input.string.length) - : input.string.substring(0, truncation) + "…" - : input.string) + ""; - } - exports.transform = transform; - }); - - unwrapExports(transform_1); - var transform_2 = transform_1.transform; - - var regex = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - - var email_address = "([a-z0-9!#$%&'*+=?^_`{|}~-]+(\\.[a-z0-9!#$%&'*+=?^_`{|}~-]+)*)"; - var domainWithTLD = "([a-z0-9]+(-+[a-z0-9]+)*\\.)+(" + dictionary.TLDs + ")"; - var domainWithAnyTLD = "([a-z0-9]+(-+[a-z0-9]+)*\\.)+([a-z0-9][a-z0-9-]{0," + (Math.max.apply(commonjsGlobal, dictionary.TLDs.split("|").map(function (x) { return x.length; })) - 2) + "}[a-z0-9])"; - var allowedInPath = "a-zA-Z\\d\\-._~\\!$&*+,;=:@%'\"\\[\\]()"; - var path = "(((\\/(([" + allowedInPath + "]+(\\/[" + allowedInPath + "]*)*))?)?)((\\?([" + allowedInPath + "\\/?]*))?)((\\#([" + allowedInPath + "\\/?]*))?))?"; - var ipv4 = "((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; - var ipv6 = "\\[(([a-f0-9:]+:+)+[a-f0-9]+)\\]"; - var port = "(:(\\d{1,5}))?"; - var protocol = "(https?:|ftps?:)\\/\\/"; - var confirmedByProtocol = "(" + protocol + ")\\S+"; - var additionalSlashes = "(([\\/]?))+"; - var fqdn = "(((" + protocol + ")?(" + domainWithTLD + "|" + ipv4 + "|(" + protocol + ")(" + ipv6 + "|" + domainWithAnyTLD + "))(?!@\\w)" + port + ")|(" + confirmedByProtocol + "))"; - var nonLatinMatches = fqdn + "((((\\/(([" + allowedInPath + "]+(\\/[" + allowedInPath + dictionary.nonLatinAlphabetRanges + "]*)*))?)?)((\\?([" + allowedInPath + "\\/?]*))?)((\\#([" + allowedInPath + "\\/?]*))?))?\\b((([" + allowedInPath + "\\/" + dictionary.nonLatinAlphabetRanges + "][a-zA-Z\\d\\-_~+=\\/" + dictionary.nonLatinAlphabetRanges + "]+)?))+)"; - exports.email = "\\b(mailto:)?" + email_address + "@(" + domainWithTLD + "|" + ipv4 + ")\\b"; - exports.url = "(" + nonLatinMatches + ")|(\\b" + fqdn + path + "\\b" + additionalSlashes + ")"; - exports.file = "(file:\\/\\/\\/)([a-z]+:(\\/|\\\\)+)?([\\w.]+([\\/\\\\]?)+)+"; - exports.final = "(" + exports.url + ")|(" + exports.email + ")|(" + exports.file + ")"; - exports.finalRegex = new RegExp(exports.final, "gi"); - // for validation purposes - exports.ipRegex = new RegExp("^(" + ipv4 + "|" + ipv6 + ")$", "i"); - exports.emailRegex = new RegExp("^(" + exports.email + ")$", "i"); - exports.fileRegex = new RegExp("^(" + exports.file + ")$", "i"); - exports.urlRegex = new RegExp("^(" + exports.url + ")$", "i"); - // identifying parts of the link - var iidxes = { - isURL: 0, - isEmail: 0, - isFile: 0, - file: { - fileName: 0, - protocol: 0, - }, - email: { - protocol: 0, - local: 0, - host: 0, - }, - url: { - ipv4: 0, - ipv6: 0, - ipv4Confirmation: 0, - byProtocol: 0, - port: 0, - // three places where protocol can appear - protocol1: 0, - protocol2: 0, - protocol3: 0, - protocolWithDomain: 0, - path: 0, - // sometimes path might be split into two parts - secondPartOfPath: 0, - query: 0, - fragment: 0, - }, - }; - exports.iidxes = iidxes; - var testers = [ - "file:///some/file/path/filename.pdf", - "mailto:e+_mail.me@sub.domain.com", - "http://sub.domain.co.uk:3000/p/a/t/h_(asd)/h?q=abc123#dfdf", - "http://www.\u0639\u0631\u0628\u064A.com", - "http://127.0.0.1:3000/p/a/t_(asd)/h?q=abc123#dfdf", - "http://[2a00:1450:4025:401::67]/k/something", - "a.org/abc/\u10D8_\u10D2\u10D2" ].join(" "); - var result = null; - var i = 0; - while ((result = exports.finalRegex.exec(testers)) !== null) { - if (i === 0) { - iidxes.isFile = result.lastIndexOf(result[0]); - iidxes.file.fileName = result.indexOf("filename.pdf"); - iidxes.file.protocol = result.indexOf("file:///"); - } - if (i === 1) { - iidxes.isEmail = result.lastIndexOf(result[0]); - iidxes.email.protocol = result.indexOf("mailto:"); - iidxes.email.local = result.indexOf("e+_mail.me"); - iidxes.email.host = result.indexOf("sub.domain.com"); - } - if (i === 2) { - iidxes.isURL = result.lastIndexOf(result[0]); - iidxes.url.protocol1 = result.indexOf("http://"); - iidxes.url.protocolWithDomain = result.indexOf("http://sub.domain.co.uk:3000"); - iidxes.url.port = result.indexOf("3000"); - iidxes.url.path = result.indexOf("/p/a/t/h_(asd)/h"); - iidxes.url.query = result.indexOf("q=abc123"); - iidxes.url.fragment = result.indexOf("dfdf"); - } - if (i === 3) { - iidxes.url.byProtocol = result.lastIndexOf("http://www.عربي.com"); - iidxes.url.protocol2 = result.lastIndexOf("http://"); - } - if (i === 4) { - iidxes.url.ipv4 = result.indexOf("127.0.0.1"); - iidxes.url.ipv4Confirmation = result.indexOf("0."); - } - if (i === 5) { - iidxes.url.ipv6 = result.indexOf("2a00:1450:4025:401::67"); - iidxes.url.protocol3 = result.lastIndexOf("http://"); - } - if (i === 6) { - iidxes.url.secondPartOfPath = result.indexOf("გგ"); - } - i++; - } - }); - - unwrapExports(regex); - var regex_1 = regex.email; - var regex_2 = regex.url; - var regex_3 = regex.file; - var regex_4 = regex.finalRegex; - var regex_5 = regex.ipRegex; - var regex_6 = regex.emailRegex; - var regex_7 = regex.fileRegex; - var regex_8 = regex.urlRegex; - var regex_9 = regex.iidxes; - - var utils = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - - function checkParenthesis(opening, closing, target, nextChar) { - if (nextChar !== closing) { - return false; - } - if (target.split(opening).length - target.split(closing).length === 1 || - (opening === closing && target.split(opening).length % 2 === 0)) { - return true; - } - } - exports.checkParenthesis = checkParenthesis; - exports.maximumAttrLength = dictionary.htmlAttributes.sort(function (a, b) { return b.length - a.length; })[0].length; - function isInsideAttribute(prevFragment) { - return (/\s[a-z0-9-]+=('|")$/i.test(prevFragment) || - /: ?url\(('|")?$/i.test(prevFragment)); - } - exports.isInsideAttribute = isInsideAttribute; - function isInsideAnchorTag(target, fullInput, targetEnd) { - var escapedTarget = target.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); - var regex = new RegExp("(?=()(" + escapedTarget + "))[\\s\\S]*?(" + escapedTarget + ")(?!\"|')", "gi"); - var result = null; - while ((result = regex.exec(fullInput)) !== null) { - var end = result.index + result[0].length; - if (end === targetEnd) { - return true; - } - } - return false; - } - exports.isInsideAnchorTag = isInsideAnchorTag; - }); - - unwrapExports(utils); - var utils_1 = utils.checkParenthesis; - var utils_2 = utils.maximumAttrLength; - var utils_3 = utils.isInsideAttribute; - var utils_4 = utils.isInsideAnchorTag; - - var node = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - - - - - var list = function (input) { - var found = []; - var result = null; - var _loop_1 = function () { - var start = result.index; - var end = start + result[0].length; - var string = result[0]; - // ### trailing slashes problem - /** - * This is a quick and dirty fix for a problem that could be probably fixed with - * slight modification in the regex. - * The problem is that the library doesn't count the trailing slashes as part - * of the URL, unless there were multiple trailing slashes. - */ - if (input.charAt(end) === "/") { - string = string + input.charAt(end); - end++; - } - // ### Parenthesis problem - /** - As we're using the \b to tokenize the URL, sometimes the parenthesis are part of the URL - and sometimes they are actually the last part, this makes the tokenization stops just - before them. - To fix this, we calculate how many parenthesis are open and how many are closed inside - the URL and based on the number we should be able to know whether the aforementioned - parenthesis character is part of the URL or not - */ - if (dictionary.closingParenthesis.indexOf(input.charAt(end)) > -1) { - dictionary.parenthesis.forEach(function (str) { - var opening = str.charAt(0); - var closing = str.charAt(1); - if (utils.checkParenthesis(opening, closing, string, input.charAt(end))) { - string = string + input.charAt(end); - end++; - } - }); - } - // ### HTML problem 1 - /** - checking whether the token is already inside an HTML element by seeing if it's - preceded by an HTML attribute that would hold a url (e.g. scr, cite ...etc) - */ - if (['""', "''", "()"].indexOf(input.charAt(start - 1) + input.charAt(end)) !== -1) { - if (utils.isInsideAttribute(input.substring(start - utils.maximumAttrLength - 15, start))) { - return "continue"; - } - } - // ### HTML problem 2 - /** - Checking whether the token is the content of an actual anchor - e.g. click to go to something.com and have fun - */ - if (input.substring(end, input.length).indexOf("") > -1 && - input.substring(0, start).indexOf(" -1 && - utils.isInsideAnchorTag(string, input, end)) { - return "continue"; - } - if (result[regex.iidxes.isURL]) { - var path = (result[regex.iidxes.url.path] || "") + - (result[regex.iidxes.url.secondPartOfPath] || "") || undefined; - var protocol = result[regex.iidxes.url.protocol1] || - result[regex.iidxes.url.protocol2] || - result[regex.iidxes.url.protocol3]; - found.push({ - start: start, - end: end, - string: string, - isURL: true, - protocol: protocol, - port: result[regex.iidxes.url.port], - ipv4: result[regex.iidxes.url.ipv4Confirmation] - ? result[regex.iidxes.url.ipv4] - : undefined, - ipv6: result[regex.iidxes.url.ipv6], - host: result[regex.iidxes.url.byProtocol] - ? undefined - : (result[regex.iidxes.url.protocolWithDomain] || "").substr((protocol || "").length), - confirmedByProtocol: !!result[regex.iidxes.url.byProtocol], - path: result[regex.iidxes.url.byProtocol] ? undefined : path, - query: result[regex.iidxes.url.query] || undefined, - fragment: result[regex.iidxes.url.fragment] || undefined, - }); - } - else if (result[regex.iidxes.isFile]) { - var filePath = string.substr(8); - found.push({ - start: start, - end: end, - string: string, - isFile: true, - protocol: result[regex.iidxes.file.protocol], - filename: result[regex.iidxes.file.fileName], - filePath: filePath, - fileDirectory: filePath.substr(0, filePath.length - result[regex.iidxes.file.fileName].length), - }); - } - else if (result[regex.iidxes.isEmail]) { - found.push({ - start: start, - end: end, - string: string, - isEmail: true, - local: result[regex.iidxes.email.local], - protocol: result[regex.iidxes.email.protocol], - host: result[regex.iidxes.email.host], - }); - } - else { - found.push({ - start: start, - end: end, - string: string, - }); - } - }; - while ((result = regex.finalRegex.exec(input)) !== null) { - _loop_1(); - } - return found; - }; - var anchorme = function (arg) { - var _a = typeof arg === "string" - ? { input: arg, options: undefined, extensions: undefined } - : arg, input = _a.input, options = _a.options, extensions = _a.extensions; - if (extensions) { - for (var index = 0; index < extensions.length; index++) { - var extension = extensions[index]; - input = input.replace(extension.test, extension.transform); - } - } - var found = list(input); - var newStr = ""; - // the following code isn't very intuitive nor human readable - // but faster than others - for (var index = 0; index < found.length; index++) { - newStr = - (newStr - ? newStr - : index === 0 - ? input.substring(0, found[index].start) - : "") + - transform_1.transform(found[index], options) + - (found[index + 1] - ? input.substring(found[index].end, found[index + 1].start) - : input.substring(found[index].end)); - } - return newStr ? newStr : input; - }; - anchorme.list = function (input) { - return list(input); - }; - anchorme.validate = { - ip: function (input) { return regex.ipRegex.test(input); }, - email: function (input) { return regex.emailRegex.test(input); }, - file: function (input) { return regex.fileRegex.test(input); }, - url: function (input) { return regex.urlRegex.test(input) || regex.ipRegex.test(input); }, - }; - exports.default = anchorme; - }); - - var index = unwrapExports(node); - - return index; - -}))); diff --git a/electros-ultralight/assets/chrome-tabs.css b/electros-ultralight/assets/chrome-tabs.css deleted file mode 100644 index 6ea17b1..0000000 --- a/electros-ultralight/assets/chrome-tabs.css +++ /dev/null @@ -1,213 +0,0 @@ -.chrome-tabs { - box-sizing: border-box; - position: relative; - font-size: 10px; - height: 40px; - /* background: linear-gradient(#dad9da, #d9d8d9); */ - padding: 0.38em 1.2em 0.0em 1.2em; - border-radius: 0.5em 0.5em 0 0; - overflow: hidden; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; -} - -.chrome-tabs * { - box-sizing: inherit; - font-family: inherit; - cursor: default; -} - -#chrome-tabs-add-tab { - background: linear-gradient(0deg, #232330, #282836); - box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.4); - display: block; - position: absolute; - right: 0px; - padding: 5px 10px; - margin-top: 9px; - margin-right: 3px; - border: 0.8px solid #252532; - border-radius: 8px; - font-size: 12px; - z-index: 1000000; - height: 24px; - color: #c4c2d0 !important; -} - -#chrome-tabs-add-tab:active { - background: linear-gradient(0deg, #262633, #1e1e29); - box-shadow: none; - top: 2px; -} - -.chrome-tabs .chrome-tabs-bottom-bar { - position: absolute; - bottom: 0; - height: 0.40em; - left: 0; - width: 100%; - z-index: 20; - border-bottom: 0.8px solid #252532; -} - -.chrome-tabs .chrome-tabs-content { - position: relative; - width: calc(100% - 75px); - height: 100%; - overflow: hidden; -} - -.chrome-tabs .chrome-tab { - position: absolute; - left: 0; - height: 37px; - width: 24em; - border: 0; - margin: 0; - z-index: 1; - top: 2px; - color: #c4c2d0; -} - -.chrome-tabs .chrome-tab, -.chrome-tabs .chrome-tab * { - user-select: none; - cursor: default; -} - -.chrome-tabs .chrome-tab .chrome-tab-background { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - overflow: hidden; - pointer-events: none; - - width: calc(100% - 8px); - height: 100%; - background: linear-gradient(180deg, #212130, #1c1c24); - border-radius: 8px 8px 0 0; - margin: 2px 4px 4px 4px; -} - -.chrome-tabs .chrome-tab .chrome-tab-background>svg { - width: 100%; - height: 100%; -} - -.chrome-tabs .chrome-tab .chrome-tab-background>svg .chrome-tab-shadow { - fill: none; - stroke: rgba(180, 180, 180, 1.0); - stroke-width: 1.0px; -} - -.chrome-tabs .chrome-tab .chrome-tab-background>svg .chrome-tab-background { - fill: #c4c2d0; - transform: translateX(0.25px) translateY(0.25px); -} - -.chrome-tabs .chrome-tab.chrome-tab-current { - z-index: 999; - color: white; -} - -.chrome-tabs .chrome-tab.chrome-tab-current .chrome-tab-background { - background: linear-gradient(180deg, #313141, #282836); - /*box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.4); */ - border: 0.7px solid #292934; - border-bottom: none; -} - -.chrome-tabs .chrome-tab.chrome-tab-just-added { - top: 14px; - animation: chrome-tab-just-added 120ms forwards ease-in-out; - -} - -@keyframes chrome-tab-just-added { - to { - top: 2px; - } -} - -.chrome-tabs.chrome-tabs-sorting .chrome-tab:not(.chrome-tab-currently-dragged), -.chrome-tabs:not(.chrome-tabs-sorting) .chrome-tab.chrome-tab-just-dragged { - transition: transform 120ms ease-in-out; -} - -.chrome-tabs .chrome-tab-favicon, -.chrome-tabs .chrome-tab-spinner { - position: relative; - margin-left: 1.6em; - height: 14px; - width: 14px; - background-size: 14px; - margin-top: 10px; - z-index: 3; - display: inline-block; - vertical-align: top; - pointer-events: none; -} - -.chrome-tabs .chrome-tab-spinner { - content: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJsb2FkZXItMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCiAgICAgd2lkdGg9IjE0cHgiIGhlaWdodD0iMTRweCIgdmlld0JveD0iMCAwIDUwIDUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MCA1MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogIDxwYXRoIGZpbGw9IiM3YTc2OGYiIGQ9Ik00My45MzUsMjUuMTQ1YzAtMTAuMzE4LTguMzY0LTE4LjY4My0xOC42ODMtMTguNjgzYy0xMC4zMTgsMC0xOC42ODMsOC4zNjUtMTguNjgzLDE4LjY4M2g0LjA2OGMwLTguMDcxLDYuNTQzLTE0LjYxNSwxNC42MTUtMTQuNjE1YzguMDcyLDAsMTQuNjE1LDYuNTQzLDE0LjYxNSwxNC42MTVINDMuOTM1eiI+CiAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVUeXBlPSJ4bWwiCiAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgdHlwZT0icm90YXRlIgogICAgICBmcm9tPSIwIDI1IDI1IgogICAgICB0bz0iMzYwIDI1IDI1IgogICAgICBkdXI9IjAuNnMiCiAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIi8+CiAgICA8L3BhdGg+CiAgPC9zdmc+Cg=="); -} - -.chrome-tabs .chrome-tab-title { - position: relative; - display: inline-block; - vertical-align: top; - padding: 0 0.5em; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 12px; - margin-top: 9px; - max-width: calc(100% - 5em); - pointer-events: none; -} - -.chrome-tabs .chrome-tab-close { - position: absolute; - width: 1.4em; - height: 1.4em; - border-radius: 50%; - z-index: 2; - right: 1.4em; - top: 11px; -} - -.chrome-tabs .chrome-tab-close::before { - content: url("data:image/svg+xml;utf8,"); - position: absolute; - display: block; - top: 0; - right: 0; - bottom: 0; - left: 0; -} - -.chrome-tabs .chrome-tab-close:hover::before, -.chrome-tabs .chrome-tab-close:hover:active::before { - content: url("data:image/svg+xml;utf8,"); -} - -.chrome-tabs .chrome-tab-close:hover { - background: #e25c4b; -} - -.chrome-tabs .chrome-tab-close:hover:active { - background: #b74a3b; -} - -.chrome-tabs .chrome-tab { - width: 243px -} - -.chrome-tabs .chrome-tab:nth-child(1) { - transform: translate3d(0px, 0, 0) -} - -.chrome-tabs .chrome-tab:nth-child(2) { - transform: translate3d(229px, 0, 0) -} \ No newline at end of file diff --git a/electros-ultralight/assets/chrome-tabs.js b/electros-ultralight/assets/chrome-tabs.js deleted file mode 100644 index 42e5067..0000000 --- a/electros-ultralight/assets/chrome-tabs.js +++ /dev/null @@ -1,272 +0,0 @@ -(function(){ - const isNodeContext = typeof module !== 'undefined' && typeof module.exports !== 'undefined' - if (isNodeContext) { - Draggabilly = require('draggabilly') - } - - const tabTemplate = ` -
-
-
-
-
-
-
-
- ` - - const defaultTabProperties = { - title: '', - favicon: '' - } - - let instanceId = 0 - let tabId = 0 - - class ChromeTabs { - constructor() { - this.draggabillyInstances = [] - } - - init(el, options) { - this.el = el - this.options = options - - this.instanceId = instanceId - this.el.setAttribute('data-chrome-tabs-instance-id', this.instanceId) - instanceId += 1 - - this.tabId = tabId - - this.setupStyleEl() - this.setupEvents() - this.layoutTabs() - this.fixZIndexes() - this.setupDraggabilly() - } - - emit(eventName, data) { - this.el.dispatchEvent(new CustomEvent(eventName, { detail: data })) - } - - setupStyleEl() { - this.animationStyleEl = document.createElement('style') - this.el.appendChild(this.animationStyleEl) - } - - setupEvents() { - window.addEventListener('resize', event => this.layoutTabs()) - - document.body.querySelector('#chrome-tabs-add-tab').addEventListener('click', event => this.emit('requestNewTab')) - - this.el.addEventListener('click', ({target}) => { - if (target.classList.contains('chrome-tab')) { - this.setCurrentTab(target) - } else if (target.classList.contains('chrome-tab-close')) { - this.emit('requestTabClose', {tabEl: target.parentNode}) - } else if (target.classList.contains('chrome-tab-title') || target.classList.contains('chrome-tab-favicon')) { - this.setCurrentTab(target.parentNode) - } - }) - } - - get tabEls() { - return Array.prototype.slice.call(this.el.querySelectorAll('.chrome-tab')) - } - - get tabContentEl() { - return this.el.querySelector('.chrome-tabs-content') - } - - get tabWidth() { - const tabsContentWidth = this.tabContentEl.clientWidth - this.options.tabOverlapDistance - const width = (tabsContentWidth / this.tabEls.length) + this.options.tabOverlapDistance - return Math.max(this.options.minWidth, Math.min(this.options.maxWidth, width)) - } - - get tabEffectiveWidth() { - return this.tabWidth - this.options.tabOverlapDistance - } - - get tabPositions() { - const tabEffectiveWidth = this.tabEffectiveWidth - let left = 0 - let positions = [] - - this.tabEls.forEach((tabEl, i) => { - positions.push(left) - left += tabEffectiveWidth - }) - return positions - } - - layoutTabs() { - const tabWidth = this.tabWidth - - this.cleanUpPreviouslyDraggedTabs() - this.tabEls.forEach((tabEl) => tabEl.style.width = tabWidth + 'px') - requestAnimationFrame(() => { - let styleHTML = '' - this.tabPositions.forEach((left, i) => { - styleHTML += ` - .chrome-tabs[data-chrome-tabs-instance-id="${ this.instanceId }"] .chrome-tab:nth-child(${ i + 1}) { - transform: translate3d(${ left }px, 0, 0) - } - ` - }) - this.animationStyleEl.innerHTML = styleHTML - }) - } - - fixZIndexes() { - const bottomBarEl = this.el.querySelector('.chrome-tabs-bottom-bar') - const tabEls = this.tabEls - - tabEls.forEach((tabEl, i) => { - let zIndex = tabEls.length - i - - if (tabEl.classList.contains('chrome-tab-current')) { - bottomBarEl.style.zIndex = tabEls.length + 1 - zIndex = tabEls.length + 2 - } - tabEl.style.zIndex = zIndex - }) - } - - createNewTabEl() { - const div = document.createElement('div') - div.innerHTML = tabTemplate - - return div.firstElementChild - } - - addTab(tabProperties) { - const tabEl = this.createNewTabEl() - - tabEl.setAttribute('data-tab-id', tabProperties.id) - - tabEl.classList.add('chrome-tab-just-added') - setTimeout(() => tabEl.classList.remove('chrome-tab-just-added'), 500) - - tabProperties = Object.assign({}, defaultTabProperties, tabProperties) - this.tabContentEl.appendChild(tabEl) - this.updateTab(tabEl, tabProperties) - this.emit('tabAdd', { tabEl }) - this.setCurrentTab(tabEl) - this.layoutTabs() - this.fixZIndexes() - this.setupDraggabilly() - } - - setCurrentTab(tabEl) { - const currentTab = this.el.querySelector('.chrome-tab-current') - if (currentTab) currentTab.classList.remove('chrome-tab-current') - tabEl.classList.add('chrome-tab-current') - this.fixZIndexes() - this.emit('activeTabChange', { tabEl }) - } - - removeTab(tabEl) { - if (tabEl.classList.contains('chrome-tab-current')) { - if (tabEl.previousElementSibling) { - this.setCurrentTab(tabEl.previousElementSibling) - } else if (tabEl.nextElementSibling) { - this.setCurrentTab(tabEl.nextElementSibling) - } - } - tabEl.parentNode.removeChild(tabEl) - this.emit('tabRemove', { tabEl }) - this.layoutTabs() - this.fixZIndexes() - this.setupDraggabilly() - } - - updateTab(tabEl, tabProperties) { - tabEl.querySelector('.chrome-tab-title').textContent = tabProperties.title - tabEl.querySelector('.chrome-tab-favicon').style.backgroundImage = `url('${tabProperties.favicon}')` - tabEl.querySelector('.chrome-tab-favicon').style.display = tabProperties.loading ? 'none' : 'inline-block' - tabEl.querySelector('.chrome-tab-spinner').style.display = tabProperties.loading ? 'inline-block' : 'none' - } - - cleanUpPreviouslyDraggedTabs() { - this.tabEls.forEach((tabEl) => tabEl.classList.remove('chrome-tab-just-dragged')) - } - - setupDraggabilly() { - const tabEls = this.tabEls - const tabEffectiveWidth = this.tabEffectiveWidth - const tabPositions = this.tabPositions - - this.draggabillyInstances.forEach(draggabillyInstance => draggabillyInstance.destroy()) - - tabEls.forEach((tabEl, originalIndex) => { - const originalTabPositionX = tabPositions[originalIndex] - const draggabillyInstance = new Draggabilly(tabEl, { - axis: 'x', - containment: this.tabContentEl - }) - - this.draggabillyInstances.push(draggabillyInstance) - - draggabillyInstance.on('dragStart', () => { - this.cleanUpPreviouslyDraggedTabs() - tabEl.classList.add('chrome-tab-currently-dragged') - this.el.classList.add('chrome-tabs-sorting') - this.fixZIndexes() - }) - - draggabillyInstance.on('dragEnd', () => { - const finalTranslateX = parseFloat(tabEl.style.left, 10) - tabEl.style.transform = `translate3d(0, 0, 0)` - - // Animate dragged tab back into its place - requestAnimationFrame(() => { - tabEl.style.left = '0' - tabEl.style.transform = `translate3d(${ finalTranslateX }px, 0, 0)` - - requestAnimationFrame(() => { - tabEl.classList.remove('chrome-tab-currently-dragged') - this.el.classList.remove('chrome-tabs-sorting') - - this.setCurrentTab(tabEl) - tabEl.classList.add('chrome-tab-just-dragged') - - requestAnimationFrame(() => { - tabEl.style.transform = '' - - this.setupDraggabilly() - }) - }) - }) - }) - - draggabillyInstance.on('dragMove', (event, pointer, moveVector) => { - // Current index be computed within the event since it can change during the dragMove - const tabEls = this.tabEls - const currentIndex = tabEls.indexOf(tabEl) - - const currentTabPositionX = originalTabPositionX + moveVector.x - const destinationIndex = Math.max(0, Math.min(tabEls.length, Math.floor((currentTabPositionX + (tabEffectiveWidth / 2)) / tabEffectiveWidth))) - - if (currentIndex !== destinationIndex) { - this.animateTabMove(tabEl, currentIndex, destinationIndex) - } - }) - }) - } - - animateTabMove(tabEl, originIndex, destinationIndex) { - if (destinationIndex < originIndex) { - tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex]) - } else { - tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex + 1]) - } - } - } - - if (isNodeContext) { - module.exports = ChromeTabs - } else { - window.ChromeTabs = ChromeTabs - } -})() diff --git a/electros-ultralight/assets/draggabilly.pkgd.min.js b/electros-ultralight/assets/draggabilly.pkgd.min.js deleted file mode 100644 index 5a796b0..0000000 --- a/electros-ultralight/assets/draggabilly.pkgd.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Draggabilly PACKAGED v2.1.1 - * Make that shiz draggable - * http://draggabilly.desandro.com - * MIT license - */ - -!function(t,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(e){i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("jquery")):t.jQueryBridget=i(t,t.jQuery)}(window,function(t,i){function e(e,r,a){function d(t,i,n){var o,r="$()."+e+'("'+i+'")';return t.each(function(t,d){var h=a.data(d,e);if(!h)return void s(e+" not initialized. Cannot call methods, i.e. "+r);var u=h[i];if(!u||"_"==i.charAt(0))return void s(r+" is not a valid method");var c=u.apply(h,n);o=void 0===o?c:o}),void 0!==o?o:t}function h(t,i){t.each(function(t,n){var o=a.data(n,e);o?(o.option(i),o._init()):(o=new r(n,i),a.data(n,e,o))})}a=a||i||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[e]=function(t){if("string"==typeof t){var i=o.call(arguments,1);return d(this,t,i)}return h(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=e)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(i||t.jQuery),e}),function(t,i){"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return i()}):"object"==typeof module&&module.exports?module.exports=i():t.getSize=i()}(window,function(){function t(t){var i=parseFloat(t),e=-1==t.indexOf("%")&&!isNaN(i);return e&&i}function i(){}function e(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;h>i;i++){var e=d[i];t[e]=0}return t}function n(t){var i=getComputedStyle(t);return i||a("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),i}function o(){if(!u){u=!0;var i=document.createElement("div");i.style.width="200px",i.style.padding="1px 2px 3px 4px",i.style.borderStyle="solid",i.style.borderWidth="1px 2px 3px 4px",i.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(i);var o=n(i);r.isBoxSizeOuter=s=200==t(o.width),e.removeChild(i)}}function r(i){if(o(),"string"==typeof i&&(i=document.querySelector(i)),i&&"object"==typeof i&&i.nodeType){var r=n(i);if("none"==r.display)return e();var a={};a.width=i.offsetWidth,a.height=i.offsetHeight;for(var u=a.isBorderBox="border-box"==r.boxSizing,c=0;h>c;c++){var p=d[c],f=r[p],g=parseFloat(f);a[p]=isNaN(g)?0:g}var l=a.paddingLeft+a.paddingRight,v=a.paddingTop+a.paddingBottom,m=a.marginLeft+a.marginRight,y=a.marginTop+a.marginBottom,b=a.borderLeftWidth+a.borderRightWidth,P=a.borderTopWidth+a.borderBottomWidth,E=u&&s,_=t(r.width);_!==!1&&(a.width=_+(E?0:l+b));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:v+P)),a.innerWidth=a.width-(l+b),a.innerHeight=a.height-(v+P),a.outerWidth=a.width+m,a.outerHeight=a.height+y,a}}var s,a="undefined"==typeof console?i:function(t){console.error(t)},d=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=d.length,u=!1;return r}),function(t,i){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",i):"object"==typeof module&&module.exports?module.exports=i():t.EvEmitter=i()}("undefined"!=typeof window?window:this,function(){function t(){}var i=t.prototype;return i.on=function(t,i){if(t&&i){var e=this._events=this._events||{},n=e[t]=e[t]||[];return-1==n.indexOf(i)&&n.push(i),this}},i.once=function(t,i){if(t&&i){this.on(t,i);var e=this._onceEvents=this._onceEvents||{},n=e[t]=e[t]||{};return n[i]=!0,this}},i.off=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){var n=e.indexOf(i);return-1!=n&&e.splice(n,1),this}},i.emitEvent=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){var n=0,o=e[n];i=i||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,i),n+=s?0:1,o=e[n]}return this}},t}),function(t,i){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("ev-emitter")):t.Unipointer=i(t,t.EvEmitter)}(window,function(t,i){function e(){}function n(){}var o=n.prototype=Object.create(i.prototype);o.bindStartEvent=function(t){this._bindStartEvent(t,!0)},o.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},o._bindStartEvent=function(i,e){e=void 0===e?!0:!!e;var n=e?"addEventListener":"removeEventListener";t.navigator.pointerEnabled?i[n]("pointerdown",this):t.navigator.msPointerEnabled?i[n]("MSPointerDown",this):(i[n]("mousedown",this),i[n]("touchstart",this))},o.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},o.getTouch=function(t){for(var i=0;i3||Math.abs(t.y)>3},o.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]),this._dragPointerUp(t,i)},o._dragPointerUp=function(t,i){this.isDragging?this._dragEnd(t,i):this._staticClick(t,i)},o._dragStart=function(t,e){this.isDragging=!0,this.dragStartPoint=i.getPointerPoint(e),this.isPreventingClicks=!0,this.dragStart(t,e)},o.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])},o._dragMove=function(t,i,e){this.isDragging&&this.dragMove(t,i,e)},o.dragMove=function(t,i,e){t.preventDefault(),this.emitEvent("dragMove",[t,i,e])},o._dragEnd=function(t,i){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,i)},o.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])},o.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},o._staticClick=function(t,i){if(!this.isIgnoringMouseUp||"mouseup"!=t.type){var e=t.target.nodeName;("INPUT"==e||"TEXTAREA"==e)&&t.target.focus(),this.staticClick(t,i),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400))}},o.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])},n.getPointerPoint=i.getPointerPoint,n}),function(t,i){"function"==typeof define&&define.amd?define(["get-size/get-size","unidragger/unidragger"],function(e,n){return i(t,e,n)}):"object"==typeof module&&module.exports?module.exports=i(t,require("get-size"),require("unidragger")):t.Draggabilly=i(t,t.getSize,t.Unidragger)}(window,function(t,i,e){function n(){}function o(t,i){for(var e in i)t[e]=i[e];return t}function r(t){return t instanceof HTMLElement}function s(t,i){this.element="string"==typeof t?d.querySelector(t):t,f&&(this.$element=f(this.element)),this.options=o({},this.constructor.defaults),this.option(i),this._create()}function a(t,i,e){return e=e||"round",i?Math[e](t/i)*i:t}var d=t.document,h=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame,u=0;h||(h=function(t){var i=(new Date).getTime(),e=Math.max(0,16-(i-u)),n=setTimeout(t,e);return u=i+e,n});var c=d.documentElement,p="string"==typeof c.style.transform?"transform":"WebkitTransform",f=t.jQuery,g=s.prototype=Object.create(e.prototype);s.defaults={},g.option=function(t){o(this.options,t)};var l={relative:!0,absolute:!0,fixed:!0};return g._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=o({},this.position);var t=getComputedStyle(this.element);l[t.position]||(this.element.style.position="relative"),this.enable(),this.setHandles()},g.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},g.dispatchEvent=function(i,e,n){var o=[e].concat(n);this.emitEvent(i,o);var r=t.jQuery;if(r&&this.$element)if(e){var s=r.Event(e);s.type=i,this.$element.trigger(s,n)}else this.$element.trigger(i,n)},g._getPosition=function(){var t=getComputedStyle(this.element),i=this._getPositionCoord(t.left,"width"),e=this._getPositionCoord(t.top,"height");this.position.x=isNaN(i)?0:i,this.position.y=isNaN(e)?0:e,this._addTransformPosition(t)},g._getPositionCoord=function(t,e){if(-1!=t.indexOf("%")){var n=i(this.element.parentNode);return n?parseFloat(t)/100*n[e]:0}return parseInt(t,10)},g._addTransformPosition=function(t){var i=t[p];if(0===i.indexOf("matrix")){var e=i.split(","),n=0===i.indexOf("matrix3d")?12:4,o=parseInt(e[n],10),r=parseInt(e[n+1],10);this.position.x+=o,this.position.y+=r}},g.pointerDown=function(t,i){this._dragPointerDown(t,i);var e=d.activeElement;e&&e.blur&&e!=d.body&&e.blur(),this._bindPostStartEvents(t),this.element.classList.add("is-pointer-down"),this.dispatchEvent("pointerDown",t,[i])},g.pointerMove=function(t,i){var e=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,e]),this._dragMove(t,i,e)},g.dragStart=function(t,i){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",t,[i]),this.animate())},g.measureContainment=function(){var t=this.options.containment;if(t){var e=r(t)?t:"string"==typeof t?d.querySelector(t):this.element.parentNode,n=i(this.element),o=i(e),s=this.element.getBoundingClientRect(),a=e.getBoundingClientRect(),h=o.borderLeftWidth+o.borderRightWidth,u=o.borderTopWidth+o.borderBottomWidth,c=this.relativeStartPosition={x:s.left-(a.left+o.borderLeftWidth),y:s.top-(a.top+o.borderTopWidth)};this.containSize={width:o.width-h-c.x-n.width,height:o.height-u-c.y-n.height}}},g.dragMove=function(t,i,e){if(this.isEnabled){var n=e.x,o=e.y,r=this.options.grid,s=r&&r[0],d=r&&r[1];n=a(n,s),o=a(o,d),n=this.containDrag("x",n,s),o=this.containDrag("y",o,d),n="y"==this.options.axis?0:n,o="x"==this.options.axis?0:o,this.position.x=this.startPosition.x+n,this.position.y=this.startPosition.y+o,this.dragPoint.x=n,this.dragPoint.y=o,this.dispatchEvent("dragMove",t,[i,e])}},g.containDrag=function(t,i,e){if(!this.options.containment)return i;var n="x"==t?"width":"height",o=this.relativeStartPosition[t],r=a(-o,e,"ceil"),s=this.containSize[n];return s=a(s,e,"floor"),Math.min(s,Math.max(r,i))},g.pointerUp=function(t,i){this.element.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[i]),this._dragPointerUp(t,i)},g.dragEnd=function(t,i){this.isEnabled&&(p&&(this.element.style[p]="",this.setLeftTop()),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",t,[i]))},g.animate=function(){if(this.isDragging){this.positionDrag();var t=this;h(function(){t.animate()})}},g.setLeftTop=function(){this.element.style.left=this.position.x+"px",this.element.style.top=this.position.y+"px"},g.positionDrag=function(){this.element.style[p]="translate3d( "+this.dragPoint.x+"px, "+this.dragPoint.y+"px, 0)"},g.staticClick=function(t,i){this.dispatchEvent("staticClick",t,[i])},g.enable=function(){this.isEnabled=!0},g.disable=function(){this.isEnabled=!1,this.isDragging&&this.dragEnd()},g.destroy=function(){this.disable(),this.element.style[p]="",this.element.style.left="",this.element.style.top="",this.element.style.position="",this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},g._init=n,f&&f.bridget&&f.bridget("draggabilly",s),s}); \ No newline at end of file diff --git a/electros-ultralight/assets/earth.svg b/electros-ultralight/assets/earth.svg deleted file mode 100644 index 540a029..0000000 --- a/electros-ultralight/assets/earth.svg +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/electros-ultralight/assets/electros.py b/electros-ultralight/assets/electros.py deleted file mode 100644 index c3b69d5..0000000 --- a/electros-ultralight/assets/electros.py +++ /dev/null @@ -1,116 +0,0 @@ -import eel -import requests -import os -import json - -# Set web files folder -eel.init('electros') - -@eel.expose -def python_function(x): - return f"Hello from Python! You sent: {x}" - -@eel.expose -def check_service_status(url): - try: - response = requests.get(url, timeout=5) - is_accessible = response.status_code == 200 - if is_accessible != check_service_status.last_status.get(url, None): - print(f"Service status changed for {url}: {'accessible' if is_accessible else 'inaccessible'}") - check_service_status.last_status[url] = is_accessible - return is_accessible - except requests.RequestException: - if check_service_status.last_status.get(url, None) is not False: - print(f"Service status changed for {url}: inaccessible") - check_service_status.last_status[url] = False - return False - -check_service_status.last_status = {} - -def read_configurations(): - config_path = os.path.join(os.path.expanduser('~'), '.elemento', 'settings') - hosts_path = os.path.join(os.path.expanduser('~'), '.elemento', 'hosts') - - config = {} - hosts = [] - - # Read settings - if os.path.exists(config_path): - try: - with open(config_path, 'r') as f: - config = json.load(f) - except json.JSONDecodeError: - print(f"Error: Invalid JSON in {config_path}") - except IOError: - print(f"Error: Unable to read {config_path}") - - # Read hosts - if os.path.exists(hosts_path): - try: - with open(hosts_path, 'r') as f: - hosts = f.read().splitlines() - except IOError: - print(f"Error: Unable to read {hosts_path}") - - return config, hosts - -@eel.expose -def get_configurations(): - config, hosts = read_configurations() - return {'config': config, 'hosts': hosts} - -@eel.expose -def modify_configurations(new_config, new_hosts): - - print('New Config:', new_config) - print('New Hosts:', new_hosts) - - config_path = os.path.join(os.path.expanduser('~'), '.elemento', 'settings') - hosts_path = os.path.join(os.path.expanduser('~'), '.elemento', 'hosts') - - # Update and save settings - try: - with open(config_path, 'w') as f: - json.dump(new_config, f, indent=4) - except IOError: - print(f"Error: Unable to write to {config_path}") - return False - - # Update and save hosts - try: - with open(hosts_path, 'w') as f: - f.write('\n'.join(new_hosts)) - except IOError: - print(f"Error: Unable to write to {hosts_path}") - return False - - return True - -@eel.expose -def update_configurations(config_updates, hosts_updates): - current_config, current_hosts = read_configurations() - - # Update config - current_config.update(config_updates) - - # Update hosts - current_hosts = list(set(current_hosts + hosts_updates)) - - print('Current Config:', current_config) - print('Current Hosts:', current_hosts) - - # Save the updated configurations - return modify_configurations(current_config, current_hosts) - -# Start the app with custom mode and flags -eel.start( - 'electros.html', - size=(800, 600), - mode='kiosk', # or 'chrome-app' if you prefer - port=8888, # Use any available port - cmdline_args=[ - '--disable-gpu', - '--disable-dev-shm-usage', - '--disable-frame-rate-limit' - ] -) \ No newline at end of file diff --git a/electros-ultralight/assets/logo.png b/electros-ultralight/assets/logo.png deleted file mode 100644 index a7a548f..0000000 Binary files a/electros-ultralight/assets/logo.png and /dev/null differ diff --git a/electros-ultralight/assets/release_notes.html b/electros-ultralight/assets/release_notes.html deleted file mode 100644 index 4d54e1d..0000000 --- a/electros-ultralight/assets/release_notes.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - Release Notes - - - - -
- -

Ultralight v1.3.0 Release Notes

- -

Changelog

-

Major Improvements

-
    -
  • Rewrite CPU renderer to be faster and more accurate (parallel engine built on Skia internals).
  • -
  • Add support for Xbox, PS4, and PS5 platforms.
  • -
  • Improve text rendering accuracy with more intelligent snapping and hinting.
  • -
  • Improve font scaling accuracy at various device scales.
  • -
  • Improve box-shadow rendering accuracy and performance.
  • -
  • Improve performance of layout and JavaScript execution using mimalloc.
  • -
  • Improve performance of JavaScript garbage-collector, reduce per-frame stalls.
  • -
  • Improve consistency of CPU and GPU renderers (both now blend in sRGB).
  • -
  • Add memory profiler and memory statistics tracking.
  • -
  • Add support for gamepad input devices.
  • -
  • Add support for remote web inspector.
  • -
  • Add support for multiple windows to AppCore.
  • -
  • Add support for rendering only a subset of Views.
  • -
  • Add support for dashed strokes to CPU renderer.
  • -
  • Add support for SVG onclick and other events that require path picking.
  • -
  • Add support for HTML5 Video / Audio (experimental) via GStreamer/FFmpeg (disabled by default).
  • -
  • Update user-agent string to reflect proper Safari / WebKit version.
  • -
  • Update to latest CA certificate chain.
  • -
  • Unify build scripts and toolchain.
  • -
-

Major API Changes

-
    -
  • Unify API to use RefPtr<> everywhere (instead of Ref<> class)
  • -
  • Unify API to use String everywhere (instead of String16, String8, etc.).
  • -
  • Make String class use String8 natively (utf-8 is now native representation instead of utf-16).
  • -
  • Make all enums use 'enum class'
  • -
  • Resources now load via FileSystem API instead of fopen().
  • -
  • FileSystem now required to be defined in Platform API before creating Renderer.
  • -
  • Buffer class now accomodates memory-mapped files and destruction callbacks.
  • -
  • FileSystem interface has been reorganized to use new Buffer API.
  • -
  • Portions of Config have been moved to ViewConfig (now certain options can be set per-View).
  • -
  • App::Quit() must now be called manually when using AppCore API.
  • -
  • Add Bitmap::LockPixelsSafe() and LockedPixels<> utility class to manage lifetimes.
  • -
  • Add WebKitVersionString() to query corresponding WebKit version.
  • -
  • Extend AppCore API to enable multi-window support.
  • -
  • Re-organize C API into logical header files.
  • -
  • Add Renderer::StartRemoteInspectorServer
  • -
  • Add Renderer::SetGamepadDetails
  • -
  • Add Renderer::FireGamepadEvent
  • -
  • Add Renderer::FireGamepadAxisEvent
  • -
  • Add Renderer::FireGamepadButtonEvent
  • -
  • Add Renderer::RenderOnly
  • -
  • Modify Renderer::CreateView signature (options moved to ViewConfig param)
  • -
  • Add View::device_scale
  • -
  • Add View::set_device_scale
  • -
  • Add View::is_accelerated
  • -
  • Add View::is_transparent
  • -
  • Add View::JavaScriptVM
  • -
  • Rename View::inspector to View::CreateLocalInspectorView
  • -
  • Modify View::LockJSContext return value (now returns RefPtr<> to manage lifetime)
  • -
  • Add ViewListener::OnCreateInspectorView
  • -
  • Add ViewListener::OnRequestClose
  • -
  • Add WindowListener::OnKeyEvent
  • -
  • Add WindowListener::OnMouseEvent
  • -
  • Add WindowListener::OnScrollEvent
  • -
-

Major Bugfixes

-
    -
  • Fix issue managing clip in CPU and GPU renderers.
  • -
  • Fix issue blending alpha in CPU renderer.
  • -
  • Fix issue stroking paths in CPU renderer.
  • -
  • Fix issue drawing glyphs with complex transformations.
  • -
  • Fix issue drawing radial gradients with CPU renderer.
  • -
  • Fix issue drawing gradients with more than 12 stops.
  • -
  • Fix issue running library off the main thread on macOS.
  • -
  • Fix issue rendering paths that begin with an ArcTo command.
  • -
  • Fix issue where BGRA byte order was not used on all platforms.
  • -
  • Fix issue painting dropdown menus.
  • -
  • Fix issue calculating CSS button height.
  • -
  • Fix issue displaying box-shadows on native inputs.
  • -
  • Fix issue displaying context-menu in web inspector.
  • -
  • Fix issue writing LocalStorage database on Windows.
  • -
  • Fix issue with KeyboardEvent.key in JavaScript always returning null.
  • -
  • Fix issue with LoadListener::OnBeginLoading not passing correct URL.
  • -
  • Fix issue with LoadListener::OnFailLoading not being fired on non-200 HTTP status codes.
  • -
  • Fix issue resizing windows with GPU acceleration enabled (AppCore).
  • -
  • Fix issue calling Window::SetTitle with Unicode strings (AppCore).
  • -
  • Fix issue with anti-aliasing when GPU acceleration is enabled on Linux (AppCore).
  • -
  • Fix issue with automatic DPI switching on Windows (AppCore).
  • -
  • Fix security issue allocating very large render layers.
  • -
  • Fix major performance bug in cURL network code.
  • -
  • Fix memory leak loading certain File URLs.
  • -
  • Fix memory leak when constructing JSString from JSStringRef (AppCore).
  • -
  • Fix various crashes and buffer overruns in Bitmap class.
  • -
  • Fix crash loading certain Data URLs.
  • -
  • Fix crash when Config::bitmap_alignment is 0.
  • -
  • Fix crash when encountering certain text-encodings.
  • -
  • Fix crash when encountering certain JavaScript code.
  • -
  • Fix crash in SQLite database code.
  • -
  • Fix crash at process shutdown.
  • -
- - - - -

Useful Links

-
-
Website
-
ultralig.ht
-
Support Docs
-
docs.ultralig.ht
-
C++ API
-
github.com/ultralight-ux/Ultralight-API
-
- -
- -

- Ultralight Team

-
- - - \ No newline at end of file diff --git a/electros-ultralight/assets/requirements.txt b/electros-ultralight/assets/requirements.txt deleted file mode 100644 index 9a38173..0000000 --- a/electros-ultralight/assets/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -eel -requests diff --git a/electros-ultralight/assets/spinner.svg b/electros-ultralight/assets/spinner.svg deleted file mode 100644 index 466ff9c..0000000 --- a/electros-ultralight/assets/spinner.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/electros-ultralight/assets/ui.css b/electros-ultralight/assets/ui.css deleted file mode 100644 index cb85cff..0000000 --- a/electros-ultralight/assets/ui.css +++ /dev/null @@ -1,73 +0,0 @@ -* { - overflow: hidden; - user-select: none; - -webkit-user-select: none; -} - -body { - margin: 0; - padding: 0; - font-family: "Segoe UI", -apple-system, Ubuntu, Arial, sans-serif; - font-size: 14px; - background: #16151d; - color: #c4c2d0; -} - -#bar { - background: #232330; - background: linear-gradient(0deg, #232330, #282836); - height: 32px; - padding: 4px 9px; - border-bottom: 0.8px solid #252532; - cursor: default; - display: flex; -} - -#address { - border-radius: 24px; - border: none; - height: 32px; - flex: 1; - font-size: 14px; - color: #c4c2d0; - background-color: #16151d; - display: inline-block; - padding: 2px 16px 2px 16px; - margin-top: 0px; - margin-left: 9px; - margin-right: 9px; - user-select: auto !important; - -webkit-user-select: text !important; -} - -#address:focus { - background-color: #16151d; - color: #FFF; -} - -.icon { - cursor: default; - fill: rgba(200, 200, 200, 1.0); - vertical-align: top; - margin-top: -1px; - padding: 5px; - height: 22px; -} - -#back { - margin-left: 0px; -} - -.icon.disabled { - - fill: rgb(99 96 116); -} - -svg#icon_defs path { - fill: inherit; -} - -.icon:not(.disabled):hover { - background-color: #343446; - border-radius: 100%; -} \ No newline at end of file diff --git a/electros-ultralight/assets/ui.html b/electros-ultralight/assets/ui.html deleted file mode 100644 index 6cf0f60..0000000 --- a/electros-ultralight/assets/ui.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - \ No newline at end of file diff --git a/electros-ultralight/assets/ui.js b/electros-ultralight/assets/ui.js deleted file mode 100644 index fa77f8e..0000000 --- a/electros-ultralight/assets/ui.js +++ /dev/null @@ -1,27 +0,0 @@ -function updateBack(enable) { - if (enable) - document.getElementById("back").classList.remove("disabled"); - else - document.getElementById("back").classList.add("disabled"); -} - -function updateForward(enable) { - if (enable) - document.getElementById("forward").classList.remove("disabled"); - else - document.getElementById("forward").classList.add("disabled"); -} - -function updateLoading(is_loading) { - if (is_loading) { - document.getElementById("refresh").style.display = "none"; - document.getElementById("stop").style.display = "inline-block"; - } else { - document.getElementById("refresh").style.display = "inline-block"; - document.getElementById("stop").style.display = "none"; - } -} - -function updateURL(url) { - document.getElementById('address').value = url; -} \ No newline at end of file diff --git a/electros-ultralight/build.sh b/electros-ultralight/build.sh deleted file mode 100755 index 335684f..0000000 --- a/electros-ultralight/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -echo "Building..." - -cmake -B build -cmake --build build --config Release --clean-first - -echo "Build complete!" \ No newline at end of file diff --git a/electros-ultralight/cmake/Electros.cmake b/electros-ultralight/cmake/Electros.cmake deleted file mode 100644 index 2bf6dbb..0000000 --- a/electros-ultralight/cmake/Electros.cmake +++ /dev/null @@ -1,122 +0,0 @@ -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) - -set(SDK_ROOT "${CMAKE_BINARY_DIR}/SDK/") -set(ULTRALIGHT_INCLUDE_DIR "${SDK_ROOT}/include") -set(ULTRALIGHT_BINARY_DIR "${SDK_ROOT}/bin") -set(ULTRALIGHT_RESOURCES_DIR "${SDK_ROOT}/resources") -set(ULTRALIGHT_INSPECTOR_DIR "${SDK_ROOT}/inspector") - -if (NOT PLATFORM) - if (UNIX) - if (APPLE) - set(PORT UltralightMac) - set(PLATFORM "mac") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - else () - set(PORT UltralightLinux) - set(PLATFORM "linux") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - endif () - elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") - set(PORT UltralightWin) - set(PLATFORM "win") - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/lib") - else () - message(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'") - endif () -else () - if (PLATFORM MATCHES "mac") - set(PORT UltralightMac) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - elseif (PLATFORM MATCHES "linux") - set(PORT UltralightLinux) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/bin") - elseif (PLATFORM MATCHES "win") - set(PORT UltralightWin) - set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/lib") - else () - message(FATAL_ERROR "Unknown platform '${PLATFORM}'") - endif () -endif () - -if (NOT ARCHITECTURE) - set(ARCHITECTURE "arm64") -endif() - -if(NOT VERSION) - set(VERSION "1.4.0b") -endif() - -if(NOT BASE_URL) - set(BASE_URL "ultralight-files.sfo3.cdn.digitaloceanspaces.com") -endif() - -ExternalProject_Add(UltralightSDK - URL https://${BASE_URL}/ultralight-sdk-${VERSION}-${PLATFORM}-${ARCHITECTURE}.7z - SOURCE_DIR "${SDK_ROOT}" - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) - -MACRO(ADD_APP source_list) - set(APP_NAME ${CMAKE_PROJECT_NAME}) - - include_directories("${ULTRALIGHT_INCLUDE_DIR}") - link_directories("${ULTRALIGHT_LIBRARY_DIR}") - link_libraries(UltralightCore AppCore Ultralight WebCore) - - if (PORT MATCHES "UltralightLinux") - SET(CMAKE_SKIP_BUILD_RPATH FALSE) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - SET(CMAKE_INSTALL_RPATH "$\{ORIGIN\}") - endif () - - if (PORT MATCHES "UltralightMac") - SET(CMAKE_SKIP_BUILD_RPATH FALSE) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - SET(CMAKE_INSTALL_RPATH "@executable_path/") - endif () - - add_executable(${APP_NAME} WIN32 MACOSX_BUNDLE ${source_list}) - - if (APPLE) - # Enable High-DPI on macOS through our custom Info.plist template - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Info.plist.in) - endif() - - if (MSVC) - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup") - endif() - - # Copy all binaries to target directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $) - - # Set the assets path to "/assets" or "/../Resources/assets" on macOS - if (APPLE) - set(ASSETS_PATH "$/../Resources/assets") - else () - set(ASSETS_PATH "$/assets") - endif () - - # Copy assets to assets path - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}") - - if(${ENABLE_INSPECTOR}) - # Copy inspector to assets directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_INSPECTOR_DIR}" "${ASSETS_PATH}/inspector") - endif () - - # Copy resources to assets directory - add_custom_command(TARGET ${APP_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources") - - add_dependencies(${APP_NAME} UltralightSDK) -ENDMACRO() \ No newline at end of file diff --git a/electros-ultralight/cmake/Info.plist.in b/electros-ultralight/cmake/Info.plist.in deleted file mode 100644 index b782d3b..0000000 --- a/electros-ultralight/cmake/Info.plist.in +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - true - - diff --git a/electros-ultralight/run_mac.sh b/electros-ultralight/run_mac.sh deleted file mode 100755 index 2d99510..0000000 --- a/electros-ultralight/run_mac.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -open build/Electros.app \ No newline at end of file diff --git a/electros-ultralight/src/Browser.cpp b/electros-ultralight/src/Browser.cpp deleted file mode 100644 index bc7069c..0000000 --- a/electros-ultralight/src/Browser.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "Browser.h" -#include -#include -#include - -Browser::Browser() { - Settings settings; - Config config; - config.scroll_timer_delay = 1.0 / 90.0; - app_ = App::Create(settings, config); - - window_ = Window::Create(app_->main_monitor(), 1800, 1200, false, - kWindowFlags_Resizable | kWindowFlags_Titled | kWindowFlags_Maximizable); - window_->SetTitle("Elemento Electros"); - - // Create the UI - ui_.reset(new UI(window_)); - window_->set_listener(ui_.get()); -} - -Browser::~Browser() { - window_->set_listener(nullptr); - - ui_.reset(); - - window_ = nullptr; - app_ = nullptr; -} - -void Browser::Run() { - app_->Run(); -} diff --git a/electros-ultralight/src/Browser.h b/electros-ultralight/src/Browser.h deleted file mode 100644 index 8b23e14..0000000 --- a/electros-ultralight/src/Browser.h +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include "UI.h" - -using namespace ultralight; - -class Browser { -public: - Browser(); - virtual ~Browser(); - - virtual void Run(); - -protected: - RefPtr app_; - RefPtr window_; - std::unique_ptr ui_; -}; diff --git a/electros-ultralight/src/Tab.cpp b/electros-ultralight/src/Tab.cpp deleted file mode 100644 index 2a3c8f7..0000000 --- a/electros-ultralight/src/Tab.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "Tab.h" -#include "UI.h" -#include -#include - -#define INSPECTOR_DRAG_HANDLE_HEIGHT 10 - -Tab::Tab(UI* ui, uint64_t id, uint32_t width, uint32_t height, int x, int y) - : ui_(ui), id_(id), container_width_(width), container_height_(height) { - overlay_ = Overlay::Create(ui->window_, width, height, x, y); - view()->set_view_listener(this); - view()->set_load_listener(this); -} - -Tab::~Tab() { - view()->set_view_listener(nullptr); - view()->set_load_listener(nullptr); -} - -void Tab::Show() { - overlay_->Show(); - overlay_->Focus(); - - if (inspector_overlay_) - inspector_overlay_->Show(); -} - -void Tab::Hide() { - overlay_->Hide(); - overlay_->Unfocus(); - - if (inspector_overlay_) - inspector_overlay_->Hide(); -} - -void Tab::ToggleInspector() { - if (!inspector_overlay_) { - view()->CreateLocalInspectorView(); - } else { - if (inspector_overlay_->is_hidden()) { - inspector_overlay_->Show(); - } else { - inspector_overlay_->Hide(); - } - } - - // Force resize to update layout -} - - -bool Tab::IsInspectorShowing() const { - if (!inspector_overlay_) - return false; - - return !inspector_overlay_->is_hidden(); -} - -IntRect Tab::GetInspectorResizeDragHandle() const { - if (!IsInspectorShowing()) - return IntRect::MakeEmpty(); - - int drag_handle_height_px = (uint32_t)std::round(INSPECTOR_DRAG_HANDLE_HEIGHT * ui_->window()->scale()); - - // This drag handle should span the width of the UI and be centered vertically at the boundary between - // the page overlay and inspector overlay. - - int drag_handle_x = (int)inspector_overlay_->x(); - int drag_handle_y = (int)inspector_overlay_->y() - drag_handle_height_px / 2; - - return { drag_handle_x, drag_handle_y, drag_handle_x + (int)inspector_overlay_->width(), - drag_handle_y + drag_handle_height_px }; -} - -int Tab::GetInspectorHeight() const { - if (inspector_overlay_) - return inspector_overlay_->height(); - - return 0; -} - -void Tab::SetInspectorHeight(int height) { - if (height > 2) { - inspector_overlay_->Resize(inspector_overlay_->width(), height); - - // Trigger a resize to perform re-layout / re-size of content overlay - Resize(container_width_, container_height_); - } -} - -void Tab::Resize(uint32_t width, uint32_t height) { - container_width_ = width; - container_height_ = height; - - uint32_t content_height = container_height_; - if (inspector_overlay_ && !inspector_overlay_->is_hidden()) { - content_height -= inspector_overlay_->height(); - } - - if (content_height < 1) - content_height = 1; - - overlay_->Resize(container_width_, content_height); - - if (inspector_overlay_ && !inspector_overlay_->is_hidden()) { - inspector_overlay_->MoveTo(0, overlay_->y() + overlay_->height()); - inspector_overlay_->Resize(container_width_, inspector_overlay_->height()); - } -} - -void Tab::OnChangeTitle(View* caller, const String& title) { - ui_->UpdateTabTitle(id_, title); -} - -void Tab::OnChangeURL(View* caller, const String& url) { - ui_->UpdateTabURL(id_, url); -} - -void Tab::OnChangeTooltip(View* caller, const String& tooltip) {} - -void Tab::OnChangeCursor(View* caller, Cursor cursor) { - if (id_ == ui_->active_tab_id_) - ui_->SetCursor(cursor); -} - -void Tab::OnAddConsoleMessage(View* caller, const ConsoleMessage& msg) { -} - -RefPtr Tab::OnCreateChildView(ultralight::View* caller, - const String& opener_url, const String& target_url, - bool is_popup, const IntRect& popup_rect) { - return ui_->CreateNewTabForChildView(target_url); -} - -RefPtr Tab::OnCreateInspectorView(ultralight::View* caller, bool is_local, - const String& inspected_url) { - if (inspector_overlay_) - return nullptr; - - inspector_overlay_ = Overlay::Create(ui_->window_, container_width_, container_height_ / 2, 0, 0); - - // Force resize to update layout - Resize(container_width_, container_height_); - inspector_overlay_->Show(); - - return inspector_overlay_->view(); -} - -void Tab::OnBeginLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} - -void Tab::OnFinishLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} - -void Tab::OnFailLoading(View* caller, uint64_t frame_id, bool is_main_frame, const String& url, - const String& description, const String& error_domain, int error_code) { - if (is_main_frame) { - char error_code_str[16]; - sprintf(error_code_str,"%d", error_code); - - String html_string = ""; - html_string += "

A Network Error was Encountered

"; - html_string += "
"; - html_string += "
URL
" + url + "
"; - html_string += "
Description
" + description + "
"; - html_string += "
Error Domain
" + error_domain + "
"; - html_string += "
Error Code
" + String(error_code_str) + "
"; - html_string += "
"; - - view()->LoadHTML(html_string); - } -} - -void Tab::OnUpdateHistory(View* caller) { - ui_->UpdateTabNavigation(id_, caller->is_loading(), caller->CanGoBack(), caller->CanGoForward()); -} diff --git a/electros-ultralight/src/Tab.h b/electros-ultralight/src/Tab.h deleted file mode 100644 index 9e4b66c..0000000 --- a/electros-ultralight/src/Tab.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once -#include -#include - -class UI; -using namespace ultralight; - -/** -* Browser Tab UI implementation. Renders the actual page content in bottom pane. -*/ -class Tab : public ViewListener, - public LoadListener { -public: - Tab(UI* ui, uint64_t id, uint32_t width, uint32_t height, int x, int y); - ~Tab(); - - void set_ready_to_close(bool ready) { ready_to_close_ = ready; } - bool ready_to_close() { return ready_to_close_; } - - RefPtr view() { return overlay_->view(); } - - void Show(); - - void Hide(); - - void ToggleInspector(); - - bool IsInspectorShowing() const; - - IntRect GetInspectorResizeDragHandle() const; - - int GetInspectorHeight() const; - - void SetInspectorHeight(int height); - - void Resize(uint32_t width, uint32_t height); - - // Inherited from Listener::View - virtual void OnChangeTitle(View* caller, const String& title) override; - virtual void OnChangeURL(View* caller, const String& url) override; - virtual void OnChangeTooltip(View* caller, const String& tooltip) override; - virtual void OnChangeCursor(View* caller, Cursor cursor) override; - virtual void OnAddConsoleMessage(View* caller, const ConsoleMessage& msg) override; - virtual RefPtr OnCreateChildView(ultralight::View* caller, - const String& opener_url, const String& target_url, - bool is_popup, const IntRect& popup_rect) override; - virtual RefPtr OnCreateInspectorView(ultralight::View* caller, bool is_local, - const String& inspected_url) override; - - // Inherited from Listener::Load - virtual void OnBeginLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - virtual void OnFinishLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - virtual void OnFailLoading(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url, const String& description, - const String& error_domain, int error_code) override; - virtual void OnUpdateHistory(View* caller) override; - -protected: - UI* ui_; - RefPtr overlay_; - RefPtr inspector_overlay_; - uint64_t id_; - bool ready_to_close_ = false; - uint32_t container_width_, container_height_; -}; diff --git a/electros-ultralight/src/UI.cpp b/electros-ultralight/src/UI.cpp deleted file mode 100644 index 5c1f868..0000000 --- a/electros-ultralight/src/UI.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#include "UI.h" - -static UI* g_ui = 0; - -#define UI_HEIGHT 80 - -UI::UI(RefPtr window) : window_(window), cur_cursor_(Cursor::kCursor_Pointer), -is_resizing_inspector_(false), is_over_inspector_resize_drag_handle_(false) { - uint32_t window_width = window_->width(); - ui_height_ = (uint32_t)std::round(UI_HEIGHT * window_->scale()); - overlay_ = Overlay::Create(window_, window_width, ui_height_, 0, 0); - g_ui = this; - - view()->set_load_listener(this); - view()->set_view_listener(this); - view()->LoadURL("file:///ui.html"); -} - -UI::~UI() { - view()->set_load_listener(nullptr); - view()->set_view_listener(nullptr); - g_ui = nullptr; -} - -bool UI::OnKeyEvent(const ultralight::KeyEvent& evt) { - return true; -} - -bool UI::OnMouseEvent(const ultralight::MouseEvent& evt) { - if (active_tab() && active_tab()->IsInspectorShowing()) { - float x_px = std::round(evt.x * window()->scale()); - float y_px = std::round(evt.y * window()->scale()); - - if (is_resizing_inspector_) { - int resize_delta = inspector_resize_begin_mouse_y_ - y_px; - int new_inspector_height = inspector_resize_begin_height_ + resize_delta; - active_tab()->SetInspectorHeight(new_inspector_height); - - if (evt.type == MouseEvent::kType_MouseUp) { - is_resizing_inspector_ = false; - } - - return false; - } - - IntRect drag_handle = active_tab()->GetInspectorResizeDragHandle(); - - bool over_drag_handle = drag_handle.Contains(Point(x_px, y_px)); - - if (over_drag_handle && !is_over_inspector_resize_drag_handle_) { - // We entered the drag area - window()->SetCursor(Cursor::kCursor_NorthSouthResize); - is_over_inspector_resize_drag_handle_ = true; - } else if (!over_drag_handle && is_over_inspector_resize_drag_handle_) { - // We left the drag area, restore previous cursor - window()->SetCursor(cur_cursor_); - is_over_inspector_resize_drag_handle_ = false; - } - - if (over_drag_handle && evt.type == MouseEvent::kType_MouseDown && !is_resizing_inspector_) { - is_resizing_inspector_ = true; - inspector_resize_begin_mouse_y_ = y_px; - inspector_resize_begin_height_ = active_tab()->GetInspectorHeight(); - } - - return !over_drag_handle; - } - - return true; -} - -void UI::OnClose(ultralight::Window* window) { - App::instance()->Quit(); -} - -void UI::OnResize(ultralight::Window* window, uint32_t width, uint32_t height) { - int tab_height = window->height() - ui_height_; - - if (tab_height < 1) - tab_height = 1; - - overlay_->Resize(window->width(), ui_height_); - - for (auto& tab : tabs_) { - if (tab.second) - tab.second->Resize(window->width(), (uint32_t)tab_height); - } -} - -void UI::OnDOMReady(View* caller, uint64_t frame_id, bool is_main_frame, const String& url) { - // Set the context for all subsequent JS* calls - RefPtr locked_context = view()->LockJSContext(); - SetJSContext(locked_context->ctx()); - - JSObject global = JSGlobalObject(); - updateBack = global["updateBack"]; - updateForward = global["updateForward"]; - updateLoading = global["updateLoading"]; - updateURL = global["updateURL"]; - addTab = global["addTab"]; - updateTab = global["updateTab"]; - closeTab = global["closeTab"]; - - global["OnBack"] = BindJSCallback(&UI::OnBack); - global["OnForward"] = BindJSCallback(&UI::OnForward); - global["OnRefresh"] = BindJSCallback(&UI::OnRefresh); - global["OnStop"] = BindJSCallback(&UI::OnStop); - global["OnToggleTools"] = BindJSCallback(&UI::OnToggleTools); - global["OnRequestNewTab"] = BindJSCallback(&UI::OnRequestNewTab); - global["OnRequestTabClose"] = BindJSCallback(&UI::OnRequestTabClose); - global["OnActiveTabChange"] = BindJSCallback(&UI::OnActiveTabChange); - global["OnRequestChangeURL"] = BindJSCallback(&UI::OnRequestChangeURL); - - CreateNewTab(); -} - -void UI::OnBack(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->GoBack(); -} - -void UI::OnForward(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->GoForward(); -} - -void UI::OnRefresh(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->Reload(); -} - -void UI::OnStop(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->view()->Stop(); -} - -void UI::OnToggleTools(const JSObject& obj, const JSArgs& args) { - if (active_tab()) - active_tab()->ToggleInspector(); -} - -void UI::OnRequestNewTab(const JSObject& obj, const JSArgs& args) { - CreateNewTab(); -} - -void UI::OnRequestTabClose(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - uint64_t id = args[0]; - - auto& tab = tabs_[id]; - if (!tab) - return; - - if (tabs_.size() == 1 && App::instance()) - App::instance()->Quit(); - - if (id != active_tab_id_) { - tabs_[id].reset(); - tabs_.erase(id); - } - else { - tab->set_ready_to_close(true); - } - - RefPtr lock(view()->LockJSContext()); - closeTab({ id }); - } -} - -void UI::OnActiveTabChange(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - uint64_t id = args[0]; - - if (id == active_tab_id_) - return; - - auto& tab = tabs_[id]; - if (!tab) - return; - - tabs_[active_tab_id_]->Hide(); - - if (tabs_[active_tab_id_]->ready_to_close()) { - tabs_[active_tab_id_].reset(); - tabs_.erase(active_tab_id_); - } - - active_tab_id_ = id; - tabs_[active_tab_id_]->Show(); - - auto tab_view = tabs_[active_tab_id_]->view(); - SetLoading(tab_view->is_loading()); - SetCanGoBack(tab_view->CanGoBack()); - SetCanGoForward(tab_view->CanGoBack()); - SetURL(tab_view->url()); - } -} - -void UI::OnRequestChangeURL(const JSObject& obj, const JSArgs& args) { - if (args.size() == 1) { - ultralight::String url = args[0]; - - if (!tabs_.empty()) { - auto& tab = tabs_[active_tab_id_]; - tab->view()->LoadURL(url); - } - } -} - -void UI::CreateNewTab() { - uint64_t id = tab_id_counter_++; - RefPtr window = window_; - int tab_height = window->height() - ui_height_; - if (tab_height < 1) - tab_height = 1; - tabs_[id].reset(new Tab(this, id, window->width(), (uint32_t)tab_height, 0, ui_height_)); - tabs_[id]->view()->LoadURL("file:///electros/electros/electros.html"); - - RefPtr lock(view()->LockJSContext()); - addTab({ id, "New Tab", "", tabs_[id]->view()->is_loading() }); -} - -RefPtr UI::CreateNewTabForChildView(const String& url) { - uint64_t id = tab_id_counter_++; - RefPtr window = window_; - int tab_height = window->height() - ui_height_; - if (tab_height < 1) - tab_height = 1; - tabs_[id].reset(new Tab(this, id, window->width(), (uint32_t)tab_height, 0, ui_height_)); - - RefPtr lock(view()->LockJSContext()); - addTab({ id, "", url, tabs_[id]->view()->is_loading() }); - - return tabs_[id]->view(); -} - -void UI::UpdateTabTitle(uint64_t id, const ultralight::String& title) { - RefPtr lock(view()->LockJSContext()); - updateTab({ id, title, "", tabs_[id]->view()->is_loading() }); -} - -void UI::UpdateTabURL(uint64_t id, const ultralight::String& url) { - if (id == active_tab_id_ && !tabs_.empty()) - SetURL(url); -} - -void UI::UpdateTabNavigation(uint64_t id, bool is_loading, bool can_go_back, bool can_go_forward) { - if (tabs_.empty()) - return; - - RefPtr lock(view()->LockJSContext()); - updateTab({ id, tabs_[id]->view()->title(), "", tabs_[id]->view()->is_loading() }); - - if (id == active_tab_id_) { - SetLoading(is_loading); - SetCanGoBack(can_go_back); - SetCanGoForward(can_go_forward); - } -} - -void UI::SetLoading(bool is_loading) { - RefPtr lock(view()->LockJSContext()); - updateLoading({ is_loading }); -} - -void UI::SetCanGoBack(bool can_go_back) { - RefPtr lock(view()->LockJSContext()); - updateBack({ can_go_back }); -} - -void UI::SetCanGoForward(bool can_go_forward) { - RefPtr lock(view()->LockJSContext()); - updateForward({ can_go_forward }); -} - -void UI::SetURL(const ultralight::String& url) { - RefPtr lock(view()->LockJSContext()); - updateURL({ url }); -} - -void UI::SetCursor(ultralight::Cursor cursor) { - if (App::instance()) - window_->SetCursor(cursor); -} diff --git a/electros-ultralight/src/UI.h b/electros-ultralight/src/UI.h deleted file mode 100644 index 3944903..0000000 --- a/electros-ultralight/src/UI.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once -#include -#include "Tab.h" -#include -#include - -using ultralight::JSObject; -using ultralight::JSArgs; -using ultralight::JSFunction; -using namespace ultralight; - -class Console; - -/** -* Browser UI implementation. Renders the toolbar/addressbar/tabs in top pane. -*/ -class UI : public WindowListener, - public LoadListener, - public ViewListener { - public: - UI(RefPtr window); - ~UI(); - - // Inherited from WindowListener - virtual bool OnKeyEvent(const ultralight::KeyEvent& evt) override; - virtual bool OnMouseEvent(const ultralight::MouseEvent& evt) override; - virtual void OnClose(ultralight::Window* window) override; - virtual void OnResize(ultralight::Window* window, uint32_t width, uint32_t height) override; - - // Inherited from LoadListener - virtual void OnDOMReady(View* caller, uint64_t frame_id, - bool is_main_frame, const String& url) override; - - // Inherited from ViewListener - virtual void OnChangeCursor(ultralight::View* caller, Cursor cursor) override { SetCursor(cursor); } - - // Called by UI JavaScript - void OnBack(const JSObject& obj, const JSArgs& args); - void OnForward(const JSObject& obj, const JSArgs& args); - void OnRefresh(const JSObject& obj, const JSArgs& args); - void OnStop(const JSObject& obj, const JSArgs& args); - void OnToggleTools(const JSObject& obj, const JSArgs& args); - void OnRequestNewTab(const JSObject& obj, const JSArgs& args); - void OnRequestTabClose(const JSObject& obj, const JSArgs& args); - void OnActiveTabChange(const JSObject& obj, const JSArgs& args); - void OnRequestChangeURL(const JSObject& obj, const JSArgs& args); - - RefPtr window() { return window_; } - -protected: - void CreateNewTab(); - RefPtr CreateNewTabForChildView(const String& url); - void UpdateTabTitle(uint64_t id, const String& title); - void UpdateTabURL(uint64_t id, const String& url); - void UpdateTabNavigation(uint64_t id, bool is_loading, bool can_go_back, bool can_go_forward); - - void SetLoading(bool is_loading); - void SetCanGoBack(bool can_go_back); - void SetCanGoForward(bool can_go_forward); - void SetURL(const String& url); - void SetCursor(Cursor cursor); - - Tab* active_tab() { return tabs_.empty() ? nullptr : tabs_[active_tab_id_].get(); } - - RefPtr view() { return overlay_->view(); } - - RefPtr window_; - RefPtr overlay_; - int ui_height_; - int tab_height_; - float scale_; - - std::map> tabs_; - uint64_t active_tab_id_ = 0; - uint64_t tab_id_counter_ = 0; - Cursor cur_cursor_; - bool is_resizing_inspector_; - bool is_over_inspector_resize_drag_handle_; - int inspector_resize_begin_height_; - int inspector_resize_begin_mouse_y_; - - JSFunction updateBack; - JSFunction updateForward; - JSFunction updateLoading; - JSFunction updateURL; - JSFunction addTab; - JSFunction updateTab; - JSFunction closeTab; - - friend class Tab; -}; diff --git a/electros-ultralight/src/main.cpp b/electros-ultralight/src/main.cpp deleted file mode 100644 index c556b90..0000000 --- a/electros-ultralight/src/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Browser.h" - -#define ENABLE_PAUSE_FOR_DEBUGGER 0 - -#if defined(_WIN32) && ENABLE_PAUSE_FOR_DEBUGGER -#include -void PauseForDebugger() { MessageBoxA(NULL, "Pause", "Caption", MB_OKCANCEL); } -#else -void PauseForDebugger() { } -#endif - -int main() { - PauseForDebugger(); - - Browser browser; - browser.Run(); - return 0; -} diff --git a/elemento-gui-new b/elemento-gui-new index 18f7d50..806be7b 160000 --- a/elemento-gui-new +++ b/elemento-gui-new @@ -1 +1 @@ -Subproject commit 18f7d50bed6fe9d508d900f9b32beba80697029b +Subproject commit 806be7be99bb200a45c64b6e9d9c27fc9877532c