-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into maintable-beta
- Loading branch information
Showing
24 changed files
with
550 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
pushd %~dp0 | ||
@powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File ".\JabRef.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Respond($response) { | ||
$jsonResponse = $response | ConvertTo-Json | ||
|
||
try { | ||
$writer = New-Object System.IO.BinaryWriter([System.Console]::OpenStandardOutput()) | ||
$writer.Write([int]$jsonResponse.Length) | ||
$writer.Write([System.Text.Encoding]::UTF8.GetBytes($jsonResponse)) | ||
$writer.Close() | ||
} finally { | ||
$writer.Dispose() | ||
} | ||
} | ||
|
||
$jabRefJarFileName = "@jabRefJarFileName@" | ||
$jabRefJar = [System.IO.Path]::Combine($PSScriptRoot, $jabRefJarFileName) | ||
|
||
try { | ||
$reader = New-Object System.IO.BinaryReader([System.Console]::OpenStandardInput()) | ||
$length = $reader.ReadInt32() | ||
$messageRaw = [System.Text.Encoding]::UTF8.GetString($reader.ReadBytes($length)) | ||
$message = $messageRaw | ConvertFrom-Json | ||
|
||
if ($message.Status -eq "validate") { | ||
if (-not (Test-Path $jabRefJar)) { | ||
return Respond @{message="jarNotFound";path=$jabRefJar} | ||
} else { | ||
return Respond @{message="jarFound"} | ||
} | ||
} | ||
|
||
if (-not (Test-Path $jabRefJar)) { | ||
$wshell = New-Object -ComObject Wscript.Shell | ||
$popup = "Unable to locate '$jabRefJarFileName' in '$([System.IO.Path]::GetDirectoryName($jabRefJar))'." | ||
$wshell.Popup($popup,0,"JabRef", 0x0 + 0x30) | ||
return | ||
} | ||
|
||
#$wshell = New-Object -ComObject Wscript.Shell | ||
#$wshell.Popup($message.Text,0,"JabRef", 0x0 + 0x30) | ||
|
||
$messageText = $message.Text | ||
$output = & java -jar $jabRefJar -importBibtex "$messageText" 2>&1 | ||
#$output = & echoargs -importBibtex $messageText 2>&1 | ||
#$wshell.Popup($output,0,"JabRef", 0x0 + 0x30) | ||
return Respond @{message="ok";output="$output"} | ||
} finally { | ||
$reader.Dispose() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "org.jabref.jabref", | ||
"description": "JabRef", | ||
"path": "JabRef.bat", | ||
"type": "stdio", | ||
"allowed_extensions": [ | ||
"@jabfox" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.