This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The main function. | |
* @param s | |
* @returns {boolean} | |
*/ | |
function isNumber(s) { | |
s = s.trim(); | |
var chars = new Set(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates Javascript Model class with getters and setters for each property in a JSON object. | |
* For instance, if you call : | |
* | |
* var model = JsonToModel({name : 'Scott'}); | |
* | |
* You will get back: | |
* | |
* function() { | |
* this.instance = 'Model@000-000000'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* What is going on here? | |
* The Event.dataTransfer object can be set with JavaScript. When the start of a drag event is | |
* detected, we capture the SVG code as a string and set it to the EventTarget.dataTransfer object | |
* as a string. Illustrator handles the rest. | |
*/ | |
/** | |
* Add drag start callback. Add this method to the <img/> element like so: | |
* | |
* <img src="path/to/image.svg" onDragStart="onDragStart" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Scott Lewis <[email protected]> | |
* @copyright 2020 Scott Lewis | |
* @version 1.0.0 | |
* @url http://github.com/iconifyit | |
* @url https://atomiclotus.net | |
* | |
* ABOUT: | |
* | |
* This JS class is a wrapper for dialogs created with the Script UI Dialog Builder by Joonas Pääkkö. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This script creates an Adobe Illustrator action, on-the-fly, to export to SVG. The main thing to | |
* understand is that the `name` values in the action code are hexadecimal-encoded strings. The number | |
* that immediately preceeds the encoded name are the length of the hex string divided by 2. | |
* | |
* Usage: | |
* | |
* Change the `basePath` variable to match your file system. This can be set to any folder you like. | |
* | |
* Credits: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-------------------------------------------------------------------------------------------------------------------------*/ | |
/** | |
* Adds JSON library support for engines that do not include it natively. | |
*/ | |
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){ | |
return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t]; | |
return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'} | |
function str(t,e){var n,r,o,f,u,i=gap,p=e[t];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(t)), | |
"function"==typeof rep&&(p=rep.call(e,t,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null"; | |
case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(p)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage : | |
* | |
* new SelectionExporter( | |
* app.activeDocument.selection[0], | |
* '/tmp/somefolder/tempfile.ai', | |
* 'My File' | |
* ); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Export selection to SVG - export_selection_as_SVG | |
* (Adapted from Layers to SVG 0.1 - export_selection_as_SVG.jsx, by Rhys van der Waerden) | |
* | |
* @author SebCorbin | |
*/ | |
// Variables | |
var ignoreHidden = true, | |
svgExportOptions = (function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ErrorBoundary extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { error: null, errorInfo: null }; | |
} | |
componentDidCatch(error, errorInfo) { | |
// Catch errors in any components below and re-render with error message | |
this.setState({ | |
error: error, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getExportOptionsSVG() { | |
var exportOptions = new ExportOptionsSVG(); | |
/** | |
* A range of artboards to save, if saveMultipleArtboards is true. A comma-delimited list of artboard names., or the empty string to save all artboards. Default: empty String. | |
* {string} | |
* | |
* NOTE: Set to an empty string to export all. Be sure `saveMultipleArtboards` is set to true to use this. | |
*/ |