Zuul status page: Redesign and fix bugs

status.html:
- Added eventqueue-length status (was already present in production
  but not committed here yet).
- HTML5 markup.
- Remove unused jquery-visibility.min.js and jquery-graphite.js.

status.js:
- Clean up (various js best practices and consistent coding style)
- Use empty() instead of html('').
- Use text() for text instead of html().
  html() will trigger the parser where text will simply create
  a text node with the string literal, much faster, safer and
  semantically correct.
- Fix implied global variable leak 'result'.
- Fix reference error that crashes/freezes the page
  Property data.trigger_event_queue and data.trigger_event_queue
  can be undefined, in which case data.trigger_event_queue.length
  causes an uncaught TypeError to be thrown.
- Use a closure instead of polluting global scope.
- Rewrite object oriented.
- Added 'demo' feature for easy local testing.

Downstream commits at
https://gerrit.wikimedia.org/r/#/q/project:integration/docroot+topic:zuul-js+branch:master+owner:Krinkle+is:merged,n,z

Change-Id: Iddd4e2787f2e2eb27bf428f733fbb8b4a9d162d5
Reviewed-on: https://review.openstack.org/26416
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/etc/status/public_html/status-basic.json-sample b/etc/status/public_html/status-basic.json-sample
new file mode 100644
index 0000000..4e12cd6
--- /dev/null
+++ b/etc/status/public_html/status-basic.json-sample
@@ -0,0 +1,176 @@
+{
+    "message": "Example error message",
+    "pipelines": [
+        {
+            "name": "test",
+            "description": "Lint and unit tests",
+            "change_queues": [
+                {
+                    "name": "some-jobs@worker301.ci-example.org",
+                    "heads": [
+                        [
+                            {
+                                "id": "10101,1",
+                                "url": "#!/review.example.org/r/10101",
+                                "project": "openstack/infra/zuul",
+                                "jobs": [
+                                    {
+                                        "name": "zuul-merge",
+                                        "url": "#!/jenkins.example.org/job/zuul-merge/201",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-lint",
+                                        "url": "#!/jenkins.example.org/job/zuul-lint/201",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-test",
+                                        "url": "#!/jenkins.example.org/job/zuul-test/201",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    }
+                                ]
+                            }
+                        ],
+                        [
+                            {
+                                "id": "10103,1",
+                                "url": "#!/review.example.org/r/10103",
+                                "project": "google/gerrit",
+                                "jobs": [
+                                    {
+                                        "name": "gerrit-merge",
+                                        "url": "#!/jenkins.example.org/job/gerrit-merge/203",
+                                        "result": "SUCCESS",
+                                        "voting": false
+                                    }
+                                ]
+                            }
+                        ]
+                    ]
+                },
+                {
+                    "name": "other-jobs@worker301.ci-example.org",
+                    "heads": [
+                        [
+                            {
+                                "id": "10102,1",
+                                "url": "#!/review.example.org/r/10102",
+                                "project": "google/gerrit",
+                                "jobs": [
+                                    {
+                                        "name": "gerrit-merge",
+                                        "url": "#!/jenkins.example.org/job/gerrit-merge/202",
+                                        "result": "UNSTABLE",
+                                        "voting": false
+                                    }
+                                ]
+                            }
+                        ],
+                        [
+                            {
+                                "id": "10104,1",
+                                "url": "#!/review.example.org/r/10104",
+                                "project": "openstack/infra/zuul",
+                                "jobs": [
+                                    {
+                                        "name": "zuul-merge",
+                                        "url": "#!/jenkins.example.org/job/zuul-merge/204",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-lint",
+                                        "url": "#!/jenkins.example.org/job/zuul-lint/204",
+                                        "result": "FAILURE",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-test",
+                                        "url": "#!/jenkins.example.org/job/zuul-test/204",
+                                        "result": null,
+                                        "voting": true
+                                    }
+                                ]
+                            }
+                        ]
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "gate-and-submit",
+            "change_queues": []
+        },
+        {
+            "name": "postmerge",
+            "change_queues": [
+                {
+                    "name": "some-jobs@worker301.ci-example.org",
+                    "heads": [
+                        [
+                            {
+                                "id": "7f1d65cb0f663c907698f915da01c008c7ef4748",
+                                "url": "#!/review.example.org/r/10100",
+                                "project": "openstack/infra/zuul",
+                                "jobs": [
+                                    {
+                                        "name": "zuul-lint",
+                                        "url": "#!/jenkins.example.org/job/zuul-lint/200",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-test",
+                                        "url": "#!/jenkins.example.org/job/zuul-test/200",
+                                        "result": "FAILURE",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-regression-python2",
+                                        "url": "#!/jenkins.example.org/job/zuul-regression-python2/200",
+                                        "result": "SUCCESS",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-regression-python3",
+                                        "url": "#!/jenkins.example.org/job/zuul-regression-python3/200",
+                                        "result": "FAILURE",
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-performance-python2",
+                                        "url": null,
+                                        "result": null,
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-performance-python3",
+                                        "url": null,
+                                        "result": null,
+                                        "voting": true
+                                    },
+                                    {
+                                        "name": "zuul-docs-publish",
+                                        "url": null,
+                                        "result": null,
+                                        "voting": true
+                                    }
+                                ]
+                            }
+                        ]
+                    ]
+                }
+            ]
+        }
+    ],
+    "trigger_event_queue": {
+        "length": 0
+    },
+    "result_event_queue": {
+        "length": 0
+    }
+}