feat(ppre): updating extension and its dependencies

This commit is contained in:
Jakub Jezek 2020-04-03 20:18:19 +02:00
parent 0c6a078445
commit 21197ec58a
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
26 changed files with 3301 additions and 7193 deletions

View file

@ -2,16 +2,19 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Avalon</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
<meta charset="utf-8">
<title>Avalon</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body onLoad="onLoaded()">
</body>
<script src="js/app.js"></script>
<script src="js/json2.js"></script>
<script src="./js/app.js"></script>
<script src="./js/json2.js"></script>
<script src="./js/CSInterface.js"></script>
<script src="./js/CEPEngine_extensions.js"></script>
<script src="./js/Vulcan.js"></script>
</html>

View file

@ -0,0 +1,699 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2018 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
// This is the JavaScript code for bridging to native functionality
// See CEPEngine_extensions.cpp for implementation of native methods.
//
// Note: So far all native file i/o functions are synchronous, and aynchronous file i/o is TBD.
/** Version v9.0.0 */
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, native */
var cep;
if (!cep) {
cep = {};
}
if (!cep.fs) {
cep.fs = {};
}
if (!cep.process) {
cep.process = {};
}
if (!cep.encoding) {
cep.encoding = {};
}
if (!cep.util) {
cep.util = {};
}
(function () {
// Internal function to get the last error code.
native function GetLastError();
function getLastError() {
return GetLastError();
}
function getErrorResult(){
var result = {err: getLastError()};
return result;
}
// Error values. These MUST be in sync with the error values
// at the top of CEPEngine_extensions.cpp
/**
* @constant No error.
*/
cep.fs.NO_ERROR = 0;
/**
* @constant Unknown error occurred.
*/
cep.fs.ERR_UNKNOWN = 1;
/**
* @constant Invalid parameters passed to function.
*/
cep.fs.ERR_INVALID_PARAMS = 2;
/**
* @constant File or directory was not found.
*/
cep.fs.ERR_NOT_FOUND = 3;
/**
* @constant File or directory could not be read.
*/
cep.fs.ERR_CANT_READ = 4;
/**
* @constant An unsupported encoding value was specified.
*/
cep.fs.ERR_UNSUPPORTED_ENCODING = 5;
/**
* @constant File could not be written.
*/
cep.fs.ERR_CANT_WRITE = 6;
/**
* @constant Target directory is out of space. File could not be written.
*/
cep.fs.ERR_OUT_OF_SPACE = 7;
/**
* @constant Specified path does not point to a file.
*/
cep.fs.ERR_NOT_FILE = 8;
/**
* @constant Specified path does not point to a directory.
*/
cep.fs.ERR_NOT_DIRECTORY = 9;
/**
* @constant Specified file already exists.
*/
cep.fs.ERR_FILE_EXISTS = 10;
/**
* @constant The maximum number of processes has been exceeded.
*/
cep.process.ERR_EXCEED_MAX_NUM_PROCESS = 101;
/**
* @constant Invalid URL.
*/
cep.util.ERR_INVALID_URL = 201;
/**
* @constant deprecated API.
*/
cep.util.DEPRECATED_API = 202;
/**
* @constant UTF8 encoding type.
*/
cep.encoding.UTF8 = "UTF-8";
/**
* @constant Base64 encoding type.
*/
cep.encoding.Base64 = "Base64";
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialog();
cep.fs.showOpenDialog = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes) {
var resultString = ShowOpenDialog(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
* @param friendlyFilePrefix {string} String to put in front of the extensions
* of files that can be selected. Ignored when chooseDirectory=true. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for OK button (mac only, default is "Open" on mac, "Open" or "Select Folder" on win).
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialogEx();
cep.fs.showOpenDialogEx = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes,
friendlyFilePrefix, prompt) {
var resultString = ShowOpenDialogEx(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', friendlyFilePrefix || '',
prompt || '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Save dialog, allowing the user to type in a file name.
*
* @param title {string} Title of the save dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected.
* @param defaultName {string} String to start with for the file name.
* @param friendlyFilePrefix {string} String to put in front of the extensions of files that can be selected. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for Save button (mac only, default is "Save" on mac and win).
* @param nameFieldLabel {string} String displayed in front of the file name text field (mac only, "File name:" on win).
*
* @return An object with these properties:
* <ul><li>"data": The file path selected to save at or "" if canceled</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowSaveDialogEx();
cep.fs.showSaveDialogEx = function (title, initialPath, fileTypes, defaultName, friendlyFilePrefix, prompt, nameFieldLabel) {
var resultString = ShowSaveDialogEx(title || '', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', defaultName || '',
friendlyFilePrefix || '', prompt || '', nameFieldLabel || '');
var result = {data: resultString || '', err: getLastError() };
return result;
};
/**
* Reads the contents of a folder.
*
* @param path {string} The path of the folder to read.
*
* @return An object with these properties:
* <ul><li>"data": An array of the names of the contained files (excluding '.' and '..'.</li>
* <li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ </li></ul>
**/
native function ReadDir();
cep.fs.readdir = function (path) {
var resultString = ReadDir(path);
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Creates a new folder.
*
* @param path {string} The path of the folder to create.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function MakeDir();
cep.fs.makedir = function (path) {
MakeDir(path);
return getErrorResult();
};
/**
* Renames a file or folder.
*
* @param oldPath {string} The old name of the file or folder.
* @param newPath {string} The new name of the file or folder.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_FILE_EXISTS </li></ul>
**/
native function Rename();
cep.fs.rename = function(oldPath, newPath) {
Rename(oldPath, newPath);
return getErrorResult();
};
/**
* Reports whether an item is a file or folder.
*
* @param path {string} The path of the file or folder.
*
* @return An object with these properties:
* <ul><li>"data": An object with properties
* <br>isFile (boolean)
* <br>isDirectory (boolean)
* <br>mtime (modification DateTime) </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND </li>
* </ul>
**/
native function IsDirectory();
native function GetFileModificationTime();
cep.fs.stat = function (path) {
var isDir = IsDirectory(path);
var modtime = GetFileModificationTime(path);
var result = {
data: {
isFile: function () {
return !isDir;
},
isDirectory: function () {
return isDir;
},
mtime: modtime
},
err: getLastError()
};
return result;
};
/**
* Reads the entire contents of a file.
*
* @param path {string} The path of the file to read.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with these properties:
* <ul><li>"data": The file contents. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ
* <br>ERR_UNSUPPORTED_ENCODING </li>
* </ul>
**/
native function ReadFile();
cep.fs.readFile = function (path, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
var contents = ReadFile(path, encoding);
var result = {data: contents, err: getLastError() };
return result;
};
/**
* Writes data to a file, replacing the file if it already exists.
*
* @param path {string} The path of the file to write.
* @param data {string} The data to write to the file.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_UNSUPPORTED_ENCODING
* <br>ERR_CANT_WRITE
* <br>ERR_OUT_OF_SPACE </li></ul>
**/
native function WriteFile();
cep.fs.writeFile = function (path, data, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
WriteFile(path, data, encoding);
return getErrorResult();
};
/**
* Sets permissions for a file or folder.
*
* @param path {string} The path of the file or folder.
* @param mode {number} The permissions in numeric format (for example, 0777).
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_CANT_WRITE </li></ul>
**/
native function SetPosixPermissions();
cep.fs.chmod = function (path, mode) {
SetPosixPermissions(path, mode);
return getErrorResult();
};
/**
* Deletes a file.
*
* @param path {string} The path of the file to delete.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE </li></ul>
**/
native function DeleteFileOrDirectory();
native function IsDirectory();
cep.fs.deleteFile = function (path) {
if (IsDirectory(path)) {
var result = {err: cep.fs.ERR_NOT_FILE};
return result;
}
DeleteFileOrDirectory(path);
return getErrorResult();
};
/**
* Creates a process.
*
* @param arguments {list} The arguments to create process. The first one is the full path of the executable,
* followed by the arguments of the executable.
*
* @return An object with these properties:
* <ul><li>"data": The pid of the process, or -1 on error. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_EXCEED_MAX_NUM_PROCESS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE</li>
* </ul>
**/
native function CreateProcess();
cep.process.createProcess = function () {
var args = Array.prototype.slice.call(arguments);
var pid = CreateProcess(args);
var result = {data: pid, err: getLastError()};
return result;
};
/**
* Registers a standard-output handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard output callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdOutHandler();
cep.process.stdout = function (pid, callback) {
SetupStdOutHandler(pid, callback);
return getErrorResult();
};
/**
* Registers up a standard-error handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard error callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdErrHandler();
cep.process.stderr = function (pid, callback) {
SetupStdErrHandler(pid, callback);
return getErrorResult();
};
/**
* Writes data to the standard input of a process.
*
* @param pid {int} The pid of the process
* @param data {string} The data to write.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WriteStdIn();
cep.process.stdin = function (pid, data) {
WriteStdIn(pid, data);
return getErrorResult();
};
/**
* Retrieves the working directory of a process.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": The path of the working directory. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function GetWorkingDirectory();
cep.process.getWorkingDirectory = function (pid) {
var wd = GetWorkingDirectory(pid);
var result = {data: wd, err: getLastError()};
return result;
};
/**
* Waits for a process to quit.
*
* @param pid {int} The pid of the process.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WaitFor();
cep.process.waitfor = function (pid) {
WaitFor(pid);
return getErrorResult();
};
/**
* Registers a handler for the onquit callback of a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function OnQuit();
cep.process.onquit = function (pid, callback) {
OnQuit(pid, callback);
return getErrorResult();
};
/**
* Reports whether a process is currently running.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": True if the process is running, false otherwise. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function IsRunning();
cep.process.isRunning = function (pid) {
var isRunning = IsRunning(pid);
var result = {data: isRunning, err: getLastError()};
return result;
};
/**
* Terminates a process.
*
* @param pid {int} The pid of the process
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function Terminate();
cep.process.terminate = function (pid) {
Terminate(pid);
return getErrorResult();
};
/**
* Encoding conversions.
*
*/
cep.encoding.convertion =
{
utf8_to_b64: function(str) {
return window.btoa(unescape(encodeURIComponent(str)));
},
b64_to_utf8: function(base64str) {
// If a base64 string contains any whitespace character, DOM Exception 5 occurs during window.atob, please see
// http://stackoverflow.com/questions/14695988/dom-exception-5-invalid-character-error-on-valid-base64-image-string-in-javascri
base64str = base64str.replace(/\s/g, '');
return decodeURIComponent(escape(window.atob(base64str)));
},
binary_to_b64: function(binary) {
return window.btoa(binary);
},
b64_to_binary: function(base64str) {
return window.atob(base64str);
},
ascii_to_b64: function(ascii) {
return window.btoa(binary);
},
b64_to_ascii: function(base64str) {
return window.atob(base64str);
}
};
/**
* Opens a page in the default system browser.
*
* @param url {string} The URL of the page/file to open, or the email address.
* Must use HTTP/HTTPS/file/mailto. For example:
* "http://www.adobe.com"
* "https://github.com"
* "file:///C:/log.txt"
* "mailto:test@adobe.com"
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function OpenURLInDefaultBrowser();
cep.util.openURLInDefaultBrowser = function (url) {
if (url && (url.indexOf("http://") === 0 ||
url.indexOf("https://") === 0 ||
url.indexOf("file://") === 0 ||
url.indexOf("mailto:") === 0)) {
OpenURLInDefaultBrowser(url);
return getErrorResult();
} else {
return { err : cep.util.ERR_INVALID_URL };
}
};
/**
* Registers a callback function for extension unload. If called more than once,
* the last callback that is successfully registered is used.
*
* @deprecated since version 6.0.0
*
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function RegisterExtensionUnloadCallback();
cep.util.registerExtensionUnloadCallback = function (callback) {
return { err : cep.util.DEPRECATED_API };
};
/**
* Stores the user's proxy credentials
*
* @param username {string} proxy username
* @param password {string} proxy password
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function StoreProxyCredentials();
cep.util.storeProxyCredentials = function (username, password) {
StoreProxyCredentials(username, password);
return getErrorResult();
};
})();

View file

@ -11,7 +11,7 @@
*
**************************************************************************************************/
/** CSInterface - v8.0.0 */
/** CSInterface - v9.2.0 */
/**
* Stores constants for the window types supported by the CSXS infrastructure.
@ -323,7 +323,7 @@ function UIColor(type, antialiasLevel, color)
* @param panelBackgroundColor The background color of the extension panel.
* @param appBarBackgroundColorSRGB The application bar background color, as sRGB.
* @param panelBackgroundColorSRGB The background color of the extension panel, as sRGB.
* @param systemHighlightColor The highlight color of the extension panel, if provided by the host application. Otherwise, the operating-system highlight color.
* @param systemHighlightColor The highlight color of the extension panel, if provided by the host application. Otherwise, the operating-system highlight color.
*
* @return AppSkinInfo object.
*/
@ -381,7 +381,7 @@ function HostCapabilities(EXTENDED_PANEL_MENU, EXTENDED_PANEL_ICONS, DELEGATE_AP
this.EXTENDED_PANEL_ICONS = EXTENDED_PANEL_ICONS;
this.DELEGATE_APE_ENGINE = DELEGATE_APE_ENGINE;
this.SUPPORT_HTML_EXTENSIONS = SUPPORT_HTML_EXTENSIONS;
this.DISABLE_FLASH_EXTENSIONS = DISABLE_FLASH_EXTENSIONS; // Since 5.0.0
this.DISABLE_FLASH_EXTENSIONS = DISABLE_FLASH_EXTENSIONS; // Since 5.0.0
}
/**
@ -410,16 +410,16 @@ function ApiVersion(major, minor, micro)
* Since 5.2.0
*
* @param menuItemLabel The menu item label.
* @param enabled True if user wants to enable the menu item.
* @param checked True if user wants to check the menu item.
* @param enabled True if user wants to enable the menu item.
* @param checked True if user wants to check the menu item.
*
* @return MenuItemStatus object.
*/
function MenuItemStatus(menuItemLabel, enabled, checked)
{
this.menuItemLabel = menuItemLabel;
this.enabled = enabled;
this.checked = checked;
this.menuItemLabel = menuItemLabel;
this.enabled = enabled;
this.checked = checked;
}
/**
@ -429,16 +429,16 @@ function MenuItemStatus(menuItemLabel, enabled, checked)
* Since 5.2.0
*
* @param menuItemID The menu item id.
* @param enabled True if user wants to enable the menu item.
* @param checked True if user wants to check the menu item.
* @param enabled True if user wants to enable the menu item.
* @param checked True if user wants to check the menu item.
*
* @return MenuItemStatus object.
*/
function ContextMenuItemStatus(menuItemID, enabled, checked)
{
this.menuItemID = menuItemID;
this.enabled = enabled;
this.checked = checked;
this.menuItemID = menuItemID;
this.enabled = enabled;
this.checked = checked;
}
//------------------------------ CSInterface ----------------------------------
@ -717,7 +717,7 @@ CSInterface.prototype.dumpInstallationInfo = function()
*
* @return A string containing the OS version, or "unknown Operation System".
* If user customizes the User Agent by setting CEF command parameter "--user-agent", only
* "Mac OS X" or "Windows" will be returned.
* "Mac OS X" or "Windows" will be returned.
*/
CSInterface.prototype.getOSInformation = function()
{
@ -768,14 +768,14 @@ CSInterface.prototype.getOSInformation = function()
}
else
{
winBit = " 32-bit";
winBit = " 32-bit";
}
}
return winVersion + winBit;
}
else if ((navigator.platform == "MacIntel") || (navigator.platform == "Macintosh"))
{
{
var result = "Mac OS X";
if (userAgent.indexOf("Mac OS X") > -1)
@ -784,7 +784,7 @@ CSInterface.prototype.getOSInformation = function()
result = result.replace(/_/g, ".");
}
return result;
return result;
}
return "Unknown Operation System";
@ -828,7 +828,7 @@ CSInterface.prototype.getExtensionID = function()
};
/**
* Retrieves the scale factor of screen.
* Retrieves the scale factor of screen.
* On Windows platform, the value of scale factor might be different from operating system's scale factor,
* since host application may use its self-defined scale factor.
*
@ -846,6 +846,21 @@ CSInterface.prototype.getScaleFactor = function()
return window.__adobe_cep__.getScaleFactor();
};
/**
* Retrieves the scale factor of Monitor.
*
* Since 8.5.0
*
* @return value >= 1.0f
* only available for windows machine
*/
if(navigator.appVersion.toLowerCase().indexOf("windows") >= 0) {
CSInterface.prototype.getMonitorScaleFactor = function()
{
return window.__adobe_cep__.getMonitorScaleFactor();
};
}
/**
* Set a handler to detect any changes of scale factor. This only works on Mac.
*
@ -878,9 +893,9 @@ CSInterface.prototype.getCurrentApiVersion = function()
*
* Since 5.2.0
*
* Register a callback function for "com.adobe.csxs.events.flyoutMenuClicked" to get notified when a
* Register a callback function for "com.adobe.csxs.events.flyoutMenuClicked" to get notified when a
* menu item is clicked.
* The "data" attribute of event is an object which contains "menuId" and "menuName" attributes.
* The "data" attribute of event is an object which contains "menuId" and "menuName" attributes.
*
* Register callback functions for "com.adobe.csxs.events.flyoutMenuOpened" and "com.adobe.csxs.events.flyoutMenuClosed"
* respectively to get notified when flyout menu is opened or closed.
@ -904,36 +919,36 @@ CSInterface.prototype.setPanelFlyoutMenu = function(menu)
{
if ("string" != typeof menu)
{
return;
return;
}
window.__adobe_cep__.invokeSync("setPanelFlyoutMenu", menu);
window.__adobe_cep__.invokeSync("setPanelFlyoutMenu", menu);
};
/**
* Updates a menu item in the extension window's flyout menu, by setting the enabled
* and selection status.
*
*
* Since 5.2.0
*
* @param menuItemLabel The menu item label.
* @param enabled True to enable the item, false to disable it (gray it out).
* @param checked True to select the item, false to deselect it.
* @param menuItemLabel The menu item label.
* @param enabled True to enable the item, false to disable it (gray it out).
* @param checked True to select the item, false to deselect it.
*
* @return false when the host application does not support this functionality (HostCapabilities.EXTENDED_PANEL_MENU is false).
* @return false when the host application does not support this functionality (HostCapabilities.EXTENDED_PANEL_MENU is false).
* Fails silently if menu label is invalid.
*
* @see HostCapabilities.EXTENDED_PANEL_MENU
*/
CSInterface.prototype.updatePanelMenuItem = function(menuItemLabel, enabled, checked)
{
var ret = false;
if (this.getHostCapabilities().EXTENDED_PANEL_MENU)
{
var itemStatus = new MenuItemStatus(menuItemLabel, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updatePanelMenuItem", JSON.stringify(itemStatus));
}
return ret;
var ret = false;
if (this.getHostCapabilities().EXTENDED_PANEL_MENU)
{
var itemStatus = new MenuItemStatus(menuItemLabel, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updatePanelMenuItem", JSON.stringify(itemStatus));
}
return ret;
};
@ -946,8 +961,8 @@ CSInterface.prototype.updatePanelMenuItem = function(menuItemLabel, enabled, che
* - an item without menu ID or menu name is disabled and is not shown.
* - if the item name is "---" (three hyphens) then it is treated as a separator. The menu ID in this case will always be NULL.
* - Checkable attribute takes precedence over Checked attribute.
* - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item.
The Chrome extension contextMenus API was taken as a reference.
* - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item.
The Chrome extension contextMenus API was taken as a reference.
https://developer.chrome.com/extensions/contextMenus
* - the items with icons and checkable items cannot coexist on the same menu level. The former take precedences over the latter.
*
@ -973,8 +988,8 @@ CSInterface.prototype.setContextMenu = function(menu, callback)
{
return;
}
window.__adobe_cep__.invokeAsync("setContextMenu", menu, callback);
window.__adobe_cep__.invokeAsync("setContextMenu", menu, callback);
};
/**
@ -986,7 +1001,7 @@ CSInterface.prototype.setContextMenu = function(menu, callback)
* - an item without menu ID or menu name is disabled and is not shown.
* - if the item label is "---" (three hyphens) then it is treated as a separator. The menu ID in this case will always be NULL.
* - Checkable attribute takes precedence over Checked attribute.
* - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item.
* - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item.
The Chrome extension contextMenus API was taken as a reference.
* - the items with icons and checkable items cannot coexist on the same menu level. The former take precedences over the latter.
https://developer.chrome.com/extensions/contextMenus
@ -996,7 +1011,7 @@ CSInterface.prototype.setContextMenu = function(menu, callback)
*
* @description An example menu JSON:
*
* {
* {
* "menu": [
* {
* "id": "menuItemId1",
@ -1050,43 +1065,43 @@ CSInterface.prototype.setContextMenuByJSON = function(menu, callback)
{
if ("string" != typeof menu)
{
return;
return;
}
window.__adobe_cep__.invokeAsync("setContextMenuByJSON", menu, callback);
window.__adobe_cep__.invokeAsync("setContextMenuByJSON", menu, callback);
};
/**
* Updates a context menu item by setting the enabled and selection status.
*
*
* Since 5.2.0
*
* @param menuItemID The menu item ID.
* @param enabled True to enable the item, false to disable it (gray it out).
* @param checked True to select the item, false to deselect it.
* @param menuItemID The menu item ID.
* @param enabled True to enable the item, false to disable it (gray it out).
* @param checked True to select the item, false to deselect it.
*/
CSInterface.prototype.updateContextMenuItem = function(menuItemID, enabled, checked)
{
var itemStatus = new ContextMenuItemStatus(menuItemID, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updateContextMenuItem", JSON.stringify(itemStatus));
var itemStatus = new ContextMenuItemStatus(menuItemID, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updateContextMenuItem", JSON.stringify(itemStatus));
};
/**
* Get the visibility status of an extension window.
*
* Get the visibility status of an extension window.
*
* Since 6.0.0
*
* @return true if the extension window is visible; false if the extension window is hidden.
*/
CSInterface.prototype.isWindowVisible = function()
{
return window.__adobe_cep__.invokeSync("isWindowVisible", "");
return window.__adobe_cep__.invokeSync("isWindowVisible", "");
};
/**
* Resize extension's content to the specified dimensions.
* 1. Works with modal and modeless extensions in all Adobe products.
* 2. Extension's manifest min/max size constraints apply and take precedence.
* 2. Extension's manifest min/max size constraints apply and take precedence.
* 3. For panel extensions
* 3.1 This works in all Adobe products except:
* * Premiere Pro
@ -1107,10 +1122,10 @@ CSInterface.prototype.resizeContent = function(width, height)
};
/**
* Register the invalid certificate callback for an extension.
* Register the invalid certificate callback for an extension.
* This callback will be triggered when the extension tries to access the web site that contains the invalid certificate on the main frame.
* But if the extension does not call this function and tries to access the web site containing the invalid certificate, a default error page will be shown.
*
*
* Since 6.1.0
*
* @param callback the callback function
@ -1123,7 +1138,7 @@ CSInterface.prototype.registerInvalidCertificateCallback = function(callback)
/**
* Register an interest in some key events to prevent them from being sent to the host application.
*
* This function works with modeless extensions and panel extensions.
* This function works with modeless extensions and panel extensions.
* Generally all the key events will be sent to the host application for these two extensions if the current focused element
* is not text input or dropdown,
* If you want to intercept some key events and want them to be handled in the extension, please call this function
@ -1167,7 +1182,7 @@ CSInterface.prototype.registerKeyEventsInterest = function(keyEventsInterest)
};
/**
* Set the title of the extension window.
* Set the title of the extension window.
* This function works with modal and modeless extensions in all Adobe products, and panel extensions in Photoshop, InDesign, InCopy, Illustrator, Flash Pro and Dreamweaver.
*
* Since 6.1.0
@ -1180,7 +1195,7 @@ CSInterface.prototype.setWindowTitle = function(title)
};
/**
* Get the title of the extension window.
* Get the title of the extension window.
* This function works with modal and modeless extensions in all Adobe products, and panel extensions in Photoshop, InDesign, InCopy, Illustrator, Flash Pro and Dreamweaver.
*
* Since 6.1.0

View file

@ -0,0 +1,459 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2018 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
/** Vulcan - v9.2.0 */
/**
* @class Vulcan
*
* The singleton instance, <tt>VulcanInterface</tt>, provides an interface
* to the Vulcan. Allows you to launch CC applications
* and discover information about them.
*/
function Vulcan()
{
}
/**
* Gets all available application specifiers on the local machine.
*
* @return The array of all available application specifiers.
*/
Vulcan.prototype.getTargetSpecifiers = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetTargetSpecifiers", JSON.stringify(params)));
};
/**
* Launches a CC application on the local machine, if it is not already running.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @param focus True to launch in foreground, or false to launch in the background.
* @param cmdLine Optional, command-line parameters to supply to the launch command.
* @return True if the app can be launched, false otherwise.
*/
Vulcan.prototype.launchApp = function(targetSpecifier, focus, cmdLine)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
params.focus = focus ? "true" : "false";
params.cmdLine = requiredParamsValid(cmdLine) ? cmdLine : "";
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanLaunchApp", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is running on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is running, false otherwise.
*/
Vulcan.prototype.isAppRunning = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppRunning", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is installed on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is installed, false otherwise.
*/
Vulcan.prototype.isAppInstalled = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppInstalled", JSON.stringify(params))).result;
};
/**
* Retrieves the local install path of a CC application.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return The path string if the application is found, "" otherwise.
*/
Vulcan.prototype.getAppPath = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return "";
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetAppPath", JSON.stringify(params))).result;
};
/**
* Registers a message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that handles the message.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.addMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanAddMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Removes a registered message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that was registered.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.removeMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanRemoveMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Dispatches a Vulcan message.
*
* @param vulcanMessage The message object.
*/
Vulcan.prototype.dispatchMessage = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
params.vulcanMessage = message;
window.__adobe_cep__.invokeSync("vulcanDispatchMessage", JSON.stringify(params));
};
/**
* Retrieves the message payload of a Vulcan message for the registered message listener callback function.
*
* @param vulcanMessage The message object.
* @return A string containing the message payload.
*/
Vulcan.prototype.getPayload = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return null;
}
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
return message.getPayload();
};
/**
* Gets all available endpoints of the running Vulcan-enabled applications.
*
* Since 7.0.0
*
* @return The array of all available endpoints.
* An example endpoint string:
* <endPoint>
* <appId>PHXS</appId>
* <appVersion>16.1.0</appVersion>
* </endPoint>
*/
Vulcan.prototype.getEndPoints = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetEndPoints", JSON.stringify(params)));
};
/**
* Gets the endpoint for itself.
*
* Since 7.0.0
*
* @return The endpoint string for itself.
*/
Vulcan.prototype.getSelfEndPoint = function()
{
var params = {};
return window.__adobe_cep__.invokeSync("vulcanGetSelfEndPoint", JSON.stringify(params));
};
/** Singleton instance of Vulcan **/
var VulcanInterface = new Vulcan();
//--------------------------------- Vulcan Message ------------------------------
/**
* @class VulcanMessage
* Message type for sending messages between host applications.
* A message of this type can be sent to the designated destination
* when appId and appVersion are provided and valid. Otherwise,
* the message is broadcast to all running Vulcan-enabled applications.
*
* To send a message between extensions running within one
* application, use the <code>CSEvent</code> type in CSInterface.js.
*
* @param type The message type.
* @param appId The peer appId.
* @param appVersion The peer appVersion.
*
*/
function VulcanMessage(type, appId, appVersion)
{
this.type = type;
this.scope = VulcanMessage.SCOPE_SUITE;
this.appId = requiredParamsValid(appId) ? appId : VulcanMessage.DEFAULT_APP_ID;
this.appVersion = requiredParamsValid(appVersion) ? appVersion : VulcanMessage.DEFAULT_APP_VERSION;
this.data = VulcanMessage.DEFAULT_DATA;
}
VulcanMessage.TYPE_PREFIX = "vulcan.SuiteMessage.";
VulcanMessage.SCOPE_SUITE = "GLOBAL";
VulcanMessage.DEFAULT_APP_ID = "UNKNOWN";
VulcanMessage.DEFAULT_APP_VERSION = "UNKNOWN";
VulcanMessage.DEFAULT_DATA = "<data><payload></payload></data>";
VulcanMessage.dataTemplate = "<data>{0}</data>";
VulcanMessage.payloadTemplate = "<payload>{0}</payload>";
/**
* Initializes this message instance.
*
* @param message A \c message instance to use for initialization.
*/
VulcanMessage.prototype.initialize = function(message)
{
this.type = message.type;
this.scope = message.scope;
this.appId = message.appId;
this.appVersion = message.appVersion;
this.data = message.data;
};
/**
* Retrieves the message data.
*
* @return A data string in XML format.
*/
VulcanMessage.prototype.xmlData = function()
{
if(this.data === undefined)
{
var str = "";
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
}
return this.data;
};
/**
* Sets the message payload of this message.
*
* @param payload A string containing the message payload.
*/
VulcanMessage.prototype.setPayload = function(payload)
{
var str = cep.encoding.convertion.utf8_to_b64(payload);
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
};
/**
* Retrieves the message payload of this message.
*
* @return A string containing the message payload.
*/
VulcanMessage.prototype.getPayload = function()
{
var str = GetValueByKey(this.data, "payload");
if(str !== null)
{
return cep.encoding.convertion.b64_to_utf8(str);
}
return null;
};
/**
* Converts the properties of this instance to a string.
*
* @return The string version of this instance.
*/
VulcanMessage.prototype.toString = function()
{
var str = "type=" + this.type;
str += ", scope=" + this.scope;
str += ", appId=" + this.appId;
str += ", appVersion=" + this.appVersion;
str += ", data=" + this.xmlData();
return str;
};
//--------------------------------------- Util --------------------------------
/**
* Formats a string based on a template.
*
* @param src The format template.
*
* @return The formatted string
*/
String.format = function(src)
{
if (arguments.length === 0)
{
return null;
}
var args = Array.prototype.slice.call(arguments, 1);
return src.replace(/\{(\d+)\}/g, function(m, i){
return args[i];
});
};
/**
* Retrieves the content of an XML element.
*
* @param xmlStr The XML string.
* @param key The name of the tag.
*
* @return The content of the tag, or the empty string
* if such tag is not found or the tag has no content.
*/
function GetValueByKey(xmlStr, key)
{
if(window.DOMParser)
{
var parser = new window.DOMParser();
try
{
var xmlDoc = parser.parseFromString(xmlStr, "text/xml");
var node = xmlDoc.getElementsByTagName(key)[0];
if(node && node.childNodes[0])
{
return node.childNodes[0].nodeValue;
}
}
catch(e)
{
//log the error
}
}
return "";
}
/**
* Reports whether required parameters are valid.
*
* @return True if all required parameters are valid,
* false if any of the required parameters are invalid.
*/
function requiredParamsValid()
{
for(var i = 0; i < arguments.length; i++)
{
var argument = arguments[i];
if(argument === undefined || argument === null)
{
return false;
}
}
return true;
}
/**
* Reports whether a string has a given prefix.
*
* @param str The target string.
* @param prefix The specific prefix string.
*
* @return True if the string has the prefix, false if not.
*/
function strStartsWith(str, prefix)
{
if(typeof str != "string")
{
return false;
}
return str.indexOf(prefix) === 0;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
[0403/174733.987:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.988:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174733.989:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.475:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.476:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/174747.477:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.527:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.528:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/182044.529:ERROR:crash_report_database_win.cc(469)] failed to stat report

View file

@ -11,7 +11,7 @@ _______________.___._____________________
*/
// variable br is defined in pypeAvalon.jsx
br = {
var br = {
getSelectedVideoTrackItems: function () {
var seq = app.project.activeSequence;
var selected = [];
@ -28,10 +28,10 @@ br = {
var clip = videoTrack.clips[m];
selected.push({
'name': clip.name,
'clip': clip,
'sequence': seq,
'videoTrack': videoTrack
name: clip.name,
clip: clip,
sequence: seq,
videoTrack: videoTrack
});
}
}

View file

@ -1,4 +1,4 @@
/* global app, qe, $, ProjectItemType */
/* global app, qe, $, ProjectItemType */
/*
.____ _ ___ .____.______
--- - - -- / . \// // . \ ___/ --- ---- - -
@ -6,13 +6,17 @@
/__/ /___/ /__/ /______/
._- -=[ PyPe 4 3veR ]=- -_.
*/
if (typeof (JSON) === 'undefined') {
var json2 = 'C:\\Users\\jezsc\\CODE\\pype-setup\\repos\\pype\\pype\\premiere\\extensions\\com.pype.avalon\\js\\json2.js';
$.evalFile(json2);
}
if (ExternalObject.AdobeXMPScript === undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
}
// variable pype is defined in pypeAvalon.jsx
pype = {
var pype = {
addNewTrack: function (numTracks) {
app.enableQE();
var sequence = app.project.activeSequence;
@ -191,8 +195,8 @@ pype = {
activeSequence.removeEmptyAudioTracks();
},
setEnvs: function (env) {
for (key in env) {
// $.writeln((key + ': ' + env[key]));
for (var key in env) {
$.writeln((key + ': ' + env[key]));
$.setenv(key, env[key])
};
},
@ -933,7 +937,7 @@ pype = {
var outFileTest = new File(fullPathToFile);
if (outFileTest.exists) {
var destroyExisting = confirm("A file with that name already exists; overwrite?", false, "Are you sure...?");
var destroyExisting = confirm('A file with that name already exists; overwrite?', false, 'Are you sure...?');
if (destroyExisting) {
outFileTest.remove();
outFileTest.close();
@ -963,14 +967,14 @@ pype = {
return file;
}
} else {
$._PPP_.updateEventPanel("Could not find output preset.");
$._PPP_.updateEventPanel('Could not find output preset.');
}
} else {
$._PPP_.updateEventPanel("Could not find/create output path.");
$._PPP_.updateEventPanel('Could not find/create output path.');
}
projPath.close();
} else {
$._PPP_.updateEventPanel("No active sequence.");
$._PPP_.updateEventPanel('No active sequence.');
}
},
@ -983,7 +987,7 @@ pype = {
},
// $.getenv('PYTHONPATH')
alert_message: function (message) {
alert(message, "WARNING", true);
alert(message, 'WARNING', true);
app.setSDKEventMessage(message, 'error');
},
getWorkFileVersion: function () {
@ -1121,5 +1125,5 @@ function include(arr, obj) {
return false
}
// var instances = pype.getPyblishRequest();
// pype.encodeRepresentation(JSON.parse(instances));
//var instances = pype.getPyblishRequest();
//pype.encodeRepresentation(JSON.parse(instances));

View file

@ -1,3 +0,0 @@
body{background-color:#323238;color:#eeeeee}#output{background:#121212;color:#eeeeee;padding:2em;font-family:monospace;font-weight:bold;min-height:8em}.dark>.list-group-item{background:#454747}
/*# sourceMappingURL=avalon.min.css.map */

View file

@ -1,9 +0,0 @@
{
"version": 3,
"file": "avalon.min.css",
"sources": [
"avalon.scss"
],
"names": [],
"mappings": "AAAA,AAAA,IAAI,AAAC,CACH,gBAAgB,CAAE,OAAO,CACzB,KAAK,CAAE,OAAO,CACf,AAED,AAAA,OAAO,AAAC,CACN,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,OAAO,CACd,OAAO,CAAE,GAAG,CACZ,WAAW,CAAE,SAAS,CACtB,WAAW,CAAE,IAAI,CACjB,UAAU,CAAE,GAAG,CAChB,AAED,AAAA,KAAK,CAAG,gBAAgB,AAAC,CACvB,UAAU,CAAE,OAAO,CACpB"
}

View file

@ -1,17 +0,0 @@
body {
background-color: #323238;
color: #eeeeee;
}
#output {
background: #121212;
color: #eeeeee;
padding: 2em;
font-family: monospace;
font-weight: bold;
min-height: 8em;
}
.dark > .list-group-item {
background: #454747;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,162 +0,0 @@
<!DOCTYPE html>
<html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Pype extention</title>
<!-- Load the pico Javascript client, always automatically available at /pico.js -->
<script src="/pico.js"></script>
<!-- Or load our module proxy -->
<script src="/api.js"></script>
<link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="./css/avalon.min.css" type="text/css" rel="stylesheet">
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="./js/vendor/jquery-3.3.1.min.js"></script>
<script src="./js/vendor/CSInterface-8.js"></script>
<script src="./js/vendor/popper.min.js"></script>
<script src="./js/vendor/bootstrap.min.js"></script>
<script src="./js/vendor/json2.js"></script>
<script>
if (window.module) module = window.module;
var ENV;
</script>
</head>
<body>
<div id="section"><a href="javascript:history.go(0)">Refresh panel</a>
<ul class="list-group list-group-flush dark">
<li class="list-group-item" id="rename">
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Rename targeted text layers<br /> converts sc010sh020 <br />to lbb201sc010sh020<br />and creates ftrack metadata</span>
<div class="input-group-text">
<input type="text" name="episode" placeholder="lbb2" aria-label="episode" aria-describedby="basic-addon5" value="" style="width:75px;">
</div>
<div class="input-group-text">
<input type="text" name="ep_suffix" placeholder="nameofepisode" aria-label="Name of episode" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-rename" type="button" class="btn btn-info btn-sm btn-block">Rename</button>
</div>
</div>
</li>
<li class="list-group-item" id="publish">
<h5>Publish</h5>
<pre><code class="js"></code></pre>
<div class="input-group input-group-lg mb-4">
<!-- <div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">GUI</span>
<div class="input-group-text">
<input type="checkbox" name="gui" checked="checked" aria-label="Checkbox for following text input">
</div>
</div> -->
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Version Up</span>
<div class="input-group-text">
<input type="checkbox" name="version-up" checked="checked" aria-label="Checkbox for following text input">
</div>
<span class="input-group-text" id="basic-addon6">
Audio Only</span>
<div class="input-group-text">
<input type="checkbox" name="audio-only" aria-label="Check if you want to export only audio">
</div>
</div>
<div class="input-group-append">
<button id="btn-publish" type="button" class="btn btn-info btn-sm btn-block">Publish</button>
</div>
</div>
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to sending data json</span>
<div class="input-group-text">
<input type="text" name="send-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-send-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to getting data json</span>
<div class="input-group-text">
<input type="text" name="get-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-prepend">
<button id="btn-get-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
<div class="input-group-append">
<button id="btn-metadata" type="button" class="btn btn-info btn-sm btn-block">Injest metadata</button>
</div>
</div>
</li>
<li class="list-group-item"><button type="button" class="btn btn-info btn-sm btn-block" id="btn-newWorkfileVersion">Save next workfile version</button></li>
<li class="list-group-item"><button type="button" class="btn btn-info btn-sm btn-block" id="btn-get-frame">Get screen grab</button></li>
<li class="list-group-item" id="load">
<h5>Load/Update assets to timeline</h5>
<pre><code class="js"></code></pre>
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Type</span>
<div class="input-group-text">
<input type="text" name="type" placeholder="renderAnimation" aria-label="Asset Type" aria-describedby="basic-addon5" value="renderAnimation">
</div>
<span class="input-group-text" id="basic-addon6">Ext</span>
<div class="input-group-text">
<input type="text" name="ext" placeholder="mxf" aria-label="File Extension" aria-describedby="basic-addon5" value="mxf">
</div>
<div class="input-group-append">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-getRernderAnimation">DO IT!</button>
</div>
</div>
</li>
</ul>
<hr />
<div class="col-md-6" id="source">
<!-- <pre>
<code class="python"></code>
</pre> -->
</div>
<h5>Output</h5>
<div class="row" id="output">
</div>
<script src="./js/pico_client.js"></script>
<script src="./js/avalon.js"></script>
</body>
</html>

View file

@ -1,367 +0,0 @@
/* global CSInterface, $, querySelector, api, displayResult */
var csi = new CSInterface();
var output = document.getElementById('output');
var rootFolderPath = csi.getSystemPath(SystemPath.EXTENSION);
var timecodes = cep_node.require('node-timecodes');
var process = cep_node.require('process');
function getEnv() {
csi.evalScript('pype.getProjectFileData();', function (result) {
process.env.EXTENSION_PATH = rootFolderPath
window.ENV = process.env;
var resultData = JSON.parse(result);
for (key in resultData) {
window.ENV[key] = resultData[key];
};
csi.evalScript('pype.setEnvs(' + JSON.stringify(window.ENV) + ')');
});
}
function renderClips() {
csi.evalScript('pype.transcodeExternal(' + rootFolderPath + ');', function (result) {
displayResult(result);
});
}
function displayResult(r) {
console.log(r);
csi.evalScript('$.writeln( ' + JSON.stringify(r) + ' )');
output.classList.remove("error");
output.innerText = r;
}
function displayError(e) {
output.classList.add("error");
output.innerText = e.message;
}
function loadJSX() {
// get the appName of the currently used app. For Premiere Pro it's "PPRO"
var appName = csi.hostEnvironment.appName;
var extensionPath = csi.getSystemPath(SystemPath.EXTENSION);
// load general JSX script independent of appName
var extensionRootGeneral = extensionPath + '/jsx/';
csi.evalScript('$._ext.evalFiles("' + extensionRootGeneral + '")');
// load JSX scripts based on appName
var extensionRootApp = extensionPath + '/jsx/' + appName + '/';
csi.evalScript('$._ext.evalFiles("' + extensionRootApp + '")');
// csi.evalScript('$._PPP_.logConsoleOutput()');
getEnv();
csi.evalScript('$._PPP_.updateEventPanel( "' + "all plugins are loaded" + '" )');
csi.evalScript('$._PPP_.updateEventPanel( "' + "testing function done" + '" )');
}
// run all at loading
loadJSX()
function loadAnimationRendersToTimeline() {
// it will get type of asset and extension from input
// and start loading script from jsx
var $ = querySelector('#load');
var data = {};
data.subset = $('input[name=type]').value;
data.subsetExt = $('input[name=ext]').value;
var requestList = [];
// get all selected clips
csi.evalScript('pype.getClipsForLoadingSubsets( "' + data.subset + '" )', function (result) {
// TODO: need to check if the clips are already created and this is just updating to last versions
var resultObj = JSON.parse(result);
var instances = resultObj[0];
var numTracks = resultObj[1];
var key = '';
// creating requesting list of dictionaries
for (key in instances) {
var clipData = {};
clipData.parentClip = instances[key];
clipData.asset = key;
clipData.subset = data.subset;
clipData.representation = data.subsetExt;
requestList.push(clipData);
}
// gets data from mongodb
api.load_representations(window.ENV['AVALON_PROJECT'], requestList).then(
function (avalonData) {
// creates or updates data on timeline
var makeData = {};
makeData.binHierarchy = data.subset + '/' + data.subsetExt;
makeData.clips = avalonData;
makeData.numTracks = numTracks;
csi.evalScript('pype.importFiles( ' + JSON.stringify(makeData) + ' )');
}
);
});
}
function evalScript(script) {
var callback = function (result) {
displayResult(result);
};
csi.evalScript(script, callback);
}
function deregister() {
api.deregister_plugin_path().then(displayResult);
}
function register() {
var $ = querySelector('#register');
var path = $('input[name=path]').value;
api.register_plugin_path(path).then(displayResult);
}
function getStagingDir() {
// create stagingDir
const fs = require('fs-extra');
const os = require('os');
const path = require('path');
const UUID = require('pure-uuid');
const id = new UUID(4).format();
const stagingDir = path.join(os.tmpdir(), id);
fs.mkdirs(stagingDir);
return stagingDir;
}
function convertPathString(path) {
return path.replace(
new RegExp('\\\\', 'g'), '/').replace(new RegExp('//\\?/', 'g'), '');
}
function publish() {
var $ = querySelector('#publish');
// var gui = $('input[name=gui]').checked;
var gui = true;
var versionUp = $('input[name=version-up]').checked;
var audioOnly = $('input[name=audio-only]').checked;
var jsonSendPath = $('input[name=send-path]').value;
var jsonGetPath = $('input[name=get-path]').value;
var publish_path = window.ENV['PUBLISH_PATH'];
if (jsonSendPath == '') {
// create temp staging directory on local
var stagingDir = convertPathString(getStagingDir());
// copy project file to stagingDir
const fs = require('fs-extra');
const path = require('path');
csi.evalScript('pype.getProjectFileData();', function (result) {
displayResult(result);
var data = JSON.parse(result);
displayResult(stagingDir);
displayResult(data.projectfile);
var destination = convertPathString(path.join(stagingDir, data.projectfile));
displayResult('copy project file');
displayResult(data.projectfile);
displayResult(destination);
fs.copyFile(data.projectpath, destination);
displayResult('project file coppied!');
});
// publishing file
csi.evalScript('pype.getPyblishRequest("' + stagingDir + '", ' + audioOnly + ');', function (r) {
var request = JSON.parse(r);
displayResult(JSON.stringify(request));
csi.evalScript('pype.encodeRepresentation(' + JSON.stringify(request) + ');', function (result) {
// create json for pyblish
var jsonfile = require('jsonfile');
var jsonSendPath = stagingDir + '_send.json'
var jsonGetPath = stagingDir + '_get.json'
$('input[name=send-path]').value = jsonSendPath;
$('input[name=get-path]').value = jsonGetPath;
var jsonContent = JSON.parse(result);
jsonfile.writeFile(jsonSendPath, jsonContent);
var checkingFile = function (path) {
var timeout = 1000;
setTimeout(function () {
if (fs.existsSync(path)) {
// register publish path
api.register_plugin_path(publish_path).then(displayResult);
// send json to pyblish
api.publish(jsonSendPath, jsonGetPath, gui).then(function (result) {
// check if resulted path exists as file
if (fs.existsSync(result.get_json_path)) {
// read json data from resulted path
displayResult('Updating metadata of clips after publishing');
jsonfile.readFile(result.get_json_path, function (err, json) {
csi.evalScript('pype.dumpPublishedInstancesToMetadata(' + JSON.stringify(json) + ');');
})
// version up project
if (versionUp) {
displayResult('Saving new version of the project file');
csi.evalScript('pype.versionUpWorkFile();');
};
} else {
// if resulted path file not existing
displayResult('Publish has not been finished correctly. Hit Publish again to publish from already rendered data, or Reset to render all again.');
};
});
} else {
displayResult('waiting');
checkingFile(path);
};
},
timeout)
};
checkingFile(jsonContent.waitingFor)
});
});
} else {
// register publish path
api.register_plugin_path(publish_path).then(displayResult);
// send json to pyblish
api.publish(jsonSendPath, jsonGetPath, gui).then(function (result) {
// check if resulted path exists as file
if (fs.existsSync(result.get_json_path)) {
// read json data from resulted path
displayResult('Updating metadata of clips after publishing');
jsonfile.readFile(result.get_json_path, function (err, json) {
csi.evalScript('pype.dumpPublishedInstancesToMetadata(' + JSON.stringify(json) + ');');
})
// version up project
if (versionUp) {
displayResult('Saving new version of the project file');
csi.evalScript('pype.versionUpWorkFile();');
};
} else {
// if resulted path file not existing
displayResult('Publish has not been finished correctly. Hit Publish again to publish from already rendered data, or Reset to render all again.');
};
});
};
// $('input[name=send-path]').value = '';
// $('input[name=get-path]').value = '';
}
function context() {
var $ = querySelector('#context');
var project = $('input[name=project]').value;
var asset = $('input[name=asset]').value;
var task = $('input[name=task]').value;
var app = $('input[name=app]').value;
api.context(project, asset, task, app).then(displayResult);
}
function tc(timecode) {
var seconds = timecodes.toSeconds(timecode);
var timec = timecodes.fromSeconds(seconds);
displayResult(seconds);
displayResult(timec);
}
function rename() {
var $ = querySelector('#rename');
var data = {};
data.ep = $('input[name=episode]').value;
data.epSuffix = $('input[name=ep_suffix]').value;
if (!data.ep) {
csi.evalScript('pype.alert_message("' + 'Need to fill episode code' + '")');
return;
};
if (!data.epSuffix) {
csi.evalScript('pype.alert_message("' + 'Need to fill episode longer suffix' + '")');
return;
};
csi.evalScript('br.renameTargetedTextLayer( ' + JSON.stringify(data) + ' );', function (result) {
displayResult(result);
});
}
// bind buttons
$('#btn-getRernderAnimation').click(function () {
loadAnimationRendersToTimeline();
});
$('#btn-rename').click(function () {
rename();
});
$('#btn-set-context').click(function () {
context();
});
$('#btn-register').click(function () {
register();
});
$('#btn-deregister').click(function () {
deregister();
});
$('#btn-publish').click(function () {
publish();
});
$('#btn-send-reset').click(function () {
var $ = querySelector('#publish');
$('input[name=send-path]').value = '';
});
$('#btn-get-reset').click(function () {
var $ = querySelector('#publish');
$('input[name=get-path]').value = '';
});
$('#btn-get-active-sequence').click(function () {
evalScript('pype.getActiveSequence();');
});
$('#btn-get-selected').click(function () {
$('#output').html('getting selected clips info ...');
evalScript('pype.getSelectedItems();');
});
$('#btn-get-env').click(function () {
displayResult(window.ENV);
});
$('#btn-get-projectitems').click(function () {
evalScript('pype.getProjectItems();');
});
$('#btn-metadata').click(function () {
var $ = querySelector('#publish');
var path = $('input[name=get-path]').value;
var jsonfile = require('jsonfile');
displayResult(path);
jsonfile.readFile(path, function (err, json) {
csi.evalScript('pype.dumpPublishedInstancesToMetadata(' + JSON.stringify(json) + ');');
displayResult('Metadata of clips after publishing were updated');
})
});
$('#btn-get-frame').click(function () {
evalScript('$._PPP_.exportCurrentFrameAsPNG();');
});
$('#btn-tc').click(function () {
tc('00:23:47:10');
});
$('#btn-generateRequest').click(function () {
evalScript('pype.getPyblishRequest();');
});
$('#btn-newWorkfileVersion').click(function () {
evalScript('pype.versionUpWorkFile();');
});

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,489 +0,0 @@
/*
json2.js
2014-02-04
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or '&nbsp;'),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, regexp: true */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== 'object') {
JSON = {};
}
(function () {
'use strict';
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function () {
return isFinite(this.valueOf())
? this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z'
: null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function () {
return this.valueOf();
};
}
var cx,
escapable,
gap,
indent,
meta,
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string'
? c
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0
? '[]'
: gap
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
: '[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0
? '{}'
: gap
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
: '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function'
? walk({'': j}, '')
: j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());

File diff suppressed because one or more lines are too long

View file

@ -11,24 +11,29 @@
* then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
**************************************************************************/
var json2 = '~/AppData/Roaming/Adobe/CEP/extensions/com.pype.avalon/js/json2.js';
$.evalFile(json2);
if (typeof ($) == 'undefined') {
$ = {};
if (typeof ($) === 'undefined') {
var $ = {};
}
if (typeof (pype) == 'undefined') {
if (typeof (pype) === 'undefined') {
var pype = {};
}
if (typeof (br) == 'undefined') {
if (typeof (br) === 'undefined') {
var br = {};
}
function keepExtention() {
return app.setExtensionPersistent("com.pype.avalon", 0);
if (typeof (app) === 'undefined') {
var app = {};
}
if (typeof (JSON) === 'undefined') {
var JSON = {};
}
function keepExtention () {
return app.setExtensionPersistent('com.pype.avalon', 0);
}
keepExtention()
@ -41,14 +46,14 @@ $._ext = {
$.writeln(path);
} catch (e) {
$.writeln(e);
alert("Exception:" + e);
alert('Exception:' + e);
}
},
// Evaluate all the files in the given folder
evalFiles: function (jsxFolderPath) {
var folder = new Folder(jsxFolderPath);
if (folder.exists) {
var jsxFiles = folder.getFiles("*.jsx");
var jsxFiles = folder.getFiles('*.jsx');
for (var i = 0; i < jsxFiles.length; i++) {
var jsxFile = jsxFiles[i];
$._ext.evalFile(jsxFile);
@ -88,5 +93,4 @@ $._ext = {
};
// var dalsiJsxFile = 'C:\\Users\\hubert\\CODE\\pype-setup\\repos\\pype-config\\pype\\premiere\\extensions\\com.pype.avalon\\jsx\\pype.jsx';
// // $._ext.evalFile(dalsiJsxFile);
// $.evalFile(dalsiJsxFile);

View file

@ -0,0 +1,48 @@
[0403/172908.369:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report

View file

@ -5,21 +5,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Pype extention</title>
<!-- Load the pico Javascript client, always automatically available at /pico.js -->
<script src="/pico.js"></script>
<!-- Or load our module proxy -->
<script src="/api.js"></script>
<link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="./css/avalon.min.css" type="text/css" rel="stylesheet">
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="./js/vendor/jquery-3.3.1.min.js"></script>
<script src="./js/vendor/CSInterface-8.js"></script>
@ -28,135 +23,133 @@
<script src="./js/vendor/json2.js"></script>
<script>
if (window.module) module = window.module;
var ENV;
</script>
if (window.module)
module = window.module;
var ENV;
</script>
</head>
<body>
<div id="section"><a href="javascript:history.go(0)">Refresh panel</a>
<ul class="list-group list-group-flush dark">
<li class="list-group-item" id="rename">
<div class="input-group input-group-sm mb-1">
<div id="section">
<a href="javascript:history.go(0)">Refresh panel</a>
<ul class="list-group list-group-flush dark">
<li class="list-group-item" id="rename">
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Rename targeted text layers<br /> converts sc010sh020 <br />to lbb201sc010sh020<br />and creates ftrack metadata</span>
<div class="input-group-text">
<input type="text" name="episode" placeholder="lbb2" aria-label="episode" aria-describedby="basic-addon5" value="" style="width:75px;">
</div>
<div class="input-group-text">
<input type="text" name="ep_suffix" placeholder="nameofepisode" aria-label="Name of episode" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Rename targeted text layers<br />
converts sc010sh020
<br />to lbb201sc010sh020<br />and creates ftrack metadata</span>
<div class="input-group-text">
<input type="text" name="episode" placeholder="lbb2" aria-label="episode" aria-describedby="basic-addon5" value="" style="width:75px;">
</div>
<div class="input-group-text">
<input type="text" name="ep_suffix" placeholder="nameofepisode" aria-label="Name of episode" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-rename" type="button" class="btn btn-info btn-sm btn-block">Rename</button>
</div>
</div>
</li>
<li class="list-group-item" id="publish">
<h5>Publish</h5>
<pre><code class="js"></code></pre>
<div class="input-group input-group-lg mb-4">
<!-- <div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">GUI</span>
<div class="input-group-text">
<input type="checkbox" name="gui" checked="checked" aria-label="Checkbox for following text input">
</div>
</div> -->
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Version Up</span>
<div class="input-group-text">
<input type="checkbox" name="version-up" checked="checked" aria-label="Checkbox for following text input">
</div>
<span class="input-group-text" id="basic-addon6">
Audio Only</span>
<div class="input-group-text">
<input type="checkbox" name="audio-only" aria-label="Check if you want to export only audio">
</div>
</div>
<div class="input-group-append">
<button id="btn-publish" type="button" class="btn btn-info btn-sm btn-block">Publish</button>
</div>
</div>
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to sending data json</span>
<div class="input-group-text">
<input type="text" name="send-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-send-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to getting data json</span>
<div class="input-group-text">
<input type="text" name="get-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-prepend">
<button id="btn-get-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
<div class="input-group-append">
<button id="btn-metadata" type="button" class="btn btn-info btn-sm btn-block">Injest metadata</button>
</div>
</div>
</li>
<li class="list-group-item"><button type="button" class="btn btn-info btn-sm btn-block" id="btn-newWorkfileVersion">Save next workfile version</button></li>
<li class="list-group-item"><button type="button" class="btn btn-info btn-sm btn-block" id="btn-get-frame">Get screen grab</button></li>
<li class="list-group-item" id="load">
<h5>Load/Update assets to timeline</h5>
<pre><code class="js"></code></pre>
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Type</span>
<div class="input-group-text">
<input type="text" name="type" placeholder="renderAnimation" aria-label="Asset Type" aria-describedby="basic-addon5" value="renderAnimation">
</div>
<span class="input-group-text" id="basic-addon6">Ext</span>
<div class="input-group-text">
<input type="text" name="ext" placeholder="mxf" aria-label="File Extension" aria-describedby="basic-addon5" value="mxf">
</div>
<div class="input-group-append">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-getRernderAnimation">DO IT!</button>
</div>
</div>
</li>
</ul>
<hr />
<div class="col-md-6" id="source">
<!-- <pre>
<code class="python"></code>
</pre> -->
<button id="btn-rename" type="button" class="btn btn-info btn-sm btn-block">Rename</button>
</div>
</div>
<h5>Output</h5>
<div class="row" id="output">
</li>
<li class="list-group-item" id="publish">
<h5>Publish</h5>
<pre><code class="js"></code></pre>
<div class="input-group input-group-lg mb-4">
<!-- <div class="input-group-prepend"> <span class="input-group-text" id="basic-addon6">GUI</span> <div class="input-group-text"> <input type="checkbox" name="gui" checked="checked" aria-label="Checkbox for following text input"> </div> </div> -->
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Version Up</span>
<div class="input-group-text">
<input type="checkbox" name="version-up" checked="checked" aria-label="Checkbox for following text input">
</div>
<span class="input-group-text" id="basic-addon6">
Audio Only</span>
<div class="input-group-text">
<input type="checkbox" name="audio-only" aria-label="Check if you want to export only audio">
</div>
</div>
<div class="input-group-append">
<button id="btn-publish" type="button" class="btn btn-info btn-sm btn-block">Publish</button>
</div>
</div>
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to sending data json</span>
<div class="input-group-text">
<input type="text" name="send-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-send-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to getting data json</span>
<div class="input-group-text">
<input type="text" name="get-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-prepend">
<button id="btn-get-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
<div class="input-group-append">
<button id="btn-metadata" type="button" class="btn btn-info btn-sm btn-block">Injest metadata</button>
</div>
</div>
<script src="./js/pico_client.js"></script>
<script src="./js/avalon.js"></script>
</li>
<li class="list-group-item">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-newWorkfileVersion">Save next workfile version</button>
</li>
<li class="list-group-item">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-get-frame">Get screen grab</button>
</li>
<li class="list-group-item" id="load">
<h5>Load/Update assets to timeline</h5>
<pre><code class="js"></code></pre>
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Type</span>
<div class="input-group-text">
<input type="text" name="type" placeholder="renderAnimation" aria-label="Asset Type" aria-describedby="basic-addon5" value="renderAnimation">
</div>
<span class="input-group-text" id="basic-addon6">Ext</span>
<div class="input-group-text">
<input type="text" name="ext" placeholder="mxf" aria-label="File Extension" aria-describedby="basic-addon5" value="mxf">
</div>
<div class="input-group-append">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-getRernderAnimation">DO IT!</button>
</div>
</div>
</li>
</ul>
<hr />
<div class="col-md-6" id="source">
<!-- <pre> <code class="python"></code> </pre> -->
</div>
<h5>Output</h5>
<div class="row" id="output"></div>
<script src="./js/pype_restapi_client.js"></script>
<script src="./js/avalon.js"></script>
</body>
</html>

View file

@ -1,75 +0,0 @@
// pico connection of python module name
var api = pico.importModule('api');
function querySelector(parent) {
return function (child) {
return document.querySelector(parent).querySelector(child)
};
}
var defs = {}
function jumpTo(name) {
var e = defs[name];
document.querySelectorAll('.highlight').forEach(function (el) {
el.classList.remove('highlight');
});
e.classList.add('highlight');
return false;
}
function unindent(code) {
var lines = code.split('\n');
var margin = -1;
for (var j = 0; j < lines.length; j++) {
var l = lines[j];
for (i = 0; i < l.length; i++) {
if (l[i] != " ") {
margin = i;
break;
}
}
if (margin > -1) {
break;
}
}
lines = lines.slice(j);
return lines.map(function (s) {
return s.substr(margin)
}).join('\n');
}
function ready() {
// // set the <code> element of each example to the corresponding functions source
// document.querySelectorAll('li pre code.js').forEach(function(e){
// var id = e.parentElement.parentElement.id;
// var f = window[id];
// var code = f.toString().split('\n').slice(2, -1).join('\n');
// e.innerText = unindent(code);
// })
document.querySelectorAll('li pre code.html').forEach(function (e) {
var html = e.parentElement.parentElement.querySelector('div.example').innerHTML;
e.innerText = unindent(html);
})
hljs.initHighlighting();
// // find all the elements representing the function definitions in the python source
// document.querySelectorAll('.python .hljs-function .hljs-title').forEach(function(e){
// var a = document.createElement('a');
// a.name = e.innerText;
// e.parentElement.insertBefore(a, e)
// return defs[e.innerText] = e.parentElement;
// });
// convert all 'api.X' strings to hyperlinks to jump to python source
document.querySelectorAll('.js').forEach(function (e) {
var code = e.innerHTML;
Object.keys(defs).forEach(function (k) {
code = code.replace('api.' + k + '(', '<a href="#' + k + '" onclick="jumpTo(\'' + k + '\')">api.' + k + '</a>(');
})
e.innerHTML = code;
})
}

View file

@ -1,7 +1,7 @@
// pico connection of python module name
var api = pico.importModule('api');
// connecting pype module
var api = {};
function querySelector(parent) {
function querySelector (parent) {
return function (child) {
return document.querySelector(parent).querySelector(child)
};
@ -9,7 +9,7 @@ function querySelector(parent) {
var defs = {}
function jumpTo(name) {
function jumpTo (name) {
var e = defs[name];
document.querySelectorAll('.highlight').forEach(function (el) {
el.classList.remove('highlight');
@ -18,7 +18,7 @@ function jumpTo(name) {
return false;
}
function unindent(code) {
function unindent (code) {
var lines = code.split('\n');
var margin = -1;
for (var j = 0; j < lines.length; j++) {
@ -40,7 +40,7 @@ function unindent(code) {
}
function ready() {
function ready () {
// // set the <code> element of each example to the corresponding functions source
// document.querySelectorAll('li pre code.js').forEach(function(e){
// var id = e.parentElement.parentElement.id;