--- /dev/null
+# http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
+CLOSURE = closure-compiler --language_in ECMASCRIPT5 --js $1 --create_source_map $1.map --source_map_format=V3 --js_output_file $1.min
+YUICOMPRESSOR = yuicompressor
+HTMLMINIFIER = html-minifier \
+ --collapse-whitespace \
+ --remove-attribute-quotes \
+ --remove-redundant-attributes \
+ --remove-empty-attributes \
+ --remove-comments
+
+all:
+
+min: css-min html-min js-min
+
+%.js.min: %.js
+ $(call CLOSURE,$<)
+
+JS_FILES = $(shell grep '[.]js$$' manifest.files)
+js-min: $(JS_FILES:=.min)
+
+%.css.min: %.css
+ $(YUICOMPRESSOR) $< > $@
+
+CSS_FILES = $(shell grep '[.]css$$' manifest.files)
+css-min: $(CSS_FILES:=.min)
+
+%.html.min: %.html
+ $(HTMLMINIFIER) $< > $@
+
+HTML_FILES = $(shell grep '[.]html$$' manifest.files)
+html-min: $(HTML_FILES:=.min)
+
+check: html-min css-min js-min
+
+dist:
+ ./makedist.sh
+
+.PHONY: all clean check css-min dist html-min js-min
--- /dev/null
+<html>
+<head>
+<script src='background.js'></script>
+</head>
+<body id='test''>
+ <canvas id='canvas' width='19' height='19'></canvas>
+</body>
+</html>
--- /dev/null
+// Copyright 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var storage = chrome.storage.local;
+
+// When visiting a waterfall page, show the icon.
+console.log('going...');
+chrome.webNavigation.onCommitted.addListener(function(e) {
+ setIcon(e.tabId);
+}, {url: [{hostEquals: 'uberchromegw.corp.google.com'},
+ {hostEquals: 'chromegw.corp.google.com'}]});
+
+function onClicked(tab) {
+ if (window.confirm('nuke them all?')) {
+ chrome.tabs.executeScript(tab.id, {
+ 'file': 'click_all.js'
+ });
+ }
+}
+
+chrome.pageAction.onClicked.addListener(onClicked);
+
+function setIcon(tabId) {
+ //chrome.pageAction.setPopup({'tabId':tabId, 'popup':'popup.html'});
+ chrome.pageAction.setIcon({'tabId':tabId, 'path':'icon-96x96.png'});
+ chrome.pageAction.setTitle({'tabId':tabId, 'title':'Nuke It'});
+ chrome.pageAction.show(tabId);
+}
--- /dev/null
+function $(s) { return document.querySelectorAll(s); }
+function $$(s) { return document.querySelector(s); }
+
+function pause(msec) {
+ var date = new Date();
+ while (new Date() - date < msec)
+ continue;
+}
+
+var max = 400;
+
+var forms = $('form[name=cancel]');
+var i, f, id, http, url, params, total;
+total = 0;
+for (i = 0; i < forms.length - 1 && i < max; ++i) {
+ ++total;
+
+ f = forms[i];
+ id = f.querySelector('input[name=id]');
+
+ http = new XMLHttpRequest();
+ http.onreadystatechange = function(state) {
+ if (this.readyState == 4) {
+ if (--total <= 0)
+ window.location.reload();
+ console.log('finished one', this.status);
+ }
+ };
+
+ url = document.URL + '/cancelbuild';
+ params = 'id=' + id.value;
+ http.open('POST', url, true);
+ console.log('hitting url', url, params);
+
+ http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
+ http.send(params);
+ pause(5);
+}
+console.log('spawned ' + total);
+if (total != forms.length) {
+ console.log('total available: ' + forms.length);
+}
+
+//i = 5 * forms.length;
+//console.log('waiting', i, 'msecs');
+//pause(i);
+//window.location.reload();
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600" viewBox="-300 -300 600 600">
+<circle r="292.3"/>
+<g style="fill:#f1cd43" transform="scale(0.9783764)">
+ <circle r="50"/>
+ <path d="M75,0A75,75 0 0,0 37.5-64.951905L125-216.50635A250,250 0 0,1 250,0Z" id="bld"/>
+ <use xlink:href="#bld" transform="rotate(120)"/>
+ <use xlink:href="#bld" transform="rotate(240)"/>
+</g>
+</svg>
\ No newline at end of file
--- /dev/null
+#!/bin/bash -e
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+cd "${0%/*}"
+
+case $1 in
+-h|--help)
+ echo "Usage: $0 [rev]"
+ exit 0
+ ;;
+esac
+
+rev=${1:-0}
+if [[ $# -gt 1 || -n ${1//[0-9]} ]] ; then
+ cat <<-EOF
+Usage: makedist.sh <rev>
+
+The ver will be taken from manifest.json.
+
+The rev should be an integer.
+
+Example:
+ ./makedist.sh 1
+This will generate a manifest for version 3.0.1 (when version is '3.0'
+in the manifest.json file)
+EOF
+ exit 0
+fi
+
+json_value() {
+ local key=$1
+ sed -n -r \
+ -e '/^[[:space:]]*"'"${key}"'"/s|.*:[[:space:]]*"([^"]*)",?$|\1|p' \
+ manifest.json
+}
+
+PN=$(json_value name | sed 's:[[:space:]/]:_:g' | tr '[:upper:]' '[:lower:]')
+if [[ ${PN} == "__msg_name__" ]] ; then
+ PN=$(basename "$(pwd)")
+fi
+PV=$(json_value version)
+PVR="${PV}.${rev}"
+P="${PN}-${PVR}"
+
+rm -rf "${P}"
+mkdir "${P}"
+
+while read line ; do
+ [[ ${line} == */* ]] && mkdir -p "${P}/${line%/*}"
+ ln "${line}" "${P}/${line}"
+done < <(sed 's:#.*::' manifest.files)
+cp Makefile manifest.files manifest.json "${P}/"
+
+make -C "${P}" -j min
+while read line ; do
+ mv -v "${line}" "${line%.min}"
+done < <(find "${P}" -name '*.min')
+rm "${P}"/{manifest.files,Makefile}
+
+sed -i \
+ -e '/"version"/s:"[^"]*",:"'${PVR}'",:' \
+ "${P}/manifest.json"
+
+zip="${P}.zip"
+rm -f "${zip}"
+zip -r "${zip}" "${P}"
+rm -rf "${P}"
+du -b "${zip}"
--- /dev/null
+background.html
+background.js
+click_all.js
+icon-128x128.png
+icon-96x96.png
--- /dev/null
+{
+ "manifest_version": 2,
+ "minimum_chrome_version": "22",
+ "name": "Chromium Waterfall Job Canceler",
+ "version": "0.2",
+ "description": "Cancel most of the pending jobs on the active page.",
+ "icons": {
+ "128": "icon-128x128.png"
+ },
+ "page_action": {
+ "default_title": "Canceler"
+ },
+ "background": {
+ "persistent": false,
+ "page": "background.html"
+ },
+ "permissions": [
+ "alarms",
+ "storage",
+ "tabs",
+ "webNavigation",
+ "https://uberchromegw.corp.google.com/*",
+ "http://uberchromegw.corp.google.com/*",
+ "https://chromegw.corp.google.com/*",
+ "http://chromegw.corp.google.com/*"
+ ]
+}
--- /dev/null
+#!/bin/sh -xe
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+pngcrush -e .png.new *.png
+for png in *.png.new ; do
+ mv ${png} ${png%.new}
+done