Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing DevTools Console Errors #227

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
if (src.startsWith("data:image")) {
continue;
}

if(window.chrome.webview === undefined) return;
//request the icon from the extension.
var base64String = await window.chrome.webview.hostObjects.bridgeTwoWay.GetBase64StringFromPath(src);
if (currentImage != null) {
Expand All @@ -195,6 +197,7 @@
}

function refreshLibraryView(libraryController) {
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage("RefreshLibrary");
}

Expand All @@ -203,13 +206,15 @@
var encodedText = encodeURIComponent(text);
//save the callback so we can access from our completion function
searchCallback = callback;
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({"func":"performSearch","data":encodedText}));
window.chrome.webview.postMessage(JSON.stringify({"func":"logEventsToInstrumentation","data":["Search",encodedText]}));
}

// Register event handlers for various events on library controller and package controller.
libController.on(libController.ItemClickedEventName, function (nodeCreationName) {
console.log('Library Node Clicked: ' + nodeCreationName);
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({"func":"createNode","data":nodeCreationName}));
});

Expand All @@ -225,15 +230,18 @@
}, true);

libController.on(libController.ItemMouseEnterEventName, function (arg) {
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({"func":"showNodeTooltip","data":[arg.data,arg.rect.top]}));
});

libController.on(libController.ItemMouseLeaveEventName, function (arg) {
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({"func":"closeNodeTooltip","data":true}));
});

libController.on(libController.SectionIconClickedEventName, function (section) {
console.log("Section clicked: " + section);
if(window.chrome.webview === undefined) return;
if (section == "Add-ons") {
window.chrome.webview.postMessage(JSON.stringify({"func":"importLibrary","data":""}));
}
Expand All @@ -245,11 +253,13 @@
var catString = elem.name + ":" + (elem.checked ? "Selected" : "Unselected");
categories.push(catString);
});
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({"func":"logEventsToInstrumentation","data":["Filter-Categories",categories.join(",")]}));
});

//This will call the NextStep() function located in the LibraryViewController
function nextStepInGuide() {
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({ "func": "NextStep", "data": "" }));
}

Expand Down Expand Up @@ -436,6 +446,7 @@

//This method will be executed when the WebBrowser change its size, so we can update the Popup vertical location that is over the library
function bodyResizeEvent() {
if(window.chrome.webview === undefined) return;
window.chrome.webview.postMessage(JSON.stringify({ "func": "ResizedEvent", "data": "" }));
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamods/librariejs",
"version": "1.0.2",
"version": "1.0.3",
"description": "Project that contains all hosted contents of Dynamo Windows client",
"main": "index.js",
"scripts": {
Expand Down
Loading