Comments by Edo78 on scripts

15 comments

Comment on:
identi.send

Sep 5, 2008

Now identi.ca has this function out of the box :-)

Comment on:
LinuxToday Loader

Aug 28, 2008

I'm thinking about writing a script like this one ... then I found it :-D

Comment on:
Gmail HTML Signatures

Jun 12, 2008

I like your extension but it's a little "problematic" with FF3.
With the new release of FF it can handle protocols like "mailto:" but if I define a "body" parameter in mailto link it's overwritten by the signature.

es. Test Me!

Comment on:
Userscripts Updater

Jun 3, 2008

I add a global
var zindex=GM_getValue('zindex',32768);

and change the div creation in updateScript to
div = createElement('div', {style:"background-color:#FFFFAA; position:absolute; top:3px; right:3px; min-width:250px; min-height:50px; padding:5px; font-size:small; z-index:"+zindex});

but I'm thinking about made it customizable ...

In my spare time I'll work on the auto-check function then I'll post my patch here so you can check it.

Comment on:
Userscripts Updater

Jun 2, 2008

I have just a little request: can you made the position of the box configurable ?
I have another script that use the upper right corner so they conflict ...

Another request (not so little this time) is:
can you modify your script to check every X hours and opening the box if some script is update ?

I'm thinking about writing a patch (with setTimeout, GM_setValue and GM_getValue so the timeout is persistent between sessions) but having it in the official version is a bigger advance.

Comment on:
Google Reader + del.icio.us

May 30, 2008

I'm working on a keyboard shortcut.
I'm thinking about "d" if only one star button is available or "d-1", "d-2" ... "d-N" when available N star button.

What do you think about ?

Comment on:
Google Reader + del.icio.us

May 21, 2008

@D.Bell
In FF 3 rc1 it's working again.

Comment on:
Gmail2 Saved Searches

May 10, 2008

I'm working on a complete rewrite version of this script with some new features. Stay tuned.

Comment on:
Google Reader + del.icio.us

May 6, 2008

ok, now it's work again ;-)

Comment on:
Google Reader + del.icio.us

May 6, 2008

Google Reader has changed to add more functionalities but this break my script, I'm working to solve this problem.

Comment on:
Gmail2 Saved Searches

Apr 24, 2008

Yeah, I've done it !!!

// Copyright 2008 by N-Dream.com (Andrin von Rechenberg)
//
// ==UserScript==
// @name          Gmail2 Saved Searches
// @namespace     http://mail.google.com/
// @description   Adds a Saved Search nav box to Gmail
// @include       http://mail.google.com/*
// @include       https://mail.google.com/*
// ==/UserScript==

window.addEventListener('load', function() {
  if (unsafeWindow.gmonkey) {
    unsafeWindow.gmonkey.load('1.0', init)
  }
}, true);

function hostId() {
  var id = "s";
  var l = top.location.href;
  var n = l.indexOf("mail.google.com/a/");
  if (n != -1) {
    l = l.substr(n + 18);
    l = l.substr(0, l.indexOf("/"));
    id += l;
  }
  return id;
}

function getData() {
  return GM_getValue(hostId(), "to me directly|#search/to%3Ame\n");
}

function addSearchElement(gmail, module, text, search) {
  var div = gmail.getNavPaneElement().ownerDocument.createElement('div');
  with(div.style) {
    background = 'white';
    color = 'rgb(125,108,58)';
    padding = '4px';
  }

  // Creating delete button
  var del = document.createElement('span');
  with(del.style) {
    cursor = 'pointer';
  }
  del.appendChild(document.createTextNode('x'));
  var newStyle = del.style.cssText + 'float:right;'
  del.setAttribute('style', newStyle);

  var h = hostId();
  del.addEventListener('click', function(evt) {
    window.setTimeout(function() {
      var parts = getData();
      parts = parts.split("\n");
      newparts = "";
      for (var i = 0; i < parts.length; ++i) {
        if (parts[i].indexOf(text + "|") != 0) {
          newparts += parts[i] + "\n";
        }
      }
      GM_setValue(h, newparts);
      redraw(gmail, module);
    }, 0);
  }, false);

  
  // Creating label
  var label = document.createElement('span');
  label.appendChild(document.createTextNode(text));
  with(label.style) {
    cursor = 'pointer';
    textDecoration = 'underline';
  }

  label.addEventListener('click', function(evt) {
    top.location.hash = search;
  }, false);

  // Appending children
  div.appendChild(del);
  div.appendChild(label);
  module.getContentElement().appendChild(div);
}

function addFooterElement(gmail, module) {
  var div = gmail.getNavPaneElement().ownerDocument.createElement('div');
  with(div.style) {
    background = 'white';
    color = 'rgb(125,108,58)';
    padding = '4px';
    fontSize = '80%';
  }

  // Creating help button
  var help = document.createElement('span');
  with(help.style) {
    cursor = 'pointer';
  }
  help.appendChild(document.createTextNode('?'));
  var newStyle = help.style.cssText + 'float:right;'
  help.setAttribute('style', newStyle);
  help.addEventListener('click', function(evt) {
    window.location.href = "http://userscripts.org/scripts/show/20214";
  }, false);

  // Creating Save Button
  var save = document.createElement('span');
  save.appendChild(document.createTextNode("Save this search..."));
  with(save.style) {
    cursor = 'pointer';
    textDecoration = 'underline';
  }
  var h = hostId();
  save.addEventListener('click', function(evt) {
    window.setTimeout(function() {
      var name = "";
      var current = getData();
      while (name == "" || 
            name.indexOf("|") != -1 ||
            current.indexOf(name + "|") != -1) {
        name = prompt("Please enter a name for this search", name);
        if (name == null) {
          return;
        }
        if (name.indexOf("|") != -1) {
          alert("| is not allowed.")
        }
        if (current.indexOf(name + "|") != -1) {
          alert("'" + name + "' is already taken.")
        }
      }
      GM_setValue(h, current + name + "|" + top.location.hash + "\n");
      redraw(gmail, module);
    }, 0);
  }, false);

  // Appending children
  div.appendChild(help);
  div.appendChild(save);
  module.getContentElement().appendChild(div);
}

function redraw(gmail, module) {
  var m = module.getContentElement();
  while (m.childNodes.length) {
    m.removeChild(m.firstChild);
  }
  window.setTimeout(function() {
    var parts = getData();
    parts = parts.split("\n").sort();
    for (var i = 0; i < parts.length; ++i) {
      var n = parts[i].indexOf("|");
      if (n != -1) {
        addSearchElement(gmail, module, parts[i].substr(0, n),
          parts[i].substr(n + 1));
      }
    }
    addFooterElement(gmail, module);
  }, 0);
}

function init(gmail) {
  var module = gmail.addNavModule('Searches', '', 'rgb(251,216,117)');
  redraw(gmail, module);
}

Maybe it can be better than this but it's just my second greasemonkey script ...

Comment on:
Gmail2 Saved Searches

Apr 24, 2008

I'm trying to fix this script but it has a lot of problem (I think because of gmail/greasemonkey update) one of that I can't yet fix completely :-(

The biggest problem is related to a greasemonkey update and is described here http://wiki.greasespot.net/0.7.20080121.0_compa...

I'm not to good in javascript programming (not yet ;-) at least) and change the getData function into

function getData() {
  var value;
  window.setTimeout(function() {
    value = GM_getValue(hostId(), "to me directly|#search/to%3Ame\n");
  }, 0);
  while(typeof(value)=="undefined") {
    /* if you know how to use a "sleep" like function you can safely remove this crappy alert*/
    alert("this alert is useful only to wait for the setTimeou to retrive the searches");
  }
  return value;
}

that crappy alert is really annoying but it's the only method I find in this short time (I'm not a javascript programmer and I'm at work).

The second problem is a little one, probably coming from a gmail update ... every window.location must be changed in top.location because gmail load itself in a frame.

Hoping this can help.
Meanwhile I try to solve the "alert" problem ...

Comment on:
Gmail2 Saved Searches

Apr 24, 2008

I have the same problem described by tcustomgolf ...
I try it in a clean FF profile only with greasemonkey and your script :-(

Comment on:
Reveal snipurl

Apr 21, 2008

I have changed

onload: function(details) {
match=match_snipredirect(details.responseText);
if (match) {
link.title = match[1];
}
}

with

onload: function(details) {
link.title=details.responseText;
}

to make it work ...

Comment on:
Google Reader + del.icio.us

Feb 8, 2008

I get a previous script and strongly clean to get the result I'm looking for.
Sadly I don't remember the scritp original name so if you are the writter of the original script let me know ;-)

P.S. sorry for my bad english