Show Image Popup Library

Библиотека функций PopupImage

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greasyfork.org/scripts/4524/14909/Show%20Image%20Popup%20Library.js

// ==UserScript==
// @name Show Image Popup Library
// @namespace PSVScripts
// @description Библиотека функций PopupImage
// @version 0.0.0.5
// ==/UserScript==

/*
  handler =  function(SourceObject, CallBack, ImageUrl)
  { 
    ~CallBack(SourceObject, ImageUrl);
    if CanHandle
      return true;
    else
      return false
  }
*/

var win = unsafewindow;

if (!win.PSVScript_IPHandlers)
  win.PSVScript_IPHandlers = new Array();

var handlers = win.PSVScript_IPHandlers;

if (!win.PSVScript_IPHandler)
  win.PSVScript_IPHandler = PSVScript_IPHandler;

function PSVScript_IPHandler(SourceObject, CB, ImageUrl)
{
  for (var i=0; i< handlers.length; i++)
  if (handlers[i](SourceObject, CB, ImageUrl))
    break;
}