✨ Feature(custom): optimize i18n and platform funcs
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="referrer" content="never">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>PicList</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but piclist-new doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
|
||||
# require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212)
|
||||
command -v xclip >/dev/null 2>&1 || { echo >&1 "no xclip"; exit 1; }
|
||||
# write image in clipboard to file (see http://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file)
|
||||
filePath=`xclip -selection clipboard -o 2>/dev/null | grep ^file:// | cut -c8-`
|
||||
if [ ! -n "$filePath" ] ;then
|
||||
if
|
||||
xclip -selection clipboard -target image/png -o >/dev/null 2>&1
|
||||
then
|
||||
xclip -selection clipboard -target image/png -o >$1 2>/dev/null
|
||||
echo $1
|
||||
else
|
||||
echo "no image"
|
||||
fi
|
||||
else
|
||||
echo $filePath
|
||||
fi
|
||||
elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||
command -v wl-copy >/dev/null 2>&1 || { echo >&1 "no wl-clipboard"; exit 1; }
|
||||
filePath=`wl-copy -o 2>/dev/null | grep ^file:// | cut -c8-`
|
||||
if [ ! -n "$filePath" ] ;then
|
||||
if
|
||||
wl-copy -t image/png -o >/dev/null 2>&1
|
||||
then
|
||||
wl-copy -t image/png image/png -o >$1 2>/dev/null
|
||||
echo $1
|
||||
else
|
||||
echo "no image"
|
||||
fi
|
||||
else
|
||||
echo $filePath
|
||||
fi
|
||||
fi
|
||||
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 639 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 645 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 823 B |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 777 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,26 +0,0 @@
|
||||
|
||||
param($imagePath)
|
||||
|
||||
# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
|
||||
|
||||
Add-Type -Assembly PresentationCore
|
||||
$img = [Windows.Clipboard]::GetImage()
|
||||
|
||||
if ($img -eq $null) {
|
||||
"no image"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
if (-not $imagePath) {
|
||||
"no image"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
|
||||
$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
|
||||
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
|
||||
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
|
||||
$encoder.Save($stream) | out-null
|
||||
$stream.Dispose() | out-null
|
||||
|
||||
$imagePath
|
||||
@@ -1,45 +0,0 @@
|
||||
# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
|
||||
param($imagePath)
|
||||
|
||||
# https://github.com/PowerShell/PowerShell/issues/7233
|
||||
# fix the output encoding bug
|
||||
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
|
||||
Add-Type -Assembly PresentationCore
|
||||
function main {
|
||||
$img = [Windows.Clipboard]::GetImage()
|
||||
|
||||
if ($img -eq $null) {
|
||||
"no image"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
if (-not $imagePath) {
|
||||
"no image"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
|
||||
$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
|
||||
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
|
||||
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
|
||||
$encoder.Save($stream) | out-null
|
||||
$stream.Dispose() | out-null
|
||||
|
||||
$imagePath
|
||||
Exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
# For WIN10
|
||||
$file = Get-Clipboard -Format FileDropList
|
||||
if ($file -ne $null) {
|
||||
Convert-Path $file
|
||||
Exit 1
|
||||
}
|
||||
} catch {
|
||||
# For WIN7 WIN8 WIN10
|
||||
main
|
||||
}
|
||||
|
||||
main
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# grab the paths
|
||||
scriptPath=$(echo $0 | awk '{ print substr( $0, 1, length($0)-6 ) }')"windows10.ps1"
|
||||
imagePath=$(echo $1 | awk '{ print substr( $0, 1, length($0)-18 ) }')
|
||||
imageName=$(echo $1 | awk '{ print substr( $0, length($0)-17, length($0) ) }')
|
||||
|
||||
# run the powershell script
|
||||
res=$(powershell.exe -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -file $(wslpath -w $scriptPath) $(wslpath -w $imagePath)"\\"$imageName)
|
||||
|
||||
# note that there is a return symbol in powershell result
|
||||
noImage=$(echo "no image\r")
|
||||
|
||||
# check whether image exists
|
||||
if [ "$res" = "$noImage" ] ;then
|
||||
echo "no image"
|
||||
else
|
||||
echo $(wslpath -u $res)
|
||||
fi
|
||||