~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to html/MochiKit/MockDOM.js

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***
2
 
    
3
 
MochiKit.MockDOM 1.3.1
 
2
 
 
3
MochiKit.MockDOM 1.4.2
4
4
 
5
5
See <http://mochikit.com/> for documentation, downloads, license, etc.
6
 
    
 
6
 
7
7
(c) 2005 Bob Ippolito.  All rights Reserved.
8
8
 
9
9
***/
 
10
 
10
11
if (typeof(MochiKit) == "undefined") {
11
 
    var MochiKit = {};
 
12
    MochiKit = {};
12
13
}
13
14
 
14
15
if (typeof(MochiKit.MockDOM) == "undefined") {
16
17
}
17
18
 
18
19
MochiKit.MockDOM.NAME = "MochiKit.MockDOM";
19
 
MochiKit.MockDOM.VERSION = "1.3.1";
 
20
MochiKit.MockDOM.VERSION = "1.4.2";
20
21
 
21
22
MochiKit.MockDOM.__repr__ = function () {
22
23
    return "[" + this.NAME + " " + this.VERSION + "]";
23
24
};
24
25
 
 
26
/** @id MochiKit.MockDOM.toString */
25
27
MochiKit.MockDOM.toString = function () {
26
28
    return this.__repr__();
27
29
};
28
30
 
 
31
/** @id MochiKit.MockDOM.createDocument */
29
32
MochiKit.MockDOM.createDocument = function () {
30
33
    var doc = new MochiKit.MockDOM.MockElement("DOCUMENT");
31
34
    doc.body = doc.createElement("BODY");
33
36
    return doc;
34
37
};
35
38
 
36
 
MochiKit.MockDOM.MockElement = function (name, data) {
37
 
    this.nodeName = name.toUpperCase();
38
 
    if (typeof(data) == "string") {
 
39
/** @id MochiKit.MockDOM.MockElement */
 
40
MochiKit.MockDOM.MockElement = function (name, data, ownerDocument) {
 
41
    this.tagName = this.nodeName = name.toUpperCase();
 
42
    this.ownerDocument = ownerDocument || null;
 
43
    if (name == "DOCUMENT") {
 
44
        this.nodeType = 9;
 
45
        this.childNodes = [];
 
46
    } else if (typeof(data) == "string") {
39
47
        this.nodeValue = data;
40
48
        this.nodeType = 3;
41
49
    } else {
46
54
        var nameattr = name.substring(
47
55
            name.indexOf('"') + 1, name.lastIndexOf('"'));
48
56
        name = name.substring(1, name.indexOf(" "));
49
 
        this.nodeName = name.toUpperCase();
 
57
        this.tagName = this.nodeName = name.toUpperCase();
50
58
        this.setAttribute("name", nameattr);
51
59
    }
52
60
};
53
61
 
54
62
MochiKit.MockDOM.MockElement.prototype = {
55
 
    createElement: function (nodeName) {
56
 
        return new MochiKit.MockDOM.MockElement(nodeName);
 
63
    /** @id MochiKit.MockDOM.MockElement.prototype.createElement */
 
64
    createElement: function (tagName) {
 
65
        return new MochiKit.MockDOM.MockElement(tagName, null, this.nodeType == 9 ? this : this.ownerDocument);
57
66
    },
 
67
    /** @id MochiKit.MockDOM.MockElement.prototype.createTextNode */
58
68
    createTextNode: function (text) {
59
 
        return new MochiKit.MockDOM.MockElement("text", text);
 
69
        return new MochiKit.MockDOM.MockElement("text", text, this.nodeType == 9 ? this : this.ownerDocument);
60
70
    },
 
71
    /** @id MochiKit.MockDOM.MockElement.prototype.setAttribute */
61
72
    setAttribute: function (name, value) {
62
73
        this[name] = value;
63
74
    },
 
75
    /** @id MochiKit.MockDOM.MockElement.prototype.getAttribute */
64
76
    getAttribute: function (name) {
65
77
        return this[name];
66
78
    },
 
79
    /** @id MochiKit.MockDOM.MockElement.prototype.appendChild */
67
80
    appendChild: function (child) {
68
81
        this.childNodes.push(child);
69
82
    },
 
83
    /** @id MochiKit.MockDOM.MockElement.prototype.toString */
70
84
    toString: function () {
71
 
        return "MockElement(" + this.nodeName + ")";
 
85
        return "MockElement(" + this.tagName + ")";
 
86
    },
 
87
    /** @id MochiKit.MockDOM.MockElement.prototype.getElementsByTagName */
 
88
    getElementsByTagName: function (tagName) {
 
89
        var foundElements = [];
 
90
        MochiKit.Base.nodeWalk(this, function(node){
 
91
            if (tagName == '*' || tagName == node.tagName) {
 
92
                foundElements.push(node);
 
93
                return node.childNodes;
 
94
            }
 
95
        });
 
96
        return foundElements;
72
97
    }
73
98
};
 
99
 
 
100
    /** @id MochiKit.MockDOM.EXPORT_OK */
 
101
MochiKit.MockDOM.EXPORT_OK = [
 
102
    "mockElement",
 
103
    "createDocument"
 
104
];
 
105
 
 
106
    /** @id MochiKit.MockDOM.EXPORT */
 
107
MochiKit.MockDOM.EXPORT = [
 
108
    "document"
 
109
];
 
110
 
 
111
MochiKit.MockDOM.__new__ = function () {
 
112
    this.document = this.createDocument();
 
113
};
 
114
 
 
115
MochiKit.MockDOM.__new__();