All pastes #2889 Raw Edit

duck

public text v1 · immutable
#2889 ·published 2004-12-11 21:26 UTC
rendered paste body
<html>
<head>
  <script>
    function DijjerObject() {
        // Reasonable defaults
        this.dijjerUrl = 'http://127.0.0.1:9115/';
        this.gifUrl = this.dijjerUrl + 'graph.gif';

        this.i = new Image();

        this.init = function() {
            this.i.src = this.gifUrl;
        }

        this.check = function() {
            return this.i.width > 0;
        }

        this.makeUrl = function( url ) {
            return this.dijjerUrl + url;
        }
    }
    var Dijjer;

    function body_onLoad(){
        Dijjer = new DijjerObject();
        Dijjer.init();
    }

    function doDijjer( url ){
        obj = document.getElementById('dijjerOutput');
        if (Dijjer.check()) {
            obj.innerHTML = 'Dijjer detected; <a href="'+Dijjer.makeUrl(url)+'">click to download</a>';
        } else {
            obj.innerHTML = 'Dijjer is not running, download it from <a href="http://dijjer.org/">dijjer.org</a>';
        }
    }
  </script>
  <title>DijjerCheck Demo</title>
</head>
<body onLoad="body_onLoad();">

<h1>DijjerCheck Demo</h1>

<form name="theForm" onSubmit="return false;">
  <input type="text" size="80" name="url" value="http://www.archive.org/download/Evolutio2001/Evolutio2001.mpeg" />

  <input type="button" value="Try to Dijjer" onClick="doDijjer(document.forms['theForm']['url'].value);"><br>
    <br>
  <div id="dijjerOutput" style="border: 1px">
    Click the button to detect Dijjer.
  </div>
</form>

<hr/>
Written by duck in 2004 and released into the public domain.

</body>
</html>