This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: var s; | |
/*Figure out the selected text*/ | |
if ( window.getSelection ) { | |
s = window.getSelection(); | |
} else if ( document.getSelection ) { | |
s = document.getSelection(); | |
} else { | |
s = document.selection.createRange().text; | |
} | |
/*If there isn't any text selected, get user input*/ | |
if ( s == '' ) { | |
s = prompt('QuickAdd'); | |
} | |
var re = RegExp( '[AaPp][Mm]' ); | |
if ( encodeURIComponent(s).match(re) ) { | |
} else { | |
s = s + ' 1pm'; /*if there isn't an AM or PM in the text, add the default 1pm time*/ | |
} | |
void( | |
/*open a new window with this information in the Google Calendar event creation page.*/ | |
window.open( | |
encodeURI('http://www.google.com/calendar/event?ctext='+s+'&action=TEMPLATE&pprop=HowCreated:QUICKADD'), | |
'addwindow', | |
'status=no,toolbar=no,width=520,height=470,resizable=yes' | |
) | |
); |
No comments:
Post a Comment