Skip to content

Instantly share code, notes, and snippets.

@rodchyn
Created March 19, 2013 17:46
Show Gist options
  • Save rodchyn/5198333 to your computer and use it in GitHub Desktop.
Save rodchyn/5198333 to your computer and use it in GitHub Desktop.
Gmail jQuery Selectors for different objects
;(function($) {
var selectedRow = $("#canvas_frame").contents().find('tr').removeClass('sel').end().find('.oZ-jd[style*=visibility]').closest('tr').addClass('sel');
var nonSelectedRows = selectedRow.closest('table').find('tr').not('.sel');
var selects = {
"subject": ".hP",
"addresses": "span.gD", // Email addresses in thread
"thread-text": ".Bu:first", // Email thread text
"sidebar": ".Bu:last", // Sidebar
frameId: 'canvas_frame',
toolbar: '.iH[gh=mtb]',
title: '.hP:visible',
from: '.gD',
buttonClasses: 'T-I J-J5-Ji ar7 nf T-I-ax7 L3',
buttonActive: 'T-I-Kq',
buttonHover: 'T-I-JW',
boxClasses: 'J-M jQjAxd',
menuItemHover: 'J-N-JT',
notificationBar: '.b8.UC',
notificationText: '.b8.UC .vh',
containerClasses: '.G-Ni.J-J5-Ji',
singleMessage: '.h7:visible', // the :visible is to get rid of left-overs when going to next message
lastMessage: '.h7.ie',
sender: '.gD', // looks like <span email="sen@der.com">Sen Der</span>
recipient: '.g2', // same as above, different class
datetime: '.g3',
messageText: '.ii.gt.adP.adO',
sidebarContainerSeparator: '.nH.Pj', // separator between ads and contact info
replyBox: '.gA.gt',
userEmail: '[aria-owns=gbd4]',
userName: '#gbmpn'
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment