Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



GreaseMonkey Javascript to loolp display all images on double click


Home  > JAVASCRIPT  > GreaseMonkey Javascript to loolp display all images on double click 
       
This is a GreaseMonkey should i type Grease Monkey javascript for more readbility :) 

Any way the monkey script below displays all the images getting in from a loop . better words if there are series of 
images ending with a number then it displays all of them on dobule click in pace of the oreginal one

eg if the image ends with 

image10.jpg 

double click on it. 

It will display images image1.jpg image2.jpg image3.jpg etc. 


Opps forgot the js. here u go. 


// ==UserScript==
// @name           Pics
// @namespace      Pics
// @include        *
// ==/UserScript==


var Images = document.getElementsByTagName('img');
var i = 0;
for (i = 0; i < images.length;="" i++)="" {="" images[i].addeventlistener("dblclick",="" downloadimages="" ,="" true);="" }="" function="" downloadimages()="" {="" var="" img1="this;" var="" imgstring="" ;="" var="" numstring="getlastintstring(img1.src)+" .";"="" var="" i="0;" imgstring="imgstring" +="">");
    for (i = 0; i < 120;="" i++)="" {="" var="" im="img1.src.replace(numstring," i+".");="" imgstring="imgstring" +="">");
    }
    for (i = 0; i < 120;="" i++)="" {="" var="" im="img1.src.replace(numstring," "0"="" +="" i="" +="" ".");="" imgstring="imgstring" +="">");
    }
    for (i = 0; i < 120;="" i++)="" {="" var="" im="img1.src.replace(numstring," +="" "00"="" +="" i="" +="" ".");="" imgstring="imgstring" +="">");
    }
    for (i = 0; i < 120;="" i++)="" {="" var="" im="img1.src.replace(numstring," "000"="" +="" i="" +="" ".");="" imgstring="imgstring" +="">");
    }

    this.parentNode.innerHTML = imgstring;
}



function getlastintstring(str) {
    var bnumeric = 0;
    var strlength = str.length;
    var numstr = "";
    for (strlength = strlength; strlength > 0; strlength--) {
        if (IsNumeric(str.substring(strlength, strlength + 1))) {
            numstr = str.substring(strlength, strlength + 1) + numstr;
            bnumeric = 1;
        } else {
            if (bnumeric > 0) {
                return numstr;
            }
        }
    }
    return numstr;
}

function IsNumeric(val) {

    if (isNaN(parseFloat(val))) {

        return false;

    }

    return true

}



I have named the js as pic. 

Note this works only on firefox with greasemonkey. u can make use of this javascript for other purposes as well. 

Thanks!
  Murugan
cancelBubble or cancel bubbling in firefox and ie

detect ctrl key press javascript

How Ajax Work

index

invoke button using javascript

javascript eval ajax

Javascript function to get outerHTML

javascript nested onclick problem not calling inner elements onclick only outer

javascript special key press

outerHTML firefox

passing window.event to a function in firefox javascript function

Remove Blank Geasemonkey

File.exist function in javascript

Javascript function IsNumeric to check if the string is Numeric

Javascript function getlastintstring to get last integers string from a string

GreaseMonkey Javascript to loolp display all images on double click

Javascript function String.contains to check if a string exisit in a string.

firefox problem outerHTML not supported solved

greasemonkey javascript grease monkey show image which are not displayed

Javascript how to navigate to a new page using javascript

Javascript modify title using javascript

passing parameter to a setTimeout Function

Javascript open new window and write content

javascript function xmlhttprequest accessing external site problem greasemonkey solution

javascript end of line

Javascript String Contain or Contains

javascript function substringbetween to find substring of a string betwen two substrings

extended javascript function contains substringBetween

Javascript Validtion Function IsEMail to check if its email

clear the elements of a dropdownlist using javascript

Javascript function to add elements to a dropdownlist

masked div popup light transparent area over html page using html css and javascript

Javascript Select Options Get Selected Value javascript

Jquery Get Selected Value

Jquery Get Selected Text



  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam