I'm trying to develop a chrome extension to interact with an email inside gmail inbox. Currently I'm using page action to show the icon of the extension and when user clicks on the icon, the plugin assumes the opened page is an email inside gmail inbox and it interacts with the email.
But it seems to be better if I can add a button to gmail web interface instead of the page action icon like below (notice the add button added by a plugin called todoist).
One way to do this is to observe html in other buttons provided by gmail,
and injecting a new button with the content script. But the classes used in elements in gmail seems to be have no verbal meaning and not sure the classes change dynamically. For example to define an icon, the html is like below.
<div class="ase T-I-J3 J-J5-Ji"></div>
Injecting may not work if the classes are changing dynamically. Also the button structure may change if the user changes different themes. (Or may be they are always the same and I can continue injecting)
Is there a standard way to do this? Or else, a stable way to inject the button?
Note: Contextual gadgets is not a solution as I want to get the attachment.
You should use gmail.js add_toolbar_button method using this you can add a custom button in Gmail inbox.
gmail.tools.add_toolbar_button('content_html', function() {
// Code here
}, 'Custom Style Classes');
There are various helper methods through this you can easily build an extension top on Gmail Inbox.
You can also use InboxSDK to inject buttons in Gmail.
Code snippet:
InboxSDK.load(1, 'YOUR_APP_ID_HERE').then(function(sdk){
sdk.Compose.registerComposeViewHandler(function(composeView){
console.log("compose view exists!");
});
});
I know this question is 4 years old but this tool could be useful for someone who is looking for a solution to inject buttons in gmail.
Related
What could be the reason why the Content Editor Toolbar of ADX Portal is not displaying, We recently published our code but then the editor toolbar is not displaying, we reverted our codes to the previous one but the same issue still occurs, while inspecting the html element the class "yui-panel-container" is there but the visibility is hidden, we change the visibility of it to visible but still there's no content.
What should be done to fix this issue?
Thanks.
If you are having the issue even after reverting your code, it makes me believe your web page access rules were changed.You must change permissions to grant on the page you want the content editor to show up.
In Administrator Web Role, make sure the target contacts are included.
Also, make sure Grant Change to Administrators is included in Web Page Access Control Rules.
Finally, in Grant Change to Administrators, make sure all required fields are filled in.
hi associate a web role to the user and then if you have created any business flow for your form in CRM , make sure to remove it and try again.
I am using WSS 3.0 in my application. I am displaying a List as a DataView Webpart. My objective here is to make this webpart visible to a selected group of individuals. As there is no option for Target Audience in WSS 3.0, I went to edit Permissions for List and gave Read permissions only to selected users. This doesn't hide the web part from the page, rather shows an Access Denied message to other users.
Access denied. You do not have permission to perform this action or access this resource.
As I said, I want to hide this webpart, as in make it invisible on the web page from other users who do not have permissions to view it. As this message will be displayed only to those users who do not have permissions!, my approach is to search for the above message in the html and identify and hide the parentnode, thereby hiding the webpart.
I am not quite sure how to do this. Any ideas? Thanks in advance!
I'm going to assume you're in a situation where you can add additional web parts to the page and not trying to add JavaScript to the DataView Web Part directly. My suggestion won't work on a separate page if a Designer adds another view of this list.
Upload a blank .js file to your Site Assets. Add a Content Editor Web Part to your page, point it at that file. Add JQuery from a provider or host it yourself, adding the reference in your file. From there, you have 3 directions in which to work: first, explore the web part with Internet Explorer's F12 Developer Tools, keeping a particular eye on divs and tables with good unique ids, names, or classes that would solve your problem if hidden. Also keep an eye on the id of the div or table or cell or whatever that contains your access denied text. Second, (assuming you're new to JQuery) do some JQuery tutorials and then start playing with selecting the above items and, say, changing their background color. Once you have both of those, you're 90% there: (try to) select the object that would contain the access denied text, and if the innerHTML is present and equals that string, then set display:none for the div or tables to hide your web part. The third tool you have is editing the page directly with SharePoint Designer: you can toss a div with an id of your choosing around any xsl:template, which might help in your JQuery selecting.
I'm sorry I can't give you the specific code, since I'm not in a position to test it. If that changes, I'll try and give a more detailed response.
Old, misdirected answer: Do either of the answers here work for you? Alternatively, this answer has some great resources to solve your problem. Just change the message to an empty string.
Thanks Aron :D
I found the id for the webpart and hard coded it. It provided the solution, but I was hoping to programmatically fetch the id instead by searching the innerhtml, as I have more than one web parts that have to be hidden.
I found a partial solution here:
Hide SharePoint web part using javascript onclick method
I put a CEWP on the page and added the following script in it:
<script>
function hide()
{
var content = document.getElementById("webpartID").innerHTML;
var n = content.search("Access denied. You do not have permission to perform this action or access this resource");
if(n!=-1)
{ document.getElementById("webpartID").style.display="none";
}
}
_spbodyonloadfunctionnames.push("hide");
</script>
In my case, I picked up the webpart id from the aspx page or view source for the page.
How can I customize the message field with Facebook share... You used to be able able to use one of the share URLs with a ?message= parameter but that no longer works... Here is what I currently use for the contents but I can't change the users default post:
FBshare
Using URL-Javascript I can alter the innerHTML of the post-field's text-area after I have gone to the URL... but I guess I can't send that information after the user has gone to the Facebook URL and left my page right?
I do believe that the old sharer.php is in the process of being deprecated.
You should convert over to using the send plugin https://developers.facebook.com/docs/reference/plugins/send/
or the like plugin https://developers.facebook.com/docs/reference/plugins/like/
Make sure your Open Graph meta tags are in order (this is where you specify title) See https://developers.facebook.com/docs/opengraph/
Hi im trying to build a mediawiki extension which requires AJAX calls during editing a page. All I need is to add a new edit button on the edit page which displays a javascript popup editor which in turn makes the appropriate calls.
I need to know if it is feasible in Mediawiki, to inject javascrpt code into edit buttons.
Any kind of information or leads are welcome!
Ok clearly the question is very specific, tht no one cared to answer. so if some one else wants to know how to add custom edit buttons in Mediawiki, this is how I did it
I found a Mediawiki help page which asks the user to edit a particular javascript page located at http://(wiki-site-url)/Mediawiki:Comomn.js .
On closer inspection this is not an actual js page but a normal wikipage(stored in the database as wikitext) which is loaded by mediawiki during runtime. The site admin can edit this page by adding
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "<path-to-image-on-the-server>",
"speedTip": "Comment visible only for editors",
"tagOpen": "open tag",
"tagClose": "closing tag",
"sampleText": "Insert comment here"}
}
This can also be achieved for a single user by applying the same edit on the users own copy of the js file available at http://(wiki-site-url/User:(Your_username)/(skinname).js
Both the js pages could be created if they dont already exist.
The wiki way is to put an HTML button into a Widget and put your JavaScript there, or better yet in its own Gadget
I'm building a facebook connect application, and here's the specific use case I'm trying to solve (using the Facebook Connect Javascript toolkit - http://github.com/facebook/connect-js)
There is a link on a page that a user clicks to "invite friends".
This click opens up a facebook friend selector widget (something like the multi-friend-selector), and the user selects friends from it.
The selected friends are POST-ed to a custom URL using an Ajax call and the selector widget goes away.
I'm able to do steps 1 and 2 using a fb:request-form and fb:multi-friend-selector. However, by default that posts to facebook and redirects the page. Is there a way to simply retrieve the UIDs of the selected users and then post them to a custom URL instead?
This topic is muddy water right now.
The current way is to implement your custom URL with an fb:req-choice in the content attribute of your fb:request-form as described here.
But as you can clearly see on that page - they are soon deprecating that element and changing how requests/invites work in general. So you can implement it like this for now, but will probably have to change it when they release more details about the new system.