InboxSDK.load(1, 'sidebar-example').then(function(sdk) {
sdk.Conversations.registerThreadViewHandler(function(threadView){
var el = document.createElement("div");
el.innerHTML = 'Hello world!';
threadView.addSidebarContentPanel({
title: 'Sidebar Example',
el: el
});
});
});--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/7fbcd541-8a85-4f00-9934-ccbbb8a82702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/4028ebd9-c51c-423f-bd68-cb4a65a287ca%40googlegroups.com.
//manifest.json
{
"name": "Sidebar extension",
"description": "ThreadView sidebar",
"version": "0.1",
"content_scripts": [
{
"matches": [
"https://mail.google.com/*",
"https://inbox.google.com/*"
],
"js": ["jquery.min.js","inboxsdk.js","content.js"],
"css": ["styles.css"],
"run_at": "document_end"
}
],
"permissions": [
"https://mail.google.com/",
"https://inbox.google.com/"
],
"web_accessible_resources": [
"sidebar.html"
],
"manifest_version": 2
}//content.js
InboxSDK.load(1, 'myappid').then(function(sdk) {
sdk.Conversations.registerThreadViewHandler(function(ThreadView){
addSidebar(ThreadView);
});
});
function addSidebar(ThreadView) {
var el = document.createElement("div");
$('#el').get(chrome.runtime.getURL('sidebar.html')); //attempted different ways to insert sidebar.html, this is 1 of them
ThreadView.addSidebarContentPanel({
title: 'App Title',
iconUrl: 'icon.png',
el: el
})
};
...//sidebar.html
<div class="class1">
<div class="name">contact.Name</div>
<div>some text</div>
</div>
...To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/d4b76f6f-322a-4e19-a6e4-0e02055d8e30%40googlegroups.com.