Recent posts by bananaphone

Subscribe to Recent posts by bananaphone 16 posts found

May 22, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Ok finally done!!
The script can be downloaded here:
http://userscripts.org/scripts/show/9407

Thank you so much for helping me out!

 
May 22, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

That first function didn't work.. or I don't get how to use it... Say if

<div class="modelinkOn">
<nobr id="mode-month">
Month
</nobr>
</div>
changes to
<div class="modelinkOff">
<nobr id="mode-month">
Month
</nobr>
</div>
Can you dectect it and run a function then?



But isn't there any way to listen for clicks thats comes from specific class? That would be the easiest way for me, because now all clicks activates my function and it craps up.

So I only want to run my function when you click on this specific link:

<td class="noprint">
  <img class="navbutton" src="images/btn_next.gif" style="vertical-align: middle; padding-left: 2px;
 padding-right: 2px;" onmousedown="fd(1);return false;" height="17" width="29">
</td>

Is it possible?
sigh.. I have been fiddling with this script for 6 hours straight and nothing works...

 
May 22, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Now almost everything is working.. Just one thing left to do. I need to get the script to stay on place in google calendar.
The script get flushed away when google calender redraws the page. It shows for a few seconds and then google redraws the page and it disappears.
I tried to do like this

function showWeeklings() {	
the script...
}
window.addEventListener('load',showWeeklings,false);
window.addEventListener('click',showWeeklings,false);

It stays when I reload the page (hit f5) but it doesn't stay on the initial load (when u first go to the page).
Also is there any way do so the click listener only can run one time? Or even better if the click listner only listens to a click event from a specific class like this one:
<td class="noprint">
  <button disabled="disabled" onclick="fd(0);return false;" id="todayButton" style="padding: 0px 1px; font-size: 85%; vertical-align: middle;">
 Today
  </button>
</td>

 
May 22, 2007
bananaphone 26 posts

Topic: Script development / How to get started

Also this page is very useful for xpath expressions:
http://www.zvon.org/xxl/XPathTutorial/General/e... (added to the wiki)

 
May 22, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Thanks Arvid for the solution and for the coding tip, Descriptor. Regular expressions is nothing new to as I have experienced it with php coding. The big problem is this.Object.Oriented.Programming style with methods and how all objects are related to each other.

 
May 21, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Ok thanks for that guys!
Now Im up to fetch another value, and I was thinking of using Xpath this time too.
The value I want to fetch is bold:

<span onmousedown="sA('20070501)">may 2007</span>

I was thinking of using this xpath:

	var displayDate = document.evaluate("//span[contains(@onmousedown, 'sA')]",
	                             document,
	                             null,
	                             XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
	                             null);
	if (!displayDate.snapshotLength) return;

   showdate = displayDate.snapshotItem(0).textContent;
	 alert (showdate);

But it displays the value IN the node (may 2007) but I want to fetch the value of the onmousedown attribute itself. Is that possible with xpath?

 
May 21, 2007
bananaphone 26 posts

Topic: Script development / How to get started

Much of the information in Dive into Greasemonkey is outdated.

 
May 21, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Thank you for helping.. now I want to go on.. but the greasemonkey tutorials are very sparse and/or outdated, and the wiki don't give much for a newcomer.
So to next problem:
All

classes I mentioned also contain a xy value and I would like to fetch that value for each div. (Before adding the date span.)
Like this:

MyValue

So I want to store MyValue in a variable. Can you do that with Xpath to?
Thats is the last thing a need help with I think :)

 
May 20, 2007
bananaphone 26 posts

Topic: Script development / Add line after a specific <div>

Im new to greasemonkey and userscripts but I starting to learn stuff. Now I need help with a basic thing I want to do.
All I want to add this line:
date
after the following

:

The id attribute is specific on each. Like this: id="rg_rowy_hN" which changes from 0-4 like this:





And I want my line after each of them..
The site I'm working is Google calendar.

I hope it's not more complicated than I think.

 
Apr 15, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Show (ISO) week number in google calendar

The week number is the current number of the week counted from the beginning of the year. The system is used (mainly) in government and business for fiscal years, as well as in timekeeping. In guess it is not widely used (or at all) in the US but its quite common in Scandinavia and other parts of Europe.
More info:
http://en.wikipedia.org/wiki/ISO_week_date

I would like to see this numbering in Google calendar, but since my javascript isn't very well I ask for your help. After some googleing I found a decent function that calculates current week number so the task would be to attach the number to the calendar.
Function getISOWeek(): http://www.meanfreepath.com/support/getting_iso...
I suggest to put the number in the Monday column at the date row. Check my screenshot below for an example.
http://xs114.xs.to/xs114/07150/weeknumber.png

 
Mar 18, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

Yes, I just tried to reinstall the script and greasemonkey and other extensions. Nothing changed.
The problem lies in the script because it works from google calender -> gmail but not on gmail -> gmail calendar.
But I just did a weird discovery right now..I just tried another gmail account.. and guess what.. it worked.
So I began to investigate what differed that account to mine .. All settings was basically the same except on thing.. It had the default option: "standard view with chat " enabled while I had "standard without chat". I did a quick switch and the script worked fine.. (the option can be made at the bottom of the gmail page)

So enabling Gmail view: "standard without chat" will break this script.

 
Mar 18, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

URL:
https://mail.google.com/mail/?ik=&search=inbox&...
There is a lot of errors in the javascript console, when loading gmail
See screenshot:
http://xs413.xs.to/xs413/07110/gerror.png
I have also tried to disable all other Greasemonkey scripts.

 
Mar 18, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

Thank you, but it still doesn't work. Maybe someelse could verify? I am running latest version of firefox and greasemonkey.

 
Mar 16, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

No, it doesn't touch the targets attributes at all.
This is how the html looks for me (with the cornerbookmarks script enabled)
http://xs413.xs.to/xs413/07115/gmai2l.png

However it works fine at the calendar page. (calender->gmail links etc).. That is weird.

 
Mar 16, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

Thank you, but it doesn't seem to work.

 
Mar 15, 2007
bananaphone 26 posts

Topic: Ideas and script requests / Prevent links in upper panel in gmail to open i new window

I would like to force the links in the upper blue link panel (image below) to open i the same window. This is to prevent opening multiple windows when switch back and forward to different google services.
Links that have the link panel is particular important. These are Gmail itself, Google calendar and Docs & Spreadsheets.
Image
http://xs313.xs.to/xs313/07115/gmail.png