Skip to content

Commit

Permalink
Bug Fixes: Plugin/icons not loading
Browse files Browse the repository at this point in the history
Arrow Expressions removed in static js files which may be causing fallback error
  • Loading branch information
tarunmangukiya committed Aug 29, 2017
1 parent f62d91b commit 48a7467
Show file tree
Hide file tree
Showing 23 changed files with 1,826 additions and 20 deletions.
1 change: 1 addition & 0 deletions Icondrop.sketchplugin/Contents/Resources/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Iconscout License Details
11 changes: 6 additions & 5 deletions Icondrop.sketchplugin/Contents/Resources/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"main.css": "static/css/main.cfd140e6.css",
"main.css.map": "static/css/main.cfd140e6.css.map",
"main.js": "static/js/main.eba78af9.js",
"main.js.map": "static/js/main.eba78af9.js.map",
"main.css": "static/css/main.62522457.css",
"main.css.map": "static/css/main.62522457.css.map",
"main.js": "static/js/main.10aa40fc.js",
"main.js.map": "static/js/main.10aa40fc.js.map",
"static\\media\\Lato-Black.ttf": "static/media/Lato-Black.77d35374.ttf",
"static\\media\\Lato-Bold.ttf": "static/media/Lato-Bold.44dfe8cc.ttf",
"static\\media\\Lato-Hairline.ttf": "static/media/Lato-Hairline.db15ac79.ttf",
Expand All @@ -16,7 +16,8 @@
"static\\media\\NunitoSans-Regular.ttf": "static/media/NunitoSans-Regular.fb98ed17.ttf",
"static\\media\\NunitoSans-SemiBold.ttf": "static/media/NunitoSans-SemiBold.9c443ad7.ttf",
"static\\media\\icon-back.svg": "static/media/icon-back.4c7be5bc.svg",
"static\\media\\icon-download.svg": "static/media/icon-download.012c24d1.svg",
"static\\media\\icon-download.svg": "static/media/icon-download.ad0b5424.svg",
"static\\media\\icon-downloads.svg": "static/media/icon-downloads.012c24d1.svg",
"static\\media\\icon-scout.svg": "static/media/icon-scout.a64a8ee8.svg",
"static\\media\\no-results.svg": "static/media/no-results.e43118a5.svg"
}
93 changes: 93 additions & 0 deletions Icondrop.sketchplugin/Contents/Resources/common/adobe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
function getScript(source, callback) {
var script = document.createElement('script');
var prior = document.getElementsByTagName('script')[0];
script.async = 1;

script.onload = script.onreadystatechange = function( _, isAbort ) {
if(isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) {
script.onload = script.onreadystatechange = null;
script = undefined;

if(!isAbort) { if(callback) callback(); }
}
};

script.src = source;
prior.parentNode.insertBefore(script, prior);
}

// CSInterface Object Global
cs = null;

// Include Scripts
/* getScript('./js/polyfill.min.js', function () {
}); */
getScript('./common/adobe/CSInterface.js', function () {
cs = new CSInterface();

// Load Manifest
getScript('./common/adobe/manifest.js', function () {
loadManifest();
});
});
getScript('./common/adobe/placeImage.js', function () {

});

var Storage = function () {

}
Storage.prototype.has = function (key) {
return (localStorage[key] !== undefined)
}
Storage.prototype.get = function (key) {
if(this.has(key)) {
return localStorage[key];
}
return null;
}
Storage.prototype.set = function (key, value) {
localStorage.setItem(key, value);
}
Storage.prototype.clear = function (key) {
localStorage.clear(key);
}

Storage.prototype.getJSON = function (key) {
if(this.has(key)) {
return this.parseJSON(localStorage[key]);
}
return null;
}
Storage.prototype.putJSON = function (key, value) {
this.set(key, JSON.stringify(value));
}
Storage.prototype.parseJSON = function (value) {
try {
return JSON.parse(value)
}
catch (e) {
return null
}
}

var app = app || {
output: 'adobe',
vector_file: 'svg',
in_app_errors: true
};

app.insertIcon = function (file) {
placeImage(file);
}

app.openURL = function (url) {
cs.openURLInDefaultBrowser(url);
}

app.showMessage = function (message) {
console.log("Message: " + message);
}

app.storage = new Storage();
Loading

0 comments on commit 48a7467

Please sign in to comment.