Krinkle has submitted this change and it was merged.

Change subject: Delete json.js and remove commented-out code
......................................................................


Delete json.js and remove commented-out code

It was apparently never used.
Current browsers can parse JSON natively but, just in case,
the ext.imagetagging.js module could be set up to depend on the
json2 polyfill bundled with MediaWiki.

Change-Id: Ib8cdfd740ec48124d409ec2fdb3cc3ffcd3733ba
---
M ImageTagPage.php
D resources/js/json.js
2 files changed, 0 insertions(+), 121 deletions(-)

Approvals:
  Krinkle: Verified; Looks good to me, approved



diff --git a/ImageTagPage.php b/ImageTagPage.php
index 77a4044..f2d5afa 100644
--- a/ImageTagPage.php
+++ b/ImageTagPage.php
@@ -13,7 +13,6 @@
                // Add CSS & JS via ResourceLoader
                $out->addModuleStyles( 'ext.imagetagging.css' );
                $out->addModules( 'ext.imagetagging.js' );
-               #$out->addScriptFile( $wgScriptPath . 
'/extensions/ImageTagging/json.js' );
 
                $imgName = $this->getTitle()->getText();
                $out->addHTML( Html::hidden( 'imgName', $imgName, array( 'id' 
=> 'imgName' ) ) );
diff --git a/resources/js/json.js b/resources/js/json.js
deleted file mode 100644
index 3e429b2..0000000
--- a/resources/js/json.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-    json.js
-    2006-04-28
-
-    This file adds these methods to JavaScript:
-
-        object.toJSONString()
-
-            This method produces a JSON text from an object. The
-            object must not contain any cyclical references.
-
-        array.toJSONString()
-
-            This method produces a JSON text from an array. The
-            array must not contain any cyclical references.
-
-        string.parseJSON()
-
-            This method parses a JSON text to produce an object or
-            array. It will return false if there is an error.
-*/
-(function () {
-    var m = {
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"' : '\\"',
-            '\\': '\\\\'
-        },
-        s = {
-            array: function (x) {
-                var a = ['['], b, f, i, l = x.length, v;
-                for (i = 0; i < l; i += 1) {
-                    v = x[i];
-                    f = s[typeof v];
-                    if (f) {
-                        v = f(v);
-                        if (typeof v == 'string') {
-                            if (b) {
-                                a[a.length] = ',';
-                            }
-                            a[a.length] = v;
-                            b = true;
-                        }
-                    }
-                }
-                a[a.length] = ']';
-                return a.join('');
-            },
-            'boolean': function (x) {
-                return String(x);
-            },
-            'null': function (x) {
-                return "null";
-            },
-            number: function (x) {
-                return isFinite(x) ? String(x) : 'null';
-            },
-            object: function (x) {
-                if (x) {
-                    if (x instanceof Array) {
-                        return s.array(x);
-                    }
-                    var a = ['{'], b, f, i, v;
-                    for (i in x) {
-                        v = x[i];
-                        f = s[typeof v];
-                        if (f) {
-                            v = f(v);
-                            if (typeof v == 'string') {
-                                if (b) {
-                                    a[a.length] = ',';
-                                }
-                                a.push(s.string(i), ':', v);
-                                b = true;
-                            }
-                        }
-                    }
-                    a[a.length] = '}';
-                    return a.join('');
-                }
-                return 'null';
-            },
-            string: function (x) {
-                if (/["\\\x00-\x1f]/.test(x)) {
-                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
-                        var c = m[b];
-                        if (c) {
-                            return c;
-                        }
-                        c = b.charCodeAt();
-                        return '\\u00' +
-                            Math.floor(c / 16).toString(16) +
-                            (c % 16).toString(16);
-                    });
-                }
-                return '"' + x + '"';
-            }
-        };
-
-    Object.prototype.toJSONString = function () {
-        return s.object(this);
-    };
-
-    Array.prototype.toJSONString = function () {
-        return s.array(this);
-    };
-})();
-
-String.prototype.parseJSON = function () {
-    try {
-        return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
-                this.replace(/"(\\.|[^"\\])*"/g, ''))) &&
-            eval('(' + this + ')');
-    } catch (e) {
-        return false;
-    }
-};

-- 
To view, visit https://gerrit.wikimedia.org/r/189646
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib8cdfd740ec48124d409ec2fdb3cc3ffcd3733ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ImageTagging
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Rillke <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to