Repository: GoogleChrome/chrome-extensions-samples Branch: main Commit: c4393862e164 Files: 2371 Total size: 10.6 MB Directory structure: gitextract_wq83segv/ ├── .allstar/ │ └── binary_artifacts.yaml ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ └── bug_report.md │ ├── dependabot.yml │ └── workflows/ │ ├── lint.yml │ └── sample-list-generator.yml ├── .gitignore ├── .husky/ │ └── pre-commit ├── .prettierignore ├── .prettierrc.json ├── .repo/ │ ├── migrate-samples.js │ └── sample-list-generator/ │ ├── .gitignore │ ├── README.md │ ├── extension-apis.json │ ├── package.json │ ├── src/ │ │ ├── constants.ts │ │ ├── index.ts │ │ ├── libs/ │ │ │ ├── api-detector.ts │ │ │ ├── api-loader.ts │ │ │ └── sample-collector.ts │ │ ├── prepare-chrome-types.ts │ │ ├── types.ts │ │ └── utils/ │ │ ├── filesystem.ts │ │ └── manifest.ts │ └── test/ │ └── api-detector/ │ └── api-detector.test.ts ├── CONTRIBUTING.md ├── LICENSE ├── README-template.md ├── README.md ├── _archive/ │ ├── apps/ │ │ ├── README.md │ │ ├── libraries/ │ │ │ └── gapi-chrome-apps-lib/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── gapi-chrome-apps.js │ │ └── samples/ │ │ ├── analytics/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── google-analytics-bundle.js │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── sample_support_metadata.json │ │ ├── appengine-channelapi/ │ │ │ ├── README.md │ │ │ ├── app/ │ │ │ │ ├── README.md │ │ │ │ ├── channel_in_a_webview.js │ │ │ │ ├── game.js │ │ │ │ ├── index.css │ │ │ │ ├── index.html │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── appengine/ │ │ │ ├── app.yaml │ │ │ ├── chatactoe.py │ │ │ └── static/ │ │ │ └── channel_in_a_webview.html │ │ ├── appsquare/ │ │ │ ├── README.md │ │ │ ├── assets/ │ │ │ │ └── icon.psd │ │ │ ├── background.js │ │ │ ├── foursquare.js │ │ │ ├── loader.js │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── appview/ │ │ │ ├── README.md │ │ │ ├── embedded-app/ │ │ │ │ ├── README.md │ │ │ │ ├── camera.html │ │ │ │ ├── camera.js │ │ │ │ ├── default.html │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── host-app/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── blink1/ │ │ │ ├── README.md │ │ │ ├── blink1.js │ │ │ ├── color-picker.html │ │ │ ├── color-picker.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── style.css │ │ │ └── udev/ │ │ │ └── 61-blink1.rules │ │ ├── bluetooth-samples/ │ │ │ ├── battery-service-demo/ │ │ │ │ ├── README.md │ │ │ │ ├── background.js │ │ │ │ ├── main.html │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── style.css │ │ │ │ └── ui.js │ │ │ ├── device-info-demo/ │ │ │ │ ├── README.md │ │ │ │ ├── background.js │ │ │ │ ├── main.html │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── style.css │ │ │ │ └── ui.js │ │ │ └── heart-rate-sensor/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── style.css │ │ │ └── ui.js │ │ ├── calculator/ │ │ │ ├── README.md │ │ │ ├── calculator.html │ │ │ ├── controller.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── model.js │ │ │ ├── sample_support_metadata.json │ │ │ ├── style.css │ │ │ ├── tests/ │ │ │ │ ├── calculator_test.html │ │ │ │ └── calculator_test.js │ │ │ └── view.js │ │ ├── camera-capture/ │ │ │ ├── README.md │ │ │ ├── app.js │ │ │ ├── background.js │ │ │ ├── index.html │ │ │ └── manifest.json │ │ ├── clock/ │ │ │ ├── README.md │ │ │ ├── alarm.js │ │ │ ├── clock.js │ │ │ ├── index.html │ │ │ ├── lib/ │ │ │ │ └── tipTipv13/ │ │ │ │ ├── jquery.tipTip.js │ │ │ │ ├── jquery.tipTip.minified.js │ │ │ │ └── tipTip.css │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── script.js │ │ │ ├── stopwatch.js │ │ │ ├── style.css │ │ │ ├── tests/ │ │ │ │ ├── clock_test.html │ │ │ │ ├── clock_test.js │ │ │ │ └── lib/ │ │ │ │ ├── prototype.js │ │ │ │ └── right.js │ │ │ └── timer.js │ │ ├── context-menu/ │ │ │ ├── README.md │ │ │ ├── a.html │ │ │ ├── a.js │ │ │ ├── b.html │ │ │ ├── b.js │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── dart/ │ │ │ ├── README.md │ │ │ ├── clock.html │ │ │ ├── compile.sh │ │ │ ├── css/ │ │ │ │ └── clock.css │ │ │ ├── dart/ │ │ │ │ ├── balls.dart │ │ │ │ ├── clock.dart │ │ │ │ ├── clock.dart.precompiled.js │ │ │ │ └── numbers.dart │ │ │ ├── js/ │ │ │ │ ├── browser_dart_csp_safe.js │ │ │ │ └── main.js │ │ │ ├── manifest.json │ │ │ ├── pubspec.yaml │ │ │ └── sample_support_metadata.json │ │ ├── desktop-capture/ │ │ │ ├── README.md │ │ │ ├── app.js │ │ │ ├── background.js │ │ │ ├── index.html │ │ │ └── manifest.json │ │ ├── dialog-element/ │ │ │ ├── README.md │ │ │ ├── dialog.js │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── styles.css │ │ ├── diff/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ ├── editor.css │ │ │ │ └── style.css │ │ │ ├── js/ │ │ │ │ ├── background.js │ │ │ │ ├── diff.js │ │ │ │ └── filesystem.js │ │ │ ├── lib/ │ │ │ │ ├── diff_match_patch.js │ │ │ │ ├── diff_match_patch_test.html │ │ │ │ ├── diff_match_patch_test.js │ │ │ │ ├── diff_match_patch_uncompressed.js │ │ │ │ └── jquery.activity-indicator.js │ │ │ ├── main.html │ │ │ └── manifest.json │ │ ├── dojo/ │ │ │ ├── .gitignore │ │ │ ├── Markdown_1.0.1/ │ │ │ │ ├── License.text │ │ │ │ ├── Markdown Readme.text │ │ │ │ └── Markdown.pl │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── crxmake.sh │ │ │ ├── executable_list │ │ │ └── include/ │ │ │ └── main.css │ │ ├── filesystem-access/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ ├── app.js │ │ │ │ └── dnd.js │ │ │ └── manifest.json │ │ ├── frameless-window/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── frameless_window.html │ │ │ ├── frameless_window.js │ │ │ ├── manifest.json │ │ │ ├── style.css │ │ │ └── titlebar.js │ │ ├── gcm-notifications/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── register.html │ │ │ └── register.js │ │ ├── gdrive/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ ├── bootstrap.css │ │ │ │ └── main.css │ │ │ ├── js/ │ │ │ │ ├── app.js │ │ │ │ ├── background.js │ │ │ │ ├── dnd.js │ │ │ │ ├── gdocs.js │ │ │ │ ├── upload.js │ │ │ │ └── util.js │ │ │ ├── main.html │ │ │ └── manifest.json │ │ ├── github-auth/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── hello-world/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── hello-world-sync/ │ │ │ ├── README.md │ │ │ ├── app.js │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ └── style.css │ │ ├── hid/ │ │ │ ├── README.md │ │ │ ├── control-panel.html │ │ │ ├── control-panel.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── style.css │ │ ├── identity/ │ │ │ ├── README.md │ │ │ ├── identity.js │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support/ │ │ │ │ ├── README.md │ │ │ │ ├── google-code-prettify/ │ │ │ │ │ ├── lang-css.js │ │ │ │ │ └── run_prettify.js │ │ │ │ ├── prettify.css │ │ │ │ ├── prettify.js │ │ │ │ ├── prettify_theme.css │ │ │ │ ├── sample_support.js │ │ │ │ ├── show_snippets.html │ │ │ │ ├── show_snippets.js │ │ │ │ ├── snippets.css │ │ │ │ └── standard.css │ │ │ └── sample_support_metadata.json │ │ ├── image-edit/ │ │ │ ├── README.md │ │ │ ├── app.js │ │ │ ├── background.js │ │ │ ├── dnd.js │ │ │ ├── index.html │ │ │ └── manifest.json │ │ ├── instagram-auth/ │ │ │ ├── README.md │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── io2012-presentation/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ ├── presentation.css │ │ │ │ └── theme.css │ │ │ ├── diff-sample-files/ │ │ │ │ ├── new-manifest.json │ │ │ │ └── old-manifest.json │ │ │ ├── helloworld/ │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── snippets │ │ │ │ ├── window.html │ │ │ │ └── window.js │ │ │ ├── js/ │ │ │ │ ├── main.js │ │ │ │ ├── servo.js │ │ │ │ ├── slide-config.js │ │ │ │ ├── slide-controller.js │ │ │ │ ├── slide-deck.js │ │ │ │ └── slides.js │ │ │ ├── manifest.json │ │ │ ├── presentation.html │ │ │ ├── servo/ │ │ │ │ ├── background.js │ │ │ │ ├── main.html │ │ │ │ ├── manifest.json │ │ │ │ ├── servo.js │ │ │ │ └── styles.css │ │ │ └── windowing_api/ │ │ │ ├── copycat.html │ │ │ ├── original.html │ │ │ ├── window.css │ │ │ └── window.js │ │ ├── ioio/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── keyboard-handler/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── window.html │ │ │ └── window.js │ │ ├── managed-in-app-payments/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ └── app.css │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── scripts/ │ │ │ ├── app.js │ │ │ └── buy.js │ │ ├── manga-cam/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── css/ │ │ │ │ └── index.css │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ ├── index.js │ │ │ │ ├── loader.js │ │ │ │ ├── postproc.js │ │ │ │ └── shaders/ │ │ │ │ ├── blur.x.glsl │ │ │ │ ├── blur.y.glsl │ │ │ │ ├── copy.fs.glsl │ │ │ │ ├── flake.fs.glsl │ │ │ │ ├── index.include.glsl │ │ │ │ ├── merge.fs.glsl │ │ │ │ ├── packing.include.glsl │ │ │ │ ├── sobel.fs.glsl │ │ │ │ └── toonize.fs.glsl │ │ │ └── manifest.json │ │ ├── mdns-browser/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── dns.js │ │ │ ├── header.css │ │ │ ├── main.css │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── service-types.js │ │ ├── media-gallery/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── media-gallery.js │ │ │ ├── page.html │ │ │ ├── runtime.js │ │ │ └── styles.css │ │ ├── messaging/ │ │ │ ├── README.md │ │ │ ├── app1/ │ │ │ │ ├── README.md │ │ │ │ ├── index.html │ │ │ │ ├── index.js │ │ │ │ ├── main.css │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ ├── app2/ │ │ │ │ ├── README.md │ │ │ │ ├── index.html │ │ │ │ ├── index.js │ │ │ │ ├── main.css │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── extension/ │ │ │ ├── README.md │ │ │ ├── eventPage.js │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.css │ │ │ └── manifest.json │ │ ├── mini-code-edit/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── cm/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── demo/ │ │ │ │ │ ├── activeline.html │ │ │ │ │ ├── changemode.html │ │ │ │ │ ├── closetag.html │ │ │ │ │ ├── complete.html │ │ │ │ │ ├── emacs.html │ │ │ │ │ ├── folding.html │ │ │ │ │ ├── formatting.html │ │ │ │ │ ├── fullscreen.html │ │ │ │ │ ├── loadmode.html │ │ │ │ │ ├── marker.html │ │ │ │ │ ├── matchhighlighter.html │ │ │ │ │ ├── mustache.html │ │ │ │ │ ├── preview.html │ │ │ │ │ ├── resize.html │ │ │ │ │ ├── runmode.html │ │ │ │ │ ├── search.html │ │ │ │ │ ├── theme.html │ │ │ │ │ ├── vim.html │ │ │ │ │ └── visibletabs.html │ │ │ │ ├── doc/ │ │ │ │ │ ├── compress.html │ │ │ │ │ ├── docs.css │ │ │ │ │ ├── internals.html │ │ │ │ │ ├── manual.html │ │ │ │ │ ├── oldrelease.html │ │ │ │ │ ├── reporting.html │ │ │ │ │ └── upgrade_v2.2.html │ │ │ │ ├── index.html │ │ │ │ ├── keymap/ │ │ │ │ │ ├── emacs.js │ │ │ │ │ └── vim.js │ │ │ │ ├── lib/ │ │ │ │ │ ├── codemirror.css │ │ │ │ │ ├── codemirror.js │ │ │ │ │ └── util/ │ │ │ │ │ ├── closetag.js │ │ │ │ │ ├── dialog.css │ │ │ │ │ ├── dialog.js │ │ │ │ │ ├── foldcode.js │ │ │ │ │ ├── formatting.js │ │ │ │ │ ├── javascript-hint.js │ │ │ │ │ ├── loadmode.js │ │ │ │ │ ├── match-highlighter.js │ │ │ │ │ ├── overlay.js │ │ │ │ │ ├── runmode.js │ │ │ │ │ ├── search.js │ │ │ │ │ ├── searchcursor.js │ │ │ │ │ ├── simple-hint.css │ │ │ │ │ └── simple-hint.js │ │ │ │ ├── mode/ │ │ │ │ │ ├── clike/ │ │ │ │ │ │ ├── clike.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── clojure/ │ │ │ │ │ │ ├── clojure.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── coffeescript/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── coffeescript.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── css/ │ │ │ │ │ │ ├── css.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── diff/ │ │ │ │ │ │ ├── diff.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── ecl/ │ │ │ │ │ │ ├── ecl.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── erlang/ │ │ │ │ │ │ ├── erlang.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── gfm/ │ │ │ │ │ │ ├── gfm.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── go/ │ │ │ │ │ │ ├── go.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── groovy/ │ │ │ │ │ │ ├── groovy.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── haskell/ │ │ │ │ │ │ ├── haskell.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── htmlembedded/ │ │ │ │ │ │ ├── htmlembedded.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── htmlmixed/ │ │ │ │ │ │ ├── htmlmixed.js │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── javascript/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── javascript.js │ │ │ │ │ ├── jinja2/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── jinja2.js │ │ │ │ │ ├── less/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── less.js │ │ │ │ │ ├── lua/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── lua.js │ │ │ │ │ ├── markdown/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── markdown.js │ │ │ │ │ ├── mysql/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── mysql.js │ │ │ │ │ ├── ntriples/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── ntriples.js │ │ │ │ │ ├── pascal/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── pascal.js │ │ │ │ │ ├── perl/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── perl.js │ │ │ │ │ ├── php/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── php.js │ │ │ │ │ ├── pig/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── pig.js │ │ │ │ │ ├── plsql/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── plsql.js │ │ │ │ │ ├── properties/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── properties.js │ │ │ │ │ ├── python/ │ │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── python.js │ │ │ │ │ ├── r/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── r.js │ │ │ │ │ ├── rpm/ │ │ │ │ │ │ ├── changes/ │ │ │ │ │ │ │ ├── changes.js │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ └── spec/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── spec.css │ │ │ │ │ │ └── spec.js │ │ │ │ │ ├── rst/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── rst.js │ │ │ │ │ ├── ruby/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── ruby.js │ │ │ │ │ ├── rust/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── rust.js │ │ │ │ │ ├── scheme/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── scheme.js │ │ │ │ │ ├── shell/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── shell.js │ │ │ │ │ ├── smalltalk/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── smalltalk.js │ │ │ │ │ ├── smarty/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── smarty.js │ │ │ │ │ ├── sparql/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── sparql.js │ │ │ │ │ ├── stex/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── stex.js │ │ │ │ │ │ └── test.html │ │ │ │ │ ├── tiddlywiki/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── tiddlywiki.css │ │ │ │ │ │ └── tiddlywiki.js │ │ │ │ │ ├── tiki/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── tiki.css │ │ │ │ │ │ └── tiki.js │ │ │ │ │ ├── vbscript/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── vbscript.js │ │ │ │ │ ├── velocity/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── velocity.js │ │ │ │ │ ├── verilog/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── verilog.js │ │ │ │ │ ├── xml/ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ └── xml.js │ │ │ │ │ ├── xquery/ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── test/ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ ├── testBase.js │ │ │ │ │ │ │ ├── testEmptySequenceKeyword.js │ │ │ │ │ │ │ ├── testMultiAttr.js │ │ │ │ │ │ │ ├── testNamespaces.js │ │ │ │ │ │ │ ├── testProcessingInstructions.js │ │ │ │ │ │ │ └── testQuotes.js │ │ │ │ │ │ └── xquery.js │ │ │ │ │ └── yaml/ │ │ │ │ │ ├── index.html │ │ │ │ │ └── yaml.js │ │ │ │ ├── test/ │ │ │ │ │ ├── index.html │ │ │ │ │ ├── mode_test.css │ │ │ │ │ ├── mode_test.js │ │ │ │ │ └── test.js │ │ │ │ └── theme/ │ │ │ │ ├── ambiance.css │ │ │ │ ├── blackboard.css │ │ │ │ ├── cobalt.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── elegant.css │ │ │ │ ├── erlang-dark.css │ │ │ │ ├── lesser-dark.css │ │ │ │ ├── monokai.css │ │ │ │ ├── neat.css │ │ │ │ ├── night.css │ │ │ │ ├── rubyblue.css │ │ │ │ └── xq-dark.css │ │ │ ├── editor.js │ │ │ ├── img/ │ │ │ │ └── README.txt │ │ │ ├── main.html │ │ │ ├── manifest.json │ │ │ ├── snippets.js │ │ │ └── style.css │ │ ├── multicast/ │ │ │ ├── ChatClient.js │ │ │ ├── Collection.js │ │ │ ├── MulticastSocket.js │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ └── manifest.json │ │ ├── one-time-payment/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ ├── app.css │ │ │ │ └── bootstrap.css │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── scripts/ │ │ │ └── app.js │ │ ├── optional-permissions/ │ │ │ ├── README.md │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── permissions.html │ │ │ └── permissions.js │ │ ├── parrot-ar-drone/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── lib/ │ │ │ │ ├── API.js │ │ │ │ ├── Command.js │ │ │ │ ├── Gamepad.js │ │ │ │ ├── NavData.js │ │ │ │ ├── Sequence.js │ │ │ │ └── Util.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ ├── scripts/ │ │ │ │ └── app.js │ │ │ ├── styles/ │ │ │ │ └── drone.css │ │ │ └── third-party/ │ │ │ └── gamepad.js │ │ ├── platform-title/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── main.css │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── platform-mac.css │ │ ├── printing/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── a.js │ │ │ ├── application.js │ │ │ ├── controls.html │ │ │ ├── controls.js │ │ │ ├── document.html │ │ │ ├── document.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── printout.html │ │ │ ├── printout.js │ │ │ └── style.css │ │ ├── restarted-demo/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── main.html │ │ │ ├── manifest.json │ │ │ └── sample_support_metadata.json │ │ ├── rich-notifications/ │ │ │ ├── README.md │ │ │ ├── app.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ ├── styles.css │ │ │ └── window.html │ │ ├── sandbox/ │ │ │ ├── LICENSE.handlebars │ │ │ ├── README.md │ │ │ ├── handlebars-1.0.0.beta.6.js │ │ │ ├── main.js │ │ │ ├── mainpage.html │ │ │ ├── mainpage.js │ │ │ ├── manifest.json │ │ │ ├── sandbox.html │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── sandboxed-content/ │ │ │ ├── README.md │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sandboxed.html │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── serial/ │ │ │ ├── adkjs/ │ │ │ │ ├── README.md │ │ │ │ ├── app/ │ │ │ │ │ ├── README.md │ │ │ │ │ ├── comm.html │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── main.css │ │ │ │ │ ├── img/ │ │ │ │ │ │ └── icon.xcf │ │ │ │ │ ├── js/ │ │ │ │ │ │ ├── adk.js │ │ │ │ │ │ ├── background.js │ │ │ │ │ │ └── serial.js │ │ │ │ │ └── manifest.json │ │ │ │ └── firmware/ │ │ │ │ ├── arduino_libs/ │ │ │ │ │ ├── AndroidAccessory/ │ │ │ │ │ │ ├── AndroidAccessory.cpp │ │ │ │ │ │ └── AndroidAccessory.h │ │ │ │ │ ├── CapSense/ │ │ │ │ │ │ ├── CapSense.cpp │ │ │ │ │ │ └── CapSense.h │ │ │ │ │ ├── TimedAction/ │ │ │ │ │ │ ├── TimedAction.cpp │ │ │ │ │ │ └── TimedAction.h │ │ │ │ │ └── USB_Host_Shield/ │ │ │ │ │ ├── Max3421e.cpp │ │ │ │ │ ├── Max3421e.h │ │ │ │ │ ├── Max3421e_constants.h │ │ │ │ │ ├── Max_LCD.cpp │ │ │ │ │ ├── Max_LCD.h │ │ │ │ │ ├── README │ │ │ │ │ ├── Usb.cpp │ │ │ │ │ ├── Usb.h │ │ │ │ │ └── ch9.h │ │ │ │ └── demokitclient/ │ │ │ │ └── demokitclient.ino │ │ │ ├── espruino/ │ │ │ │ ├── README.md │ │ │ │ ├── index.html │ │ │ │ ├── launch.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── ledtoggle/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── launch.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── sketches/ │ │ │ └── serial_light/ │ │ │ └── serial_light.ino │ │ ├── serial-control-signals/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── logic.js │ │ │ ├── main.html │ │ │ ├── manifest.json │ │ │ └── styles.css │ │ ├── servo/ │ │ │ ├── README.md │ │ │ ├── Servo/ │ │ │ │ └── Servo.ino │ │ │ ├── background.js │ │ │ ├── main.html │ │ │ ├── manifest.json │ │ │ ├── servo.js │ │ │ └── styles.css │ │ ├── storage/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── syncfs-editor/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ └── editor.css │ │ │ ├── js/ │ │ │ │ ├── background.js │ │ │ │ ├── editor.js │ │ │ │ ├── filer.js │ │ │ │ ├── main.js │ │ │ │ └── utils.js │ │ │ ├── main.html │ │ │ └── manifest.json │ │ ├── systemInfo/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── systemInfo.js │ │ ├── tasks/ │ │ │ ├── README.md │ │ │ ├── gapi-chrome-apps.js │ │ │ ├── gapiCallback.js │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── sample_support_metadata.json │ │ ├── tcpserver/ │ │ │ ├── README.md │ │ │ ├── commands/ │ │ │ │ ├── BrowserCommands.js │ │ │ │ └── webview.html │ │ │ ├── index.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ ├── server.js │ │ │ ├── styles/ │ │ │ │ ├── main.css │ │ │ │ └── webview.css │ │ │ └── tcp-server.js │ │ ├── telnet/ │ │ │ ├── README.md │ │ │ ├── ansi-converter.js │ │ │ ├── launch.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ ├── tcp-client.js │ │ │ ├── terminal.css │ │ │ ├── terminal.html │ │ │ └── terminal.js │ │ ├── text-editor/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── editor.html │ │ │ ├── editor.js │ │ │ ├── icons/ │ │ │ │ └── Readme.txt │ │ │ ├── lib/ │ │ │ │ ├── ace/ │ │ │ │ │ ├── ace.js │ │ │ │ │ ├── anchor.js │ │ │ │ │ ├── anchor_test.js │ │ │ │ │ ├── background_tokenizer.js │ │ │ │ │ ├── commands/ │ │ │ │ │ │ ├── command_manager.js │ │ │ │ │ │ ├── command_manager_test.js │ │ │ │ │ │ ├── default_commands.js │ │ │ │ │ │ └── multi_select_commands.js │ │ │ │ │ ├── config.js │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── editor.css │ │ │ │ │ ├── document.js │ │ │ │ │ ├── document_test.js │ │ │ │ │ ├── edit_session/ │ │ │ │ │ │ ├── bracket_match.js │ │ │ │ │ │ ├── fold.js │ │ │ │ │ │ ├── fold_line.js │ │ │ │ │ │ └── folding.js │ │ │ │ │ ├── edit_session.js │ │ │ │ │ ├── edit_session_test.js │ │ │ │ │ ├── editor.js │ │ │ │ │ ├── editor_change_document_test.js │ │ │ │ │ ├── editor_highlight_selected_word_test.js │ │ │ │ │ ├── editor_navigation_test.js │ │ │ │ │ ├── editor_text_edit_test.js │ │ │ │ │ ├── ext/ │ │ │ │ │ │ ├── static.css │ │ │ │ │ │ ├── static_highlight.js │ │ │ │ │ │ ├── static_highlight_test.js │ │ │ │ │ │ └── textarea.js │ │ │ │ │ ├── keyboard/ │ │ │ │ │ │ ├── hash_handler.js │ │ │ │ │ │ ├── keybinding/ │ │ │ │ │ │ │ ├── emacs.js │ │ │ │ │ │ │ └── vim.js │ │ │ │ │ │ ├── keybinding.js │ │ │ │ │ │ ├── state_handler.js │ │ │ │ │ │ └── textinput.js │ │ │ │ │ ├── layer/ │ │ │ │ │ │ ├── cursor.js │ │ │ │ │ │ ├── gutter.js │ │ │ │ │ │ ├── marker.js │ │ │ │ │ │ ├── text.js │ │ │ │ │ │ └── text_test.js │ │ │ │ │ ├── lib/ │ │ │ │ │ │ ├── browser_focus.js │ │ │ │ │ │ ├── dom.js │ │ │ │ │ │ ├── es5-shim.js │ │ │ │ │ │ ├── event.js │ │ │ │ │ │ ├── event_emitter.js │ │ │ │ │ │ ├── event_emitter_test.js │ │ │ │ │ │ ├── fixoldbrowsers.js │ │ │ │ │ │ ├── keys.js │ │ │ │ │ │ ├── lang.js │ │ │ │ │ │ ├── net.js │ │ │ │ │ │ ├── oop.js │ │ │ │ │ │ ├── regexp.js │ │ │ │ │ │ └── useragent.js │ │ │ │ │ ├── mode/ │ │ │ │ │ │ ├── behaviour/ │ │ │ │ │ │ │ ├── cstyle.js │ │ │ │ │ │ │ ├── xml.js │ │ │ │ │ │ │ └── xquery.js │ │ │ │ │ │ ├── behaviour.js │ │ │ │ │ │ ├── c_cpp.js │ │ │ │ │ │ ├── c_cpp_highlight_rules.js │ │ │ │ │ │ ├── clojure.js │ │ │ │ │ │ ├── clojure_highlight_rules.js │ │ │ │ │ │ ├── coffee/ │ │ │ │ │ │ │ ├── coffee-script.js │ │ │ │ │ │ │ ├── helpers.js │ │ │ │ │ │ │ ├── lexer.js │ │ │ │ │ │ │ ├── nodes.js │ │ │ │ │ │ │ ├── parser.js │ │ │ │ │ │ │ ├── parser_test.js │ │ │ │ │ │ │ ├── rewriter.js │ │ │ │ │ │ │ └── scope.js │ │ │ │ │ │ ├── coffee.js │ │ │ │ │ │ ├── coffee_highlight_rules.js │ │ │ │ │ │ ├── coffee_highlight_rules_test.js │ │ │ │ │ │ ├── coffee_worker.js │ │ │ │ │ │ ├── coldfusion.js │ │ │ │ │ │ ├── coldfusion_highlight_rules.js │ │ │ │ │ │ ├── coldfusion_test.js │ │ │ │ │ │ ├── csharp.js │ │ │ │ │ │ ├── csharp_highlight_rules.js │ │ │ │ │ │ ├── css/ │ │ │ │ │ │ │ └── csslint.js │ │ │ │ │ │ ├── css.js │ │ │ │ │ │ ├── css_highlight_rules.js │ │ │ │ │ │ ├── css_highlight_rules_test.js │ │ │ │ │ │ ├── css_test.js │ │ │ │ │ │ ├── css_worker.js │ │ │ │ │ │ ├── css_worker_test.js │ │ │ │ │ │ ├── doc_comment_highlight_rules.js │ │ │ │ │ │ ├── folding/ │ │ │ │ │ │ │ ├── cstyle.js │ │ │ │ │ │ │ ├── cstyle_test.js │ │ │ │ │ │ │ ├── fold_mode.js │ │ │ │ │ │ │ ├── html.js │ │ │ │ │ │ │ ├── html_test.js │ │ │ │ │ │ │ ├── mixed.js │ │ │ │ │ │ │ ├── pythonic.js │ │ │ │ │ │ │ ├── pythonic_test.js │ │ │ │ │ │ │ ├── xml.js │ │ │ │ │ │ │ └── xml_test.js │ │ │ │ │ │ ├── golang.js │ │ │ │ │ │ ├── golang_highlight_rules.js │ │ │ │ │ │ ├── groovy.js │ │ │ │ │ │ ├── groovy_highlight_rules.js │ │ │ │ │ │ ├── haxe.js │ │ │ │ │ │ ├── haxe_highlight_rules.js │ │ │ │ │ │ ├── html.js │ │ │ │ │ │ ├── html_highlight_rules.js │ │ │ │ │ │ ├── html_highlight_rules_test.js │ │ │ │ │ │ ├── html_test.js │ │ │ │ │ │ ├── java.js │ │ │ │ │ │ ├── java_highlight_rules.js │ │ │ │ │ │ ├── javascript.js │ │ │ │ │ │ ├── javascript_highlight_rules.js │ │ │ │ │ │ ├── javascript_highlight_rules_test.js │ │ │ │ │ │ ├── javascript_test.js │ │ │ │ │ │ ├── javascript_worker.js │ │ │ │ │ │ ├── javascript_worker_test.js │ │ │ │ │ │ ├── json/ │ │ │ │ │ │ │ └── json_parse.js │ │ │ │ │ │ ├── json.js │ │ │ │ │ │ ├── json_highlight_rules.js │ │ │ │ │ │ ├── json_worker.js │ │ │ │ │ │ ├── json_worker_test.js │ │ │ │ │ │ ├── latex.js │ │ │ │ │ │ ├── latex_highlight_rules.js │ │ │ │ │ │ ├── less.js │ │ │ │ │ │ ├── less_highlight_rules.js │ │ │ │ │ │ ├── liquid.js │ │ │ │ │ │ ├── liquid_highlight_rules.js │ │ │ │ │ │ ├── liquid_highlight_rules_test.js │ │ │ │ │ │ ├── lua.js │ │ │ │ │ │ ├── lua_highlight_rules.js │ │ │ │ │ │ ├── markdown.js │ │ │ │ │ │ ├── markdown_highlight_rules.js │ │ │ │ │ │ ├── matching_brace_outdent.js │ │ │ │ │ │ ├── matching_parens_outdent.js │ │ │ │ │ │ ├── ocaml.js │ │ │ │ │ │ ├── ocaml_highlight_rules.js │ │ │ │ │ │ ├── perl.js │ │ │ │ │ │ ├── perl_highlight_rules.js │ │ │ │ │ │ ├── pgsql.js │ │ │ │ │ │ ├── pgsql_highlight_rules.js │ │ │ │ │ │ ├── php.js │ │ │ │ │ │ ├── php_highlight_rules.js │ │ │ │ │ │ ├── powershell.js │ │ │ │ │ │ ├── powershell_highlight_rules.js │ │ │ │ │ │ ├── python.js │ │ │ │ │ │ ├── python_highlight_rules.js │ │ │ │ │ │ ├── python_test.js │ │ │ │ │ │ ├── ruby.js │ │ │ │ │ │ ├── ruby_highlight_rules.js │ │ │ │ │ │ ├── ruby_highlight_rules_test.js │ │ │ │ │ │ ├── scad.js │ │ │ │ │ │ ├── scad_highlight_rules.js │ │ │ │ │ │ ├── scala.js │ │ │ │ │ │ ├── scala_highlight_rules.js │ │ │ │ │ │ ├── scss.js │ │ │ │ │ │ ├── scss_highlight_rules.js │ │ │ │ │ │ ├── sh.js │ │ │ │ │ │ ├── sh_highlight_rules.js │ │ │ │ │ │ ├── sql.js │ │ │ │ │ │ ├── sql_highlight_rules.js │ │ │ │ │ │ ├── svg.js │ │ │ │ │ │ ├── svg_highlight_rules.js │ │ │ │ │ │ ├── text.js │ │ │ │ │ │ ├── text_highlight_rules.js │ │ │ │ │ │ ├── text_test.js │ │ │ │ │ │ ├── textile.js │ │ │ │ │ │ ├── textile_highlight_rules.js │ │ │ │ │ │ ├── xml.js │ │ │ │ │ │ ├── xml_highlight_rules.js │ │ │ │ │ │ ├── xml_highlight_rules_test.js │ │ │ │ │ │ ├── xml_test.js │ │ │ │ │ │ ├── xml_util.js │ │ │ │ │ │ ├── xquery.js │ │ │ │ │ │ └── xquery_highlight_rules.js │ │ │ │ │ ├── model/ │ │ │ │ │ │ └── editor.js │ │ │ │ │ ├── mouse/ │ │ │ │ │ │ ├── default_gutter_handler.js │ │ │ │ │ │ ├── default_handlers.js │ │ │ │ │ │ ├── dragdrop.js │ │ │ │ │ │ ├── fold_handler.js │ │ │ │ │ │ ├── mouse_event.js │ │ │ │ │ │ ├── mouse_handler.js │ │ │ │ │ │ └── multi_select_handler.js │ │ │ │ │ ├── multi_select.js │ │ │ │ │ ├── multi_select_test.js │ │ │ │ │ ├── narcissus/ │ │ │ │ │ │ ├── definitions.js │ │ │ │ │ │ ├── lexer.js │ │ │ │ │ │ ├── options.js │ │ │ │ │ │ └── parser.js │ │ │ │ │ ├── placeholder.js │ │ │ │ │ ├── placeholder_test.js │ │ │ │ │ ├── range.js │ │ │ │ │ ├── range_list.js │ │ │ │ │ ├── range_list_test.js │ │ │ │ │ ├── range_test.js │ │ │ │ │ ├── renderloop.js │ │ │ │ │ ├── requirejs/ │ │ │ │ │ │ └── text.js │ │ │ │ │ ├── scrollbar.js │ │ │ │ │ ├── search.js │ │ │ │ │ ├── search_test.js │ │ │ │ │ ├── selection.js │ │ │ │ │ ├── selection_test.js │ │ │ │ │ ├── split.js │ │ │ │ │ ├── test/ │ │ │ │ │ │ ├── all.js │ │ │ │ │ │ ├── all_browser.js │ │ │ │ │ │ ├── assertions.js │ │ │ │ │ │ ├── asyncjs/ │ │ │ │ │ │ │ ├── assert.js │ │ │ │ │ │ │ ├── async.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ │ └── utils.js │ │ │ │ │ │ ├── benchmark.js │ │ │ │ │ │ ├── mockdom.js │ │ │ │ │ │ ├── mockrenderer.js │ │ │ │ │ │ └── tests.html │ │ │ │ │ ├── theme/ │ │ │ │ │ │ ├── chrome.js │ │ │ │ │ │ ├── clouds.js │ │ │ │ │ │ ├── clouds_midnight.js │ │ │ │ │ │ ├── cobalt.js │ │ │ │ │ │ ├── crimson_editor.js │ │ │ │ │ │ ├── dawn.js │ │ │ │ │ │ ├── dreamweaver.js │ │ │ │ │ │ ├── eclipse.js │ │ │ │ │ │ ├── idle_fingers.js │ │ │ │ │ │ ├── kr_theme.js │ │ │ │ │ │ ├── merbivore.js │ │ │ │ │ │ ├── merbivore_soft.js │ │ │ │ │ │ ├── mono_industrial.js │ │ │ │ │ │ ├── monokai.js │ │ │ │ │ │ ├── pastel_on_dark.js │ │ │ │ │ │ ├── solarized_dark.js │ │ │ │ │ │ ├── solarized_light.js │ │ │ │ │ │ ├── textmate.js │ │ │ │ │ │ ├── tomorrow.js │ │ │ │ │ │ ├── tomorrow_night.js │ │ │ │ │ │ ├── tomorrow_night_blue.js │ │ │ │ │ │ ├── tomorrow_night_bright.js │ │ │ │ │ │ ├── tomorrow_night_eighties.js │ │ │ │ │ │ ├── twilight.js │ │ │ │ │ │ └── vibrant_ink.js │ │ │ │ │ ├── token_iterator.js │ │ │ │ │ ├── token_iterator_test.js │ │ │ │ │ ├── tokenizer.js │ │ │ │ │ ├── undomanager.js │ │ │ │ │ ├── unicode.js │ │ │ │ │ ├── virtual_renderer.js │ │ │ │ │ ├── virtual_renderer_test.js │ │ │ │ │ └── worker/ │ │ │ │ │ ├── jshint.js │ │ │ │ │ ├── jslint.js │ │ │ │ │ ├── mirror.js │ │ │ │ │ ├── worker.js │ │ │ │ │ └── worker_client.js │ │ │ │ └── pilot/ │ │ │ │ ├── browser_focus.js │ │ │ │ ├── canon.js │ │ │ │ ├── dom.js │ │ │ │ ├── event.js │ │ │ │ ├── event_emitter.js │ │ │ │ ├── fixoldbrowsers.js │ │ │ │ ├── index.js │ │ │ │ ├── keys.js │ │ │ │ ├── lang.js │ │ │ │ ├── oop.js │ │ │ │ └── useragent.js │ │ │ ├── manifest.json │ │ │ ├── modes.js │ │ │ ├── require.js │ │ │ ├── require_config.js │ │ │ └── styles.css │ │ ├── todomvc/ │ │ │ ├── background.js │ │ │ ├── bower.json │ │ │ ├── bower_components/ │ │ │ │ ├── director/ │ │ │ │ │ └── build/ │ │ │ │ │ └── director.js │ │ │ │ └── todomvc-common/ │ │ │ │ └── base.css │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ ├── alarms.js │ │ │ │ ├── app.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── controller.js │ │ │ │ ├── export.js │ │ │ │ ├── helpers.js │ │ │ │ ├── model.js │ │ │ │ ├── store.js │ │ │ │ └── view.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ └── styles.css │ │ ├── tts/ │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── ttsdemo.css │ │ │ ├── ttsdemo.html │ │ │ └── ttsdemo.js │ │ ├── udp/ │ │ │ ├── README.md │ │ │ ├── demo.js │ │ │ ├── echo_mco.html │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── mco.js │ │ │ ├── networking.js │ │ │ ├── raf.js │ │ │ ├── sample_support_metadata.json │ │ │ └── server/ │ │ │ └── dropping-server.js │ │ ├── url-handler/ │ │ │ ├── README.md │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── usb/ │ │ │ ├── device-info/ │ │ │ │ ├── README.md │ │ │ │ ├── background.js │ │ │ │ ├── index.html │ │ │ │ ├── manifest.json │ │ │ │ ├── script.js │ │ │ │ └── style.css │ │ │ └── knob/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── knob.html │ │ │ ├── knob.js │ │ │ └── manifest.json │ │ ├── usb-label-printer/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dettach_kernel_driver.py │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── weather/ │ │ │ ├── README.md │ │ │ ├── lib/ │ │ │ │ └── iscroll.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ ├── style.css │ │ │ ├── weather.html │ │ │ └── weather.js │ │ ├── web-store/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── css/ │ │ │ │ └── index.css │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ ├── index.js │ │ │ │ ├── webstore.js │ │ │ │ └── zip/ │ │ │ │ ├── deflate.js │ │ │ │ ├── inflate.js │ │ │ │ └── zip.js │ │ │ └── manifest.json │ │ ├── webgl-pointer-lock/ │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ ├── Detector.js │ │ │ │ └── showlogo3d.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── obj/ │ │ │ │ └── html5rocks.js │ │ │ └── styles/ │ │ │ └── main.css │ │ ├── webserver/ │ │ │ ├── README.md │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ └── styles/ │ │ │ ├── bootstrap.css │ │ │ └── main.css │ │ ├── websocket-server/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── http.js │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── manifest.json │ │ │ ├── sample_support_metadata.json │ │ │ └── sha1.js │ │ ├── webview-samples/ │ │ │ ├── browser/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── browser.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ ├── declarative-web-request/ │ │ │ │ ├── README.md │ │ │ │ ├── blocked.css │ │ │ │ ├── blocked.html │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── config.js │ │ │ │ ├── content_blocker.js │ │ │ │ ├── content_blocker_main.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ ├── insert-css/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── config.js │ │ │ │ ├── css.js │ │ │ │ ├── css_main.js │ │ │ │ ├── inject.css │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ ├── local-resources/ │ │ │ │ ├── README.md │ │ │ │ ├── app.css │ │ │ │ ├── bad_app.html │ │ │ │ ├── crash.js │ │ │ │ ├── good_app.html │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ └── trusted.html │ │ │ ├── multi-tab-browser/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── browser.js │ │ │ │ ├── browser_main.js │ │ │ │ ├── config.js │ │ │ │ ├── context_menu.js │ │ │ │ ├── exit_box_controller.js │ │ │ │ ├── find_box_controller.js │ │ │ │ ├── guest_messaging.js │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── permission_box_controller.js │ │ │ │ ├── popup.js │ │ │ │ ├── tabs.js │ │ │ │ └── zoom_box_controller.js │ │ │ ├── new-window/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── browser.js │ │ │ │ ├── browser_main.js │ │ │ │ ├── config.js │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.js │ │ │ │ ├── tabs.js │ │ │ │ └── title.js │ │ │ ├── new-window-user-agent/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── browser.js │ │ │ │ ├── browser_main.js │ │ │ │ ├── config.js │ │ │ │ ├── context_menu.js │ │ │ │ ├── guest_messaging.js │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.js │ │ │ │ └── tabs.js │ │ │ ├── shared-script/ │ │ │ │ ├── README.md │ │ │ │ ├── app.css │ │ │ │ ├── correct_injection.html │ │ │ │ ├── correct_injection.js │ │ │ │ ├── incorrect_injection.html │ │ │ │ ├── incorrect_injection.js │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ └── more_dragons.js │ │ │ ├── user-agent/ │ │ │ │ ├── README.md │ │ │ │ ├── browser.css │ │ │ │ ├── browser.html │ │ │ │ ├── browser.js │ │ │ │ ├── browser_bindings.js │ │ │ │ ├── config.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── webview/ │ │ │ ├── README.md │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── main.js │ │ │ ├── manifest.json │ │ │ └── page_hosted_in_external_server.html │ │ ├── window-options/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── css/ │ │ │ │ └── window.css │ │ │ ├── icon_128.xcf │ │ │ ├── manifest.json │ │ │ ├── window.html │ │ │ └── window.js │ │ ├── window-state/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── icon_128.xcf │ │ │ ├── manifest.json │ │ │ ├── window.css │ │ │ ├── window.html │ │ │ └── window.js │ │ └── windows/ │ │ ├── README.md │ │ ├── copycat.html │ │ ├── main.js │ │ ├── manifest.json │ │ ├── original.html │ │ ├── scripts/ │ │ │ └── window.js │ │ └── styles/ │ │ └── window.css │ └── mv2/ │ ├── api/ │ │ ├── bookmarks/ │ │ │ └── basic/ │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── browserAction/ │ │ │ ├── make_page_red/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ ├── print/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ ├── set_icon_path/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ └── set_page_color/ │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── browsingData/ │ │ │ └── basic/ │ │ │ ├── manifest.json │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── commands/ │ │ │ ├── background.js │ │ │ ├── browser_action.html │ │ │ └── manifest.json │ │ ├── contentSettings/ │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── contextMenus/ │ │ │ ├── basic/ │ │ │ │ ├── manifest.json │ │ │ │ └── sample.js │ │ │ ├── event_page/ │ │ │ │ ├── manifest.json │ │ │ │ └── sample.js │ │ │ └── global_context_search/ │ │ │ ├── background.js │ │ │ ├── locales.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ └── options.js │ │ ├── cookies/ │ │ │ ├── background.js │ │ │ ├── manager.html │ │ │ ├── manager.js │ │ │ └── manifest.json │ │ ├── debugger/ │ │ │ ├── live-headers/ │ │ │ │ ├── background.js │ │ │ │ ├── headers.html │ │ │ │ ├── headers.js │ │ │ │ └── manifest.json │ │ │ └── pause-resume/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── default_command_override/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── desktopCapture/ │ │ │ ├── app.js │ │ │ ├── background.js │ │ │ ├── index.html │ │ │ └── manifest.json │ │ ├── deviceInfo/ │ │ │ └── basic/ │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── devtools/ │ │ │ ├── network/ │ │ │ │ └── chrome-firephp/ │ │ │ │ ├── background.js │ │ │ │ ├── devtools.html │ │ │ │ ├── devtools.js │ │ │ │ └── manifest.json │ │ │ └── panels/ │ │ │ └── chrome-query/ │ │ │ ├── devtools.html │ │ │ ├── devtools.js │ │ │ └── manifest.json │ │ ├── displaySource/ │ │ │ └── tabCast/ │ │ │ ├── README │ │ │ ├── background.js │ │ │ ├── main.css │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── document_scan/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── scan.css │ │ │ ├── scan.html │ │ │ └── scan.js │ │ ├── downloads/ │ │ │ ├── download_filename_controller/ │ │ │ │ ├── bg.js │ │ │ │ ├── manifest.json │ │ │ │ ├── options.html │ │ │ │ └── options.js │ │ │ ├── download_links/ │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.html │ │ │ │ ├── popup.js │ │ │ │ └── send_links.js │ │ │ ├── download_manager/ │ │ │ │ ├── _locales/ │ │ │ │ │ └── en/ │ │ │ │ │ └── messages.json │ │ │ │ ├── background.js │ │ │ │ ├── icons.html │ │ │ │ ├── icons.js │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.css │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ ├── download_open/ │ │ │ │ ├── _locales/ │ │ │ │ │ └── en/ │ │ │ │ │ └── messages.json │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ └── downloads_overwrite/ │ │ │ ├── bg.js │ │ │ └── manifest.json │ │ ├── eventPage/ │ │ │ └── basic/ │ │ │ ├── background.js │ │ │ ├── content.js │ │ │ └── manifest.json │ │ ├── extension/ │ │ │ └── isAllowedAccess/ │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ ├── popup.js │ │ │ └── sample.css │ │ ├── fileSystemProvider/ │ │ │ ├── archive/ │ │ │ │ ├── background.js │ │ │ │ ├── example1.fake │ │ │ │ ├── example2.fake │ │ │ │ └── manifest.json │ │ │ └── basic/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── fontSettings/ │ │ │ ├── css/ │ │ │ │ ├── chrome_shared.css │ │ │ │ ├── overlay.css │ │ │ │ ├── uber_shared.css │ │ │ │ └── widgets.css │ │ │ ├── js/ │ │ │ │ ├── cr/ │ │ │ │ │ ├── ui/ │ │ │ │ │ │ └── overlay.js │ │ │ │ │ └── ui.js │ │ │ │ └── cr.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── pending_changes.js │ │ │ ├── slider.css │ │ │ └── slider.js │ │ ├── history/ │ │ │ ├── historyOverride/ │ │ │ │ ├── history.html │ │ │ │ ├── logic.js │ │ │ │ ├── manifest.json │ │ │ │ └── style.css │ │ │ └── showHistory/ │ │ │ ├── manifest.json │ │ │ ├── typedUrls.html │ │ │ └── typedUrls.js │ │ ├── i18n/ │ │ │ ├── cld/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ ├── detectLanguage/ │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ ├── getMessage/ │ │ │ │ ├── _locales/ │ │ │ │ │ ├── en_US/ │ │ │ │ │ │ └── messages.json │ │ │ │ │ ├── es/ │ │ │ │ │ │ └── messages.json │ │ │ │ │ └── sr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ └── localizedHostedApp/ │ │ │ ├── _locales/ │ │ │ │ ├── de/ │ │ │ │ │ └── messages.json │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ └── manifest.json │ │ ├── idle/ │ │ │ └── idle_simple/ │ │ │ ├── background.js │ │ │ ├── history.html │ │ │ ├── history.js │ │ │ └── manifest.json │ │ ├── input.ime/ │ │ │ └── basic/ │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── messaging/ │ │ │ └── timer/ │ │ │ ├── manifest.json │ │ │ ├── page.js │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── nativeMessaging/ │ │ │ ├── README.md │ │ │ ├── app/ │ │ │ │ ├── main.html │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── host/ │ │ │ ├── com.google.chrome.example.echo-win.json │ │ │ ├── com.google.chrome.example.echo.json │ │ │ ├── install_host.bat │ │ │ ├── install_host.sh │ │ │ ├── native-messaging-example-host │ │ │ ├── native-messaging-example-host.bat │ │ │ ├── uninstall_host.bat │ │ │ └── uninstall_host.sh │ │ ├── notifications/ │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ └── style.css │ │ ├── omnibox/ │ │ │ ├── newtab_search/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ └── simple-example/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── override/ │ │ │ ├── blank_ntp/ │ │ │ │ ├── blank.html │ │ │ │ └── manifest.json │ │ │ └── override_igoogle/ │ │ │ ├── manifest.json │ │ │ └── redirect.html │ │ ├── pageAction/ │ │ │ ├── pageaction_by_content/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ ├── pageaction_by_url/ │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ └── set_icon/ │ │ │ ├── background.html │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── permissions/ │ │ │ ├── extension-questions/ │ │ │ │ ├── manifest.json │ │ │ │ ├── options.html │ │ │ │ ├── options.js │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ └── extension-questions.crx │ │ ├── power/ │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── preferences/ │ │ │ ├── allowThirdPartyCookies/ │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.css │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ └── enableReferrer/ │ │ │ ├── manifest.json │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── printing/ │ │ │ ├── manifest.json │ │ │ ├── printers.css │ │ │ ├── printers.html │ │ │ └── printers.js │ │ ├── printingMetrics/ │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── print_jobs.css │ │ │ ├── print_jobs.html │ │ │ └── print_jobs.js │ │ ├── processes/ │ │ │ ├── process_monitor/ │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ └── show_tabs/ │ │ │ ├── manifest.json │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── storage/ │ │ │ └── stylizr/ │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── tabCapture/ │ │ │ ├── eventPage.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── receiver.html │ │ │ └── receiver.js │ │ ├── tabs/ │ │ │ ├── inspector/ │ │ │ │ ├── background.js │ │ │ │ ├── jstemplate_compiled.js │ │ │ │ ├── manifest.json │ │ │ │ ├── tabs_api.html │ │ │ │ └── tabs_api.js │ │ │ ├── pin/ │ │ │ │ ├── README │ │ │ │ ├── background.js │ │ │ │ └── manifest.json │ │ │ ├── screenshot/ │ │ │ │ ├── background.js │ │ │ │ ├── manifest.json │ │ │ │ ├── screenshot.html │ │ │ │ └── screenshot.js │ │ │ └── zoom/ │ │ │ ├── README │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── topsites/ │ │ │ ├── basic/ │ │ │ │ ├── manifest.json │ │ │ │ ├── popup.html │ │ │ │ └── popup.js │ │ │ └── magic8ball/ │ │ │ ├── manifest.json │ │ │ ├── newTab.css │ │ │ ├── newTab.html │ │ │ └── newTab.js │ │ ├── ttsEngine/ │ │ │ └── console_tts_engine/ │ │ │ ├── console_tts_engine.html │ │ │ ├── console_tts_engine.js │ │ │ └── manifest.json │ │ ├── water_alarm_notification/ │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── webNavigation/ │ │ │ └── basic/ │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── navigation_collector.js │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── webview/ │ │ │ ├── capturevisibleregion/ │ │ │ │ ├── display.html │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ ├── test.html │ │ │ │ ├── test.js │ │ │ │ └── test2.html │ │ │ ├── comm_demo_app/ │ │ │ │ ├── app.js │ │ │ │ ├── main.js │ │ │ │ ├── manifest.json │ │ │ │ └── test.html │ │ │ └── comm_demo_ext/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ └── windows/ │ │ └── merge_windows/ │ │ ├── NOTICE │ │ ├── background.js │ │ └── manifest.json │ ├── extensions/ │ │ ├── app_launcher/ │ │ │ ├── manifest.json │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── buildbot/ │ │ │ ├── active_issues.js │ │ │ ├── bg.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ ├── popup.js │ │ │ ├── prefs.js │ │ │ ├── try_status.js │ │ │ └── utils.js │ │ ├── calendar/ │ │ │ ├── _locales/ │ │ │ │ ├── ar/ │ │ │ │ │ └── messages.json │ │ │ │ ├── bg/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ca/ │ │ │ │ │ └── messages.json │ │ │ │ ├── cs/ │ │ │ │ │ └── messages.json │ │ │ │ ├── da/ │ │ │ │ │ └── messages.json │ │ │ │ ├── de/ │ │ │ │ │ └── messages.json │ │ │ │ ├── el/ │ │ │ │ │ └── messages.json │ │ │ │ ├── en/ │ │ │ │ │ └── messages.json │ │ │ │ ├── en_GB/ │ │ │ │ │ └── messages.json │ │ │ │ ├── es/ │ │ │ │ │ └── messages.json │ │ │ │ ├── es_419/ │ │ │ │ │ └── messages.json │ │ │ │ ├── et/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fil/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── he/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hu/ │ │ │ │ │ └── messages.json │ │ │ │ ├── id/ │ │ │ │ │ └── messages.json │ │ │ │ ├── it/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ja/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ko/ │ │ │ │ │ └── messages.json │ │ │ │ ├── lt/ │ │ │ │ │ └── messages.json │ │ │ │ ├── lv/ │ │ │ │ │ └── messages.json │ │ │ │ ├── nb/ │ │ │ │ │ └── messages.json │ │ │ │ ├── nl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pt_BR/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pt_PT/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ro/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ru/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sk/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sv/ │ │ │ │ │ └── messages.json │ │ │ │ ├── th/ │ │ │ │ │ └── messages.json │ │ │ │ ├── tr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── uk/ │ │ │ │ │ └── messages.json │ │ │ │ ├── vi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── zh_CN/ │ │ │ │ │ └── messages.json │ │ │ │ └── zh_TW/ │ │ │ │ └── messages.json │ │ │ ├── javascript/ │ │ │ │ ├── background.js │ │ │ │ └── options.js │ │ │ ├── manifest.json │ │ │ └── views/ │ │ │ └── options.html │ │ ├── catblock/ │ │ │ ├── background.js │ │ │ ├── loldogs.js │ │ │ └── manifest.json │ │ ├── catifier/ │ │ │ ├── event_page.js │ │ │ └── manifest.json │ │ ├── chrome_search/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── constant_context/ │ │ │ ├── background.js │ │ │ ├── content_script.js │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── download_images/ │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── email_this_page/ │ │ │ ├── background.js │ │ │ ├── content_script.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ └── options.js │ │ ├── fx/ │ │ │ ├── bg.js │ │ │ ├── content.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ └── options.js │ │ ├── gdocs/ │ │ │ ├── README │ │ │ ├── background.html │ │ │ ├── chrome_ex_oauth.html │ │ │ ├── chrome_ex_oauth.js │ │ │ ├── chrome_ex_oauthsimple.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ └── popup.html │ │ ├── gmail/ │ │ │ ├── _locales/ │ │ │ │ ├── ar/ │ │ │ │ │ └── messages.json │ │ │ │ ├── bg/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ca/ │ │ │ │ │ └── messages.json │ │ │ │ ├── cs/ │ │ │ │ │ └── messages.json │ │ │ │ ├── da/ │ │ │ │ │ └── messages.json │ │ │ │ ├── de/ │ │ │ │ │ └── messages.json │ │ │ │ ├── el/ │ │ │ │ │ └── messages.json │ │ │ │ ├── en/ │ │ │ │ │ └── messages.json │ │ │ │ ├── en_GB/ │ │ │ │ │ └── messages.json │ │ │ │ ├── es/ │ │ │ │ │ └── messages.json │ │ │ │ ├── es_419/ │ │ │ │ │ └── messages.json │ │ │ │ ├── et/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fil/ │ │ │ │ │ └── messages.json │ │ │ │ ├── fr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── he/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── hu/ │ │ │ │ │ └── messages.json │ │ │ │ ├── id/ │ │ │ │ │ └── messages.json │ │ │ │ ├── it/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ja/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ko/ │ │ │ │ │ └── messages.json │ │ │ │ ├── lt/ │ │ │ │ │ └── messages.json │ │ │ │ ├── lv/ │ │ │ │ │ └── messages.json │ │ │ │ ├── nb/ │ │ │ │ │ └── messages.json │ │ │ │ ├── nl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pt_BR/ │ │ │ │ │ └── messages.json │ │ │ │ ├── pt_PT/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ro/ │ │ │ │ │ └── messages.json │ │ │ │ ├── ru/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sk/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sl/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── sv/ │ │ │ │ │ └── messages.json │ │ │ │ ├── th/ │ │ │ │ │ └── messages.json │ │ │ │ ├── tr/ │ │ │ │ │ └── messages.json │ │ │ │ ├── uk/ │ │ │ │ │ └── messages.json │ │ │ │ ├── vi/ │ │ │ │ │ └── messages.json │ │ │ │ ├── zh_CN/ │ │ │ │ │ └── messages.json │ │ │ │ └── zh_TW/ │ │ │ │ └── messages.json │ │ │ ├── background.html │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── imageinfo/ │ │ │ ├── NOTICE │ │ │ ├── background.js │ │ │ ├── imageinfo/ │ │ │ │ ├── binaryajax.js │ │ │ │ ├── exif.js │ │ │ │ ├── imageinfo.js │ │ │ │ └── readme.txt │ │ │ ├── info.css │ │ │ ├── info.html │ │ │ ├── info.js │ │ │ └── manifest.json │ │ ├── irc/ │ │ │ ├── README.txt │ │ │ ├── app/ │ │ │ │ └── manifest.json │ │ │ ├── conf/ │ │ │ │ ├── irc.xml │ │ │ │ ├── jetty.xml │ │ │ │ └── webdefault.xml │ │ │ └── servlet/ │ │ │ ├── WEB-INF/ │ │ │ │ └── web.xml │ │ │ ├── addChannel.html │ │ │ ├── addServer.html │ │ │ ├── index.html │ │ │ ├── irc.js │ │ │ ├── jstemplate/ │ │ │ │ ├── jsevalcontext.js │ │ │ │ ├── jstemplate.js │ │ │ │ └── util.js │ │ │ ├── notification.html │ │ │ ├── src/ │ │ │ │ └── org/ │ │ │ │ └── chromium/ │ │ │ │ └── IRCProxyWebSocket.java │ │ │ ├── styles.css │ │ │ └── util.js │ │ ├── managed_bookmarks/ │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ └── schema.json │ │ ├── mappy/ │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── mappy_content_script.js │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── maps_app/ │ │ │ └── manifest.json │ │ ├── news/ │ │ │ ├── README │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── css/ │ │ │ │ ├── feed.css │ │ │ │ └── options.css │ │ │ ├── javascript/ │ │ │ │ ├── feed.js │ │ │ │ ├── options.js │ │ │ │ └── util.js │ │ │ ├── manifest.json │ │ │ └── views/ │ │ │ ├── background.html │ │ │ ├── feed.html │ │ │ └── options.html │ │ ├── news_a11y/ │ │ │ ├── README │ │ │ ├── feed.css │ │ │ ├── feed.html │ │ │ ├── feed.js │ │ │ ├── feed_iframe.css │ │ │ ├── feed_iframe.js │ │ │ └── manifest.json │ │ ├── news_i18n/ │ │ │ ├── README │ │ │ ├── _locales/ │ │ │ │ ├── en/ │ │ │ │ │ └── messages.json │ │ │ │ ├── es/ │ │ │ │ │ └── messages.json │ │ │ │ └── sr/ │ │ │ │ └── messages.json │ │ │ ├── feed.css │ │ │ ├── feed.html │ │ │ ├── feed.js │ │ │ └── manifest.json │ │ ├── no_cookies/ │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── oauth_contacts/ │ │ │ ├── NOTICE │ │ │ ├── README │ │ │ ├── background.js │ │ │ ├── chrome_ex_oauth.html │ │ │ ├── chrome_ex_oauth.js │ │ │ ├── chrome_ex_oauthsimple.js │ │ │ ├── contacts.html │ │ │ ├── contacts.js │ │ │ ├── manifest.json │ │ │ └── onload.js │ │ ├── optional_permissions/ │ │ │ ├── logic.js │ │ │ ├── manifest.json │ │ │ ├── newtab.html │ │ │ └── style.css │ │ ├── plugin_settings/ │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── css/ │ │ │ │ ├── plugin_list.css │ │ │ │ └── rule_list.css │ │ │ ├── domui/ │ │ │ │ ├── css/ │ │ │ │ │ ├── button.css │ │ │ │ │ ├── chrome_shared.css │ │ │ │ │ ├── list.css │ │ │ │ │ └── select.css │ │ │ │ └── js/ │ │ │ │ ├── cr/ │ │ │ │ │ ├── event_target.js │ │ │ │ │ ├── ui/ │ │ │ │ │ │ ├── array_data_model.js │ │ │ │ │ │ ├── list.js │ │ │ │ │ │ ├── list_item.js │ │ │ │ │ │ ├── list_selection_controller.js │ │ │ │ │ │ ├── list_selection_model.js │ │ │ │ │ │ └── list_single_selection_model.js │ │ │ │ │ └── ui.js │ │ │ │ ├── cr.js │ │ │ │ └── util.js │ │ │ ├── js/ │ │ │ │ ├── chrome_stubs.js │ │ │ │ ├── main.js │ │ │ │ ├── plugin_list.js │ │ │ │ ├── plugin_list_test.html │ │ │ │ ├── plugin_settings.js │ │ │ │ ├── plugin_settings_test.html │ │ │ │ ├── rule_list.js │ │ │ │ └── rule_list_test.html │ │ │ ├── manifest.json │ │ │ ├── options/ │ │ │ │ ├── css/ │ │ │ │ │ └── list.css │ │ │ │ └── js/ │ │ │ │ ├── deletable_item_list.js │ │ │ │ └── inline_editable_list.js │ │ │ └── options.html │ │ ├── proxy_configuration/ │ │ │ ├── _locales/ │ │ │ │ └── en/ │ │ │ │ └── messages.json │ │ │ ├── background.js │ │ │ ├── manifest.json │ │ │ ├── popup.css │ │ │ ├── popup.html │ │ │ ├── popup.js │ │ │ ├── proxy_error_handler.js │ │ │ ├── proxy_form_controller.js │ │ │ └── test/ │ │ │ ├── jsunittest.js │ │ │ ├── proxy_form_controller_test.html │ │ │ ├── proxy_form_controller_test.js │ │ │ └── unittest.css │ │ ├── speak_selection/ │ │ │ ├── background.js │ │ │ ├── content_script.js │ │ │ ├── keycodes.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ └── tabs.js │ │ ├── talking_alarm_clock/ │ │ │ ├── audio/ │ │ │ │ ├── cuckoo.ogg │ │ │ │ ├── digital.ogg │ │ │ │ ├── metal.ogg │ │ │ │ ├── ringing.ogg │ │ │ │ └── rooster.ogg │ │ │ ├── background.js │ │ │ ├── common.js │ │ │ ├── credits.html │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── ttsdebug/ │ │ │ ├── manifest.json │ │ │ ├── ttsdebug.css │ │ │ ├── ttsdebug.html │ │ │ └── ttsdebug.js │ │ └── ttsdemo/ │ │ ├── manifest.json │ │ ├── ttsdemo.html │ │ └── ttsdemo.js │ ├── howto/ │ │ ├── sandbox/ │ │ │ ├── LICENSE.handlebars │ │ │ ├── eventpage.html │ │ │ ├── eventpage.js │ │ │ ├── handlebars-1.0.0.beta.6.js │ │ │ ├── manifest.json │ │ │ └── sandbox.html │ │ └── tab_shortcuts/ │ │ ├── manifest.json │ │ └── tab_shortcuts.js │ ├── readme.md │ └── tutorials/ │ ├── analytics/ │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── broken_background_color/ │ │ ├── background.js │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ └── popup.js │ ├── get_started/ │ │ ├── background.js │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ └── popup.js │ ├── get_started_complete/ │ │ ├── background.js │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ └── popup.js │ ├── getstarted/ │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── hello_extensions/ │ │ ├── hello.html │ │ └── manifest.json │ ├── oauth_starter/ │ │ ├── background.js │ │ ├── index.html │ │ ├── manifest.json │ │ └── oauth.js │ └── oauth_tutorial_complete/ │ ├── background.js │ ├── index.html │ ├── manifest.json │ └── oauth.js ├── api-samples/ │ ├── action/ │ │ ├── README.md │ │ ├── background.js │ │ ├── demo/ │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ └── index.js │ │ ├── manifest.json │ │ ├── popups/ │ │ │ ├── a.html │ │ │ ├── b.html │ │ │ └── popup.html │ │ └── third-party/ │ │ └── awsm/ │ │ └── awsm.css │ ├── alarms/ │ │ ├── README.md │ │ ├── background.js │ │ ├── bg-wrapper.js │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ └── manifest.json │ ├── bookmarks/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── browsingData/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.css │ │ ├── popup.html │ │ └── popup.js │ ├── commands/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── popup.css │ │ ├── popup.html │ │ └── popup.js │ ├── contentSettings/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── contextMenus/ │ │ ├── basic/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ └── sample.js │ │ └── global_context_search/ │ │ ├── README.md │ │ ├── background.js │ │ ├── locales.js │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── cookies/ │ │ └── cookie-clearer/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── debugger/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ ├── declarativeNetRequest/ │ │ ├── no-cookies/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── rules_1.json │ │ │ └── service-worker.js │ │ ├── url-blocker/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── rules_1.json │ │ │ └── service_worker.js │ │ └── url-redirect/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── rules_1.json │ │ └── service_worker.js │ ├── default_command_override/ │ │ ├── README.md │ │ ├── background.js │ │ └── manifest.json │ ├── devtools/ │ │ ├── inspectedWindow/ │ │ │ ├── README.md │ │ │ ├── devtools.html │ │ │ ├── devtools.js │ │ │ ├── manifest.json │ │ │ ├── panel.html │ │ │ └── panel.js │ │ └── panels/ │ │ ├── devtools.html │ │ ├── devtools.js │ │ ├── manifest.json │ │ └── readme.md │ ├── favicon/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── fontSettings/ │ │ ├── fontSettings Advanced/ │ │ │ ├── README.md │ │ │ ├── css/ │ │ │ │ ├── chrome_shared.css │ │ │ │ ├── overlay.css │ │ │ │ ├── uber_shared.css │ │ │ │ └── widgets.css │ │ │ ├── js/ │ │ │ │ ├── cr/ │ │ │ │ │ ├── ui/ │ │ │ │ │ │ └── overlay.js │ │ │ │ │ └── ui.js │ │ │ │ └── cr.js │ │ │ ├── manifest.json │ │ │ ├── options.html │ │ │ ├── options.js │ │ │ ├── pending_changes.js │ │ │ ├── slider.css │ │ │ └── slider.js │ │ └── fontSettings Basic/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── history/ │ │ ├── historyOverride/ │ │ │ ├── README.md │ │ │ ├── history.html │ │ │ ├── logic.js │ │ │ ├── manifest.json │ │ │ └── style.css │ │ └── showHistory/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ ├── popup.js │ │ └── service-worker.js │ ├── identity/ │ │ ├── README.md │ │ ├── identity.js │ │ ├── index.html │ │ ├── main.js │ │ ├── manifest.json │ │ └── style.css │ ├── idle/ │ │ ├── README.md │ │ ├── history.html │ │ ├── history.js │ │ ├── manifest.json │ │ └── service-worker.js │ ├── il8n/ │ │ ├── README.md │ │ ├── _locales/ │ │ │ ├── en/ │ │ │ │ └── messages.json │ │ │ └── fr/ │ │ │ └── messages.json │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── nativeMessaging/ │ │ ├── README.md │ │ ├── extension/ │ │ │ ├── main.html │ │ │ ├── main.js │ │ │ └── manifest.json │ │ └── host/ │ │ ├── com.google.chrome.example.echo-win.json │ │ ├── com.google.chrome.example.echo.json │ │ ├── install_host.bat │ │ ├── install_host.sh │ │ ├── native-messaging-example-host │ │ ├── native-messaging-example-host.bat │ │ ├── uninstall_host.bat │ │ └── uninstall_host.sh │ ├── omnibox/ │ │ ├── new-tab-search/ │ │ │ ├── README.md │ │ │ ├── background.js │ │ │ └── manifest.json │ │ └── simple-example/ │ │ ├── README.md │ │ ├── logs.css │ │ ├── logs.html │ │ ├── logs.js │ │ ├── manifest.json │ │ └── service-worker.js │ ├── override/ │ │ └── blank_ntp/ │ │ ├── README.md │ │ ├── blank.html │ │ └── manifest.json │ ├── power/ │ │ ├── README.md │ │ ├── _locales/ │ │ │ └── en/ │ │ │ └── messages.json │ │ ├── background.js │ │ └── manifest.json │ ├── printing/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── printers.css │ │ ├── printers.html │ │ └── printers.js │ ├── privacy/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ ├── readingList/ │ │ ├── README.md │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ ├── manifest.json │ │ └── sw.js │ ├── richNotification/ │ │ ├── manifest.json │ │ ├── popup.html │ │ ├── popup.js │ │ └── readme.md │ ├── sandbox/ │ │ ├── sandbox/ │ │ │ ├── LICENSE.handlebars │ │ │ ├── handlebars-1.0.0.beta.6.js │ │ │ ├── mainpage.html │ │ │ ├── mainpage.js │ │ │ ├── manifest.json │ │ │ ├── sandbox.html │ │ │ ├── sandbox.md │ │ │ ├── service-worker.js │ │ │ └── styles/ │ │ │ └── main.css │ │ └── sandboxed-content/ │ │ ├── README.md │ │ ├── main.html │ │ ├── manifest.json │ │ ├── sandboxed.html │ │ ├── service-worker.js │ │ └── styles/ │ │ └── main.css │ ├── scripting/ │ │ ├── README.md │ │ ├── content-script.js │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ ├── manifest.json │ │ └── sw.js │ ├── storage/ │ │ └── stylizr/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ └── popup.js │ ├── tabCapture/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── receiver.html │ │ ├── receiver.js │ │ └── service-worker.js │ ├── tabs/ │ │ ├── inspector/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── service-worker.js │ │ │ ├── window_and_tabs_manager.css │ │ │ ├── window_and_tabs_manager.html │ │ │ └── window_and_tabs_manager.js │ │ ├── pin/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ └── service-worker.js │ │ ├── screenshot/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── screenshot.html │ │ │ ├── screenshot.js │ │ │ └── service-worker.js │ │ └── zoom/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ ├── popup.js │ │ └── service-worker.js │ ├── topSites/ │ │ ├── basic/ │ │ │ ├── README.md │ │ │ ├── manifest.json │ │ │ ├── popup.html │ │ │ └── popup.js │ │ └── magic8ball/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── newTab.css │ │ ├── newTab.html │ │ └── newTab.js │ ├── userScripts/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── options.css │ │ ├── options.html │ │ ├── options.js │ │ ├── sw.js │ │ └── user-script.js │ ├── web-accessible-resources/ │ │ ├── README.md │ │ ├── content-script.js │ │ ├── index.html │ │ ├── manifest.json │ │ └── service-worker.js │ ├── webNavigation/ │ │ └── basic/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ ├── webRequest/ │ │ └── http-auth/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ └── windows/ │ ├── README.md │ ├── background.js │ └── manifest.json ├── eslint.config.js ├── functional-samples/ │ ├── ai.gemini-in-the-cloud/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── package.json │ │ └── sidepanel/ │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── ai.gemini-on-device/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── package.json │ │ ├── privacy.txt │ │ ├── rollup.config.mjs │ │ └── sidepanel/ │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── ai.gemini-on-device-alt-texter/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── ai.gemini-on-device-audio-scribe/ │ │ ├── README.md │ │ ├── background.js │ │ ├── bridge.js │ │ ├── demo-chat-app/ │ │ │ ├── index.html │ │ │ ├── script.js │ │ │ └── style.css │ │ ├── manifest.json │ │ ├── override-createobject-url.js │ │ ├── sidepanel.html │ │ └── sidepanel.js │ ├── ai.gemini-on-device-calendar-mate/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── package.json │ │ └── rollup.config.mjs │ ├── ai.gemini-on-device-summarization/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── package.json │ │ ├── rollup.config.mjs │ │ ├── scripts/ │ │ │ └── extract-content.js │ │ └── sidepanel/ │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── cookbook.file_handlers/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── view-file.html │ │ └── view-file.js │ ├── cookbook.geolocation-contentscript/ │ │ ├── README.md │ │ ├── content-script.js │ │ └── manifest.json │ ├── cookbook.geolocation-offscreen/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── offscreen.html │ │ ├── offscreen.js │ │ └── service_worker.js │ ├── cookbook.geolocation-popup/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── cookbook.offscreen-clipboard-write/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── offscreen.html │ │ └── offscreen.js │ ├── cookbook.offscreen-dom/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── offscreen.html │ │ └── offscreen.js │ ├── cookbook.permissions-addhostaccessrequest/ │ │ ├── README.md │ │ ├── background.js │ │ ├── banner.js │ │ └── manifest.json │ ├── cookbook.push/ │ │ ├── README.md │ │ ├── background.js │ │ └── manifest.json │ ├── cookbook.sidepanel-global/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── service-worker.js │ │ ├── sidepanel.html │ │ └── sidepanel.js │ ├── cookbook.sidepanel-multiple/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── service-worker.js │ │ └── sidepanels/ │ │ ├── main-sp.html │ │ └── welcome-sp.html │ ├── cookbook.sidepanel-open/ │ │ ├── README.md │ │ ├── content-script.js │ │ ├── manifest.json │ │ ├── page.html │ │ ├── script.js │ │ ├── service-worker.js │ │ ├── sidepanel-global.html │ │ └── sidepanel-tab.html │ ├── cookbook.sidepanel-site-specific/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── service-worker.js │ │ └── sidepanel.html │ ├── cookbook.wasm-helloworld-print/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ └── wasm/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── pkg/ │ │ │ ├── helloworld_demo.d.ts │ │ │ ├── helloworld_demo.js │ │ │ ├── helloworld_demo_bg.wasm │ │ │ └── helloworld_demo_bg.wasm.d.ts │ │ └── src/ │ │ └── lib.rs │ ├── cookbook.wasm-helloworld-print-nomodule/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ └── wasm/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── pkg/ │ │ │ ├── helloworld_demo.d.ts │ │ │ ├── helloworld_demo.js │ │ │ ├── helloworld_demo_bg.wasm │ │ │ └── helloworld_demo_bg.wasm.d.ts │ │ └── src/ │ │ └── lib.rs │ ├── libraries-xhr-in-sw/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── package.json │ │ ├── rollup.config.mjs │ │ ├── sidepanel/ │ │ │ ├── index.html │ │ │ └── script.js │ │ └── third_party/ │ │ ├── fetchTitle.js │ │ └── xhr-shim/ │ │ ├── LICENSE │ │ └── xhr-shim.js │ ├── reference.mv3-content-scripts/ │ │ ├── README.md │ │ ├── content-script.js │ │ ├── manifest.json │ │ ├── popup.css │ │ ├── popup.html │ │ └── popup.js │ ├── sample.bookmarks/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.css │ │ ├── popup.html │ │ ├── popup.js │ │ └── third-party/ │ │ ├── jquery-1.12.4.js │ │ ├── jquery-ui-1.12.1.js │ │ ├── jquery-ui.css │ │ ├── jquery-ui.structure.css │ │ └── jquery-ui.theme.css │ ├── sample.catifier/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── rules.json │ ├── sample.co2meter/ │ │ ├── README.md │ │ ├── background.js │ │ ├── co2-state-iframe.html │ │ ├── co2-state-iframe.js │ │ ├── images/ │ │ │ └── icon32.psd │ │ ├── main-page.html │ │ ├── main-page.js │ │ ├── manifest.json │ │ ├── modules/ │ │ │ ├── co2_meter.js │ │ │ ├── constant.js │ │ │ └── icon.js │ │ ├── popup.html │ │ └── popup.js │ ├── sample.dnr-rule-manager/ │ │ ├── README.md │ │ ├── manager.css │ │ ├── manager.html │ │ ├── manager.js │ │ ├── manifest.json │ │ ├── popup.html │ │ ├── popup.js │ │ └── service_worker.js │ ├── sample.favicon-cs/ │ │ ├── README.md │ │ ├── content.js │ │ ├── manifest.json │ │ └── style.css │ ├── sample.milestones/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── sample.optional_permissions/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── newtab.html │ │ ├── newtab.js │ │ └── style.css │ ├── sample.page-redder/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ ├── sample.sidepanel-dictionary/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── service-worker.js │ │ ├── sidepanel.html │ │ └── sidepanel.js │ ├── sample.tabcapture-recorder/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── offscreen.html │ │ ├── offscreen.js │ │ └── service-worker.js │ ├── sample.theme/ │ │ ├── Cached Theme.pak │ │ ├── README.md │ │ └── manifest.json │ ├── sample.water_alarm_notification/ │ │ ├── README.md │ │ ├── background.js │ │ ├── manifest.json │ │ ├── popup.html │ │ └── popup.js │ ├── sample.webgpu/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── service-worker.js │ ├── tutorial.broken-color/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ ├── popup.js │ │ └── service-worker.js │ ├── tutorial.custom-cursor/ │ │ ├── README.md │ │ ├── counter.js │ │ ├── manifest.json │ │ ├── service-worker.js │ │ └── style.css │ ├── tutorial.focus-mode/ │ │ ├── README.md │ │ ├── background.js │ │ ├── focus-mode.css │ │ └── manifest.json │ ├── tutorial.focus-mode-debugging/ │ │ ├── README.md │ │ ├── background.js │ │ ├── fixed/ │ │ │ ├── background.js │ │ │ └── focus-mode.js │ │ ├── focus-mode.css │ │ ├── focus-mode.js │ │ └── manifest.json │ ├── tutorial.getting-started/ │ │ ├── README.md │ │ ├── background.js │ │ ├── button.css │ │ ├── manifest.json │ │ ├── options.html │ │ ├── options.js │ │ ├── popup.html │ │ └── popup.js │ ├── tutorial.google-analytics/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup/ │ │ │ ├── popup.html │ │ │ └── popup.js │ │ ├── scripts/ │ │ │ └── google-analytics.js │ │ └── service-worker.js │ ├── tutorial.hello-world/ │ │ ├── README.md │ │ ├── hello.html │ │ ├── manifest.json │ │ └── popup.js │ ├── tutorial.mole-game/ │ │ ├── README.md │ │ ├── controller/ │ │ │ ├── manifest.json │ │ │ └── service-worker.js │ │ └── mole/ │ │ ├── manifest.json │ │ └── service-worker.js │ ├── tutorial.open-api-reference/ │ │ ├── README.md │ │ ├── api-list.js │ │ ├── content.js │ │ ├── manifest.json │ │ ├── service-worker.js │ │ ├── sw-omnibox.js │ │ ├── sw-suggestions.js │ │ └── sw-tips.js │ ├── tutorial.puppeteer/ │ │ ├── README.md │ │ ├── index.test.js │ │ └── package.json │ ├── tutorial.quick-api-reference/ │ │ ├── README.md │ │ ├── content.js │ │ ├── manifest.json │ │ ├── service-worker.js │ │ ├── sw-omnibox.js │ │ └── sw-tips.js │ ├── tutorial.reading-time/ │ │ ├── README.md │ │ ├── manifest.json │ │ └── scripts/ │ │ └── content.js │ ├── tutorial.tabs-manager/ │ │ ├── README.md │ │ ├── manifest.json │ │ ├── popup.css │ │ ├── popup.html │ │ └── popup.js │ ├── tutorial.terminate-sw/ │ │ ├── README.md │ │ ├── puppeteer/ │ │ │ ├── .eslintrc │ │ │ ├── index.test.js │ │ │ └── package.json │ │ ├── selenium/ │ │ │ ├── .eslintrc │ │ │ ├── index.test.js │ │ │ └── package.json │ │ └── test-extension/ │ │ ├── manifest.json │ │ ├── page.html │ │ ├── page.js │ │ ├── service-worker-broken.js │ │ └── service-worker-fixed.js │ └── tutorial.websockets/ │ ├── README.md │ ├── manifest.json │ └── service-worker.js └── package.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .allstar/binary_artifacts.yaml ================================================ # Ignore reason: Packed extension for demo purposes. ignorePaths: - _archive/mv2/api/permissions/extension-questions.crx ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- ⚠️ If you have general Chrome Extensions questions, consider posting to the [Chromium Extensions Group](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-extensions) or [Stack Overflow](https://stackoverflow.com/questions/tagged/google-chrome-extension). **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior, or file the issue is found in: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Notes** Anything additional here. 🌈 ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" ================================================ FILE: .github/workflows/lint.yml ================================================ name: CI on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install modules run: npm ci - name: Run ESLint run: npm run lint ================================================ FILE: .github/workflows/sample-list-generator.yml ================================================ name: Sample List Generator on: push: branches: - main defaults: run: working-directory: ./.repo/sample-list-generator jobs: generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 18 - name: Install dependencies run: npm install - name: Generate sample list run: npm run start - name: Upload to artifacts uses: actions/upload-artifact@v4 with: name: extension-samples.json path: ./.repo/sample-list-generator/extension-samples.json if-no-files-found: error ================================================ FILE: .gitignore ================================================ *~ *.DS_store node_modules # Temporary directory for debugging extension samples _debug _metadata dist **/*.swp ================================================ FILE: .husky/pre-commit ================================================ npx lint-staged ================================================ FILE: .prettierignore ================================================ _archive third-party node_modules dist ================================================ FILE: .prettierrc.json ================================================ { "printWidth": 80, "tabWidth": 2, "semi": true, "singleQuote": true, "trailingComma": "none", "bracketSpacing": true, "arrowParens": "always" } ================================================ FILE: .repo/migrate-samples.js ================================================ // Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview Intended to be run as a script on the old samples page, to * extract a list of samples and render as a Markdown table. */ var sampleHeadings = Array.from(document.querySelectorAll('main h2')); var samples = sampleHeadings2.map((heading) => { const title = heading.textContent; const link = heading.querySelector('a'); const href = link.href; const expectedHrefPrefix = 'https://developer.chrome.com/extensions/examples/' let id = ''; if (href.startsWith(expectedHrefPrefix)) { id = href.substr(expectedHrefPrefix.length).replace(/\.zip$/, ''); } else { console.warn('bad href', href); } let notes = ''; // probably a TEXT node let curr = heading; for (;;) { curr = curr.nextSibling; if (!(curr instanceof Text)) { break; } notes += curr.textContent; } notes = notes.trim(); notes = notes.replace(/\s+/g, ' '); // curr probably points to Calls: now const callNodes = Array.from(curr.querySelectorAll('ul li code')); const calls = callNodes.map((node) => node.textContent); return {title, id, notes, calls}; }); var formatCallsList = (calls) => { const parts = calls.map((call) => `
  • ${call}
  • `); return ``; }; var formatRow = (sample) => { return `[${sample.title}](${sample.id})
    ${sample.notes} | ${formatCallsList(sample.calls)}`; }; var formatTable = (all) => { return `Sample | Calls\n--- | ---\n${all.map(formatRow).join('\n')}`; }; ================================================ FILE: .repo/sample-list-generator/.gitignore ================================================ extension-samples.json ================================================ FILE: .repo/sample-list-generator/README.md ================================================ # Sample List Generator ## Overview It's a script that generates `./extension-samples.json` with the list of all the samples available. Currently, this JSON will be provided to [developer.chrome.com](https://developer.chrome.com) for generating a list page containing all the samples. This allows developers to quickly find the sample they want to reference. ## How to use ### Install dependencies ```bash npm install ``` ### Run prefetch script (optional) The prefetch script will generate a list of all the available extension apis on [developer.chrome.com](https://developer.chrome.com/docs/extensions/reference) and save it to `./extension-apis.json`. The file `./extension-apis.json` will be committed so you don't need to run this script unless you want to update the list. ```bash npm run prepare-chrome-types ``` ### Run the generator ```bash npm start ``` ### Run the tests ```bash npm test ``` ## Types ```ts type ApiTypeResult = 'event' | 'method' | 'property' | 'type' | 'unknown'; interface ApiItem { type: ApiTypeResult; namespace: string; propertyName: string; } interface SampleItem { type: 'API_SAMPLE' | 'FUNCTIONAL_SAMPLE'; name: string; title: string; description: string; repo_link: string; apis: ApiItem[]; permissions: string[]; } // the type of extension-samples.json file is SampleItem[] ``` ## Example Here is an example of the generated `extension-samples.json` file: ```json [ { "type": "API_SAMPLE", "name": "alarms", "title": "Alarms API Demo", "description": "", "repo_link": "https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/api-samples/alarms", "permissions": ["alarms"], "apis": [ { "type": "event", "namespace": "runtime", "propertyName": "onInstalled" }, { "type": "event", "namespace": "action", "propertyName": "onClicked" }, { "type": "event", "namespace": "alarms", "propertyName": "onAlarm" }, { "type": "type", "namespace": "runtime", "propertyName": "OnInstalledReason" }, { "type": "method", "namespace": "alarms", "propertyName": "create" }, { "type": "method", "namespace": "tabs", "propertyName": "create" }, { "type": "method", "namespace": "alarms", "propertyName": "clear" }, { "type": "method", "namespace": "alarms", "propertyName": "clearAll" }, { "type": "method", "namespace": "alarms", "propertyName": "getAll" } ] }, { "type": "FUNCTIONAL_SAMPLE", "name": "tutorial.getting-started", "title": "Getting Started Example", "description": "Build an Extension!", "repo_link": "https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/tutorial.getting-started", "permissions": ["storage", "activeTab", "scripting"], "apis": [ { "type": "event", "namespace": "runtime", "propertyName": "onInstalled" }, { "type": "property", "namespace": "storage", "propertyName": "sync" }, { "type": "method", "namespace": "tabs", "propertyName": "query" }, { "type": "method", "namespace": "scripting", "propertyName": "executeScript" } ] } ] ``` ================================================ FILE: .repo/sample-list-generator/extension-apis.json ================================================ { "_comment": "This file is autogenerated by running `npm run prepare-chrome-types`, do not edit.", "accessibilityFeatures": { "properties": [ "animationPolicy", "autoclick", "caretHighlight", "cursorColor", "cursorHighlight", "dictation", "dockedMagnifier", "focusHighlight", "highContrast", "largeCursor", "screenMagnifier", "selectToSpeak", "spokenFeedback", "stickyKeys", "switchAccess", "virtualKeyboard" ], "methods": [], "types": [], "events": [] }, "action": { "properties": [], "methods": [ "disable", "enable", "getBadgeBackgroundColor", "getBadgeText", "getBadgeTextColor", "getPopup", "getTitle", "getUserSettings", "isEnabled", "openPopup", "setBadgeBackgroundColor", "setBadgeText", "setBadgeTextColor", "setIcon", "setPopup", "setTitle" ], "types": [ "OpenPopupOptions", "TabDetails", "UserSettings", "UserSettingsChange" ], "events": ["onClicked", "onUserSettingsChanged"] }, "alarms": { "properties": [], "methods": ["clear", "clearAll", "create", "get", "getAll"], "types": ["Alarm", "AlarmCreateInfo"], "events": ["onAlarm"] }, "app.runtime": { "properties": [], "methods": [], "types": ["EmbedRequest", "LaunchData", "LaunchItem", "LaunchSource"], "events": ["onEmbedRequested", "onLaunched", "onRestarted"] }, "app.window": { "properties": [], "methods": [ "canSetVisibleOnAllWorkspaces", "create", "current", "get", "getAll" ], "types": [ "AppWindow", "Bounds", "BoundsSpecification", "ContentBounds", "CreateWindowOptions", "FrameOptions", "State", "WindowType" ], "events": [ "onBoundsChanged", "onClosed", "onFullscreened", "onMaximized", "onMinimized", "onRestored" ] }, "app": { "properties": [], "methods": ["getDetails", "getIsInstalled", "installState", "runningState"], "types": ["DOMWindow", "Details", "InstallState", "RunningState"], "events": [] }, "appviewTag": { "properties": [], "methods": ["connect"], "types": ["EmbedRequest"], "events": [] }, "audio": { "properties": [], "methods": [ "getDevices", "getMute", "setActiveDevices", "setMute", "setProperties" ], "types": [ "AudioDeviceInfo", "DeviceFilter", "DeviceIdLists", "DeviceProperties", "LevelChangedEvent", "MuteChangedEvent", "DeviceType", "StreamType" ], "events": ["onDeviceListChanged", "onLevelChanged", "onMuteChanged"] }, "bluetooth": { "properties": [], "methods": [ "getAdapterState", "getDevice", "getDevices", "startDiscovery", "stopDiscovery" ], "types": [ "AdapterState", "BluetoothFilter", "Device", "DeviceType", "FilterType", "Transport", "VendorIdSource" ], "events": [ "onAdapterStateChanged", "onDeviceAdded", "onDeviceChanged", "onDeviceRemoved" ] }, "bluetoothLowEnergy": { "properties": [], "methods": [ "connect", "createCharacteristic", "createDescriptor", "createService", "disconnect", "getCharacteristic", "getCharacteristics", "getDescriptor", "getDescriptors", "getIncludedServices", "getService", "getServices", "notifyCharacteristicValueChanged", "readCharacteristicValue", "readDescriptorValue", "registerAdvertisement", "registerService", "removeService", "resetAdvertising", "sendRequestResponse", "setAdvertisingInterval", "startCharacteristicNotifications", "stopCharacteristicNotifications", "unregisterAdvertisement", "unregisterService", "writeCharacteristicValue", "writeDescriptorValue" ], "types": [ "Advertisement", "Characteristic", "ConnectProperties", "Descriptor", "Device", "ManufacturerData", "Notification", "NotificationProperties", "Request", "Response", "Service", "ServiceData", "AdvertisementType", "CharacteristicProperty", "DescriptorPermission" ], "events": [ "onCharacteristicReadRequest", "onCharacteristicValueChanged", "onCharacteristicWriteRequest", "onDescriptorReadRequest", "onDescriptorValueChanged", "onDescriptorWriteRequest", "onServiceAdded", "onServiceChanged", "onServiceRemoved" ] }, "bluetoothSocket": { "properties": [], "methods": [ "close", "connect", "create", "disconnect", "getInfo", "getSockets", "listenUsingL2cap", "listenUsingRfcomm", "send", "setPaused", "update" ], "types": [ "AcceptErrorInfo", "AcceptInfo", "CreateInfo", "ListenOptions", "ReceiveErrorInfo", "ReceiveInfo", "SocketInfo", "SocketProperties", "AcceptError", "ReceiveError" ], "events": ["onAccept", "onAcceptError", "onReceive", "onReceiveError"] }, "bookmarks": { "properties": [ "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE", "MAX_WRITE_OPERATIONS_PER_HOUR" ], "methods": [ "create", "get", "getChildren", "getRecent", "getSubTree", "getTree", "move", "remove", "removeTree", "search", "update" ], "types": [ "BookmarkTreeNode", "CreateDetails", "BookmarkTreeNodeUnmodifiable", "FolderType" ], "events": [ "onChanged", "onChildrenReordered", "onCreated", "onImportBegan", "onImportEnded", "onMoved", "onRemoved" ] }, "browser": { "properties": [], "methods": ["openTab"], "types": ["OpenTabOptions"], "events": [] }, "browserAction": { "properties": [], "methods": [ "disable", "enable", "getBadgeBackgroundColor", "getBadgeText", "getPopup", "getTitle", "setBadgeBackgroundColor", "setBadgeText", "setIcon", "setPopup", "setTitle" ], "types": ["TabDetails", "ColorArray", "ImageDataType"], "events": ["onClicked"] }, "browsingData": { "properties": [], "methods": [ "remove", "removeAppcache", "removeCache", "removeCacheStorage", "removeCookies", "removeDownloads", "removeFileSystems", "removeFormData", "removeHistory", "removeIndexedDB", "removeLocalStorage", "removePasswords", "removePluginData", "removeServiceWorkers", "removeWebSQL", "settings" ], "types": ["DataTypeSet", "RemovalOptions"], "events": [] }, "certificateProvider": { "properties": [], "methods": [ "reportSignature", "requestPin", "setCertificates", "stopPinRequest" ], "types": [ "CertificateInfo", "CertificatesUpdateRequest", "ClientCertificateInfo", "PinResponseDetails", "ReportSignatureDetails", "RequestPinDetails", "SetCertificatesDetails", "SignRequest", "SignatureRequest", "StopPinRequestDetails", "Algorithm", "Error", "Hash", "PinRequestErrorType", "PinRequestType" ], "events": [ "onCertificatesRequested", "onCertificatesUpdateRequested", "onSignDigestRequested", "onSignatureRequested" ] }, "chrome_url_overrides": { "properties": [], "methods": [], "types": ["UrlOverrideInfo"], "events": [] }, "clipboard": { "properties": [], "methods": ["setImageData"], "types": ["AdditionalDataItem", "DataItemType", "ImageType"], "events": ["onClipboardDataChanged"] }, "commands": { "properties": [], "methods": ["getAll"], "types": ["Command"], "events": ["onCommand"] }, "contentScripts": { "properties": [], "methods": [], "types": ["ContentScript"], "events": [] }, "contentSettings": { "properties": [ "autoVerify", "automaticDownloads", "camera", "clipboard", "cookies", "fullscreen", "images", "javascript", "location", "microphone", "mouselock", "notifications", "plugins", "popups", "unsandboxedPlugins" ], "methods": [], "types": [ "ContentSetting", "ResourceIdentifier", "AutoVerifyContentSetting", "CameraContentSetting", "ClipboardContentSetting", "CookiesContentSetting", "FullscreenContentSetting", "ImagesContentSetting", "JavascriptContentSetting", "LocationContentSetting", "MicrophoneContentSetting", "MouselockContentSetting", "MultipleAutomaticDownloadsContentSetting", "NotificationsContentSetting", "PluginsContentSetting", "PopupsContentSetting", "PpapiBrokerContentSetting", "Scope" ], "events": [] }, "contextMenus": { "properties": ["ACTION_MENU_TOP_LEVEL_LIMIT"], "methods": ["create", "remove", "removeAll", "update"], "types": ["CreateProperties", "OnClickData", "ContextType", "ItemType"], "events": ["onClicked"] }, "cookies": { "properties": [], "methods": [ "get", "getAll", "getAllCookieStores", "getPartitionKey", "remove", "set" ], "types": [ "Cookie", "CookieDetails", "CookiePartitionKey", "CookieStore", "FrameDetails", "OnChangedCause", "SameSiteStatus" ], "events": ["onChanged"] }, "crossOriginIsolation": { "properties": [], "methods": [], "types": ["ResponseHeader"], "events": [] }, "debugger": { "properties": [], "methods": ["attach", "detach", "getTargets", "sendCommand"], "types": [ "Debuggee", "DebuggerSession", "TargetInfo", "DetachReason", "TargetInfoType" ], "events": ["onDetach", "onEvent"] }, "declarativeContent": { "properties": [], "methods": [], "types": [ "PageStateMatcher", "RequestContentScript", "SetIcon", "ShowAction", "ShowPageAction", "ImageDataType" ], "events": ["onPageChanged"] }, "declarativeNetRequest": { "properties": [ "DYNAMIC_RULESET_ID", "GETMATCHEDRULES_QUOTA_INTERVAL", "GUARANTEED_MINIMUM_STATIC_RULES", "MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL", "MAX_NUMBER_OF_DYNAMIC_RULES", "MAX_NUMBER_OF_ENABLED_STATIC_RULESETS", "MAX_NUMBER_OF_REGEX_RULES", "MAX_NUMBER_OF_SESSION_RULES", "MAX_NUMBER_OF_STATIC_RULESETS", "MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES", "MAX_NUMBER_OF_UNSAFE_SESSION_RULES", "SESSION_RULESET_ID" ], "methods": [ "getAvailableStaticRuleCount", "getDisabledRuleIds", "getDynamicRules", "getEnabledRulesets", "getMatchedRules", "getSessionRules", "isRegexSupported", "setExtensionActionOptions", "testMatchOutcome", "updateDynamicRules", "updateEnabledRulesets", "updateSessionRules", "updateStaticRules" ], "types": [ "ExtensionActionOptions", "GetDisabledRuleIdsOptions", "GetRulesFilter", "HeaderInfo", "IsRegexSupportedResult", "MatchedRule", "MatchedRuleInfo", "MatchedRuleInfoDebug", "MatchedRulesFilter", "ModifyHeaderInfo", "QueryKeyValue", "QueryTransform", "Redirect", "RegexOptions", "RequestDetails", "Rule", "RuleAction", "RuleCondition", "RulesMatchedDetails", "Ruleset", "TabActionCountUpdate", "TestMatchOutcomeResult", "TestMatchRequestDetails", "URLTransform", "UpdateRuleOptions", "UpdateRulesetOptions", "UpdateStaticRulesOptions", "DomainType", "HeaderOperation", "RequestMethod", "ResourceType", "RuleActionType", "UnsupportedRegexReason" ], "events": ["onRuleMatchedDebug"] }, "declarativeWebRequest": { "properties": [], "methods": [], "types": [ "AddRequestCookie", "AddResponseCookie", "AddResponseHeader", "CancelRequest", "EditRequestCookie", "EditResponseCookie", "IgnoreRules", "RedirectByRegEx", "RedirectRequest", "RedirectToEmptyDocument", "RedirectToTransparentImage", "RemoveRequestCookie", "RemoveRequestHeader", "RemoveResponseCookie", "RemoveResponseHeader", "RequestMatcher", "SendMessageToExtension", "SetRequestHeader", "FilterResponseCookie", "HeaderFilter", "RequestCookie", "ResponseCookie", "Stage" ], "events": ["onMessage", "onRequest"] }, "desktopCapture": { "properties": [], "methods": ["cancelChooseDesktopMedia", "chooseDesktopMedia"], "types": [ "DesktopCaptureSourceType", "SelfCapturePreferenceEnum", "SystemAudioPreferenceEnum" ], "events": [] }, "devtools.inspectedWindow": { "properties": ["tabId"], "methods": ["eval", "getResources", "reload"], "types": ["Resource"], "events": ["onResourceAdded", "onResourceContentCommitted"] }, "devtools.network": { "properties": [], "methods": ["getHAR"], "types": ["Request"], "events": ["onNavigated", "onRequestFinished"] }, "devtools.panels": { "properties": ["elements", "sources", "themeName"], "methods": ["create", "openResource", "setOpenResourceHandler"], "types": [ "Button", "ElementsPanel", "ExtensionPanel", "ExtensionSidebarPane", "SourcesPanel" ], "events": [] }, "devtools.performance": { "properties": [], "methods": [], "types": [], "events": ["onProfilingStarted", "onProfilingStopped"] }, "devtools.recorder": { "properties": [], "methods": ["createView", "registerRecorderExtensionPlugin"], "types": ["RecorderExtensionPlugin", "RecorderView"], "events": [] }, "diagnostics": { "properties": [], "methods": ["sendPacket"], "types": ["SendPacketOptions", "SendPacketResult"], "events": [] }, "dns": { "properties": [], "methods": ["resolve"], "types": ["ResolveCallbackResolveInfo"], "events": [] }, "documentScan": { "properties": [], "methods": [ "cancelScan", "closeScanner", "getOptionGroups", "getScannerList", "openScanner", "readScanData", "scan", "setOptions", "startScan" ], "types": [ "CancelScanResponse", "CloseScannerResponse", "DeviceFilter", "GetOptionGroupsResponse", "GetScannerListResponse", "OpenScannerResponse", "OptionConstraint", "OptionGroup", "OptionSetting", "ReadScanDataResponse", "ScanOptions", "ScanResults", "ScannerInfo", "ScannerOption", "SetOptionResult", "SetOptionsResponse", "StartScanOptions", "StartScanResponse", "Configurability", "ConnectionType", "ConstraintType", "OperationResult", "OptionType", "OptionUnit" ], "events": [] }, "dom": { "properties": [], "methods": ["openOrClosedShadowRoot"], "types": [], "events": [] }, "downloads": { "properties": [], "methods": [ "acceptDanger", "cancel", "download", "erase", "getFileIcon", "open", "pause", "removeFile", "resume", "search", "setShelfEnabled", "setUiOptions", "show", "showDefaultFolder" ], "types": [ "BooleanDelta", "DoubleDelta", "DownloadDelta", "DownloadItem", "DownloadOptions", "DownloadQuery", "FilenameSuggestion", "GetFileIconOptions", "HeaderNameValuePair", "StringDelta", "UiOptions", "DangerType", "FilenameConflictAction", "HttpMethod", "InterruptReason", "State" ], "events": ["onChanged", "onCreated", "onDeterminingFilename", "onErased"] }, "enterprise.deviceAttributes": { "properties": [], "methods": [ "getDeviceAnnotatedLocation", "getDeviceAssetId", "getDeviceHostname", "getDeviceSerialNumber", "getDirectoryDeviceId" ], "types": [], "events": [] }, "enterprise.hardwarePlatform": { "properties": [], "methods": ["getHardwarePlatformInfo"], "types": ["HardwarePlatformInfo"], "events": [] }, "enterprise.kioskInput": { "properties": [], "methods": ["setCurrentInputMethod"], "types": ["SetCurrentInputMethodOptions"], "events": [] }, "enterprise.networkingAttributes": { "properties": [], "methods": ["getNetworkDetails"], "types": ["NetworkDetails"], "events": [] }, "enterprise.platformKeys": { "properties": [], "methods": [ "challengeKey", "challengeMachineKey", "challengeUserKey", "getCertificates", "getTokens", "importCertificate", "removeCertificate" ], "types": [ "ChallengeKeyOptions", "RegisterKeyOptions", "Token", "Algorithm", "Scope" ], "events": [] }, "events": { "properties": [], "methods": [], "types": ["Event", "Rule", "UrlFilter"], "events": [] }, "extension": { "properties": ["inIncognitoContext", "lastError"], "methods": [ "getBackgroundPage", "getExtensionTabs", "getURL", "getViews", "isAllowedFileSchemeAccess", "isAllowedIncognitoAccess", "sendRequest", "setUpdateUrlData" ], "types": ["ViewType"], "events": ["onRequest", "onRequestExternal"] }, "extensionTypes": { "properties": [], "methods": [], "types": [ "DeleteInjectionDetails", "ImageDetails", "InjectDetails", "CSSOrigin", "DocumentLifecycle", "ExecutionWorld", "FrameType", "ImageFormat", "RunAt" ], "events": [] }, "extensionsManifestTypes": { "properties": [], "methods": [], "types": [ "ContentCapabilities", "ExternallyConnectable", "OptionsUI", "UsbPrinters", "bluetooth", "sockets", "KioskSecondaryApps", "SocketHostPatterns", "automation" ], "events": [] }, "fileBrowserHandler": { "properties": [], "methods": [], "types": ["FileHandlerExecuteEventDetails"], "events": ["onExecute"] }, "fileHandlers": { "properties": [], "methods": [], "types": ["FileHandler", "Icon"], "events": [] }, "fileSystem": { "properties": [], "methods": [ "chooseEntry", "getDisplayPath", "getVolumeList", "getWritableEntry", "isRestorable", "isWritableEntry", "requestFileSystem", "restoreEntry", "retainEntry" ], "types": [ "AcceptOption", "ChooseEntryOptions", "RequestFileSystemOptions", "Volume", "VolumeListChangedEvent", "ChooseEntryType" ], "events": ["onVolumeListChanged"] }, "fileSystemProvider": { "properties": [], "methods": ["get", "getAll", "mount", "notify", "unmount"], "types": [ "AbortRequestedOptions", "Action", "AddWatcherRequestedOptions", "Change", "CloseFileRequestedOptions", "CloudFileInfo", "CloudIdentifier", "ConfigureRequestedOptions", "CopyEntryRequestedOptions", "CreateDirectoryRequestedOptions", "CreateFileRequestedOptions", "DeleteEntryRequestedOptions", "EntryMetadata", "ExecuteActionRequestedOptions", "FileSystemInfo", "GetActionsRequestedOptions", "GetMetadataRequestedOptions", "MountOptions", "MoveEntryRequestedOptions", "NotifyOptions", "OpenFileRequestedOptions", "OpenedFile", "ReadDirectoryRequestedOptions", "ReadFileRequestedOptions", "RemoveWatcherRequestedOptions", "TruncateRequestedOptions", "UnmountOptions", "UnmountRequestedOptions", "Watcher", "WriteFileRequestedOptions", "ChangeType", "CommonActionId", "OpenFileMode", "ProviderError" ], "events": [ "onAbortRequested", "onAddWatcherRequested", "onCloseFileRequested", "onConfigureRequested", "onCopyEntryRequested", "onCreateDirectoryRequested", "onCreateFileRequested", "onDeleteEntryRequested", "onExecuteActionRequested", "onGetActionsRequested", "onGetMetadataRequested", "onMountRequested", "onMoveEntryRequested", "onOpenFileRequested", "onReadDirectoryRequested", "onReadFileRequested", "onRemoveWatcherRequested", "onTruncateRequested", "onUnmountRequested", "onWriteFileRequested" ] }, "fontSettings": { "properties": [], "methods": [ "clearDefaultFixedFontSize", "clearDefaultFontSize", "clearFont", "clearMinimumFontSize", "getDefaultFixedFontSize", "getDefaultFontSize", "getFont", "getFontList", "getMinimumFontSize", "setDefaultFixedFontSize", "setDefaultFontSize", "setFont", "setMinimumFontSize" ], "types": ["FontName", "GenericFamily", "LevelOfControl", "ScriptCode"], "events": [ "onDefaultFixedFontSizeChanged", "onDefaultFontSizeChanged", "onFontChanged", "onMinimumFontSizeChanged" ] }, "gcm": { "properties": ["MAX_MESSAGE_SIZE"], "methods": ["register", "send", "unregister"], "types": [], "events": ["onMessage", "onMessagesDeleted", "onSendError"] }, "hid": { "properties": [], "methods": [ "connect", "disconnect", "getDevices", "receive", "receiveFeatureReport", "send", "sendFeatureReport" ], "types": [ "DeviceFilter", "GetDevicesOptions", "HidCollectionInfo", "HidConnectInfo", "HidDeviceInfo" ], "events": ["onDeviceAdded", "onDeviceRemoved"] }, "history": { "properties": [], "methods": [ "addUrl", "deleteAll", "deleteRange", "deleteUrl", "getVisits", "search" ], "types": ["HistoryItem", "UrlDetails", "VisitItem", "TransitionType"], "events": ["onVisitRemoved", "onVisited"] }, "i18n": { "properties": [], "methods": [ "detectLanguage", "getAcceptLanguages", "getMessage", "getUILanguage" ], "types": ["LanguageCode"], "events": [] }, "identity": { "properties": [], "methods": [ "clearAllCachedAuthTokens", "getAccounts", "getAuthToken", "getProfileUserInfo", "getRedirectURL", "launchWebAuthFlow", "removeCachedAuthToken" ], "types": [ "AccountInfo", "GetAuthTokenResult", "InvalidTokenDetails", "ProfileDetails", "ProfileUserInfo", "TokenDetails", "WebAuthFlowDetails", "AccountStatus" ], "events": ["onSignInChanged"] }, "idle": { "properties": [], "methods": ["getAutoLockDelay", "queryState", "setDetectionInterval"], "types": ["IdleState"], "events": ["onStateChanged"] }, "incognito": { "properties": [], "methods": [], "types": ["IncognitoMode"], "events": [] }, "input.ime": { "properties": [], "methods": [ "clearComposition", "commitText", "deleteSurroundingText", "hideInputView", "keyEventHandled", "sendKeyEvents", "setAssistiveWindowButtonHighlighted", "setAssistiveWindowProperties", "setCandidateWindowProperties", "setCandidates", "setComposition", "setCursorPosition", "setMenuItems", "updateMenuItems" ], "types": [ "AssistiveWindowProperties", "InputContext", "KeyboardEvent", "MenuItem", "MenuParameters", "AssistiveWindowButton", "AssistiveWindowType", "AutoCapitalizeType", "InputContextType", "KeyboardEventType", "MenuItemStyle", "MouseButton", "ScreenType", "UnderlineStyle", "WindowPosition" ], "events": [ "onActivate", "onAssistiveWindowButtonClicked", "onBlur", "onCandidateClicked", "onDeactivated", "onFocus", "onInputContextUpdate", "onKeyEvent", "onMenuItemActivated", "onReset", "onSurroundingTextChanged" ] }, "instanceID": { "properties": [], "methods": [ "deleteID", "deleteToken", "getCreationTime", "getID", "getToken" ], "types": [], "events": ["onTokenRefresh"] }, "loginState": { "properties": [], "methods": ["getProfileType", "getSessionState"], "types": ["ProfileType", "SessionState"], "events": ["onSessionStateChanged"] }, "management": { "properties": [], "methods": [ "createAppShortcut", "generateAppForLink", "get", "getAll", "getPermissionWarningsById", "getPermissionWarningsByManifest", "getSelf", "installReplacementWebApp", "launchApp", "setEnabled", "setLaunchType", "uninstall", "uninstallSelf" ], "types": [ "ExtensionInfo", "IconInfo", "UninstallOptions", "ExtensionDisabledReason", "ExtensionInstallType", "ExtensionType", "LaunchType" ], "events": ["onDisabled", "onEnabled", "onInstalled", "onUninstalled"] }, "manifestTypes": { "properties": [], "methods": [], "types": [ "ChromeSettingsOverrides", "FileSystemProviderCapabilities", "FileSystemProviderSource" ], "events": [] }, "mdns": { "properties": ["MAX_SERVICE_INSTANCES_PER_EVENT"], "methods": ["forceDiscovery"], "types": ["MDnsService"], "events": ["onServiceList"] }, "mediaGalleries": { "properties": [], "methods": [ "addGalleryWatch", "addUserSelectedFolder", "getMediaFileSystemMetadata", "getMediaFileSystems", "getMetadata", "removeGalleryWatch" ], "types": [ "AddGalleryWatchResult", "GalleryChangeDetails", "MediaFileSystemMetadata", "MediaFileSystemsDetails", "MediaMetadata", "MediaMetadataOptions", "StreamInfo", "GalleryChangeType", "GetMediaFileSystemsInteractivity", "GetMetadataType" ], "events": ["onGalleryChanged"] }, "networking.onc": { "properties": [], "methods": [ "createNetwork", "disableNetworkType", "enableNetworkType", "forgetNetwork", "getCaptivePortalStatus", "getDeviceStates", "getGlobalPolicy", "getManagedProperties", "getNetworks", "getProperties", "getState", "requestNetworkScan", "setProperties", "startConnect", "startDisconnect" ], "types": [ "CellularProperties", "CellularProviderProperties", "CellularStateProperties", "CertificatePattern", "DeviceStateProperties", "EAPProperties", "EthernetProperties", "EthernetStateProperties", "FoundNetworkProperties", "GlobalPolicy", "IPConfigProperties", "IssuerSubjectPattern", "ManagedBoolean", "ManagedCellularProperties", "ManagedDOMString", "ManagedDOMStringList", "ManagedEthernetProperties", "ManagedIPConfigProperties", "ManagedIPConfigType", "ManagedLong", "ManagedManualProxySettings", "ManagedProperties", "ManagedProxyLocation", "ManagedProxySettings", "ManagedProxySettingsType", "ManagedThirdPartyVPNProperties", "ManagedVPNProperties", "ManagedWiFiProperties", "ManualProxySettings", "NetworkConfigProperties", "NetworkFilter", "NetworkProperties", "NetworkStateProperties", "PaymentPortal", "ProxyLocation", "ProxySettings", "SIMLockStatus", "ThirdPartyVPNProperties", "VPNProperties", "VPNStateProperties", "WiFiProperties", "WiFiStateProperties", "WiMAXProperties", "ActivationStateType", "CaptivePortalStatus", "ClientCertificateType", "ConnectionStateType", "DeviceStateType", "IPConfigType", "NetworkType", "ProxySettingsType" ], "events": [ "onDeviceStateListChanged", "onNetworkListChanged", "onNetworksChanged", "onPortalDetectionCompleted" ] }, "notifications": { "properties": [], "methods": ["clear", "create", "getAll", "getPermissionLevel", "update"], "types": [ "NotificationBitmap", "NotificationButton", "NotificationItem", "NotificationOptions", "PermissionLevel", "TemplateType" ], "events": [ "onButtonClicked", "onClicked", "onClosed", "onPermissionLevelChanged", "onShowSettings" ] }, "oauth2": { "properties": [], "methods": [], "types": ["OAuth2Info"], "events": [] }, "offscreen": { "properties": [], "methods": ["closeDocument", "createDocument"], "types": ["CreateParameters", "Reason"], "events": [] }, "omnibox": { "properties": [], "methods": ["setDefaultSuggestion"], "types": [ "DefaultSuggestResult", "SuggestResult", "DescriptionStyleType", "OnInputEnteredDisposition" ], "events": [ "onDeleteSuggestion", "onInputCancelled", "onInputChanged", "onInputEntered", "onInputStarted" ] }, "pageAction": { "properties": [], "methods": [ "getPopup", "getTitle", "hide", "setIcon", "setPopup", "setTitle", "show" ], "types": ["TabDetails", "ImageDataType"], "events": ["onClicked"] }, "pageCapture": { "properties": [], "methods": ["saveAsMHTML"], "types": [], "events": [] }, "permissions": { "properties": [], "methods": [ "addHostAccessRequest", "contains", "getAll", "remove", "removeHostAccessRequest", "request" ], "types": ["Permissions"], "events": ["onAdded", "onRemoved"] }, "platformKeys": { "properties": [], "methods": [ "getKeyPair", "getKeyPairBySpki", "selectClientCertificates", "subtleCrypto", "verifyTLSServerCertificate" ], "types": [ "ClientCertificateRequest", "Match", "SelectDetails", "VerificationDetails", "VerificationResult", "ClientCertificateType" ], "events": [] }, "power": { "properties": [], "methods": ["releaseKeepAwake", "reportActivity", "requestKeepAwake"], "types": ["Level"], "events": [] }, "printerProvider": { "properties": [], "methods": [], "types": ["PrintJob", "PrinterInfo", "PrintError"], "events": [ "onGetCapabilityRequested", "onGetPrintersRequested", "onGetUsbPrinterInfoRequested", "onPrintRequested" ] }, "printing": { "properties": [ "MAX_GET_PRINTER_INFO_CALLS_PER_MINUTE", "MAX_SUBMIT_JOB_CALLS_PER_MINUTE" ], "methods": [ "cancelJob", "getJobStatus", "getPrinterInfo", "getPrinters", "submitJob" ], "types": [ "GetPrinterInfoResponse", "Printer", "SubmitJobRequest", "SubmitJobResponse", "JobStatus", "PrinterSource", "PrinterStatus", "SubmitJobStatus" ], "events": ["onJobStatusChanged"] }, "printingMetrics": { "properties": [], "methods": ["getPrintJobs"], "types": [ "MediaSize", "PrintJobInfo", "PrintSettings", "Printer", "ColorMode", "DuplexMode", "PrintJobSource", "PrintJobStatus", "PrinterSource" ], "events": ["onPrintJobFinished"] }, "privacy": { "properties": ["network", "services", "websites"], "methods": [], "types": ["IPHandlingPolicy"], "events": [] }, "processes": { "properties": [], "methods": ["getProcessIdForTab", "getProcessInfo", "terminate"], "types": ["Cache", "Process", "TaskInfo", "ProcessType"], "events": [ "onCreated", "onExited", "onUnresponsive", "onUpdated", "onUpdatedWithMemory" ] }, "proxy": { "properties": ["settings"], "methods": [], "types": [ "PacScript", "ProxyConfig", "ProxyRules", "ProxyServer", "Mode", "Scheme" ], "events": ["onProxyError"] }, "readingList": { "properties": [], "methods": ["addEntry", "query", "removeEntry", "updateEntry"], "types": [ "AddEntryOptions", "QueryInfo", "ReadingListEntry", "RemoveOptions", "UpdateEntryOptions" ], "events": ["onEntryAdded", "onEntryRemoved", "onEntryUpdated"] }, "runtime": { "properties": ["id", "lastError"], "methods": [ "connect", "connectNative", "getBackgroundPage", "getContexts", "getManifest", "getPackageDirectoryEntry", "getPlatformInfo", "getURL", "openOptionsPage", "reload", "requestUpdateCheck", "restart", "restartAfterDelay", "sendMessage", "sendNativeMessage", "setUninstallURL" ], "types": [ "ContextFilter", "ExtensionContext", "MessageSender", "PlatformInfo", "Port", "ContextType", "OnInstalledReason", "OnRestartRequiredReason", "PlatformArch", "PlatformNaclArch", "PlatformOs", "RequestUpdateCheckStatus" ], "events": [ "onBrowserUpdateAvailable", "onConnect", "onConnectExternal", "onConnectNative", "onInstalled", "onMessage", "onMessageExternal", "onRestartRequired", "onStartup", "onSuspend", "onSuspendCanceled", "onUpdateAvailable", "onUserScriptConnect", "onUserScriptMessage" ] }, "scripting": { "properties": [], "methods": [ "executeScript", "getRegisteredContentScripts", "insertCSS", "registerContentScripts", "removeCSS", "unregisterContentScripts", "updateContentScripts" ], "types": [ "CSSInjection", "ContentScriptFilter", "InjectionResult", "InjectionTarget", "RegisteredContentScript", "ScriptInjection", "ExecutionWorld", "StyleOrigin" ], "events": [] }, "search": { "properties": [], "methods": ["query"], "types": ["QueryInfo", "Disposition"], "events": [] }, "serial": { "properties": [], "methods": [ "clearBreak", "connect", "disconnect", "flush", "getConnections", "getControlSignals", "getDevices", "getInfo", "send", "setBreak", "setControlSignals", "setPaused", "update" ], "types": [ "ConnectionInfo", "ConnectionOptions", "DeviceControlSignals", "DeviceInfo", "HostControlSignals", "ReceiveErrorInfo", "ReceiveInfo", "SendInfo", "DataBits", "ParityBit", "ReceiveError", "SendError", "StopBits" ], "events": ["onReceive", "onReceiveError"] }, "sessions": { "properties": ["MAX_SESSION_RESULTS"], "methods": ["getDevices", "getRecentlyClosed", "restore"], "types": ["Device", "Filter", "Session"], "events": ["onChanged"] }, "sharedModule": { "properties": [], "methods": [], "types": ["Export", "Import"], "events": [] }, "sidePanel": { "properties": [], "methods": [ "getOptions", "getPanelBehavior", "open", "setOptions", "setPanelBehavior" ], "types": [ "GetPanelOptions", "OpenOptions", "PanelBehavior", "PanelOptions", "SidePanel" ], "events": [] }, "socket": { "properties": [], "methods": [ "accept", "bind", "connect", "create", "destroy", "disconnect", "getInfo", "getJoinedGroups", "getNetworkList", "joinGroup", "leaveGroup", "listen", "read", "recvFrom", "secure", "sendTo", "setKeepAlive", "setMulticastLoopbackMode", "setMulticastTimeToLive", "setNoDelay", "write" ], "types": [ "AcceptInfo", "CreateInfo", "CreateOptions", "NetworkInterface", "ReadInfo", "RecvFromInfo", "SecureOptions", "SocketInfo", "TLSVersionConstraints", "WriteInfo", "SocketType" ], "events": [] }, "sockets.tcp": { "properties": [], "methods": [ "close", "connect", "create", "disconnect", "getInfo", "getSockets", "secure", "send", "setKeepAlive", "setNoDelay", "setPaused", "update" ], "types": [ "CreateInfo", "ReceiveErrorInfo", "ReceiveInfo", "SecureOptions", "SendInfo", "SocketInfo", "SocketProperties", "TLSVersionConstraints", "DnsQueryType" ], "events": ["onReceive", "onReceiveError"] }, "sockets.tcpServer": { "properties": [], "methods": [ "close", "create", "disconnect", "getInfo", "getSockets", "listen", "setPaused", "update" ], "types": [ "AcceptErrorInfo", "AcceptInfo", "CreateInfo", "SocketInfo", "SocketProperties" ], "events": ["onAccept", "onAcceptError"] }, "sockets.udp": { "properties": [], "methods": [ "bind", "close", "create", "getInfo", "getJoinedGroups", "getSockets", "joinGroup", "leaveGroup", "send", "setBroadcast", "setMulticastLoopbackMode", "setMulticastTimeToLive", "setPaused", "update" ], "types": [ "CreateInfo", "ReceiveErrorInfo", "ReceiveInfo", "SendInfo", "SocketInfo", "SocketProperties", "DnsQueryType" ], "events": ["onReceive", "onReceiveError"] }, "storage": { "properties": ["local", "managed", "session", "sync"], "methods": [], "types": ["StorageArea", "StorageChange", "AccessLevel"], "events": ["onChanged"] }, "syncFileSystem": { "properties": [], "methods": [ "getConflictResolutionPolicy", "getFileStatus", "getFileStatuses", "getServiceStatus", "getUsageAndQuota", "requestFileSystem", "setConflictResolutionPolicy" ], "types": [ "FileInfo", "FileStatusInfo", "ServiceInfo", "StorageInfo", "ConflictResolutionPolicy", "FileStatus", "ServiceStatus", "SyncAction", "SyncDirection" ], "events": ["onFileStatusChanged", "onServiceStatusChanged"] }, "system.cpu": { "properties": [], "methods": ["getInfo"], "types": ["CpuInfo", "CpuTime", "ProcessorInfo"], "events": [] }, "system.display": { "properties": [], "methods": [ "clearTouchCalibration", "completeCustomTouchCalibration", "enableUnifiedDesktop", "getDisplayLayout", "getInfo", "overscanCalibrationAdjust", "overscanCalibrationComplete", "overscanCalibrationReset", "overscanCalibrationStart", "setDisplayLayout", "setDisplayProperties", "setMirrorMode", "showNativeTouchCalibration", "startCustomTouchCalibration" ], "types": [ "Bounds", "DisplayLayout", "DisplayMode", "DisplayProperties", "DisplayUnitInfo", "Edid", "GetInfoFlags", "Insets", "MirrorModeInfo", "Point", "TouchCalibrationPair", "TouchCalibrationPairQuad", "ActiveState", "LayoutPosition", "MirrorMode" ], "events": ["onDisplayChanged"] }, "system.memory": { "properties": [], "methods": ["getInfo"], "types": ["MemoryInfo"], "events": [] }, "system.network": { "properties": [], "methods": ["getNetworkInterfaces"], "types": ["NetworkInterface"], "events": [] }, "system.storage": { "properties": [], "methods": ["ejectDevice", "getAvailableCapacity", "getInfo"], "types": [ "StorageAvailableCapacityInfo", "StorageUnitInfo", "EjectDeviceResultCode", "StorageUnitType" ], "events": ["onAttached", "onDetached"] }, "systemLog": { "properties": [], "methods": ["add"], "types": ["MessageOptions"], "events": [] }, "tabCapture": { "properties": [], "methods": ["capture", "getCapturedTabs", "getMediaStreamId"], "types": [ "CaptureInfo", "CaptureOptions", "GetMediaStreamOptions", "MediaStreamConstraint", "TabCaptureState" ], "events": ["onStatusChanged"] }, "tabGroups": { "properties": ["TAB_GROUP_ID_NONE"], "methods": ["get", "move", "query", "update"], "types": ["TabGroup", "Color"], "events": ["onCreated", "onMoved", "onRemoved", "onUpdated"] }, "tabs": { "properties": [ "MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND", "TAB_ID_NONE", "TAB_INDEX_NONE" ], "methods": [ "captureVisibleTab", "connect", "create", "detectLanguage", "discard", "duplicate", "executeScript", "get", "getAllInWindow", "getCurrent", "getSelected", "getZoom", "getZoomSettings", "goBack", "goForward", "group", "highlight", "insertCSS", "move", "query", "reload", "remove", "removeCSS", "sendMessage", "sendRequest", "setZoom", "setZoomSettings", "ungroup", "update" ], "types": [ "MutedInfo", "Tab", "ZoomSettings", "MutedInfoReason", "TabStatus", "WindowType", "ZoomSettingsMode", "ZoomSettingsScope" ], "events": [ "onActivated", "onActiveChanged", "onAttached", "onCreated", "onDetached", "onHighlightChanged", "onHighlighted", "onMoved", "onRemoved", "onReplaced", "onSelectionChanged", "onUpdated", "onZoomChange" ] }, "topSites": { "properties": [], "methods": ["get"], "types": ["MostVisitedURL"], "events": [] }, "tts": { "properties": [], "methods": ["getVoices", "isSpeaking", "pause", "resume", "speak", "stop"], "types": ["TtsEvent", "TtsOptions", "TtsVoice", "EventType", "VoiceGender"], "events": ["onVoicesChanged"] }, "ttsEngine": { "properties": [], "methods": ["updateLanguage", "updateVoices"], "types": [ "AudioBuffer", "AudioStreamOptions", "LanguageStatus", "LanguageUninstallOptions", "SpeakOptions", "TtsClient", "LanguageInstallStatus", "TtsClientSource", "VoiceGender" ], "events": [ "onInstallLanguageRequest", "onLanguageStatusRequest", "onPause", "onResume", "onSpeak", "onSpeakWithAudioStream", "onStop", "onUninstallLanguageRequest" ] }, "types": { "properties": [], "methods": [], "types": ["ChromeSetting", "ChromeSettingScope", "LevelOfControl"], "events": [] }, "usb": { "properties": [], "methods": [ "bulkTransfer", "claimInterface", "closeDevice", "controlTransfer", "findDevices", "getConfiguration", "getConfigurations", "getDevices", "getUserSelectedDevices", "interruptTransfer", "isochronousTransfer", "listInterfaces", "openDevice", "releaseInterface", "requestAccess", "resetDevice", "setConfiguration", "setInterfaceAlternateSetting" ], "types": [ "ConfigDescriptor", "ConnectionHandle", "ControlTransferInfo", "Device", "DeviceFilter", "DevicePromptOptions", "EndpointDescriptor", "EnumerateDevicesAndRequestAccessOptions", "EnumerateDevicesOptions", "GenericTransferInfo", "InterfaceDescriptor", "IsochronousTransferInfo", "TransferResultInfo", "Direction", "Recipient", "RequestType", "SynchronizationType", "TransferType", "UsageType" ], "events": ["onDeviceAdded", "onDeviceRemoved"] }, "userScripts": { "properties": [], "methods": [ "configureWorld", "execute", "getScripts", "getWorldConfigurations", "register", "resetWorldConfiguration", "unregister", "update" ], "types": [ "InjectionResult", "InjectionTarget", "RegisteredUserScript", "ScriptSource", "UserScriptFilter", "UserScriptInjection", "WorldProperties", "ExecutionWorld" ], "events": [] }, "virtualKeyboard": { "properties": [], "methods": ["restrictFeatures"], "types": ["FeatureRestrictions"], "events": [] }, "vpnProvider": { "properties": [], "methods": [ "createConfig", "destroyConfig", "notifyConnectionStateChanged", "sendPacket", "setParameters" ], "types": ["Parameters", "PlatformMessage", "UIEvent", "VpnConnectionState"], "events": [ "onConfigCreated", "onConfigRemoved", "onPacketReceived", "onPlatformMessage", "onUIEvent" ] }, "wallpaper": { "properties": [], "methods": ["setWallpaper"], "types": ["WallpaperLayout"], "events": [] }, "webAccessibleResources": { "properties": [], "methods": [], "types": ["WebAccessibleResource"], "events": [] }, "webAuthenticationProxy": { "properties": [], "methods": [ "attach", "completeCreateRequest", "completeGetRequest", "completeIsUvpaaRequest", "detach" ], "types": [ "CreateRequest", "CreateResponseDetails", "DOMExceptionDetails", "GetRequest", "GetResponseDetails", "IsUvpaaRequest", "IsUvpaaResponseDetails" ], "events": [ "onCreateRequest", "onGetRequest", "onIsUvpaaRequest", "onRemoteSessionStateChange", "onRequestCanceled" ] }, "webNavigation": { "properties": [], "methods": ["getAllFrames", "getFrame"], "types": ["TransitionQualifier", "TransitionType"], "events": [ "onBeforeNavigate", "onCommitted", "onCompleted", "onCreatedNavigationTarget", "onDOMContentLoaded", "onErrorOccurred", "onHistoryStateUpdated", "onReferenceFragmentUpdated", "onTabReplaced" ] }, "webRequest": { "properties": ["MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES"], "methods": ["handlerBehaviorChanged"], "types": [ "BlockingResponse", "RequestFilter", "UploadData", "FormDataItem", "HttpHeaders", "IgnoredActionType", "OnAuthRequiredOptions", "OnBeforeRedirectOptions", "OnBeforeRequestOptions", "OnBeforeSendHeadersOptions", "OnCompletedOptions", "OnErrorOccurredOptions", "OnHeadersReceivedOptions", "OnResponseStartedOptions", "OnSendHeadersOptions", "ResourceType" ], "events": [ "onActionIgnored", "onAuthRequired", "onBeforeRedirect", "onBeforeRequest", "onBeforeSendHeaders", "onCompleted", "onErrorOccurred", "onHeadersReceived", "onResponseStarted", "onSendHeaders" ] }, "webviewTag": { "properties": ["contentWindow", "contextMenus", "request"], "methods": [ "addContentScripts", "back", "canGoBack", "canGoForward", "captureVisibleRegion", "clearData", "executeScript", "find", "forward", "getAudioState", "getProcessId", "getUserAgent", "getZoom", "getZoomMode", "go", "insertCSS", "isAudioMuted", "isSpatialNavigationEnabled", "isUserAgentOverridden", "loadDataWithBaseUrl", "print", "reload", "removeContentScripts", "setAudioMuted", "setSpatialNavigationEnabled", "setUserAgentOverride", "setZoom", "setZoomMode", "stop", "stopFinding", "terminate" ], "types": [ "ClearDataOptions", "ClearDataTypeSet", "ContentScriptDetails", "ContentWindow", "ContextMenuCreateProperties", "ContextMenuUpdateProperties", "ContextMenus", "DialogController", "DownloadPermissionRequest", "FileSystemPermissionRequest", "FindCallbackResults", "FindOptions", "FullscreenPermissionRequest", "GeolocationPermissionRequest", "HidPermissionRequest", "InjectDetails", "InjectionItems", "LoadPluginPermissionRequest", "MediaPermissionRequest", "NewWindow", "PointerLockPermissionRequest", "SelectionRect", "WebRequestEventInterface", "ContextType", "ZoomMode" ], "events": [ "close", "consolemessage", "contentload", "dialog", "exit", "findupdate", "loadabort", "loadcommit", "loadredirect", "loadstart", "loadstop", "newwindow", "permissionrequest", "responsive", "sizechanged", "unresponsive", "zoomchange" ] }, "windows": { "properties": ["WINDOW_ID_CURRENT", "WINDOW_ID_NONE"], "methods": [ "create", "get", "getAll", "getCurrent", "getLastFocused", "remove", "update" ], "types": [ "QueryOptions", "Window", "CreateType", "WindowState", "WindowType" ], "events": ["onBoundsChanged", "onCreated", "onFocusChanged", "onRemoved"] } } ================================================ FILE: .repo/sample-list-generator/package.json ================================================ { "name": "sample-list-generator", "version": "1.0.0", "scripts": { "start": "ts-node src/index.ts", "prepare-chrome-types": "ts-node src/prepare-chrome-types.ts", "test": "mocha --require ts-node/register test/**/*.test.ts" }, "devDependencies": { "@types/babel__core": "7.20.1", "@types/mocha": "10.0.1", "@types/node-fetch": "2.6.4", "@types/sinon": "10.0.15", "mocha": "10.2.0", "sinon": "15.2.0", "ts-node": "10.9.1", "typescript": "5.1.3" }, "dependencies": { "@babel/core": "7.22.5", "node-fetch": "2.6.11", "typedoc": "0.24.8" } } ================================================ FILE: .repo/sample-list-generator/src/constants.ts ================================================ export type FolderTypes = "API_SAMPLE" | "FUNCTIONAL_SAMPLE"; // Define all available folders for samples export const AVAILABLE_FOLDERS: { path: string, type: FolderTypes }[] = [ { path: 'api-samples', type: 'API_SAMPLE' }, { path: 'functional-samples', type: 'FUNCTIONAL_SAMPLE' } ]; export const REPO_BASE_URL = 'https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/'; ================================================ FILE: .repo/sample-list-generator/src/index.ts ================================================ import path from 'path'; import fs from 'fs/promises'; import { getAllSamples } from './libs/sample-collector'; const start = async () => { const samples = await getAllSamples(); // write to extension-samples.json await fs.writeFile( path.join(__dirname, '../extension-samples.json'), JSON.stringify(samples, null, 2) ); }; start(); ================================================ FILE: .repo/sample-list-generator/src/libs/api-detector.ts ================================================ import { ApiItem, ApiItemWithType, ApiTypeResult, ExtensionApiMap } from '../types'; import * as babel from '@babel/core'; import { isIdentifier } from '@babel/types'; import fs from 'fs/promises'; import { getAllJsFiles } from '../utils/filesystem'; import { loadExtensionApis } from './api-loader'; let EXTENSION_API_MAP: ExtensionApiMap = loadExtensionApis(); /** * Gets the type of an api call. * @param namespace - The namespace of the api call. * @param propertyName - The property name of the api call. * @returns The type of the api call. * @example * getApiType('tabs', 'query') * // returns 'method' */ export const getApiType = ( namespace: string, propertyName: string ): ApiTypeResult => { namespace = namespace.replace(/_/g, '.'); const apiTypes = EXTENSION_API_MAP[namespace]; if (apiTypes) { if (apiTypes.methods.includes(propertyName)) { return 'method'; } if (apiTypes.events.includes(propertyName)) { return 'event'; } if (apiTypes.properties.includes(propertyName)) { return 'property'; } if (apiTypes.types.includes(propertyName)) { return 'type'; } } return 'unknown'; }; /** * Gets all the api calls in a sample. * @param sampleFolderPath - The path to the sample folder. * @returns A promise that resolves to an array of apis the sample uses. */ export const getApiListForSample = async ( sampleFolderPath: string ): Promise => { // get all js files in the folder const jsFiles = await getAllJsFiles(sampleFolderPath); const calls: ApiItemWithType[] = []; await Promise.all( jsFiles.map(async (file) => { const callsFromFile = await extractApiCalls((await fs.readFile(file)).toString('utf-8')); calls.push(...callsFromFile); }) ); return uniqueItems(calls); }; /** * Gets the complete API call for the member expression. * @param path - The path to the MemberExpression node. * @returns The full member expression. * @example * getFullMemberExpression(path.node) * // returns ['chrome', 'tabs', 'query'] */ export function getFullMemberExpression( path: babel.NodePath ): string[] { const result: string[] = []; // Include the chrome. or browser. identifier if (isIdentifier(path.node.object)) { result.push(path.node.object.name); } else { // We don't support expressions return result; } while (path) { if (isIdentifier(path.node.property)) { result.push(path.node.property.name); } else { // We don't support expressions break; } const parentPath = path.parentPath; if (!parentPath || !parentPath.isMemberExpression()) { break; } else { path = parentPath; } } return result; } /** * Gets the namespace and property name of an api call. * @param parts - The parts of the api call. * @returns The namespace and property name of the api call. * @example * getApiItem(['chrome', 'tabs', 'query']) * // returns { namespace: 'tabs', propertyName: 'query' } * getApiItem(['chrome', 'devtools', 'inspectedWindow', 'eval']) * // returns { namespace: 'devtools.inspectedWindow', propertyName: 'eval' } */ export function getApiItem(parts: string[]): ApiItem { let namespace = ''; let propertyName = ''; // For some apis like `chrome.devtools.inspectedWindow.eval`, // the namespace is actually `devtools.inspectedWindow`. // So we need to check if the first two parts combined is a valid namespace. if (EXTENSION_API_MAP[`${parts[0]}.${parts[1]}`]) { namespace = `${parts[0]}.${parts[1]}`; propertyName = parts[2]; } else { namespace = parts[0]; propertyName = parts[1]; } return { namespace, propertyName }; } /** * Filters an array of ApiItemWithType to remove duplicates. * @param array - The array of ApiItemWithType to filter. */ function uniqueItems(array: ApiItemWithType[]) { const tmp = new Set(); return array.filter((item) => { const fullApiString = `${item.namespace}.${item.propertyName}`; return !tmp.has(fullApiString) && tmp.add(fullApiString); }); } /** * Extracts all chrome and browser api calls from a file. * @param script - The script string to extract api calls from. * @returns A promise that resolves to an array of ApiItemWithType. * @example * extractApiCalls('chrome.tabs.query({})') * // returns [{ type: 'method', namespace: 'tabs', propertyName: 'query' }] */ export const extractApiCalls = (script: string): Promise => { return new Promise((resolve, reject) => { const calls: ApiItemWithType[] = []; babel.parse( script, { ast: true, compact: false }, (err, result) => { if (err || !result) { reject(err); return; } babel.traverse(result, { MemberExpression(path) { const parts = getFullMemberExpression(path); // not a chrome or browser api if (!['chrome', 'browser'].includes(parts.shift() || '')) { return; } const { namespace, propertyName } = getApiItem(parts); let type = getApiType(namespace, propertyName); // api not found if (type === 'unknown') { console.warn('api not found', namespace, propertyName); return; } calls.push({ type, namespace, propertyName }); } }); resolve(calls); } ); }); }; ================================================ FILE: .repo/sample-list-generator/src/libs/api-loader.ts ================================================ import path from 'path'; import fs from 'fs'; import type { ExtensionApiMap } from '../types'; import { isFileExistsSync } from '../utils/filesystem'; export const loadExtensionApis = (): ExtensionApiMap => { const filePath = path.join(__dirname, '../../extension-apis.json'); // check if extension-apis.json exists if (!isFileExistsSync(filePath)) { console.error( 'extension-apis.json does not exist. Please run "npm run prepare-chrome-types" first.' ); process.exit(1); } let data = fs.readFileSync(filePath, 'utf8'); const apiMap = JSON.parse(data); // Due to the specific implementation of this API, we need to manually add it // to the list of APIs recognised by the sample list generator. apiMap['aiOriginTrial.languageModel'] = { properties: [], methods: ['create', 'capabilities', 'params', 'availability'], types: [], events: [] }; return apiMap; }; ================================================ FILE: .repo/sample-list-generator/src/libs/sample-collector.ts ================================================ import path from 'path'; import fs from 'fs/promises'; import { AVAILABLE_FOLDERS, REPO_BASE_URL } from '../constants'; import { getApiListForSample } from './api-detector'; import type { AvailableFolderItem, SampleItem } from '../types'; import { getBasePath, isDirectory, isFileExists } from '../utils/filesystem'; import { getManifest } from '../utils/manifest'; export const getAllSamples = async () => { let samples: SampleItem[] = []; // loop through all available folders // e.g. api-samples, functional-samples for (let samplesFolder of AVAILABLE_FOLDERS) { const currentSamples = await getSamples( samplesFolder.path, samplesFolder.type ); samples.push(...currentSamples); } return samples; }; const getSamples = async ( currentRootFolderPath: string, sampleType: AvailableFolderItem['type'] ): Promise => { const samples: SampleItem[] = []; const basePath = getBasePath(); // get all contents in the folder const contents = await fs.readdir(path.join(basePath, currentRootFolderPath)); for (let content of contents) { const currentPath = path.join(basePath, currentRootFolderPath, content); // if content is not a folder, skip if (!(await isDirectory(currentPath))) { continue; } const manifestPath = path.join(currentPath, 'manifest.json'); // check if manifest.json exists const manifestExists = await isFileExists(manifestPath); if (manifestExists) { // get manifest metadata const manifestData = await getManifest(manifestPath); // add to samples samples.push({ type: sampleType, name: content, repo_link: new URL( `${REPO_BASE_URL}${currentPath.replace(basePath, '')}` ).toString(), apis: await getApiListForSample(currentPath), title: manifestData.name || content, description: manifestData.description || '', permissions: manifestData.permissions || [] }); } else { // if manifest.json does not exist, loop through all folders in current folder const currentSamples = await getSamples( path.join(currentRootFolderPath, content), sampleType ); samples.push(...currentSamples); } } return samples; }; ================================================ FILE: .repo/sample-list-generator/src/prepare-chrome-types.ts ================================================ import fetch from 'node-fetch'; import path from 'path'; import fs from 'fs/promises'; import { ExtensionApiMap } from './types'; import { ReflectionKind } from 'typedoc'; // Bucket used to store processed types data const STORAGE_BUCKET = process.env.STORAGE_BUCKET; // Fetch the latest version of the chrome types from storage const fetchChromeTypes = async (): Promise> => { if (!STORAGE_BUCKET) { throw new Error('The STORAGE_BUCKET environment variable must be set.'); } console.log('Fetching chrome types...'); const response = await fetch( `https://storage.googleapis.com/download/storage/v1/b/${STORAGE_BUCKET}/o/chrome-types.json?alt=media` ); const chromeTypes = await response.json(); return chromeTypes; }; const run = async () => { const result: ExtensionApiMap = {}; const chromeTypes = await fetchChromeTypes(); for (const [chromeApiKey, chromeApiDetails] of Object.entries(chromeTypes)) { const apiDetails: ExtensionApiMap[string] = { properties: [], methods: [], types: [], events: [] }; for (let property of chromeApiDetails._type.properties) { const name = property.name as string; // check property type let propertyType = 'types'; if (property.kind & ReflectionKind.VariableOrProperty) { propertyType = 'properties'; } if ( property.type?.type === 'reference' && ['CustomChromeEvent', 'events.Event', 'Event'].includes( property.type.name ) ) { propertyType = 'events'; } if (property.signatures) { propertyType = 'methods'; } apiDetails[propertyType].push(name); } result[chromeApiKey] = apiDetails; } console.log('Writing to file...'); await fs.writeFile( path.join(__dirname, '../extension-apis.json'), JSON.stringify( { _comment: 'This file is autogenerated by running `npm run prepare-chrome-types`, do not edit.', ...result }, null, 2 ) ); console.log('Done!'); }; run(); ================================================ FILE: .repo/sample-list-generator/src/types.ts ================================================ import type { FolderTypes } from './constants'; export interface ApiItem { namespace: string; propertyName: string; } export interface ApiItemWithType extends ApiItem { type: ApiTypeResult; } export interface ManifestData { [key: string]: string; name: string; description: string; permissions: string[]; } export interface LocaleData { [key: string]: { message: string; description: string; }; } export type SampleItem = { type: FolderTypes; name: string; repo_link: string; apis: ApiItem[]; title: string; description: string; permissions: string[]; }; export interface AvailableFolderItem { path: string; type: FolderTypes; } export type ApiTypeResult = | 'event' | 'method' | 'property' | 'type' | 'unknown'; export type ExtensionApiMap = Record> ================================================ FILE: .repo/sample-list-generator/src/utils/filesystem.ts ================================================ import fs from 'fs/promises'; import { accessSync } from 'fs'; import path from 'path'; export const getAllFiles = async (dir: string): Promise => { const result: string[] = []; for (const file of await fs.readdir(dir)) { const filePath = path.join(dir, file); const stats = await fs.stat(filePath); if (stats.isFile()) { result.push(filePath); } else if (stats.isDirectory()) { if (file === "node_modules") continue; result.push(...(await getAllFiles(filePath))); } } return result; }; export const getAllJsFiles = async (dir: string): Promise => { const allFiles = await getAllFiles(dir); return allFiles.filter((file) => file.endsWith('.js') ); } export const isDirectory = async (path: string): Promise => { return (await fs.stat(path)).isDirectory() } export const isFileExists = async (filePath: string): Promise => { try { await fs.access(filePath); return true; } catch { return false; } }; export const isFileExistsSync = (filePath: string): boolean => { try { accessSync(filePath); return true; } catch { return false; } }; export const getBasePath = (): string => { return path.join(__dirname, '../../../../'); }; ================================================ FILE: .repo/sample-list-generator/src/utils/manifest.ts ================================================ import fs from 'fs/promises'; import { dirname } from 'path'; import { ManifestData, LocaleData } from '../types'; const localeRegex = /__MSG_([^_]*)__/ function usesLocaleFiles(obj: object): boolean { // recursively check if any value in a supplied object // is a string that starts with __MSG_. If found, it // means that the extension uses locale files. return Object.values(obj).some((value) => { if (Object.prototype.toString.call(value) === '[object Object]') { return usesLocaleFiles(value); } return typeof value === 'string' && value.startsWith('__MSG_') }); } export const getManifest = async ( manifestPath: string ): Promise => { const manifest = await fs.readFile(manifestPath, 'utf8'); const parsedManifest = JSON.parse(manifest); if (usesLocaleFiles(parsedManifest)) { const directory = dirname(manifestPath); const localeFile: string = await fs.readFile(`${directory}/_locales/en/messages.json`, 'utf8') const localeData: LocaleData = JSON.parse(localeFile); for (const [key, value] of Object.entries(parsedManifest)) { if (typeof value === 'string' && value.startsWith('__MSG_')) { const localeKey: string | undefined = value.match(localeRegex)?.[1]; if (localeKey) { const localeKeyData = localeData[localeKey] const localeMessage: string = localeKeyData?.message; parsedManifest[key] = localeMessage; } } } } return parsedManifest; }; ================================================ FILE: .repo/sample-list-generator/test/api-detector/api-detector.test.ts ================================================ import { describe, it, beforeEach } from 'mocha'; import assert from 'assert'; import sinon from 'sinon'; import { getApiType, extractApiCalls, getApiItem } from '../../src/libs/api-detector'; describe('API Detector', function () { beforeEach(function () { sinon.reset(); }); describe('extractApiCalls()', function () { it('should return correct api list for sample file (normal)', async function () { const file = ` let a = 1; let b = chrome.action.getBadgeText(); let c = chrome.action.setBadgeText(a); chrome.action.onClicked.addListener(function (tab) { console.log('clicked'); }); alert(chrome.contextMenus.ACTION_MENU_TOP_LEVEL_LIMIT) `; const result = await extractApiCalls(file); assert.deepEqual(result, [ { namespace: 'action', propertyName: 'getBadgeText', type: 'method' }, { namespace: 'action', propertyName: 'setBadgeText', type: 'method' }, { namespace: 'action', propertyName: 'onClicked', type: 'event' }, { namespace: 'contextMenus', propertyName: 'ACTION_MENU_TOP_LEVEL_LIMIT', type: 'property' } ]); }); it('should return correct api list for sample file (storage)', async function () { const file = ` let b = await chrome.storage.local.get(); let c = await chrome.storage.sync.get(); let d = await chrome.storage.managed.get(); let e = await chrome.storage.session.get(); let f = await chrome.storage.onChanged.addListener(); `; const result = await extractApiCalls(file); assert.deepEqual(result, [ { namespace: 'storage', propertyName: 'local', type: 'property' }, { namespace: 'storage', propertyName: 'sync', type: 'property' }, { namespace: 'storage', propertyName: 'managed', type: 'property' }, { namespace: 'storage', propertyName: 'session', type: 'property' }, { namespace: 'storage', propertyName: 'onChanged', type: 'event' } ]); }); it('should return correct api list for sample file (async)', async function () { const file = ` let a = 1; let b = await chrome.action.getBadgeText(); await chrome.action.setBadgeText(a); `; const result = await extractApiCalls(file); assert.deepEqual(result, [ { namespace: 'action', propertyName: 'getBadgeText', type: 'method' }, { namespace: 'action', propertyName: 'setBadgeText', type: 'method' } ]); }); it('should return correct api list for sample file (special case)', async function () { const file = ` let a = 1; let b = await chrome.system.cpu.getInfo(); chrome.devtools.network.onRequestFinished.addListener( function(request) { if (request.response.bodySize > 40*1024) { chrome.devtools.inspectedWindow.eval( 'console.log("Large image: " + unescape("' + escape(request.request.url) + '"))'); } } ); `; const result = await extractApiCalls(file); assert.deepEqual(result, [ { namespace: 'system.cpu', propertyName: 'getInfo', type: 'method' }, { namespace: 'devtools.network', propertyName: 'onRequestFinished', type: 'event' }, { namespace: 'devtools.inspectedWindow', propertyName: 'eval', type: 'method' } ]); }); }); describe('getApiType()', function () { it('should return correct type of api in normal case', function () { let apiType = getApiType('action', 'getBadgeText'); assert.equal(apiType, 'method'); }); it('should return correct type of api in special case', function () { let apiType = getApiType('devtools.network', 'onNavigated'); assert.equal(apiType, 'event'); }); it('should return unknown when api not found', function () { let apiType = getApiType('action', '123'); assert.equal(apiType, 'unknown'); }); }); describe('getApiItem()', function () { it('should return correct api item', function () { let apiItem = getApiItem(['action', 'getBadgeText']); assert.deepEqual(apiItem, { namespace: 'action', propertyName: 'getBadgeText' }); }); it('should return correct api item (storage)', function () { let apiItem = getApiItem(['storage', 'sync', 'get']); assert.deepEqual(apiItem, { namespace: 'storage', propertyName: 'sync' }); apiItem = getApiItem(['storage', 'sync', 'onChanged']); assert.deepEqual(apiItem, { namespace: 'storage', propertyName: 'sync' }); apiItem = getApiItem(['storage', 'onChanged']); assert.deepEqual(apiItem, { namespace: 'storage', propertyName: 'onChanged' }); }); it('should return correct api item (special case)', function () { let apiItem = getApiItem([ 'devtools', 'network', 'onRequestFinished', 'addListener' ]); assert.deepEqual(apiItem, { namespace: 'devtools.network', propertyName: 'onRequestFinished' }); }); }); }); ================================================ FILE: CONTRIBUTING.md ================================================ # How to Contribute We'd love to accept your patches and contributions to this project. ## Before you begin ### Sign our Contributor License Agreement Contributions to this project must be accompanied by a [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again. Visit to see your current agreements or to sign a new one. ### Review our Community Guidelines This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). ## Contribution process ### Create an issue first Before adding a new sample, [create an issue first](https://github.com/GoogleChrome/chrome-extensions-samples/issues/new). Describe why this sample is needed and how you plan to implement it. Only once you've got the approval from one of the maintainers start working on a PR. Non trivial PRs without an approved issue will be rejected. ### Code Reviews All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests. ### Setting up your Environment If you want to contribute to this repository, you need to first [create your own fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo). After forking chrome-extensions-samples to your own Github account, run the following steps to get started: ```sh # clone your fork to your local machine git clone https://github.com/your-fork/chrome-extensions-samples.git cd chrome-extensions-samples # install dependencies npm install ``` ### Writing a README All new code samples or samples updated from Manifest V2 should include a README file. Please copy the [provided template](./README-template.md) into your sample's folder and follow the instructions therein. ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README-template.md ================================================ _To create a README for your sample_ 1. _Copy this file to your sample folder._ 1. _Enter the requested information below._ 1. _Delete these instructions._ _For API samples use the name of the API. For example, a sample about the `chrome.declarativeNetRequest` would simply be called "chrome.declarativeNetRequest". (Do not use special formatting in headings.) For functional samples, the title should be what the sample demonstrates_ # Title _Describe what the sample demonstrates. If this is an API sample, link to the API._ This sample demonstrates ... ## Overview _Describe how the sample demonstrates the API or use case and briefly describe how to use it._ ## Implementation Notes _Add any information that doesn't fit elsewhere in the README._ ## Running this extension 1. Clone this repository. 2. Load this directory in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked). 3. _Add the rest of the instructions here_ ================================================ FILE: README.md ================================================ # Chrome Extensions samples Official samples for Chrome Extensions and the Chrome Apps platform. (Chrome Apps are deprecated. Learn more [on the Chromium blog](https://blog.chromium.org/2020/08/changes-to-chrome-app-support-timeline.html)). For more information on extensions, see [Chrome Developers](https://developer.chrome.com). ## Explore samples The directory structure is as follows: - [api-samples/](api-samples/) - extensions focused on a single API package - [functional-samples/](functional-samples/) - full featured extensions spanning multiple API packages - [\_archive/apps/](_archive/apps/) - deprecated Chrome Apps platform (not listed below) - [\_archive/mv2/](_archive/mv2/) - resources for manifest version 2 You can also use the [Samples](https://developer.chrome.com/docs/extensions/samples/) page to discover extensions by type, permissions, and extension API. ## Installation To experiment with these samples, please clone this repo and use 'Load Unpacked Extension'. Read more on [Development Basics](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked). ## Contributing Please see [the CONTRIBUTING file](/CONTRIBUTING.md) for information on contributing to the `chrome-extensions-samples` project. ## License `chrome-extensions-samples` are authored by Google and are licensed under the [Apache License, Version 2.0](/LICENSE). ================================================ FILE: _archive/apps/README.md ================================================ # Chrome Apps samples Official samples for deprecated Chrome Apps platform. If you want to learn about the platform, you can: 1. look at the source code of the samples below. Most samples have a "Try it now" button that allows you to install and play with it. 2. read the [official docs](http://developer.chrome.com/apps) If you have questions, [search](http://stackoverflow.com/questions/tagged/google-chrome-app) or [ask at StackOverflow](http://stackoverflow.com/questions/ask?tags=google-chrome-app) (observe the google-chrome-app tag) or join the [Chromium Apps](https://groups.google.com/a/chromium.org/forum/?fromgroups#!forum/chromium-apps) Google group. # Samples Sample | API or feature | Link --- | --- |:---: analytics | storage
    ios
    android
    | Try it now appengine-channelapi/app | webview
    | Try it now appsquare | geolocation
    identity
    storage
    | Try it now appview/embedded-app | getUserMedia
    | Try it now appview/host-app | appview
    | Try it now blink1 | hid
    usb
    | Try it now bluetooth-samples/battery-service-demo | bluetooth
    | Try it now bluetooth-samples/device-info-demo | bluetooth
    | Try it now bluetooth-samples/heart-rate-sensor | bluetooth
    | Try it now calculator | clipboard
    ios
    android
    | Try it now camera-capture | getUserMedia
    | Try it now clock | framelessWindows
    geolocation
    richNotifications
    storage
    | Try it now context-menu | contextMenu
    | Try it now dart | dart
    ios
    | Try it now desktop-capture | desktopCapture
    | Try it now dialog-element | | Try it now diff | clipboard
    fileSystem
    storage
    | Try it now filesystem-access | fileSystem
    storage
    | Try it now frameless-window | framelessWindows
    | Try it now gcm-notifications | gcm
    richNotifications
    storage
    | Try it now gdrive | framelessWindows
    identity
    | Try it now github-auth | identity
    | Try it now hello-world | ios
    android
    | Try it now hello-world-sync | storage
    ios
    android
    | Try it now hid | hid
    | Try it now identity | identity
    android
    | Try it now image-edit | fileSystem
    storage
    | Try it now instagram-auth | identity
    | Try it now io2012-presentation | framelessWindows
    getUserMedia
    serial
    storage
    webview
    | - io2012-presentation/helloworld | | - io2012-presentation/servo | getUserMedia
    serial
    | - ioio | bluetooth
    | Try it now keyboard-handler | | Try it now managed-in-app-payments | in-app-payments
    | - manga-cam | framelessWindows
    getUserMedia
    syncFileSystem
    | Try it now mdns-browser | framelessWindows
    sockets
    systemInfo
    | Try it now media-gallery | mediaGallery
    | Try it now messaging/app1 | messaging
    | Try it now messaging/app2 | messaging
    | Try it now messaging/extension | messaging
    richNotifications
    | Try it now mini-code-edit | commands
    contextMenu
    fileSystem
    | Try it now multicast | framelessWindows
    messaging
    sockets
    storage
    | Try it now one-time-payment | identity
    storage
    | Try it now optional-permissions | optionalPermissions
    | Try it now parrot-ar-drone | old_sockets
    sockets
    android
    | Try it now platform-title | framelessWindows
    | Try it now printing | print
    storage
    systemInfo
    | Try it now restarted-demo | storage
    ios
    | Try it now rich-notifications | richNotifications
    android
    | Try it now sandbox | sandbox
    | Try it now sandboxed-content | sandbox
    | Try it now serial-control-signals | serial
    | Try it now serial/adkjs/app | serial
    | Try it now serial/espruino | serial
    | Try it now serial/ledtoggle | serial
    | Try it now servo | getUserMedia
    serial
    | Try it now storage | | Try it now syncfs-editor | syncFileSystem
    | Try it now systemInfo | systemInfo
    | Try it now tasks | identity
    android
    | Try it now tcpserver | sockets
    systemInfo
    webview
    | Try it now telnet | sockets
    | Try it now text-editor | clipboard
    fileSystem
    | Try it now todomvc | alarms
    fileSystem
    richNotifications
    storage
    syncFileSystem
    android
    | - tts | tts
    | - udp | sockets
    ios
    | Try it now url-handler | storage
    webview
    | - usb-label-printer | fileSystem
    getUserMedia
    optionalPermissions
    usb
    | Try it now usb/device-info | usb
    | Try it now usb/knob | optionalPermissions
    usb
    | Try it now weather | geolocation
    storage
    ios
    | Try it now web-store | fileSystem
    identity
    storage
    webstore
    | Try it now webgl-pointer-lock | framelessWindows
    pointerLock
    | Try it now webserver | sockets
    systemInfo
    android
    | Try it now websocket-server | sockets
    ios
    | Try it now webview-samples/browser | webview
    | Try it now webview-samples/declarative-web-request | storage
    webview
    | Try it now webview-samples/insert-css | storage
    webview
    | Try it now webview-samples/local-resources | webview
    | Try it now webview-samples/multi-tab-browser | contextMenu
    webview
    | - webview-samples/new-window | webview
    | Try it now webview-samples/new-window-user-agent | contextMenu
    webview
    | - webview-samples/shared-script | webview
    | Try it now webview-samples/user-agent | webview
    | Try it now webview-samples/webview | geolocation
    getUserMedia
    pointerLock
    webview
    | Try it now window-options | fullscreen
    | Try it now window-state | fullscreen
    | Try it now windows | framelessWindows
    | Try it now # Samples by features API or feature | Samples --- | --- alarms | todomvc appview | appview_host-app bluetooth | bluetooth-samples_battery-service-demo bluetooth-samples_device-info-demo bluetooth-samples_heart-rate-sensor ioio clipboard | calculator diff text-editor commands | mini-code-edit contextMenu | context-menu mini-code-edit webview-samples_multi-tab-browser webview-samples_new-window-user-agent dart | dart desktopCapture | desktop-capture fileSystem | diff filesystem-access image-edit mini-code-edit text-editor todomvc usb-label-printer web-store framelessWindows | clock frameless-window gdrive io2012-presentation manga-cam mdns-browser multicast platform-title webgl-pointer-lock windows fullscreen | window-options window-state gcm | gcm-notifications geolocation | appsquare clock weather webview-samples_webview getUserMedia | appview_embedded-app camera-capture io2012-presentation io2012-presentation_servo manga-cam servo usb-label-printer webview-samples_webview hid | blink1 hid identity | appsquare gdrive github-auth identity instagram-auth one-time-payment tasks web-store in-app-payments | managed-in-app-payments mediaGallery | media-gallery messaging | messaging_app1 messaging_app2 messaging_extension multicast old_sockets | parrot-ar-drone optionalPermissions | optional-permissions usb-label-printer usb_knob pointerLock | webgl-pointer-lock webview-samples_webview print | printing richNotifications | clock gcm-notifications messaging_extension rich-notifications todomvc sandbox | sandbox sandboxed-content serial | io2012-presentation io2012-presentation_servo serial-control-signals serial_adkjs_app serial_espruino serial_ledtoggle servo sockets | mdns-browser multicast parrot-ar-drone tcpserver telnet udp webserver websocket-server storage | analytics appsquare clock diff filesystem-access gcm-notifications hello-world-sync image-edit io2012-presentation multicast one-time-payment printing restarted-demo todomvc url-handler weather web-store webview-samples_declarative-web-request webview-samples_insert-css syncFileSystem | manga-cam syncfs-editor todomvc systemInfo | mdns-browser printing systemInfo tcpserver webserver tts | tts usb | blink1 usb-label-printer usb_device-info usb_knob webstore | web-store webview | appengine-channelapi_app io2012-presentation tcpserver url-handler webview-samples_browser webview-samples_declarative-web-request webview-samples_insert-css webview-samples_local-resources webview-samples_multi-tab-browser webview-samples_new-window webview-samples_new-window-user-agent webview-samples_shared-script webview-samples_user-agent webview-samples_webview # Mobile support You can generate native mobile versions of the samples below using the procedure described here.
    SampleAndroid supportiOS support
    analyticsSupported.Supported.
    calculatorSupported. Visual issues caused by fixed-size layoutSupported. Visual issues caused by fixed-size layout
    dartSupported. Visual issues caused by fixed-size layout
    hello-worldSupported.Supported.
    hello-world-syncSupported. sync storage doesn't actually sync - works localSupported. sync storage doesn't actually sync - works local
    identitySupported. You need to add an Android OAuth app in the Cloud API console of the OAuth project. The app's SHA1 can be the debug one (see more here), and the package name is org.chromium.identity.MyApp. If you don't add the Android OAuth app and tries to use the OAuth client-id from the Chrome app, you will get a generic message GoogleAuthException
    parrot-ar-droneSupported. Communication to the Drone works, but the UI requires a connected gamepad.
    restarted-demoSupported. Restart must be done via Safari remote debugging.
    rich-notificationsSupported.
    tasksSupported.
    todomvcSupported.
    udpSupported.
    weatherSupported.
    webserverSupported. Directory picking doesn't work on some versions of Android
    websocket-serverSupported.
    # Libraries and tools * [Google APIs client library for Chrome Apps](https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/_archive/apps/libraries/gapi-chrome-apps-lib) * [Google Analytics for Chrome Apps and Extensions](https://github.com/GoogleChrome/chrome-platform-analytics) ================================================ FILE: _archive/apps/libraries/gapi-chrome-apps-lib/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: _archive/apps/libraries/gapi-chrome-apps-lib/README.md ================================================ # Google API javascript client library loader for Chrome Packaged Apps Provides the Google API javascript client 'gapi' as appropriate for hosted websites, or if in a Chrome packaged app implement a minimal set of functionality that is Content Security Policy compliant and uses the chrome identity api. ## Status This library is likely not suitable for use without additional modifications. ## Usage To be expanded upon, but essentially: - Add 'identity' permission to manifest. - Reference this script instead of the apis.google.com online version. - Call gapi methods as usual. ## Examples: * [Tasks app using GAPI](https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/_archive/apps/samples/tasks) ## Resources * [JavaScript Client Library Reference](https://developers.google.com/api-client-library/javascript/reference/referencedocs) ================================================ FILE: _archive/apps/libraries/gapi-chrome-apps-lib/gapi-chrome-apps.js ================================================ /** * Copyright 2013 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * gapi-chrome-apps version 0.001 * * Provides the Google API javascript client 'gapi' as * appropriate for hosted websites, or if in a Chrome packaged * app implement a minimal set of functionality that is Content * Security Policy compliant and uses the chrome identity api. * * https://github.com/GoogleChrome/chrome-app-samples/tree/master/gapi-chrome-apps-lib * */ "use strict"; (function () { if (typeof gapi !== 'undefined') throw new Error('gapi already defined.'); if (typeof gapiIsLoaded !== 'function') throw new Error('gapiIsLoaded callback function must be defined prior to ' + 'loading gapi-chrome-apps.js'); // If not running in a chrome packaged app, load web gapi: if (!(chrome && chrome.app && chrome.app.runtime)) { // Load web gapi. var script = document.createElement('script'); script.src = 'https://apis.google.com/js/client.js?onload=gapiIsLoaded'; document.documentElement.appendChild(script); return; } window.gapi = {}; window.gapi.auth = {}; window.gapi.client = {}; var access_token = undefined; gapi.auth.authorize = function (params, callback) { if (typeof callback !== 'function') throw new Error('callback required'); var details = {}; details.interactive = params.immediate === false || false; if (params.accountHint) { // Specifying this prevents the account chooser from appearing on Android. details.accountHint = params.accountHint; } console.assert(!params.response_type || params.response_type == 'token'); var callbackWrapper = function (getAuthTokenCallbackParam) { access_token = getAuthTokenCallbackParam; // TODO: error conditions? if (typeof access_token !== 'undefined') callback({ access_token: access_token}); else callback(); } chrome.identity.getAuthToken(details, callbackWrapper); }; gapi.client.request = function (args) { if (typeof args !== 'object') throw new Error('args required'); if (typeof args.callback !== 'function') throw new Error('callback required'); if (typeof args.path !== 'string') throw new Error('path required'); if (args.root && args.root === 'string') { var path = args.root + args.path; } else { var path = 'https://www.googleapis.com' + args.path; } if (typeof args.params === 'object') { var deliminator = '?'; for (var i in args.params) { path += deliminator + encodeURIComponent(i) + "=" + encodeURIComponent(args.params[i]); deliminator = '&'; } } var xhr = new XMLHttpRequest(); xhr.open(args.method || 'GET', path); xhr.setRequestHeader('Authorization', 'Bearer ' + access_token); if (typeof args.body !== 'undefined') { xhr.setRequestHeader('content-type', 'application/json'); xhr.send(JSON.stringify(args.body)); } else { xhr.send(); } xhr.onerror = function () { // TODO, error handling. debugger; }; xhr.onload = function() { var rawResponseObject = { // TODO: body, headers. gapiRequest: { data: { status: this.status, statusText: this.statusText } } }; var rawResp = JSON.stringify(rawResponseObject); if (this.response) { var jsonResp = JSON.parse(this.response); args.callback(jsonResp, rawResp); } else { args.callback(null, rawResp); } }; }; // Call client handler when gapi is ready. setTimeout(function () { gapiIsLoaded(); }, 0); })(); ================================================ FILE: _archive/apps/samples/analytics/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Analytics This example demonstrates how to include support for Google Analytics in your packaged application. It uses the [chrome-platform-analytics](https://github.com/GoogleChrome/chrome-platform-analytics) library, which allows tracking app views or any arbitrary event to Google Analytics. See more at the [project wiki](https://github.com/GoogleChrome/chrome-platform-analytics/wiki) *Please note: You will need to modify main.js to include real Google Analytics credentials.* ## Resources * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) * [chrome-platform-analytics](https://github.com/GoogleChrome/chrome-platform-analytics/wiki) ## Screenshot ![screenshot](/_archive/apps/samples/analytics/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/analytics/background.js ================================================ // Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('main.html', {"id": "analyticsWinID"}, function() {}); }); ================================================ FILE: _archive/apps/samples/analytics/google-analytics-bundle.js ================================================ (function() { var g,aa=aa||{},h=this,ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&& !a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},m=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},n=function(a){return"string"==typeof a},ea=function(a){return"number"==typeof a},p=function(a){return"function"==ca(a)},q=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},fa=function(a,b,c){return a.call.apply(a.bind, arguments)},ga=function(a,b,c){if(!a)throw Error();if(2b?1:0};var w=Array.prototype,ja=w.indexOf?function(a,b,c){return w.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(n(a))return n(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?null:n(a)?a.charAt(b):a[b]},pa=function(a,b){var c=ja(a,b),d;(d=0<=c)&&w.splice.call(a,c,1);return d},qa=function(a){return w.concat.apply(w, arguments)},ra=function(a,b,c){return 2>=arguments.length?w.slice.call(a,b):w.slice.call(a,b,c)};var sa="StopIteration"in h?h.StopIteration:Error("StopIteration"),ta=function(){};ta.prototype.next=function(){throw sa;};ta.prototype.vc=function(){return this};var ua=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)},va=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},wa=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},xa=function(a,b){var c;t:{for(c in a)if(b.call(void 0,a[c],c,a))break t;c=void 0}return c&&a[c]},ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),za=function(a,b){for(var c,d,e=1;e2*this.h&&Aa(this),!0):!1};var Aa=function(a){if(a.h!=a.b.length){for(var b=0,c=0;b=c.length)throw sa;var k=c[b++];return a?k:d[k]}};return k};var y=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Ba,Ca,Da={id:"hitType",name:"t",valueType:"text",maxLength:void 0,defaultValue:void 0},Ea={id:"sessionControl",name:"sc",valueType:"text",maxLength:void 0,defaultValue:void 0},Fa={id:"description",name:"cd",valueType:"text",maxLength:2048,defaultValue:void 0},Ga={id:"eventCategory",name:"ec",valueType:"text",maxLength:150,defaultValue:void 0},Ha={id:"eventAction",name:"ea",valueType:"text",maxLength:500,defaultValue:void 0},Ia={id:"eventLabel",name:"el",valueType:"text",maxLength:500,defaultValue:void 0}, Ja={id:"eventValue",name:"ev",valueType:"integer",maxLength:void 0,defaultValue:void 0},Ka={pd:Da,Qc:{id:"anonymizeIp",name:"aip",valueType:"boolean",maxLength:void 0,defaultValue:void 0},Ad:{id:"queueTime",name:"qt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Wc:{id:"cacheBuster",name:"z",valueType:"text",maxLength:void 0,defaultValue:void 0},Gd:Ea,Wd:{id:"userId",name:"uid",valueType:"text",maxLength:void 0,defaultValue:void 0},xd:{id:"nonInteraction",name:"ni",valueType:"boolean", maxLength:void 0,defaultValue:void 0},fd:Fa,Pd:{id:"title",name:"dt",valueType:"text",maxLength:1500,defaultValue:void 0},Sc:{id:"appId",name:"aid",valueType:"text",maxLength:150,defaultValue:void 0},Tc:{id:"appInstallerId",name:"aiid",valueType:"text",maxLength:150,defaultValue:void 0},jd:Ga,hd:Ha,kd:Ia,ld:Ja,Id:{id:"socialNetwork",name:"sn",valueType:"text",maxLength:50,defaultValue:void 0},Hd:{id:"socialAction",name:"sa",valueType:"text",maxLength:50,defaultValue:void 0},Jd:{id:"socialTarget", name:"st",valueType:"text",maxLength:2048,defaultValue:void 0},Sd:{id:"transactionId",name:"ti",valueType:"text",maxLength:500,defaultValue:void 0},Rd:{id:"transactionAffiliation",name:"ta",valueType:"text",maxLength:500,defaultValue:void 0},Td:{id:"transactionRevenue",name:"tr",valueType:"currency",maxLength:void 0,defaultValue:void 0},Ud:{id:"transactionShipping",name:"ts",valueType:"currency",maxLength:void 0,defaultValue:void 0},Vd:{id:"transactionTax",name:"tt",valueType:"currency",maxLength:void 0, defaultValue:void 0},dd:{id:"currencyCode",name:"cu",valueType:"text",maxLength:10,defaultValue:void 0},td:{id:"itemPrice",name:"ip",valueType:"currency",maxLength:void 0,defaultValue:void 0},ud:{id:"itemQuantity",name:"iq",valueType:"integer",maxLength:void 0,defaultValue:void 0},rd:{id:"itemCode",name:"ic",valueType:"text",maxLength:500,defaultValue:void 0},sd:{id:"itemName",name:"in",valueType:"text",maxLength:500,defaultValue:void 0},qd:{id:"itemCategory",name:"iv",valueType:"text",maxLength:500, defaultValue:void 0},bd:{id:"campaignSource",name:"cs",valueType:"text",maxLength:100,defaultValue:void 0},$c:{id:"campaignMedium",name:"cm",valueType:"text",maxLength:50,defaultValue:void 0},ad:{id:"campaignName",name:"cn",valueType:"text",maxLength:100,defaultValue:void 0},Zc:{id:"campaignKeyword",name:"ck",valueType:"text",maxLength:500,defaultValue:void 0},Xc:{id:"campaignContent",name:"cc",valueType:"text",maxLength:500,defaultValue:void 0},Yc:{id:"campaignId",name:"ci",valueType:"text",maxLength:100, defaultValue:void 0},od:{id:"gclid",name:"gclid",valueType:"text",maxLength:void 0,defaultValue:void 0},ed:{id:"dclid",name:"dclid",valueType:"text",maxLength:void 0,defaultValue:void 0},zd:{id:"pageLoadTime",name:"plt",valueType:"integer",maxLength:void 0,defaultValue:void 0},gd:{id:"dnsTime",name:"dns",valueType:"integer",maxLength:void 0,defaultValue:void 0},Kd:{id:"tcpConnectTime",name:"tcp",valueType:"integer",maxLength:void 0,defaultValue:void 0},Fd:{id:"serverResponseTime",name:"srt",valueType:"integer", maxLength:void 0,defaultValue:void 0},yd:{id:"pageDownloadTime",name:"pdt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Bd:{id:"redirectResponseTime",name:"rrt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Ld:{id:"timingCategory",name:"utc",valueType:"text",maxLength:150,defaultValue:void 0},Od:{id:"timingVar",name:"utv",valueType:"text",maxLength:500,defaultValue:void 0},Nd:{id:"timingValue",name:"utt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Md:{id:"timingLabel", name:"utl",valueType:"text",maxLength:500,defaultValue:void 0},md:{id:"exDescription",name:"exd",valueType:"text",maxLength:150,defaultValue:void 0},nd:{id:"exFatal",name:"exf",valueType:"boolean",maxLength:void 0,defaultValue:"1"}},La=function(a){if(1>a||200a||200a)return"0";if(3>a)return"1-2";a=Math.floor(Math.log(a-1)/Math.log(2));return Math.pow(2,a)+1+"-"+Math.pow(2,a+1)},Oa=function(a,b){for(var c=0,d=a.length-1,e=0;c<=d;){var f=Math.floor((c+d)/2),e=a[f];if(b<=e){d=0==f?0:a[f-1];if(b>d)return(d+1).toString()+"-"+e.toString();d=f-1}else if(b>e){if(f>=a.length-1)return(a[a.length-1]+1).toString()+"+";c=f+1}}return"<= 0"};var z=function(){this.ab=[]},Pa=function(){return new z};g=z.prototype;g.when=function(a){this.ab.push(a);return this};g.zb=function(a){var b=arguments;this.when(function(a){return 0<=ja(b,a.Gb())});return this};g.Oc=function(a,b){var c=ra(arguments,1);this.when(function(b){b=b.T().get(a);return 0<=ja(c,b)});return this};g.xb=function(a,b){if(q(this.e))throw Error("Filter has already been set.");this.e=q(b)?r(a,b):a;return this}; g.Ca=function(){if(0==this.ab.length)throw Error("Must specify at least one predicate using #when or a helper method.");if(!q(this.e))throw Error("Must specify a delegate filter using #applyFilter.");return r(function(a){ma(this.ab,function(b){return b(a)})&&this.e(a)},this)};var A=function(){this.Ab=!1;this.Bb="";this.qb=!1;this.za=null};A.prototype.wc=function(a){this.Ab=!0;this.Bb=a||" - ";return this};A.prototype.Nc=function(){this.qb=!0;return this};A.prototype.Ec=function(){return Qa(this,Na)};A.prototype.Fc=function(a){return Qa(this,ha(Oa,a))}; var Qa=function(a,b){if(null!=a.za)throw Error("LabelerBuilder: Only one labeling strategy may be used.");a.za=r(function(a){var d=a.T().get(Ja),e=a.T().get(Ia);ea(d)&&(d=b(d),null!=e&&this.Ab&&(d=e+this.Bb+d),a.T().set(Ia,d))},a);return a};A.prototype.Ca=function(){if(null==this.za)throw Error("LabelerBuilder: a labeling strategy must be specified prior to calling build().");return Pa().zb("event").xb(r(function(a){this.za(a);this.qb&&a.T().remove(Ja)},this)).Ca()};var Ra=function(a,b){var c=Array.prototype.slice.call(arguments),d=c.shift();if("undefined"==typeof d)throw Error("[goog.string.format] Template required");return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,l,N,J,U,V){if("%"==J)return"%";var Db=c.shift();if("undefined"==typeof Db)throw Error("[goog.string.format] Not enough arguments");arguments[0]=Db;return B[J].apply(null,arguments)})},B={s:function(a,b,c){return isNaN(c)||""==c||a.length>=c?a:a=-1a?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=a&&(d=f+d);if(isNaN(c)||d.length>=c)return d;d=isNaN(e)?Math.abs(a).toString():Math.abs(a).toFixed(e);a=c-d.length-f.length;return d=0<=b.indexOf("-",0)?f+d+Array(a+1).join(" "):f+Array(a+1).join(0<=b.indexOf("0",0)?"0":" ")+d},d:function(a,b,c,d,e,f,k,l){return B.f(parseInt(a,10),b,c,d,0,f,k,l)}};B.i=B.d; B.u=B.d;var Sa=function(a){if("function"==typeof a.t)return a.t();if(n(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;dparseFloat(a))?String(b):a}(),bb={},M=function(a){var b; if(!(b=bb[a])){b=0;for(var c=String(ab).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f=a.keyCode)a.keyCode=-1}catch(b){}};O.prototype.l=function(){};var jb="closure_listenable_"+(1E6*Math.random()|0),kb=function(a){return!(!a||!a[jb])},lb=0;var mb=function(a,b,c,d,e){this.O=a;this.proxy=null;this.src=b;this.type=c;this.pa=!!d;this.sa=e;this.key=++lb;this.removed=this.qa=!1},nb=function(a){a.removed=!0;a.O=null;a.proxy=null;a.src=null;a.sa=null};var P=function(a){this.src=a;this.j={};this.Z=0};P.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.j[f];a||(a=this.j[f]=[],this.Z++);var k=ob(a,b,d,e);-1e.keyCode||void 0!=e.returnValue)){t:{var f=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(k){f=!0}if(f||void 0==e.returnValue)e.returnValue=!0}e=[];for(f=c.currentTarget;f;f=f.parentNode)e.push(f);for(var f=a.type,l=e.length-1;!c.U&&0<=l;l--)c.currentTarget=e[l],d&=Fb(e[l],f,!0,c);for(l=0;!c.U&&l>>0),ub=function(a){if(p(a))return a;a[Gb]||(a[Gb]=function(b){return a.handleEvent(b)});return a[Gb]};var Q=function(){E.call(this);this.A=new P(this);this.kc=this;this.Qa=null};u(Q,E);Q.prototype[jb]=!0;g=Q.prototype;g.addEventListener=function(a,b,c,d){tb(this,a,b,c,d)};g.removeEventListener=function(a,b,c,d){Bb(this,a,b,c,d)}; g.dispatchEvent=function(a){var b,c=this.Qa;if(c){b=[];for(var d=1;c;c=c.Qa)b.push(c),++d}c=this.kc;d=a.type||a;if(n(a))a=new F(a,c);else if(a instanceof F)a.target=a.target||c;else{var e=a;a=new F(d,c);za(a,e)}var e=!0,f;if(b)for(var k=b.length-1;!a.U&&0<=k;k--)f=a.currentTarget=b[k],e=Hb(f,d,!0,a)&&e;a.U||(f=a.currentTarget=c,e=Hb(f,d,!0,a)&&e,a.U||(e=Hb(f,d,!1,a)&&e));if(b)for(k=0;!a.U&&k=b.Ia&&b.cancel())}this.hb?this.hb.call(this.gb,this):this.Ka=!0;this.C||this.w(new dc)}};S.prototype.ib=function(a,b){this.Ja=!1;ec(this,a,b)}; var ec=function(a,b,c){a.C=!0;a.v=c;a.W=!b;fc(a)},hc=function(a){if(a.C){if(!a.Ka)throw new gc;a.Ka=!1}};S.prototype.G=function(a){hc(this);ec(this,!0,a)};S.prototype.w=function(a){hc(this);ec(this,!1,a)};S.prototype.J=function(a,b){return ic(this,a,null,b)};var ic=function(a,b,c,d){a.ja.push([b,c,d]);a.C&&fc(a);return a};S.prototype.then=function(a,b,c){var d,e,f=new R(function(a,b){d=a;e=b});ic(this,d,function(a){a instanceof dc?f.cancel():e(a)});return f.then(a,b,c)};Sb(S); var jc=function(a){var b=new S;ic(a,b.G,b.w,b);return b},kc=function(a){return la(a.ja,function(a){return p(a[1])})},fc=function(a){if(a.ka&&a.C&&kc(a)){var b=a.ka,c=lc[b];c&&(h.clearTimeout(c.ma),delete lc[b]);a.ka=0}a.o&&(a.o.Ia--,delete a.o);for(var b=a.v,d=c=!1;a.ja.length&&!a.Ja;){var e=a.ja.shift(),f=e[0],k=e[1],e=e[2];if(f=a.W?k:f)try{var l=f.call(e||a.gb,b);void 0!==l&&(a.W=a.W&&(l==b||l instanceof Error),a.v=b=l);Tb(b)&&(d=!0,a.Ja=!0)}catch(N){b=N,a.W=!0,kc(a)||(c=!0)}}a.v=b;d&&(l=r(a.ib, a,!0),d=r(a.ib,a,!1),b instanceof S?(ic(b,l,d),b.Lb=!0):b.then(l,d));c&&(b=new mc(b),lc[b.ma]=b,a.ka=b.ma)},nc=function(a){var b=new S;b.G(a);return b},pc=function(){var a=oc,b=new S;b.w(a);return b},gc=function(){v.call(this)};u(gc,v);gc.prototype.message="Deferred has already fired";gc.prototype.name="AlreadyCalledError";var dc=function(){v.call(this)};u(dc,v);dc.prototype.message="Deferred was canceled";dc.prototype.name="CanceledError"; var mc=function(a){this.ma=h.setTimeout(r(this.pc,this),0);this.ga=a};mc.prototype.pc=function(){delete lc[this.ma];throw this.ga;};var lc={};var qc=function(a){this.$a=[];this.e=a};qc.prototype.S=function(a){if(!p(a))throw Error("Invalid filter. Must be a function.");this.$a.push(a)};qc.prototype.send=function(a,b){for(var c=new T(a,b),d=0;db.maxLength&&a.set(b,c.substring(0,b.maxLength))})},ed=function(a){Ua(a,function(b,c){void 0!==b.defaultValue&&c==b.defaultValue&&a.remove(b)})};var oc={status:"device-offline",Ba:void 0},fd={status:"rate-limited",Ba:void 0},gd={status:"sampled-out",Ba:void 0},hd={status:"sent",Ba:void 0};var id=function(a,b){this.Wb=a;this.e=b};id.prototype.send=function(a,b){var c;c=this.Wb;var d=c.pb(),e=Math.floor((d-c.ob)*c.Sb);0c.$?c=!1:(c.$-=1,c=!0);return c||"item"==a||"transaction"==a?this.e.send(a,b):nc(fd)};var jd=function(){this.$=60;this.Tb=500;this.Sb=5E-4;this.pb=function(){return(new Date).getTime()};this.ob=this.pb()};var kd=function(a,b){this.k=a;this.e=b};kd.prototype.send=function(a,b){var c=b.get(vc),c=parseInt(c.split("-")[1],16),d;"timing"!=a?d=this.k.V:((d=b.get(yc))&&b.remove(yc),d||(d=this.k.V));return c<655.36*d?this.e.send(a,b):nc(gd)};var ld=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,md=L,nd=function(a,b){if(md){md=!1;var c=h.location;if(c){var d=c.href;if(d&&(d=(d=nd(3,d))?decodeURI(d):d)&&d!=c.hostname)throw md=!0,Error();}}return b.match(ld)[a]||null};var od=function(){};od.prototype.Eb=null;var qd=function(a){var b;(b=a.Eb)||(b={},pd(a)&&(b[0]=!0,b[1]=!0),b=a.Eb=b);return b};var rd,sd=function(){};u(sd,od);var td=function(a){return(a=pd(a))?new ActiveXObject(a):new XMLHttpRequest},pd=function(a){if(!a.Hb&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;cthis.na?c.w({status:"payload-too-big",Ba:Ra("Encoded hit length == %s, but should be <= %s.",d.length,this.na)}):xd(this.$b,function(){c.G(hd)},d);return c};var Jd=function(a,b){var c=new Fd;c.add(Da.name,a);Ua(b,function(a,b){c.add(a.name,b.toString())});return c.toString()};var Kd=function(a,b,c){this.k=a;this.Qb=b;this.na=c};Kd.prototype.Sa=function(){if(!this.q){var a=this.k;if(!jc(a.ha).C)throw Error("Cannot construct shared channel prior to settings being ready.");new ad;var b=new cd(new Id(this.Qb,this.na)),c=new jd;this.q=new bd(a,new kd(a,new id(c,b)))}return this.q};var Ld=new x,Md=function(){if(!Ba){var a=new Tc("google-analytics");Ba=new X(a)}return Ba};t("goog.async.Deferred",S);t("goog.async.Deferred.prototype.addCallback",S.prototype.J);t("goog.events.EventTarget",Q);t("goog.events.EventTarget.prototype.listen",Q.prototype.listen);t("analytics.getService",function(a){var b=Ld.get(a,null);if(null===b){var b=chrome.runtime.getManifest().version,c=Md();if(!Ca){var d=Md();Ca=new Wc(d,new Kd(d,"https://www.google-analytics.com/collect",8192))}b=new Hc("ca1.5.2",a,b,c,Ca);Ld.set(a,b)}return b});t("analytics.internal.GoogleAnalyticsService",Hc); t("analytics.internal.GoogleAnalyticsService.prototype.getTracker",Hc.prototype.Cc);t("analytics.internal.GoogleAnalyticsService.prototype.getConfig",Hc.prototype.Bc);t("analytics.internal.ServiceSettings",X);t("analytics.internal.ServiceSettings.prototype.setTrackingPermitted",X.prototype.Lc);t("analytics.internal.ServiceSettings.prototype.isTrackingPermitted",X.prototype.va);t("analytics.internal.ServiceSettings.prototype.setSampleRate",X.prototype.Kc);t("analytics.internal.ServiceTracker",W); t("analytics.internal.ServiceTracker.prototype.send",W.prototype.send);t("analytics.internal.ServiceTracker.prototype.sendAppView",W.prototype.Gc);t("analytics.internal.ServiceTracker.prototype.sendEvent",W.prototype.Hc);t("analytics.internal.ServiceTracker.prototype.sendSocial",W.prototype.Jc);t("analytics.internal.ServiceTracker.prototype.sendException",W.prototype.Ic);t("analytics.internal.ServiceTracker.prototype.sendTiming",W.prototype.Cb); t("analytics.internal.ServiceTracker.prototype.startTiming",W.prototype.Mc);t("analytics.internal.ServiceTracker.Timing",Gc);t("analytics.internal.ServiceTracker.Timing.prototype.send",Gc.prototype.send);t("analytics.internal.ServiceTracker.prototype.forceSessionStart",W.prototype.Ac);t("analytics.internal.ServiceTracker.prototype.addFilter",W.prototype.S);t("analytics.internal.FilterChannel.Hit",T);t("analytics.internal.FilterChannel.Hit.prototype.getHitType",T.prototype.Gb); t("analytics.internal.FilterChannel.Hit.prototype.getParameters",T.prototype.T);t("analytics.internal.FilterChannel.Hit.prototype.cancel",T.prototype.cancel);t("analytics.ParameterMap",C);t("analytics.ParameterMap.Entry",C.Entry);t("analytics.ParameterMap.prototype.set",C.prototype.set);t("analytics.ParameterMap.prototype.get",C.prototype.get);t("analytics.ParameterMap.prototype.remove",C.prototype.remove);t("analytics.ParameterMap.prototype.toObject",C.prototype.Jb); t("analytics.HitTypes.APPVIEW","appview");t("analytics.HitTypes.EVENT","event");t("analytics.HitTypes.SOCIAL","social");t("analytics.HitTypes.TRANSACTION","transaction");t("analytics.HitTypes.ITEM","item");t("analytics.HitTypes.TIMING","timing");t("analytics.HitTypes.EXCEPTION","exception");ua(Ka,function(a){var b=a.id.replace(/[A-Z]/,"_$&").toUpperCase();t("analytics.Parameters."+b,a)});t("analytics.filters.EventLabelerBuilder",A); t("analytics.filters.EventLabelerBuilder.prototype.appendToExistingLabel",A.prototype.wc);t("analytics.filters.EventLabelerBuilder.prototype.stripValue",A.prototype.Nc);t("analytics.filters.EventLabelerBuilder.prototype.powersOfTwo",A.prototype.Ec);t("analytics.filters.EventLabelerBuilder.prototype.rangeBounds",A.prototype.Fc);t("analytics.filters.EventLabelerBuilder.prototype.build",A.prototype.Ca);t("analytics.filters.FilterBuilder",z);t("analytics.filters.FilterBuilder.builder",Pa); t("analytics.filters.FilterBuilder.prototype.when",z.prototype.when);t("analytics.filters.FilterBuilder.prototype.whenHitType",z.prototype.zb);t("analytics.filters.FilterBuilder.prototype.whenValue",z.prototype.Oc);t("analytics.filters.FilterBuilder.prototype.applyFilter",z.prototype.xb);t("analytics.filters.FilterBuilder.prototype.build",z.prototype.Ca);t("analytics.EventBuilder",D);t("analytics.EventBuilder.builder",function(){return Va});t("analytics.EventBuilder.prototype.category",D.prototype.xc); t("analytics.EventBuilder.prototype.action",D.prototype.action);t("analytics.EventBuilder.prototype.label",D.prototype.label);t("analytics.EventBuilder.prototype.value",D.prototype.value);t("analytics.EventBuilder.prototype.dimension",D.prototype.yc);t("analytics.EventBuilder.prototype.metric",D.prototype.Dc);t("analytics.EventBuilder.prototype.send",D.prototype.send); })() ================================================ FILE: _archive/apps/samples/analytics/main.html ================================================ Analytics sample app

    Settings

    Loading settings...
    ================================================ FILE: _archive/apps/samples/analytics/main.js ================================================ // Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var service, tracker, out; function initAnalyticsConfig(config) { document.getElementById('settings-loading').hidden = true; document.getElementById('settings-loaded').hidden = false; var checkbox = document.getElementById('analytics'); checkbox.checked = config.isTrackingPermitted(); checkbox.onchange = function() { config.setTrackingPermitted(checkbox.checked); }; } function startApp() { // Initialize the Analytics service object with the name of your app. service = analytics.getService('ice_cream_app'); service.getConfig().addCallback(initAnalyticsConfig); // Get a Tracker using your Google Analytics app Tracking ID. tracker = service.getTracker('UA-XXXXX-X'); // Record an "appView" each time the user launches your app or goes to a new // screen within the app. tracker.sendAppView('MainView'); var button1 = document.getElementById('chocolate'); var button2 = document.getElementById('vanilla'); out = document.getElementById('out'); [button1, button2].forEach(addButtonListener); } function addButtonListener(button) { button.addEventListener('click', function() { tracker.sendEvent('Flavor', 'Choose', button.id); out.textContent = 'You chose: ' + button.textContent; }); } window.onload = startApp; ================================================ FILE: _archive/apps/samples/analytics/manifest.json ================================================ { "name": "Analytics Sample App", "description": "An example app using Google Analytics without the Closure library", "version": "1.2.5", "manifest_version": 2, "icons": {"128": "icon_128.png"}, "app": { "background": { "scripts": ["background.js"] } }, "permissions": [ "https://www.google-analytics.com/*", "storage" ] } ================================================ FILE: _archive/apps/samples/analytics/sample_support_metadata.json ================================================ { "sample": "analytics", "files_with_snippets": [ ], "android": {"works": true}, "ios": {"works": true} } ================================================ FILE: _archive/apps/samples/appengine-channelapi/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # AppEngine Channel API example This is an example of how to use the AppEngine's Channel API in a Chrome Packaged App. Since the Channel API is not directly compatible with the CSP restrictions in a packaged app, this sample uses a WebView and a "proxy" object that communicates with the Webview using async postMessage. This code is an adaptation of the [Tic Tac Toe game](https://code.google.com/p/channel-tac-toe/) used by the AppEngine team to demonstrate the Channel API. The main modifications from the original game are: - index.html is not rendered as a template in the server, it is embedded in the app. All responses from the server are JSON messages; - the server doesn't use the appengine's user library, since that would require another authentication step. Instead, the server attributes a random UUID to the first user and another to the second. This user ID is returned to the client that uses it in the following calls. It is not secure, but simple enough for this sample. In a real application, this method would allow an eaversdropper to capture the GET request and replay with different commands; - all the interations with the channel API are abstracted in the ChannelAPI object defined by channel_in_a_webview.js. This object communicates with the webview page (channel_in_a_webview.html), served to the webview from the appengine server. To run: - go to the `appengine` folder and type `dev_appserver.py .` - install the Chrome Packaged App in the `app` folder - run the Chrome packaged app twice and copy the game ID from one screen to the other - play * [Appengine Channel API](https://developers.google.com/appengine/docs/python/channel) * [Webview](https://developer.chrome.com/apps/tags/webview) ## Screenshot ![screenshot](/_archive/apps/samples/appengine_channelapi/app/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/appengine-channelapi/app/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") ================================================ FILE: _archive/apps/samples/appengine-channelapi/app/channel_in_a_webview.js ================================================ (function (exports) { function ChannelInAWebview(rootUrl) { this.webview = document.createElement('webview'); this.webview.src = rootUrl+'/static/channel_in_a_webview.html'; this.webview.style.width='0px'; this.webview.style.height='0px'; this.webview.style.display='none'; this.webview.style.width='10px'; this.webview.style.height='10px'; this.webview.style.display='block'; this.webview.style.border='1px solid red'; document.body.appendChild(this.webview); this.onOpened = this.onMessage = null; window.addEventListener('message', function(e) { // sanity check for origin if ( this.webview.src.indexOf(e.origin)!=0 ) { console.error("Invalid origin of message, ignoring"); return; } // onOpened event if ( this.onOpened && e.data && 'onOpened' in e.data ) { this.onOpened(); } // onMessage event if ( this.onMessage && e.data && 'onMessage' in e.data ) { this.onMessage.call(this, e.data['onMessage']); } }.bind(this)); } ChannelInAWebview.prototype._sendMessageToWebview = function(data) { this.webview.contentWindow.postMessage(data, this.webview.src); } ChannelInAWebview.prototype.openChannel = function(token) { this._sendMessageToWebview({'openChannel': token}); } exports.ChannelInAWebview = ChannelInAWebview; })(window); ================================================ FILE: _archive/apps/samples/appengine-channelapi/app/game.js ================================================ ROOT = 'http:/localhost:8080'; window.addEventListener('DOMContentLoaded', init); function init() { var xhr = new XMLHttpRequest(); xhr.open('GET', ROOT); xhr.onload = function(e) { game(JSON.parse(e.target.responseText)); }; xhr.send(); } function game(data) { // event listeners: document.querySelector('#go').addEventListener('click', function() { var xhr = new XMLHttpRequest(); xhr.open('GET', ROOT+'/?g='+document.querySelector('#another_game_key').value); xhr.onload = function(e) { initialize(JSON.parse(e.target.responseText)); }; xhr.send(); }); var handleMouseOver = function(e) { highlightSquare(parseInt(e.target.id)) }; var handleOnClick = function(e) { moveInSquare(parseInt(e.target.id)) }; var i; for (i = 0; i < 9; i++) { var square = document.getElementById(i); square.onmouseover = handleMouseOver; square.onclick = handleOnClick; } var state = { }; updateGame = function() { for (i = 0; i < 9; i++) { var square = document.getElementById(i); square.innerHTML = state.board[i]; if (state.winner != '' && state.winningBoard != '') { if (state.winningBoard[i] == state.board[i]) { if (state.winner == state.me) { square.style.background = "green"; } else { square.style.background = "red"; } } else { square.style.background = "white"; } } } var display = { 'other-player': 'none', 'your-move': 'none', 'their-move': 'none', 'you-won': 'none', 'you-lost': 'none', 'board': 'block' }; if (!state.userO || state.userO == '') { display['other-player'] = 'block'; display['board'] = 'none'; } else if (state.winner == state.me) { display['you-won'] = 'block'; } else if (state.winner != '') { display['you-lost'] = 'block'; } else if (isMyMove()) { display['your-move'] = 'block'; } else { display['their-move'] = 'block'; } for (var label in display) { document.getElementById(label).style.display = display[label]; } }; isMyMove = function() { return (state.winner == "") && (state.moveX == (state.userX == state.me)); } myPiece = function() { return state.userX == state.me ? 'X' : 'O'; } sendMessage = function(path, opt_param) { path = ROOT + path + '?g=' + state.game_key; if (state.me) { path += '&u=' + state.me; } if (opt_param) { path += '&' + opt_param; } var xhr = new XMLHttpRequest(); xhr.open('POST', path, true); xhr.send(); }; moveInSquare = function(id) { if (isMyMove() && state.board[id] == ' ') { sendMessage('/move', 'i=' + id); } } highlightSquare = function(id) { if (state.winner != "") { return; } for (i = 0; i < 9; i++) { if (i == id && isMyMove()) { if (state.board[i] = ' ') { color = 'lightBlue'; } else { color = 'lightGrey'; } } else { color = 'white'; } document.getElementById(i).style['background'] = color; } } onOpened = function() { sendMessage('/opened'); }; onMessage = function(m) { var newState = JSON.parse(m.data); state.board = newState.board || state.board; state.userX = newState.userX || state.userX; state.userO = newState.userO || state.userO; state.moveX = newState.moveX; state.winner = newState.winner || ""; state.winningBoard = newState.winningBoard || ""; updateGame(); } initialize = function(data) { state = { game_key: data.game_key, me: data.me } var gamelinks = document.querySelectorAll('.gamelink'); for (var i=0; i

    Channel-based Tic Tac Toe

    You won this game!
    You lost this game.
    ================================================ FILE: _archive/apps/samples/appengine-channelapi/app/main.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "appEngineSampleID", innerBounds: { width: 500, height: 300 } }); }); ================================================ FILE: _archive/apps/samples/appengine-channelapi/app/manifest.json ================================================ { "manifest_version": 2, "name": "Appengine Channel API Sample", "version": "2", "minimum_chrome_version": "27", "permissions": ["webview", "http://localhost:8080/*"], "app": { "background": { "scripts": ["main.js"] } } } ================================================ FILE: _archive/apps/samples/appengine-channelapi/appengine/app.yaml ================================================ application: moishetest version: 1 runtime: python api_version: 1 handlers: - url: /static static_dir: static - url: /.* script: chatactoe.py inbound_services: - channel_presence ================================================ FILE: _archive/apps/samples/appengine-channelapi/appengine/chatactoe.py ================================================ #!/usr/bin/python2.4 # # Copyright 2010 Google Inc. All Rights Reserved. # pylint: disable-msg=C6310 """Channel Tic Tac Toe This module demonstrates the App Engine Channel API by implementing a simple tic-tac-toe game. """ import datetime import logging import os import random import re import uuid import sys from django.utils import simplejson from google.appengine.api import channel from google.appengine.ext import db from google.appengine.ext import webapp from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app class Game(db.Model): """All the data we store for a game""" userX = db.StringProperty() userO = db.StringProperty() board = db.StringProperty() moveX = db.BooleanProperty() winner = db.StringProperty() winning_board = db.StringProperty() class Wins(): x_win_patterns = ['XXX......', '...XXX...', '......XXX', 'X..X..X..', '.X..X..X.', '..X..X..X', 'X...X...X', '..X.X.X..'] o_win_patterns = map(lambda s: s.replace('X','O'), x_win_patterns) x_wins = map(lambda s: re.compile(s), x_win_patterns) o_wins = map(lambda s: re.compile(s), o_win_patterns) class GameUpdater(): game = None def __init__(self, game): self.game = game def get_game_message(self): gameUpdate = { 'board': self.game.board, 'userX': self.game.userX, 'userO': '' if not self.game.userO else self.game.userO, 'moveX': self.game.moveX, 'winner': self.game.winner, 'winningBoard': self.game.winning_board } return simplejson.dumps(gameUpdate) def send_update(self): message = self.get_game_message() channel.send_message(self.game.userX + self.game.key().id_or_name(), message) if self.game.userO: channel.send_message(self.game.userO + self.game.key().id_or_name(), message) def check_win(self): if self.game.moveX: # O just moved, check for O wins wins = Wins().o_wins potential_winner = self.game.userO else: # X just moved, check for X wins wins = Wins().x_wins potential_winner = self.game.userX for win in wins: if win.match(self.game.board): self.game.winner = potential_winner self.game.winning_board = win.pattern return def make_move(self, position, user): if position >= 0 and user == self.game.userX or user == self.game.userO: if self.game.moveX == (user == self.game.userX): boardList = list(self.game.board) if (boardList[position] == ' '): boardList[position] = 'X' if self.game.moveX else 'O' self.game.board = "".join(boardList) self.game.moveX = not self.game.moveX self.check_win() self.game.put() self.send_update() return class GameFromRequest(): game = None; user = None; def __init__(self, request): self.user = request.get('u') game_key = request.get('g') if game_key: self.game = Game.get_by_key_name(game_key) def get_game_data(self): return ( self.game, self.user ) class MovePage(webapp.RequestHandler): def post(self): (game, user) = GameFromRequest(self.request).get_game_data() if game and user: id = int(self.request.get('i')) GameUpdater(game).make_move(id, user) class OpenedPage(webapp.RequestHandler): def post(self): (game, user) = GameFromRequest(self.request).get_game_data() GameUpdater(game).send_update() class MainPage(webapp.RequestHandler): """The main UI page, renders the 'index.html' template.""" def get(self): """Renders the main page. When this page is shown, we create a new channel to push asynchronous updates to the client.""" game_key = self.request.get('g') game = None user = None if game_key: game = Game.get_by_key_name(game_key) if game: user = game.userO if not user: user = uuid.uuid4().hex game.userO = user game.put() if not game: game_key = uuid.uuid4().hex user = uuid.uuid4().hex game = Game(key_name = game_key, moveX = True, userX = user, complete = False, board = ' ') game.put() game_link = 'http://localhost:8080/?g=' + game_key if game: token = channel.create_channel(user + game_key) values = {'token': token, 'me': user, 'game_key': game_key, 'game_link': game_link, 'initial_message': GameUpdater(game).get_game_message() } self.response.out.write(simplejson.dumps(values)) else: self.response.out.write(simplejson.dumps({'error': 'No such game'})) application = webapp.WSGIApplication([ ('/', MainPage), ('/opened', OpenedPage), ('/move', MovePage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() ================================================ FILE: _archive/apps/samples/appengine-channelapi/appengine/static/channel_in_a_webview.html ================================================ ================================================ FILE: _archive/apps/samples/appsquare/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # AppSquare This is a basic Foursquare client implemented as a packaged app. It just displays recent checkins of the logged in user's friends. To log into Foursquare, it uses the [identity API](http://developer.chrome.com/apps/identity.html) (specfically, the `launchWebAuthFlow` method). Once it gets the OAuth token, it uses the [storage API](http://developer.chrome.com/apps/storage) to persist it. It also uses the [W3C Geolocation API](http://www.w3.org/TR/geolocation-API/) to pass in the current location to the Foursquare API. When running it unpacked, it will normally have a different ID (the unpacked extension ID is a hash of the path on disk). However, this will result in the auth API not working, since the redirect URL will be different. To force the unpacked app to have the same ID, add this key and value to `manifest.json`: "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDnyZBBnfu+qNi1x5C0YKIob4ACrA84HdMArTGobttMHIxM2Z6aLshFmoKZa/pbyQS6D5yNywr4KM/llWiY2aV2puIflUxRT8SjjPehswCvm6eWQM+r3mB755m48x+diDl8URJsX4AJ3pQHnKWEvitZcuBh0GTfsLzKU/BfHEaH7QIDAQAB" (this is a base 64 encoded version of the app's public key) The key *must* be removed before uploading it to the store. ## Resources * [Identity](https://developer.chrome.com/docs/apps/app_identity/) * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/appsquare/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/appsquare/background.js ================================================ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('main.html', { id: "appSquareID", innerBounds: { width: 300, height: 600 } }); }); ================================================ FILE: _archive/apps/samples/appsquare/foursquare.js ================================================ var foursquare = {}; (function(api) { // See "Pure AJAX application" from // https://developer.foursquare.com/overview/auth var ACCESS_TOKEN_PREFIX = '#access_token='; var storage = chrome.storage.local; var ACCESS_TOKEN_STORAGE_KEY = 'foursquare-access-token'; var getAccessToken = function(callback) { storage.get(ACCESS_TOKEN_STORAGE_KEY, function(items) { callback(items[ACCESS_TOKEN_STORAGE_KEY]); }); } var setAccessToken = function(accessToken, callback) { var items = {}; items[ACCESS_TOKEN_STORAGE_KEY] = accessToken; storage.set(items, callback); } var clearAccessToken = function(callback) { storage.remove(ACCESS_TOKEN_STORAGE_KEY, callback); } // Tokens state is not exposed via the API api.isSignedIn = function(callback) { getAccessToken(function(accessToken) { callback(!!accessToken); }); }; api.signIn = function(appId, clientId, successCallback, errorCallback) { var redirectUrl = chrome.identity.getRedirectURL(); var authUrl = 'https://foursquare.com/oauth2/authorize?' + 'client_id=' + clientId + '&' + 'response_type=token&' + 'redirect_uri=' + encodeURIComponent(redirectUrl); chrome.identity.launchWebAuthFlow( {url: authUrl, interactive: true}, function(responseUrl) { if (chrome.runtime.lastError) { errorCallback(chrome.runtime.lastError.message); return; } var accessTokenStart = responseUrl.indexOf(ACCESS_TOKEN_PREFIX); if (!accessTokenStart) { errorCallback('Unexpected responseUrl: ' + responseUrl); return; } var accessToken = responseUrl.substring( accessTokenStart + ACCESS_TOKEN_PREFIX.length); setAccessToken(accessToken, successCallback); }); }; api.signOut = function(callback) { clearAccessToken(callback); }; var apiMethod = function( path, postData, params, successCallback, errorCallback) { getAccessToken(function(accessToken) { var xhr = new XMLHttpRequest(); // TODO(mihaip): use xhr.responseType = 'json' once it's supported. xhr.onload = function() { successCallback(JSON.parse(xhr.responseText).response); } xhr.onerror = function() { errorCallback(xhr.status, xhr.statusText, JSON.parse(xhr.responseText)); } var encodedParams = []; for (var paramName in params) { encodedParams.push(encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName])); } xhr.open( 'GET', 'https://api.foursquare.com/v2/' + path + '?oauth_token=' + encodeURIComponent(accessToken) + '&' + encodedParams.join('&'), true); xhr.send(null); }); } api.getRecentCheckins = apiMethod.bind(api, 'checkins/recent', undefined); })(foursquare); ================================================ FILE: _archive/apps/samples/appsquare/loader.js ================================================ function ImageLoader(url) { this.url_ = url; } ImageLoader.prototype.loadInto = function(imageNode) { var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function() { // TODO(mihaip): cache the response into a local filesystem. imageNode.src = window.webkitURL.createObjectURL(xhr.response); } xhr.open('GET', this.url_, true); xhr.send(); }; ================================================ FILE: _archive/apps/samples/appsquare/main.html ================================================ Foursquare Client
      ================================================ FILE: _archive/apps/samples/appsquare/main.js ================================================ function initUi() { foursquare.isSignedIn(function(isSignedIn) { if (isSignedIn) { document.body.classList.add('signed-in'); document.body.classList.remove('signed-out'); fetchCheckins(); } else { document.body.classList.add('signed-out'); document.body.classList.remove('signed-in'); } }); }; document.getElementById('sign-in-button').onclick = function() { foursquare.signIn( location.hostname, // the app's ID 'JP3SRNV00FA1P11W0PHONEUDRQJVSCNODBTCGBKSOPSXIVMX', // Foursquare API client ID initUi, function(error) { console.log('Sign-in error: ' + error); }); }; document.getElementById('sign-out-button').onclick = function() { foursquare.signOut(initUi); }; function fetchCheckins() { function fetchCheckinsWithLocation(opt_location) { var params = { 'limit': 40 }; if (opt_location) { params['ll'] = opt_location; } foursquare.getRecentCheckins( params, function(responseJson) { renderCheckins(responseJson.recent); }, function(status, statusText, responseJson) { console.log('Error status: ' + status + ' (' + statusText + ')\n' + JSON.stringify(responseJson)); }); } navigator.geolocation.getCurrentPosition( function(position) { fetchCheckinsWithLocation( position.coords.latitude + ',' + position.coords.longitude); }, function(error) { console.log('Geolocation error: ' + error.message); fetchCheckinsWithLocation(); }); }; function renderCheckins(checkins) { var checkinsNode = document.getElementById('checkins'); checkinsNode.innerHTML = ''; checkins.forEach(function(checkin) { var user = checkin.user; var venue = checkin.venue; var checkinNode = document.createElement('li'); checkinNode.className = 'checkin'; if (checkin.isMayor) { var mayorOverlayNode = document.createElement('img'); mayorOverlayNode.className = 'mayor-overlay'; mayorOverlayNode.src = 'crown-overlay.png'; checkinNode.appendChild(mayorOverlayNode); } var displayName = user.firstName; if (displayName && user.lastName) { displayName += ' ' + user.lastName.substring(0, 1) + '.'; } else if (user.lastName) { displayName = user.lastName; } else { displayName = ''; } var displayVenueName = venue.name || ''; var photoNode = document.createElement('img'); photoNode.className = 'photo'; var photoLoader = new ImageLoader(checkin.user.photo); photoLoader.loadInto(photoNode); checkinNode.appendChild(photoNode); var headerNode = document.createElement('h3'); headerNode.innerText = displayName + ' @ ' + displayVenueName; checkinNode.appendChild(headerNode); var locationNode = document.createElement('div'); locationNode.className = 'location'; var displayVenueLocation; var venueLocation = venue.location; if (venueLocation.country == 'United States') { displayVenueLocation = venueLocation.city + ', ' + venueLocation.state; } else { displayVenueLocation = venueLocation.city + ', ' + venueLocation.country; } if (venueLocation.distance && venueLocation.distance < 100000) { displayVenueLocation += ' ('; if (venueLocation.distance < 1000) { displayVenueLocation += venueLocation.distance + ' m'; } else { displayVenueLocation += Math.round(venueLocation.distance/1000) + ' km'; } displayVenueLocation += ' away)'; } locationNode.innerText = displayVenueLocation; checkinNode.appendChild(locationNode); var timestampNode = document.createElement('div'); timestampNode.className = 'timestamp'; var displayTimestamp = new Date(checkin.createdAt * 1000).toLocaleDateString(); var timeDelta = Date.now()/1000 - checkin.createdAt; if (timeDelta < 60) { displayTimestamp = 'just now'; } else if (timeDelta < 3600) { displayTimestamp = Math.round(timeDelta/60) + ' mins ago'; } else if (timeDelta < 24 * 3600) { displayTimestamp = Math.round(timeDelta/3600) + ' hours ago'; } else if (timeDelta < 7 * 24 * 3600) { displayTimestamp = Math.round(timeDelta/(24 * 3600)) + ' days ago'; } timestampNode.innerText = displayTimestamp; checkinNode.appendChild(timestampNode); checkinsNode.appendChild(checkinNode); }); } onload = initUi; ================================================ FILE: _archive/apps/samples/appsquare/manifest.json ================================================ { "name": "Sample of Foursquare integration", "version": "7.1", "manifest_version": 2, "minimum_chrome_version": "33", "app": { "background": { "scripts": ["background.js"] } }, "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "permissions": [ "identity", "geolocation", "storage", "https://api.foursquare.com/", "https://*.4sqi.net/", "https://foursquare.com/" ] } ================================================ FILE: _archive/apps/samples/appview/README.md ================================================ # Appview These samples show how to use the `` tag to embed other Chrome Apps within your Chrome App. Add `host-app` and `embedded-app` and embed the `embedded-app` inside `host-app`. ## Resources * [Appview](https://developer.chrome.com/apps/tags/appview) * [Runtime](http://developer.chrome.com/apps/app_runtime) * [Window](http://developer.chrome.com/apps/app_window) * [videoCapture](https://developer.chrome.com/apps/declare_permissions) ## Screenshot ![screenshot](/_archive/apps/samples/appview/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/appview/embedded-app/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") ================================================ FILE: _archive/apps/samples/appview/embedded-app/camera.html ================================================ ================================================ FILE: _archive/apps/samples/appview/embedded-app/camera.js ================================================ navigator.webkitGetUserMedia({ video: true }, function(stream) { document.querySelector('video').src = URL.createObjectURL(stream); }, function(error) { console.log(error) }); ================================================ FILE: _archive/apps/samples/appview/embedded-app/default.html ================================================

      Yeah! I'm succesfully embedded!

      How about sending some data now? Let's try!

      {"message": "camera"}

      ================================================ FILE: _archive/apps/samples/appview/embedded-app/main.js ================================================ chrome.app.runtime.onEmbedRequested.addListener(function(request) { if (!request.data.message) { request.allow('default.html'); } else if (request.data.message == 'camera') { request.allow('camera.html'); } else { request.deny(); } }); ================================================ FILE: _archive/apps/samples/appview/embedded-app/manifest.json ================================================ { "manifest_version": 2, "name": "Sample Appview Embedded", "description": "This sample shows how to allow your app to be embedded into another app", "version": "2", "minimum_chrome_version": "43", "permissions": ["videoCapture"], "app": { "background": { "scripts": ["main.js"] } } } ================================================ FILE: _archive/apps/samples/appview/host-app/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") ================================================ FILE: _archive/apps/samples/appview/host-app/index.html ================================================
      ================================================ FILE: _archive/apps/samples/appview/host-app/index.js ================================================ var container = document.querySelector('#container'); var logField = document.querySelector('#log'); var form = document.querySelector('form'); var embedAppId = document.querySelector('#embedAppId'); var embedAppData = document.querySelector('#embedAppData'); form.addEventListener('submit', function(event) { event.preventDefault(); var appview = document.createElement('appview'); container.textContent = ''; container.appendChild(appview); try { var data = JSON.parse(embedAppData.value || '{}'); } catch(e) { appendLog('⚠ Syntax error has occured when parsing JSON App Data.'); return; } appendLog('Attempting to embed app ' + embedAppId.value + '...'); appview.connect(embedAppId.value, data, function(result) { if (result) { appendLog('Embedding request has succedded.'); } else { appendLog('Embedding request has failed.'); } appview.classList.toggle('success', result); }); }); function appendLog(message) { logField.innerHTML += new Date().toLocaleTimeString() + ': ' + message + '
      '; logField.scrollTop = logField.scrollHeight; } ================================================ FILE: _archive/apps/samples/appview/host-app/main.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "host", innerBounds: { width: 800, height: 600, } }); }); ================================================ FILE: _archive/apps/samples/appview/host-app/manifest.json ================================================ { "manifest_version": 2, "name": "Sample Appview Host", "description": "This sample shows how to request another app to be embedded.", "version": "2", "minimum_chrome_version": "43", "permissions": ["appview"], "app": { "background": { "scripts": ["main.js"] } } } ================================================ FILE: _archive/apps/samples/blink1/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Blink(1) This sample demos the `chrome.hid` API by controlling a [ThingM blink(1) mk2](http://blink1mk2.thingm.com/) RGB LED light via USB HID Feature Reports. ## APIs * [HID](https://developer.chrome.com/apps/hid) * [Runtime](https://developer.chrome.com/apps/app_runtime) * [Window](https://developer.chrome.com/apps/app_window) ## Running this app on Linux On Linux a udev rule must be added to allow Chrome to open the blink(1) device. Copy the file [`udev/61-blink1.rules`](https://raw.githubusercontent.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/samples/blink1/udev/61-blink1.rules) to `/etc/udev/rules.d`. It contains the following rule which allows anyone in the `plugdev` group read/write access the `hidraw` node for this device. See [USB Caveats](https://developer.chrome.com/apps/app_usb#caveats) for more details. # Make the blink(1) accessible to plugdev via hidraw. SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="27b8", ATTRS{idProduct}=="01ed", MODE="0660", GROUP="plugdev" ## Screenshot ![screenshot](/_archive/apps/samples/blink1/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/blink1/blink1.js ================================================ function Blink1(deviceId) { this.deviceId = deviceId; this.connection = null; }; Blink1.VENDOR_ID = 0x27B8; Blink1.PRODUCT_ID = 0x01ED; Blink1.prototype.connect = function(cb) { chrome.hid.connect(this.deviceId, function(connectionInfo) { if (chrome.runtime.lastError) { console.warn("Unable to connect device: " + chrome.runtime.lastError.message); cb(false); return; } this.connection = connectionInfo.connectionId; cb(true); }.bind(this)); }; Blink1.prototype.disconnect = function(cb) { chrome.hid.disconnect(this.connection, function() { if (chrome.runtime.lastError) { console.warn("Unable to disconnect device: " + chrome.runtime.lastError.message); cb(false); return; } cb(true); }.bind(this)); }; // The following functions send commands to the blink(1). The command protocol // operates over feature reports and is documented here: // // https://github.com/todbot/blink1/blob/master/docs/blink1-hid-commands.md // // blink(1) HID feature reports are 8 bytes, though only the first 7 bytes // appear to ever be read by the firmware. 8 bytes must be sent because some // platforms require it (Windows). The documentation refers to sending the // report ID as the first byte of the buffer, this is a detail of the HID // transport layer and the firmware's HID library and is not reflected in the // buffers sent here. This confusion is probably why the firmware only uses the // first 7 bytes of the report. // // Be careful not to send multiple commands simultaneously as each command // overwrites the buffer returned by a GET_REPORT(Feature) request and so the // command result may be lost or misattributed. // // TODO(reillyeon): Add transparent request queueing to prevent this. Blink1.prototype.fadeRgb = function(r, g, b, fade_ms, led) { var fade_time = fade_ms / 10; var th = (fade_time & 0xff00) >> 8; var tl = fade_time & 0x00ff; var data = new Uint8Array(8); data[0] = 'c'.charCodeAt(0); data[1] = r; data[2] = g; data[3] = b; data[4] = th; data[5] = tl; data[6] = led; chrome.hid.sendFeatureReport(this.connection, 1, data.buffer, function() { if (chrome.runtime.lastError) { console.warn("Unable to send fade command: " + chrome.runtime.lastError.message); } }); }; Blink1.prototype.getRgb = function(led, cb) { var data = new Uint8Array(8); data[0] = 'r'.charCodeAt(0); data[6] = led; chrome.hid.sendFeatureReport(this.connection, 1, data.buffer, function() { if (chrome.runtime.lastError) { console.warn("Unable to send get command: " + chrome.runtime.lastError.message); cb(undefined, undefined, undefined); return; } chrome.hid.receiveFeatureReport(this.connection, 1, function(buffer) { if (chrome.runtime.lastError) { console.warn("Unable to read get response: " + chrome.runtime.lastError.message); cb(undefined, undefined, undefined); return; } var data = new Uint8Array(buffer); cb(data[2], data[3], data[4]); }); }.bind(this)); }; Blink1.prototype.getVersion = function(cb) { var data = new Uint8Array(8); data[0] = 'v'.charCodeAt(0); chrome.hid.sendFeatureReport(this.connection, 1, data.buffer, function() { if (chrome.runtime.lastError) { console.warn("Unable to send version command: " + chrome.runtime.lastError.message); cb(undefined); return; } chrome.hid.receiveFeatureReport(this.connection, 1, function(buffer) { if (chrome.runtime.lastError) { console.warn("Unable to read version response: " + chrome.runtime.lastError.message); cb(undefined); return; } var data = new Uint8Array(buffer); cb(String.fromCharCode(data[3]) + "." + String.fromCharCode(data[4])); }); }.bind(this)); }; ================================================ FILE: _archive/apps/samples/blink1/color-picker.html ================================================ ================================================ FILE: _archive/apps/samples/blink1/color-picker.js ================================================ (function() { var ui = { picker: null, r: null, g: null, b: null }; var bg = undefined; function initializeWindow() { for (var k in ui) { var id = k.replace(/([A-Z])/, '-$1').toLowerCase(); var element = document.getElementById(id); if (!element) { throw "Missing UI element: " + k; } ui[k] = element; } setGradients(); ui.picker.addEventListener('change', onSelectionChanged); ui.r.addEventListener('input', onColorChanged); ui.g.addEventListener('input', onColorChanged); ui.b.addEventListener('input', onColorChanged); chrome.hid.getDevices({}, onDevicesEnumerated); if (chrome.hid.onDeviceAdded) { chrome.hid.onDeviceAdded.addListener(onDeviceAdded); } if (chrome.hid.onDeviceRemoved) { chrome.hid.onDeviceRemoved.addListener(onDeviceRemoved); } }; function enableControls(enabled) { ui.r.disabled = !enabled; ui.g.disabled = !enabled; ui.b.disabled = !enabled; }; function onDevicesEnumerated(devices) { if (chrome.runtime.lastError) { console.error("Unable to enumerate devices: " + chrome.runtime.lastError.message); return; } for (var device of devices) { onDeviceAdded(device); } } function onDeviceAdded(device) { if (device.vendorId != Blink1.VENDOR_ID || device.productId != Blink1.PRODUCT_ID) { return; } var blink1 = new Blink1(device.deviceId); blink1.connect(function (success) { if (success) { blink1.getVersion(function (version) { if (version) { blink1.version = version; addNewDevice(blink1); } }); } }); } function onDeviceRemoved(deviceId) { var option = ui.picker.options.namedItem('device-' + deviceId); if (!option) { return; } if (option.selected) { bg.blink1.disconnect(function() {}); bg.blink1 = undefined; enableControls(false); if (option.previousSibling) { option.previousSibling.selected = true; } if (option.nextSibling) { option.nextSibling.selected = true; } } ui.picker.remove(option.index); if (ui.picker.options.length == 0) { var empty = document.createElement('option'); empty.text = 'No devices found.'; empty.id = 'empty'; empty.selected = true; ui.picker.add(empty); ui.picker.disabled = true; } else { switchToDevice(ui.picker.selectedIndex); } } function addNewDevice(blink1) { var firstDevice = ui.picker.options[0].id == 'empty'; var option = document.createElement('option'); option.text = blink1.deviceId + ' (version ' + blink1.version + ')'; option.id = 'device-' + blink1.deviceId; ui.picker.add(option); ui.picker.disabled = false; if (firstDevice) { ui.picker.remove(0); option.selected = true; setActiveDevice(blink1); } else { blink1.disconnect(function () {}); } } function setActiveDevice(blink1) { bg.blink1 = blink1; bg.blink1.getRgb(0, function(r, g, b) { ui.r.value = r || 0; ui.g.value = g || 0; ui.b.value = b || 0; setGradients(); }); enableControls(true); } function switchToDevice(optionIndex) { var deviceId = parseInt(ui.picker.options[optionIndex].id.substring(7)); var blink1 = new Blink1(deviceId); blink1.connect(function (success) { if (success) { setActiveDevice(blink1); } }); } function onSelectionChanged() { bg.blink1.disconnect(function() {}); bg.blink1 = undefined; enableControls(false); switchToDevice(ui.picker.selectedIndex); } function onColorChanged() { setGradients(); bg.blink1.fadeRgb(ui.r.value, ui.g.value, ui.b.value, 250, 0); } function setGradients() { var r = ui.r.value, g = ui.g.value, b = ui.b.value; ui.r.style.background = 'linear-gradient(to right, rgb(0, ' + g + ', ' + b + '), ' + 'rgb(255, ' + g + ', ' + b + '))'; ui.g.style.background = 'linear-gradient(to right, rgb(' + r + ', 0, ' + b + '), ' + 'rgb(' + r + ', 255, ' + b + '))'; ui.b.style.background = 'linear-gradient(to right, rgb(' + r + ', ' + g + ', 0), ' + 'rgb(' + r + ', ' + g + ', 255))'; } window.addEventListener('load', function() { // Once the background page has been loaded, it will not unload until this // window is closed. chrome.runtime.getBackgroundPage(function(backgroundPage) { bg = backgroundPage; initializeWindow(); }); }); }()); ================================================ FILE: _archive/apps/samples/blink1/main.js ================================================ var blink1 = undefined; function onAppWindowClosed() { if (blink1) { blink1.disconnect(); } window.close(); } function onAppWindowCreated(appWindow) { appWindow.onClosed.addListener(onAppWindowClosed); } chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create( "color-picker.html", { id: "blink1", innerBounds: { width: 160, height: 115 }, resizable: false }, onAppWindowCreated); }); ================================================ FILE: _archive/apps/samples/blink1/manifest.json ================================================ { "name": "blink(1)", "manifest_version": 2, "version": "0.3", "minimum_chrome_version": "39.0.2140.0", "app": { "background": { "scripts": [ "main.js" ] } }, "icons": { "128": "128.png" }, "permissions": [ "hid", { "usbDevices": [ { "vendorId": 10168, "productId": 493 } ] } ] } ================================================ FILE: _archive/apps/samples/blink1/style.css ================================================ select { margin: 2px; width: 140px; } input[type=range] { outline: none; -webkit-appearance: none; width: 140px; } input[type=range]::-webkit-slider-runnable-track { transition: opacity .4s ease-in; } input[type=range]:disabled::-webkit-slider-runnable-track { opacity: 0; } ================================================ FILE: _archive/apps/samples/blink1/udev/61-blink1.rules ================================================ # Make the blink(1) accessible to plugdev via hidraw. SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="27b8", ATTRS{idProduct}=="01ed", MODE="0660", GROUP="plugdev" ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") Bluetooth Low-Energy Battery Service Demo ========================================= This sample demonstrates how an app can read the battery level of a Bluetooth Low Energy peripheral using the chrome.bluetoothLowEnergy API to communicate with the Generic Attribute Profile (GATT) based Battery Service. ## Screenshot ![screenshot](/_archive/apps/samples/bluetooth-samples/battery-service-demo/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/background.js ================================================ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('main.html', { 'innerBounds': { 'width': 620, 'height': 274, 'minWidth': 620, 'minHeight': 274, 'left': 100, 'top': 100 } }); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/main.html ================================================ Bluetooth LE Battery Service Demo
      No device with "Battery Service" selected.
      -
      ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/main.js ================================================ var main = (function() { // GATT Battery Service UUIDs var BATTERY_SERVICE_UUID = '0000180f-0000-1000-8000-00805f9b34fb'; var BATTERY_LEVEL_UUID = '00002a19-0000-1000-8000-00805f9b34fb'; function BatteryLevelDemo() { // A mapping from device addresses to device names for found devices that // expose a Battery service. this.deviceMap_ = {}; // The currently selected service and its characteristic. this.service_ = null; this.batteryLevelChrc_ = null; this.discovering_ = false; } /** * Sets up the UI for the given service by retrieving its characteristic and * setting up notifications. */ BatteryLevelDemo.prototype.selectService = function(service) { // Hide or show the appropriate elements based on whether or not // |serviceId| is undefined. UI.getInstance().resetState(!service); if (this.service_ && (!service || this.service_.deviceAddress !== service.deviceAddress)) { chrome.bluetoothLowEnergy.disconnect(this.service_.deviceAddress); } this.service_ = service; // Disable notifications from the currently selected Battery Level // characteristic. if (this.batteryLevelChrc_) { chrome.bluetoothLowEnergy.stopCharacteristicNotifications( this.batteryLevelChrc_.instanceId); } this.batteryLevelChrc_ = null; this.updateBatteryLevelValue(); // Initialize to unknown if (!service) { console.log('No service selected.'); return; } console.log('GATT service selected: ' + service.instanceId); // Get the characteristics of the selected service. var self = this; chrome.bluetoothLowEnergy.getCharacteristics(service.instanceId, function(chrcs) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same service is still selected. if (self.service_ && service.instanceId != self.service_.instanceId) { return; } if (chrcs.length == 0) { console.log('Service has no characteristics: ' + service.instanceId); return; } chrcs.forEach(function(chrc) { // This service should have only one characteristic. if (chrc.uuid != BATTERY_LEVEL_UUID) { console.log('Found unexpected characteristic: ' + chrc.instanceId + ' with UUID: ' + chrc.uuid); return; } console.log('Setting Battery Level characteristic: ' + chrc.instanceId); self.batteryLevelChrc_ = chrc; // Enable notifications from the characteristic. chrome.bluetoothLowEnergy.startCharacteristicNotifications( chrc.instanceId, function() { if (chrome.runtime.lastError && chrome.runtime.lastError.message != 'Already notifying') { console.log('Failed to enable Battery Level notifications: ' + chrome.runtime.lastError.message); return; } console.log('Battery Level notifications enabled! Sending request to ' + 'read current battery level.'); // Read the value of the characteristic once and store it. The Battery // Level characteristic must support both reads and notifications, so // we will track the value via both. chrome.bluetoothLowEnergy.readCharacteristicValue(chrc.instanceId, function(readChrc) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same characteristic is still selected. if (readChrc.instanceId != self.batteryLevelChrc_.instanceId) { return; } // No need the update the value here, as a successful read will trigger // the onCharacteristicValueChanged event. We will perform the update in // the listener instead. console.log('Request to read battery level complete.'); }); }); }); }); }; BatteryLevelDemo.prototype.updateBatteryLevelValue = function() { if (!this.batteryLevelChrc_) { console.log('No Battery Level Characteristic selected'); UI.getInstance().setBatteryLevel(null); return; } // Value field might be undefined if the read request failed or no // notification has been received yet. if (!this.batteryLevelChrc_.value) { console.log('No Battery Level value received yet'); return; } var valueBytes = new Uint8Array(this.batteryLevelChrc_.value); // The value should contain a single byte. if (valueBytes.length != 1) { console.log('Invalid Battery Level value length: ' + valueBytes.length); return; } var batteryLevel = valueBytes[0]; UI.getInstance().setBatteryLevel(batteryLevel); }; BatteryLevelDemo.prototype.updateDiscoveryToggleState = function(discovering) { if (this.discovering_ !== discovering) { this.discovering_ = discovering; UI.getInstance().setDiscoveryToggleState(this.discovering_); } }; BatteryLevelDemo.prototype.init = function() { // Set up the UI to look like no device was initially selected. this.selectService(null); // Store the |this| to be used by API callbacks below. var self = this; // Request information about the local Bluetooth adapter to be displayed in // the UI. var updateAdapterState = function(adapterState) { UI.getInstance().setAdapterState(adapterState.address, adapterState.name); self.updateDiscoveryToggleState(adapterState.discovering); }; chrome.bluetooth.getAdapterState(function(adapterState) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); } self.updateDiscoveryToggleState(adapterState.discovering); updateAdapterState(adapterState); }); chrome.bluetooth.onAdapterStateChanged.addListener(updateAdapterState); // Helper functions used below. var isKnownDevice = function(deviceAddress) { return self.deviceMap_.hasOwnProperty(deviceAddress); }; var storeDevice = function(deviceAddress, device) { var resetUI = false; if (device == null) { delete self.deviceMap_[deviceAddress]; resetUI = true; } else { self.deviceMap_[deviceAddress] = (device.name ? device.name : deviceAddress); } // Update the selector UI with the new device list. UI.getInstance().updateDeviceSelector(self.deviceMap_, resetUI); }; // Initialize the device map. chrome.bluetooth.getDevices(function(devices) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); } if (devices) { devices.forEach(function(device) { // See if the device exposes a Battery service. chrome.bluetoothLowEnergy.getServices(device.address, function(services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } if (!services) { return; } var found = false; for (var i = 0; i < services.length; i++) { if (services[i].uuid == BATTERY_SERVICE_UUID) { console.log('Found Battery service!'); found = true; break; } } if (!found) { return; } console.log('Found device with Battery service: ' + device.address); storeDevice(device.address, device); }); }); } }); // Set up discovery toggle button handler UI.getInstance().setDiscoveryToggleHandler(function() { var discoveryHandler = function() { if (chrome.runtime.lastError) { console.log('Failed to ' + (self.discovering_ ? 'stop' : 'start') + ' discovery ' + chrome.runtime.lastError.message); } }; if (self.discovering_) { chrome.bluetooth.stopDiscovery(discoveryHandler); } else { chrome.bluetooth.startDiscovery(discoveryHandler); } }); // Set up the device selector. UI.getInstance().setDeviceSelectionHandler(function(selectedValue) { // If |selectedValue| is empty, unselect everything. if (!selectedValue) { self.selectService(null); return; } chrome.bluetoothLowEnergy.connect(selectedValue, function () { if (chrome.runtime.lastError) { console.log('Failed to connect to Battery device "' + selectedValue + '" ' + chrome.runtime.lastError.message); return; } console.log('Connected to Battery device: ' + selectedValue); }); // Request all GATT services of the selected device to see if it still has // a Battery service and pick the first one to display. chrome.bluetoothLowEnergy.getServices(selectedValue, function(services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); self.selectService(undefined); return; } var foundService = null; for (var i = 0; i < services.length; i++) { if (services[i].uuid == BATTERY_SERVICE_UUID) { foundService = services[i]; break; } } self.selectService(foundService); }); }); // Track devices that get added and removed. If they have the battery service // UUID in their advertisement data, then it will be available in the // |uuids| field of the device. chrome.bluetooth.onDeviceAdded.addListener(function (device) { if (!device.uuids || device.uuids.indexOf(BATTERY_SERVICE_UUID) < 0) { return; } if (self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('Found device with Battery service: ' + device.address); self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track devices as they are removed. chrome.bluetooth.onDeviceRemoved.addListener(function (device) { if (!self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('Battery device removed: ' + device.address); delete self.deviceMap_[device.address]; if (self.service_ && self.service_.deviceAddress == device.address) { chrome.bluetoothLowEnergy.disconnect(device.address); self.selectService(undefined); UI.getInstance().triggerDeviceSelection(); } UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track GATT services as they are added. chrome.bluetoothLowEnergy.onServiceAdded.addListener(function(service) { // Ignore, if the service is not a Battery service. if (service.uuid != BATTERY_SERVICE_UUID) { return; } // If this came from the currently selected device and no service is // currently selected, select this service. if (UI.getInstance().getSelectedDeviceAddress() == service.deviceAddress && !self.service_) { self.selectService(service); } // Add the device of the service to the device map and update the UI. console.log('New Battery service added: ' + service.instanceId); if (isKnownDevice(service.deviceAddress)) { return; } // Looks like it's a brand new device. Get information about the device so // that we can display the device name in the drop-down menu. chrome.bluetooth.getDevice(service.deviceAddress, function(device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } storeDevice(device.address, device); }); }); // Track GATT services as they are removed. chrome.bluetoothLowEnergy.onServiceRemoved.addListener(function(service) { // Ignore, if the service is not a Battery service. if (service.uuid != BATTERY_SERVICE_UUID) { return; } // See if this is the currently selected service. If so, unselect it. console.log('Battery service removed: ' + service.instanceId); var selectedRemoved = false; if (self.service_ && self.service_.instanceId == service.instanceId) { console.log('The selected service disappeared!'); self.selectService(null); selectedRemoved = true; } // Remove the associated device from the map only if it has no other Battery // services exposed (this will usually be the case) if (!isKnownDevice(service.deviceAddress)) { return; } chrome.bluetooth.getDevice(service.deviceAddress, function(device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } chrome.bluetoothLowEnergy.getServices(device.address, function(services) { if (chrome.runtime.lastError) { // Error obtaining services. Remove the device from the map. console.log(chrome.runtime.lastError.message); storeDevice(device.address, null); return; } var found = false; for (var i = 0; i < services.length; i++) { if (services[i].uuid == BATTERY_SERVICE_UUID) { found = true; break; } } if (found) { return; } console.log('Removing device: ' + device.address); storeDevice(device.address, null); }); }); }); // Track GATT services as they change. chrome.bluetoothLowEnergy.onServiceChanged.addListener(function(service) { // This only matters if the selected service changed. if (!self.service_ || service.instanceId != self.service_.instanceId) { return; } console.log('The selected service has changed'); // Reselect the service to force an updated. self.selectService(service); }); // Track GATT characteristic value changes. This event will be triggered after // successful characteristic value reads and received notifications and // indications. chrome.bluetoothLowEnergy.onCharacteristicValueChanged.addListener( function(chrc) { if (self.batteryLevelChrc_ && chrc.instanceId == self.batteryLevelChrc_.instanceId) { console.log('Battery Level value changed'); self.batteryLevelChrc_ = chrc; self.updateBatteryLevelValue(); return; } }); }; return { BatteryLevelDemo: BatteryLevelDemo }; })(); document.addEventListener('DOMContentLoaded', function() { var demo = new main.BatteryLevelDemo(); demo.init(); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/manifest.json ================================================ { "name": "Battery Service Demo", "description": "Battery Service Demo using chrome.bluetoothLowEnergy", "version": "0.1", "minimum_chrome_version": "37", "icons": { "16": "bluetooth.png", "48": "bluetooth.png", "128": "bluetooth.png" }, "app": { "background": { "scripts": ["background.js"] } }, "bluetooth": { "low_energy": true, "uuids": ["180f"] } } ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/style.css ================================================ body { margin: 0; overflow: hidden; height: 274px; } #header { padding: 10px 15px 5px 15px; background: #fafafa; box-shadow: 0 0 5px #858585; } #header img { width: 50px; } #header h1 { font-family: 'DejaVu Sans Light', Verdana, sans-serif; font-weight: normal; vertical-align: top; display: inline-block; margin: 8px; } #adapter-status { float: right; margin-top: 2px; } #adapter-address { font-weight: bold; } ul { padding-left: 0; margin: inherit; } ul li { list-style-type: none; } #device-selection-div { margin-top: 5px; } #device-selector { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } #discovery-toggle-button { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } hr { border: 0; height: 0; border-top: 1px solid rgba(0,0,0,0.12); border-bottom: 1px solid rgba(255,255,255,0.3); } #no-devices-error { font-size: 10pt; text-align: center; padding-top: 60px; } #info-div { position: relative; margin: auto; width: 185px; height: 80px; top: 15%; } .battery { z-index: -1; position: relative; width: 97%; height: 100%; border: 7px solid black; box-sizing: border-box; } .battery .level { position: absolute; height: 100%; } .battery .level.high { background-color: green; } .battery .level.medium { background-color: orange; } .battery .level.low { background-color: red; } .battery-tip { position: absolute; left: 97%; background-color: black; width: 3%; height: 30%; top: 35%; } #battery-level { position: absolute; width: 100%; height: 100%; text-align: center; color: black; font-size: 3em; padding-top: 3% } ================================================ FILE: _archive/apps/samples/bluetooth-samples/battery-service-demo/ui.js ================================================ var UI = (function() { // Common functions used for tweaking UI elements. function UI() { } // Global instance. var instance; UI.prototype.resetState = function(noDevices) { document.getElementById('no-devices-error').hidden = !noDevices; document.getElementById('info-div').hidden = noDevices; this.clearAllFields(); }; UI.prototype.clearAllFields = function() { this.setBatteryLevel(null); }; UI.prototype.setBatteryLevel = function(level) { var levelField = document.getElementById('battery-level'); var value = (level == null) ? '-' : level + ' %'; levelField.innerHTML = ''; levelField.appendChild(document.createTextNode(value)); var batteryBox = document.getElementById('battery-level-box'); if (level == null) { batteryBox.style.width = '0%'; return; } var levelClass; if (level > 65) { levelClass = 'high'; } else if (level > 30) { levelClass = 'medium'; } else { levelClass = 'low'; } batteryBox.className = 'level ' + levelClass; batteryBox.style.width = level + '%'; }; UI.prototype.setDiscoveryToggleState = function(isDiscoverying) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); if (isDiscoverying) { discoveryToggleButton.innerHTML = 'stop discovery'; } else { discoveryToggleButton.innerHTML = 'start discovery'; } }; UI.prototype.setDiscoveryToggleHandler = function(handler) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); discoveryToggleButton.onclick = handler; }; UI.prototype.setDeviceSelectionHandler = function(handler) { var deviceSelector = document.getElementById('device-selector'); deviceSelector.onchange = function() { handler(deviceSelector[deviceSelector.selectedIndex].value); }; }; UI.prototype.triggerDeviceSelection = function() { var deviceSelector = document.getElementById('device-selector'); if (deviceSelector.onchange) deviceSelector.onchange(); }; UI.prototype.getSelectedDeviceAddress = function() { var deviceSelector = document.getElementById('device-selector'); return deviceSelector[deviceSelector.selectedIndex].value; }; UI.prototype.updateDeviceSelector = function(deviceMap, reset) { var deviceSelector = document.getElementById('device-selector'); var placeHolder = document.getElementById('placeholder'); var addresses = Object.keys(deviceMap); reset = (reset !== undefined) ? reset : false; deviceSelector.innerHTML = ''; placeHolder.innerHTML = ''; deviceSelector.appendChild(placeHolder); // Clear the drop-down menu. if (addresses.length == 0) { console.log('No connected devices found'); placeHolder.appendChild(document.createTextNode('No connected devices')); return; } // Hide the placeholder and populate placeHolder.appendChild(document.createTextNode('Connected devices found')); for (var i = 0; i < addresses.length; i++) { var address = addresses[i]; var deviceOption = document.createElement('option'); deviceOption.setAttribute('value', address); deviceOption.appendChild(document.createTextNode( deviceMap[address])); deviceSelector.appendChild(deviceOption); } if (reset) deviceSelector.selectedIndex = 0; }; UI.prototype.setAdapterState = function(address, name) { var addressField = document.getElementById('adapter-address'); var nameField = document.getElementById('adapter-name'); var setAdapterField = function (field, value) { field.innerHTML = ''; field.appendChild(document.createTextNode(value)); }; setAdapterField(addressField, address ? address : 'unknown'); setAdapterField(nameField, name ? name : 'Local Adapter'); }; return { getInstance: function() { if (!instance) { instance = new UI(); } return instance; } }; })(); ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") Bluetooth Low-Energy Device Information Service Demo ==================================================== This sample demonstrates how an app can communicate with the GATT based Device Information Service on a Bluetooth Low Energy peripheral using the chrome.bluetoothLowEnergy API. ## Screenshot ![screenshot](/_archive/apps/samples/bluetooth-samples/device-info-demo/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/background.js ================================================ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('main.html', { 'innerBounds': { 'width': 635, 'height': 370, 'minWidth': 635, 'minHeight': 370, 'left': 100, 'top': 100 } }); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/main.html ================================================ Bluetooth LE Device Information Service Demo
      No device with "Device Information Service" selected.
      Manufacturer Name: -
      Serial Number: -
      Hardware Revision: -
      Firmware Revision: -
      Software Revision: -
      Vendor ID Source: -
      Vendor ID: -
      Product ID: -
      Product Version: -
      ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/main.js ================================================ var main = (function() { // GATT Device Information Service UUIDs var DEVICE_INFO_SERVICE_UUID = '0000180a-0000-1000-8000-00805f9b34fb'; var MANUFACTURER_NAME_STRING_UUID = '00002a29-0000-1000-8000-00805f9b34fb'; var SERIAL_NUMBER_STRING_UUID = '00002a25-0000-1000-8000-00805f9b34fb'; var HARDWARE_REVISION_STRING_UUID = '00002a27-0000-1000-8000-00805f9b34fb'; var FIRMWARE_REVISION_STRING_UUID = '00002a26-0000-1000-8000-00805f9b34fb'; var SOFTWARE_REVISION_STRING_UUID = '00002a28-0000-1000-8000-00805f9b34fb'; var PNP_ID_UUID = '00002a50-0000-1000-8000-00805f9b34fb'; function DeviceInfoDemo() { // A mapping from device addresses to device names for found devices that // expose a Battery service. this.deviceMap_ = {}; // The currently selected service and its characteristics. this.service_ = null; this.chrcMap_ = {}; this.discovering_ = false; } /** * Sets up the UI for the given service. */ DeviceInfoDemo.prototype.selectService = function(service) { // Hide or show the appropriate elements based on whether or not // |serviceId| is undefined. UI.getInstance().resetState(!service); if (this.service_ && (!service || this.service_.deviceAddress !== service.deviceAddress)) { chrome.bluetoothLowEnergy.disconnect(this.service_.deviceAddress); } this.service_ = service; this.chrcMap_ = {}; if (!service) { console.log('No service selected.'); return; } console.log('GATT service selected: ' + service.instanceId); // Get the characteristics of the selected service. var self = this; chrome.bluetoothLowEnergy.getCharacteristics(service.instanceId, function (chrcs) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same service is still selected. if (self.service_ && service.instanceId != self.service_.instanceId) { return; } if (chrcs.length == 0) { console.log('Service has no characteristics: ' + service.instanceId); return; } chrcs.forEach(function (chrc) { var fieldId; var valueDisplayFunction = UI.getInstance().setStringValue; if (chrc.uuid == MANUFACTURER_NAME_STRING_UUID) { console.log('Setting Manufacturer Name String Characteristic: ' + chrc.instanceId); fieldId = 'manufacturer-name-string'; } else if (chrc.uuid == SERIAL_NUMBER_STRING_UUID) { console.log('Setting Serial Number String Characteristic: ' + chrc.instanceId); fieldId = 'serial-number-string'; } else if (chrc.uuid == HARDWARE_REVISION_STRING_UUID) { console.log('Setting Hardware Revision String Characteristic: ' + chrc.instanceId); fieldId = 'hardware-revision-string'; } else if (chrc.uuid == FIRMWARE_REVISION_STRING_UUID) { console.log('Setting Firmware Revision String Characteristic: ' + chrc.instanceId); fieldId = 'firmware-revision-string'; } else if (chrc.uuid == SOFTWARE_REVISION_STRING_UUID) { console.log('Setting Software Revision String Characteristic: ' + chrc.instanceId); fieldId = 'software-revision-string'; } else if (chrc.uuid == PNP_ID_UUID) { console.log('Setting PnP ID Characteristic: ' + chrc.instanceId); fieldId = 'pnp-id'; valueDisplayFunction = UI.getInstance().setPnpIdValue; } if (fieldId === undefined) { console.log('Ignoring characteristic "' + chrc.instanceId + '" with UUID ' + chrc.uuid); return; } self.chrcMap_[fieldId] = chrc; // Read the value of the characteristic and store it. chrome.bluetoothLowEnergy.readCharacteristicValue(chrc.instanceId, function (readChrc) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same characteristic is still selected. if (!self.chrcMap_.hasOwnProperty(fieldId) || self.chrcMap_[fieldId].instanceId != readChrc.instanceId) return; self.chrcMap_[fieldId] = readChrc; valueDisplayFunction(fieldId, readChrc.value); }); }); }); }; DeviceInfoDemo.prototype.updateDiscoveryToggleState = function(discovering) { if (this.discovering_ !== discovering) { this.discovering_ = discovering; UI.getInstance().setDiscoveryToggleState(this.discovering_); } }; DeviceInfoDemo.prototype.init = function() { // Set up the UI to look like no device was initially selected. this.selectService(null); // Store the |this| to be used by API callbacks below. var self = this; // Request information about the local Bluetooth adapter to be displayed in // the UI. var updateAdapterState = function(adapterState) { UI.getInstance().setAdapterState(adapterState.address, adapterState.name); self.updateDiscoveryToggleState(adapterState.discovering); }; chrome.bluetooth.getAdapterState(function (adapterState) { if (chrome.runtime.lastError) console.log(chrome.runtime.lastError.message); self.updateDiscoveryToggleState(adapterState.discovering); updateAdapterState(adapterState); }); chrome.bluetooth.onAdapterStateChanged.addListener(updateAdapterState); // Helper functions used below. var isKnownDevice = function(deviceAddress) { return self.deviceMap_.hasOwnProperty(deviceAddress); }; var storeDevice = function(deviceAddress, device) { var resetUI = false; if (device == null) { delete self.deviceMap_[deviceAddress]; resetUI = true; } else { self.deviceMap_[deviceAddress] = (device.name ? device.name : deviceAddress); } // Update the selector UI with the new device list. UI.getInstance().updateDeviceSelector(self.deviceMap_, resetUI); }; // Initialize the device map. chrome.bluetooth.getDevices(function (devices) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); } if (devices) { devices.forEach(function (device) { // See if the device exposes a Device Information service. chrome.bluetoothLowEnergy.getServices(device.address, function (services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } if (!services) return; var found = false; services.forEach(function (service) { if (service.uuid == DEVICE_INFO_SERVICE_UUID) { console.log('Found Device Information service!'); found = true; } }); if (!found) return; console.log('Found device with Device Information service: ' + device.address); storeDevice(device.address, device); }); }); } }); // Set up discovery toggle button handler UI.getInstance().setDiscoveryToggleHandler(function() { var discoveryHandler = function() { if (chrome.runtime.lastError) { console.log('Failed to ' + (self.discovering_ ? 'stop' : 'start') + ' discovery ' + chrome.runtime.lastError.message); } }; if (self.discovering_) { chrome.bluetooth.stopDiscovery(discoveryHandler); } else { chrome.bluetooth.startDiscovery(discoveryHandler); } }); // Set up the device selector. UI.getInstance().setDeviceSelectionHandler(function(selectedValue) { // If |selectedValue| is empty, unselect everything. if (!selectedValue) { self.selectService(null); return; } chrome.bluetoothLowEnergy.connect(selectedValue, function () { if (chrome.runtime.lastError) { console.log('Failed to connect to Battery device "' + selectedValue + '" ' + chrome.runtime.lastError.message); return; } console.log('Connected to Battery device: ' + selectedValue); }); // Request all GATT services of the selected device to see if it still has // a Device Information service and pick the first one to display. chrome.bluetoothLowEnergy.getServices(selectedValue, function (services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); self.selectService(null); return; } var foundService = null; services.forEach(function (service) { if (service.uuid == DEVICE_INFO_SERVICE_UUID) foundService = service; }); self.selectService(foundService); }); }); // Track devices that get added and removed. If they have the device info // service UUID in their advertisement data, then it will be available in // the |uuids| field of the device. chrome.bluetooth.onDeviceAdded.addListener(function (device) { if (!device.uuids || device.uuids.indexOf(DEVICE_INFO_SERVICE_UUID) < 0) { return; } if (self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('Found device with Device Info service: ' + device.address); self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track devices as they are removed. chrome.bluetooth.onDeviceRemoved.addListener(function (device) { if (!self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('Device Info device removed: ' + device.address); delete self.deviceMap_[device.address]; if (self.service_ && self.service_.deviceAddress == device.address) { chrome.bluetoothLowEnergy.disconnect(device.address); self.selectService(undefined); UI.getInstance().triggerDeviceSelection(); } UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track GATT services as they are added. chrome.bluetoothLowEnergy.onServiceAdded.addListener(function (service) { // Ignore, if the service is not a Device Information service. if (service.uuid != DEVICE_INFO_SERVICE_UUID) return; // If this came from the currently selected device and no service is // currently selected, select this service. if (UI.getInstance().getSelectedDeviceAddress() == service.deviceAddress && !self.service_) { self.selectService(service); } // Add the device of the service to the device map and update the UI. console.log('New Device Information service added: ' + service.instanceId); if (isKnownDevice(service.deviceAddress)) return; // Looks like it's a brand new device. Get information about the device so // that we can display the device name in the drop-down menu. chrome.bluetooth.getDevice(service.deviceAddress, function (device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } storeDevice(device.address, device); }); }); // Track GATT services as they are removed. chrome.bluetoothLowEnergy.onServiceRemoved.addListener(function (service) { // Ignore, if the service is not a Device Information service. if (service.uuid != DEVICE_INFO_SERVICE_UUID) return; // See if this is the currently selected service. If so, unselect it. console.log('Device Information service removed: ' + service.instanceId); var selectedRemoved = false; if (self.service_ && self.service_.instanceId == service.instanceId) { console.log('The selected service disappeared!'); self.selectService(null); selectedRemoved = true; } // Remove the associated device from the map only if it has no other Device // Information services exposed (this will usually be the case) if (!isKnownDevice(service.deviceAddress)) { return; } chrome.bluetooth.getDevice(service.deviceAddress, function (device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } chrome.bluetoothLowEnergy.getServices(device.address, function (services) { if (chrome.runtime.lastError) { // Error obtaining services. Remove the device from the map. console.log(chrome.runtime.lastError.message); storeDevice(device.address, null); return; } var found = false; for (var i = 0; i < services.length; i++) { if (services[i].uuid == DEVICE_INFO_SERVICE_UUID) { found = true; break; } } if (found) { return; } console.log('Removing device: ' + device.address); storeDevice(device.address, null); }); }); }); // Track GATT services as they change. chrome.bluetoothLowEnergy.onServiceChanged.addListener(function (service) { // This only matters if the selected service changed. if (!self.service_ || service.instanceId != self.service_.instanceId) { return; } console.log('The selected service has changed'); // Reselect the service to force an updated. self.selectService(service); }); }; return { DeviceInfoDemo: DeviceInfoDemo }; })(); document.addEventListener('DOMContentLoaded', function() { var demo = new main.DeviceInfoDemo(); demo.init(); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/manifest.json ================================================ { "name": "Device Information Service Demo", "description": "Device Information Demo using chrome.bluetoothLowEnergy", "version": "0.3", "minimum_chrome_version": "37", "icons": { "16": "bluetooth.png", "48": "bluetooth.png", "128": "bluetooth.png" }, "app": { "background": { "scripts": ["background.js"] } }, "bluetooth": { "low_energy": true, "uuids": ["180a"] } } ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/style.css ================================================ body { margin: 0; overflow: hidden; } #header { padding: 10px 15px 5px 15px; background: #fafafa; box-shadow: 0 0 5px #858585; } #header img { width: 50px; } #header h1 { font-family: 'DejaVu Sans Light', Verdana, sans-serif; font-weight: normal; vertical-align: top; display: inline-block; margin: 8px; white-space: nowrap; overflow: hidden; } #adapter-status { float: right; margin-top: 2px; } #adapter-address { font-weight: bold; } ul { padding-left: 0; margin: inherit; } ul li { list-style-type: none; } #device-selection-div { margin-top: 5px; } #device-selector { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } #discovery-toggle-button { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } hr { border: 0; height: 0; border-top: 1px solid rgba(0,0,0,0.12); border-bottom: 1px solid rgba(255,255,255,0.3); } #no-devices-error { font-size: 10pt; text-align: center; padding-top: 15%; } #info-div { height: 245px; box-sizing: border-box; margin: 10px; padding: 10px; box-shadow: 0 0 4px rgba(0, 0, 0, 0.65); overflow-y: scroll; overflow-x: hidden; word-break: break-all; color: #333; } .device-info-field { margin-bottom: 6px; font-weight: bold; } div.device-info-field span { font-style: italic; font-weight: normal; } ================================================ FILE: _archive/apps/samples/bluetooth-samples/device-info-demo/ui.js ================================================ var UI = (function() { // Common functions used for tweaking UI elements. function UI() { } // Global instance. var instance; UI.prototype.resetState = function(noDevices) { document.getElementById('no-devices-error').hidden = !noDevices; document.getElementById('info-div').hidden = noDevices; this.clearAllFields(); }; UI.prototype.clearAllFields = function() { setFieldValue('manufacturer-name-string', null); setFieldValue('serial-number-string', null); setFieldValue('hardware-revision-string', null); setFieldValue('firmware-revision-string', null); setFieldValue('software-revision-string', null); setFieldValue('vendor-id-source', null); setFieldValue('vendor-id', null); setFieldValue('product-id', null); setFieldValue('product-version', null); }; UI.prototype.setStringValue = function(id, buffer) { if (!buffer) { setFieldValue(id, null); return; } var valueString = String.fromCharCode.apply(null, new Uint8Array(buffer)); setFieldValue(id, valueString); }; UI.prototype.setPnpIdValue = function(id, buffer) { var vendorIdSource = null; var vendorId = null; var productId = null; var productVersion = null; var setPnpValues = function() { setFieldValue('vendor-id-source', vendorIdSource); setFieldValue('vendor-id', vendorId); setFieldValue('product-id', productId); setFieldValue('product-version', productVersion); }; if (!buffer) { setPnpValues(); return; } var valueBytes = new Uint8Array(buffer); if (valueBytes.length != 7) { setPnpValues(); return; } var vendorIdSource = valueBytes[0]; var vendorId = valueBytes[1] | valueBytes[2] << 8; var productId = valueBytes[3] | valueBytes[4] << 8; var productVersion = valueBytes[5] | valueBytes[6] << 8; setPnpValues(); }; UI.prototype.setDiscoveryToggleState = function(isDiscoverying) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); if (isDiscoverying) { discoveryToggleButton.innerHTML = 'stop discovery'; } else { discoveryToggleButton.innerHTML = 'start discovery'; } }; UI.prototype.setDiscoveryToggleHandler = function(handler) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); discoveryToggleButton.onclick = handler; }; UI.prototype.setDeviceSelectionHandler = function(handler) { var deviceSelector = document.getElementById('device-selector'); deviceSelector.onchange = function() { handler(deviceSelector[deviceSelector.selectedIndex].value); }; }; UI.prototype.triggerDeviceSelection = function() { var deviceSelector = document.getElementById('device-selector'); if (deviceSelector.onchange) deviceSelector.onchange(); }; UI.prototype.getSelectedDeviceAddress = function() { var deviceSelector = document.getElementById('device-selector'); return deviceSelector[deviceSelector.selectedIndex].value; }; UI.prototype.updateDeviceSelector = function(deviceMap, reset) { var deviceSelector = document.getElementById('device-selector'); var placeHolder = document.getElementById('placeholder'); var addresses = Object.keys(deviceMap); reset = (reset !== undefined) ? reset : false; deviceSelector.innerHTML = ''; placeHolder.innerHTML = ''; deviceSelector.appendChild(placeHolder); // Clear the drop-down menu. if (addresses.length == 0) { console.log('No connected devices found'); placeHolder.appendChild(document.createTextNode('No connected devices')); return; } // Hide the placeholder and populate placeHolder.appendChild(document.createTextNode('Connected devices found')); for (var i = 0; i < addresses.length; i++) { var address = addresses[i]; var deviceOption = document.createElement('option'); deviceOption.setAttribute('value', address); deviceOption.appendChild(document.createTextNode( deviceMap[address])); deviceSelector.appendChild(deviceOption); } if (reset) deviceSelector.selectedIndex = 0; }; UI.prototype.setAdapterState = function(address, name) { var addressField = document.getElementById('adapter-address'); var nameField = document.getElementById('adapter-name'); var setAdapterField = function (field, value) { field.innerHTML = ''; field.appendChild(document.createTextNode(value)); }; setAdapterField(addressField, address ? address : 'unknown'); setAdapterField(nameField, name ? name : 'Local Adapter'); }; // private methods: function setFieldValue(id, value) { var div = document.getElementById(id); div.innerHTML = ''; div.appendChild( document.createTextNode((value == null) ? '-' : value)); } return { getInstance: function() { if (!instance) { instance = new UI(); } return instance; } }; })(); ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") Low-Energy Heart Rate Sensor ============================ This sample demonstrates using the chrome.bluetoothLowEnergy API to communicate with the Generic Attribute Profile (GATT) based Heart Rate Service on a Bluetooth Low Energy heart rate sensor. ## Screenshot ![screenshot](/_archive/apps/samples/bluetooth-samples/heart-rate-sensor/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/background.js ================================================ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('main.html', { 'innerBounds': { 'width': 620, 'height': 274, 'minWidth': 620, 'minHeight': 274, 'left': 100, 'top': 100 } }); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/main.html ================================================ Bluetooth LE Heart Rate Monitor
      No Heart Rate device selected
      -
      heart icon
      Sensor Contact Status: -
      Energy Expanded: - kJ
      RR-Interval: - s
      Body Sensor Location: -
      ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/main.js ================================================ var main = (function() { // GATT Heart Rate Service UUIDs var HEART_RATE_SERVICE_UUID = '0000180d-0000-1000-8000-00805f9b34fb'; var HEART_RATE_MEASUREMENT_UUID = '00002a37-0000-1000-8000-00805f9b34fb'; var BODY_SENSOR_LOCATION_UUID = '00002a38-0000-1000-8000-00805f9b34fb'; var HEART_RATE_CONTROL_POINT_UUID = '00002a39-0000-1000-8000-00805f9b34fb'; function HeartRateSensor() { // A mapping from device addresses to device names for found devices that // expose a Heart Rate service. this.deviceMap_ = {}; // The currenty selected service and its characteristics. this.service_ = null; this.measurementChrc_ = null; this.energyExpandedChrc_ = null; this.bodySensorLocChrc_ = null; this.controlPointChrc_ = null; this.discovering_ = false; } /** * Sets up the UI for the given service by retrieving the initial values of * all relevant characteristics and performing other necessary set up. */ HeartRateSensor.prototype.selectService = function(service) { // Hide or show the appropriate elements based on whether or not // |serviceId| is undefined. UI.getInstance().resetState(!service); if (this.service_ && (!service || this.service_.deviceAddress !== service.deviceAddress)) { chrome.bluetoothLowEnergy.disconnect(this.service_.deviceAddress); } this.service_ = service; // Disable notifications from the currently selected Heart Rate Measurement // characteristic if (this.measurementChrc_) { chrome.bluetoothLowEnergy.stopCharacteristicNotifications( this.measurementChrc_.instanceId); } this.measurementChrc_ = null; this.bodySensorLocChrc_ = null; this.controlPointChrc_ = null; this.energyExpandedChrc_ = null; if (!service) { console.log('No service selected.'); return; } console.log('GATT service selected: ' + service.instanceId); // Get the characteristics of the selected service. var self = this; chrome.bluetoothLowEnergy.getCharacteristics(service.instanceId, function (chrcs) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same service is still selected. if (service.instanceId != self.service_.instanceId) { return; } if (chrcs.length == 0) { console.log('Service has no characteristics: ' + service.instanceId); return; } chrcs.forEach(function (chrc) { if (chrc.uuid == HEART_RATE_MEASUREMENT_UUID) { console.log('Setting Heart Rate Measurement Characteristic: ' + chrc.instanceId); self.measurementChrc_ = chrc; self.updateHeartRateMeasurementValue(); // Enable notifications from the characteristic. chrome.bluetoothLowEnergy.startCharacteristicNotifications( chrc.instanceId, function () { if (chrome.runtime.lastError) { console.log( 'Failed to enable Heart Rate Measurement notifications: ' + chrome.runtime.lastError.message); return; } console.log('Heart Rate Measurement notifications enabled!'); }); return; } if (chrc.uuid == BODY_SENSOR_LOCATION_UUID) { console.log('Setting Body Sensor Location Characteristic: ' + chrc.instanceId); self.bodySensorLocChrc_ = chrc; // Read the value of the characteristic once and store it. chrome.bluetoothLowEnergy.readCharacteristicValue( chrc.instanceId, function (readChrc) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } // Make sure that the same characteristic is still selected. if (readChrc.instanceId != self.bodySensorLocChrc_.instanceId) { return; } self.bodySensorLocChrc_ = readChrc; self.updateBodySensorLocationValue(); }); return; } if (chrc.uuid == HEART_RATE_CONTROL_POINT_UUID) { console.log('Setting Heart Rate Control Point Characteristic: ' + chrc.instanceId); self.controlPointChrc_ = chrc; UI.getInstance().setResetButtonEnabled(true); return; } }); }); }; HeartRateSensor.prototype.updateHeartRateMeasurementValue = function() { if (!this.measurementChrc_) { console.log('No Heart Rate Measurement Characteristic selected'); return; } // The Heart Rate Measurement Characteristic does not allow 'read' // operations and its value can only be obtained via notifications, so the // |value| field might be undefined here. if (!this.measurementChrc_.value) { console.log('No Heart Rate Measurement value received yet'); return; } var valueBytes = new Uint8Array(this.measurementChrc_.value); if (valueBytes.length < 2) { console.log('Invalid Heart Rate Measurement value'); return; } // The first byte is the flags field. var flags = valueBytes[0]; // The least significant bit is the Heart Rate Value format. If 0, the heart // rate measurement is expressed in the next byte of the value. If 1, it is // a 16 bit value expressed in the next two bytes of the value. var hrFormat = flags & 0x01; // The next two bits is the Sensor Contact Status. var sensorContactStatus = (flags >> 1) & 0x03; // The next bit is the Energy Expanded Status. If 1, the Energy Expanded // field is present in the characteristic value. var eeStatus = (flags >> 3) & 0x01; // The next bit is the RR-Interval bit. If 1, RR-Interval values are // present. var rrBit = (flags >> 4) & 0x01; var heartRateMeasurement; var energyExpanded; var rrInterval; var minLength = hrFormat == 1 ? 3 : 2; if (valueBytes.length < minLength) { console.log('Invalid Heart Rate Measurement value'); return; } if (hrFormat == 0) { console.log('8-bit Heart Rate format'); heartRateMeasurement = valueBytes[1]; } else { console.log('16-bit Heart Rate format'); heartRateMeasurement = valueBytes[1] | (valueBytes[2] << 8); } var nextByte = minLength; if (eeStatus == 1) { if (valueBytes.length < nextByte + 2) { console.log('Invalid value for "Energy Expanded"'); return; } console.log('Energy Expanded field present'); energyExpanded = valueBytes[nextByte] | (valueBytes[nextByte + 1] << 8); nextByte += 2; } if (rrBit == 1) { if (valueBytes.length < nextByte + 2) { console.log('Invalid value for "RR-Interval"'); return; } console.log('RR-Interval field present'); // Note: According to the specification, there can be several RR-Interval // values in a characteristic value, however we're just picking the first // one here for demo purposes. rrInterval = valueBytes[nextByte] | (valueBytes[nextByte + 1] << 8); } UI.getInstance().setHeartRateMeasurement(heartRateMeasurement); UI.getInstance().setSensorContactStatus((function() { switch (sensorContactStatus) { case 0: case 1: return 'not supported'; case 2: return 'contact not detected'; case 3: return 'contact detected'; default: return; } })()); if (energyExpanded !== undefined) { this.energyExpandedChrc_ = energyExpanded; } UI.getInstance().setEnergyExpanded(this.energyExpandedChrc_); UI.getInstance().setRRInterval(rrInterval); }; HeartRateSensor.prototype.updateBodySensorLocationValue = function() { if (!this.bodySensorLocChrc_) { console.log('No Body Sensor Location Characteristic selected'); return; } // Since this function is called after a read request, the value should be // present if the read was successful but it may be undefined if the read // failed, so check here. if (!this.bodySensorLocChrc_.value) { console.log('No Body Sensor Location has been read'); return; } var valueBytes = new Uint8Array(this.bodySensorLocChrc_.value); if (valueBytes.length != 1) { console.log('Invalid Body Sensor Location value'); return; } var bodySensorLocation = (function () { switch (valueBytes[0]) { case 0: return 'Other'; case 1: return 'Chest'; case 2: return 'Wrist'; case 3: return 'Finger'; case 4: return 'Hand'; case 5: return 'Ear Lobe'; case 6: return 'Foot'; default: return; } })(); UI.getInstance().setBodySensorLocation(bodySensorLocation); }; HeartRateSensor.prototype.resetEnergyExpanded = function() { if (!this.controlPointChrc_) { console.log('No Heart Rate Control Point characteristic selected'); return; } var writeValue = new ArrayBuffer(1); var writeBytes = new Uint8Array(writeValue); writeBytes[0] = 1; // '1' indicates a 'reset' command. chrome.bluetoothLowEnergy.writeCharacteristicValue( this.controlPointChrc_.instanceId, writeValue, function () { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } console.log('Heart Rate Control Point Characteristic written!'); }); }; HeartRateSensor.prototype.updateDiscoveryToggleState = function(discovering) { if (this.discovering_ !== discovering) { this.discovering_ = discovering; UI.getInstance().setDiscoveryToggleState(this.discovering_); } }; HeartRateSensor.prototype.init = function() { // Set up the UI to look like no device was initially selected. this.selectService(undefined); var self = this; // Request information about the local Bluetooth adapter to be displayed in // the UI. var updateAdapterState = function(adapterState) { UI.getInstance().setAdapterState(adapterState.address, adapterState.name); self.updateDiscoveryToggleState(adapterState.discovering); }; chrome.bluetooth.getAdapterState(function (adapterState) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); } self.updateDiscoveryToggleState(adapterState.discovering); updateAdapterState(adapterState); }); chrome.bluetooth.onAdapterStateChanged.addListener(updateAdapterState); // Initialize the device map. chrome.bluetooth.getDevices(function (devices) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); } if (devices) { devices.forEach(function (device) { if (device.uuids && device.uuids.indexOf(HEART_RATE_SERVICE_UUID) > -1) { if (!self.deviceMap_.hasOwnProperty(device.address)) { self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); } return; } // See if the device exposes a Heart Rate service. chrome.bluetoothLowEnergy.getServices(device.address, function (services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } if (!services) { return; } var found = false; services.forEach(function (service) { if (service.uuid == HEART_RATE_SERVICE_UUID) { console.log('Found Heart Rate service!'); found = true; } }); if (!found) { return; } if (!self.deviceMap_.hasOwnProperty(device.address)) { console.log('Found device with Heart Rate service: ' + device.address); self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); } }); }); } }); // Set up discovery toggle button handler UI.getInstance().setDiscoveryToggleHandler(function() { var discoveryHandler = function() { if (chrome.runtime.lastError) { console.log('Failed to ' + (self.discovering_ ? 'stop' : 'start') + ' discovery ' + chrome.runtime.lastError.message); } }; if (self.discovering_) { chrome.bluetooth.stopDiscovery(discoveryHandler); } else { chrome.bluetooth.startDiscovery(discoveryHandler); } }); // Set up the device selector. UI.getInstance().setDeviceSelectionHandler(function (selectedValue) { // If |selectedValue| is empty, unselect everything. if (!selectedValue) { self.selectService(undefined); return; } chrome.bluetoothLowEnergy.connect(selectedValue, function () { if (chrome.runtime.lastError) { console.log('Failed to connect to HR device "' + selectedValue + '" ' + chrome.runtime.lastError.message); return; } console.log('Connected to HR device: ' + selectedValue); }); // Request all GATT services of the selected device to see if it still has // a Heart Rate service and pick the first Heart Rate service to display. chrome.bluetoothLowEnergy.getServices(selectedValue, function (services) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); self.selectService(undefined); return; } var foundService = undefined; services.forEach(function (service) { if (service.uuid == HEART_RATE_SERVICE_UUID) { foundService = service; } }); self.selectService(foundService); }); }); // Set up the "Reset Energy Expanded" button action. UI.getInstance().setResetEnergyExpandedHandler(function() { self.resetEnergyExpanded(); }); // Track devices that get added and removed. If they have the heart rate // UUID in their advertisement data, then it will be available in the // |uuids| field of the device. chrome.bluetooth.onDeviceAdded.addListener(function (device) { if (!device.uuids || device.uuids.indexOf(HEART_RATE_SERVICE_UUID) < 0) { return; } if (self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('Found device with HR service: ' + device.address); self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track devices as they are removed. chrome.bluetooth.onDeviceRemoved.addListener(function (device) { if (!self.deviceMap_.hasOwnProperty(device.address)) { return; } console.log('HR device removed: ' + device.address); delete self.deviceMap_[device.address]; if (self.service_ && self.service_.deviceAddress == device.address) { chrome.bluetoothLowEnergy.disconnect(device.address); self.selectService(undefined); UI.getInstance().triggerDeviceSelection(); } UI.getInstance().updateDeviceSelector(self.deviceMap_); }); // Track GATT services as they are added. chrome.bluetoothLowEnergy.onServiceAdded.addListener(function (service) { // Ignore, if the service is not a Heart Rate service. if (service.uuid != HEART_RATE_SERVICE_UUID) { return; } // If this came from the currently selected device and no service is // currently selected, select this service. if (UI.getInstance().getSelectedDeviceAddress() == service.deviceAddress && !self.service_) { self.selectService(service); } // Add the device of the service to the device map and update the UI. console.log('New Heart Rate service added: ' + service.instanceId); if (self.deviceMap_.hasOwnProperty(service.deviceAddress)) { return; } // Looks like it's a brand new device. Get information about the device so // that we can display the device name in the drop-down menu. chrome.bluetooth.getDevice(service.deviceAddress, function (device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } self.deviceMap_[device.address] = (device.name ? device.name : device.address); UI.getInstance().updateDeviceSelector(self.deviceMap_); }); }); // Track GATT services as they are removed. chrome.bluetoothLowEnergy.onServiceRemoved.addListener(function (service) { // Ignore, if the service is not a Heart Rate service. if (service.uuid != HEART_RATE_SERVICE_UUID) { return; } // See if this is the currently selected service. If so, unselect it. console.log('Heart Rate service removed: ' + service.instanceId); var selectedRemoved = false; if (self.service_ && self.service_.instanceId == service.instanceId) { console.log('The selected service disappeared!'); self.selectService(undefined); selectedRemoved = true; UI.getInstance().updateDeviceSelector(self.deviceMap_, true /* reset */); } // Remove the associated device from the map only if it no longer lists // the Heart Rate UUID. if (!self.deviceMap_.hasOwnProperty(service.deviceAddress)) { return; } chrome.bluetooth.getDevice(service.deviceAddress, function (device) { if (chrome.runtime.lastError) { console.log(chrome.runtime.lastError.message); return; } if (!device.uuids || device.uuids.indexOf(HEART_RATE_SERVICE_UUID) < 0) { console.log('Removing device: ' + device.address); delete self.deviceMap_[device.address]; UI.getInstance().updateDeviceSelector(self.deviceMap_); } if (selectedRemoved) { UI.getInstance().triggerDeviceSelection(); } }); }); // Track GATT services as they change. chrome.bluetoothLowEnergy.onServiceChanged.addListener(function (service) { // This only matters if the selected service changed. if (!self.service_ || service.instanceId != self.service_.instanceId) { return; } console.log('The selected service has changed'); // Reselect the service to force an updated. self.selectService(service); }); // Track GATT characteristic value changes. This event will be triggered // after successful characteristic value reads and received notifications // and indications. chrome.bluetoothLowEnergy.onCharacteristicValueChanged.addListener( function (chrc) { if (self.measurementChrc_ && chrc.instanceId == self.measurementChrc_.instanceId) { console.log('Heart Rate Measurement value changed'); self.measurementChrc_ = chrc; self.updateHeartRateMeasurementValue(); return; } }); }; return { HeartRateSensor: HeartRateSensor }; })(); document.addEventListener('DOMContentLoaded', function() { var sensor = new main.HeartRateSensor(); sensor.init(); }); ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/manifest.json ================================================ { "name": "Heart Rate Service Demo", "description": "Heart Rate Monitor Demo using chrome.bluetoothLowEnergy", "version": "0.1", "minimum_chrome_version": "37", "icons": { "16": "hr_sensor_icon16.png", "48": "hr_sensor_icon48.png", "128": "hr_sensor_icon128.png" }, "app": { "background": { "scripts": ["background.js"] } }, "bluetooth": { "low_energy": true, "uuids": ["180d"] } } ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/style.css ================================================ body { margin: 0; overflow: hidden; } #header { padding: 10px 15px 5px 15px; background: #fafafa; box-shadow: 0 0 5px #858585; margin-bottom: 20px; } #header img { width: 50px; } #header h1 { font-family: 'DejaVu Sans Light', Verdana, sans-serif; font-weight: normal; vertical-align: top; display: inline-block; margin: 8px; } #adapter-status { float: right; margin-top: 2px; } #adapter-address { font-weight: bold; } ul { padding-left: 0; margin: inherit; } ul li { list-style-type: none; } #device-selection-div { margin-top: 5px; } #device-selector { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } #discovery-toggle-button { background: transparent; border: 1px solid #aaa; color: #454545; font-style: italic; } hr { border: 0; height: 0; border-top: 1px solid rgba(0,0,0,0.12); border-bottom: 1px solid rgba(255,255,255,0.3); } #no-devices-error { font-size: 10pt; text-align: center; padding-top: 7%; } #heart-rate-bpm { float: left; height: 136px; line-height: 136px; width: 50%; text-align: center; font-size: 35px; color: #ff0000; } #heart { position: relative; display: inline-block; width: 40px; height: 40px; top: 5%; left: -10px; } #heart img { position: absolute; width: 50%; height: 50%; top: 25%; left: 25%; } .blink-animation { -webkit-animation: blink 1s linear infinite; } @-webkit-keyframes "blink" { 0% { opacity: 1; } 33% { opacity: 1; } 66% { opacity: 0; } 100% { opacity: 0; } } #heart-rate-fields { float: right; width: 48%; margin-right: 2%; box-sizing: border-box; padding: 10px; box-shadow: 0 0 4px rgba(0, 0, 0, 0.65); } .heart-rate-field { margin-bottom: 5px; } div.heart-rate-field span { font-style: italic; color: #333; } ================================================ FILE: _archive/apps/samples/bluetooth-samples/heart-rate-sensor/ui.js ================================================ var UI = (function() { // Common functions used for tweaking UI elements. function UI() { } // Global instance. var instance; UI.prototype.resetState = function(noDevices) { document.getElementById('no-devices-error').hidden = !noDevices; document.getElementById('info-div').hidden = noDevices; this.clearAllFields(); }; UI.prototype.clearAllFields = function() { this.setHeartRateMeasurement(null); this.setSensorContactStatus(null); this.setEnergyExpanded(null); this.setRRInterval(null); this.setBodySensorLocation(null); this.setResetButtonEnabled(false); }; UI.prototype.setHeartRateMeasurement = function(value) { setFieldValue('heart-rate-measurement', value); }; UI.prototype.setSensorContactStatus = function(value) { setFieldValue('sensor-contact-status', value); }; UI.prototype.setEnergyExpanded = function(value) { setFieldValue('energy-expanded', value); }; UI.prototype.setRRInterval = function(value) { setFieldValue('rr-interval', value); }; UI.prototype.setBodySensorLocation = function(value) { setFieldValue('body-sensor-location', value); }; UI.prototype.setResetButtonEnabled = function(enabled) { document.getElementById('heart-rate-control-point').disabled = !enabled; }; UI.prototype.setResetEnergyExpandedHandler = function(handler) { document.getElementById('heart-rate-control-point').onclick = handler; }; UI.prototype.setDiscoveryToggleState = function(isDiscoverying) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); if (isDiscoverying) { discoveryToggleButton.innerHTML = 'stop discovery'; } else { discoveryToggleButton.innerHTML = 'start discovery'; } }; UI.prototype.setDiscoveryToggleHandler = function(handler) { var discoveryToggleButton = document.getElementById('discovery-toggle-button'); discoveryToggleButton.onclick = handler; }; UI.prototype.setDeviceSelectionHandler = function(handler) { var deviceSelector = document.getElementById('device-selector'); deviceSelector.onchange = function() { handler(deviceSelector[deviceSelector.selectedIndex].value); }; }; UI.prototype.triggerDeviceSelection = function() { var deviceSelector = document.getElementById('device-selector'); if (deviceSelector.onchange) deviceSelector.onchange(); }; UI.prototype.getSelectedDeviceAddress = function() { var deviceSelector = document.getElementById('device-selector'); return deviceSelector[deviceSelector.selectedIndex].value; }; UI.prototype.updateDeviceSelector = function(deviceMap, reset) { var deviceSelector = document.getElementById('device-selector'); var placeHolder = document.getElementById('placeholder'); var addresses = Object.keys(deviceMap); reset = (reset !== undefined) ? reset : false; deviceSelector.innerHTML = ''; placeHolder.innerHTML = ''; deviceSelector.appendChild(placeHolder); // Clear the drop-down menu. if (addresses.length == 0) { console.log('No heart rate devices found'); placeHolder.appendChild(document.createTextNode('No HR devices found')); return; } // Hide the placeholder and populate placeHolder.appendChild(document.createTextNode('HR devices found')); for (var i = 0; i < addresses.length; i++) { var address = addresses[i]; var deviceOption = document.createElement('option'); deviceOption.setAttribute('value', address); deviceOption.appendChild(document.createTextNode( deviceMap[address])); deviceSelector.appendChild(deviceOption); } if (reset) deviceSelector.selectedIndex = 0; }; UI.prototype.setAdapterState = function(address, name) { var addressField = document.getElementById('adapter-address'); var nameField = document.getElementById('adapter-name'); var setAdapterField = function (field, value) { field.innerHTML = ''; field.appendChild(document.createTextNode(value)); }; setAdapterField(addressField, address ? address : 'unknown'); setAdapterField(nameField, name ? name : 'Local Adapter'); }; // private methods: function setFieldValue(id, value) { var div = document.getElementById(id); div.innerHTML = ''; div.appendChild( document.createTextNode((value == null) ? '-' : value)); } return { getInstance: function() { if (!instance) { instance = new UI(); } return instance; } }; })(); ================================================ FILE: _archive/apps/samples/calculator/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Calculator A sample application that provides a simple calculator. Supports basic operations such as addition, multiplication, subtraction and division. This sample also incorporates an MVC-style structure and requires jQuery for DOM manipulation. ## APIs * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/calculator/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/calculator/calculator.html ================================================ Calculator
      AC
      +/-
      ÷
      7
      8
      9
      4
      5
      6
      1
      2
      3
      0
      .
      ×
      +
      =
      ================================================ FILE: _archive/apps/samples/calculator/controller.js ================================================ $(document).ready(function () { new View(new Calculator()); }); ================================================ FILE: _archive/apps/samples/calculator/main.js ================================================ /** * Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. **/ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('calculator.html', { id: "calcWinID", innerBounds: { width: 244, height: 380, minWidth: 244, minHeight: 380 } }); }); ================================================ FILE: _archive/apps/samples/calculator/manifest.json ================================================ { "name": "Calculator", "description": "A simple calculator.", "manifest_version": 2, "minimum_chrome_version": "23", "version": "1.2", "offline_enabled": true, "app": { "background": { "scripts": ["main.js"] } }, "permissions" : [ "clipboardWrite" ], "icons": { "16": "assets/icon-128x128.png", "128": "assets/icon-128x128.png" } } ================================================ FILE: _archive/apps/samples/calculator/model.js ================================================ function Calculator() { this.operatorNeedsReset = true; this.operandNeedsReset = true; this.accumulatorNeedsReset = true; this.decimal = -1; this.ResetRegisters(); } Calculator.prototype.DoOperation = function() { switch (this.operator) { case '+': this.accumulator += this.operand; break; case '-': this.accumulator -= this.operand; break; case '/': this.accumulator /= this.operand; break; case '*': this.accumulator *= this.operand; break; default: this.accumulator = this.operand; break; } return this.accumulator; } Calculator.prototype.SendAccumulatorByUDP = function() { var calcResult = this.accumulator; } Calculator.prototype.ResetRegisters = function() { if (this.operatorNeedsReset) { this.operatorNeedsReset = false; this.operator = null; } if (this.operandNeedsReset) { this.operandNeedsReset = false; this.operand = 0; this.decimal = -1; } if (this.accumulatorNeedsReset) { this.accumulatorNeedsReset = false; this.accumulator = 0; } } Calculator.prototype.HandleButtonClick = function(buttonValue) { var result; switch (buttonValue) { case '+': case '-': case '/': case '*': this.decimal = -1; if (this.operatorNeedsReset) { this.operatorNeedsReset = false; this.operator = null; this.operand = this.accumulator; } this.operandNeedsReset = true; result = this.DoOperation(); this.operator = buttonValue; break; case '=': this.decimal = -1; this.operandNeedsReset = true; this.operatorNeedsReset = true; this.DoOperation(); this.SendAccumulatorByUDP(); break; case 'AC': this.decimal = -1; this.accumulatorNeedsReset = true; this.operandNeedsReset = true; this.operatorNeedsReset = true; this.ResetRegisters(); break; case '.': if (this.decimal < 0) this.decimal = 0; this.operand = parseFloat(this.operand); result = this.operand; break; case '+ / -': this.operand *= -1; break; case 'back': this.accumulatorNeedsReset = false; this.ResetRegisters(); if (this.operand == 0) { this.operator = 'back'; this.operatorNeedsReset = true; } else { var operandStr = this.operand + ''; operandStr = operandStr.slice(0, operandStr.length - 1); if (operandStr == '') this.operand = 0; else this.operand = parseFloat(operandStr); } break; default: this.ResetRegisters(); if (this.decimal >= 0) { this.decimal += 1; this.operand += ( Math.pow(10, -1 * this.decimal) * parseInt(buttonValue)); } else { this.operand *= 10; this.operand += parseInt(buttonValue); } result = this.operand; break; } if (result == null) { result = this.accumulator; } var rstr_len = (result + '').length; if ((result >= 0 && rstr_len > 8) || (result < 0 && rstr_len > 9)) { result = 'Overflow'; } return [this.operator, this.operand, this.accumulator]; } ================================================ FILE: _archive/apps/samples/calculator/sample_support_metadata.json ================================================ { "sample": "calculator", "files_with_snippets": [ ], "android": {"works": true, "comments": "Visual issues caused by fixed-size layout"}, "ios": {"works": true, "comments": "Visual issues caused by fixed-size layout"} } ================================================ FILE: _archive/apps/samples/calculator/style.css ================================================ html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } body { margin: 0px; padding: 0px; width: 100%; height: 100%; font: bold 16px 'Open Sans', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; font-weight: 700; } ::-webkit-scrollbar { display: none; } ::-webkit-scrollbar-thumb { display: none; } #calc { background-color: #fff; border: 0; margin: 0; padding: 0px; display: flex; flex-direction: column; height: 100%; } #calc #display, #calc #display:focus { flex: 1 1 100%; border: none; letter-spacing: 1px; line-height: 20px; margin: 0px; min-width: 204px; overflow: scroll; padding: 20px; width: calc( 100% - 40px ); } .edge-top { height: 5px; width: 100%; z-index: 99; position: absolute; background: #fff; } .edge { background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); height: 20px; position: absolute; top: 5px; width: 100%; z-index: 99; } .equation { width: 100%; position: relative; clear: both; height: 22px; } .equation .operator { color: #2c2c2c; width: 15px; float: right; padding-right: 5px; height: 22px; line-height: 16px; padding-top: 3px; padding-bottom: 3px; } .equation .operand { color: #2c2c2c; float: right; max-width: 80px; text-align: right; overflow: hidden; height: 16px; line-height: 16px; padding-top: 3px; padding-bottom: 3px; } .equation .accumulator { color: #888; float: left; font-size: 13px; width: 85px; max-width: 80px; text-align: left; overflow: hidden; height: 13px; line-height: 13px; padding-top: 6px; padding-bottom: 3px; } #display .hr { width: 100%; height: 0px; border-top: 1px solid #d9d9d9; position: relative; } #calc #buttons { flex: 1 1 100%; height: 244px; width: 100%; min-height: 225px; min-width: 244px; } .button-row { display: flex; flex-direction: row; flex-wrap: nowrap; flex: 1 1 100%; } .button-column { display: flex; flex-direction: column; flex-wrap: nowrap; flex: 1 1 100%; } .calc-button { display: inline-flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; text-align: center; color: rgb(202, 202, 202); background: linear-gradient(#4B4B4B, #424242); box-shadow: inset 1px 1px 0 #636363, inset -1px -1px 0 #141414; text-shadow: 1px 1px #222; flex: 1 1 100%; } .calc-button:active, .calc-button.active { background: linear-gradient(#424242, #4B4B4B); box-shadow: inset 1px 1px 0 #141414, inset -1px -1px 0 #636363; } .calc-button.big { font-size: 24px; } .calc-button.AC { } .calc-button.plus-minus { } .calc-button.div { } .calc-button.mult { } .calc-button.plus { } .calc-button.minus { } .calc-button.one { } .calc-button.two { } .calc-button.three { } .calc-button.four { } .calc-button.five { } .calc-button.six { } .calc-button.seven { } .calc-button.eight { } .calc-button.nine { } .calc-button.equals { flex: 2 1 200%; background: linear-gradient(#6BA0FF, #2C76F8); box-shadow: inset 1px 1px 0 #84ACF5, inset -1px -1px 0 #175EDA; } .calc-button.equals:active, .calc-button.equals.active { background: linear-gradient(#2C76F8, #6BA0FF); box-shadow: inset 1px 1px 0 #175EDA, inset -1px -1px 0 #84ACF5; } .calc-button.zero { } .calc-button.point { } ================================================ FILE: _archive/apps/samples/calculator/tests/calculator_test.html ================================================ Calculator Chrome App

      Calculator Tests

        ================================================ FILE: _archive/apps/samples/calculator/tests/calculator_test.js ================================================ $(document).ready(function() { module("Initialize and Reset Registers"); test("Basic Initialization", function() { var calculator = new Calculator(); ok(!calculator.operatorNeedsReset); equal(calculator.operator, null); equal(calculator.decimal, -1); ok(!calculator.operandNeedsReset); ok(!calculator.accumulatorNeedsReset); equal(calculator.operand, 0); equal(calculator.accumulator, 0); }); test("Reset Operator", function() { var calculator = new Calculator(); calculator.operator = '+'; calculator.operatorNeedsReset = true; calculator.ResetRegisters(); ok(!calculator.operatorNeedsReset); equal(calculator.operator, null); }); test("Reset Operand", function() { var calculator = new Calculator(); calculator.operand = 50; calculator.decimal = -5; calculator.operandNeedsReset = true; calculator.ResetRegisters(); ok(!calculator.operatorNeedsReset); equal(calculator.operator, null); equal(calculator.decimal, -1); }); test("Reset Accumulator", function() { var calculator = new Calculator(); calculator.accumulator = 50; calculator.accumulatorNeedsReset = true; calculator.ResetRegisters(); ok(!calculator.accumulatorNeedsReset); equal(calculator.accumulator, 0); }); module("Do Operations"); test("Plus", function() { var calculator = new Calculator(); calculator.operator = '+'; equal(calculator.accumulator, 0); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, 5); calculator.operand = -3; calculator.DoOperation(); equal(calculator.accumulator, 2); calculator.operand = -2; calculator.DoOperation(); equal(calculator.accumulator, 0); calculator.operand = -1; calculator.DoOperation(); equal(calculator.accumulator, -1); calculator.operand = 3; calculator.DoOperation(); equal(calculator.accumulator, 2); calculator.operand = 0; calculator.DoOperation(); equal(calculator.accumulator, 2); }); test("Minus", function() { var calculator = new Calculator(); calculator.operator = '-'; equal(calculator.accumulator, 0); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, -5); calculator.operand = -3; calculator.DoOperation(); equal(calculator.accumulator, -2); calculator.operand = -2; calculator.DoOperation(); equal(calculator.accumulator, 0); calculator.operand = -1; calculator.DoOperation(); equal(calculator.accumulator, 1); calculator.operand = 3; calculator.DoOperation(); equal(calculator.accumulator, -2); calculator.operand = 0; calculator.DoOperation(); equal(calculator.accumulator, -2); }); test("Multiplication", function() { var calculator = new Calculator(); calculator.operator = '*'; equal(calculator.accumulator, 0); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, 0); calculator.accumulator = 1; equal(calculator.accumulator, 1); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, 5); calculator.operand = -2; calculator.DoOperation(); equal(calculator.accumulator, -10); calculator.operand = 1.5; calculator.DoOperation(); equal(calculator.accumulator, -15); calculator.operand = -1; calculator.DoOperation(); equal(calculator.accumulator, 15); calculator.operand = 0; calculator.DoOperation(); equal(calculator.accumulator, 0); }); test("Division", function() { var calculator = new Calculator(); calculator.operator = '/'; equal(calculator.accumulator, 0); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, 0); calculator.accumulator = 1; equal(calculator.accumulator, 1); calculator.operand = 5; calculator.DoOperation(); equal(calculator.accumulator, 0.2); calculator.operand = -2; calculator.DoOperation(); equal(calculator.accumulator, -0.1); calculator.operand = 0.1; calculator.DoOperation(); equal(calculator.accumulator, -1); calculator.operand = -1; calculator.DoOperation(); equal(calculator.accumulator, 1); calculator.operand = 0; calculator.DoOperation(); equal(calculator.accumulator, 'Infinity'); }); }); ================================================ FILE: _archive/apps/samples/calculator/view.js ================================================ var operators = ['+', '-', '/', '*']; var values = { 'one' : 1, 'two' : 2, 'three' : 3, 'four' : 4, 'five' : 5, 'six' : 6, 'seven' : 7, 'eight' : 8, 'nine' : 9, 'zero' : 0, 'plus' : '+', 'minus' : '-', 'div' : '/', 'mult' : '*', 'equals': '=', 'point' : '.', 'AC' : 'AC', 'plus-minus' : '+ / -' }; var keyboard = { 49 : 1, 50 : 2, 51 : 3, 52 : 4, 53 : 5, 54 : 6, 55 : 7, 56 : 8, 57 : 9, 48 : 0, 187 : '=', 13 : '=', 190 : '.', 189 : '-', 191 : '/', 65 : 'AC', // a 67 : 'AC', // c 8 : 'back', 97 : 1, // numberpad 98 : 2, 99 : 3, 100 : 4, 101 : 5, 102 : 6, 103 : 7, 104 : 8, 105 : 9, 96 : 0, 110 : '.', 109 : '-', 111 : '/', 107 : '+', 106 : '*' }; var shiftKeyboard = { 187 : '+', 56 : '*' }; var shift = false; function View(calcModel) { this.calcElement = $('#calc'); this.buttonsElement = $('#buttons'); this.displayElement = $('#display'); this.lastDisplayElement = null; this.BuildWidgets(); var calc = this; Array.prototype.forEach.call(document.querySelectorAll('.calc-button'), function(button) { var handler = function(e) { e.preventDefault(); var clicked = values[e.target.classList[1]]; var result = calcModel.HandleButtonClick(clicked); calc.buttonClicked(clicked, result); }; button.addEventListener('touchstart', handler); button.addEventListener('click', handler); button.addEventListener('touchstart', function(e) { e.target.classList.add('active'); }); button.addEventListener('touchend', function(e) { e.target.classList.remove('active'); }); }); window.addEventListener("copy", function(e) { var result = calcModel.accumulator; e.preventDefault(); e.clipboardData.setData("text/plain",result); }); $(document).keydown(function(event) { if (event.ctrlKey && event.keyCode == 67) { return; } var clicked = null; if (event.which == 16) shift = true; else if (shift && event.which in shiftKeyboard) clicked = shiftKeyboard[event.which]; else if (!shift && event.which in keyboard) clicked = keyboard[event.which]; if (clicked != null) { var result = calcModel.HandleButtonClick(clicked); calc.buttonClicked(clicked, result); } }); $(document).keyup(function(event) { if (event.which == 16) shift = false; }); } function displayNumber(number) { var digits = (number + '').length; if ((number >= 0 && digits > 8) || (number < 0 && digits > 9)) { if (number % 1 != 0) { number = parseFloat((number + '').slice(0, 8)); if (number % 1 != 0) return number; } var pow = (number + '').length - 1; var extra_length = (pow + '').length + 2; number = number * Math.pow(10, -1*pow); number = (number + '').slice(0, 8 - extra_length) + 'e' + pow; } return number; } View.prototype.buttonClicked = function(clicked, result) { var operator = result[0]; var operand = displayNumber(result[1]); var accumulator = displayNumber(result[2]); if (clicked == 'AC') { this.displayElement.text(''); this.AddDisplayEquation('', 0, ''); } else if (clicked == 'back' && operator == 'back') { this.UpdateDisplayEquation('', '', ''); } else if (operators.indexOf(clicked) != -1) { if (this.lastDisplayElement) this.UpdateTotal(accumulator); operand = ''; accumulator = ''; this.AddDisplayEquation(operator, operand, accumulator); } else if (clicked == '=') { this.displayElement.append('
        '); this.AddDisplayEquation('', accumulator, accumulator); this.lastDisplayElement = null; } else if (clicked == '+ / -') { this.UpdateDisplayEquation(operator, operand, ''); } else if (this.lastDisplayElement) { accumulator = ''; this.UpdateDisplayEquation(operator, operand, accumulator); } else { accumulator = ''; operator = ''; this.AddDisplayEquation(operator, operand, accumulator); } } View.prototype.BuildWidgets = function() { // this.AddButtons(this.calcElement); this.AddDisplayEquation('', 0, ''); } View.prototype.UpdateTotal = function(accumulator) { $(this.lastDisplayElement).children('.accumulator').text(accumulator); } View.prototype.AddDisplayEquation = function(operator, operand, accumulator) { this.displayElement.append( '
        ' + '
        ' + operand + '
        ' + '
        ' + operator + '
        ' + '
        ' + accumulator + ''); this.lastDisplayElement = $('.equation').last(); this.displayElement.scrollTop(this.displayElement[0].scrollHeight); } View.prototype.UpdateDisplayEquation = function(operator, operand, accumulator) { $(this.lastDisplayElement).children('.operator').text(operator); $(this.lastDisplayElement).children('.operand').text(operand); $(this.lastDisplayElement).children('.accumulator').text(accumulator); this.displayElement.scrollTop(this.displayElement[0].scrollHeight); } ================================================ FILE: _archive/apps/samples/camera-capture/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Camera Capture Shows how to grab a camera feed using getUserMedia. Requires the `videoCapture` permissions to be set in the manifest file. ## APIs * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) * [videoCapture](https://developer.chrome.com/apps/declare_permissions) ## Screenshot ![screenshot](/_archive/apps/samples/camera-capture/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/camera-capture/app.js ================================================ /* Copyright 2012 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Author: Eric Bidelman (ericbidelman@chromium.org) */ /** * Grabs the camera feed from the browser, requesting * video from the selected device. Requires the permissions * for videoCapture to be set in the manifest. * * @see http://developer.chrome.com/apps/manifest#permissions */ var curStream = null; // keep track of current stream function getCamera() { var cameraSrcId = document.querySelector('select').value; // constraints allow us to select a specific video source var constraints = { video: { optional: [{ sourceId: cameraSrcId }] }, audio:false } navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia navigator.getUserMedia(constraints, function(stream) { var videoElm = document.querySelector('video'); videoElm.src = URL.createObjectURL(stream); stream.onended = function() { updateButtonState(); } videoElm.onplay = function() { if(curStream !== null) { // stop previous stream curStream.stop(); } curStream = stream; updateButtonState(); } }, function(e) { curStream = null; console.error(e); }); } /** * Click handler to init the camera grab */ document.querySelector('button').addEventListener('click', function(e) { // camera is active, stop stream if(curStream && curStream.active) { curStream.stop(); document.querySelector('video').src = ""; } else { getCamera(); } }); /** * Change stream source according to dropdown selection */ document.querySelector('select').addEventListener('change',function() { if(curStream && curStream.active) { getCamera(); } }); /** * Updates button state according to Camera stream status */ function updateButtonState() { var btn = document.querySelector('button'); btn.disabled = false; if((!curStream) || (!curStream.active)) { btn.innerHTML = "Enable Camera"; } else { btn.innerHTML = "Disable Camera"; } } /** * Populate camera sources drop down */ getVideoSources(function(cameras){ var ddl = document.querySelector('select'); if(cameras.length == 1) { // if only 1 camera is found drop down can be disabled ddl.disabled = true; } cameras.forEach(function(camera){ var opt = document.createElement('option'); opt.value = camera.id; opt.appendChild(document.createTextNode(camera.label)); ddl.appendChild(opt); }); }); /** * This retrieves video sources and passes them to callback parameter */ function getVideoSources(callback) { var videoSources = []; callback = callback || function(){}; MediaStreamTrack.getSources(function(sources){ sources.forEach(function(source,index){ if(source.kind === 'video') { // we only need to enlist video sources videoSources.push({ id: source.id, label: source.label || 'Camera '+(videoSources.length+1) }); } }); callback(videoSources); }); } ================================================ FILE: _archive/apps/samples/camera-capture/background.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "camCaptureID", innerBounds: { width: 700, height: 600 } }); }); ================================================ FILE: _archive/apps/samples/camera-capture/index.html ================================================

        ================================================ FILE: _archive/apps/samples/camera-capture/manifest.json ================================================ { "name": "Camera Capture Sample", "version": "2.2", "manifest_version": 2, "icons": { "16": "camera.png", "128": "camera.png" }, "app": { "background": { "scripts": ["background.js"] } }, "permissions": [ "videoCapture" ] } ================================================ FILE: _archive/apps/samples/clock/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Clock A widget-like application that provides a world clock, an alarm, a timer and a stopwatch. ## APIs * [Sync Storage API](http://developer.chrome.com/apps/storage) * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/clock/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/clock/alarm.js ================================================ Alarm = function(id, name, hour, minute, on) { this.id = id; this.name = name; this.hour = hour; this.minute = minute; this.on = on; this.displayed = false; this.alarm_time = new Date(); this.alarm_time.setHours(hour); this.alarm_time.setMinutes(minute); } //Alarm inherits from Clock Alarm.prototype = new Clock(this.id, 0); //Method to initialize the alarm Alarm.prototype.create = function() { this.canvas = $('.alarm .' + this.id + ' .clock')[0]; this.canvas.height = this.config.container.height; this.canvas.width = this.config.container.width; this.context = this.canvas.getContext("2d"); this.startTick(); } //Method to update the alarm Alarm.prototype.update = function(name, hour, minute) { this.name = name; this.hour = hour; this.minute = minute; this.drawClock(this.hour, this.minute, 0); this.displayTime(this.hour, this.minute, false); } //Method to draw the number Alarm.prototype.drawText = function(hour, minute, second) { for (var i = 0; i < 12; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (i/12) - 0.5)); this.context.translate(this.config.face.radius - 24, 0); this.context.rotate((Math.PI * (2.0 * (i/12) - 0.5) * -1)); var alpha = this.config.unit.major.alpha; if (i === 0) var textValue = 12; else var textValue = i; this.context.globalAlpha = alpha; this.context.fillStyle = this.config.unit.major.color; this.context.shadowOffsetX = 1; this.context.shadowOffsetY = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.8)"; this.context.font = "500 13px 'Open Sans'"; this.context.textBaseline = 'middle'; this.context.textAlign = "center"; this.context.fillText(textValue, 0, 0); this.context.restore(); } } //Method to fire each second and redraw the clock Alarm.prototype.tick = function() { this.drawClock(this.hour, this.minute, 0); this.displayTime(this.hour, this.minute, false); var now = new Date(); if (this.on && now.getHours() == this.hour && now.getMinutes() == this.minute && !this.displayed) { new Notification(name, { icon: 'img/alarm.png' }); this.displayed = true; } else { this.displayed = false; } } Alarm.prototype.toggleState = function() { this.on = !this.on; return this.on; } ================================================ FILE: _archive/apps/samples/clock/clock.js ================================================ Clock = function(id, offset) { this.config = { container: {height: 240, width: 240}, face: {color: '#424240', alpha: 1, radius: 120}, hourHand: {color: '#4d90fe', alpha: 1, length: 70, width: 4}, minuteHand: {color: '#4d90fe', alpha: 1, length: 90, width: 4}, unit: { major: {color: '#f5f5f5', alpha: 0.4, length: 8, width: 6}, mid: {color: '#f5f5f5', alpha: 0.4, length: 8, width: 4}, minor: {color: '#f5f5f5', alpha: 0.4, length: 8, width: 2} } }; this.tickId; this.offset = offset; this.id = id; } //Method to initialize the clock Clock.prototype.create = function(ctx) { if (ctx) { this.context = ctx; } else { this.canvas = $('.world .' + this.id + ' .clock')[0]; this.canvas.height = this.config.container.height; this.canvas.width = this.config.container.width; this.context = this.canvas.getContext("2d"); } this.startTick(); } //Methods to draw the clock Clock.prototype.drawClock = function (hour, minute, second) { this.context.clearRect(0, 0, this.config.container.width, this.config.container.height); this.drawface(); this.drawUnits(); this.innerShadow(); this.drawText(hour, minute, second); this.drawHands(hour, minute, second); } //Method to draw the clocks face Clock.prototype.drawface = function () { this.context.save(); this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 1; this.context.shadowBlur = 1; this.context.shadowColor = "rgba(255, 255, 255, 1)"; this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, this.config.face.radius, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.face.color; this.context.fill(); this.context.restore(); } //Method to draw an inner shadow on the clock face Clock.prototype.innerShadow = function() { this.context.save(); this.context.strokeStyle = "rgba(0, 0, 0, 0.3)"; this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 1; this.context.shadowBlur = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.3)"; this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, this.config.face.radius, Math.PI, 0); this.context.stroke(); this.context.restore(); } //Method to draw the hands Clock.prototype.drawHands = function(hour, minute, second) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (((hour%12)*5 + minute/12.0)/60) - 0.5)); this.context.globalAlpha = this.config.hourHand.alpha; this.context.strokeStyle = this.config.hourHand.color; this.context.lineWidth = this.config.hourHand.width; this.context.lineCap = "round"; this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 4; this.context.shadowBlur = 2; this.context.shadowColor = "rgba(0, 0, 0, 0.2)"; this.context.beginPath(); this.context.moveTo(-8, 0); this.context.lineTo(this.config.hourHand.length - 5, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); this.context.save(); this.context.translate(this.config.container.width/2,this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * ((minute + (second/60.0))/60) - 0.5)); this.context.globalAlpha = this.config.minuteHand.alpha; this.context.strokeStyle = this.config.minuteHand.color; this.context.lineWidth = this.config.minuteHand.width; this.context.lineCap = "round"; this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 4; this.context.shadowBlur = 2; this.context.shadowColor = "rgba(0, 0, 0, 0.2)"; this.context.beginPath(); this.context.moveTo(-8, 0); this.context.lineTo(this.config.minuteHand.length - 5, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, 4, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.minuteHand.color; this.context.fill(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, 1, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.unit.major.color; this.context.fill(); this.context.restore(); } //Method to draw the number Clock.prototype.drawText = function(hour, minute, second) { for (var i = 0; i < 12; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (i/12) - 0.5)); this.context.translate(this.config.face.radius - 24, 0); this.context.rotate((Math.PI * (2.0 * (i/12) - 0.5) * -1)); var alpha = this.config.unit.major.alpha; if (i === 0) j = 11; else j = i - 1; var textValue = ''; if ((hour % 12) === i) { alpha += (1-this.config.unit.major.alpha); if (i === 0) textValue = 12; else textValue = i; } this.context.globalAlpha = alpha; this.context.fillStyle = this.config.unit.major.color; this.context.shadowOffsetX = 1; this.context.shadowOffsetY = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.8)"; this.context.font = "500 13px 'Open Sans'"; this.context.textBaseline = 'middle'; this.context.textAlign = "center"; this.context.fillText(textValue, 0, 0); this.context.restore(); } } //Method to draw the units Clock.prototype.drawUnits = function() { for (var i = 0; i < 60; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (i/60) - 0.5)); this.context.globalAlpha = this.config.unit.major.alpha; this.context.strokeStyle = this.config.unit.major.color; if (i % 5 === 0) { if (i % 15 === 0) { this.context.lineWidth = this.config.unit.major.width; var length = this.config.unit.major.length; } else { this.context.lineWidth = this.config.unit.mid.width; var length = this.config.unit.mid.length; } } else { this.context.lineWidth = this.config.unit.minor.width; var length = this.config.unit.minor.length; } this.context.beginPath(); this.context.moveTo(this.config.face.radius - length, 0); this.context.lineTo(this.config.face.radius, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); } } Clock.prototype.displayTime = function(hours, minutes, displayDay) { var day = ' • Today'; var noon = ' AM'; if (minutes < 0) { minutes += 60; hours -= 1; } else if (minutes > 59) { minutes -= 60; hours += 1; } if (minutes < 10) minutes = '0' + minutes; if (hours < 0) { day = ' • Yesterday'; hours += 24; } else if (hours >= 24) { day = ' • Tomorrow'; hours -= 24; } if (hours >= 12) noon = ' PM'; if (hours > 12) hours -= 12; if (hours == 0) hours = 12; var time = hours + ':' + minutes + noon; $('.' + this.id + ' .time').html(time); if (displayDay) $('.' + this.id + ' .day').html(day); } //Method to fire each second and redraw the clock Clock.prototype.tick = function() { var str_offset = (this.offset + '').split('.'); var hours_offset = parseInt(str_offset[0]); var minutes_offset = 0; if (str_offset.length > 1) minutes_offset = parseInt(str_offset[1]); var now = new Date(); var hours = now.getHours() + hours_offset; var minutes = now.getMinutes() + minutes_offset; var seconds = now.getSeconds(); this.drawClock(hours, minutes, seconds); this.displayTime(hours, minutes, true); } Clock.prototype.startTick = function() { var inst = this; this.tickId = setInterval(function() { inst.tick(); }, 1000); } Clock.prototype.stopTick = function() { clearInterval(tickId); } ================================================ FILE: _archive/apps/samples/clock/index.html ================================================ World Clock
        ================================================ FILE: _archive/apps/samples/clock/lib/tipTipv13/jquery.tipTip.js ================================================ /* * TipTip * Copyright 2010 Drew Wilson * www.drewwilson.com * code.drewwilson.com/entry/tiptip-jquery-plugin * * Version 1.3 - Updated: Mar. 23, 2010 * * This Plug-In will create a custom tooltip to replace the default * browser tooltip. It is extremely lightweight and very smart in * that it detects the edges of the browser window and will make sure * the tooltip stays within the current window size. As a result the * tooltip will adjust itself to be displayed above, below, to the left * or to the right depending on what is necessary to stay within the * browser window. It is completely customizable as well via CSS. * * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){ $.fn.tipTip = function(options) { var defaults = { activation: "hover", keepAlive: false, maxWidth: "200px", edgeOffset: 3, defaultPosition: "bottom", delay: 400, fadeIn: 200, fadeOut: 200, attribute: "title", content: false, // HTML or String to fill TipTIp with enter: function(){}, exit: function(){} }; var opts = $.extend(defaults, options); // Setup tip tip elements and render them to the DOM if($("#tiptip_holder").length <= 0){ var tiptip_holder = $('
        '); var tiptip_content = $('
        '); var tiptip_arrow = $('
        '); $("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
        '))); } else { var tiptip_holder = $("#tiptip_holder"); var tiptip_content = $("#tiptip_content"); var tiptip_arrow = $("#tiptip_arrow"); } return this.each(function(){ var org_elem = $(this); if(opts.content){ var org_title = opts.content; } else { var org_title = org_elem.attr(opts.attribute); } if(org_title != ""){ if(!opts.content){ org_elem.removeAttr(opts.attribute); //remove original Attribute } var timeout = false; if(opts.activation == "hover"){ org_elem.hover(function(){ active_tiptip(); }, function(){ if(!opts.keepAlive){ deactive_tiptip(); } }); if(opts.keepAlive){ tiptip_holder.hover(function(){}, function(){ deactive_tiptip(); }); } } else if(opts.activation == "focus"){ org_elem.focus(function(){ active_tiptip(); }).blur(function(){ deactive_tiptip(); }); } else if(opts.activation == "click"){ org_elem.click(function(){ active_tiptip(); return false; }).hover(function(){},function(){ if(!opts.keepAlive){ deactive_tiptip(); } }); if(opts.keepAlive){ tiptip_holder.hover(function(){}, function(){ deactive_tiptip(); }); } } function active_tiptip(){ opts.enter.call(this); tiptip_content.html(org_title); tiptip_holder.hide().removeAttr("class").css("margin","0"); tiptip_arrow.removeAttr("style"); var top = parseInt(org_elem.offset()['top']); var left = parseInt(org_elem.offset()['left']); var org_width = parseInt(org_elem.outerWidth()); var org_height = parseInt(org_elem.outerHeight()); var tip_w = tiptip_holder.outerWidth(); var tip_h = tiptip_holder.outerHeight(); var w_compare = Math.round((org_width - tip_w) / 2); var h_compare = Math.round((org_height - tip_h) / 2); var marg_left = Math.round(left + w_compare); var marg_top = Math.round(top + org_height + opts.edgeOffset); var t_class = ""; var arrow_top = ""; var arrow_left = Math.round(tip_w - 12) / 2; if(opts.defaultPosition == "bottom"){ t_class = "_bottom"; } else if(opts.defaultPosition == "top"){ t_class = "_top"; } else if(opts.defaultPosition == "left"){ t_class = "_left"; } else if(opts.defaultPosition == "right"){ t_class = "_right"; } var right_compare = (w_compare + left) < parseInt($(window).scrollLeft()); var left_compare = (tip_w + left) > parseInt($(window).width()); if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){ t_class = "_right"; arrow_top = Math.round(tip_h - 13) / 2; arrow_left = -12; marg_left = Math.round(left + org_width + opts.edgeOffset); marg_top = Math.round(top + h_compare); } else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){ t_class = "_left"; arrow_top = Math.round(tip_h - 13) / 2; arrow_left = Math.round(tip_w); marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5)); marg_top = Math.round(top + h_compare); } var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop()); var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0; if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){ if(t_class == "_top" || t_class == "_bottom"){ t_class = "_top"; } else { t_class = t_class+"_top"; } arrow_top = tip_h; marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset)); } else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){ if(t_class == "_top" || t_class == "_bottom"){ t_class = "_bottom"; } else { t_class = t_class+"_bottom"; } arrow_top = -12; marg_top = Math.round(top + org_height + opts.edgeOffset); } if(t_class == "_right_top" || t_class == "_left_top"){ marg_top = marg_top + 5; } else if(t_class == "_right_bottom" || t_class == "_left_bottom"){ marg_top = marg_top - 5; } if(t_class == "_left_top" || t_class == "_left_bottom"){ marg_left = marg_left + 5; } tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"}); tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class); if (timeout){ clearTimeout(timeout); } timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay); } function deactive_tiptip(){ opts.exit.call(this); if (timeout){ clearTimeout(timeout); } tiptip_holder.fadeOut(opts.fadeOut); } } }); } })(jQuery); ================================================ FILE: _archive/apps/samples/clock/lib/tipTipv13/jquery.tipTip.minified.js ================================================ /* * TipTip * Copyright 2010 Drew Wilson * www.drewwilson.com * code.drewwilson.com/entry/tiptip-jquery-plugin * * Version 1.3 - Updated: Mar. 23, 2010 * * This Plug-In will create a custom tooltip to replace the default * browser tooltip. It is extremely lightweight and very smart in * that it detects the edges of the browser window and will make sure * the tooltip stays within the current window size. As a result the * tooltip will adjust itself to be displayed above, below, to the left * or to the right depending on what is necessary to stay within the * browser window. It is completely customizable as well via CSS. * * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('
        ');var tiptip_content=$('
        ');var tiptip_arrow=$('
        ');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
        ')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery); ================================================ FILE: _archive/apps/samples/clock/lib/tipTipv13/tipTip.css ================================================ /* TipTip CSS - Version 1.2 */ #tiptip_holder { display: none; position: absolute; top: 0; left: 0; z-index: 99999; } #tiptip_holder.tip_top { padding-bottom: 5px; } #tiptip_holder.tip_bottom { padding-top: 5px; } #tiptip_holder.tip_right { padding-left: 5px; } #tiptip_holder.tip_left { padding-right: 5px; } #tiptip_content { font-size: 11px; color: #fff; text-shadow: 0 0 2px #000; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.25); background-color: rgb(25,25,25); background-color: rgba(25,25,25,0.92); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000)); border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; box-shadow: 0 0 3px #555; -webkit-box-shadow: 0 0 3px #555; -moz-box-shadow: 0 0 3px #555; } #tiptip_arrow, #tiptip_arrow_inner { position: absolute; border-color: transparent; border-style: solid; border-width: 6px; height: 0; width: 0; } #tiptip_holder.tip_top #tiptip_arrow { border-top-color: #fff; border-top-color: rgba(255,255,255,0.35); } #tiptip_holder.tip_bottom #tiptip_arrow { border-bottom-color: #fff; border-bottom-color: rgba(255,255,255,0.35); } #tiptip_holder.tip_right #tiptip_arrow { border-right-color: #fff; border-right-color: rgba(255,255,255,0.35); } #tiptip_holder.tip_left #tiptip_arrow { border-left-color: #fff; border-left-color: rgba(255,255,255,0.35); } #tiptip_holder.tip_top #tiptip_arrow_inner { margin-top: -7px; margin-left: -6px; border-top-color: rgb(25,25,25); border-top-color: rgba(25,25,25,0.92); } #tiptip_holder.tip_bottom #tiptip_arrow_inner { margin-top: -5px; margin-left: -6px; border-bottom-color: rgb(25,25,25); border-bottom-color: rgba(25,25,25,0.92); } #tiptip_holder.tip_right #tiptip_arrow_inner { margin-top: -6px; margin-left: -5px; border-right-color: rgb(25,25,25); border-right-color: rgba(25,25,25,0.92); } #tiptip_holder.tip_left #tiptip_arrow_inner { margin-top: -6px; margin-left: -7px; border-left-color: rgb(25,25,25); border-left-color: rgba(25,25,25,0.92); } /* Webkit Hacks */ @media screen and (-webkit-min-device-pixel-ratio:0) { #tiptip_content { padding: 4px 8px 5px 8px; background-color: rgba(45,45,45,0.88); } #tiptip_holder.tip_bottom #tiptip_arrow_inner { border-bottom-color: rgba(45,45,45,0.88); } #tiptip_holder.tip_top #tiptip_arrow_inner { border-top-color: rgba(20,20,20,0.92); } } ================================================ FILE: _archive/apps/samples/clock/main.js ================================================ /** * Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. **/ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "clockWinID", innerBounds: { height: 550, width: 800, top: 100 }, frame: 'none' }); }); ================================================ FILE: _archive/apps/samples/clock/manifest.json ================================================ { "name": "World Clock", "version": "0.1.6", "manifest_version": 2, "minimum_chrome_version": "23", "description": "A world clock application.", "icons": { "16": "assets/icon.png", "128": "assets/icon.png" }, "app": { "background": { "scripts": ["main.js"] } }, "offline_enabled": true, "permissions": ["geolocation", "storage", "notifications", "" ] } ================================================ FILE: _archive/apps/samples/clock/script.js ================================================ var local; var local_class; var clocks = {}; var alarms = {}; var alarm_clocks = {}; var base_url = 'http://api.worldweatheronline.com/free/v1/tz.ashx?key=vfc3k7q22tjedr2rxse7xzke&format=json&q='; var view = 'world'; var stopwatch; var timer; $(document).ready(function() { $('.close').click(function() { window.close(); }); $('.menu-item.world').tipTip({ edgeOffset: -5, defaultPosition: 'top' }); $('.menu-item.alarm').tipTip({ edgeOffset: -5, defaultPosition: 'top' }); $('.menu-item.timer').tipTip({ edgeOffset: -5, defaultPosition: 'top' }); $('.menu-item.stopwatch').tipTip({ edgeOffset: -5, defaultPosition: 'top' }); setInterval(function() { if (view == 'world' && !navigator.onLine) $('.menu-item.new-world').addClass('hidden'); else if (view == 'world') $('.menu-item.new-world').removeClass('hidden'); }) $('.menu-item.world').click(function() { $('.menu-item.button').addClass('hidden'); $('#container > div').addClass('hidden'); $('#container .world').removeClass('hidden'); $('.menu-item').removeClass('selected'); $('.menu-item.world').addClass('selected'); view = 'world'; if (sizeOf(clocks) == 0) $('.menu-item.new-world').click(); $('.new-world').removeClass('hidden'); }); $('.menu-item.alarm').click(function() { $('.menu-item.button').addClass('hidden'); $('#container > div').addClass('hidden'); $('#container .alarm').removeClass('hidden'); $('.menu-item').removeClass('selected'); $('.menu-item.alarm').addClass('selected'); view = 'alarm'; if (sizeOf(alarms) == 0) $('.menu-item.new-alarm').click(); $('.new-alarm').removeClass('hidden'); }); $('.menu-item.timer').click(function() { $('.menu-item.button').addClass('hidden'); $('#container > div').addClass('hidden'); $('#container .timer').removeClass('hidden'); $('.menu-item').removeClass('selected'); $('.menu-item.timer').addClass('selected'); view = 'timer'; }); $('.menu-item.stopwatch').click(function() { $('.menu-item.button').addClass('hidden'); $('#container > div').addClass('hidden'); $('#container .stopwatch').removeClass('hidden'); $('.menu-item').removeClass('selected'); $('.menu-item.stopwatch').addClass('selected'); view = 'stopwatch'; }); $('.menu-item.new-world').click(function() { openNewClock(); }); $('.menu-item.new-alarm').click(function() { openNewAlarm(); }); $('.world .new .add').click(function() { addWorldClock(); }); $('.alarm .new .add').click(function() { addAlarmClock(); }); $('#new-city').keyup(function(event) { if (event.which == 13) $('.world .new .add').click(); }); $('.world .new .cancel').click(function() { $('.world .new #new-city').val(''); $('.world .new #new-city').removeClass('form-error'); $('.new .error-message').addClass('hidden'); $('.new .error-message').html(''); $('.world .new').addClass('hidden'); resize(); }); $('.alarm .new .cancel').click(function() { $('.alarm .new #new-alarm-name').val(''); $('#new-alarm-hour').val(''); $('#new-alarm-minute').val(''); $('#new-alarm-noon').val(''); $('.alarm .new').addClass('hidden'); resize(); }); $('.alarm .edit .cancel').live('click', function() { var id = $(this).parent().attr('class').split(' ')[0]; $('.edit.' + id).addClass('hidden'); $('.info.' + id).removeClass('hidden'); $(this).parent().parent().removeClass('editing'); }); $('.alarm .edit .save').live('click', function() { var id = $(this).parent().attr('class').split(' ')[0]; editAlarmClock(id); $('.edit.' + id).addClass('hidden'); $('.info.' + id).removeClass('hidden'); $(this).parent().parent().removeClass('editing'); }); createDefaultText('00', $('#timer-minute')); createDefaultText('00', $('#timer-second')); $('#timer-minute').keyup(function() { if ($('#timer-minute').val() != '00') { $('.timer .button.start').removeClass('disabled'); } }); $('#timer-second').keyup(function() { if ($('#timer-second').val() != '00') { $('.timer .button.start').removeClass('disabled'); } }); $('.timer .button.start').click(function() { if (!$(this).hasClass('disabled')) { var minute = parseInt($('#timer-minute').val()) % 60; var second = parseInt($('#timer-second').val()) % 60; if (isNaN(minute)) { minute = 0; $('#timer-minute').val('00'); } if (isNaN(second)) { second = 0; $('#timer-second').val('00'); } timer.setWatch(minute, second); timer.startTiming(); $('.timer #timer-minute').addClass('disabled'); $('.timer #timer-second').addClass('disabled'); $('.timer .button.start').addClass('hidden'); $('.timer .button.stop').removeClass('disabled'); $('.timer .button.stop').removeClass('hidden'); $('.timer .button.reset').removeClass('disabled'); } }); $('.timer .button.stop').click(function() { timer.stopTiming(); $('.timer .button.start').removeClass('hidden'); $('.timer .button.stop').addClass('hidden'); }); $('.timer .button.reset').click(function() { $('.timer .button.start').removeClass('hidden'); $('.timer .button.stop').addClass('hidden'); $('.timer .button.start').addClass('disabled'); $('.timer .button.reset').addClass('disabled'); timer.resetWatch(); $('.timer #timer-minute').val('00'); $('.timer #timer-second').val('00'); $('.timer #timer-minute').removeClass('disabled'); $('.timer #timer-second').removeClass('disabled'); }); $('.stopwatch .button.start').click(function() { stopwatch.startTiming(); $('.stopwatch .button.start').addClass('hidden'); $('.stopwatch .button.stop').removeClass('hidden'); }); $('.stopwatch .button.stop').click(function() { stopwatch.stopTiming(); $('.stopwatch .button.start').removeClass('hidden'); $('.stopwatch .button.stop').addClass('hidden'); }); $('.stopwatch .button.reset').click(function() { stopwatch.resetWatch(); $('.stopwatch .button.start').removeClass('hidden'); $('.stopwatch .button.stop').addClass('hidden'); }); $('.delete').live('click', function() { var class_name = $(this).parent().attr('class').split(' ')[1]; $('.' + class_name).remove(); if (view == 'alarm') { var num = parseInt(class_name.slice(1)); var cur_num = sizeOf(alarms); if (cur_num === 1) { delete alarms[class_name]; delete alarm_clocks[class_name]; } else { while (cur_num > num) { var id = 'a' + cur_num; var alarm = alarms[id]; var alarm_clock = alarm_clocks[id]; delete alarms[id]; delete alarm_clocks[id]; cur_num -= 1; alarms['a' + cur_num] = alarm; alarm_clocks['a' + cur_num] = alarm_clock; $('.' + id).removeClass(id).addClass('a' + cur_num); } } } delete clocks[class_name]; chrome.storage.sync.set({ 'clocks': clocks, 'alarms': alarms }); if (sizeOf(clocks) == 0) $('.menu-item.new-world').click(); if (sizeOf(alarms) == 0) $('.menu-item.new-alarm').click(); resize(); }); $('.info').live('click', function() { $(this).parent().addClass('editing'); var id = $(this).attr('class').split(' ')[0]; var hour = parseInt(alarms[id]['hour']); var minute = parseInt(alarms[id]['minute']); var noon = 'AM'; if (hour == 12) { noon = 'PM'; } if (hour > 12) { noon = 'PM'; hour -= 12; } if (hour == 0) { hour = 12; } if (hour < 10) { hour = '0' + hour; } if (minute < 10) { minute = '0' + minute; } $('.' + id + ' .edit-alarm-name').val(alarms[id]['name']); $('.' + id + ' .edit-alarm-hour').val(hour); $('.' + id + ' .edit-alarm-minute').val(minute); $('.' + id + ' .edit-alarm-noon').val(noon); $(this).addClass('hidden'); $('.' + id + '.edit').removeClass('hidden'); }); $(window).resize(function() { resize(); }); setup(); }); function createDefaultText(default_text, $input) { $input.css('color', '#666'); $input.val(default_text); $input.focus(function() { var actual_text = $input.val(); if (actual_text == default_text) { $input.val(''); $input.css('color', '#333'); } }); $input.blur(function() { var actual_text = $input.val(); if (!actual_text) { $input.val(default_text); $input.css('color', '#666'); } }); } function openNewClock() { $('.world .new').removeClass('hidden'); $('#new-city').focus(); resize(); } function openNewAlarm() { var default_text = 'Alarm ' + (sizeOf(alarms) + 1); var $input = $('#new-alarm-name'); createDefaultText(default_text, $input); createDefaultText('00', $('#new-alarm-hour')); createDefaultText('00', $('#new-alarm-minute')); createDefaultText('AM', $('#new-alarm-noon')); $('.alarm .new').removeClass('hidden'); resize(); } function setup() { chrome.storage.sync.get(function(items) { for (var clock_class in items['clocks']) { clocks[clock_class] = items['clocks'][clock_class]; } for (var alarm_class in items['alarms']) { alarms[alarm_class] = items['alarms'][alarm_class]; } local = items['local']; navigator.geolocation.getCurrentPosition(getCurrentPosSuccessFunction, getCurrentPosErrorFunction); }); } function setupClocks() { var clock = new Clock('new', 0); clock.create(); var found_local = false; for (var city_class in clocks) { if (city_class == local_class) found_local = true; addClock(city_class); } if (local_class && !found_local) addClock(local_class); if (sizeOf(clocks) == 0) { $('.menu-item.new-world').click(); } } function setupAlarms() { var alarm = new Alarm('new', 'new', 0, 0, 0); alarm.create(); for (var id in alarms) { addAlarm(id); } if (sizeOf(alarms) == 0) $('.menu-item.new-alarm').click(); } function setupTimer() { timer = new Timer(); timer.create(); } function setupStopwatch() { stopwatch = new Stopwatch(); stopwatch.create(); } function getCurrentPosSuccessFunction(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; var url = encodeURI(base_url + lat + ',' + lng); $.get(url, function(data) { if (!data['data']['error']) { local = parseInt(data['data']['time_zone'][0]['utcOffset']); chrome.storage.sync.set({ 'local' : local }); } }, 'json' ); setupClocks(); setupAlarms(); setupTimer(); setupStopwatch(); } function getCurrentPosErrorFunction(error) { console.log("Geocoder failed"); local = -new Date().getTimezoneOffset()/60; setupClocks(); setupAlarms(); setupTimer(); setupStopwatch(); } // Function adds a canvas element and initializes a new clock for that canvas function addClock(city_class) { var city = clocks[city_class][0]; var offset = clocks[city_class][1] - local; $('#container .world .new').before('
        '); $('.' + city_class).append('
        '); $('.' + city_class).append(''); $('.' + city_class).append('
        ' + city + '
        '); $('.' + city_class).append('
        '); $('.' + city_class).append('
        '); var clock = new Clock(city_class, offset); clock.create(); resize(); } // Function adds a canvas element and initializes a new alarm for that canvas function addAlarm(id) { var alarm = alarms[id]; var edit = ''; var info = '
        \
        ' + alarm['name'] + '
        \
        \
        ' $('#container .alarm .new').before('
        '); $('.alarm-clock.' + id).append('
        '); $('.alarm-clock.' + id).append(''); $('.alarm-clock.' + id).append(info); $('.alarm-clock.' + id).append(edit); var alarm_clock = new Alarm(id, alarm['name'], alarm['hour'], alarm['minute'], alarm['on']); alarm_clock.create(); alarm_clocks[id] = alarm_clock; resize(); } function addWorldClock() { var city = $('.world .new #new-city').val(); if (city.split(' ').join('-') in clocks) { $('.world .new .button.cancel').click(); } else { var url = encodeURI(base_url + city); $.get(url, function(data) { if (data['data']['error']) { var city = $('.world .new #new-city').val(); $('.world .new #new-city').addClass('form-error'); $('.new .error-message').html('Could not find the time for ' + city + '.
        '); $('.new .error-message').removeClass('hidden'); } else { var city = data['data']['request'][0]['query'].split(', ')[0]; var city_class = city.split(' ').join('-'); var time_zone = parseInt(data['data']['time_zone'][0]['utcOffset']); clocks[city_class] = [city, time_zone]; chrome.storage.sync.set({ 'clocks' : clocks }); addClock(city_class); $('.world .new #new-city').val(''); $('.new .error-message').html(''); $('.world .new').addClass('hidden'); } }, 'json' ); } } function addAlarmClock() { var name = $('#new-alarm-name').val(); var hour = parseInt($('#new-alarm-hour').val()); var minute = parseInt($('#new-alarm-minute').val()); if (isNaN(hour)) { hour = 12; } if (isNaN(minute)) { minute = 0; } var noon = $('#new-alarm-noon').val(); if (noon.toLowerCase() == 'pm' && hour != 12) hour += 12; else if (noon.toLowerCase() == 'am' && hour == 12) hour -= 12; var id = 'a' + (sizeOf(alarms) + 1); alarm = { 'name' : name, 'hour' : hour, 'minute' : minute, 'on' : true }; alarms[id] = alarm; chrome.storage.sync.set({ 'alarms' : alarms }); $('#new-alarm-name').val(''); $('#new-alarm-hour').val(''); $('#new-alarm-minute').val(''); $('#new-alarm-noon').val(''); addAlarm(id); $('.alarm .new').addClass('hidden'); } function editAlarmClock(id) { var name = $('.edit.' + id + ' .edit-alarm-name').val(); console.log(name); var hour = parseInt($('.edit.' + id + ' .edit-alarm-hour').val()); var minute = parseInt($('.edit.' + id + ' .edit-alarm-minute').val()); if (isNaN(hour)) { hour = alarms[id]['hour']; } if (isNaN(minute)) { minute = alarms[id]['minute']; } var noon = $('.edit.' + id + ' .edit-alarm-noon').val(); if (noon.toLowerCase() == 'pm' && hour != 12) hour += 12; else if (noon.toLowerCase() == 'am' && hour == 12) hour -= 12; alarm = { 'name' : name, 'hour' : hour, 'minute' : minute, 'on' : alarms[id]['on'] }; alarms[id] = alarm; alarm_clock = alarm_clocks[id]; console.log(hour); console.log(minute); alarm_clock.update(name, hour, minute); chrome.storage.sync.set({ 'alarms' : alarms }); $('.' + id + '.info .name').text(name); } function resize() { var clock_width = 330.0; var clocks_size = sizeOf(clocks); if (!$('.world .new').hasClass('hidden')) clocks_size += 1; var lines = Math.ceil(clock_width * clocks_size / window.innerWidth); var height = 350 * lines; if (window.innerHeight > height + 100) { $('.world').css({ 'top' : '50%', 'margin-top' : '-' + height/2 + 'px' }); } else { $('.world').css({ 'top' : '0px', 'margin-top' : '0px' }); } var alarm_width = 300.0; var alarms_size = sizeOf(alarms); if (!$('.alarm .new').hasClass('hidden')) alarms_size += 1; var lines = Math.ceil(alarm_width * alarms_size / window.innerWidth); var height = 385 * lines; if (window.innerHeight > height) { $('.alarm').css({ 'top' : '50%', 'margin-top' : '-' + height/2 + 'px' }); } else { $('.alarm').css({ 'top' : '0px', 'margin-top' : '0px' }); } } function sizeOf(dictionary) { var count = 0; for (var key in dictionary) { if (dictionary.hasOwnProperty(key)) count++; } return count; } ================================================ FILE: _archive/apps/samples/clock/stopwatch.js ================================================ Stopwatch = function() { this.config = { container: {height: 250, width: 250}, face: {color: '#424240', alpha: 1, radius: 120}, hourHand: {color: '#4d90fe', alpha: 1, length: 35, width: 3}, minuteHand: {color: '#4d90fe', alpha: 1, length: 90, width: 2}, unit: { major: {color: '#f5f5f5', alpha: 0.4, length: 12, width: 2}, mid: {color: '#f5f5f5', alpha: 0.4, length: 12, width: 1}, minor: {color: '#f5f5f5', alpha: 0.4, length: 8, width: 1} }, minute: { face: {color: '#424240', alpha: 1, radius: 35}, hand: {color: '#4d90fe', alpha: 1, length: 20, width: 2}, unit: { major: {color: '#f5f5f5', alpha: 0.4, length: 5, width: 2}, mid: {color: '#f5f5f5', alpha: 0.4, length: 5, width: 1}, minor: {color: '#f5f5f5', alpha: 0.4, length: 2, width: 1} } } }; this.timing = false; this.time_passed = new Date(0); } //Stopwatch inherits from Clock Stopwatch.prototype = new Clock(this.id, 0); //Method to initialize the stopwatch Stopwatch.prototype.create = function() { this.canvas = $('.stopwatch .clock')[0]; this.canvas.height = this.config.container.height; this.canvas.width = this.config.container.width; this.context = this.canvas.getContext("2d"); this.drawClock(0, 0, 0, 0); this.startTick(); } //Methods to draw the stopwatch Stopwatch.prototype.drawClock = function (hour, minute, second, millisecond) { this.context.clearRect(0, 0, this.config.container.width, this.config.container.height); this.drawface(); this.drawUnits(); this.innerShadow(); this.drawText(hour, minute, second); this.drawTime(minute, second, millisecond); this.drawHands(hour, minute, second, millisecond); } //Method to draw the hands (minutes and seconds are switched... TODO: fix that) Stopwatch.prototype.drawHands = function(hour, second, minute, millisecond) { this.context.save(); this.context.translate(this.config.container.width/2,this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * ((minute + (millisecond/1000.0))/60) - 0.5)); this.context.globalAlpha = this.config.minuteHand.alpha; this.context.strokeStyle = this.config.minuteHand.color; this.context.lineWidth = this.config.minuteHand.width; this.context.lineCap = "round"; this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 4; this.context.shadowBlur = 2; this.context.shadowColor = "rgba(0, 0, 0, 0.2)"; this.context.beginPath(); this.context.moveTo(0, 0); this.context.lineTo(this.config.minuteHand.length - 5, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, 4, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.minuteHand.color; this.context.fill(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/2, 1, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.unit.major.color; this.context.fill(); this.context.restore(); this.context.save(); this.context.translate(this.config.container.width/2,this.config.container.height/3.5); this.context.rotate(Math.PI * (2.0 * ((second + (minute / 60.0)) / 60) - 0.5)); this.context.globalAlpha = this.config.minute.hand.alpha; this.context.strokeStyle = this.config.minute.hand.color; this.context.lineWidth = this.config.minute.hand.width; this.context.lineCap = "round"; this.context.shadowOffsetX = 0; this.context.shadowOffsetY = 4; this.context.shadowBlur = 2; this.context.shadowColor = "rgba(0, 0, 0, 0.2)"; this.context.beginPath(); this.context.moveTo(0, 0); this.context.lineTo(this.config.minute.hand.length - 5, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/3.5, 4, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.minute.hand.color; this.context.fill(); this.context.restore(); this.context.save(); this.context.beginPath(); this.context.arc(this.config.container.width/2, this.config.container.height/3.5, 1, 0, Math.PI*2, false); this.context.closePath(); this.context.fillStyle = this.config.minute.unit.major.color; this.context.fill(); this.context.restore(); } //Method to draw the number Stopwatch.prototype.drawText = function(hour, minute, second, millisecond) { //Numbers for main face for (var i = 0; i < 12; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (i/12) - 0.5)); this.context.translate(this.config.face.radius - 22, 0); this.context.rotate((Math.PI * (2.0 * (i/12) - 0.5) * -1)); var alpha = this.config.unit.major.alpha; this.context.globalAlpha = alpha; this.context.fillStyle = this.config.unit.major.color; this.context.shadowOffsetX = 1; this.context.shadowOffsetY = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.8)"; this.context.font = "600 11px 'Open Sans'"; this.context.textBaseline = 'middle'; this.context.textAlign = "center"; var textValue; if (i === 0) { textValue = 60; } else { textValue = i * 5; } this.context.fillText(textValue, 0, 0); this.context.restore(); } //Numbers for minutes face for (var i = 0; i < 12; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/3.5); this.context.rotate(Math.PI * (2.0 * (i/12) - 0.5)); this.context.translate(this.config.minute.face.radius - 13, 0); this.context.rotate((Math.PI * (2.0 * (i/12) - 0.5) * -1)); var alpha = this.config.minute.unit.major.alpha; this.context.globalAlpha = alpha; this.context.fillStyle = this.config.minute.unit.major.color; this.context.shadowOffsetX = 1; this.context.shadowOffsetY = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.8)"; this.context.font = "600 10px 'Open Sans'"; this.context.textBaseline = 'middle'; this.context.textAlign = "center"; var textValue = ''; if (i === 0) { textValue = 60; } else if (i % 2 === 0) { textValue = i * 5; } this.context.fillText(textValue, 0, 0); this.context.restore(); } } //Method to draw the units Stopwatch.prototype.drawUnits = function() { //Draw units for main face for (var i = 0; i < 60 * 5; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/2); this.context.rotate(Math.PI * (2.0 * (i/(60*5)) - 0.5)); this.context.globalAlpha = this.config.unit.major.alpha; this.context.strokeStyle = this.config.unit.major.color; if (i % 5 === 0) { if (i % 25 === 0) { this.context.lineWidth = this.config.unit.major.width; var length = this.config.unit.major.length; } else { this.context.lineWidth = this.config.unit.mid.width; var length = this.config.unit.mid.length; } } else { this.context.lineWidth = this.config.unit.minor.width; var length = this.config.unit.minor.length; } this.context.beginPath(); this.context.moveTo(this.config.face.radius - length, 0); this.context.lineTo(this.config.face.radius, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); } //Draw units for minutes face for (var i = 0; i < 60; i++) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/3.5); this.context.rotate(Math.PI * (2.0 * (i / 60) - 0.5)); this.context.globalAlpha = this.config.minute.unit.major.alpha; this.context.strokeStyle = this.config.minute.unit.major.color; if (i % 5 === 0) { if (i % 15 === 0) { this.context.lineWidth = this.config.minute.unit.major.width; var length = this.config.minute.unit.major.length; } else { this.context.lineWidth = this.config.minute.unit.mid.width; var length = this.config.minute.unit.mid.length; } } else { this.context.lineWidth = this.config.minute.unit.minor.width; var length = this.config.minute.unit.minor.length; } this.context.beginPath(); this.context.moveTo(this.config.minute.face.radius - length, 0); this.context.lineTo(this.config.minute.face.radius, 0); this.context.closePath(); this.context.stroke(); this.context.restore(); } } Stopwatch.prototype.drawTime = function(minute, second, millisecond) { this.context.save(); this.context.translate(this.config.container.width/2, this.config.container.height/1.3); var alpha = this.config.unit.major.alpha; this.context.globalAlpha = alpha; this.context.fillStyle = this.config.unit.major.color; this.context.shadowOffsetX = 1; this.context.shadowOffsetY = 1; this.context.shadowColor = "rgba(0, 0, 0, 0.8)"; this.context.font = "600 14px 'Open Sans'"; this.context.textBaseline = 'middle'; this.context.textAlign = "center"; if (minute < 10) minute = '0' + minute; if (second < 10) second = '0' + second; millisecond = parseInt(millisecond / 100); var textValue = minute + ':' + second + ':' + millisecond; this.context.fillText(textValue, 0, 0); this.context.restore(); } Stopwatch.prototype.startTiming = function() { this.timing = true; } Stopwatch.prototype.stopTiming = function() { this.timing = false; } Stopwatch.prototype.resetWatch = function() { this.timing = false; this.time_passed = new Date(0) this.drawClock(0, 0, 0, 0); } //Method to fire ten times each second and redraw the clock Stopwatch.prototype.tick = function() { if (this.timing) { this.time_passed.setTime(this.time_passed.getTime() + 100); var minute = this.time_passed.getMinutes(); var second = this.time_passed.getSeconds(); var millisecond = this.time_passed.getMilliseconds(); this.drawClock(0, minute, second, millisecond); } } Stopwatch.prototype.startTick = function() { var inst = this; this.tickId = setInterval(function() { inst.tick(); }, 100); } ================================================ FILE: _archive/apps/samples/clock/style.css ================================================ html { position: fixed; width: 100%; height: 100%; -webkit-app-region: drag; } input, button, .menu-item, .button, .close { -webkit-app-region: no-drag; } body { background: #f5f5f5; color: #222; font-family: "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; font-size: 13px; line-height: 18px; margin: 0px; text-align: left; } .button { background-color: #f5f5f5; background-image: linear-gradient(top, #f5f5f5, #f1f1f1); background-image: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 2px; -webkit-border-radius: 2px; color: #444; cursor: default; display: inline-block; font-size: 11px; font-weight: bold; height: 27px; line-height: 27px; margin-left: 2px; margin-right: 2px; margin-top: 8px; min-width: 40px; padding: 0 8px; text-align: center; transition: all 0.218s; -webkit-transition: all 0.218s; white-space: nowrap; } .button:hover { background-color: #f8f8f8; background-image: -webkit-linear-gradient(top, #f8f8f8, #f1f1f1); background-image: linear-gradient(top, #f8f8f8, #f1f1f1); border: 1px solid #c6c6Cc; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); color: #222; transition: all 0.0s; -webkit-transition: all 0.0s; } .button:active { background-color: #f6f6f6; background-image: -webkit-linear-gradient(top, #f6f6f6, #f1f1f1); background-image: linear-gradient(top, #f6f6f6, #f1f1f1); border: 1px solid #c6c6c6; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); color: #333; } input[type=text] { background-color: #fff; border: 1px solid #d9d9d9; border-top: 1px solid #c0c0c0; box-sizing: border-box; -webkit-box-sizing: border-box; border-radius: 1 px; -webkit-border-radius: 1px; color: #333; display: inline-block; height: 29px; line-height: 27px; margin-top: 8px; padding-left: 8px; vertical-align: top; } input[type=text]:hover { border: 1px solid #b9b9b9; border-top: 1px solid #a0a0a0; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); } input[type=text]:focus { border: 1px solid #4d90fe; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.3); outline: none; } input[type=text].form-error{ border: 1px solid #dd4b39; } .error-message { color: #dd4b39; padding: 0px; } .close { background: url('img/x.png') center no-repeat; background-size: 20px 20px; height: 20px; width: 20px; margin: 5px; float: right; opacity: 0.7; z-index: 50; } .close:hover { opacity: 1; } #container { text-align: center; } #container .world, #container .alarm, #container .timer, #container .stopwatch { top: 20px; bottom: 100px; position: absolute; text-align: center; width: 100%; overflow: auto; } #container .timer, #container .stopwatch { margin-top: -165px; top: 50%; } #container .world .city-clock, #container .world .new, #container .alarm .alarm-clock, #container .alarm .new, #container .timer .timer-clock, #container .stopwatch .stopwatch-clock { display: inline-block; position: static; text-align: center; vertical-align: middle; margin: 40px; margin-top: 0px; margin-bottom: 30px; } #container .world .new { margin-bottom: -12px; } #container .alarm .new { margin-bottom: -74px; } #container .alarm .editing { margin-bottom: -38px; } .world .city-clock .clock, .word .new .clock, .alarm .alarm-clock .clock, .alarm .new .clock { display: block; height: 240px; position: relative; width: 240px; margin-right: -25px; margin-bottom: 30px; } .timer .clock, .stopwatch .clock { display: block; position: static; } .world .new .new-input, .alarm .new .new-input { text-align: center; position: static; } #container .world .new.hidden, #container .alarm .new.hidden { display: none; } .world .city-clock .city, .alarm .alarm-clock .name { display: block; font-weight: bold; font-size: 18px; margin-bottom: 5px; } .world .city-clock .time, .world .city-clock .day, .alarm .alarm-clock .time { display: inline-block; font-size: 14px; padding: 1px; } .alarm .new #new-alarm-hour, .alarm .new #new-alarm-minute, .alarm .new #new-alarm-noon, .alarm .edit .edit-alarm-hour, .alarm .edit .edit-alarm-minute, .alarm .edit .edit-alarm-noon { display: inline-block; margin-right: -2px; margin-left: -2px; width: 43px; height: 29px; line-height: 27px; padding-right: 13px; } .alarm .info { position: relative; z-index: 10; } .delete { background: url('img/x.png') center no-repeat; background-size: 15px 15px; float: right; height: 15px; opacity: 0; padding: 10px; position: relative; width: 15px; z-index: 10; } .city-clock:hover .delete, .alarm-clock:hover .delete { opacity: 0.7; } .delete:hover { opacity: 1; } .timer-clock .button, .stopwatch-clock .button { font-weight: normal; letter-spacing: 1px; margin-top: 30px; background: #424240; color: #ccc; min-width: 50px; margin-right: 20px; } .timer-clock .button.reset, .timer-clock .button.set, .stopwatch-clock .button.reset { margin-right: 0px; } .timer-clock .button:hover, .stopwatch-clock .button:hover, .menu-item.button:hover { background: #424240; border: 1px solid rgba(0, 0, 0, 0.1); } .timer-clock .button:active, .stopwatch-clock .button:active, .menu-item.button:active { background: #3e3e3c; border: 1px solid rgba(0, 0, 0, 0.3); } .timer .button.disabled { opacity: 0.5; } .timer-clock #timer-minute, .timer-clock #timer-second { display: inline-block; height: 26px; line-height: 24px; margin-right: -3px; margin-top: 20px; margin-bottom: -10px; width: 35px; opacity: 1; } .timer-clock #timer-minute.disabled, .timer-clock #timer-second.disabled { opacity: 0; } #menu { position: absolute; text-align: center; bottom: 25px; width: 100%; } .menu-item { display: inline-block; height: 24px; margin: 10px; margin-bottom: 25px; width: 24px; } .menu-item.world { background: url('img/world.png') center no-repeat; background-size: 24px 24px; } #menu .alarm { background: url('img/alarm.png') center no-repeat; background-size: 24px 24px; } #menu .timer { background: url('img/timer.png') center no-repeat; background-size: 24px 24px; } #menu .stopwatch { background: url('img/stopwatch.png') center no-repeat; background-size: 24px 24px; } .menu-item.button { position: static; font-weight: 600; font-size: 11px; letter-spacing: 1px; margin: 0px; margin-left: -48px; background: #424240; color: #f5f5f5; width: 16px; height: 20px; padding-left: 2px; padding-right: 2px; line-height: 18px; } .menu-item.world:hover { background: url('img/world_hover.png') center no-repeat; background-size: 24px 24px; } #menu .alarm:hover { background: url('img/alarm_hover.png') center no-repeat; background-size: 24px 24px; } #menu .timer:hover { background: url('img/timer_hover.png') center no-repeat; background-size: 24px 24px; } #menu .stopwatch:hover { background: url('img/stopwatch_hover.png') center no-repeat; background-size: 24px 24px; } .menu-item.world.selected { background: url('img/world_selected.png') center no-repeat; background-size: 24px 24px; } #menu .alarm.selected { background: url('img/alarm_selected.png') center no-repeat; background-size: 24px 24px; } #menu .timer.selected { background: url('img/timer_selected.png') center no-repeat; background-size: 24px 24px; } #menu .stopwatch.selected { background: url('img/stopwatch_selected.png') center no-repeat; background-size: 24px 24px; } .hidden { display: none; } #tiptip_holder { display: none; position: absolute; top: 0; left: 0; z-index: 99999; } #tiptip_holder.tip_top { padding-bottom: 5px; } #tiptip_holder.tip_bottom { padding-top: 5px; } #tiptip_holder.tip_right { padding-left: 5px; } #tiptip_holder.tip_left { padding-right: 5px; } #tiptip_content { font-size: 10px; font-weight: 600; color: #999; } #tiptip_arrow, #tiptip_arrow_inner { display: none; } #tiptip_holder.tip_top #tiptip_arrow { display: none; } #tiptip_holder.tip_bottom #tiptip_arrow { display: none; } #tiptip_holder.tip_right #tiptip_arrow { display: none; } #tiptip_holder.tip_left #tiptip_arrow { display: none; } #tiptip_holder.tip_top #tiptip_arrow_inner { display: none; } #tiptip_holder.tip_bottom #tiptip_arrow_inner { display: none; } #tiptip_holder.tip_right #tiptip_arrow_inner { display: none; } #tiptip_holder.tip_left #tiptip_arrow_inner { display: none; } ================================================ FILE: _archive/apps/samples/clock/tests/clock_test.html ================================================ World Clock Chrome App

        World Clock Tests

          ================================================ FILE: _archive/apps/samples/clock/tests/clock_test.js ================================================ chrome = {}; chrome.storage = {}; chrome.storage.sync = {}; storage_get_called = false; storage_set_called = false; chrome.storage.sync.get = function() { storage_get_called = true; } chrome.storage.sync.set = function(items) { storage_set_called = true; storage_items = items; } var Context = new Class({ initialize: function($canvasElem) { this._ctx = $canvasElem._.getContext('2d'); this._calls = []; // names/args of recorded calls this._initMethods(); }, _initMethods: function() { // define methods to test here // no way to introspect so we have to do some extra work :( var methods = { fill: function() { this._ctx.fill(); }, lineTo: function(x, y) { this._ctx.lineTo(x, y); }, moveTo: function(x, y) { this._ctx.moveTo(x, y); }, stroke: function() { this._ctx.stroke(); } // and so on }; // attach methods to the class itself var scope = this; var addMethod = function(name, method) { scope[methodName] = function() { scope.record(name, arguments); method.apply(scope, arguments); }; } for(var methodName in methods) { var method = methods[methodName]; addMethod(methodName, method); } }, assign: function(k, v) { this._ctx[k] = v; }, record: function(methodName, args) { this._calls.push({name: methodName, args: args}); }, getCalls: function() { return this._calls; } // TODO: expand API as needed }); $(document).ready(function() { module("Initialization"); test("Get Chrome Storage", function() { expect(1); ok(storage_get_called); }); module("Clock"); }); ================================================ FILE: _archive/apps/samples/clock/tests/lib/prototype.js ================================================ /* Prototype JavaScript framework, version 1.7.1 * (c) 2005-2010 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.7.1', Browser: (function(){ var ua = navigator.userAgent; var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; return { IE: !!window.attachEvent && !isOpera, Opera: isOpera, WebKit: ua.indexOf('AppleWebKit/') > -1, Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, MobileSafari: /Apple.*Mobile/.test(ua) } })(), BrowserFeatures: { XPath: !!document.evaluate, SelectorsAPI: !!document.querySelector, ElementExtensions: (function() { var constructor = window.Element || window.HTMLElement; return !!(constructor && constructor.prototype); })(), SpecificElementExtensions: (function() { if (typeof window.HTMLDivElement !== 'undefined') return true; var div = document.createElement('div'), form = document.createElement('form'), isSupported = false; if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { isSupported = true; } div = form = null; return isSupported; })() }, ScriptFragment: ']*>([\\S\\s]*?)<\/script\\s*>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; /* Based on Alex Arnell's inheritance implementation. */ var Class = (function() { var IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') return false; } return true; })(); function subclass() {}; function create() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0, length = properties.length; i < length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } function addMethods(source) { var ancestor = this.superclass && this.superclass.prototype, properties = Object.keys(source); if (IS_DONTENUM_BUGGY) { if (source.toString != Object.prototype.toString) properties.push("toString"); if (source.valueOf != Object.prototype.valueOf) properties.push("valueOf"); } for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames()[0] == "$super") { var method = value; value = (function(m) { return function() { return ancestor[m].apply(this, arguments); }; })(property).wrap(method); value.valueOf = (function(method) { return function() { return method.valueOf.call(method); }; })(method); value.toString = (function(method) { return function() { return method.toString.call(method); }; })(method); } this.prototype[property] = value; } return this; } return { create: create, Methods: { addMethods: addMethods } }; })(); (function() { var _toString = Object.prototype.toString, _hasOwnProperty = Object.prototype.hasOwnProperty, NULL_TYPE = 'Null', UNDEFINED_TYPE = 'Undefined', BOOLEAN_TYPE = 'Boolean', NUMBER_TYPE = 'Number', STRING_TYPE = 'String', OBJECT_TYPE = 'Object', FUNCTION_CLASS = '[object Function]', BOOLEAN_CLASS = '[object Boolean]', NUMBER_CLASS = '[object Number]', STRING_CLASS = '[object String]', ARRAY_CLASS = '[object Array]', DATE_CLASS = '[object Date]', NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON && typeof JSON.stringify === 'function' && JSON.stringify(0) === '0' && typeof JSON.stringify(Prototype.K) === 'undefined'; var DONT_ENUMS = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor']; var IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') return false; } return true; })(); function Type(o) { switch(o) { case null: return NULL_TYPE; case (void 0): return UNDEFINED_TYPE; } var type = typeof o; switch(type) { case 'boolean': return BOOLEAN_TYPE; case 'number': return NUMBER_TYPE; case 'string': return STRING_TYPE; } return OBJECT_TYPE; } function extend(destination, source) { for (var property in source) destination[property] = source[property]; return destination; } function inspect(object) { try { if (isUndefined(object)) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } } function toJSON(value) { return Str('', { '': value }, []); } function Str(key, holder, stack) { var value = holder[key]; if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') { value = value.toJSON(key); } var _class = _toString.call(value); switch (_class) { case NUMBER_CLASS: case BOOLEAN_CLASS: case STRING_CLASS: value = value.valueOf(); } switch (value) { case null: return 'null'; case true: return 'true'; case false: return 'false'; } var type = typeof value; switch (type) { case 'string': return value.inspect(true); case 'number': return isFinite(value) ? String(value) : 'null'; case 'object': for (var i = 0, length = stack.length; i < length; i++) { if (stack[i] === value) { throw new TypeError("Cyclic reference to '" + value + "' in object"); } } stack.push(value); var partial = []; if (_class === ARRAY_CLASS) { for (var i = 0, length = value.length; i < length; i++) { var str = Str(i, value, stack); partial.push(typeof str === 'undefined' ? 'null' : str); } partial = '[' + partial.join(',') + ']'; } else { var keys = Object.keys(value); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], str = Str(key, value, stack); if (typeof str !== "undefined") { partial.push(key.inspect(true)+ ':' + str); } } partial = '{' + partial.join(',') + '}'; } stack.pop(); return partial; } } function stringify(object) { return JSON.stringify(object); } function toQueryString(object) { return $H(object).toQueryString(); } function toHTML(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); } function keys(object) { if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); } var results = []; for (var property in object) { if (_hasOwnProperty.call(object, property)) results.push(property); } if (IS_DONTENUM_BUGGY) { for (var i = 0; property = DONT_ENUMS[i]; i++) { if (_hasOwnProperty.call(object, property)) results.push(property); } } return results; } function values(object) { var results = []; for (var property in object) results.push(object[property]); return results; } function clone(object) { return extend({ }, object); } function isElement(object) { return !!(object && object.nodeType == 1); } function isArray(object) { return _toString.call(object) === ARRAY_CLASS; } var hasNativeIsArray = (typeof Array.isArray == 'function') && Array.isArray([]) && !Array.isArray({}); if (hasNativeIsArray) { isArray = Array.isArray; } function isHash(object) { return object instanceof Hash; } function isFunction(object) { return _toString.call(object) === FUNCTION_CLASS; } function isString(object) { return _toString.call(object) === STRING_CLASS; } function isNumber(object) { return _toString.call(object) === NUMBER_CLASS; } function isDate(object) { return _toString.call(object) === DATE_CLASS; } function isUndefined(object) { return typeof object === "undefined"; } extend(Object, { extend: extend, inspect: inspect, toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON, toQueryString: toQueryString, toHTML: toHTML, keys: Object.keys || keys, values: values, clone: clone, isElement: isElement, isArray: isArray, isHash: isHash, isFunction: isFunction, isString: isString, isNumber: isNumber, isDate: isDate, isUndefined: isUndefined }); })(); Object.extend(Function.prototype, (function() { var slice = Array.prototype.slice; function update(array, args) { var arrayLength = array.length, length = args.length; while (length--) array[arrayLength + length] = args[length]; return array; } function merge(array, args) { array = slice.call(array, 0); return update(array, args); } function argumentNames() { var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') .replace(/\s+/g, '').split(','); return names.length == 1 && !names[0] ? [] : names; } function bind(context) { if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; if (!Object.isFunction(this)) throw new TypeError("The object is not callable."); var nop = function() {}; var __method = this, args = slice.call(arguments, 1); var bound = function() { var a = merge(args, arguments), c = context; var c = this instanceof bound ? this : context; return __method.apply(c, a); }; nop.prototype = this.prototype; bound.prototype = new nop(); return bound; } function bindAsEventListener(context) { var __method = this, args = slice.call(arguments, 1); return function(event) { var a = update([event || window.event], args); return __method.apply(context, a); } } function curry() { if (!arguments.length) return this; var __method = this, args = slice.call(arguments, 0); return function() { var a = merge(args, arguments); return __method.apply(this, a); } } function delay(timeout) { var __method = this, args = slice.call(arguments, 1); timeout = timeout * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); } function defer() { var args = update([0.01], arguments); return this.delay.apply(this, args); } function wrap(wrapper) { var __method = this; return function() { var a = update([__method.bind(this)], arguments); return wrapper.apply(this, a); } } function methodize() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { var a = update([this], arguments); return __method.apply(null, a); }; } var extensions = { argumentNames: argumentNames, bindAsEventListener: bindAsEventListener, curry: curry, delay: delay, defer: defer, wrap: wrap, methodize: methodize }; if (!Function.prototype.bind) extensions.bind = bind; return extensions; })()); (function(proto) { function toISOString() { return this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z'; } function toJSON() { return this.toISOString(); } if (!proto.toISOString) proto.toISOString = toISOString; if (!proto.toJSON) proto.toJSON = toJSON; })(Date.prototype); RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); this.currentlyExecuting = false; } catch(e) { this.currentlyExecuting = false; throw e; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, (function() { var NATIVE_JSON_PARSE_SUPPORT = window.JSON && typeof JSON.parse === 'function' && JSON.parse('{"test": true}').test; function prepareReplacement(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; } function gsub(pattern, replacement) { var result = '', source = this, match; replacement = prepareReplacement(replacement); if (Object.isString(pattern)) pattern = RegExp.escape(pattern); if (!(pattern.length || pattern.source)) { replacement = replacement(''); return replacement + source.split('').join(replacement) + replacement; } while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; } function sub(pattern, replacement, count) { replacement = prepareReplacement(replacement); count = Object.isUndefined(count) ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); } function scan(pattern, iterator) { this.gsub(pattern, iterator); return String(this); } function truncate(length, truncation) { length = length || 30; truncation = Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); } function strip() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); } function stripTags() { return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } function stripScripts() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); } function extractScripts() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'), matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); } function evalScripts() { return this.extractScripts().map(function(script) { return eval(script); }); } function escapeHTML() { return this.replace(/&/g,'&').replace(//g,'>'); } function unescapeHTML() { return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); } function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()), value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); } function toArray() { return this.split(''); } function succ() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); } function times(count) { return count < 1 ? '' : new Array(count + 1).join(this); } function camelize() { return this.replace(/-+(.)?/g, function(match, chr) { return chr ? chr.toUpperCase() : ''; }); } function capitalize() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function underscore() { return this.replace(/::/g, '/') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/-/g, '_') .toLowerCase(); } function dasherize() { return this.replace(/_/g, '-'); } function inspect(useDoubleQuotes) { var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { if (character in String.specialChar) { return String.specialChar[character]; } return '\\u00' + character.charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; } function unfilterJSON(filter) { return this.replace(filter || Prototype.JSONFilter, '$1'); } function isJSON() { var str = this; if (str.blank()) return false; str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'); str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); return (/^[\],:{}\s]*$/).test(str); } function evalJSON(sanitize) { var json = this.unfilterJSON(), cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; if (cx.test(json)) { json = json.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); } function parseJSON() { var json = this.unfilterJSON(); return JSON.parse(json); } function include(pattern) { return this.indexOf(pattern) > -1; } function startsWith(pattern) { return this.lastIndexOf(pattern, 0) === 0; } function endsWith(pattern) { var d = this.length - pattern.length; return d >= 0 && this.indexOf(pattern, d) === d; } function empty() { return this == ''; } function blank() { return /^\s*$/.test(this); } function interpolate(object, pattern) { return new Template(this, pattern).evaluate(object); } return { gsub: gsub, sub: sub, scan: scan, truncate: truncate, strip: String.prototype.trim || strip, stripTags: stripTags, stripScripts: stripScripts, extractScripts: extractScripts, evalScripts: evalScripts, escapeHTML: escapeHTML, unescapeHTML: unescapeHTML, toQueryParams: toQueryParams, parseQuery: toQueryParams, toArray: toArray, succ: succ, times: times, camelize: camelize, capitalize: capitalize, underscore: underscore, dasherize: dasherize, inspect: inspect, unfilterJSON: unfilterJSON, isJSON: isJSON, evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON, include: include, startsWith: startsWith, endsWith: endsWith, empty: empty, blank: blank, interpolate: interpolate }; })()); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (object && Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return (match[1] + ''); var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3], pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = (function() { function each(iterator, context) { try { this._each(iterator, context); } catch (e) { if (e != $break) throw e; } return this; } function eachSlice(number, iterator, context) { var index = -number, slices = [], array = this.toArray(); if (number < 1) return array; while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); } function all(iterator, context) { iterator = iterator || Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator.call(context, value, index, this); if (!result) throw $break; }, this); return result; } function any(iterator, context) { iterator = iterator || Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator.call(context, value, index, this)) throw $break; }, this); return result; } function collect(iterator, context) { iterator = iterator || Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator.call(context, value, index, this)); }, this); return results; } function detect(iterator, context) { var result; this.each(function(value, index) { if (iterator.call(context, value, index, this)) { result = value; throw $break; } }, this); return result; } function findAll(iterator, context) { var results = []; this.each(function(value, index) { if (iterator.call(context, value, index, this)) results.push(value); }, this); return results; } function grep(filter, iterator, context) { iterator = iterator || Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(RegExp.escape(filter)); this.each(function(value, index) { if (filter.match(value)) results.push(iterator.call(context, value, index, this)); }, this); return results; } function include(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; } function inGroupsOf(number, fillWith) { fillWith = Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); } function inject(memo, iterator, context) { this.each(function(value, index) { memo = iterator.call(context, memo, value, index, this); }, this); return memo; } function invoke(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); } function max(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index, this); if (result == null || value >= result) result = value; }, this); return result; } function min(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index, this); if (result == null || value < result) result = value; }, this); return result; } function partition(iterator, context) { iterator = iterator || Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator.call(context, value, index, this) ? trues : falses).push(value); }, this); return [trues, falses]; } function pluck(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; } function reject(iterator, context) { var results = []; this.each(function(value, index) { if (!iterator.call(context, value, index, this)) results.push(value); }, this); return results; } function sortBy(iterator, context) { return this.map(function(value, index) { return { value: value, criteria: iterator.call(context, value, index, this) }; }, this).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); } function toArray() { return this.map(); } function zip() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); } function size() { return this.toArray().length; } function inspect() { return '#'; } return { each: each, eachSlice: eachSlice, all: all, every: all, any: any, some: any, collect: collect, map: collect, detect: detect, findAll: findAll, select: findAll, filter: findAll, grep: grep, include: include, member: include, inGroupsOf: inGroupsOf, inject: inject, invoke: invoke, max: max, min: min, partition: partition, pluck: pluck, reject: reject, sortBy: sortBy, toArray: toArray, entries: toArray, zip: zip, size: size, inspect: inspect, find: detect }; })(); function $A(iterable) { if (!iterable) return []; if ('toArray' in Object(iterable)) return iterable.toArray(); var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } Array.from = $A; (function() { var arrayProto = Array.prototype, slice = arrayProto.slice, _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available function each(iterator, context) { for (var i = 0, length = this.length >>> 0; i < length; i++) { if (i in this) iterator.call(context, this[i], i, this); } } if (!_each) _each = each; function clear() { this.length = 0; return this; } function first() { return this[0]; } function last() { return this[this.length - 1]; } function compact() { return this.select(function(value) { return value != null; }); } function flatten() { return this.inject([], function(array, value) { if (Object.isArray(value)) return array.concat(value.flatten()); array.push(value); return array; }); } function without() { var values = slice.call(arguments, 0); return this.select(function(value) { return !values.include(value); }); } function reverse(inline) { return (inline === false ? this.toArray() : this)._reverse(); } function uniq(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); } function intersect(array) { return this.uniq().findAll(function(item) { return array.indexOf(item) !== -1; }); } function clone() { return slice.call(this, 0); } function size() { return this.length; } function inspect() { return '[' + this.map(Object.inspect).join(', ') + ']'; } function indexOf(item, i) { if (this == null) throw new TypeError(); var array = Object(this), length = array.length >>> 0; if (length === 0) return -1; i = Number(i); if (isNaN(i)) { i = 0; } else if (i !== 0 && isFinite(i)) { i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i)); } if (i > length) return -1; var k = i >= 0 ? i : Math.max(length - Math.abs(i), 0); for (; k < length; k++) if (k in array && array[k] === item) return k; return -1; } function lastIndexOf(item, i) { if (this == null) throw new TypeError(); var array = Object(this), length = array.length >>> 0; if (length === 0) return -1; if (!Object.isUndefined(i)) { i = Number(i); if (isNaN(i)) { i = 0; } else if (i !== 0 && isFinite(i)) { i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i)); } } else { i = length; } var k = i >= 0 ? Math.min(i, length - 1) : length - Math.abs(i); for (; k >= 0; k--) if (k in array && array[k] === item) return k; return -1; } function concat(_) { var array = [], items = slice.call(arguments, 0), item, n = 0; items.unshift(this); for (var i = 0, length = items.length; i < length; i++) { item = items[i]; if (Object.isArray(item) && !('callee' in item)) { for (var j = 0, arrayLength = item.length; j < arrayLength; j++) { if (j in item) array[n] = item[j]; n++; } } else { array[n++] = item; } } array.length = n; return array; } function wrapNative(method) { return function() { if (arguments.length === 0) { return method.call(this, Prototype.K); } else if (arguments[0] === undefined) { var args = slice.call(arguments, 1); args.unshift(Prototype.K); return method.apply(this, args); } else { return method.apply(this, arguments); } }; } function map(iterator) { if (this == null) throw new TypeError(); iterator = iterator || Prototype.K; var object = Object(this); var results = [], context = arguments[1], n = 0; for (var i = 0, length = object.length >>> 0; i < length; i++) { if (i in object) { results[n] = iterator.call(context, object[i], i, object); } n++; } results.length = n; return results; } if (arrayProto.map) { map = wrapNative(Array.prototype.map); } function filter(iterator) { if (this == null || !Object.isFunction(iterator)) throw new TypeError(); var object = Object(this); var results = [], context = arguments[1], value; for (var i = 0, length = object.length >>> 0; i < length; i++) { if (i in object) { value = object[i]; if (iterator.call(context, value, i, object)) { results.push(value); } } } return results; } if (arrayProto.filter) { filter = Array.prototype.filter; } function some(iterator) { if (this == null) throw new TypeError(); iterator = iterator || Prototype.K; var context = arguments[1]; var object = Object(this); for (var i = 0, length = object.length >>> 0; i < length; i++) { if (i in object && iterator.call(context, object[i], i, object)) { return true; } } return false; } if (arrayProto.some) { var some = wrapNative(Array.prototype.some); } function every(iterator) { if (this == null) throw new TypeError(); iterator = iterator || Prototype.K; var context = arguments[1]; var object = Object(this); for (var i = 0, length = object.length >>> 0; i < length; i++) { if (i in object && !iterator.call(context, object[i], i, object)) { return false; } } return true; } if (arrayProto.every) { var every = wrapNative(Array.prototype.every); } var _reduce = arrayProto.reduce; function inject(memo, iterator) { iterator = iterator || Prototype.K; var context = arguments[2]; return _reduce.call(this, iterator.bind(context), memo); } if (!arrayProto.reduce) { var inject = Enumerable.inject; } Object.extend(arrayProto, Enumerable); if (!arrayProto._reverse) arrayProto._reverse = arrayProto.reverse; Object.extend(arrayProto, { _each: _each, map: map, collect: map, select: filter, filter: filter, findAll: filter, some: some, any: some, every: every, all: every, inject: inject, clear: clear, first: first, last: last, compact: compact, flatten: flatten, without: without, reverse: reverse, uniq: uniq, intersect: intersect, clone: clone, toArray: clone, size: size, inspect: inspect }); var CONCAT_ARGUMENTS_BUGGY = (function() { return [].concat(arguments)[0][0] !== 1; })(1,2); if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; })(); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { function initialize(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); } function _each(iterator, context) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator.call(context, pair); } } function set(key, value) { return this._object[key] = value; } function get(key) { if (this._object[key] !== Object.prototype[key]) return this._object[key]; } function unset(key) { var value = this._object[key]; delete this._object[key]; return value; } function toObject() { return Object.clone(this._object); } function keys() { return this.pluck('key'); } function values() { return this.pluck('value'); } function index(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; } function merge(object) { return this.clone().update(object); } function update(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; var value = String.interpret(value); value = value.gsub(/(\r)?\n/, '\r\n'); value = encodeURIComponent(value); value = value.gsub(/%20/, '+'); return key + '=' + value; } function toQueryString() { return this.inject([], function(results, pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) { var queryValues = []; for (var i = 0, len = values.length, value; i < len; i++) { value = values[i]; queryValues.push(toQueryPair(key, value)); } return results.concat(queryValues); } } else results.push(toQueryPair(key, values)); return results; }).join('&'); } function inspect() { return '#'; } function clone() { return new Hash(this); } return { initialize: initialize, _each: _each, set: set, get: get, unset: unset, toObject: toObject, toTemplateReplacements: toObject, keys: keys, values: values, index: index, merge: merge, update: update, toQueryString: toQueryString, inspect: inspect, toJSON: toObject, clone: clone }; })()); Hash.from = $H; Object.extend(Number.prototype, (function() { function toColorPart() { return this.toPaddedString(2, 16); } function succ() { return this + 1; } function times(iterator, context) { $R(0, this, true).each(iterator, context); return this; } function toPaddedString(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; } function abs() { return Math.abs(this); } function round() { return Math.round(this); } function ceil() { return Math.ceil(this); } function floor() { return Math.floor(this); } return { toColorPart: toColorPart, succ: succ, times: times, toPaddedString: toPaddedString, abs: abs, round: round, ceil: ceil, floor: floor }; })()); function $R(start, end, exclusive) { return new ObjectRange(start, end, exclusive); } var ObjectRange = Class.create(Enumerable, (function() { function initialize(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; } function _each(iterator, context) { var value = this.start; while (this.include(value)) { iterator.call(context, value); value = value.succ(); } } function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } return { initialize: initialize, _each: _each, include: include }; })()); var Abstract = { }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator, context) { this.responders._each(iterator, context); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isHash(this.options.parameters)) this.options.parameters = this.options.parameters.toObject(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.isString(this.options.parameters) ? this.options.parameters : Object.toQueryString(this.options.parameters); if (!['get', 'post'].include(this.method)) { params += (params ? '&' : '') + "_method=" + this.method; this.method = 'post'; } if (params && this.method === 'get') { this.url += (this.url.include('?') ? '&' : '?') + params; } this.parameters = params.toQueryParams(); try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300) || status == 304; }, getStatus: function() { try { if (this.transport.status === 1223) return 204; return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { this.transport.onreadystatechange = Prototype.emptyFunction; } }, isSameOrigin: function() { var m = this.url.match(/^\s*https?:\/\/[^\/]*/); return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ protocol: location.protocol, domain: document.domain, port: location.port ? ':' + location.port : '' })); }, getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; } catch (e) { return null; } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if (readyState == 4) { var xml = transport.responseXML; this.responseXML = Object.isUndefined(xml) ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; try { json = decodeURIComponent(escape(json)); } catch(e) { } try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = Object.clone(options); var onComplete = options.onComplete; options.onComplete = (function(response, json) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); (function(GLOBAL) { var UNDEFINED; var SLICE = Array.prototype.slice; var DIV = document.createElement('div'); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } GLOBAL.$ = $; if (!GLOBAL.Node) GLOBAL.Node = {}; if (!GLOBAL.Node.ELEMENT_NODE) { Object.extend(GLOBAL.Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } var ELEMENT_CACHE = {}; function shouldUseCreationCache(tagName, attributes) { if (tagName === 'select') return false; if ('type' in attributes) return false; return true; } var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){ try { var el = document.createElement(''); return el.tagName.toLowerCase() === 'input' && el.name === 'x'; } catch(err) { return false; } })(); var oldElement = GLOBAL.Element; function Element(tagName, attributes) { attributes = attributes || {}; tagName = tagName.toLowerCase(); if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!ELEMENT_CACHE[tagName]) ELEMENT_CACHE[tagName] = Element.extend(document.createElement(tagName)); var node = shouldUseCreationCache(tagName, attributes) ? ELEMENT_CACHE[tagName].cloneNode(false) : document.createElement(tagName); return Element.writeAttribute(node, attributes); } GLOBAL.Element = Element; Object.extend(GLOBAL.Element, oldElement || {}); if (oldElement) GLOBAL.Element.prototype = oldElement.prototype; Element.Methods = { ByTag: {}, Simulated: {} }; var methods = {}; var INSPECT_ATTRIBUTES = { id: 'id', className: 'class' }; function inspect(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); var attribute, value; for (var property in INSPECT_ATTRIBUTES) { attribute = INSPECT_ATTRIBUTES[property]; value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); } return result + '>'; } methods.inspect = inspect; function visible(element) { return $(element).style.display !== 'none'; } function toggle(element, bool) { element = $(element); if (Object.isUndefined(bool)) bool = !Element.visible(element); Element[bool ? 'show' : 'hide'](element); return element; } function hide(element) { element = $(element); element.style.display = 'none'; return element; } function show(element) { element = $(element); element.style.display = ''; return element; } Object.extend(methods, { visible: visible, toggle: toggle, hide: hide, show: show }); function remove(element) { element = $(element); element.parentNode.removeChild(element); return element; } var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ var el = document.createElement("select"), isBuggy = true; el.innerHTML = ""; if (el.options && el.options[0]) { isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; } el = null; return isBuggy; })(); var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ try { var el = document.createElement("table"); if (el && el.tBodies) { el.innerHTML = "test"; var isBuggy = typeof el.tBodies[0] == "undefined"; el = null; return isBuggy; } } catch (e) { return true; } })(); var LINK_ELEMENT_INNERHTML_BUGGY = (function() { try { var el = document.createElement('div'); el.innerHTML = ""; var isBuggy = (el.childNodes.length === 0); el = null; return isBuggy; } catch(e) { return true; } })(); var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY; var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { var s = document.createElement("script"), isBuggy = false; try { s.appendChild(document.createTextNode("")); isBuggy = !s.firstChild || s.firstChild && s.firstChild.nodeType !== 3; } catch (e) { isBuggy = true; } s = null; return isBuggy; })(); function update(element, content) { element = $(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { element.text = content; return element; } if (ANY_INNERHTML_BUGGY) { if (tagName in INSERTION_TRANSLATIONS.tags) { while (element.firstChild) element.removeChild(element.firstChild); var nodes = getContentFromAnonymousElement(tagName, content.stripScripts()); for (var i = 0, node; node = nodes[i]; i++) element.appendChild(node); } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf(' -1) { while (element.firstChild) element.removeChild(element.firstChild); var nodes = getContentFromAnonymousElement(tagName, content.stripScripts(), true); for (var i = 0, node; node = nodes[i]; i++) element.appendChild(node); } else { element.innerHTML = content.stripScripts(); } } else { element.innerHTML = content.stripScripts(); } content.evalScripts.bind(content).defer(); return element; } function replace(element, content) { element = $(element); if (content && content.toElement) { content = content.toElement(); } else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; } var INSERTION_TRANSLATIONS = { before: function(element, node) { element.parentNode.insertBefore(node, element); }, top: function(element, node) { element.insertBefore(node, element.firstChild); }, bottom: function(element, node) { element.appendChild(node); }, after: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
          ', 1], TBODY: ['', '
          ', 2], TR: ['', '
          ', 3], TD: ['
          ', '
          ', 4], SELECT: ['', 1] } }; var tags = INSERTION_TRANSLATIONS.tags; Object.extend(tags, { THEAD: tags.TBODY, TFOOT: tags.TBODY, TH: tags.TD }); function replace_IE(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (tagName in INSERTION_TRANSLATIONS.tags) { var nextSibling = Element.next(element); var fragments = getContentFromAnonymousElement( tagName, content.stripScripts()); parent.removeChild(element); var iterator; if (nextSibling) iterator = function(node) { parent.insertBefore(node, nextSibling) }; else iterator = function(node) { parent.appendChild(node); } fragments.each(iterator); } else { element.outerHTML = content.stripScripts(); } content.evalScripts.bind(content).defer(); return element; } if ('outerHTML' in document.documentElement) replace = replace_IE; function isContent(content) { if (Object.isUndefined(content) || content === null) return false; if (Object.isString(content) || Object.isNumber(content)) return true; if (Object.isElement(content)) return true; if (content.toElement || content.toHTML) return true; return false; } function insertContentAt(element, content, position) { position = position.toLowerCase(); var method = INSERTION_TRANSLATIONS[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { method(element, content); return element; } content = Object.toHTML(content); var tagName = ((position === 'before' || position === 'after') ? element.parentNode : element).tagName.toUpperCase(); var childNodes = getContentFromAnonymousElement(tagName, content.stripScripts()); if (position === 'top' || position === 'after') childNodes.reverse(); for (var i = 0, node; node = childNodes[i]; i++) method(element, node); content.evalScripts.bind(content).defer(); } function insert(element, insertions) { element = $(element); if (isContent(insertions)) insertions = { bottom: insertions }; for (var position in insertions) insertContentAt(element, insertions[position], position); return element; } function wrap(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) { $(wrapper).writeAttribute(attributes || {}); } else if (Object.isString(wrapper)) { wrapper = new Element(wrapper, attributes); } else { wrapper = new Element('div', wrapper); } if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; } function cleanWhitespace(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType === Node.TEXT_NODE && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; } function empty(element) { return $(element).innerHTML.blank(); } function getContentFromAnonymousElement(tagName, html, force) { var t = INSERTION_TRANSLATIONS.tags[tagName], div = DIV; var workaround = !!t; if (!workaround && force) { workaround = true; t = ['', '', 0]; } if (workaround) { div.innerHTML = ' ' + t[0] + html + t[1]; div.removeChild(div.firstChild); for (var i = t[2]; i--; ) div = div.firstChild; } else { div.innerHTML = html; } return $A(div.childNodes); } function clone(element, deep) { if (!(element = $(element))) return; var clone = element.cloneNode(deep); if (!HAS_UNIQUE_ID_PROPERTY) { clone._prototypeUID = UNDEFINED; if (deep) { var descendants = Element.select(clone, '*'), i = descendants.length; while (i--) descendants[i]._prototypeUID = UNDEFINED; } } return Element.extend(clone); } function purgeElement(element) { var uid = getUniqueElementID(element); if (uid) { Element.stopObserving(element); if (!HAS_UNIQUE_ID_PROPERTY) element._prototypeUID = UNDEFINED; delete Element.Storage[uid]; } } function purgeCollection(elements) { var i = elements.length; while (i--) purgeElement(elements[i]); } function purgeCollection_IE(elements) { var i = elements.length, element, uid; while (i--) { element = elements[i]; uid = getUniqueElementID(element); delete Element.Storage[uid]; delete Event.cache[uid]; } } if (HAS_UNIQUE_ID_PROPERTY) { purgeCollection = purgeCollection_IE; } function purge(element) { if (!(element = $(element))) return; purgeElement(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); return null; } Object.extend(methods, { remove: remove, update: update, replace: replace, insert: insert, wrap: wrap, cleanWhitespace: cleanWhitespace, empty: empty, clone: clone, purge: purge }); function recursivelyCollect(element, property, maximumLength) { element = $(element); maximumLength = maximumLength || -1; var elements = []; while (element = element[property]) { if (element.nodeType === Node.ELEMENT_NODE) elements.push(Element.extend(element)); if (elements.length === maximumLength) break; } return elements; } function ancestors(element) { return recursivelyCollect(element, 'parentNode'); } function descendants(element) { return Element.select(element, '*'); } function firstDescendant(element) { element = $(element).firstChild; while (element && element.nodeType !== Node.ELEMENT_NODE) element = element.nextSibling; return $(element); } function immediateDescendants(element) { var results = [], child = $(element).firstChild; while (child) { if (child.nodeType === Node.ELEMENT_NODE) results.push(Element.extend(child)); child = child.nextSibling; } return results; } function previousSiblings(element) { return recursivelyCollect(element, 'previousSibling'); } function nextSiblings(element) { return recursivelyCollect(element, 'nextSibling'); } function siblings(element) { element = $(element); var previous = previousSiblings(element), next = nextSiblings(element); return previous.reverse().concat(next); } function match(element, selector) { element = $(element); if (Object.isString(selector)) return Prototype.Selector.match(element, selector); return selector.match(element); } function _recursivelyFind(element, property, expression, index) { element = $(element), expression = expression || 0, index = index || 0; if (Object.isNumber(expression)) { index = expression, expression = null; } while (element = element[property]) { if (element.nodeType !== 1) continue; if (expression && !Prototype.Selector.match(element, expression)) continue; if (--index >= 0) continue; return Element.extend(element); } } function up(element, expression, index) { element = $(element); if (arguments.length === 1) return $(element.parentNode); return _recursivelyFind(element, 'parentNode', expression, index); } function down(element, expression, index) { element = $(element), expression = expression || 0, index = index || 0; if (Object.isNumber(expression)) index = expression, expression = '*'; var node = Prototype.Selector.select(expression, element)[index]; return Element.extend(node); } function previous(element, expression, index) { return _recursivelyFind(element, 'previousSibling', expression, index); } function next(element, expression, index) { return _recursivelyFind(element, 'nextSibling', expression, index); } function select(element) { element = $(element); var expressions = SLICE.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element); } function adjacent(element) { element = $(element); var expressions = SLICE.call(arguments, 1).join(', '); var siblings = Element.siblings(element), results = []; for (var i = 0, sibling; sibling = siblings[i]; i++) { if (Prototype.Selector.match(sibling, expressions)) results.push(sibling); } return results; } function descendantOf_DOM(element, ancestor) { element = $(element), ancestor = $(ancestor); while (element = element.parentNode) if (element === ancestor) return true; return false; } function descendantOf_contains(element, ancestor) { element = $(element), ancestor = $(ancestor); if (!ancestor.contains) return descendantOf_DOM(element, ancestor); return ancestor.contains(element) && ancestor !== element; } function descendantOf_compareDocumentPosition(element, ancestor) { element = $(element), ancestor = $(ancestor); return (element.compareDocumentPosition(ancestor) & 8) === 8; } var descendantOf; if (DIV.compareDocumentPosition) { descendantOf = descendantOf_compareDocumentPosition; } else if (DIV.contains) { descendantOf = descendantOf_contains; } else { descendantOf = descendantOf_DOM; } Object.extend(methods, { recursivelyCollect: recursivelyCollect, ancestors: ancestors, descendants: descendants, firstDescendant: firstDescendant, immediateDescendants: immediateDescendants, previousSiblings: previousSiblings, nextSiblings: nextSiblings, siblings: siblings, match: match, up: up, down: down, previous: previous, next: next, select: select, adjacent: adjacent, descendantOf: descendantOf, getElementsBySelector: select, childElements: immediateDescendants }); var idCounter = 1; function identify(element) { element = $(element); var id = Element.readAttribute(element, 'id'); if (id) return id; do { id = 'anonymous_element_' + idCounter++ } while ($(id)); Element.writeAttribute(element, 'id', id); return id; } function readAttribute(element, name) { return $(element).getAttribute(name); } function readAttribute_IE(element, name) { element = $(element); var table = ATTRIBUTE_TRANSLATIONS.read; if (table.values[name]) return table.values[name](element, name); if (table.names[name]) name = table.names[name]; if (name.include(':')) { if (!element.attributes || !element.attributes[name]) return null; return element.attributes[name].value; } return element.getAttribute(name); } function readAttribute_Opera(element, name) { if (name === 'title') return element.title; return element.getAttribute(name); } var PROBLEMATIC_ATTRIBUTE_READING = (function() { DIV.setAttribute('onclick', Prototype.emptyFunction); var value = DIV.getAttribute('onclick'); var isFunction = (typeof value === 'function'); DIV.removeAttribute('onclick'); return isFunction; })(); if (PROBLEMATIC_ATTRIBUTE_READING) { readAttribute = readAttribute_IE; } else if (Prototype.Browser.Opera) { readAttribute = readAttribute_Opera; } function writeAttribute(element, name, value) { element = $(element); var attributes = {}, table = ATTRIBUTE_TRANSLATIONS.write; if (typeof name === 'object') { attributes = name; } else { attributes[name] = Object.isUndefined(value) ? true : value; } for (var attr in attributes) { name = table.names[attr] || attr; value = attributes[attr]; if (table.values[attr]) name = table.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; } function hasAttribute(element, attribute) { attribute = ATTRIBUTE_TRANSLATIONS.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return !!(node && node.specified); } GLOBAL.Element.Methods.Simulated.hasAttribute = hasAttribute; function classNames(element) { return new Element.ClassNames(element); } var regExpCache = {}; function getRegExpForClassName(className) { if (regExpCache[className]) return regExpCache[className]; var re = new RegExp("(^|\\s+)" + className + "(\\s+|$)"); regExpCache[className] = re; return re; } function hasClassName(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; if (elementClassName.length === 0) return false; if (elementClassName === className) return true; return getRegExpForClassName(className).test(elementClassName); } function addClassName(element, className) { if (!(element = $(element))) return; if (!hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; } function removeClassName(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( getRegExpForClassName(className), ' ').strip(); return element; } function toggleClassName(element, className, bool) { if (!(element = $(element))) return; if (Object.isUndefined(bool)) bool = !hasClassName(element, className); var method = Element[bool ? 'addClassName' : 'removeClassName']; return method(element, className); } var ATTRIBUTE_TRANSLATIONS = {}; var classProp = 'className', forProp = 'for'; DIV.setAttribute(classProp, 'x'); if (DIV.className !== 'x') { DIV.setAttribute('class', 'x'); if (DIV.className === 'x') classProp = 'class'; } var LABEL = document.createElement('label'); LABEL.setAttribute(forProp, 'x'); if (LABEL.htmlFor !== 'x') { LABEL.setAttribute('htmlFor', 'x'); if (LABEL.htmlFor === 'x') forProp = 'htmlFor'; } LABEL = null; function _getAttr(element, attribute) { return element.getAttribute(attribute); } function _getAttr2(element, attribute) { return element.getAttribute(attribute, 2); } function _getAttrNode(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ''; } function _getFlag(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; } DIV.onclick = Prototype.emptyFunction; var onclickValue = DIV.getAttribute('onclick'); var _getEv; if (String(onclickValue).indexOf('{') > -1) { _getEv = function(element, attribute) { var value = element.getAttribute(attribute); if (!value) return null; value = value.toString(); value = value.split('{')[1]; value = value.split('}')[0]; return value.strip(); }; } else if (onclickValue === '') { _getEv = function(element, attribute) { var value = element.getAttribute(attribute); if (!value) return null; return value.strip(); }; } ATTRIBUTE_TRANSLATIONS.read = { names: { 'class': classProp, 'className': classProp, 'for': forProp, 'htmlFor': forProp }, values: { style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } }; ATTRIBUTE_TRANSLATIONS.write = { names: { className: 'class', htmlFor: 'for', cellpadding: 'cellPadding', cellspacing: 'cellSpacing' }, values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; ATTRIBUTE_TRANSLATIONS.has = { names: {} }; Object.extend(ATTRIBUTE_TRANSLATIONS.write.names, ATTRIBUTE_TRANSLATIONS.read.names); var CAMEL_CASED_ATTRIBUTE_NAMES = $w('colSpan rowSpan vAlign dateTime ' + 'accessKey tabIndex encType maxLength readOnly longDesc frameBorder'); for (var i = 0, attr; attr = CAMEL_CASED_ATTRIBUTE_NAMES[i]; i++) { ATTRIBUTE_TRANSLATIONS.write.names[attr.toLowerCase()] = attr; ATTRIBUTE_TRANSLATIONS.has.names[attr.toLowerCase()] = attr; } Object.extend(ATTRIBUTE_TRANSLATIONS.read.values, { href: _getAttr2, src: _getAttr2, type: _getAttr, action: _getAttrNode, disabled: _getFlag, checked: _getFlag, readonly: _getFlag, multiple: _getFlag, onload: _getEv, onunload: _getEv, onclick: _getEv, ondblclick: _getEv, onmousedown: _getEv, onmouseup: _getEv, onmouseover: _getEv, onmousemove: _getEv, onmouseout: _getEv, onfocus: _getEv, onblur: _getEv, onkeypress: _getEv, onkeydown: _getEv, onkeyup: _getEv, onsubmit: _getEv, onreset: _getEv, onselect: _getEv, onchange: _getEv }); Object.extend(methods, { identify: identify, readAttribute: readAttribute, writeAttribute: writeAttribute, classNames: classNames, hasClassName: hasClassName, addClassName: addClassName, removeClassName: removeClassName, toggleClassName: toggleClassName }); function normalizeStyleName(style) { if (style === 'float' || style === 'styleFloat') return 'cssFloat'; return style.camelize(); } function normalizeStyleName_IE(style) { if (style === 'float' || style === 'cssFloat') return 'styleFloat'; return style.camelize(); } function setStyle(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { elementStyle.cssText += ';' + styles; if (styles.include('opacity')) { var opacity = styles.match(/opacity:\s*(\d?\.?\d*)/)[1]; Element.setOpacity(element, opacity); } return element; } for (var property in styles) { if (property === 'opacity') { Element.setOpacity(element, styles[property]); } else { var value = styles[property]; if (property === 'float' || property === 'cssFloat') { property = Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat'; } elementStyle[property] = value; } } return element; } function getStyle(element, style) { element = $(element); style = normalizeStyleName(style); var value = element.style[style]; if (!value || value === 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style === 'opacity') return value ? parseFloat(value) : 1.0; return value === 'auto' ? null : value; } function getStyle_Opera(element, style) { switch (style) { case 'height': case 'width': if (!Element.visible(element)) return null; var dim = parseInt(getStyle(element, style), 10); if (dim !== element['offset' + style.capitalize()]) return dim + 'px'; return Element.measure(element, style); default: return getStyle(element, style); } } function getStyle_IE(element, style) { element = $(element); style = normalizeStyleName_IE(style); var value = element.style[style]; if (!value && element.currentStyle) { value = element.currentStyle[style]; } if (style === 'opacity' && !STANDARD_CSS_OPACITY_SUPPORTED) return getOpacity_IE(element); if (value === 'auto') { if ((style === 'width' || style === 'height') && Element.visible(element)) return Element.measure(element, style) + 'px'; return null; } return value; } function stripAlphaFromFilter_IE(filter) { return (filter || '').replace(/alpha\([^\)]*\)/gi, ''); } function hasLayout_IE(element) { if (!element.currentStyle.hasLayout) element.style.zoom = 1; return element; } var STANDARD_CSS_OPACITY_SUPPORTED = (function() { DIV.style.cssText = "opacity:.55"; return /^0.55/.test(DIV.style.opacity); })(); function setOpacity(element, value) { element = $(element); if (value == 1 || value === '') value = ''; else if (value < 0.00001) value = 0; element.style.opacity = value; return element; } function setOpacity_IE(element, value) { if (STANDARD_CSS_OPACITY_SUPPORTED) return setOpacity(element, value); element = hasLayout_IE($(element)); var filter = Element.getStyle(element, 'filter'), style = element.style; if (value == 1 || value === '') { filter = stripAlphaFromFilter_IE(filter); if (filter) style.filter = filter; else style.removeAttribute('filter'); return element; } if (value < 0.00001) value = 0; style.filter = stripAlphaFromFilter_IE(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; } function getOpacity(element) { return Element.getStyle(element, 'opacity'); } function getOpacity_IE(element) { if (STANDARD_CSS_OPACITY_SUPPORTED) return getOpacity(element); var filter = Element.getStyle(element, 'filter'); if (filter.length === 0) return 1.0; var match = (filter || '').match(/alpha\(opacity=(.*)\)/); if (match[1]) return parseFloat(match[1]) / 100; return 1.0; } Object.extend(methods, { setStyle: setStyle, getStyle: getStyle, setOpacity: setOpacity, getOpacity: getOpacity }); if ('styleFloat' in DIV.style) { methods.getStyle = getStyle_IE; methods.setOpacity = setOpacity_IE; methods.getOpacity = getOpacity_IE; } var UID = 0; GLOBAL.Element.Storage = { UID: 1 }; function getUniqueElementID(element) { if (element === window) return 0; if (typeof element._prototypeUID === 'undefined') element._prototypeUID = Element.Storage.UID++; return element._prototypeUID; } function getUniqueElementID_IE(element) { if (element === window) return 0; if (element == document) return 1; return element.uniqueID; } var HAS_UNIQUE_ID_PROPERTY = ('uniqueID' in DIV); if (HAS_UNIQUE_ID_PROPERTY) getUniqueElementID = getUniqueElementID_IE; function getStorage(element) { if (!(element = $(element))) return; var uid = getUniqueElementID(element); if (!Element.Storage[uid]) Element.Storage[uid] = $H(); return Element.Storage[uid]; } function store(element, key, value) { if (!(element = $(element))) return; var storage = getStorage(element); if (arguments.length === 2) { storage.update(key); } else { storage.set(key, value); } return element; } function retrieve(element, key, defaultValue) { if (!(element = $(element))) return; var storage = getStorage(element), value = storage.get(key); if (Object.isUndefined(value)) { storage.set(key, defaultValue); value = defaultValue; } return value; } Object.extend(methods, { getStorage: getStorage, store: store, retrieve: retrieve }); var Methods = {}, ByTag = Element.Methods.ByTag, F = Prototype.BrowserFeatures; if (!F.ElementExtensions && ('__proto__' in DIV)) { GLOBAL.HTMLElement = {}; GLOBAL.HTMLElement.prototype = DIV['__proto__']; F.ElementExtensions = true; } function checkElementPrototypeDeficiency(tagName) { if (typeof window.Element === 'undefined') return false; var proto = window.Element.prototype; if (proto) { var id = '_' + (Math.random() + '').slice(2), el = document.createElement(tagName); proto[id] = 'x'; var isBuggy = (el[id] !== 'x'); delete proto[id]; el = null; return isBuggy; } return false; } var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkElementPrototypeDeficiency('object'); function extendElementWith(element, methods) { for (var property in methods) { var value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } } var EXTENDED = {}; function elementIsExtended(element) { var uid = getUniqueElementID(element); return (uid in EXTENDED); } function extend(element) { if (!element || elementIsExtended(element)) return element; if (element.nodeType !== Node.ELEMENT_NODE || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName.toUpperCase(); if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); extendElementWith(element, methods); EXTENDED[getUniqueElementID(element)] = true; return element; } function extend_IE8(element) { if (!element || elementIsExtended(element)) return element; var t = element.tagName; if (t && (/^(?:object|applet|embed)$/i.test(t))) { extendElementWith(element, Element.Methods); extendElementWith(element, Element.Methods.Simulated); extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); } return element; } if (F.SpecificElementExtensions) { extend = HTMLOBJECTELEMENT_PROTOTYPE_BUGGY ? extend_IE8 : Prototype.K; } function addMethodsToTagName(tagName, methods) { tagName = tagName.toUpperCase(); if (!ByTag[tagName]) ByTag[tagName] = {}; Object.extend(ByTag[tagName], methods); } function mergeMethods(destination, methods, onlyIfAbsent) { if (Object.isUndefined(onlyIfAbsent)) onlyIfAbsent = false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; var element = document.createElement(tagName), proto = element['__proto__'] || element.constructor.prototype; element = null; return proto; } function addMethods(methods) { if (arguments.length === 0) addFormMethods(); if (arguments.length === 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) { Object.extend(Element.Methods, methods || {}); } else { if (Object.isArray(tagName)) { for (var i = 0, tag; tag = tagName[i]; i++) addMethodsToTagName(tag, methods); } else { addMethodsToTagName(tagName, methods); } } var ELEMENT_PROTOTYPE = window.HTMLElement ? HTMLElement.prototype : Element.prototype; if (F.ElementExtensions) { mergeMethods(ELEMENT_PROTOTYPE, Element.Methods); mergeMethods(ELEMENT_PROTOTYPE, Element.Methods.Simulated, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; mergeMethods(klass.prototype, ByTag[tag]); } } Object.extend(Element, Element.Methods); Object.extend(Element, Element.Methods.Simulated); delete Element.ByTag; delete Element.Simulated; Element.extend.refresh(); ELEMENT_CACHE = {}; } Object.extend(GLOBAL.Element, { extend: extend, addMethods: addMethods }); if (extend === Prototype.K) { GLOBAL.Element.extend.refresh = Prototype.emptyFunction; } else { GLOBAL.Element.extend.refresh = function() { if (Prototype.BrowserFeatures.ElementExtensions) return; Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); EXTENDED = {}; }; } function addFormMethods() { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods), "BUTTON": Object.clone(Form.Element.Methods) }); } Element.addMethods(methods); })(this); (function() { function toDecimal(pctString) { var match = pctString.match(/^(\d+)%?$/i); if (!match) return null; return (Number(match[1]) / 100); } function getRawStyle(element, style) { element = $(element); var value = element.style[style]; if (!value || value === 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style === 'opacity') return value ? parseFloat(value) : 1.0; return value === 'auto' ? null : value; } function getRawStyle_IE(element, style) { var value = element.style[style]; if (!value && element.currentStyle) { value = element.currentStyle[style]; } return value; } function getContentWidth(element, context) { var boxWidth = element.offsetWidth; var bl = getPixelValue(element, 'borderLeftWidth', context) || 0; var br = getPixelValue(element, 'borderRightWidth', context) || 0; var pl = getPixelValue(element, 'paddingLeft', context) || 0; var pr = getPixelValue(element, 'paddingRight', context) || 0; return boxWidth - bl - br - pl - pr; } if ('currentStyle' in document.documentElement) { getRawStyle = getRawStyle_IE; } function getPixelValue(value, property, context) { var element = null; if (Object.isElement(value)) { element = value; value = getRawStyle(element, property); } if (value === null || Object.isUndefined(value)) { return null; } if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) { return window.parseFloat(value); } var isPercentage = value.include('%'), isViewport = (context === document.viewport); if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) { var style = element.style.left, rStyle = element.runtimeStyle.left; element.runtimeStyle.left = element.currentStyle.left; element.style.left = value || 0; value = element.style.pixelLeft; element.style.left = style; element.runtimeStyle.left = rStyle; return value; } if (element && isPercentage) { context = context || element.parentNode; var decimal = toDecimal(value), whole = null; var isHorizontal = property.include('left') || property.include('right') || property.include('width'); var isVertical = property.include('top') || property.include('bottom') || property.include('height'); if (context === document.viewport) { if (isHorizontal) { whole = document.viewport.getWidth(); } else if (isVertical) { whole = document.viewport.getHeight(); } } else { if (isHorizontal) { whole = $(context).measure('width'); } else if (isVertical) { whole = $(context).measure('height'); } } return (whole === null) ? 0 : whole * decimal; } return 0; } function toCSSPixels(number) { if (Object.isString(number) && number.endsWith('px')) return number; return number + 'px'; } function isDisplayed(element) { while (element && element.parentNode) { var display = element.getStyle('display'); if (display === 'none') { return false; } element = $(element.parentNode); } return true; } var hasLayout = Prototype.K; if ('currentStyle' in document.documentElement) { hasLayout = function(element) { if (!element.currentStyle.hasLayout) { element.style.zoom = 1; } return element; }; } function cssNameFor(key) { if (key.include('border')) key = key + '-width'; return key.camelize(); } Element.Layout = Class.create(Hash, { initialize: function($super, element, preCompute) { $super(); this.element = $(element); Element.Layout.PROPERTIES.each( function(property) { this._set(property, null); }, this); if (preCompute) { this._preComputing = true; this._begin(); Element.Layout.PROPERTIES.each( this._compute, this ); this._end(); this._preComputing = false; } }, _set: function(property, value) { return Hash.prototype.set.call(this, property, value); }, set: function(property, value) { throw "Properties of Element.Layout are read-only."; }, get: function($super, property) { var value = $super(property); return value === null ? this._compute(property) : value; }, _begin: function() { if (this._isPrepared()) return; var element = this.element; if (isDisplayed(element)) { this._setPrepared(true); return; } var originalStyles = { position: element.style.position || '', width: element.style.width || '', visibility: element.style.visibility || '', display: element.style.display || '' }; element.store('prototype_original_styles', originalStyles); var position = getRawStyle(element, 'position'), width = element.offsetWidth; if (width === 0 || width === null) { element.style.display = 'block'; width = element.offsetWidth; } var context = (position === 'fixed') ? document.viewport : element.parentNode; var tempStyles = { visibility: 'hidden', display: 'block' }; if (position !== 'fixed') tempStyles.position = 'absolute'; element.setStyle(tempStyles); var positionedWidth = element.offsetWidth, newWidth; if (width && (positionedWidth === width)) { newWidth = getContentWidth(element, context); } else if (position === 'absolute' || position === 'fixed') { newWidth = getContentWidth(element, context); } else { var parent = element.parentNode, pLayout = $(parent).getLayout(); newWidth = pLayout.get('width') - this.get('margin-left') - this.get('border-left') - this.get('padding-left') - this.get('padding-right') - this.get('border-right') - this.get('margin-right'); } element.setStyle({ width: newWidth + 'px' }); this._setPrepared(true); }, _end: function() { var element = this.element; var originalStyles = element.retrieve('prototype_original_styles'); element.store('prototype_original_styles', null); element.setStyle(originalStyles); this._setPrepared(false); }, _compute: function(property) { var COMPUTATIONS = Element.Layout.COMPUTATIONS; if (!(property in COMPUTATIONS)) { throw "Property not found."; } return this._set(property, COMPUTATIONS[property].call(this, this.element)); }, _isPrepared: function() { return this.element.retrieve('prototype_element_layout_prepared', false); }, _setPrepared: function(bool) { return this.element.store('prototype_element_layout_prepared', bool); }, toObject: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var obj = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) obj[key] = value; }, this); return obj; }, toHash: function() { var obj = this.toObject.apply(this, arguments); return new Hash(obj); }, toCSS: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var css = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) css[cssNameFor(key)] = value + 'px'; }, this); return css; }, inspect: function() { return "#"; } }); Object.extend(Element.Layout, { PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'), COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'), COMPUTATIONS: { 'height': function(element) { if (!this._preComputing) this._begin(); var bHeight = this.get('border-box-height'); if (bHeight <= 0) { if (!this._preComputing) this._end(); return 0; } var bTop = this.get('border-top'), bBottom = this.get('border-bottom'); var pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); if (!this._preComputing) this._end(); return bHeight - bTop - bBottom - pTop - pBottom; }, 'width': function(element) { if (!this._preComputing) this._begin(); var bWidth = this.get('border-box-width'); if (bWidth <= 0) { if (!this._preComputing) this._end(); return 0; } var bLeft = this.get('border-left'), bRight = this.get('border-right'); var pLeft = this.get('padding-left'), pRight = this.get('padding-right'); if (!this._preComputing) this._end(); return bWidth - bLeft - bRight - pLeft - pRight; }, 'padding-box-height': function(element) { var height = this.get('height'), pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); return height + pTop + pBottom; }, 'padding-box-width': function(element) { var width = this.get('width'), pLeft = this.get('padding-left'), pRight = this.get('padding-right'); return width + pLeft + pRight; }, 'border-box-height': function(element) { if (!this._preComputing) this._begin(); var height = element.offsetHeight; if (!this._preComputing) this._end(); return height; }, 'border-box-width': function(element) { if (!this._preComputing) this._begin(); var width = element.offsetWidth; if (!this._preComputing) this._end(); return width; }, 'margin-box-height': function(element) { var bHeight = this.get('border-box-height'), mTop = this.get('margin-top'), mBottom = this.get('margin-bottom'); if (bHeight <= 0) return 0; return bHeight + mTop + mBottom; }, 'margin-box-width': function(element) { var bWidth = this.get('border-box-width'), mLeft = this.get('margin-left'), mRight = this.get('margin-right'); if (bWidth <= 0) return 0; return bWidth + mLeft + mRight; }, 'top': function(element) { var offset = element.positionedOffset(); return offset.top; }, 'bottom': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pHeight = parent.measure('height'); var mHeight = this.get('border-box-height'); return pHeight - mHeight - offset.top; }, 'left': function(element) { var offset = element.positionedOffset(); return offset.left; }, 'right': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pWidth = parent.measure('width'); var mWidth = this.get('border-box-width'); return pWidth - mWidth - offset.left; }, 'padding-top': function(element) { return getPixelValue(element, 'paddingTop'); }, 'padding-bottom': function(element) { return getPixelValue(element, 'paddingBottom'); }, 'padding-left': function(element) { return getPixelValue(element, 'paddingLeft'); }, 'padding-right': function(element) { return getPixelValue(element, 'paddingRight'); }, 'border-top': function(element) { return getPixelValue(element, 'borderTopWidth'); }, 'border-bottom': function(element) { return getPixelValue(element, 'borderBottomWidth'); }, 'border-left': function(element) { return getPixelValue(element, 'borderLeftWidth'); }, 'border-right': function(element) { return getPixelValue(element, 'borderRightWidth'); }, 'margin-top': function(element) { return getPixelValue(element, 'marginTop'); }, 'margin-bottom': function(element) { return getPixelValue(element, 'marginBottom'); }, 'margin-left': function(element) { return getPixelValue(element, 'marginLeft'); }, 'margin-right': function(element) { return getPixelValue(element, 'marginRight'); } } }); if ('getBoundingClientRect' in document.documentElement) { Object.extend(Element.Layout.COMPUTATIONS, { 'right': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.right - rect.right).round(); }, 'bottom': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.bottom - rect.bottom).round(); } }); } Element.Offset = Class.create({ initialize: function(left, top) { this.left = left.round(); this.top = top.round(); this[0] = this.left; this[1] = this.top; }, relativeTo: function(offset) { return new Element.Offset( this.left - offset.left, this.top - offset.top ); }, inspect: function() { return "#".interpolate(this); }, toString: function() { return "[#{left}, #{top}]".interpolate(this); }, toArray: function() { return [this.left, this.top]; } }); function getLayout(element, preCompute) { return new Element.Layout(element, preCompute); } function measure(element, property) { return $(element).getLayout().get(property); } function getHeight(element) { return Element.getDimensions(element).height; } function getWidth(element) { return Element.getDimensions(element).width; } function getDimensions(element) { element = $(element); var display = Element.getStyle(element, 'display'); if (display && display !== 'none') { return { width: element.offsetWidth, height: element.offsetHeight }; } var style = element.style; var originalStyles = { visibility: style.visibility, position: style.position, display: style.display }; var newStyles = { visibility: 'hidden', display: 'block' }; if (originalStyles.position !== 'fixed') newStyles.position = 'absolute'; Element.setStyle(element, newStyles); var dimensions = { width: element.offsetWidth, height: element.offsetHeight }; Element.setStyle(element, originalStyles); return dimensions; } function getOffsetParent(element) { element = $(element); if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element)) return $(document.body); var isInline = (Element.getStyle(element, 'display') === 'inline'); if (!isInline && element.offsetParent) return $(element.offsetParent); while ((element = element.parentNode) && element !== document.body) { if (Element.getStyle(element, 'position') !== 'static') { return isHtml(element) ? $(document.body) : $(element); } } return $(document.body); } function cumulativeOffset(element) { element = $(element); var valueT = 0, valueL = 0; if (element.parentNode) { do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); } return new Element.Offset(valueL, valueT); } function positionedOffset(element) { element = $(element); var layout = element.getLayout(); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (isBody(element)) break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); valueL -= layout.get('margin-top'); valueT -= layout.get('margin-left'); return new Element.Offset(valueL, valueT); } function cumulativeScrollOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return new Element.Offset(valueL, valueT); } function viewportOffset(forElement) { var valueT = 0, valueL = 0, docBody = document.body; var element = $(forElement); do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == docBody && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (element != docBody) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return new Element.Offset(valueL, valueT); } function absolutize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'absolute') { return element; } var offsetParent = getOffsetParent(element); var eOffset = element.viewportOffset(), pOffset = offsetParent.viewportOffset(); var offset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); element.store('prototype_absolutize_original_styles', { left: element.getStyle('left'), top: element.getStyle('top'), width: element.getStyle('width'), height: element.getStyle('height') }); element.setStyle({ position: 'absolute', top: offset.top + 'px', left: offset.left + 'px', width: layout.get('width') + 'px', height: layout.get('height') + 'px' }); return element; } function relativize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'relative') { return element; } var originalStyles = element.retrieve('prototype_absolutize_original_styles'); if (originalStyles) element.setStyle(originalStyles); return element; } function scrollTo(element) { element = $(element); var pos = Element.cumulativeOffset(element); window.scrollTo(pos.left, pos.top); return element; } function makePositioned(element) { element = $(element); var position = Element.getStyle(element, 'position'), styles = {}; if (position === 'static' || !position) { styles.position = 'relative'; if (Prototype.Browser.Opera) { styles.top = 0; styles.left = 0; } Element.setStyle(element, styles); Element.store(element, 'prototype_made_positioned', true); } return element; } function undoPositioned(element) { element = $(element); var storage = Element.getStorage(element), madePositioned = storage.get('prototype_made_positioned'); if (madePositioned) { storage.unset('prototype_made_positioned'); Element.setStyle(element, { position: '', top: '', bottom: '', left: '', right: '' }); } return element; } function makeClipping(element) { element = $(element); var storage = Element.getStorage(element), madeClipping = storage.get('prototype_made_clipping'); if (Object.isUndefined(madeClipping)) { var overflow = Element.getStyle(element, 'overflow'); storage.set('prototype_made_clipping', overflow); if (overflow !== 'hidden') element.style.overflow = 'hidden'; } return element; } function undoClipping(element) { element = $(element); var storage = Element.getStorage(element), overflow = storage.get('prototype_made_clipping'); if (!Object.isUndefined(overflow)) { storage.unset('prototype_made_clipping'); element.style.overflow = overflow || ''; } return element; } function clonePosition(element, source, options) { options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, options || {}); source = $(source); element = $(element); var p, delta, layout, styles = {}; if (options.setLeft || options.setTop) { p = Element.viewportOffset(source); delta = [0, 0]; if (Element.getStyle(element, 'position') === 'absolute') { var parent = Element.getOffsetParent(element); if (parent !== document.body) delta = Element.viewportOffset(parent); } } if (options.setWidth || options.setHeight) { layout = Element.getLayout(source); } if (options.setLeft) styles.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) styles.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) styles.width = layout.get('border-box-width') + 'px'; if (options.setHeight) styles.height = layout.get('border-box-height') + 'px'; return Element.setStyle(element, styles); } if (Prototype.Browser.IE) { getOffsetParent = getOffsetParent.wrap( function(proceed, element) { element = $(element); if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element)) return $(document.body); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); positionedOffset = positionedOffset.wrap(function(proceed, element) { element = $(element); if (!element.parentNode) return new Element.Offset(0, 0); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); var offsetParent = element.getOffsetParent(); if (offsetParent && offsetParent.getStyle('position') === 'fixed') hasLayout(offsetParent); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; }); } else if (Prototype.Browser.Webkit) { cumulativeOffset = function(element) { element = $(element); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) { if (Element.getStyle(element, 'position') == 'absolute') break; } element = element.offsetParent; } while (element); return new Element.Offset(valueL, valueT); }; } Element.addMethods({ getLayout: getLayout, measure: measure, getWidth: getWidth, getHeight: getHeight, getDimensions: getDimensions, getOffsetParent: getOffsetParent, cumulativeOffset: cumulativeOffset, positionedOffset: positionedOffset, cumulativeScrollOffset: cumulativeScrollOffset, viewportOffset: viewportOffset, absolutize: absolutize, relativize: relativize, scrollTo: scrollTo, makePositioned: makePositioned, undoPositioned: undoPositioned, makeClipping: makeClipping, undoClipping: undoClipping, clonePosition: clonePosition }); function isBody(element) { return element.nodeName.toUpperCase() === 'BODY'; } function isHtml(element) { return element.nodeName.toUpperCase() === 'HTML'; } function isDocument(element) { return element.nodeType === Node.DOCUMENT_NODE; } function isDetached(element) { return element !== document.body && !Element.descendantOf(element, document.body); } if ('getBoundingClientRect' in document.documentElement) { Element.addMethods({ viewportOffset: function(element) { element = $(element); if (isDetached(element)) return new Element.Offset(0, 0); var rect = element.getBoundingClientRect(), docEl = document.documentElement; return new Element.Offset(rect.left - docEl.clientLeft, rect.top - docEl.clientTop); } }); } })(); (function() { var IS_OLD_OPERA = Prototype.Browser.Opera && (window.parseFloat(window.opera.version()) < 9.5); var ROOT = null; function getRootElement() { if (ROOT) return ROOT; ROOT = IS_OLD_OPERA ? document.body : document.documentElement; return ROOT; } function getDimensions() { return { width: this.getWidth(), height: this.getHeight() }; } function getWidth() { return getRootElement().clientWidth; } function getHeight() { return getRootElement().clientHeight; } function getScrollOffsets() { var x = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft; var y = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; return new Element.Offset(x, y); } document.viewport = { getDimensions: getDimensions, getWidth: getWidth, getHeight: getHeight, getScrollOffsets: getScrollOffsets }; })(); window.$$ = function() { var expression = $A(arguments).join(', '); return Prototype.Selector.select(expression, document); }; Prototype.Selector = (function() { function select() { throw new Error('Method "Prototype.Selector.select" must be defined.'); } function match() { throw new Error('Method "Prototype.Selector.match" must be defined.'); } function find(elements, expression, index) { index = index || 0; var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i; for (i = 0; i < length; i++) { if (match(elements[i], expression) && index == matchIndex++) { return Element.extend(elements[i]); } } } function extendElements(elements) { for (var i = 0, length = elements.length; i < length; i++) { Element.extend(elements[i]); } return elements; } var K = Prototype.K; return { select: select, match: match, find: find, extendElements: (Element.extend === K) ? K : extendElements, extendElement: Element.extend }; })(); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true, rBackslash = /\\/g, rNonWord = /\W/; [0, 0].sort(function() { baseHasDuplicate = false; return 0; }); var Sizzle = function( selector, context, results, seed ) { results = results || []; context = context || document; var origContext = context; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var m, set, checkSet, extra, ret, cur, pop, i, prune = true, contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; do { chunker.exec( "" ); m = chunker.exec( soFar ); if ( m ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } } while ( m ); if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set ); } } } else { if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray( set ); } else { prune = false; } while ( parts.length ) { cur = parts.pop(); pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function( results ) { if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort( sortOrder ); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[ i - 1 ] ) { results.splice( i--, 1 ); } } } } return results; }; Sizzle.matches = function( expr, set ) { return Sizzle( expr, null, null, set ); }; Sizzle.matchesSelector = function( node, expr ) { return Sizzle( expr, null, null, [node] ).length > 0; }; Sizzle.find = function( expr, context, isXML ) { var set; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace( rBackslash, "" ); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( "*" ) : []; } return { set: set, expr: expr }; }; Sizzle.filter = function( expr, set, inplace, not ) { var match, anyFound, old = expr, result = [], curLoop = set, isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { var found, item, filter = Expr.filter[ type ], left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw "Syntax error, unrecognized expression: " + msg; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function( elem ) { return elem.getAttribute( "href" ); }, type: function( elem ) { return elem.getAttribute( "type" ); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !rNonWord.test( part ), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function( checkSet, part ) { var elem, isPartStr = typeof part === "string", i = 0, l = checkSet.length; if ( isPartStr && !rNonWord.test( part ) ) { part = part.toLowerCase(); for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); }, "~": function( checkSet, part, isXML ) { var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); } }, find: { ID: function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m && m.parentNode ? [m] : []; } }, NAME: function( match, context ) { if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName( match[1] ); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function( match, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( match[1] ); } } }, preFilter: { CLASS: function( match, curLoop, inplace, result, not, isXML ) { match = " " + match[1].replace( rBackslash, "" ) + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function( match ) { return match[1].replace( rBackslash, "" ); }, TAG: function( match, curLoop ) { return match[1].replace( rBackslash, "" ).toLowerCase(); }, CHILD: function( match ) { if ( match[1] === "nth" ) { if ( !match[2] ) { Sizzle.error( match[0] ); } match[2] = match[2].replace(/^\+|\s*/g, ''); var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } else if ( match[2] ) { Sizzle.error( match[0] ); } match[0] = done++; return match; }, ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function( match, curLoop, inplace, result, not ) { if ( match[1] === "not" ) { if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function( match ) { match.unshift( true ); return match; } }, filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; }, disabled: function( elem ) { return elem.disabled === true; }, checked: function( elem ) { return elem.checked === true; }, selected: function( elem ) { if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, parent: function( elem ) { return !!elem.firstChild; }, empty: function( elem ) { return !elem.firstChild; }, has: function( elem, i, match ) { return !!Sizzle( match[3], elem ).length; }, header: function( elem ) { return (/h\d/i).test( elem.nodeName ); }, text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, radio: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; }, checkbox: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; }, file: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; }, password: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; }, submit: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "submit" === elem.type; }, image: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; }, reset: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "reset" === elem.type; }, button: function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && "button" === elem.type || name === "button"; }, input: function( elem ) { return (/input|select|textarea|button/i).test( elem.nodeName ); }, focus: function( elem ) { return elem === elem.ownerDocument.activeElement; } }, setFilters: { first: function( elem, i ) { return i === 0; }, last: function( elem, i, match, array ) { return i === array.length - 1; }, even: function( elem, i ) { return i % 2 === 0; }, odd: function( elem, i ) { return i % 2 === 1; }, lt: function( elem, i, match ) { return i < match[3] - 0; }, gt: function( elem, i, match ) { return i > match[3] - 0; }, nth: function( elem, i, match ) { return match[3] - 0 === i; }, eq: function( elem, i, match ) { return match[3] - 0 === i; } }, filter: { PSEUDO: function( elem, match, i, array ) { var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var j = 0, l = not.length; j < l; j++ ) { if ( not[j] === elem ) { return false; } } return true; } else { Sizzle.error( name ); } }, CHILD: function( elem, match ) { var type = match[1], node = elem; switch ( type ) { case "only": case "first": while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case "nth": var first = match[2], last = match[3]; if ( first === 1 && last === 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function( elem, match ) { return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function( elem, match ) { var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function( elem, match, i, array ) { var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS, fescape = function(all, num){ return "\\" + (num - 0 + 1); }; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); } var makeArray = function( array, results ) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; } catch( e ) { makeArray = function( array, results ) { var i = 0, ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( ; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder, siblingCheck; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; }; } else { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } else if ( a.sourceIndex && b.sourceIndex ) { return a.sourceIndex - b.sourceIndex; } var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; if ( aup === bup ) { return siblingCheck( a, b ); } else if ( !aup ) { return -1; } else if ( !bup ) { return 1; } while ( cur ) { ap.unshift( cur ); cur = cur.parentNode; } cur = bup; while ( cur ) { bp.unshift( cur ); cur = cur.parentNode; } al = ap.length; bl = bp.length; for ( var i = 0; i < al && i < bl; i++ ) { if ( ap[i] !== bp[i] ) { return siblingCheck( ap[i], bp[i] ); } } return i === al ? siblingCheck( a, bp[i], -1 ) : siblingCheck( ap[i], b, 1 ); }; siblingCheck = function( a, b, ret ) { if ( a === b ) { return ret; } var cur = a.nextSibling; while ( cur ) { if ( cur === b ) { return -1; } cur = cur.nextSibling; } return 1; }; } Sizzle.getText = function( elems ) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; } else if ( elem.nodeType !== 8 ) { ret += Sizzle.getText( elem.childNodes ); } } return ret; }; (function(){ var form = document.createElement("div"), id = "script" + (new Date()).getTime(), root = document.documentElement; form.innerHTML = ""; root.insertBefore( form, root.firstChild ); if ( document.getElementById( id ) ) { Expr.find.ID = function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function( elem, match ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); root = form = null; })(); (function(){ var div = document.createElement("div"); div.appendChild( document.createComment("") ); if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function( match, context ) { var results = context.getElementsByTagName( match[1] ); if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } div.innerHTML = ""; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function( elem ) { return elem.getAttribute( "href", 2 ); }; } div = null; })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"), id = "__sizzle__"; div.innerHTML = "

          "; if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function( query, context, extra, seed ) { context = context || document; if ( !seed && !Sizzle.isXML(context) ) { var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } if ( context.nodeType === 9 ) { if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); if ( elem && elem.parentNode ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } } else { return makeArray( [], extra ); } } try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { var oldContext = context, old = context.getAttribute( "id" ), nid = old || id, hasParent = context.parentNode, relativeHierarchySelector = /^\s*[+~]/.test( query ); if ( !old ) { context.setAttribute( "id", nid ); } else { nid = nid.replace( /'/g, "\\$&" ); } if ( relativeHierarchySelector && hasParent ) { context = context.parentNode; } try { if ( !relativeHierarchySelector || hasParent ) { return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); } } catch(pseudoError) { } finally { if ( !old ) { oldContext.removeAttribute( "id" ); } } } } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } div = null; })(); } (function(){ var html = document.documentElement, matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; if ( matches ) { var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), pseudoWorks = false; try { matches.call( document.documentElement, "[test!='']:sizzle" ); } catch( pseudoError ) { pseudoWorks = true; } Sizzle.matchesSelector = function( node, expr ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); if ( ret || !disconnectedMatch || node.document && node.document.nodeType !== 11 ) { return ret; } } } catch(e) {} } return Sizzle(expr, null, null, [node]).length > 0; }; } })(); (function(){ var div = document.createElement("div"); div.innerHTML = "
          "; if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; div = null; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } if ( document.documentElement.contains ) { Sizzle.contains = function( a, b ) { return a !== b && (a.contains ? a.contains(b) : true); }; } else if ( document.documentElement.compareDocumentPosition ) { Sizzle.contains = function( a, b ) { return !!(a.compareDocumentPosition(b) & 16); }; } else { Sizzle.contains = function() { return false; }; } Sizzle.isXML = function( elem ) { var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function( selector, context ) { var match, tmpSet = [], later = "", root = context.nodeType ? [context] : context; while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; window.Sizzle = Sizzle; })(); Prototype._original_property = window.Sizzle; ;(function(engine) { var extendElements = Prototype.Selector.extendElements; function select(selector, scope) { return extendElements(engine(selector, scope || document)); } function match(element, selector) { return engine.matches(selector, [element]).length == 1; } Prototype.Selector.engine = engine; Prototype.Selector.select = select; Prototype.Selector.match = match; })(Sizzle); window.Sizzle = Prototype._original_property; delete Prototype._original_property; var Form = { reset: function(form) { form = $(form); form.reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit, accumulator, initial; if (options.hash) { initial = {}; accumulator = function(result, key, value) { if (key in result) { if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; return result; }; } else { initial = ''; accumulator = function(result, key, value) { value = value.gsub(/(\r)?\n/, '\r\n'); value = encodeURIComponent(value); value = value.gsub(/%20/, '+'); return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value; } } return elements.inject(initial, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { result = accumulator(result, key, value); } } return result; }); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { var elements = $(form).getElementsByTagName('*'); var element, results = [], serializers = Form.Element.Serializers; for (var i = 0; element = elements[i]; i++) { if (serializers[element.tagName.toLowerCase()]) results.push(Element.extend(element)); } return results; }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return /^(?:input|select|textarea)$/i.test(element.tagName); }); }, focusFirstElement: function(form) { form = $(form); var element = form.findFirstElement(); if (element) element.activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !(/^(?:button|reset|submit)$/i.test(element.type)))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = (function() { function input(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return inputSelector(element, value); default: return valueSelector(element, value); } } function inputSelector(element, value) { if (Object.isUndefined(value)) return element.checked ? element.value : null; else element.checked = !!value; } function valueSelector(element, value) { if (Object.isUndefined(value)) return element.value; else element.value = value; } function select(element, value) { if (Object.isUndefined(value)) return (element.type === 'select-one' ? selectOne : selectMany)(element); var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } function selectOne(element) { var index = element.selectedIndex; return index >= 0 ? optionValue(element.options[index]) : null; } function selectMany(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(optionValue(opt)); } return values; } function optionValue(opt) { return Element.hasAttribute(opt, 'value') ? opt.value : opt.text; } return { input: input, inputSelector: inputSelector, textarea: valueSelector, select: select, selectOne: selectOne, selectMany: selectMany, optionValue: optionValue, button: valueSelector }; })(); /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); (function(GLOBAL) { var DIV = document.createElement('div'); var docEl = document.documentElement; var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl && 'onmouseleave' in docEl; var Event = { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45 }; var isIELegacyEvent = function(event) { return false; }; if (window.attachEvent) { if (window.addEventListener) { isIELegacyEvent = function(event) { return !(event instanceof window.Event); }; } else { isIELegacyEvent = function(event) { return true; }; } } var _isButton; function _isButtonForDOMEvents(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); } var legacyButtonMap = { 0: 1, 1: 4, 2: 2 }; function _isButtonForLegacyEvents(event, code) { return event.button === legacyButtonMap[code]; } function _isButtonForWebKit(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 2 || (event.which == 1 && event.metaKey); case 2: return event.which == 3; default: return false; } } if (window.attachEvent) { if (!window.addEventListener) { _isButton = _isButtonForLegacyEvents; } else { _isButton = function(event, code) { return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) : _isButtonForDOMEvents(event, code); } } } else if (Prototype.Browser.WebKit) { _isButton = _isButtonForWebKit; } else { _isButton = _isButtonForDOMEvents; } function isLeftClick(event) { return _isButton(event, 0) } function isMiddleClick(event) { return _isButton(event, 1) } function isRightClick(event) { return _isButton(event, 2) } function element(event) { return Element.extend(_element(event)); } function _element(event) { event = Event.extend(event); var node = event.target, type = event.type, currentTarget = event.currentTarget; if (currentTarget && currentTarget.tagName) { if (type === 'load' || type === 'error' || (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' && currentTarget.type === 'radio')) node = currentTarget; } if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; return Element.extend(node); } function findElement(event, expression) { var element = _element(event), match = Prototype.Selector.match; if (!expression) return Element.extend(element); while (element) { if (Object.isElement(element) && match(element, expression)) return Element.extend(element); element = element.parentNode; } } function pointer(event) { return { x: pointerX(event), y: pointerY(event) }; } function pointerX(event) { var docElement = document.documentElement, body = document.body || { scrollLeft: 0 }; return event.pageX || (event.clientX + (docElement.scrollLeft || body.scrollLeft) - (docElement.clientLeft || 0)); } function pointerY(event) { var docElement = document.documentElement, body = document.body || { scrollTop: 0 }; return event.pageY || (event.clientY + (docElement.scrollTop || body.scrollTop) - (docElement.clientTop || 0)); } function stop(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } Event.Methods = { isLeftClick: isLeftClick, isMiddleClick: isMiddleClick, isRightClick: isRightClick, element: element, findElement: findElement, pointer: pointer, pointerX: pointerX, pointerY: pointerY, stop: stop }; var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (window.attachEvent) { function _relatedTarget(event) { var element; switch (event.type) { case 'mouseover': case 'mouseenter': element = event.fromElement; break; case 'mouseout': case 'mouseleave': element = event.toElement; break; default: return null; } return Element.extend(element); } var additionalMethods = { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return '[object Event]' } }; Event.extend = function(event, element) { if (!event) return false; if (!isIELegacyEvent(event)) return event; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement || element, relatedTarget: _relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); Object.extend(event, methods); Object.extend(event, additionalMethods); return event; }; } else { Event.extend = Prototype.K; } if (window.addEventListener) { Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; Object.extend(Event.prototype, methods); } var EVENT_TRANSLATIONS = { mouseenter: 'mouseover', mouseleave: 'mouseout' }; function getDOMEventName(eventName) { return EVENT_TRANSLATIONS[eventName] || eventName; } if (MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) getDOMEventName = Prototype.K; function getUniqueElementID(element) { if (element === window) return 0; if (typeof element._prototypeUID === 'undefined') element._prototypeUID = Element.Storage.UID++; return element._prototypeUID; } function getUniqueElementID_IE(element) { if (element === window) return 0; if (element == document) return 1; return element.uniqueID; } if ('uniqueID' in DIV) getUniqueElementID = getUniqueElementID_IE; function isCustomEvent(eventName) { return eventName.include(':'); } Event._isCustomEvent = isCustomEvent; function getRegistryForElement(element, uid) { var CACHE = GLOBAL.Event.cache; if (Object.isUndefined(uid)) uid = getUniqueElementID(element); if (!CACHE[uid]) CACHE[uid] = { element: element }; return CACHE[uid]; } function destroyRegistryForElement(element, uid) { if (Object.isUndefined(uid)) uid = getUniqueElementID(element); delete GLOBAL.Event.cache[uid]; } function register(element, eventName, handler) { var registry = getRegistryForElement(element); if (!registry[eventName]) registry[eventName] = []; var entries = registry[eventName]; var i = entries.length; while (i--) if (entries[i].handler === handler) return null; var uid = getUniqueElementID(element); var responder = GLOBAL.Event._createResponder(uid, eventName, handler); var entry = { responder: responder, handler: handler }; entries.push(entry); return entry; } function unregister(element, eventName, handler) { var registry = getRegistryForElement(element); var entries = registry[eventName]; if (!entries) return; var i = entries.length, entry; while (i--) { if (entries[i].handler === handler) { entry = entries[i]; break; } } if (!entry) return; var index = entries.indexOf(entry); entries.splice(index, 1); return entry; } function observe(element, eventName, handler) { element = $(element); var entry = register(element, eventName, handler); if (entry === null) return element; var responder = entry.responder; if (isCustomEvent(eventName)) observeCustomEvent(element, eventName, responder); else observeStandardEvent(element, eventName, responder); return element; } function observeStandardEvent(element, eventName, responder) { var actualEventName = getDOMEventName(eventName); if (element.addEventListener) { element.addEventListener(actualEventName, responder, false); } else { element.attachEvent('on' + actualEventName, responder); } } function observeCustomEvent(element, eventName, responder) { if (element.addEventListener) { element.addEventListener('dataavailable', responder, false); } else { element.attachEvent('ondataavailable', responder); element.attachEvent('onlosecapture', responder); } } function stopObserving(element, eventName, handler) { element = $(element); var handlerGiven = !Object.isUndefined(handler), eventNameGiven = !Object.isUndefined(eventName); if (!eventNameGiven && !handlerGiven) { stopObservingElement(element); return element; } if (!handlerGiven) { stopObservingEventName(element, eventName); return element; } var entry = unregister(element, eventName, handler); if (!entry) return element; removeEvent(element, eventName, entry.responder); return element; } function stopObservingStandardEvent(element, eventName, responder) { var actualEventName = getDOMEventName(eventName); if (element.removeEventListener) { element.removeEventListener(actualEventName, responder, false); } else { element.detachEvent('on' + actualEventName, responder); } } function stopObservingCustomEvent(element, eventName, responder) { if (element.removeEventListener) { element.removeEventListener('dataavailable', responder, false); } else { element.detachEvent('ondataavailable', responder); element.detachEvent('onlosecapture', responder); } } function stopObservingElement(element) { var uid = getUniqueElementID(element), registry = getRegistryForElement(element, uid); destroyRegistryForElement(element, uid); var entries, i; for (var eventName in registry) { if (eventName === 'element') continue; entries = registry[eventName]; i = entries.length; while (i--) removeEvent(element, eventName, entries[i].responder); } } function stopObservingEventName(element, eventName) { var registry = getRegistryForElement(element); var entries = registry[eventName]; if (!entries) return; delete registry[eventName]; var i = entries.length; while (i--) removeEvent(element, eventName, entries[i].responder); } function removeEvent(element, eventName, handler) { if (isCustomEvent(eventName)) stopObservingCustomEvent(element, eventName, handler); else stopObservingStandardEvent(element, eventName, handler); } function getFireTarget(element) { if (element !== document) return element; if (document.createEvent && !element.dispatchEvent) return document.documentElement; return element; } function fire(element, eventName, memo, bubble) { element = getFireTarget($(element)); if (Object.isUndefined(bubble)) bubble = true; memo = memo || {}; var event = fireEvent(element, eventName, memo, bubble); return Event.extend(event); } function fireEvent_DOM(element, eventName, memo, bubble) { var event = document.createEvent('HTMLEvents'); event.initEvent('dataavailable', bubble, true); event.eventName = eventName; event.memo = memo; element.dispatchEvent(event); return event; } function fireEvent_IE(element, eventName, memo, bubble) { var event = document.createEventObject(); event.eventType = bubble ? 'ondataavailable' : 'onlosecapture'; event.eventName = eventName; event.memo = memo; element.fireEvent(event.eventType, event); return event; } var fireEvent = document.createEvent ? fireEvent_DOM : fireEvent_IE; Event.Handler = Class.create({ initialize: function(element, eventName, selector, callback) { this.element = $(element); this.eventName = eventName; this.selector = selector; this.callback = callback; this.handler = this.handleEvent.bind(this); }, start: function() { Event.observe(this.element, this.eventName, this.handler); return this; }, stop: function() { Event.stopObserving(this.element, this.eventName, this.handler); return this; }, handleEvent: function(event) { var element = Event.findElement(event, this.selector); if (element) this.callback.call(this.element, event, element); } }); function on(element, eventName, selector, callback) { element = $(element); if (Object.isFunction(selector) && Object.isUndefined(callback)) { callback = selector, selector = null; } return new Event.Handler(element, eventName, selector, callback).start(); } Object.extend(Event, Event.Methods); Object.extend(Event, { fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Element.addMethods({ fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Object.extend(document, { fire: fire.methodize(), observe: observe.methodize(), stopObserving: stopObserving.methodize(), on: on.methodize(), loaded: false }); if (GLOBAL.Event) Object.extend(window.Event, Event); else GLOBAL.Event = Event; GLOBAL.Event.cache = {}; function destroyCache_IE() { GLOBAL.Event.cache = null; } if (window.attachEvent) window.attachEvent('onunload', destroyCache_IE); DIV = null; docEl = null; })(this); (function(GLOBAL) { /* Code for creating leak-free event responders is based on work by John-David Dalton. */ var docEl = document.documentElement; var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl && 'onmouseleave' in docEl; function isSimulatedMouseEnterLeaveEvent(eventName) { return !MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && (eventName === 'mouseenter' || eventName === 'mouseleave'); } function createResponder(uid, eventName, handler) { if (Event._isCustomEvent(eventName)) return createResponderForCustomEvent(uid, eventName, handler); if (isSimulatedMouseEnterLeaveEvent(eventName)) return createMouseEnterLeaveResponder(uid, eventName, handler); return function(event) { var cacheEntry = Event.cache[uid]; var element = cacheEntry.element; Event.extend(event, element); handler.call(element, event); }; } function createResponderForCustomEvent(uid, eventName, handler) { return function(event) { var cacheEntry = Event.cache[uid], element = cacheEntry.element; if (Object.isUndefined(event.eventName)) return false; if (event.eventName !== eventName) return false; Event.extend(event, element); handler.call(element, event); }; } function createMouseEnterLeaveResponder(uid, eventName, handler) { return function(event) { var cacheEntry = Event.cache[uid], element = cacheEntry.element; Event.extend(event, element); var parent = event.relatedTarget; while (parent && parent !== element) { try { parent = parent.parentNode; } catch(e) { parent = element; } } if (parent === element) return; handler.call(element, event); } } GLOBAL.Event._createResponder = createResponder; docEl = null; })(this); (function(GLOBAL) { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ var TIMER; function fireContentLoadedEvent() { if (document.loaded) return; if (TIMER) window.clearTimeout(TIMER); document.loaded = true; document.fire('dom:loaded'); } function checkReadyState() { if (document.readyState === 'complete') { document.detachEvent('onreadystatechange', checkReadyState); fireContentLoadedEvent(); } } function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch (e) { TIMER = pollDoScroll.defer(); return; } fireContentLoadedEvent(); } if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else { document.attachEvent('onreadystatechange', checkReadyState); if (window == top) TIMER = pollDoScroll.defer(); } Event.observe(window, 'load', fireContentLoadedEvent); })(this); Element.addMethods(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); var Position = { includeScrollOffsets: false, prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator, context) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator, context); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ (function() { window.Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); }, findElements: function(rootElement) { return Prototype.Selector.select(this.expression, rootElement); }, match: function(element) { return Prototype.Selector.match(element, this.expression); }, toString: function() { return this.expression; }, inspect: function() { return "#"; } }); Object.extend(Selector, { matchElements: function(elements, expression) { var match = Prototype.Selector.match, results = []; for (var i = 0, length = elements.length; i < length; i++) { var element = elements[i]; if (match(element, expression)) { results.push(Element.extend(element)); } } return results; }, findElement: function(elements, expression, index) { index = index || 0; var matchIndex = 0, element; for (var i = 0, length = elements.length; i < length; i++) { element = elements[i]; if (Prototype.Selector.match(element, expression) && index === matchIndex++) { return Element.extend(element); } } }, findChildElements: function(element, expressions) { var selector = expressions.toArray().join(', '); return Prototype.Selector.select(selector, element || document); } }); })(); ================================================ FILE: _archive/apps/samples/clock/tests/lib/right.js ================================================ /** * RightJS v2.3.1 - http://rightjs.org * Released under the terms of MIT license * * Copyright (C) 2008-2012 Nikolay Nemshilov */ var RightJS=function(a,b,c,d,e,f,g,h,i){function cL(a,b,c,d){var e={},f=a.marginLeft.toFloat()||0,g=a.marginTop.toFloat()||0,h=c==="right",i=c==="bottom",j=c==="top"||i;d==="out"?(e[j?"height":"width"]="0px",h?e.marginLeft=f+b.x+"px":i&&(e.marginTop=g+b.y+"px")):(j?(e.height=b.y+"px",a.height="0px"):(e.width=b.x+"px",a.width="0px"),h?(e.marginLeft=f+"px",a.marginLeft=f+b.x+"px"):i&&(e.marginTop=g+"px",a.marginTop=g+b.y+"px"));return e}function cK(a,b,c){var d=a.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(a.size().x).setStyle(b),e;a.parent()&&a.insert(d,"before"),e=cJ(d,c),d.remove();return e}function cJ(a,b){var c=0,d=b.length,e=a.computedStyles(),f={},g;for(;c"+b+""+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bO.appendChild(b[0])}else for(var g=0,h=b.length,i;gb?1:a-1;c--)if(a.call(b,this[c],c,this))return this[c];return i};d.include({indexOf:k.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0,d=this.length;c-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?_(X,this,arguments):this[0]},last:function(){return arguments.length?_(Y,this,arguments):this[this.length-1]},random:function(){return this.length===0?i:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){_(R,this,arguments);return this},forEach:R,map:function(){return _(U,this,arguments)},filter:function(){return _(S,this,arguments)},reject:function(){return _(T,this,arguments)},some:function(a){return _(V,this,a?arguments:[ba])},every:function(a){return _(W,this,a?arguments:[ba])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0;c0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return Q.apply(this,a||!z(this[0])?arguments:[bb])},sortBy:function(){var a=Z(arguments,this);return this.sort(function(b,c){return bb(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0,c=this.length;b]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/]*>([\s\S]*?)<\/script>/img,function(a,c){b+=c+"\n";return""});a===!0?t(b):x(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);return this},camelize:function(){return this.replace(/(\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},dasherize:function(){return this.underscored().replace(/_/g,"-")},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===i?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\d)-(\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=J(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(J(arguments)):a)}},bindAsEventListener:function(){var a=J(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(J(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(J(arguments)))},rcurry:function(){var a=J(arguments),b=this;return function(){return b.apply(b,J(arguments).concat(a))}},delay:function(){var a=J(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=J(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=J(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c=a;d--)b.call(c,d);return this},to:function(a,b,c){var d=this+0,e=a,f=[],g=d;b=b||function(a){return a};if(e>d)for(;g<=e;g++)f.push(b.call(c,g));else for(;g>=e;g--)f.push(b.call(c,g));return f},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return thisa?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1")},a.JSON||(a.JSON=function(){function g(a){return(a<10?"0":"")+a}function d(a){return a.replace(c,function(a){return b[a]||"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}var a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;return{stringify:function(a){switch(typeof a){case"boolean":return e(a);case"number":return e(a+0);case"string":return'"'+d(a)+'"';case"object":if(a===null)return"null";if(B(a))return"["+J(a).map(JSON.stringify).join(",")+"]";if(m.call(a)==="[object Date]")return'"'+a.getUTCFullYear()+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+g(a.getMilliseconds())+'Z"';var b=[],c;for(c in a)b.push('"'+c+'":'+JSON.stringify(a[c]));return"{"+b.join(",")+"}"}},parse:function(b){if(y(b)&&b){b=b.replace(a,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return(new f("return "+b))()}throw"JSON parse error: "+b}}}());var bc=j.Class=function(){var a=J(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!A(b)&&(c=b,b={}),!d&&c&&(c===bw||c.ancestors.include(bw))&&(d=bx()),d=s(d||function(){bi(this);return"initialize"in this?this.initialize.apply(this,arguments):this},bd),c=c||bc,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,N(b[a]))});return d.include(b)},bd={extend:function(){J(arguments).filter(A).each(function(a){s(this,bf(a,!0)),bg(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);J(arguments).filter(A).each(function(b){c.each(bf(b,!1),function(b,c){for(var d,e=0,f=a.length;e"),bs.OLD=bs.IE8L=bt=!0}catch(bv){}var bw=j.Wrapper=new bc({_:i,initialize:function(a){this._=a}});bw.Cache=q,bw.Cast=function(a){return a.tagName in bH?bH[a.tagName]:i};var bB=j.Document=new bc(bw,{win:function(){return bA(this._.defaultView||this._.parentWindow)}}),bC=bA(b),bD=j.Window=new bc(bw,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=z(a)?null:E(a);f instanceof bG&&(a=f.position()),A(a)&&(e=a.y,d=a.x),A(c=c||b)&&j.Fx?(new cg.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bE=j.Event=new bc(bw,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:bz,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bG){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bw&&this.currentTarget instanceof bw){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bA(b);b=b.parentNode}}return i}},bz),bF=[],bG=j.Element=new bc(bw,{initialize:function(a,b){bK(this,a,b)}},by),bH=bG.Wrappers={},bI={},bJ=function(a,c){return(a in bI?bI[a]:bI[a]=b.createElement(a)).cloneNode(!1)};bt&&(bJ=function(a,c){c!==i&&(a==="input"||a==="button")&&(a="<"+a+' name="'+c.name+'" type="'+c.type+'"'+(c.checked?" checked":"")+" />",delete c.name,delete c.type);return b.createElement(a)}),bG.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bA(b):null},parents:function(a){return bL(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bL(this,"nextSibling",a)},prevSiblings:function(a){return bL(this,"previousSibling",a)},next:function(a){return!a&&this._.nextElementSibling!==i?bA(this._.nextElementSibling):this.nextSiblings(a)[0]},prev:function(a){return!a&&this._.previousElementSibling!==i?bA(this._.previousElementSibling):this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=b===i?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bG&&(a=a._),bM[b](d,a.nodeType===i?bQ(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){E(a).insert(this,b);return this},append:function(a){return this.insert(y(a)?J(arguments).join(""):arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}return this.clean().insert(a)},html:function(a){return a===i?this._.innerHTML:this.update(a)},text:function(a){return a===i?this._.textContent===i?this._.innerText:this._.textContent:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=E(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bG(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bM={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a,b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},bN={TBODY:["","
          ",2],TR:["","
          ",3],TD:["","
          ",4],COL:["","
          ",2],LEGEND:["
          ","
          ",2],AREA:["","",2],OPTION:["",2]};v(bN,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bO=b.createDocumentFragment(),bP=b.createElement("DIV");bG.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==i?(e[a]=b,a=e):y(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),bu&&c==="opacity"?f.filter="alpha(opacity="+a[c]*100+")":c==="float"&&(d=br?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bR(this._.style,a)||bR(this.computedStyles(),a)},computedStyles:o.currentStyle?function(){return this._.currentStyle||{}}:o.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";b.indexOf(" "+a+" ")==-1&&(this._.className+=(b===" "?"":" ")+a);return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)?"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}}),bG.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),d.substr(0,5)!=="data-"&&(e[d]=a[d]));return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=G(a.tagName).insertTo(o),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()},data:function(a,b){var c,d,e,f,g,h;if(A(a))for(c in a)b=this.data(c,a[c]);else if(b===i){a="data-"+(""+a).dasherize();for(d={},e=!1,f=this._.attributes,h=0;hb.x&&a.xb.y&&a.y1)e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),d[e]||(d[e]=f[0]==="]"?[]:{}),d=d[e];e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),e===""?d.push(b.value()):d[e]=b.value()}});return a},serialize:function(){return c.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});bS("submit reset focus blur disable enable change");var bU=j.Input=bH.INPUT=bH.BUTTON=bH.SELECT=bH.TEXTAREA=bH.OPTGROUP=new bc(bG,{initialize:function(a,b){if(!a||A(a)&&!C(a))b=a||{},/textarea|select/.test(b.type||"")?(a=b.type,delete b.type):a="input";this.$super(a,b)},form:function(){return bA(this._.form)},insert:function(a,b){this.$super(a,b),this.find("option").each(function(a){a._.selected=!!a.get("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?this.find("option").map(function(a){return a._.selected?a._.value:null}).compact():this._.value},setValue:function(a){this._.type=="select-multiple"?(a=N(a).map(e),this.find("option").each(function(b){b._.selected=a.include(b._.value)})):this._.value=a;return this},value:function(a){return this[a===i?"getValue":"setValue"](a)},focus:function(){this._.focus(),this.focused=!0,br&&this.fire("focus",{bubbles:!1});return this},blur:function(){this._.blur(),this.focused=!1,br&&this.fire("blur",{bubbles:!1});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=!0;return this.fire("disable")},enable:function(){this._.disabled=!1;return this.fire("enable")},disabled:function(a){return a===i?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){a===i?a=this._.checked:(this._.checked=a,a=this);return a}});bt?(b.attachEvent("onfocusin",bV),b.attachEvent("onfocusout",bV)):(b.addEventListener("focus",bV,!0),b.addEventListener("blur",bV,!0));var bW=[],bX=!0;bS("mouseenter mouseleave"),[bG,bB].each("include",{delegate:function(a){var b=cb(arguments),c,d,e,f;for(c in b)for(d=0,f=b[c];d=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type","application/x-www-form-urlencoded;charset="+this.encoding),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new ce.JSONP(this):this.form&&this.form.first("input[type=file]")?new ce.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){return a},prepareData:function(){return J(arguments).map(function(a){y(a)||(a=c.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(a.readyState==4&&!a.canceled){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText,this.xml=this.responseXML=a.responseXML,this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(a){var b=this.getHeader("Content-type"),c=this.getHeader("X-JSON");c&&(this.json=this.responseJSON=this.headerJSON=JSON.parse(c)),this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?t(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=JSON.parse(this.text):this.evalScripts&&this.text.evalScripts()},initCallbacks:function(){this.on({create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),this.on("complete","tryScripts"),ce.EVENTS.each(function(a){this.on(a,function(){ce.fire(a,this,this.xhr)})},this)},showSpinner:function(){ce.showSpinner.call(this,this)},hideSpinner:function(){ce.hideSpinner.call(this,this)}});s(bl(ce),{counter:0,showSpinner:function(a){ce.trySpinner(a,"show")},hideSpinner:function(a){ce.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||ce.Options,d=E(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){ce.counter++,ce.showSpinner()},countOut:function(){ce.counter--,ce.counter<1&&ce.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bT.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new ce(this._.action||b.location.href,s({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof ce&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",cf,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",cf),this.remote=!1;return this}}),ce.include({prepareParams:function(a){a&&a instanceof bT&&(this.form=a,a=a.values());return a}}),bG.include({load:function(a,b){(new ce(a,s({method:"get"},b))).update(this);return this}}),ce.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},ce.IFramed=new bc({include:ce.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append('',"after"),E(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status=200,this.readyState=4,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){E(this.id).set("src","about:blank")}}),ce.JSONP=new bc({include:ce.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(y(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=G("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(F("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cg=j.Fx=new bc(bk,{extend:{EVENTS:H("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bt?40:60,duration:"normal",transition:"default",queue:!0,engine:"css"}},initialize:function(a,b){this.$super(b),this.element=E(a),cj(this)},start:function(){if(ck(this,arguments))return this;cl(this),this.prepare.apply(this,arguments),cp(this);return this.fire("start",this)},finish:function(){cq(this),cm(this),this.fire("finish"),cn(this);return this},cancel:function(){cq(this),cm(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),ch=[],ci=[],cr={"default":"(.25,.1,.25,1)",linear:"(0,0,1,1)","ease-in":"(.42,0,1,1)","ease-out":"(0,0,.58,1)","ease-in-out":"(.42,0,.58,1)","ease-out-in":"(0,.42,1,.58)"},cs={};e.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"},e.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bG.include({stop:function(){co(this);return this},hide:function(a,b){return a&&this.visible()?cu(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cu(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cu(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cu(this,a,["out",s(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cu(this,"morph",[a,b||{}])},highlight:function(){return cu(this,"highlight",arguments)},fade:function(){return cu(this,"fade",arguments)},slide:function(){return cu(this,"slide",arguments)},scroll:function(a,b){return cu(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return A(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var cv=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in o.style}),cw=cv+"ransition",cx=cw+"Property",cy=cw+"Duration",cz=cw+"TimingFunction",cA={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0,.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cg.Options.engine=cv===i||bq?"javascript":"native",cg.Morph=new bc(cg,{prepare:function(a){if(this.options.engine==="native"&&cv!==i)this.render=this.transition=function(){},cB.call(this,a);else{var b=cE(a),c=cJ(this.element,b),d=cK(this.element,a,b);cI(this.element,c,d),this.before=cH(c),this.after=cH(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Context menus Sample that shows how to use the [context menu API](http://developer.chrome.com/apps/contextMenus) in an app to manage various application context menus, such as menus that only apply to particular windows, menus that apply to selections, and context menus that work on the app launcher. ## APIs * [Context menu API](http://developer.chrome.com/apps/contextMenus) * [Runtime](http://developer.chrome.com/apps/app_runtime) * [Window](http://developer.chrome.com/apps/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/context-menu/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/context-menu/a.html ================================================ Window A

          Window A

          Right click to see the context menu.

          Select this text and then right-click

          Log:

          
            
          
          
          
          ================================================
          FILE: _archive/apps/samples/context-menu/a.js
          ================================================
          function log(message) {
            document.getElementById('log').textContent += message + '\n';
          }
          
          chrome.contextMenus.onClicked.addListener(function(info) {
            if (!document.hasFocus()) {
              log('Ignoring context menu click that happened in another window');
              return;
            }
          
            log('Item selected in A: ' + info.menuItemId);
          });
          
          window.addEventListener("load", function(e){
            log('Window A is loaded');
          });
          
          
          
          ================================================
          FILE: _archive/apps/samples/context-menu/b.html
          ================================================
          
            
              
              Window B
            
            
              

          Window B

          Right click to see the context menu.

          Log:

          
            
          
          
          
          ================================================
          FILE: _archive/apps/samples/context-menu/b.js
          ================================================
          function log(message) {
            document.getElementById('log').textContent += message + '\n';
          }
          
          chrome.contextMenus.onClicked.addListener(function(info) {
            if (!document.hasFocus()) {
              log('Ignoring context menu click that happened in another window');
              return;
            }
          
            log('Item selected in B: ' + info.menuItemId);
          });
          
          window.addEventListener("load", function(e){
            log('Window B is loaded');
          });
          
          
          ================================================
          FILE: _archive/apps/samples/context-menu/main.js
          ================================================
          // Holds the data structure for all the context menus used in the app
          var CONTEXT_MENU_CONTENTS = {
            forWindows : [
              'foo',
              'bar',
              'baz'
            ],
            forSelection: [
              'Selection context menu'
            ],
            forLauncher : [
              'Launch Window "A"',
              'Launch Window "B"'
            ]
          }
          
          function setUpContextMenus() {
            CONTEXT_MENU_CONTENTS.forWindows.forEach(function(commandId) {
              chrome.contextMenus.create({
                title: 'A: ' + commandId,
                type: 'radio',
                id: 'A' + commandId,
                documentUrlPatterns: [ "chrome-extension://*/a.html"],
                contexts: ['all']
              });
            });
          
            CONTEXT_MENU_CONTENTS.forWindows.forEach(function(commandId) {
              chrome.contextMenus.create({
                title: 'B: ' + commandId,
                type: 'checkbox',
                id: 'B' + commandId,
                documentUrlPatterns: [ "chrome-extension://*/b.html"],
                contexts: ['all']
              });
            });
          
            CONTEXT_MENU_CONTENTS.forSelection.forEach(function(commandId) {
              chrome.contextMenus.create({
                type: "separator",
                id: 'sep1',
                contexts: ['selection']
              });
              chrome.contextMenus.create( {
                title: commandId + ' "%s"',
                id: commandId,
                contexts: ['selection']
              });
            });
          
            CONTEXT_MENU_CONTENTS.forLauncher.forEach(function(commandId, index) {
              chrome.contextMenus.create({
                title: commandId,
                id: 'launcher' + index,
                contexts: ['launcher']
              });
            });
          }
          
          chrome.app.runtime.onLaunched.addListener(function() {
            chrome.app.window.create('a.html', {id: 'a', outerBounds:{top: 0, left: 0, width: 300, height: 300}});
            chrome.app.window.create('b.html', {id: 'b', outerBounds:{top: 0, left: 310, width: 300, height: 300}});
          });
          
          chrome.runtime.onInstalled.addListener(function() {
            // When the app gets installed, set up the context menus
            setUpContextMenus();
          });
          
          chrome.contextMenus.onClicked.addListener(function(itemData) {
            if (itemData.menuItemId == "launcher0")
              chrome.app.window.create('a.html', {id: 'a', outerBounds:{top: 0, left: 0, width: 300, height: 300}});
            if (itemData.menuItemId == "launcher1")
              chrome.app.window.create('b.html', {id: 'b', outerBounds:{top: 0, left: 310, width: 300, height: 300}});
          });
          
          
          ================================================
          FILE: _archive/apps/samples/context-menu/manifest.json
          ================================================
          {
            "manifest_version": 2,
            "name": "Context Menu Sample",
            "version": "4",
            "app": {
              "background": {
                "scripts": ["main.js"]
              }
            },
            "permissions": ["contextMenus"]
          }
          
          
          ================================================
          FILE: _archive/apps/samples/dart/README.md
          ================================================
          ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store")
          
          
          # Using DART in a Chrome Packaged App
          
          A simple Dart sample transformed into a Chrome packaged app. Please, use Dart version equal or greater than
             0.1.2.0_15284_chrome-bot (Fri Nov 23 05:26:52 2012)
          if you want to recompile dart to JS. See the correct, CSP compatible, command-line parameter in the compile.sh script.
          
          ## APIs
          
          * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime)
          * [Window](https://developer.chrome.com/docs/extensions/reference/app_window)
          
          
          ## Screenshot
          ![screenshot](/_archive/apps/samples/dart/assets/screenshot_1280_800.png)
          
          
          
          ================================================
          FILE: _archive/apps/samples/dart/clock.html
          ================================================
          
          
          
          
          
            
              
              Clock Demo
              
            
            
              

          Clock

          An html5 clock using absolutely positioned elements.

          ================================================ FILE: _archive/apps/samples/dart/compile.sh ================================================ #!/bin/bash pub get dart2js -odart/clock.dart.js dart/clock.dart ================================================ FILE: _archive/apps/samples/dart/css/clock.css ================================================ /* Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file */ /* for details. All rights reserved. Use of this source code is governed by a */ /* BSD-style license that can be found in the LICENSE file. */ body { background-color: #F8F8F8; font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: normal; line-height: 1.2em; margin: 15px; } p { color: #333; } #canvas-content { width: 100%; height: 400px; position: relative; border: 1px solid #ccc; background-color: #fff; } #summary { float: left; } #notes { float: right; width: 120px; text-align: right; } .error { font-style: italic; color: red; } #container2 { width: 100px; height: 100px; position: relative; margin: auto; } #target { width: 100%; height: 100%; position: absolute; } #target figure { display: block; position: absolute; width: 150px; height: 80px; border: 1px solid #333; font-size: 36px; color: #222; background: #3291d8; text-align: center; line-height: 2em; } ================================================ FILE: _archive/apps/samples/dart/dart/balls.dart ================================================ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of clock; int get clientWidth => window.innerWidth; int get clientHeight => window.innerHeight; class Balls { static const double RADIUS2 = Ball.RADIUS * Ball.RADIUS; static const int LT_GRAY_BALL_INDEX = 0; static const int GREEN_BALL_INDEX = 1; static const int BLUE_BALL_INDEX = 2; static const int DK_GRAY_BALL_INDEX = 4; static const int RED_BALL_INDEX = 5; static const int MD_GRAY_BALL_INDEX = 6; static const List PNGS = const [ "images/ball-d9d9d9.png", "images/ball-009a49.png", "images/ball-13acfa.png", "images/ball-265897.png", "images/ball-b6b4b5.png", "images/ball-c0000b.png", "images/ball-c9c9c9.png" ]; DivElement root; num lastTime; List balls; Balls() : lastTime = new DateTime.now().millisecondsSinceEpoch, balls = new List() { root = new DivElement(); document.body.nodes.add(root); makeAbsolute(root); setElementSize(root, 0.0, 0.0, 0.0, 0.0); } void tick(num now) { showFps(1000.0 / (now - lastTime + 0.01)); double delta = min((now - lastTime) / 1000.0, 0.1); lastTime = now; // incrementally move each ball, removing balls that are offscreen balls.removeWhere((ball) => ball.tick(delta)); collideBalls(delta); } void collideBalls(double delta) { balls.forEach((b0) { balls.forEach((b1) { // See if the two balls are intersecting. double dx = (b0.x - b1.x).abs(); double dy = (b0.y - b1.y).abs(); double d2 = dx * dx + dy * dy; if (d2 < RADIUS2) { // Make sure they're actually on a collision path // (not intersecting while moving apart). // This keeps balls that end up intersecting from getting stuck // without all the complexity of keeping them strictly separated. if (newDistanceSquared(delta, b0, b1) > d2) { return; } // They've collided. Normalize the collision vector. double d = sqrt(d2); if (d == 0) { // TODO: move balls apart. return; } dx /= d; dy /= d; // Calculate the impact velocity and speed along the collision vector. double impactx = b0.vx - b1.vx; double impacty = b0.vy - b1.vy; double impactSpeed = impactx * dx + impacty * dy; // Bump. b0.vx -= dx * impactSpeed; b0.vy -= dy * impactSpeed; b1.vx += dx * impactSpeed; b1.vy += dy * impactSpeed; } }); }); } double newDistanceSquared(double delta, Ball b0, Ball b1) { double nb0x = b0.x + b0.vx * delta; double nb0y = b0.y + b0.vy * delta; double nb1x = b1.x + b1.vx * delta; double nb1y = b1.y + b1.vy * delta; double ndx = (nb0x - nb1x).abs(); double ndy = (nb0y - nb1y).abs(); double nd2 = ndx * ndx + ndy * ndy; return nd2; } void add(double x, double y, int color) { balls.add(new Ball(root, x, y, color)); } } class Ball { static const double GRAVITY = 400.0; static const double RESTITUTION = 0.8; static const double MIN_VELOCITY = 100.0; static const double INIT_VELOCITY = 800.0; static const double RADIUS = 14.0; static Random random; static double randomVelocity() { if (random == null) { random = new Random(); } return (random.nextDouble() - 0.5) * INIT_VELOCITY; } Element root; ImageElement elem; double x, y; double vx, vy; double ax, ay; double age; Ball(this.root, this.x, this.y, int color) { elem = new ImageElement(src: Balls.PNGS[color]); makeAbsolute(elem); setElementPosition(elem, x, y); root.nodes.add(elem); ax = 0.0; ay = GRAVITY; vx = randomVelocity(); vy = randomVelocity(); } // return true => remove me bool tick(double delta) { // Update velocity and position. vx += ax * delta; vy += ay * delta; x += vx * delta; y += vy * delta; // Handle falling off the edge. if ((x < RADIUS) || (x > clientWidth)) { elem.remove(); return true; } // Handle ground collisions. if (y > clientHeight) { y = clientHeight.toDouble(); vy *= -RESTITUTION; } // Position the element. setElementPosition(elem, x - RADIUS, y - RADIUS); return false; } } ================================================ FILE: _archive/apps/samples/dart/dart/clock.dart ================================================ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library clock; import 'dart:async'; import 'dart:html'; import 'dart:math'; part 'balls.dart'; part 'numbers.dart'; void main() { new CountDownClock(); } double fpsAverage; /** * Display the animation's FPS in a div. */ void showFps(num fps) { if (fpsAverage == null) { fpsAverage = fps; } else { fpsAverage = fps * 0.05 + fpsAverage * 0.95; query("#notes").text = "${fpsAverage.round().toInt()} fps"; } } class CountDownClock { static const int NUMBER_SPACING = 19; static const double BALL_WIDTH = 19.0; static const double BALL_HEIGHT = 19.0; List hours = new List(2); List minutes = new List(2); List seconds = new List(2); int displayedHour = -1; int displayedMinute = -1; int displayedSecond = -1; Balls balls = new Balls(); CountDownClock() { var parent = query("#canvas-content"); createNumbers(parent, parent.clientWidth, parent.clientHeight); updateTime(new DateTime.now()); window.requestAnimationFrame(tick); } void tick(num time) { updateTime(new DateTime.now()); balls.tick(time); window.requestAnimationFrame(tick); } void updateTime(DateTime now) { if (now.hour != displayedHour) { setDigits(pad2(now.hour), hours); displayedHour = now.hour; } if (now.minute != displayedMinute) { setDigits(pad2(now.minute), minutes); displayedMinute = now.minute; } if (now.second != displayedSecond) { setDigits(pad2(now.second), seconds); displayedSecond = now.second; } } void setDigits(String digits, List numbers) { for (int i = 0; i < numbers.length; ++i) { int digit = digits.codeUnitAt(i) - '0'.codeUnitAt(0); numbers[i].setPixels(ClockNumbers.PIXELS[digit]); } } String pad3(int number) { if (number < 10) { return "00${number}"; } if (number < 100) { return "0${number}"; } return "${number}"; } String pad2(int number) { if (number < 10) { return "0${number}"; } return "${number}"; } void createNumbers(Element parent, num width, num height) { DivElement root = new DivElement(); makeRelative(root); root.style.textAlign = 'center'; query("#canvas-content").nodes.add(root); double hSize = (BALL_WIDTH * ClockNumber.WIDTH + NUMBER_SPACING) * 6 + (BALL_WIDTH + NUMBER_SPACING) * 2; hSize -= NUMBER_SPACING; double vSize = BALL_HEIGHT * ClockNumber.HEIGHT; double x = (width - hSize) / 2; double y = (height - vSize) / 3; for (int i = 0; i < hours.length; ++i) { hours[i] = new ClockNumber(this, x, Balls.BLUE_BALL_INDEX); root.nodes.add(hours[i].root); setElementPosition(hours[i].root, x, y); x += BALL_WIDTH * ClockNumber.WIDTH + NUMBER_SPACING; } root.nodes.add(new Colon(x, y).root); x += BALL_WIDTH + NUMBER_SPACING; for (int i = 0; i < minutes.length; ++i) { minutes[i] = new ClockNumber(this, x, Balls.RED_BALL_INDEX); root.nodes.add(minutes[i].root); setElementPosition(minutes[i].root, x, y); x += BALL_WIDTH * ClockNumber.WIDTH + NUMBER_SPACING; } root.nodes.add(new Colon(x, y).root); x += BALL_WIDTH + NUMBER_SPACING; for (int i = 0; i < seconds.length; ++i) { seconds[i] = new ClockNumber(this, x, Balls.GREEN_BALL_INDEX); root.nodes.add(seconds[i].root); setElementPosition(seconds[i].root, x, y); x += BALL_WIDTH * ClockNumber.WIDTH + NUMBER_SPACING; } } } void makeAbsolute(Element elem) { elem.style.position = 'absolute'; } void makeRelative(Element elem) { elem.style.position = 'relative'; } void setElementPosition(Element elem, double x, double y) { elem.style.left = "${x}px"; elem.style.top = "${y}px"; } void setElementSize(Element elem, double l, double t, double r, double b) { setElementPosition(elem, l, t); elem.style.right = "${r}px"; elem.style.bottom = "${b}px"; } ================================================ FILE: _archive/apps/samples/dart/dart/clock.dart.precompiled.js ================================================ // Generated by dart2js, the Dart to JavaScript compiler version: 1.1.1. // The code supports the following hooks: // dartPrint(message) - if this function is defined it is called // instead of the Dart [print] method. // dartMainRunner(main) - if this function is defined, the Dart [main] // method will not be invoked directly. // Instead, a closure that will invoke [main] is // passed to [dartMainRunner]. (function($) { function dart() {}var A = new dart; delete A.x; var B = new dart; delete B.x; var C = new dart; delete C.x; var D = new dart; delete D.x; var E = new dart; delete E.x; var F = new dart; delete F.x; var G = new dart; delete G.x; var H = new dart; delete H.x; var J = new dart; delete J.x; var K = new dart; delete K.x; var L = new dart; delete L.x; var M = new dart; delete M.x; var N = new dart; delete N.x; var O = new dart; delete O.x; var P = new dart; delete P.x; var Q = new dart; delete Q.x; var R = new dart; delete R.x; var S = new dart; delete S.x; var T = new dart; delete T.x; var U = new dart; delete U.x; var V = new dart; delete V.x; var W = new dart; delete W.x; var X = new dart; delete X.x; var Y = new dart; delete Y.x; var Z = new dart; delete Z.x; function Isolate() {} init(); $ = Isolate.$isolateProperties; var $$ = {}; // Native classes (function (reflectionData) { "use strict"; function map(x){x={x:x};delete x.x;return x} function processStatics(descriptor) { for (var property in descriptor) { if (!hasOwnProperty.call(descriptor, property)) continue; if (property === "") continue; var element = descriptor[property]; var firstChar = property.substring(0, 1); var previousProperty; if (firstChar === "+") { mangledGlobalNames[previousProperty] = property.substring(1); if (descriptor[property] == 1) descriptor[previousProperty].$reflectable = 1; if (element && element.length) init.typeInformation[previousProperty] = element; } else if (firstChar === "@") { property = property.substring(1); $[property]["@"] = element; } else if (firstChar === "*") { globalObject[previousProperty].$defaultValues = element; var optionalMethods = descriptor.$methodsWithOptionalArguments; if (!optionalMethods) { descriptor.$methodsWithOptionalArguments = optionalMethods = {} } optionalMethods[property] = previousProperty; } else if (typeof element === "function") { globalObject[previousProperty = property] = element; functions.push(property); init.globalFunctions[property] = element; } else if (element.constructor === Array) { addStubs(globalObject, element, property, true, descriptor, functions); } else { previousProperty = property; var newDesc = {}; var previousProp; for (var prop in element) { if (!hasOwnProperty.call(element, prop)) continue; firstChar = prop.substring(0, 1); if (prop === "static") { processStatics(init.statics[property] = element[prop]); } else if (firstChar === "+") { mangledNames[previousProp] = prop.substring(1); if (element[prop] == 1) element[previousProp].$reflectable = 1; } else if (firstChar === "@" && prop !== "@") { newDesc[prop.substring(1)]["@"] = element[prop]; } else if (firstChar === "*") { newDesc[previousProp].$defaultValues = element[prop]; var optionalMethods = newDesc.$methodsWithOptionalArguments; if (!optionalMethods) { newDesc.$methodsWithOptionalArguments = optionalMethods={} } optionalMethods[prop] = previousProp; } else { var elem = element[prop]; if (prop && elem != null && elem.constructor === Array && prop !== "<>") { addStubs(newDesc, elem, prop, false, element, []); } else { newDesc[previousProp = prop] = elem; } } } $$[property] = [globalObject, newDesc]; classes.push(property); } } } function addStubs(descriptor, array, name, isStatic, originalDescriptor, functions) { var f, funcs = [originalDescriptor[name] = descriptor[name] = f = (function() { var result = array[0]; if (result != null && typeof result != "function") { throw new Error( name + ": expected value of type 'function' at index " + (0) + " but got " + (typeof result)); } return result; })()]; f.$stubName = name; functions.push(name); for (var index = 0; index < array.length; index += 2) { f = array[index + 1]; if (typeof f != "function") break; f.$stubName = (function() { var result = array[index + 2]; if (result != null && typeof result != "string") { throw new Error( name + ": expected value of type 'string' at index " + (index + 2) + " but got " + (typeof result)); } return result; })(); funcs.push(f); if (f.$stubName) { originalDescriptor[f.$stubName] = descriptor[f.$stubName] = f; functions.push(f.$stubName); } } for (var i = 0; i < funcs.length; index++, i++) { funcs[i].$callName = (function() { var result = array[index + 1]; if (result != null && typeof result != "string") { throw new Error( name + ": expected value of type 'string' at index " + (index + 1) + " but got " + (typeof result)); } return result; })(); } var getterStubName = (function() { var result = array[++index]; if (result != null && typeof result != "string") { throw new Error( name + ": expected value of type 'string' at index " + (++index) + " but got " + (typeof result)); } return result; })(); array = array.slice(++index); var requiredParameterInfo = (function() { var result = array[0]; if (result != null && (typeof result != "number" || (result|0) !== result)) { throw new Error( name + ": expected value of type 'int' at index " + (0) + " but got " + (typeof result)); } return result; })(); var requiredParameterCount = requiredParameterInfo >> 1; var isAccessor = (requiredParameterInfo & 1) === 1; var isSetter = requiredParameterInfo === 3; var isGetter = requiredParameterInfo === 1; var optionalParameterInfo = (function() { var result = array[1]; if (result != null && (typeof result != "number" || (result|0) !== result)) { throw new Error( name + ": expected value of type 'int' at index " + (1) + " but got " + (typeof result)); } return result; })(); var optionalParameterCount = optionalParameterInfo >> 1; var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1; var isIntercepted = requiredParameterCount + optionalParameterCount != funcs[0].length; var functionTypeIndex = (function() { var result = array[2]; if (result != null && (typeof result != "number" || (result|0) !== result) && typeof result != "function") { throw new Error( name + ": expected value of type 'function or int' at index " + (2) + " but got " + (typeof result)); } return result; })(); var isReflectable = array.length > requiredParameterCount + optionalParameterCount + 3; if (getterStubName) { f = tearOff(funcs, array, isStatic, name, isIntercepted); if (isStatic) init.globalFunctions[name] = f; originalDescriptor[getterStubName] = descriptor[getterStubName] = f; funcs.push(f); if (getterStubName) functions.push(getterStubName); f.$stubName = getterStubName; f.$callName = null; } if (isReflectable) { for (var i = 0; i < funcs.length; i++) { funcs[i].$reflectable = 1; funcs[i].$reflectionInfo = array; } } if (isReflectable) { var unmangledNameIndex = optionalParameterCount * 2 + requiredParameterCount + 3; var unmangledName = (function() { var result = array[unmangledNameIndex]; if (result != null && typeof result != "string") { throw new Error( name + ": expected value of type 'string' at index " + (unmangledNameIndex) + " but got " + (typeof result)); } return result; })(); var reflectionName = unmangledName + ":" + requiredParameterCount + ":" + optionalParameterCount; if (isGetter) { reflectionName = unmangledName; } else if (isSetter) { reflectionName = unmangledName + "="; } if (isStatic) { init.mangledGlobalNames[name] = reflectionName; } else { init.mangledNames[name] = reflectionName; } funcs[0].$reflectionName = reflectionName; funcs[0].$metadataIndex = unmangledNameIndex + 1; if (optionalParameterCount) descriptor[unmangledName + "*"] = funcs[0]; } } function tearOffGetterNoCsp(funcs, reflectionInfo, name, isIntercepted) { return isIntercepted ? new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + (functionCounter++)+ "(x) {" + "if (c === null) c = H.closureFromTearOff(" + "this, funcs, reflectionInfo, false, [x], name);" + "return new c(this, funcs[0], x, name);" + "}")(funcs, reflectionInfo, name, H, null) : new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + (functionCounter++)+ "() {" + "if (c === null) c = H.closureFromTearOff(" + "this, funcs, reflectionInfo, false, [], name);" + "return new c(this, funcs[0], null, name);" + "}")(funcs, reflectionInfo, name, H, null) } function tearOffGetterCsp(funcs, reflectionInfo, name, isIntercepted) { var cache = null; return isIntercepted ? function(x) { if (cache === null) cache = H.closureFromTearOff(this, funcs, reflectionInfo, false, [x], name); return new cache(this, funcs[0], x, name) } : function() { if (cache === null) cache = H.closureFromTearOff(this, funcs, reflectionInfo, false, [], name); return new cache(this, funcs[0], null, name) } } function tearOff(funcs, reflectionInfo, isStatic, name, isIntercepted) { var cache; return isStatic ? function() { if (cache === void 0) cache = H.closureFromTearOff(this, funcs, reflectionInfo, true, [], name).prototype; return cache; } : tearOffGetter(funcs, reflectionInfo, name, isIntercepted); } var functionCounter = 0; var tearOffGetter = (typeof dart_precompiled == "function") ? tearOffGetterCsp : tearOffGetterNoCsp; if (!init.libraries) init.libraries = []; if (!init.mangledNames) init.mangledNames = map(); if (!init.mangledGlobalNames) init.mangledGlobalNames = map(); if (!init.statics) init.statics = map(); if (!init.typeInformation) init.typeInformation = map(); if (!init.globalFunctions) init.globalFunctions = map(); var libraries = init.libraries; var mangledNames = init.mangledNames; var mangledGlobalNames = init.mangledGlobalNames; var hasOwnProperty = Object.prototype.hasOwnProperty; var length = reflectionData.length; for (var i = 0; i < length; i++) { var data = reflectionData[i]; var name = data[0]; var uri = data[1]; var metadata = data[2]; var globalObject = data[3]; var descriptor = data[4]; var isRoot = !!data[5]; var fields = descriptor && descriptor[""]; var classes = []; var functions = []; processStatics(descriptor); libraries.push([name, uri, classes, functions, metadata, fields, isRoot, globalObject]); } }) ([ ["_foreign_helper", "dart:_foreign_helper", , H, { "": "", JS_CONST: { "": "Object;code" } }], ["_interceptors", "dart:_interceptors", , J, { "": "", getInterceptor: function(object) { return void 0; }, makeDispatchRecord: function(interceptor, proto, extension, indexability) { return {i: interceptor, p: proto, e: extension, x: indexability}; }, getNativeInterceptor: function(object) { var record, proto, objectProto, interceptor; record = object[init.dispatchPropertyName]; if (record == null) if ($.initNativeDispatchFlag == null) { H.initNativeDispatch(); record = object[init.dispatchPropertyName]; } if (record != null) { proto = record.p; if (false === proto) return record.i; if (true === proto) return object; objectProto = Object.getPrototypeOf(object); if (proto === objectProto) return record.i; if (record.e === objectProto) throw H.wrapException(P.UnimplementedError$("Return interceptor for " + H.S(proto(object, record)))); } interceptor = H.lookupAndCacheInterceptor(object); if (interceptor == null) return C.UnknownJavaScriptObject_methods; return interceptor; }, Interceptor: { "": "Object;", $eq: function(receiver, other) { return receiver === other; }, get$hashCode: function(receiver) { return H.Primitives_objectHashCode(receiver); }, toString$0: function(receiver) { return H.Primitives_objectToString(receiver); }, "%": "DOMError|FileError|MediaError|MediaKeyError|Navigator|NavigatorUserMediaError|PositionError|SQLError|SVGAnimatedLength|SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList" }, JSBool: { "": "bool/Interceptor;", toString$0: function(receiver) { return String(receiver); }, get$hashCode: function(receiver) { return receiver ? 519018 : 218159; }, $isbool: true }, JSNull: { "": "Interceptor;", $eq: function(receiver, other) { return null == other; }, toString$0: function(receiver) { return "null"; }, get$hashCode: function(receiver) { return 0; } }, JavaScriptObject: { "": "Interceptor;", get$hashCode: function(_) { return 0; } }, PlainJavaScriptObject: { "": "JavaScriptObject;" }, UnknownJavaScriptObject: { "": "JavaScriptObject;" }, JSArray: { "": "List/Interceptor;", forEach$1: function(receiver, f) { return H.IterableMixinWorkaround_forEach(receiver, f); }, elementAt$1: function(receiver, index) { if (index < 0 || index >= receiver.length) return H.ioore(receiver, index); return receiver[index]; }, toString$0: function(receiver) { return H.IterableMixinWorkaround_toStringIterable(receiver, "[", "]"); }, get$iterator: function(receiver) { return new H.ListIterator(receiver, receiver.length, 0, null); }, get$hashCode: function(receiver) { return H.Primitives_objectHashCode(receiver); }, get$length: function(receiver) { return receiver.length; }, set$length: function(receiver, newLength) { if (newLength < 0) throw H.wrapException(P.RangeError$value(newLength)); if (!!receiver.fixed$length) H.throwExpression(P.UnsupportedError$("set length")); receiver.length = newLength; }, $index: function(receiver, index) { if (typeof index !== "number" || Math.floor(index) !== index) throw H.wrapException(new P.ArgumentError(index)); if (index >= receiver.length || index < 0) throw H.wrapException(P.RangeError$value(index)); return receiver[index]; }, $indexSet: function(receiver, index, value) { if (!!receiver.immutable$list) H.throwExpression(P.UnsupportedError$("indexed set")); if (typeof index !== "number" || Math.floor(index) !== index) throw H.wrapException(new P.ArgumentError(index)); if (index >= receiver.length || index < 0) throw H.wrapException(P.RangeError$value(index)); receiver[index] = value; }, $isList: true, $asList: null, $isList: true, static: {JSArray_JSArray$fixed: function($length, $E) { var t1; if (typeof $length !== "number" || Math.floor($length) !== $length || $length < 0) throw H.wrapException(P.ArgumentError$("Length must be a non-negative integer: " + H.S($length))); t1 = H.setRuntimeTypeInfo(new Array($length), [$E]); t1.fixed$length = init; return t1; }} }, JSNumber: { "": "num/Interceptor;", remainder$1: function(receiver, b) { return receiver % b; }, toInt$0: function(receiver) { var t1; if (receiver >= -2147483648 && receiver <= 2147483647) return receiver | 0; if (isFinite(receiver)) { t1 = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver); return t1 + 0; } throw H.wrapException(P.UnsupportedError$('' + receiver)); }, roundToDouble$0: function(receiver) { if (receiver < 0) return -Math.round(-receiver); else return Math.round(receiver); }, toString$0: function(receiver) { if (receiver === 0 && 1 / receiver < 0) return "-0.0"; else return "" + receiver; }, get$hashCode: function(receiver) { return receiver & 0x1FFFFFFF; }, $add: function(receiver, other) { return receiver + other; }, $sub: function(receiver, other) { if (typeof other !== "number") throw H.wrapException(new P.ArgumentError(other)); return receiver - other; }, _tdivFast$1: function(receiver, other) { return (receiver | 0) === receiver ? receiver / other | 0 : this.toInt$0(receiver / other); }, _shrOtherPositive$1: function(receiver, other) { var t1; if (receiver > 0) t1 = other > 31 ? 0 : receiver >>> other; else { t1 = other > 31 ? 31 : other; t1 = receiver >> t1 >>> 0; } return t1; }, $lt: function(receiver, other) { if (typeof other !== "number") throw H.wrapException(P.ArgumentError$(other)); return receiver < other; }, $ge: function(receiver, other) { if (typeof other !== "number") throw H.wrapException(P.ArgumentError$(other)); return receiver >= other; }, $isnum: true, static: {"": "JSNumber__MIN_INT32,JSNumber__MAX_INT32"} }, JSInt: { "": "int/JSNumber;", $isdouble: true, $isnum: true, $isint: true }, JSDouble: { "": "double/JSNumber;", $isdouble: true, $isnum: true }, JSString: { "": "String/Interceptor;", codeUnitAt$1: function(receiver, index) { if (index < 0) throw H.wrapException(P.RangeError$value(index)); if (index >= receiver.length) throw H.wrapException(P.RangeError$value(index)); return receiver.charCodeAt(index); }, $add: function(receiver, other) { if (typeof other !== "string") throw H.wrapException(new P.ArgumentError(other)); return receiver + other; }, substring$2: function(receiver, startIndex, endIndex) { if (endIndex == null) endIndex = receiver.length; if (typeof endIndex !== "number" || Math.floor(endIndex) !== endIndex) H.throwExpression(P.ArgumentError$(endIndex)); if (startIndex < 0) throw H.wrapException(P.RangeError$value(startIndex)); if (typeof endIndex !== "number") return H.iae(endIndex); if (startIndex > endIndex) throw H.wrapException(P.RangeError$value(startIndex)); if (endIndex > receiver.length) throw H.wrapException(P.RangeError$value(endIndex)); return receiver.substring(startIndex, endIndex); }, substring$1: function($receiver, startIndex) { return this.substring$2($receiver, startIndex, null); }, get$isEmpty: function(receiver) { return receiver.length === 0; }, toString$0: function(receiver) { return receiver; }, get$hashCode: function(receiver) { var t1, hash, i; for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) { hash = 536870911 & hash + receiver.charCodeAt(i); hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0); hash ^= hash >> 6; } hash = 536870911 & hash + ((67108863 & hash) << 3 >>> 0); hash ^= hash >> 11; return 536870911 & hash + ((16383 & hash) << 15 >>> 0); }, get$length: function(receiver) { return receiver.length; }, $index: function(receiver, index) { if (typeof index !== "number" || Math.floor(index) !== index) throw H.wrapException(new P.ArgumentError(index)); if (index >= receiver.length || index < 0) throw H.wrapException(P.RangeError$value(index)); return receiver[index]; }, $isString: true } }], ["_isolate_helper", "dart:_isolate_helper", , H, { "": "", _callInIsolate: function(isolate, $function) { var result = isolate.eval$1($function); init.globalState.topEventLoop.run$0(); return result; }, startRootIsolate: function(entry) { var t1, t2, rootContext; t1 = new H._Manager(0, 0, 1, null, null, null, null, null, null, null, null, null, entry); t1._Manager$1(entry); init.globalState = t1; if (init.globalState.isWorker === true) return; t1 = init.globalState; t2 = t1.nextIsolateId; t1.nextIsolateId = t2 + 1; rootContext = new H._IsolateContext(t2, P.LinkedHashMap_LinkedHashMap(null, null, null, J.JSInt, H.RawReceivePortImpl), P.LinkedHashSet_LinkedHashSet(null, null, null, J.JSInt), new Isolate()); init.globalState.rootContext = rootContext; init.globalState.currentContext = rootContext; t1 = H.getDynamicRuntimeType(); t2 = H.buildFunctionType(t1, [t1])._isTest$1(entry); if (t2) rootContext.eval$1(new H.startRootIsolate_closure(entry)); else { t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(entry); if (t1) rootContext.eval$1(new H.startRootIsolate_closure0(entry)); else rootContext.eval$1(entry); } init.globalState.topEventLoop.run$0(); }, IsolateNatives_computeThisScript: function() { var currentScript = init.currentScript; if (currentScript != null) return String(currentScript.src); if (typeof version == "function" && typeof os == "object" && "system" in os) return H.IsolateNatives_computeThisScriptD8(); if (typeof version == "function" && typeof system == "function") return thisFilename(); return; }, IsolateNatives_computeThisScriptD8: function() { var stack, matches; stack = new Error().stack; if (stack == null) { stack = (function() {try { throw new Error() } catch(e) { return e.stack }})(); if (stack == null) throw H.wrapException(P.UnsupportedError$("No stack trace")); } matches = stack.match(new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")); if (matches != null) return matches[1]; matches = stack.match(new RegExp("^[^@]*@(.*):[0-9]*$", "m")); if (matches != null) return matches[1]; throw H.wrapException(P.UnsupportedError$("Cannot extract URI from \"" + stack + "\"")); }, IsolateNatives__processWorkerMessage: function(sender, e) { var msg, t1, functionName, entryPoint, args, message, isSpawnUri, replyTo, t2, context, uri, t3, t4, t5, worker, t6, workerId; msg = H._deserializeMessage(e.data); t1 = J.getInterceptor$asx(msg); switch (t1.$index(msg, "command")) { case "start": init.globalState.currentManagerId = t1.$index(msg, "id"); functionName = t1.$index(msg, "functionName"); entryPoint = functionName == null ? init.globalState.entry : init.globalFunctions[functionName](); args = t1.$index(msg, "args"); message = H._deserializeMessage(t1.$index(msg, "msg")); isSpawnUri = t1.$index(msg, "isSpawnUri"); replyTo = H._deserializeMessage(t1.$index(msg, "replyTo")); t1 = init.globalState; t2 = t1.nextIsolateId; t1.nextIsolateId = t2 + 1; context = new H._IsolateContext(t2, P.LinkedHashMap_LinkedHashMap(null, null, null, J.JSInt, H.RawReceivePortImpl), P.LinkedHashSet_LinkedHashSet(null, null, null, J.JSInt), new Isolate()); init.globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, new H.IsolateNatives__processWorkerMessage_closure(entryPoint, args, message, isSpawnUri, replyTo), "worker-start")); init.globalState.currentContext = context; init.globalState.topEventLoop.run$0(); break; case "spawn-worker": t2 = t1.$index(msg, "functionName"); uri = t1.$index(msg, "uri"); t3 = t1.$index(msg, "args"); t4 = t1.$index(msg, "msg"); t5 = t1.$index(msg, "isSpawnUri"); t1 = t1.$index(msg, "replyPort"); if (uri == null) uri = $.get$IsolateNatives_thisScript(); worker = new Worker(uri); worker.onmessage = function(e) { H.IsolateNatives__processWorkerMessage(worker, e); }; t6 = init.globalState; workerId = t6.nextManagerId; t6.nextManagerId = workerId + 1; t6 = $.get$IsolateNatives_workerIds(); t6.$indexSet(t6, worker, workerId); t6 = init.globalState.managers; t6.$indexSet(t6, workerId, worker); worker.postMessage(H._serializeMessage(H.fillLiteralMap(["command", "start", "id", workerId, "replyTo", H._serializeMessage(t1), "args", t3, "msg", H._serializeMessage(t4), "isSpawnUri", t5, "functionName", t2], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null)))); break; case "message": if (t1.$index(msg, "port") != null) t1.$index(msg, "port").send$1(t1.$index(msg, "msg")); init.globalState.topEventLoop.run$0(); break; case "close": t1 = init.globalState.managers; t2 = $.get$IsolateNatives_workerIds(); t1.remove$1(t1, t2.$index(t2, sender)); sender.terminate(); init.globalState.topEventLoop.run$0(); break; case "log": H.IsolateNatives__log(t1.$index(msg, "msg")); break; case "print": if (init.globalState.isWorker === true) { t1 = init.globalState.mainManager; t2 = H._serializeMessage(H.fillLiteralMap(["command", "print", "msg", msg], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))); t1.toString; self.postMessage(t2); } else P.print(t1.$index(msg, "msg")); break; case "error": throw H.wrapException(t1.$index(msg, "msg")); default: } }, IsolateNatives__log: function(msg) { var trace, t1, t2, exception; if (init.globalState.isWorker === true) { t1 = init.globalState.mainManager; t2 = H._serializeMessage(H.fillLiteralMap(["command", "log", "msg", msg], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))); t1.toString; self.postMessage(t2); } else try { $.get$globalThis().console.log(msg); } catch (exception) { H.unwrapException(exception); trace = new H._StackTrace(exception, null); throw H.wrapException(P.Exception_Exception(trace)); } }, _serializeMessage: function(message) { var t1; if (init.globalState.supportsWorkers === true) { t1 = new H._JsSerializer(0, new H._MessageTraverserVisitedMap()); t1._visited = new H._JsVisitedMap(null); return t1.traverse$1(message); } else { t1 = new H._JsCopier(new H._MessageTraverserVisitedMap()); t1._visited = new H._JsVisitedMap(null); return t1.traverse$1(message); } }, _deserializeMessage: function(message) { if (init.globalState.supportsWorkers === true) return new H._JsDeserializer(null).deserialize$1(message); else return message; }, _MessageTraverser_isPrimitive: function(x) { return x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean"; }, _Deserializer_isPrimitive: function(x) { return x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean"; }, startRootIsolate_closure: { "": "Closure:8;entry_0", call$0: function() { this.entry_0.call$1([]); } }, startRootIsolate_closure0: { "": "Closure:8;entry_1", call$0: function() { this.entry_1.call$2([], null); } }, _Manager: { "": "Object;nextIsolateId,currentManagerId,nextManagerId,currentContext,rootContext,topEventLoop,fromCommandLine,isWorker,supportsWorkers,isolates,mainManager,managers,entry", _Manager$1: function(entry) { var t1, t2, t3, $function; t1 = $.get$globalWindow() == null; t2 = $.get$globalWorker(); t3 = t1 && $.get$globalPostMessageDefined() === true; this.isWorker = t3; if (!t3) t2 = t2 != null && $.get$IsolateNatives_thisScript() != null; else t2 = true; this.supportsWorkers = t2; this.fromCommandLine = t1 && !t3; t2 = H._IsolateEvent; t3 = H.setRuntimeTypeInfo(new P.ListQueue(null, 0, 0, 0), [t2]); t3.ListQueue$1(null, t2); this.topEventLoop = new H._EventLoop(t3, 0); this.isolates = P.LinkedHashMap_LinkedHashMap(null, null, null, J.JSInt, H._IsolateContext); this.managers = P.LinkedHashMap_LinkedHashMap(null, null, null, J.JSInt, null); if (this.isWorker === true) { t1 = new H._MainManagerStub(); this.mainManager = t1; $function = function (e) { H.IsolateNatives__processWorkerMessage(t1, e); }; $.get$globalThis().onmessage = $function; $.get$globalThis().dartPrint = function (object) {}; } } }, _IsolateContext: { "": "Object;id,ports,weakPorts,isolateStatics<", eval$1: function(code) { var old, result; old = init.globalState.currentContext; init.globalState.currentContext = this; $ = this.isolateStatics; result = null; try { result = code.call$0(); } finally { init.globalState.currentContext = old; if (old != null) $ = old.get$isolateStatics(); } return result; }, lookup$1: function(portId) { var t1 = this.ports; return t1.$index(t1, portId); }, register$2: function(_, portId, port) { var t1 = this.ports; if (t1.containsKey$1(portId)) throw H.wrapException(P.Exception_Exception("Registry: ports must be registered only once.")); t1.$indexSet(t1, portId, port); this._updateGlobalState$0(); }, _updateGlobalState$0: function() { var t1, t2; t1 = this.id; if (this.ports._collection$_length - this.weakPorts._collection$_length > 0) { t2 = init.globalState.isolates; t2.$indexSet(t2, t1, this); } else { t2 = init.globalState.isolates; t2.remove$1(t2, t1); } } }, _EventLoop: { "": "Object;events,activeTimerCount", dequeue$0: function() { var t1 = this.events; if (t1._head === t1._tail) return; return t1.removeFirst$0(); }, runIteration$0: function() { var $event, t1, t2; $event = this.dequeue$0(); if ($event == null) { if (init.globalState.rootContext != null && init.globalState.isolates.containsKey$1(init.globalState.rootContext.id) && init.globalState.fromCommandLine === true && init.globalState.rootContext.ports._collection$_length === 0) H.throwExpression(P.Exception_Exception("Program exited with open ReceivePorts.")); t1 = init.globalState; if (t1.isWorker === true && t1.isolates._collection$_length === 0 && t1.topEventLoop.activeTimerCount === 0) { t1 = t1.mainManager; t2 = H._serializeMessage(H.fillLiteralMap(["command", "close"], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))); t1.toString; self.postMessage(t2); } return false; } $event.process$0(); return true; }, _runHelper$0: function() { if ($.get$globalWindow() != null) new H._EventLoop__runHelper_next(this).call$0(); else for (; this.runIteration$0();) ; }, run$0: function() { var e, trace, exception, t1, t2; if (init.globalState.isWorker !== true) this._runHelper$0(); else try { this._runHelper$0(); } catch (exception) { t1 = H.unwrapException(exception); e = t1; trace = new H._StackTrace(exception, null); t1 = init.globalState.mainManager; t2 = H._serializeMessage(H.fillLiteralMap(["command", "error", "msg", H.S(e) + "\n" + H.S(trace)], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))); t1.toString; self.postMessage(t2); } } }, _EventLoop__runHelper_next: { "": "Closure:0;this_0", call$0: function() { if (!this.this_0.runIteration$0()) return; P.Timer_Timer(C.Duration_0, this); } }, _IsolateEvent: { "": "Object;isolate,fn,message", process$0: function() { this.isolate.eval$1(this.fn); } }, _MainManagerStub: { "": "Object;" }, IsolateNatives__processWorkerMessage_closure: { "": "Closure:8;entryPoint_0,args_1,message_2,isSpawnUri_3,replyTo_4", call$0: function() { var t1, t2, t3, t4, t5, t6, t7; t1 = this.entryPoint_0; t2 = this.args_1; t3 = this.message_2; t4 = init.globalState.currentContext.id; $.Primitives_mirrorFunctionCacheName = $.Primitives_mirrorFunctionCacheName + ("_" + t4); $.Primitives_mirrorInvokeCacheName = $.Primitives_mirrorInvokeCacheName + ("_" + t4); t4 = $.RawReceivePortImpl__nextFreeId; $.RawReceivePortImpl__nextFreeId = t4 + 1; t5 = new H.RawReceivePortImpl(t4, null, false); t6 = init.globalState.currentContext; t7 = t6.weakPorts; t7.add$1(t7, t4); t6.register$2(t6, t4, t5); t4 = new H.ReceivePortImpl(t5, null); t4.ReceivePortImpl$fromRawReceivePort$1(t5); $.controlPort = t4; this.replyTo_4.send$1(["spawned", new H._NativeJsSendPort(t5, init.globalState.currentContext.id)]); if (this.isSpawnUri_3 !== true) t1.call$1(t3); else { t4 = H.getDynamicRuntimeType(); t5 = H.buildFunctionType(t4, [t4, t4])._isTest$1(t1); if (t5) t1.call$2(t2, t3); else { t3 = H.buildFunctionType(t4, [t4])._isTest$1(t1); if (t3) t1.call$1(t2); else t1.call$0(); } } } }, _BaseSendPort: { "": "Object;", $isSendPort: true }, _NativeJsSendPort: { "": "_BaseSendPort;_receivePort,_isolateId", send$1: function(message) { var t1, t2, t3, isolate, shouldSerialize; t1 = {}; t2 = init.globalState.isolates; t3 = this._isolateId; isolate = t2.$index(t2, t3); if (isolate == null) return; if (this._receivePort.get$_isClosed()) return; shouldSerialize = init.globalState.currentContext != null && init.globalState.currentContext.id !== t3; t1.msg_0 = message; if (shouldSerialize) t1.msg_0 = H._serializeMessage(message); t2 = init.globalState.topEventLoop; t3 = "receive " + H.S(message); t2.events._add$1(new H._IsolateEvent(isolate, new H._NativeJsSendPort_send_closure(t1, this, shouldSerialize), t3)); }, $eq: function(_, other) { var t1; if (other == null) return false; t1 = J.getInterceptor(other); return typeof other === "object" && other !== null && !!t1.$is_NativeJsSendPort && J.$eq(this._receivePort, other._receivePort); }, get$hashCode: function(_) { return this._receivePort.get$_id(); }, $is_NativeJsSendPort: true, $isSendPort: true }, _NativeJsSendPort_send_closure: { "": "Closure:8;box_0,this_1,shouldSerialize_2", call$0: function() { var t1, t2; t1 = this.this_1._receivePort; if (!t1.get$_isClosed()) { if (this.shouldSerialize_2) { t2 = this.box_0; t2.msg_0 = H._deserializeMessage(t2.msg_0); } t1.__isolate_helper$_add$1(this.box_0.msg_0); } } }, _WorkerSendPort: { "": "_BaseSendPort;_workerId,_receivePortId,_isolateId", send$1: function(message) { var workerMessage, t1, manager; workerMessage = H._serializeMessage(H.fillLiteralMap(["command", "message", "port", this, "msg", message], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))); if (init.globalState.isWorker === true) { init.globalState.mainManager.toString; self.postMessage(workerMessage); } else { t1 = init.globalState.managers; manager = t1.$index(t1, this._workerId); if (manager != null) manager.postMessage(workerMessage); } }, $eq: function(_, other) { var t1; if (other == null) return false; t1 = J.getInterceptor(other); return typeof other === "object" && other !== null && !!t1.$is_WorkerSendPort && J.$eq(this._workerId, other._workerId) && J.$eq(this._isolateId, other._isolateId) && J.$eq(this._receivePortId, other._receivePortId); }, get$hashCode: function(_) { var t1, t2, t3; t1 = this._workerId; if (typeof t1 !== "number") return t1.$shl(); t2 = this._isolateId; if (typeof t2 !== "number") return t2.$shl(); t3 = this._receivePortId; if (typeof t3 !== "number") return H.iae(t3); return (t1 << 16 ^ t2 << 8 ^ t3) >>> 0; }, $is_WorkerSendPort: true, $isSendPort: true }, RawReceivePortImpl: { "": "Object;_id<,_handler,_isClosed<", _handler$1: function(arg0) { return this._handler.call$1(arg0); }, close$0: function(_) { var t1, t2; if (this._isClosed) return; this._isClosed = true; this._handler = null; t1 = init.globalState.currentContext; t2 = t1.ports; t2.remove$1(t2, this._id); t1._updateGlobalState$0(); }, __isolate_helper$_add$1: function(dataEvent) { if (this._isClosed) return; this._handler$1(dataEvent); }, static: {"": "RawReceivePortImpl__nextFreeId"} }, ReceivePortImpl: { "": "Stream;_rawPort,_controller", listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) { var t1 = this._controller; t1.toString; return H.setRuntimeTypeInfo(new P._ControllerStream(t1), [null]).listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError); }, close$0: [function(_) { var t1 = this._rawPort; t1.close$0(t1); t1 = this._controller; t1.close$0(t1); }, "call$0", "get$close", 0, 0, 0], ReceivePortImpl$fromRawReceivePort$1: function(_rawPort) { var t1 = P.StreamController_StreamController(this.get$close(this), null, null, null, true, null); this._controller = t1; this._rawPort._handler = t1.get$add(t1); } }, _JsSerializer: { "": "_Serializer;_nextFreeRefId,_visited", visitSendPort$1: function(x) { if (!!x.$is_NativeJsSendPort) return ["sendport", init.globalState.currentManagerId, x._isolateId, x._receivePort.get$_id()]; if (!!x.$is_WorkerSendPort) return ["sendport", x._workerId, x._isolateId, x._receivePortId]; throw H.wrapException("Illegal underlying port " + H.S(x)); } }, _JsCopier: { "": "_Copier;_visited", visitSendPort$1: function(x) { if (!!x.$is_NativeJsSendPort) return new H._NativeJsSendPort(x._receivePort, x._isolateId); if (!!x.$is_WorkerSendPort) return new H._WorkerSendPort(x._workerId, x._receivePortId, x._isolateId); throw H.wrapException("Illegal underlying port " + H.S(x)); } }, _JsDeserializer: { "": "_Deserializer;_deserialized", deserializeSendPort$1: function(list) { var t1, managerId, isolateId, receivePortId, isolate, receivePort; t1 = J.getInterceptor$asx(list); managerId = t1.$index(list, 1); isolateId = t1.$index(list, 2); receivePortId = t1.$index(list, 3); if (J.$eq(managerId, init.globalState.currentManagerId)) { t1 = init.globalState.isolates; isolate = t1.$index(t1, isolateId); if (isolate == null) return; receivePort = isolate.lookup$1(receivePortId); if (receivePort == null) return; return new H._NativeJsSendPort(receivePort, isolateId); } else return new H._WorkerSendPort(managerId, receivePortId, isolateId); } }, _JsVisitedMap: { "": "Object;tagged", $index: function(_, object) { return object.__MessageTraverser__attached_info__; }, $indexSet: function(_, object, info) { this.tagged.push(object); object.__MessageTraverser__attached_info__ = info; }, reset$0: function(_) { this.tagged = []; }, cleanup$0: function() { var $length, i, t1; for ($length = this.tagged.length, i = 0; i < $length; ++i) { t1 = this.tagged; if (i >= t1.length) return H.ioore(t1, i); t1[i].__MessageTraverser__attached_info__ = null; } this.tagged = null; } }, _MessageTraverserVisitedMap: { "": "Object;", $index: function(_, object) { return; }, $indexSet: function(_, object, info) { }, reset$0: function(_) { }, cleanup$0: function() { return; } }, _MessageTraverser: { "": "Object;", traverse$1: function(x) { var result, t1; if (H._MessageTraverser_isPrimitive(x)) return this.visitPrimitive$1(x); t1 = this._visited; t1.reset$0(t1); result = null; try { result = this._dispatch$1(x); } finally { this._visited.cleanup$0(); } return result; }, _dispatch$1: function(x) { var t1; if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") return this.visitPrimitive$1(x); t1 = J.getInterceptor(x); if (typeof x === "object" && x !== null && (x.constructor === Array || !!t1.$isList)) return this.visitList$1(x); if (typeof x === "object" && x !== null && !!t1.$isMap) return this.visitMap$1(x); if (typeof x === "object" && x !== null && !!t1.$isSendPort) return this.visitSendPort$1(x); return this.visitObject$1(x); }, visitObject$1: function(x) { throw H.wrapException("Message serialization: Illegal value " + H.S(x) + " passed"); } }, _Copier: { "": "_MessageTraverser;", visitPrimitive$1: function(x) { return x; }, visitList$1: function(list) { var t1, copy, len, t2, i; t1 = this._visited; copy = t1.$index(t1, list); if (copy != null) return copy; t1 = J.getInterceptor$asx(list); len = t1.get$length(list); copy = Array(len); copy.fixed$length = init; t2 = this._visited; t2.$indexSet(t2, list, copy); for (i = 0; i < len; ++i) copy[i] = this._dispatch$1(t1.$index(list, i)); return copy; }, visitMap$1: function(map) { var t1, t2, copy; t1 = {}; t2 = this._visited; copy = t2.$index(t2, map); t1.copy_0 = copy; if (copy != null) return copy; copy = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null); t1.copy_0 = copy; t2 = this._visited; t2.$indexSet(t2, map, copy); map.forEach$1(map, new H._Copier_visitMap_closure(t1, this)); return t1.copy_0; }, visitSendPort$1: function(x) { return H.throwExpression(P.UnimplementedError$(null)); } }, _Copier_visitMap_closure: { "": "Closure:9;box_0,this_1", call$2: function(key, val) { var t1 = this.this_1; J.$indexSet$ax(this.box_0.copy_0, t1._dispatch$1(key), t1._dispatch$1(val)); } }, _Serializer: { "": "_MessageTraverser;", visitPrimitive$1: function(x) { return x; }, visitList$1: function(list) { var t1, copyId, id; t1 = this._visited; copyId = t1.$index(t1, list); if (copyId != null) return ["ref", copyId]; id = this._nextFreeRefId; this._nextFreeRefId = id + 1; t1 = this._visited; t1.$indexSet(t1, list, id); return ["list", id, this._serializeList$1(list)]; }, visitMap$1: function(map) { var t1, copyId, id, keys; t1 = this._visited; copyId = t1.$index(t1, map); if (copyId != null) return ["ref", copyId]; id = this._nextFreeRefId; this._nextFreeRefId = id + 1; t1 = this._visited; t1.$indexSet(t1, map, id); t1 = map.get$keys(); keys = this._serializeList$1(P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "IterableBase", 0))); t1 = map.get$values(map); return ["map", id, keys, this._serializeList$1(P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "IterableBase", 0)))]; }, _serializeList$1: function(list) { var t1, len, result, i, t2; t1 = J.getInterceptor$asx(list); len = t1.get$length(list); result = []; C.JSArray_methods.set$length(result, len); for (i = 0; i < len; ++i) { t2 = this._dispatch$1(t1.$index(list, i)); if (i >= result.length) return H.ioore(result, i); result[i] = t2; } return result; }, visitSendPort$1: function(x) { return H.throwExpression(P.UnimplementedError$(null)); } }, _Deserializer: { "": "Object;", deserialize$1: function(x) { if (H._Deserializer_isPrimitive(x)) return x; this._deserialized = P.HashMap_HashMap(null, null, null, null, null); return this._deserializeHelper$1(x); }, _deserializeHelper$1: function(x) { var t1, id; if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean") return x; t1 = J.getInterceptor$asx(x); switch (t1.$index(x, 0)) { case "ref": id = t1.$index(x, 1); t1 = this._deserialized; return t1.$index(t1, id); case "list": return this._deserializeList$1(x); case "map": return this._deserializeMap$1(x); case "sendport": return this.deserializeSendPort$1(x); default: return this.deserializeObject$1(x); } }, _deserializeList$1: function(x) { var t1, id, dartList, len, i; t1 = J.getInterceptor$asx(x); id = t1.$index(x, 1); dartList = t1.$index(x, 2); t1 = this._deserialized; t1.$indexSet(t1, id, dartList); t1 = J.getInterceptor$asx(dartList); len = t1.get$length(dartList); if (typeof len !== "number") return H.iae(len); i = 0; for (; i < len; ++i) t1.$indexSet(dartList, i, this._deserializeHelper$1(t1.$index(dartList, i))); return dartList; }, _deserializeMap$1: function(x) { var result, t1, id, t2, keys, values, len, i; result = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null); t1 = J.getInterceptor$asx(x); id = t1.$index(x, 1); t2 = this._deserialized; t2.$indexSet(t2, id, result); keys = t1.$index(x, 2); values = t1.$index(x, 3); t1 = J.getInterceptor$asx(keys); len = t1.get$length(keys); if (typeof len !== "number") return H.iae(len); t2 = J.getInterceptor$asx(values); i = 0; for (; i < len; ++i) result.$indexSet(result, this._deserializeHelper$1(t1.$index(keys, i)), this._deserializeHelper$1(t2.$index(values, i))); return result; }, deserializeObject$1: function(x) { throw H.wrapException("Unexpected serialized object"); } }, TimerImpl: { "": "Object;_once,_inEventLoop,_handle", TimerImpl$2: function(milliseconds, callback) { var t1, t2; if (milliseconds === 0) t1 = $.get$globalThis().setTimeout == null || init.globalState.isWorker === true; else t1 = false; if (t1) { this._handle = 1; t1 = init.globalState.topEventLoop; t2 = init.globalState.currentContext; t1.events._add$1(new H._IsolateEvent(t2, new H.TimerImpl_internalCallback(this, callback), "timer")); this._inEventLoop = true; } else { t1 = $.get$globalThis(); if (t1.setTimeout != null) { t2 = init.globalState.topEventLoop; t2.activeTimerCount = t2.activeTimerCount + 1; this._handle = t1.setTimeout(H.convertDartClosureToJS(new H.TimerImpl_internalCallback0(this, callback), 0), milliseconds); } else throw H.wrapException(P.UnsupportedError$("Timer greater than 0.")); } }, static: {TimerImpl$: function(milliseconds, callback) { var t1 = new H.TimerImpl(true, false, null); t1.TimerImpl$2(milliseconds, callback); return t1; }} }, TimerImpl_internalCallback: { "": "Closure:0;this_0,callback_1", call$0: function() { this.this_0._handle = null; this.callback_1.call$0(); } }, TimerImpl_internalCallback0: { "": "Closure:0;this_2,callback_3", call$0: function() { this.this_2._handle = null; var t1 = init.globalState.topEventLoop; t1.activeTimerCount = t1.activeTimerCount - 1; this.callback_3.call$0(); } } }], ["_js_helper", "dart:_js_helper", , H, { "": "", isJsIndexable: function(object, record) { var result, t1; if (record != null) { result = record.x; if (result != null) return result; } t1 = J.getInterceptor(object); return typeof object === "object" && object !== null && !!t1.$isJavaScriptIndexingBehavior; }, S: function(value) { var res; if (typeof value === "string") return value; if (typeof value === "number") { if (value !== 0) return "" + value; } else if (true === value) return "true"; else if (false === value) return "false"; else if (value == null) return "null"; res = J.toString$0(value); if (typeof res !== "string") throw H.wrapException(P.ArgumentError$(value)); return res; }, Primitives_objectHashCode: function(object) { var hash = object.$identityHash; if (hash == null) { hash = Math.random() * 0x3fffffff | 0; object.$identityHash = hash; } return hash; }, Primitives_objectTypeName: function(object) { var $name, decompiled; $name = C.JS_CONST_IX5(J.getInterceptor(object)); if ($name === "Object") { decompiled = String(object.constructor).match(/^\s*function\s*(\S*)\s*\(/)[1]; if (typeof decompiled === "string") $name = decompiled; } if (J.getInterceptor$s($name).codeUnitAt$1($name, 0) === 36) $name = C.JSString_methods.substring$1($name, 1); return $name + H.joinArguments(H.getRuntimeTypeInfo(object), 0, null); }, Primitives_objectToString: function(object) { return "Instance of '" + H.Primitives_objectTypeName(object) + "'"; }, Primitives__fromCharCodeApply: function(array) { var end, t1, result, i, subarray, t2; end = array.length; for (t1 = end <= 500, result = "", i = 0; i < end; i += 500) { if (t1) subarray = array; else { t2 = i + 500; t2 = t2 < end ? t2 : end; subarray = array.slice(i, t2); } result += String.fromCharCode.apply(null, subarray); } return result; }, Primitives_stringFromCodePoints: function(codePoints) { var a, t1, i; a = []; a.$builtinTypeInfo = [J.JSInt]; for (t1 = new H.ListIterator(codePoints, codePoints.length, 0, null); t1.moveNext$0();) { i = t1._dev$_current; if (typeof i !== "number" || Math.floor(i) !== i) throw H.wrapException(P.ArgumentError$(i)); if (i <= 65535) a.push(i); else if (i <= 1114111) { a.push(55296 + (C.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); a.push(56320 + (i & 1023)); } else throw H.wrapException(P.ArgumentError$(i)); } return H.Primitives__fromCharCodeApply(a); }, Primitives_stringFromCharCodes: function(charCodes) { var t1, i; for (t1 = new H.ListIterator(charCodes, charCodes.length, 0, null); t1.moveNext$0();) { i = t1._dev$_current; if (typeof i !== "number" || Math.floor(i) !== i) throw H.wrapException(P.ArgumentError$(i)); if (i < 0) throw H.wrapException(P.ArgumentError$(i)); if (i > 65535) return H.Primitives_stringFromCodePoints(charCodes); } return H.Primitives__fromCharCodeApply(charCodes); }, Primitives_lazyAsJsDate: function(receiver) { if (receiver.date === void 0) receiver.date = new Date(receiver.millisecondsSinceEpoch); return receiver.date; }, Primitives_getHours: function(receiver) { return receiver.isUtc ? H.Primitives_lazyAsJsDate(receiver).getUTCHours() + 0 : H.Primitives_lazyAsJsDate(receiver).getHours() + 0; }, Primitives_getMinutes: function(receiver) { return receiver.isUtc ? H.Primitives_lazyAsJsDate(receiver).getUTCMinutes() + 0 : H.Primitives_lazyAsJsDate(receiver).getMinutes() + 0; }, Primitives_getSeconds: function(receiver) { return receiver.isUtc ? H.Primitives_lazyAsJsDate(receiver).getUTCSeconds() + 0 : H.Primitives_lazyAsJsDate(receiver).getSeconds() + 0; }, Primitives_getProperty: function(object, key) { if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") throw H.wrapException(new P.ArgumentError(object)); return object[key]; }, Primitives_setProperty: function(object, key, value) { if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string") throw H.wrapException(new P.ArgumentError(object)); object[key] = value; }, iae: function(argument) { throw H.wrapException(P.ArgumentError$(argument)); }, ioore: function(receiver, index) { if (receiver == null) J.get$length$asx(receiver); if (typeof index !== "number" || Math.floor(index) !== index) H.iae(index); throw H.wrapException(P.RangeError$value(index)); }, wrapException: function(ex) { var wrapper; if (ex == null) ex = new P.NullThrownError(); wrapper = new Error(); wrapper.dartException = ex; if ("defineProperty" in Object) { Object.defineProperty(wrapper, "message", { get: H.toStringWrapper }); wrapper.name = ""; } else wrapper.toString = H.toStringWrapper; return wrapper; }, toStringWrapper: function() { return J.toString$0(this.dartException); }, throwExpression: function(ex) { var wrapper; if (ex == null) ex = new P.NullThrownError(); wrapper = new Error(); wrapper.dartException = ex; if ("defineProperty" in Object) { Object.defineProperty(wrapper, "message", { get: H.toStringWrapper }); wrapper.name = ""; } else wrapper.toString = H.toStringWrapper; throw wrapper; }, unwrapException: function(ex) { var t1, message, number, ieErrorCode, t2, t3, t4, nullLiteralCall, t5, t6, t7, t8, t9, match; t1 = new H.unwrapException_saveStackTrace(ex); if (ex == null) return; if (typeof ex !== "object") return ex; if ("dartException" in ex) return t1.call$1(ex.dartException); else if (!("message" in ex)) return ex; message = ex.message; if ("number" in ex && typeof ex.number == "number") { number = ex.number; ieErrorCode = number & 65535; if ((C.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) switch (ieErrorCode) { case 438: return t1.call$1(H.JsNoSuchMethodError$(H.S(message) + " (Error " + ieErrorCode + ")", null)); case 445: case 5007: t2 = H.S(message) + " (Error " + ieErrorCode + ")"; return t1.call$1(new H.NullError(t2, null)); default: } } if (ex instanceof TypeError) { t2 = $.get$TypeErrorDecoder_noSuchMethodPattern(); t3 = $.get$TypeErrorDecoder_notClosurePattern(); t4 = $.get$TypeErrorDecoder_nullCallPattern(); nullLiteralCall = $.get$TypeErrorDecoder_nullLiteralCallPattern(); t5 = $.get$TypeErrorDecoder_undefinedCallPattern(); t6 = $.get$TypeErrorDecoder_undefinedLiteralCallPattern(); t7 = $.get$TypeErrorDecoder_nullPropertyPattern(); $.get$TypeErrorDecoder_nullLiteralPropertyPattern(); t8 = $.get$TypeErrorDecoder_undefinedPropertyPattern(); t9 = $.get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); match = t2.matchTypeError$1(message); if (match != null) return t1.call$1(H.JsNoSuchMethodError$(message, match)); else { match = t3.matchTypeError$1(message); if (match != null) { match.method = "call"; return t1.call$1(H.JsNoSuchMethodError$(message, match)); } else { match = t4.matchTypeError$1(message); if (match == null) { match = nullLiteralCall.matchTypeError$1(message); if (match == null) { match = t5.matchTypeError$1(message); if (match == null) { match = t6.matchTypeError$1(message); if (match == null) { match = t7.matchTypeError$1(message); if (match == null) { match = nullLiteralCall.matchTypeError$1(message); if (match == null) { match = t8.matchTypeError$1(message); if (match == null) { match = t9.matchTypeError$1(message); t2 = match != null; } else t2 = true; } else t2 = true; } else t2 = true; } else t2 = true; } else t2 = true; } else t2 = true; } else t2 = true; if (t2) { t2 = match == null ? null : match.method; return t1.call$1(new H.NullError(message, t2)); } } } t2 = typeof message === "string" ? message : ""; return t1.call$1(new H.UnknownJsTypeError(t2)); } if (ex instanceof RangeError) { if (typeof message === "string" && message.indexOf("call stack") !== -1) return new P.StackOverflowError(); return t1.call$1(new P.ArgumentError(null)); } if (typeof InternalError == "function" && ex instanceof InternalError) if (typeof message === "string" && message === "too much recursion") return new P.StackOverflowError(); return ex; }, objectHashCode: function(object) { if (object == null || typeof object != 'object') return J.get$hashCode$(object); else return H.Primitives_objectHashCode(object); }, fillLiteralMap: function(keyValuePairs, result) { var $length, index, index0, index1; $length = keyValuePairs.length; for (index = 0; index < $length; index = index1) { index0 = index + 1; index1 = index0 + 1; result.$indexSet(result, keyValuePairs[index], keyValuePairs[index0]); } return result; }, invokeClosure: function(closure, isolate, numberOfArguments, arg1, arg2, arg3, arg4) { var t1 = J.getInterceptor(numberOfArguments); if (t1.$eq(numberOfArguments, 0)) return H._callInIsolate(isolate, new H.invokeClosure_closure(closure)); else if (t1.$eq(numberOfArguments, 1)) return H._callInIsolate(isolate, new H.invokeClosure_closure0(closure, arg1)); else if (t1.$eq(numberOfArguments, 2)) return H._callInIsolate(isolate, new H.invokeClosure_closure1(closure, arg1, arg2)); else if (t1.$eq(numberOfArguments, 3)) return H._callInIsolate(isolate, new H.invokeClosure_closure2(closure, arg1, arg2, arg3)); else if (t1.$eq(numberOfArguments, 4)) return H._callInIsolate(isolate, new H.invokeClosure_closure3(closure, arg1, arg2, arg3, arg4)); else throw H.wrapException(P.Exception_Exception("Unsupported number of arguments for wrapped closure")); }, convertDartClosureToJS: function(closure, arity) { var $function; if (closure == null) return; $function = closure.$identity; if (!!$function) return $function; $function = (function(closure, arity, context, invoke) { return function(a1, a2, a3, a4) { return invoke(closure, context, arity, a1, a2, a3, a4); };})(closure,arity,init.globalState.currentContext,H.invokeClosure); closure.$identity = $function; return $function; }, Closure_fromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, propertyName) { var $function, callName, functionType, $prototype, $constructor, t1, isIntercepted, trampoline, signatureFunction, getReceiver, i, stub, stubCallName, t2; $function = functions[0]; $function.$stubName; callName = $function.$callName; $function.$reflectionInfo = reflectionInfo; functionType = H.ReflectionInfo_ReflectionInfo($function).functionType; $prototype = isStatic ? Object.create(new H.TearOffClosure().constructor.prototype) : Object.create(new H.BoundClosure(null, null, null, null).constructor.prototype); $prototype.$initialize = $prototype.constructor; if (isStatic) $constructor = function(){this.$initialize()}; else if (typeof dart_precompiled == "function") { t1 = function(a,b,c,d) {this.$initialize(a,b,c,d)}; $constructor = t1; } else { t1 = $.Closure_functionCounter; $.Closure_functionCounter = J.$add$ns(t1, 1); t1 = new Function("a", "b", "c", "d", "this.$initialize(a,b,c,d);" + t1); $constructor = t1; } $prototype.constructor = $constructor; $constructor.prototype = $prototype; t1 = !isStatic; if (t1) { isIntercepted = jsArguments.length == 1 && true; trampoline = H.Closure_forwardCallTo($function, isIntercepted); } else { $prototype.$name = propertyName; trampoline = $function; isIntercepted = false; } if (typeof functionType == "number") signatureFunction = (function(s){return function(){return init.metadata[s]}})(functionType); else if (t1 && typeof functionType == "function") { getReceiver = isIntercepted ? H.BoundClosure_receiverOf : H.BoundClosure_selfOf; signatureFunction = function(f,r){return function(){return f.apply({$receiver:r(this)},arguments)}}(functionType,getReceiver); } else throw H.wrapException("Error in reflectionInfo."); $prototype.$signature = signatureFunction; $prototype[callName] = trampoline; for (t1 = functions.length, i = 1; i < t1; ++i) { stub = functions[i]; stubCallName = stub.$callName; if (stubCallName != null) { t2 = isStatic ? stub : H.Closure_forwardCallTo(stub, isIntercepted); $prototype[stubCallName] = t2; } } $prototype["call*"] = $function; return $constructor; }, Closure_cspForwardCall: function(arity, $function) { var getSelf = H.BoundClosure_selfOf; switch (arity) { case 0: return function(F,S){return function(){return F.call(S(this))}}($function,getSelf); case 1: return function(F,S){return function(a){return F.call(S(this),a)}}($function,getSelf); case 2: return function(F,S){return function(a,b){return F.call(S(this),a,b)}}($function,getSelf); case 3: return function(F,S){return function(a,b,c){return F.call(S(this),a,b,c)}}($function,getSelf); case 4: return function(F,S){return function(a,b,c,d){return F.call(S(this),a,b,c,d)}}($function,getSelf); case 5: return function(F,S){return function(a,b,c,d,e){return F.call(S(this),a,b,c,d,e)}}($function,getSelf); default: return function(f,s){return function(){return f.apply(s(this),arguments)}}($function,getSelf); } }, Closure_forwardCallTo: function($function, isIntercepted) { var arity, t1, t2, $arguments; if (isIntercepted) return H.Closure_forwardInterceptedCallTo($function); arity = $function.length; if (typeof dart_precompiled == "function") return H.Closure_cspForwardCall(arity, $function); else if (arity === 0) { t1 = $.BoundClosure_selfFieldNameCache; if (t1 == null) { t1 = H.BoundClosure_computeFieldNamed("self"); $.BoundClosure_selfFieldNameCache = t1; } t1 = "return function(){return F.call(this." + H.S(t1) + ");"; t2 = $.Closure_functionCounter; $.Closure_functionCounter = J.$add$ns(t2, 1); return new Function("F", t1 + H.S(t2) + "}")($function); } else if (1 <= arity && arity < 27) { $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity).join(","); t1 = "return function(" + $arguments + "){return F.call(this."; t2 = $.BoundClosure_selfFieldNameCache; if (t2 == null) { t2 = H.BoundClosure_computeFieldNamed("self"); $.BoundClosure_selfFieldNameCache = t2; } t2 = t1 + H.S(t2) + "," + $arguments + ");"; t1 = $.Closure_functionCounter; $.Closure_functionCounter = J.$add$ns(t1, 1); return new Function("F", t2 + H.S(t1) + "}")($function); } else return H.Closure_cspForwardCall(arity, $function); }, Closure_cspForwardInterceptedCall: function(arity, $name, $function) { var getSelf, getReceiver; getSelf = H.BoundClosure_selfOf; getReceiver = H.BoundClosure_receiverOf; switch (arity) { case 0: throw H.wrapException(H.RuntimeError$("Intercepted function with no arguments.")); case 1: return function(n,s,r){return function(){return s(this)[n](r(this))}}($name,getSelf,getReceiver); case 2: return function(n,s,r){return function(a){return s(this)[n](r(this),a)}}($name,getSelf,getReceiver); case 3: return function(n,s,r){return function(a,b){return s(this)[n](r(this),a,b)}}($name,getSelf,getReceiver); case 4: return function(n,s,r){return function(a,b,c){return s(this)[n](r(this),a,b,c)}}($name,getSelf,getReceiver); case 5: return function(n,s,r){return function(a,b,c,d){return s(this)[n](r(this),a,b,c,d)}}($name,getSelf,getReceiver); case 6: return function(n,s,r){return function(a,b,c,d,e){return s(this)[n](r(this),a,b,c,d,e)}}($name,getSelf,getReceiver); default: return function(f,s,r,a){return function(){a=[r(this)];Array.prototype.push.apply(a,arguments);return f.apply(s(this),a)}}($function,getSelf,getReceiver); } }, Closure_forwardInterceptedCallTo: function($function) { var stubName, arity, t1, t2, $arguments; stubName = $function.$stubName; arity = $function.length; if (typeof dart_precompiled == "function") return H.Closure_cspForwardInterceptedCall(arity, stubName, $function); else if (arity === 1) { t1 = "return this." + H.S(H.BoundClosure_selfFieldName()) + "." + stubName + "(this." + H.S(H.BoundClosure_receiverFieldName()) + ");"; t2 = $.Closure_functionCounter; $.Closure_functionCounter = J.$add$ns(t2, 1); return new Function(t1 + H.S(t2)); } else if (1 < arity && arity < 28) { $arguments = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity - 1).join(","); t1 = "return function(" + $arguments + "){return this." + H.S(H.BoundClosure_selfFieldName()) + "." + stubName + "(this." + H.S(H.BoundClosure_receiverFieldName()) + "," + $arguments + ");"; t2 = $.Closure_functionCounter; $.Closure_functionCounter = J.$add$ns(t2, 1); return new Function(t1 + H.S(t2) + "}")(); } else return H.Closure_cspForwardInterceptedCall(arity, stubName, $function); }, closureFromTearOff: function(receiver, functions, reflectionInfo, isStatic, jsArguments, $name) { functions.fixed$length = init; reflectionInfo.fixed$length = init; return H.Closure_fromTearOff(receiver, functions, reflectionInfo, !!isStatic, jsArguments, $name); }, throwCyclicInit: function(staticName) { throw H.wrapException(P.CyclicInitializationError$("Cyclic initialization for static " + H.S(staticName))); }, buildFunctionType: function(returnType, parameterTypes, optionalParameterTypes) { return new H.RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, null); }, getDynamicRuntimeType: function() { return C.C_DynamicRuntimeType; }, createRuntimeType: function($name) { return new H.TypeImpl($name, null); }, setRuntimeTypeInfo: function(target, typeInfo) { if (target != null) target.$builtinTypeInfo = typeInfo; return target; }, getRuntimeTypeInfo: function(target) { if (target == null) return; return target.$builtinTypeInfo; }, getRuntimeTypeArguments: function(target, substitutionName) { return H.substitute(target["$as" + H.S(substitutionName)], H.getRuntimeTypeInfo(target)); }, getRuntimeTypeArgument: function(target, substitutionName, index) { var $arguments = H.getRuntimeTypeArguments(target, substitutionName); return $arguments == null ? null : $arguments[index]; }, getTypeArgumentByIndex: function(target, index) { var rti = H.getRuntimeTypeInfo(target); return rti == null ? null : rti[index]; }, runtimeTypeToString: function(type, onTypeVariable) { if (type == null) return "dynamic"; else if (typeof type === "object" && type !== null && type.constructor === Array) return type[0].builtin$cls + H.joinArguments(type, 1, onTypeVariable); else if (typeof type == "function") return type.builtin$cls; else if (typeof type === "number" && Math.floor(type) === type) return C.JSInt_methods.toString$0(type); else return; }, joinArguments: function(types, startIndex, onTypeVariable) { var buffer, index, firstArgument, allDynamic, argument, str; if (types == null) return ""; buffer = P.StringBuffer$(""); for (index = startIndex, firstArgument = true, allDynamic = true; index < types.length; ++index) { if (firstArgument) firstArgument = false; else buffer._contents = buffer._contents + ", "; argument = types[index]; if (argument != null) allDynamic = false; str = H.runtimeTypeToString(argument, onTypeVariable); str = typeof str === "string" ? str : H.S(str); buffer._contents = buffer._contents + str; } return allDynamic ? "" : "<" + H.S(buffer) + ">"; }, substitute: function(substitution, $arguments) { if (typeof substitution === "object" && substitution !== null && substitution.constructor === Array) $arguments = substitution; else if (typeof substitution == "function") { substitution = H.invokeOn(substitution, null, $arguments); if (typeof substitution === "object" && substitution !== null && substitution.constructor === Array) $arguments = substitution; else if (typeof substitution == "function") $arguments = H.invokeOn(substitution, null, $arguments); } return $arguments; }, areSubtypes: function(s, t) { var len, i; if (s == null || t == null) return true; len = s.length; for (i = 0; i < len; ++i) if (!H.isSubtype(s[i], t[i])) return false; return true; }, computeSignature: function(signature, context, contextName) { return H.invokeOn(signature, context, H.getRuntimeTypeArguments(context, contextName)); }, isSubtype: function(s, t) { var targetSignatureFunction, t1, typeOfS, t2, typeOfT, $name, substitution; if (s === t) return true; if (s == null || t == null) return true; if ("func" in t) { if (!("func" in s)) { if ("$is_" + H.S(t.func) in s) return true; targetSignatureFunction = s.$signature; if (targetSignatureFunction == null) return false; s = targetSignatureFunction.apply(s, null); } return H.isFunctionSubtype(s, t); } if (t.builtin$cls === "Function" && "func" in s) return true; t1 = typeof s === "object" && s !== null && s.constructor === Array; typeOfS = t1 ? s[0] : s; t2 = typeof t === "object" && t !== null && t.constructor === Array; typeOfT = t2 ? t[0] : t; $name = H.runtimeTypeToString(typeOfT, null); if (typeOfT !== typeOfS) { if (!("$is" + H.S($name) in typeOfS)) return false; substitution = typeOfS["$as" + H.S(H.runtimeTypeToString(typeOfT, null))]; } else substitution = null; if (!t1 && substitution == null || !t2) return true; t1 = t1 ? s.slice(1) : null; t2 = t2 ? t.slice(1) : null; return H.areSubtypes(H.substitute(substitution, t1), t2); }, areAssignable: function(s, t, allowShorter) { var sLength, tLength, i, t1, t2; if (t == null && s == null) return true; if (t == null) return allowShorter; if (s == null) return false; sLength = s.length; tLength = t.length; if (allowShorter) { if (sLength < tLength) return false; } else if (sLength !== tLength) return false; for (i = 0; i < tLength; ++i) { t1 = s[i]; t2 = t[i]; if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) return false; } return true; }, areAssignableMaps: function(s, t) { var t1, names, i, $name, tType, sType; if (t == null) return true; if (s == null) return false; t1 = Object.getOwnPropertyNames(t); t1.fixed$length = init; names = t1; for (t1 = names.length, i = 0; i < t1; ++i) { $name = names[i]; if (!Object.hasOwnProperty.call(s, $name)) return false; tType = t[$name]; sType = s[$name]; if (!(H.isSubtype(tType, sType) || H.isSubtype(sType, tType))) return false; } return true; }, isFunctionSubtype: function(s, t) { var sReturnType, tReturnType, sParameterTypes, tParameterTypes, sOptionalParameterTypes, tOptionalParameterTypes, sParametersLen, tParametersLen, sOptionalParametersLen, tOptionalParametersLen, pos, t1, t2, tPos, sPos; if (!("func" in s)) return false; if ("void" in s) { if (!("void" in t) && "ret" in t) return false; } else if (!("void" in t)) { sReturnType = s.ret; tReturnType = t.ret; if (!(H.isSubtype(sReturnType, tReturnType) || H.isSubtype(tReturnType, sReturnType))) return false; } sParameterTypes = s.args; tParameterTypes = t.args; sOptionalParameterTypes = s.opt; tOptionalParameterTypes = t.opt; sParametersLen = sParameterTypes != null ? sParameterTypes.length : 0; tParametersLen = tParameterTypes != null ? tParameterTypes.length : 0; sOptionalParametersLen = sOptionalParameterTypes != null ? sOptionalParameterTypes.length : 0; tOptionalParametersLen = tOptionalParameterTypes != null ? tOptionalParameterTypes.length : 0; if (sParametersLen > tParametersLen) return false; if (sParametersLen + sOptionalParametersLen < tParametersLen + tOptionalParametersLen) return false; if (sParametersLen === tParametersLen) { if (!H.areAssignable(sParameterTypes, tParameterTypes, false)) return false; if (!H.areAssignable(sOptionalParameterTypes, tOptionalParameterTypes, true)) return false; } else { for (pos = 0; pos < sParametersLen; ++pos) { t1 = sParameterTypes[pos]; t2 = tParameterTypes[pos]; if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) return false; } for (tPos = pos, sPos = 0; tPos < tParametersLen; ++sPos, ++tPos) { t1 = sOptionalParameterTypes[sPos]; t2 = tParameterTypes[tPos]; if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) return false; } for (tPos = 0; tPos < tOptionalParametersLen; ++sPos, ++tPos) { t1 = sOptionalParameterTypes[sPos]; t2 = tOptionalParameterTypes[tPos]; if (!(H.isSubtype(t1, t2) || H.isSubtype(t2, t1))) return false; } } return H.areAssignableMaps(s.named, t.named); }, invokeOn: function($function, receiver, $arguments) { return $function.apply(receiver, $arguments); }, toStringForNativeObject: function(obj) { var t1 = $.getTagFunction; return "Instance of " + (t1 == null ? "" : t1.call$1(obj)); }, hashCodeForNativeObject: function(object) { return H.Primitives_objectHashCode(object); }, defineProperty: function(obj, property, value) { Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); }, lookupAndCacheInterceptor: function(obj) { var tag, record, interceptor, interceptorClass, mark, t1; tag = $.getTagFunction.call$1(obj); record = $.dispatchRecordsForInstanceTags[tag]; if (record != null) { Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } interceptor = $.interceptorsForUncacheableTags[tag]; if (interceptor != null) return interceptor; interceptorClass = init.interceptorsByTag[tag]; if (interceptorClass == null) { tag = $.alternateTagFunction.call$2(obj, tag); if (tag != null) { record = $.dispatchRecordsForInstanceTags[tag]; if (record != null) { Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } interceptor = $.interceptorsForUncacheableTags[tag]; if (interceptor != null) return interceptor; interceptorClass = init.interceptorsByTag[tag]; } } if (interceptorClass == null) return; interceptor = interceptorClass.prototype; mark = tag[0]; if (mark === "!") { record = H.makeLeafDispatchRecord(interceptor); $.dispatchRecordsForInstanceTags[tag] = record; Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } if (mark === "~") { $.interceptorsForUncacheableTags[tag] = interceptor; return interceptor; } if (mark === "-") { t1 = H.makeLeafDispatchRecord(interceptor); Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); return t1.i; } if (mark === "+") return H.patchInteriorProto(obj, interceptor); if (mark === "*") throw H.wrapException(P.UnimplementedError$(tag)); if (init.leafTags[tag] === true) { t1 = H.makeLeafDispatchRecord(interceptor); Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); return t1.i; } else return H.patchInteriorProto(obj, interceptor); }, patchInteriorProto: function(obj, interceptor) { var proto, record; proto = Object.getPrototypeOf(obj); record = J.makeDispatchRecord(interceptor, proto, null, null); Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return interceptor; }, makeLeafDispatchRecord: function(interceptor) { return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); }, makeDefaultDispatchRecord: function(tag, interceptorClass, proto) { var interceptor = interceptorClass.prototype; if (init.leafTags[tag] === true) return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); else return J.makeDispatchRecord(interceptor, proto, null, null); }, initNativeDispatch: function() { if (true === $.initNativeDispatchFlag) return; $.initNativeDispatchFlag = true; H.initNativeDispatchContinue(); }, initNativeDispatchContinue: function() { var map, tags, i, tag, proto, record, interceptorClass; $.dispatchRecordsForInstanceTags = Object.create(null); $.interceptorsForUncacheableTags = Object.create(null); H.initHooks(); map = init.interceptorsByTag; tags = Object.getOwnPropertyNames(map); if (typeof window != "undefined") { window; for (i = 0; i < tags.length; ++i) { tag = tags[i]; proto = $.prototypeForTagFunction.call$1(tag); if (proto != null) { record = H.makeDefaultDispatchRecord(tag, map[tag], proto); if (record != null) Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); } } } for (i = 0; i < tags.length; ++i) { tag = tags[i]; if (/^[A-Za-z_]/.test(tag)) { interceptorClass = map[tag]; map["!" + tag] = interceptorClass; map["~" + tag] = interceptorClass; map["-" + tag] = interceptorClass; map["+" + tag] = interceptorClass; map["*" + tag] = interceptorClass; } } }, initHooks: function() { var hooks, transformers, i, transformer, getTag, getUnknownTag, prototypeForTag; hooks = C.JS_CONST_aQP(); hooks = H.applyHooksTransformer(C.JS_CONST_0, H.applyHooksTransformer(C.JS_CONST_rr7, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_Fs4, H.applyHooksTransformer(C.JS_CONST_gkc, H.applyHooksTransformer(C.JS_CONST_U4w, H.applyHooksTransformer(C.JS_CONST_QJm(C.JS_CONST_IX5), hooks))))))); if (typeof dartNativeDispatchHooksTransformer != "undefined") { transformers = dartNativeDispatchHooksTransformer; if (typeof transformers == "function") transformers = [transformers]; if (transformers.constructor == Array) for (i = 0; i < transformers.length; ++i) { transformer = transformers[i]; if (typeof transformer == "function") hooks = transformer(hooks) || hooks; } } getTag = hooks.getTag; getUnknownTag = hooks.getUnknownTag; prototypeForTag = hooks.prototypeForTag; $.getTagFunction = new H.initHooks_closure(getTag); $.alternateTagFunction = new H.initHooks_closure0(getUnknownTag); $.prototypeForTagFunction = new H.initHooks_closure1(prototypeForTag); }, applyHooksTransformer: function(transformer, hooks) { return transformer(hooks) || hooks; }, ReflectionInfo: { "": "Object;jsFunction,data,isAccessor,requiredParameterCount,optionalParameterCount,areOptionalParametersNamed,functionType", static: {"": "ReflectionInfo_REQUIRED_PARAMETERS_INFO,ReflectionInfo_OPTIONAL_PARAMETERS_INFO,ReflectionInfo_FUNCTION_TYPE_INDEX,ReflectionInfo_FIRST_DEFAULT_ARGUMENT", ReflectionInfo_ReflectionInfo: function(jsFunction) { var data, requiredParametersInfo, requiredParameterCount, optionalParametersInfo; data = jsFunction.$reflectionInfo; if (data == null) return; data.fixed$length = init; data = data; requiredParametersInfo = data[0]; requiredParameterCount = requiredParametersInfo >> 1; optionalParametersInfo = data[1]; return new H.ReflectionInfo(jsFunction, data, (requiredParametersInfo & 1) === 1, requiredParameterCount, optionalParametersInfo >> 1, (optionalParametersInfo & 1) === 1, data[2]); }} }, TypeErrorDecoder: { "": "Object;_pattern,_arguments,_argumentsExpr,_expr,_method,_receiver<", matchTypeError$1: function(message) { var match, result, t1; match = new RegExp(this._pattern).exec(message); if (match == null) return; result = {}; t1 = this._arguments; if (t1 !== -1) result.arguments = match[t1 + 1]; t1 = this._argumentsExpr; if (t1 !== -1) result.argumentsExpr = match[t1 + 1]; t1 = this._expr; if (t1 !== -1) result.expr = match[t1 + 1]; t1 = this._method; if (t1 !== -1) result.method = match[t1 + 1]; t1 = this._receiver; if (t1 !== -1) result.receiver = match[t1 + 1]; return result; }, static: {"": "TypeErrorDecoder_noSuchMethodPattern,TypeErrorDecoder_notClosurePattern,TypeErrorDecoder_nullCallPattern,TypeErrorDecoder_nullLiteralCallPattern,TypeErrorDecoder_undefinedCallPattern,TypeErrorDecoder_undefinedLiteralCallPattern,TypeErrorDecoder_nullPropertyPattern,TypeErrorDecoder_nullLiteralPropertyPattern,TypeErrorDecoder_undefinedPropertyPattern,TypeErrorDecoder_undefinedLiteralPropertyPattern", TypeErrorDecoder_extractPattern: function(message) { var match, $arguments, argumentsExpr, expr, method, receiver; message = message.replace(String({}), '$receiver$').replace(new RegExp("[[\\]{}()*+?.\\\\^$|]", 'g'), '\\$&'); match = message.match(/\\\$[a-zA-Z]+\\\$/g); if (match == null) match = []; $arguments = match.indexOf("\\$arguments\\$"); argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); expr = match.indexOf("\\$expr\\$"); method = match.indexOf("\\$method\\$"); receiver = match.indexOf("\\$receiver\\$"); return new H.TypeErrorDecoder(message.replace('\\$arguments\\$', '((?:x|[^x])*)').replace('\\$argumentsExpr\\$', '((?:x|[^x])*)').replace('\\$expr\\$', '((?:x|[^x])*)').replace('\\$method\\$', '((?:x|[^x])*)').replace('\\$receiver\\$', '((?:x|[^x])*)'), $arguments, argumentsExpr, expr, method, receiver); }, TypeErrorDecoder_provokeCallErrorOn: function(expression) { return function($expr$) { var $argumentsExpr$ = '$arguments$' try { $expr$.$method$($argumentsExpr$); } catch (e) { return e.message; } }(expression); }, TypeErrorDecoder_provokePropertyErrorOn: function(expression) { return function($expr$) { try { $expr$.$method$; } catch (e) { return e.message; } }(expression); }} }, NullError: { "": "Error;_message,_method", toString$0: function(_) { var t1 = this._method; if (t1 == null) return "NullError: " + H.S(this._message); return "NullError: Cannot call \"" + H.S(t1) + "\" on null"; }, $isError: true }, JsNoSuchMethodError: { "": "Error;_message,_method,_receiver<", toString$0: function(_) { var t1, t2; t1 = this._method; if (t1 == null) return "NoSuchMethodError: " + H.S(this._message); t2 = this._receiver; if (t2 == null) return "NoSuchMethodError: Cannot call \"" + t1 + "\" (" + H.S(this._message) + ")"; return "NoSuchMethodError: Cannot call \"" + t1 + "\" on \"" + t2 + "\" (" + H.S(this._message) + ")"; }, $isError: true, static: {JsNoSuchMethodError$: function(_message, match) { var t1, t2; t1 = match == null; t2 = t1 ? null : match.method; t1 = t1 ? null : match.receiver; return new H.JsNoSuchMethodError(_message, t2, t1); }} }, UnknownJsTypeError: { "": "Error;_message", toString$0: function(_) { var t1 = this._message; return C.JSString_methods.get$isEmpty(t1) ? "Error" : "Error: " + t1; } }, unwrapException_saveStackTrace: { "": "Closure:10;ex_0", call$1: function(error) { var t1 = J.getInterceptor(error); if (typeof error === "object" && error !== null && !!t1.$isError) if (error.$thrownJsError == null) error.$thrownJsError = this.ex_0; return error; } }, _StackTrace: { "": "Object;_exception,_trace", toString$0: function(_) { var t1, trace; t1 = this._trace; if (t1 != null) return t1; t1 = this._exception; trace = typeof t1 === "object" ? t1.stack : null; t1 = trace == null ? "" : trace; this._trace = t1; return t1; } }, invokeClosure_closure: { "": "Closure:8;closure_0", call$0: function() { return this.closure_0.call$0(); } }, invokeClosure_closure0: { "": "Closure:8;closure_1,arg1_2", call$0: function() { return this.closure_1.call$1(this.arg1_2); } }, invokeClosure_closure1: { "": "Closure:8;closure_3,arg1_4,arg2_5", call$0: function() { return this.closure_3.call$2(this.arg1_4, this.arg2_5); } }, invokeClosure_closure2: { "": "Closure:8;closure_6,arg1_7,arg2_8,arg3_9", call$0: function() { return this.closure_6.call$3(this.arg1_7, this.arg2_8, this.arg3_9); } }, invokeClosure_closure3: { "": "Closure:8;closure_10,arg1_11,arg2_12,arg3_13,arg4_14", call$0: function() { return this.closure_10.call$4(this.arg1_11, this.arg2_12, this.arg3_13, this.arg4_14); } }, Closure: { "": "Object;", toString$0: function(_) { return "Closure"; } }, TearOffClosure: { "": "Closure;" }, BoundClosure: { "": "TearOffClosure;_self<,_target,_receiver<,__js_helper$_name", $eq: function(_, other) { var t1; if (other == null) return false; if (this === other) return true; t1 = J.getInterceptor(other); if (typeof other !== "object" || other === null || !t1.$isBoundClosure) return false; return this._self === other._self && this._target === other._target && this._receiver === other._receiver; }, get$hashCode: function(_) { var t1, receiverHashCode; t1 = this._receiver; if (t1 == null) receiverHashCode = H.Primitives_objectHashCode(this._self); else receiverHashCode = typeof t1 !== "object" ? J.get$hashCode$(t1) : H.Primitives_objectHashCode(t1); return (receiverHashCode ^ H.Primitives_objectHashCode(this._target)) >>> 0; }, $isBoundClosure: true, static: {"": "BoundClosure_selfFieldNameCache,BoundClosure_receiverFieldNameCache", BoundClosure_selfOf: function(closure) { return closure.get$_self(); }, BoundClosure_receiverOf: function(closure) { return closure.get$_receiver(); }, BoundClosure_selfFieldName: function() { var t1 = $.BoundClosure_selfFieldNameCache; if (t1 == null) { t1 = H.BoundClosure_computeFieldNamed("self"); $.BoundClosure_selfFieldNameCache = t1; } return t1; }, BoundClosure_receiverFieldName: function() { var t1 = $.BoundClosure_receiverFieldNameCache; if (t1 == null) { t1 = H.BoundClosure_computeFieldNamed("receiver"); $.BoundClosure_receiverFieldNameCache = t1; } return t1; }, BoundClosure_computeFieldNamed: function(fieldName) { var template, t1, names, i, $name; template = new H.BoundClosure("self", "target", "receiver", "name"); t1 = Object.getOwnPropertyNames(template); t1.fixed$length = init; names = t1; for (t1 = names.length, i = 0; i < t1; ++i) { $name = names[i]; if (template[$name] === fieldName) return $name; } }} }, RuntimeError: { "": "Error;message", toString$0: function(_) { return "RuntimeError: " + H.S(this.message); }, static: {RuntimeError$: function(message) { return new H.RuntimeError(message); }} }, RuntimeType: { "": "Object;" }, RuntimeFunctionType: { "": "RuntimeType;returnType,parameterTypes,optionalParameterTypes,namedParameters", _isTest$1: function(expression) { var functionTypeObject = this._extractFunctionTypeObjectFrom$1(expression); return functionTypeObject == null ? false : H.isFunctionSubtype(functionTypeObject, this.toRti$0()); }, _extractFunctionTypeObjectFrom$1: function(o) { var interceptor = J.getInterceptor(o); return "$signature" in interceptor ? interceptor.$signature() : null; }, toRti$0: function() { var result, t1, t2, namedRti, keys, i, $name; result = { "func": "dynafunc" }; t1 = this.returnType; t2 = J.getInterceptor(t1); if (typeof t1 === "object" && t1 !== null && !!t2.$isVoidRuntimeType) result.void = true; else if (typeof t1 !== "object" || t1 === null || !t2.$isDynamicRuntimeType) result.ret = t1.toRti$0(); t1 = this.parameterTypes; if (t1 != null && t1.length !== 0) result.args = H.RuntimeFunctionType_listToRti(t1); t1 = this.optionalParameterTypes; if (t1 != null && t1.length !== 0) result.opt = H.RuntimeFunctionType_listToRti(t1); t1 = this.namedParameters; if (t1 != null) { namedRti = {}; keys = H.extractKeys(t1); for (t2 = keys.length, i = 0; i < t2; ++i) { $name = keys[i]; namedRti[$name] = t1[$name].toRti$0(); } result.named = namedRti; } return result; }, toString$0: function(_) { var t1, t2, result, needsComma, i, type, keys, $name; t1 = this.parameterTypes; if (t1 != null) for (t2 = t1.length, result = "(", needsComma = false, i = 0; i < t2; ++i, needsComma = true) { type = t1[i]; if (needsComma) result += ", "; result += H.S(type); } else { result = "("; needsComma = false; } t1 = this.optionalParameterTypes; if (t1 != null && t1.length !== 0) { result = (needsComma ? result + ", " : result) + "["; for (t2 = t1.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { type = t1[i]; if (needsComma) result += ", "; result += H.S(type); } result += "]"; } else { t1 = this.namedParameters; if (t1 != null) { result = (needsComma ? result + ", " : result) + "{"; keys = H.extractKeys(t1); for (t2 = keys.length, needsComma = false, i = 0; i < t2; ++i, needsComma = true) { $name = keys[i]; if (needsComma) result += ", "; result += H.S(t1[$name].toRti$0()) + " " + $name; } result += "}"; } } return result + (") -> " + H.S(this.returnType)); }, static: {"": "RuntimeFunctionType_inAssert", RuntimeFunctionType_listToRti: function(list) { var result, t1, i; list = list; result = []; for (t1 = list.length, i = 0; i < t1; ++i) result.push(list[i].toRti$0()); return result; }} }, DynamicRuntimeType: { "": "RuntimeType;", toString$0: function(_) { return "dynamic"; }, toRti$0: function() { return; }, $isDynamicRuntimeType: true }, TypeImpl: { "": "Object;_typeName,_unmangledName", toString$0: function(_) { var t1, unmangledName, unmangledName0; t1 = this._unmangledName; if (t1 != null) return t1; unmangledName = this._typeName; unmangledName0 = init.mangledGlobalNames[unmangledName]; unmangledName = unmangledName0 == null ? unmangledName : unmangledName0; this._unmangledName = unmangledName; return unmangledName; }, get$hashCode: function(_) { return J.get$hashCode$(this._typeName); }, $eq: function(_, other) { var t1; if (other == null) return false; t1 = J.getInterceptor(other); return typeof other === "object" && other !== null && !!t1.$isTypeImpl && J.$eq(this._typeName, other._typeName); }, $isTypeImpl: true }, initHooks_closure: { "": "Closure:10;getTag_0", call$1: function(o) { return this.getTag_0(o); } }, initHooks_closure0: { "": "Closure:11;getUnknownTag_1", call$2: function(o, tag) { return this.getUnknownTag_1(o, tag); } }, initHooks_closure1: { "": "Closure:12;prototypeForTag_2", call$1: function(tag) { return this.prototypeForTag_2(tag); } } }], ["clock", "clock.dart", , Q, { "": "", main: [function() { var t1, t2, t3, t4; t1 = H.setRuntimeTypeInfo(Array(2), [Q.ClockNumber]); t2 = H.setRuntimeTypeInfo(Array(2), [Q.ClockNumber]); t3 = H.setRuntimeTypeInfo(Array(2), [Q.ClockNumber]); t4 = new Q.Balls(null, P.DateTime$_now().millisecondsSinceEpoch, H.setRuntimeTypeInfo([], [Q.Ball])); t4.Balls$0(); new Q.CountDownClock(t1, t2, t3, -1, -1, -1, t4).CountDownClock$0(); }, "call$0", "main$closure", 0, 0, 0], setElementPosition: function(elem, x, y) { J.set$left$x(elem.style, H.S(x) + "px"); J.set$top$x(elem.style, H.S(y) + "px"); }, Balls: { "": "Object;root,lastTime,balls", tick$1: function(now) { var t1, t2, t3, delta; t1 = J.getInterceptor$n(now); t2 = J.$add$ns(t1.$sub(now, this.lastTime), 0.01); if (typeof t2 !== "number") return H.iae(t2); t2 = 1000 / t2; t3 = $.fpsAverage; if (t3 == null) $.fpsAverage = t2; else { if (typeof t3 !== "number") return t3.$mul(); $.fpsAverage = t2 * 0.05 + t3 * 0.95; document.querySelector("#notes").textContent = "" + C.JSInt_methods.toInt$0(C.JSNumber_methods.toInt$0(J.roundToDouble$0$n($.fpsAverage))) + " fps"; } t1 = t1.$sub(now, this.lastTime); if (typeof t1 !== "number") return t1.$div(); delta = P.min(t1 / 1000, 0.1); this.lastTime = now; H.IterableMixinWorkaround_removeWhereList(this.balls, new Q.Balls_tick_closure(delta)); this.collideBalls$1(delta); }, collideBalls$1: function(delta) { H.IterableMixinWorkaround_forEach(this.balls, new Q.Balls_collideBalls_closure(this, delta)); }, Balls$0: function() { var t1 = document.createElement("div", null); this.root = t1; document.body.appendChild(t1); J.set$position$x(this.root.style, "absolute"); t1 = this.root; Q.setElementPosition(t1, 0, 0); J.set$right$x(t1.style, "0px"); J.set$bottom$x(t1.style, "0px"); }, static: {"": "Balls_RADIUS2,Balls_LT_GRAY_BALL_INDEX,Balls_GREEN_BALL_INDEX,Balls_BLUE_BALL_INDEX,Balls_DK_GRAY_BALL_INDEX,Balls_RED_BALL_INDEX,Balls_MD_GRAY_BALL_INDEX,Balls_PNGS"} }, Balls_tick_closure: { "": "Closure:10;delta_0", call$1: function(ball) { return ball.tick$1(this.delta_0); } }, Balls_collideBalls_closure: { "": "Closure:10;this_0,delta_1", call$1: function(b0) { var t1 = this.this_0; H.IterableMixinWorkaround_forEach(t1.balls, new Q.Balls_collideBalls__closure(t1, this.delta_1, b0)); } }, Balls_collideBalls__closure: { "": "Closure:10;this_2,delta_3,b0_4", call$1: function(b1) { var t1, t2, t3, t4, t5, dx, dy, d2, t6, t7, t8, t9, t10, ndx, ndy, d, impactSpeed; t1 = this.b0_4; t2 = J.getInterceptor$x(t1); t3 = t2.get$x(t1); t4 = J.getInterceptor$x(b1); t5 = t4.get$x(b1); if (typeof t3 !== "number") return t3.$sub(); if (typeof t5 !== "number") return H.iae(t5); dx = Math.abs(t3 - t5); t5 = t2.get$y(t1); t3 = t4.get$y(b1); if (typeof t5 !== "number") return t5.$sub(); if (typeof t3 !== "number") return H.iae(t3); dy = Math.abs(t5 - t3); d2 = dx * dx + dy * dy; if (d2 < 196) { t3 = this.delta_3; t2 = t2.get$x(t1); t5 = t1.get$vx(); if (typeof t2 !== "number") return t2.$add(); t6 = t1.y; t7 = t1.vy; if (typeof t6 !== "number") return t6.$add(); t4 = t4.get$x(b1); t8 = b1.get$vx(); if (typeof t4 !== "number") return t4.$add(); t9 = b1.y; t10 = b1.vy; if (typeof t9 !== "number") return t9.$add(); ndx = Math.abs(t2 + t5 * t3 - (t4 + t8 * t3)); ndy = Math.abs(t6 + t7 * t3 - (t9 + t10 * t3)); if (ndx * ndx + ndy * ndy > d2) return; d = Math.sqrt(d2); if (d === 0) return; dx /= d; dy /= d; t2 = t1.get$vx(); impactSpeed = (t2 - b1.vx) * dx + (t1.vy - b1.vy) * dy; t3 = dx * impactSpeed; t1.vx = t2 - t3; t2 = dy * impactSpeed; t1.vy = t1.vy - t2; b1.vx = b1.vx + t3; b1.vy = b1.vy + t2; } } }, Ball: { "": "Object;root,elem,x>,y>,vx<,vy,ax,ay,age", tick$1: function(delta) { var t1, t2, t3, t4; t1 = this.vx + this.ax * delta; this.vx = t1; t2 = this.vy + this.ay * delta; this.vy = t2; t3 = this.x; if (typeof t3 !== "number") return t3.$add(); t1 = t3 + t1 * delta; this.x = t1; t3 = this.y; if (typeof t3 !== "number") return t3.$add(); t3 += t2 * delta; this.y = t3; if (!(t1 < 14)) { t4 = window.innerWidth; if (typeof t4 !== "number") return H.iae(t4); t4 = t1 > t4; } else t4 = true; if (t4) { t1 = this.elem; t2 = t1.parentNode; if (t2 != null) t2.removeChild(t1); return true; } t4 = window.innerHeight; if (typeof t4 !== "number") return H.iae(t4); if (t3 > t4) { t3 = window.innerHeight; t3.toString; this.y = t3; this.vy = t2 * -0.8; t2 = t3; } else t2 = t3; t3 = this.elem; if (typeof t2 !== "number") return t2.$sub(); Q.setElementPosition(t3, t1 - 14, t2 - 14); return false; }, Ball$4: function(root, x, y, color) { var t1; if (color >= 7) return H.ioore(C.List_8eb, color); t1 = W.ImageElement_ImageElement(null, C.List_8eb[color], null); this.elem = t1; J.set$position$x(t1.style, "absolute"); Q.setElementPosition(this.elem, this.x, this.y); this.root.appendChild(this.elem); this.ax = 0; this.ay = 400; this.vx = Q.Ball_randomVelocity(); this.vy = Q.Ball_randomVelocity(); }, static: {"": "Ball_GRAVITY,Ball_RESTITUTION,Ball_MIN_VELOCITY,Ball_INIT_VELOCITY,Ball_RADIUS,Ball_random", Ball_randomVelocity: function() { var t1 = $.Ball_random; if (t1 == null) { $.Ball_random = C.C__JSRandom; t1 = C.C__JSRandom; } return (t1.nextDouble$0() - 0.5) * 800; }} }, CountDownClock: { "": "Object;hours,minutes,seconds,displayedHour,displayedMinute,displayedSecond,balls", tick$1: [function(time) { var t1, t2; this.updateTime$1(P.DateTime$_now()); this.balls.tick$1(time); t1 = window; t2 = this.get$tick(); C.Window_methods._ensureRequestAnimationFrame$0(t1); C.Window_methods._requestAnimationFrame$1(t1, W._wrapZone(t2)); }, "call$1", "get$tick", 2, 0, 13], updateTime$1: function(now) { if (H.Primitives_getHours(now) !== this.displayedHour) { this.setDigits$2(this.pad2$1(H.Primitives_getHours(now)), this.hours); this.displayedHour = H.Primitives_getHours(now); } if (H.Primitives_getMinutes(now) !== this.displayedMinute) { this.setDigits$2(this.pad2$1(H.Primitives_getMinutes(now)), this.minutes); this.displayedMinute = H.Primitives_getMinutes(now); } if (H.Primitives_getSeconds(now) !== this.displayedSecond) { this.setDigits$2(this.pad2$1(H.Primitives_getSeconds(now)), this.seconds); this.displayedSecond = H.Primitives_getSeconds(now); } }, setDigits$2: function(digits, numbers) { var t1, i, t2, digit; for (t1 = digits.length, i = 0; i < 2; ++i) { if (i >= t1) H.throwExpression(P.RangeError$value(i)); t2 = digits.charCodeAt(i); digit = t2 - "0".charCodeAt(0); t2 = numbers[i]; if (digit < 0 || digit >= 10) return H.ioore(C.List_e3I, digit); t2.setPixels$1(C.List_e3I[digit]); } }, pad2$1: function(number) { if (number < 10) return "0" + number; return "" + number; }, createNumbers$3: function($parent, width, height) { var root, x, y, t1, i, t2; root = document.createElement("div", null); J.set$position$x(root.style, "relative"); J.set$textAlign$x(root.style, "center"); document.querySelector("#canvas-content").appendChild(root); if (typeof width !== "number") return width.$sub(); x = (width - 627) / 2; if (typeof height !== "number") return height.$sub(); y = (height - 133) / 3; for (t1 = this.hours, i = 0; i < 2; ++i) { t2 = Q.ClockNumber$(this, x, 2); t1[i] = t2; root.appendChild(t2.root); t2 = t1[i].root; J.set$left$x(t2.style, "" + x + "px"); J.set$top$x(t2.style, "" + y + "px"); x += 95; } root.appendChild(Q.Colon$(x, y).root); x += 38; for (t1 = this.minutes, i = 0; i < 2; ++i) { t2 = Q.ClockNumber$(this, x, 5); t1[i] = t2; root.appendChild(t2.root); t2 = t1[i].root; J.set$left$x(t2.style, "" + x + "px"); J.set$top$x(t2.style, "" + y + "px"); x += 95; } root.appendChild(Q.Colon$(x, y).root); x += 38; for (t1 = this.seconds, i = 0; i < 2; ++i) { t2 = Q.ClockNumber$(this, x, 1); t1[i] = t2; root.appendChild(t2.root); t2 = t1[i].root; J.set$left$x(t2.style, "" + x + "px"); J.set$top$x(t2.style, "" + y + "px"); x += 95; } }, CountDownClock$0: function() { var $parent, t1, t2; $parent = document.querySelector("#canvas-content"); this.createNumbers$3($parent, $parent.clientWidth, $parent.clientHeight); this.updateTime$1(P.DateTime$_now()); t1 = window; t2 = this.get$tick(); C.Window_methods._ensureRequestAnimationFrame$0(t1); C.Window_methods._requestAnimationFrame$1(t1, W._wrapZone(t2)); }, static: {"": "CountDownClock_NUMBER_SPACING,CountDownClock_BALL_WIDTH,CountDownClock_BALL_HEIGHT"} }, ClockNumber: { "": "Object;app,root,imgs,pixels,ballColor", setPixels$1: function(px) { var t1, y, x, img, t2; for (t1 = this.ballColor, y = 0; y < 7; ++y) for (x = 0; x < 4; ++x) { img = this.imgs[y][x]; t2 = this.pixels; if (t2 != null) if (t2[y][x] !== 0 && px[y][x] === 0) P.scheduleMicrotask(new Q.ClockNumber_setPixels_closure(this, img)); if (px[y][x] !== 0) { if (t1 >= 7) return H.ioore(C.List_8eb, t1); t2 = C.List_8eb[t1]; } else t2 = "images/ball-c9c9c9.png"; J.set$src$x(img, t2); } this.pixels = px; }, ClockNumber$3: function(app, pos, ballColor) { var t1, y, t2, x; this.imgs = H.setRuntimeTypeInfo(Array(7), [[J.JSArray, W.ImageElement]]); t1 = document.createElement("div", null); this.root = t1; J.set$position$x(t1.style, "absolute"); Q.setElementPosition(this.root, pos, 0); for (y = 0; y < 7; ++y) { t1 = this.imgs; t2 = Array(4); t2.$builtinTypeInfo = [W.ImageElement]; t1[y] = t2; } for (y = 0; y < 7; ++y) for (t1 = y * 19, x = 0; x < 4; ++x) { this.imgs[y][x] = W.ImageElement_ImageElement(null, null, null); t2 = this.root; t2.toString; t2.appendChild(this.imgs[y][x]); J.set$position$x(this.imgs[y][x].style, "absolute"); t2 = this.imgs[y][x]; J.set$left$x(t2.style, "" + x * 19 + "px"); J.set$top$x(t2.style, "" + t1 + "px"); } }, static: {"": "ClockNumber_WIDTH,ClockNumber_HEIGHT", ClockNumber$: function(app, pos, ballColor) { var t1 = new Q.ClockNumber(app, null, null, null, ballColor); t1.ClockNumber$3(app, pos, ballColor); return t1; }} }, ClockNumber_setPixels_closure: { "": "Closure:8;this_0,img_1", call$0: function() { var r, t1, absx, absy, t2, t3, t4; r = this.img_1.getBoundingClientRect(); t1 = J.getInterceptor$x(r); absx = t1.get$left(r); absy = t1.get$top(r); t1 = this.this_0; t2 = t1.app.balls; t3 = t2.root; t4 = new Q.Ball(t3, null, absx, absy, null, null, null, null, null); t4.Ball$4(t3, absx, absy, t1.ballColor); t2.balls.push(t4); } }, Colon: { "": "Object;root", Colon$2: function(xpos, ypos) { var t1, dot; t1 = document.createElement("div", null); this.root = t1; J.set$position$x(t1.style, "absolute"); Q.setElementPosition(this.root, xpos, ypos); dot = W.ImageElement_ImageElement(null, "images/ball-b6b4b5.png", null); this.root.appendChild(dot); J.set$position$x(dot.style, "absolute"); Q.setElementPosition(dot, 0, 38); dot = W.ImageElement_ImageElement(null, "images/ball-b6b4b5.png", null); this.root.appendChild(dot); J.set$position$x(dot.style, "absolute"); Q.setElementPosition(dot, 0, 76); }, static: {Colon$: function(xpos, ypos) { var t1 = new Q.Colon(null); t1.Colon$2(xpos, ypos); return t1; }} } }, 1], ["dart._collection.dev", "dart:_collection-dev", , H, { "": "", IterableMixinWorkaround_forEach: function(iterable, f) { var t1; for (t1 = new H.ListIterator(iterable, iterable.length, 0, null); t1.moveNext$0();) f.call$1(t1._dev$_current); }, IterableMixinWorkaround_removeWhereList: function(list, test) { var retained, $length, t1, i, element; retained = []; $length = list.length; for (t1 = $length, i = 0; i < $length; ++i) { if (i >= t1) return H.ioore(list, i); element = list[i]; if (test.call$1(element) !== true) retained.push(element); t1 = list.length; if ($length !== t1) throw H.wrapException(P.ConcurrentModificationError$(list)); } t1 = retained.length; if (t1 === $length) return; C.JSArray_methods.set$length(list, t1); for (i = 0; i < retained.length; ++i) C.JSArray_methods.$indexSet(list, i, retained[i]); }, IterableMixinWorkaround_toStringIterable: function(iterable, leftDelimiter, rightDelimiter) { var result, i, t1; for (i = 0; t1 = $.get$IterableMixinWorkaround__toStringList(), i < t1.length; ++i) if (t1[i] === iterable) return H.S(leftDelimiter) + "..." + H.S(rightDelimiter); result = P.StringBuffer$(""); try { $.get$IterableMixinWorkaround__toStringList().push(iterable); result.write$1(leftDelimiter); result.writeAll$2(iterable, ", "); result.write$1(rightDelimiter); } finally { t1 = $.get$IterableMixinWorkaround__toStringList(); if (0 >= t1.length) return H.ioore(t1, 0); t1.pop(); } return result.get$_contents(); }, IterableMixinWorkaround_setRangeList: function(list, start, end, from, skipCount) { var $length; if (start < 0 || start > list.length) H.throwExpression(P.RangeError$range(start, 0, list.length)); if (end < start || end > list.length) H.throwExpression(P.RangeError$range(end, start, list.length)); $length = end - start; if ($length === 0) return; if (skipCount + $length > from.length) throw H.wrapException(P.StateError$("Not enough elements")); H.Lists_copy(from, skipCount, list, start, $length); }, Lists_copy: function(src, srcStart, dst, dstStart, count) { var i, j, t1, t2; if (srcStart < dstStart) for (i = srcStart + count - 1, j = dstStart + count - 1, t1 = src.length; i >= srcStart; --i, --j) { if (i >= t1) return H.ioore(src, i); C.JSArray_methods.$indexSet(dst, j, src[i]); } else for (t1 = srcStart + count, t2 = src.length, j = dstStart, i = srcStart; i < t1; ++i, ++j) { if (i >= t2) return H.ioore(src, i); C.JSArray_methods.$indexSet(dst, j, src[i]); } }, Symbol_getName: function(symbol) { return symbol.get$_name(); }, ListIterator: { "": "Object;_iterable,_dev$_length,_index,_dev$_current", get$current: function() { return this._dev$_current; }, moveNext$0: function() { var t1, t2, $length, t3; t1 = this._iterable; t2 = J.getInterceptor$asx(t1); $length = t2.get$length(t1); if (this._dev$_length !== $length) throw H.wrapException(P.ConcurrentModificationError$(t1)); t3 = this._index; if (t3 >= $length) { this._dev$_current = null; return false; } this._dev$_current = t2.elementAt$1(t1, t3); this._index = this._index + 1; return true; } }, MappedIterable: { "": "IterableBase;_iterable,_f", get$iterator: function(_) { var t1 = this._iterable; t1 = new H.MappedIterator(null, t1.get$iterator(t1), this._f); t1.$builtinTypeInfo = this.$builtinTypeInfo; return t1; }, get$length: function(_) { var t1 = this._iterable; return t1.get$length(t1); }, $asIterableBase: function($S, $T) { return [$T]; }, static: {MappedIterable_MappedIterable: function(iterable, $function, $S, $T) { return H.setRuntimeTypeInfo(new H.EfficientLengthMappedIterable(iterable, $function), [$S, $T]); }} }, EfficientLengthMappedIterable: { "": "MappedIterable;_iterable,_f", $asMappedIterable: null }, MappedIterator: { "": "Iterator;_dev$_current,_iterator,_f", _f$1: function(arg0) { return this._f.call$1(arg0); }, moveNext$0: function() { var t1 = this._iterator; if (t1.moveNext$0()) { this._dev$_current = this._f$1(t1.get$current()); return true; } this._dev$_current = null; return false; }, get$current: function() { return this._dev$_current; }, $asIterator: function($S, $T) { return [$T]; } }, FixedLengthListMixin: { "": "Object;" } }], ["dart._js_names", "dart:_js_names", , H, { "": "", extractKeys: function(victim) { var t1 = H.setRuntimeTypeInfo((function(victim, hasOwnProperty) { var result = []; for (var key in victim) { if (hasOwnProperty.call(victim, key)) result.push(key); } return result; })(victim, Object.prototype.hasOwnProperty), [null]); t1.fixed$length = init; return t1; } }], ["dart.async", "dart:async", , P, { "": "", _invokeErrorHandler: function(errorHandler, error, stackTrace) { var t1 = H.getDynamicRuntimeType(); t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(errorHandler); if (t1) return errorHandler.call$2(error, stackTrace); else return errorHandler.call$1(error); }, _registerErrorHandler: function(errorHandler, zone) { var t1 = H.getDynamicRuntimeType(); t1 = H.buildFunctionType(t1, [t1, t1])._isTest$1(errorHandler); zone.toString; if (t1) return errorHandler; else return errorHandler; }, _asyncRunCallback: [function() { var callback, t1, exception, milliseconds; for (; t1 = $.get$_asyncCallbacks(), t1._head !== t1._tail;) { callback = t1.removeFirst$0(); try { callback.call$0(); } catch (exception) { H.unwrapException(exception); milliseconds = C.JSInt_methods._tdivFast$1(C.Duration_0._duration, 1000); H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, P._asyncRunCallback$closure()); throw exception; } } $._callbacksAreEnqueued = false; }, "call$0", "_asyncRunCallback$closure", 0, 0, 0], _scheduleAsyncCallback: function(callback) { $.get$_asyncCallbacks()._add$1(callback); if (!$._callbacksAreEnqueued) { P._createTimer(C.Duration_0, P._asyncRunCallback$closure()); $._callbacksAreEnqueued = true; } }, scheduleMicrotask: function(callback) { var t1, f, milliseconds; t1 = $.Zone__current; if (t1 === C.C__RootZone) { t1.toString; f = C.C__RootZone !== t1 ? t1.bindCallback$1(callback) : callback; $.get$_asyncCallbacks()._add$1(f); if (!$._callbacksAreEnqueued) { milliseconds = C.JSInt_methods._tdivFast$1(C.Duration_0._duration, 1000); H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, P._asyncRunCallback$closure()); $._callbacksAreEnqueued = true; } return; } f = t1.bindCallback$2$runGuarded(callback, true); if (C.C__RootZone !== t1) f = t1.bindCallback$1(f); $.get$_asyncCallbacks()._add$1(f); if (!$._callbacksAreEnqueued) { milliseconds = C.JSInt_methods._tdivFast$1(C.Duration_0._duration, 1000); H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, P._asyncRunCallback$closure()); $._callbacksAreEnqueued = true; } }, StreamController_StreamController: function(onCancel, onListen, onPause, onResume, sync, $T) { return sync ? H.setRuntimeTypeInfo(new P._SyncStreamController(onListen, onPause, onResume, onCancel, null, 0, null), [$T]) : H.setRuntimeTypeInfo(new P._AsyncStreamController(onListen, onPause, onResume, onCancel, null, 0, null), [$T]); }, _runGuarded: function(notificationHandler) { var result, e, s, t1, t2, exception; if (notificationHandler == null) return; try { result = notificationHandler.call$0(); t1 = result; t2 = J.getInterceptor(t1); if (typeof t1 === "object" && t1 !== null && !!t2.$isFuture) return result; return; } catch (exception) { t1 = H.unwrapException(exception); e = t1; s = new H._StackTrace(exception, null); t1 = $.Zone__current; t1.toString; P._rootHandleUncaughtError(t1, null, t1, e, s); } }, _nullDataHandler: [function(value) { }, "call$1", "_nullDataHandler$closure", 2, 0, 1], _nullErrorHandler: [function(error, stackTrace) { var t1 = $.Zone__current; t1.toString; P._rootHandleUncaughtError(t1, null, t1, error, stackTrace); }, function(error) { return P._nullErrorHandler(error, null); }, null, "call$2", "call$1", "_nullErrorHandler$closure", 2, 2, 2, 3], _nullDoneHandler: [function() { return; }, "call$0", "_nullDoneHandler$closure", 0, 0, 0], _runUserCode: function(userCode, onSuccess, onError) { var e, s, exception, t1; try { onSuccess.call$1(userCode.call$0()); } catch (exception) { t1 = H.unwrapException(exception); e = t1; s = new H._StackTrace(exception, null); onError.call$2(e, s); } }, _cancelAndError: function(subscription, future, error, stackTrace) { var cancelFuture, t1; cancelFuture = subscription.cancel$0(); t1 = J.getInterceptor(cancelFuture); if (typeof cancelFuture === "object" && cancelFuture !== null && !!t1.$isFuture) cancelFuture.whenComplete$1(new P._cancelAndError_closure(future, error, stackTrace)); else future._completeError$2(error, stackTrace); }, _cancelAndErrorClosure: function(subscription, future) { return new P._cancelAndErrorClosure_closure(subscription, future); }, Timer_Timer: function(duration, callback) { var t1 = $.Zone__current; if (t1 === C.C__RootZone) { t1.toString; return P._rootCreateTimer(t1, null, t1, duration, callback); } return P._rootCreateTimer(t1, null, t1, duration, t1.bindCallback$2$runGuarded(callback, true)); }, _createTimer: function(duration, callback) { var milliseconds = C.JSInt_methods._tdivFast$1(duration._duration, 1000); return H.TimerImpl$(milliseconds < 0 ? 0 : milliseconds, callback); }, _rootHandleUncaughtError: function($self, $parent, zone, error, stackTrace) { P._rootRun($self, null, $self, new P._rootHandleUncaughtError_closure(error, stackTrace)); }, _rootRun: function($self, $parent, zone, f) { var old, t1, t2; t1 = $.Zone__current; t2 = zone; if (t1 == null ? t2 == null : t1 === t2) return f.call$0(); old = t1; try { $.Zone__current = zone; t1 = f.call$0(); return t1; } finally { $.Zone__current = old; } }, _rootRunUnary: function($self, $parent, zone, f, arg) { var old, t1, t2; t1 = $.Zone__current; t2 = zone; if (t1 == null ? t2 == null : t1 === t2) return f.call$1(arg); old = t1; try { $.Zone__current = zone; t1 = f.call$1(arg); return t1; } finally { $.Zone__current = old; } }, _rootScheduleMicrotask: function($self, $parent, zone, f) { P._scheduleAsyncCallback(C.C__RootZone !== zone ? zone.bindCallback$1(f) : f); }, _rootCreateTimer: function($self, $parent, zone, duration, callback) { return P._createTimer(duration, C.C__RootZone !== zone ? zone.bindCallback$1(callback) : callback); }, _AsyncError: { "": "Object;error>,stackTrace<", $isError: true }, Future: { "": "Object;", $isFuture: true }, _Future: { "": "Object;_state,_zone<,_resultOrListeners,_nextListener<,_onValueCallback,_errorTestCallback,_onErrorCallback,_whenCompleteActionCallback", get$_isComplete: function() { return this._state >= 4; }, get$_hasError: function() { return this._state === 8; }, set$_isChained: function(value) { if (value) this._state = 2; else this._state = 0; }, get$_onValue: function() { return this._state === 2 ? null : this._onValueCallback; }, _onValue$1: function(arg0) { return this.get$_onValue().call$1(arg0); }, get$_whenCompleteAction: function() { return this._state === 2 ? null : this._whenCompleteActionCallback; }, _whenCompleteAction$0: function() { return this.get$_whenCompleteAction().call$0(); }, then$2$onError: function(f, onError) { var t1, result; t1 = $.Zone__current; t1.toString; result = H.setRuntimeTypeInfo(new P._Future(0, t1, null, null, f, null, P._registerErrorHandler(onError, t1), null), [null]); this._addListener$1(result); return result; }, whenComplete$1: function(action) { var t1, result; t1 = $.Zone__current; t1.toString; result = new P._Future(0, t1, null, null, null, null, null, action); result.$builtinTypeInfo = this.$builtinTypeInfo; this._addListener$1(result); return result; }, get$_async$_value: function() { return this._resultOrListeners; }, get$_error: function() { return this._resultOrListeners; }, _setValue$1: function(value) { this._state = 4; this._resultOrListeners = value; }, _setError$2: function(error, stackTrace) { this._state = 8; this._resultOrListeners = new P._AsyncError(error, stackTrace); }, _addListener$1: function(listener) { var t1; if (this._state >= 4) { t1 = this._zone; t1.toString; P._rootScheduleMicrotask(t1, null, t1, new P._Future__addListener_closure(this, listener)); } else { listener._nextListener = this._resultOrListeners; this._resultOrListeners = listener; } }, _removeListeners$0: function() { var current, prev, next; current = this._resultOrListeners; this._resultOrListeners = null; for (prev = null; current != null; prev = current, current = next) { next = current.get$_nextListener(); current._nextListener = prev; } return prev; }, _complete$1: function(value) { var t1, listeners; t1 = J.getInterceptor(value); if (typeof value === "object" && value !== null && !!t1.$isFuture) { P._Future__chainFutures(value, this); return; } listeners = this._removeListeners$0(); this._setValue$1(value); P._Future__propagateToListeners(this, listeners); }, _completeError$2: [function(error, stackTrace) { var listeners = this._removeListeners$0(); this._setError$2(error, stackTrace); P._Future__propagateToListeners(this, listeners); }, function(error) { return this._completeError$2(error, null); }, "_completeError$1", "call$2", "call$1", "get$_completeError", 2, 2, 2, 3], _asyncComplete$1: function(value) { var t1; if (this._state !== 0) H.throwExpression(new P.StateError("Future already completed")); this._state = 1; t1 = this._zone; t1.toString; P._rootScheduleMicrotask(t1, null, t1, new P._Future__asyncComplete_closure(this, value)); }, $is_Future: true, $isFuture: true, static: {"": "_Future__INCOMPLETE,_Future__PENDING_COMPLETE,_Future__CHAINED,_Future__VALUE,_Future__ERROR", _Future$: function($T) { return H.setRuntimeTypeInfo(new P._Future(0, $.Zone__current, null, null, null, null, null, null), [$T]); }, _Future__chainFutures: function(source, target) { var t1; target._state = 2; t1 = J.getInterceptor(source); if (typeof source === "object" && source !== null && !!t1.$is_Future) if (source._state >= 4) P._Future__propagateToListeners(source, target); else source._addListener$1(target); else source.then$2$onError(new P._Future__chainFutures_closure(target), new P._Future__chainFutures_closure0(target)); }, _Future__propagateMultipleListeners: function(source, listeners) { var listeners0; do { listeners0 = listeners.get$_nextListener(); listeners._nextListener = null; P._Future__propagateToListeners(source, listeners); if (listeners0 != null) { listeners = listeners0; continue; } else break; } while (true); }, _Future__propagateToListeners: function(source, listeners) { var t1, t2, t3, hasError, asyncError, t4, t5, chainSource, listeners0; t1 = {}; t1.source_4 = source; for (t2 = source; true;) { t3 = {}; if (!t2.get$_isComplete()) return; hasError = t1.source_4.get$_hasError(); if (hasError && listeners == null) { t2 = t1.source_4; asyncError = t2.get$_error(); t2 = t2._zone; t3 = J.get$error$x(asyncError); t4 = asyncError.get$stackTrace(); t2.toString; P._rootHandleUncaughtError(t2, null, t2, t3, t4); return; } if (listeners == null) return; if (listeners._nextListener != null) { P._Future__propagateMultipleListeners(t1.source_4, listeners); return; } if (hasError) { t2 = t1.source_4.get$_zone(); t4 = listeners._zone; t2.toString; t4.toString; t2 = t4 == null ? t2 != null : t4 !== t2; } else t2 = false; if (t2) { t2 = t1.source_4; asyncError = t2.get$_error(); t2 = t2._zone; t3 = J.get$error$x(asyncError); t4 = asyncError.get$stackTrace(); t2.toString; P._rootHandleUncaughtError(t2, null, t2, t3, t4); return; } t2 = $.Zone__current; t4 = listeners._zone; if (t2 == null ? t4 != null : t2 !== t4) { t4.toString; P._rootRun(t4, null, t4, new P._Future__propagateToListeners_closure(t1, listeners)); return; } t3.listenerHasValue_1 = null; t3.listenerValueOrError_2 = null; t3.isPropagationAborted_3 = false; t4.toString; P._rootRun(t4, null, t4, new P._Future__propagateToListeners_closure0(t1, t3, hasError, listeners)); if (t3.isPropagationAborted_3) return; t2 = t3.listenerHasValue_1 === true; if (t2) { t4 = t3.listenerValueOrError_2; t5 = J.getInterceptor(t4); t5 = typeof t4 === "object" && t4 !== null && !!t5.$isFuture; t4 = t5; } else t4 = false; if (t4) { chainSource = t3.listenerValueOrError_2; t2 = J.getInterceptor(chainSource); if (typeof chainSource === "object" && chainSource !== null && !!t2.$is_Future && chainSource._state >= 4) { listeners._state = 2; t1.source_4 = chainSource; t2 = chainSource; continue; } P._Future__chainFutures(chainSource, listeners); return; } if (t2) { listeners0 = listeners._removeListeners$0(); t2 = t3.listenerValueOrError_2; listeners._state = 4; listeners._resultOrListeners = t2; } else { listeners0 = listeners._removeListeners$0(); asyncError = t3.listenerValueOrError_2; t2 = J.get$error$x(asyncError); t3 = asyncError.get$stackTrace(); listeners._state = 8; listeners._resultOrListeners = new P._AsyncError(t2, t3); } t1.source_4 = listeners; t2 = listeners; listeners = listeners0; } }} }, _Future__addListener_closure: { "": "Closure:8;this_0,listener_1", call$0: function() { P._Future__propagateToListeners(this.this_0, this.listener_1); } }, _Future__chainFutures_closure: { "": "Closure:10;target_0", call$1: function(value) { this.target_0._complete$1(value); } }, _Future__chainFutures_closure0: { "": "Closure:14;target_1", call$2: function(error, stackTrace) { this.target_1._completeError$2(error, stackTrace); }, call$1: function(error) { return this.call$2(error, null); } }, _Future__asyncComplete_closure: { "": "Closure:8;this_0,value_1", call$0: function() { this.this_0._complete$1(this.value_1); } }, _Future__propagateToListeners_closure: { "": "Closure:8;box_2,listener_3", call$0: function() { P._Future__propagateToListeners(this.box_2.source_4, this.listener_3); } }, _Future__propagateToListeners_closure0: { "": "Closure:8;box_2,box_1,hasError_4,listener_5", call$0: function() { var t1, value, asyncError, test, matchesTest, errorCallback, e, s, t2, t3, t4, t5, completeResult, exception; t1 = {}; try { t2 = this.box_2; if (!this.hasError_4) { value = t2.source_4.get$_async$_value(); t3 = this.listener_5; t4 = t3._state === 2 ? null : t3._onValueCallback; t5 = this.box_1; if (t4 != null) { t5.listenerValueOrError_2 = t3._onValue$1(value); t5.listenerHasValue_1 = true; } else { t5.listenerValueOrError_2 = value; t5.listenerHasValue_1 = true; } t4 = t5; } else { asyncError = t2.source_4.get$_error(); t3 = this.listener_5; test = t3._state === 2 ? null : t3._errorTestCallback; matchesTest = true; if (test != null) matchesTest = test.call$1(J.get$error$x(asyncError)); if (matchesTest === true) t4 = (t3._state === 2 ? null : t3._onErrorCallback) != null; else t4 = false; if (t4) { errorCallback = t3._state === 2 ? null : t3._onErrorCallback; t4 = this.box_1; t4.listenerValueOrError_2 = P._invokeErrorHandler(errorCallback, J.get$error$x(asyncError), asyncError.get$stackTrace()); t4.listenerHasValue_1 = true; } else { t4 = this.box_1; t4.listenerValueOrError_2 = asyncError; t4.listenerHasValue_1 = false; } } if ((t3._state === 2 ? null : t3._whenCompleteActionCallback) != null) { completeResult = t3._whenCompleteAction$0(); t1.completeResult_0 = completeResult; t5 = J.getInterceptor(completeResult); if (typeof completeResult === "object" && completeResult !== null && !!t5.$isFuture) { t3.set$_isChained(true); t1.completeResult_0.then$2$onError(new P._Future__propagateToListeners__closure(t2, t3), new P._Future__propagateToListeners__closure0(t1, t3)); t4.isPropagationAborted_3 = true; } } } catch (exception) { t1 = H.unwrapException(exception); e = t1; s = new H._StackTrace(exception, null); if (this.hasError_4) { t1 = J.get$error$x(this.box_2.source_4.get$_error()); t2 = e; t2 = t1 == null ? t2 == null : t1 === t2; t1 = t2; } else t1 = false; t2 = this.box_1; if (t1) t2.listenerValueOrError_2 = this.box_2.source_4.get$_error(); else t2.listenerValueOrError_2 = new P._AsyncError(e, s); t2.listenerHasValue_1 = false; } } }, _Future__propagateToListeners__closure: { "": "Closure:10;box_2,listener_6", call$1: function(ignored) { P._Future__propagateToListeners(this.box_2.source_4, this.listener_6); } }, _Future__propagateToListeners__closure0: { "": "Closure:14;box_0,listener_7", call$2: function(error, stackTrace) { var t1, t2, t3, completeResult; t1 = this.box_0; t2 = t1.completeResult_0; t3 = J.getInterceptor(t2); if (typeof t2 !== "object" || t2 === null || !t3.$is_Future) { completeResult = P._Future$(null); t1.completeResult_0 = completeResult; completeResult._setError$2(error, stackTrace); } P._Future__propagateToListeners(t1.completeResult_0, this.listener_7); }, call$1: function(error) { return this.call$2(error, null); } }, Stream: { "": "Object;", forEach$1: function(_, action) { var t1, future; t1 = {}; future = P._Future$(null); t1.subscription_0 = null; t1.subscription_0 = this.listen$4$cancelOnError$onDone$onError(new P.Stream_forEach_closure(t1, this, action, future), true, new P.Stream_forEach_closure0(future), future.get$_completeError()); return future; }, get$length: function(_) { var t1, future; t1 = {}; future = P._Future$(J.JSInt); t1.count_0 = 0; this.listen$4$cancelOnError$onDone$onError(new P.Stream_length_closure(t1), true, new P.Stream_length_closure0(t1, future), future.get$_completeError()); return future; } }, Stream_forEach_closure: { "": "Closure;box_0,this_1,action_2,future_3", call$1: function(element) { P._runUserCode(new P.Stream_forEach__closure(this.action_2, element), new P.Stream_forEach__closure0(), P._cancelAndErrorClosure(this.box_0.subscription_0, this.future_3)); }, $signature: function() { return H.computeSignature(function(T) { return {func: "dynamic__T", args: [T]}; }, this.this_1, "Stream"); } }, Stream_forEach__closure: { "": "Closure:8;action_4,element_5", call$0: function() { return this.action_4.call$1(this.element_5); } }, Stream_forEach__closure0: { "": "Closure:10;", call$1: function(_) { } }, Stream_forEach_closure0: { "": "Closure:8;future_6", call$0: function() { this.future_6._complete$1(null); } }, Stream_length_closure: { "": "Closure:10;box_0", call$1: function(_) { var t1 = this.box_0; t1.count_0 = t1.count_0 + 1; } }, Stream_length_closure0: { "": "Closure:8;box_0,future_1", call$0: function() { this.future_1._complete$1(this.box_0.count_0); } }, StreamSubscription: { "": "Object;" }, _StreamController: { "": "Object;", get$_pendingEvents: function() { if ((this._state & 8) === 0) return this._varData; return this._varData.get$varData(); }, _ensurePendingEvents$0: function() { if ((this._state & 8) === 0) { var t1 = this._varData; if (t1 == null) { t1 = new P._StreamImplEvents(null, null, 0); this._varData = t1; } return t1; } t1 = this._varData.get$varData(); return t1; }, get$_subscription: function() { if ((this._state & 8) !== 0) return this._varData.get$varData(); return this._varData; }, _badEventState$0: function() { if ((this._state & 4) !== 0) return new P.StateError("Cannot add event after closing"); return new P.StateError("Cannot add event while adding a stream"); }, add$1: [function(_, value) { var t1 = this._state; if (t1 >= 4) throw H.wrapException(this._badEventState$0()); if ((t1 & 1) !== 0) this._sendData$1(value); else if ((t1 & 3) === 0) { t1 = this._ensurePendingEvents$0(); t1.add$1(t1, new P._DelayedData(value, null)); } }, "call$1", "get$add", 2, 0, function() { return H.computeSignature(function(T) { return {func: "void__T", void: true, args: [T]}; }, this.$receiver, "_StreamController"); }], close$0: function(_) { var t1, t2; t1 = this._state; if ((t1 & 4) !== 0) return this._doneFuture; if (t1 >= 4) throw H.wrapException(this._badEventState$0()); t1 |= 4; this._state = t1; if (this._doneFuture == null) { t2 = P._Future$(null); this._doneFuture = t2; if ((t1 & 2) !== 0) t2._complete$1(null); } t1 = this._state; if ((t1 & 1) !== 0) this._sendDone$0(); else if ((t1 & 3) === 0) { t1 = this._ensurePendingEvents$0(); t1.add$1(t1, C.C__DelayedDone); } return this._doneFuture; }, _subscribe$1: function(cancelOnError) { var t1, t2, subscription, pendingEvents, addState; if ((this._state & 3) !== 0) throw H.wrapException(new P.StateError("Stream has already been listened to.")); t1 = $.Zone__current; t2 = cancelOnError ? 1 : 0; subscription = H.setRuntimeTypeInfo(new P._ControllerSubscription(this, null, null, null, t1, t2, null, null), [null]); pendingEvents = this.get$_pendingEvents(); t2 = this._state | 1; this._state = t2; if ((t2 & 8) !== 0) { addState = this._varData; addState.set$varData(subscription); addState.resume$0(); } else this._varData = subscription; subscription._setPendingEvents$1(pendingEvents); subscription._guardCallback$1(new P._StreamController__subscribe_closure(this)); return subscription; }, _recordCancel$1: function(subscription) { var t1, future; if ((this._state & 8) !== 0) this._varData.cancel$0(); this._varData = null; this._state = this._state & 4294967286 | 2; t1 = new P._StreamController__recordCancel_complete(this); future = P._runGuarded(this.get$_onCancel()); if (future != null) future = future.whenComplete$1(t1); else t1.call$0(); return future; } }, _StreamController__subscribe_closure: { "": "Closure:8;this_0", call$0: function() { P._runGuarded(this.this_0.get$_onListen()); } }, _StreamController__recordCancel_complete: { "": "Closure:0;this_0", call$0: function() { var t1 = this.this_0._doneFuture; if (t1 != null && t1._state === 0) t1._asyncComplete$1(null); } }, _SyncStreamControllerDispatch: { "": "Object;", _sendData$1: function(data) { this.get$_subscription()._async$_add$1(data); }, _sendDone$0: function() { this.get$_subscription()._close$0(); } }, _AsyncStreamControllerDispatch: { "": "Object;", _sendData$1: function(data) { this.get$_subscription()._addPending$1(new P._DelayedData(data, null)); }, _sendDone$0: function() { this.get$_subscription()._addPending$1(C.C__DelayedDone); } }, _AsyncStreamController: { "": "_StreamController__AsyncStreamControllerDispatch;_onListen<,_onPause<,_onResume<,_onCancel<,_varData,_state,_doneFuture", $as_StreamController__AsyncStreamControllerDispatch: null }, _StreamController__AsyncStreamControllerDispatch: { "": "_StreamController+_AsyncStreamControllerDispatch;", $as_StreamController: null }, _SyncStreamController: { "": "_StreamController__SyncStreamControllerDispatch;_onListen<,_onPause<,_onResume<,_onCancel<,_varData,_state,_doneFuture", $as_StreamController__SyncStreamControllerDispatch: null }, _StreamController__SyncStreamControllerDispatch: { "": "_StreamController+_SyncStreamControllerDispatch;", $as_StreamController: null }, _ControllerStream: { "": "_StreamImpl;_async$_controller", _createSubscription$1: function(cancelOnError) { return this._async$_controller._subscribe$1(cancelOnError); }, get$hashCode: function(_) { return (H.Primitives_objectHashCode(this._async$_controller) ^ 892482866) >>> 0; }, $eq: function(_, other) { var t1; if (other == null) return false; if (this === other) return true; t1 = J.getInterceptor(other); if (typeof other !== "object" || other === null || !t1.$is_ControllerStream) return false; return other._async$_controller === this._async$_controller; }, $is_ControllerStream: true, $as_StreamImpl: null }, _ControllerSubscription: { "": "_BufferingStreamSubscription;_async$_controller,_onData,_onError,_onDone,_zone,_state,_cancelFuture,_pending", _onCancel$0: function() { return this._async$_controller._recordCancel$1(this); }, _onPause$0: [function() { var t1, addState; t1 = this._async$_controller; if ((t1._state & 8) !== 0) { addState = t1._varData; addState.pause$0(addState); } P._runGuarded(t1.get$_onPause()); }, "call$0", "get$_onPause", 0, 0, 0], _onResume$0: [function() { var t1 = this._async$_controller; if ((t1._state & 8) !== 0) t1._varData.resume$0(); P._runGuarded(t1.get$_onResume()); }, "call$0", "get$_onResume", 0, 0, 0], $as_BufferingStreamSubscription: null }, _EventSink: { "": "Object;" }, _BufferingStreamSubscription: { "": "Object;_onData,_onError,_onDone,_zone<,_state,_cancelFuture,_pending", _setPendingEvents$1: function(pendingEvents) { if (pendingEvents == null) return; this._pending = pendingEvents; if (!pendingEvents.get$isEmpty(pendingEvents)) { this._state = (this._state | 64) >>> 0; pendingEvents.schedule$1(this); } }, onData$1: function(handleData) { this._zone.toString; this._onData = handleData; }, onError$1: function(_, handleError) { this._onError = P._registerErrorHandler(handleError, this._zone); }, onDone$1: function(handleDone) { this._zone.toString; this._onDone = handleDone; }, pause$1: function(_, resumeSignal) { var t1 = this._state; if ((t1 & 8) !== 0) return; this._state = (t1 + 128 | 4) >>> 0; if (t1 < 128 && this._pending != null) this._pending.cancelSchedule$0(); if ((t1 & 4) === 0 && (this._state & 32) === 0) this._guardCallback$1(this.get$_onPause()); }, pause$0: function($receiver) { return this.pause$1($receiver, null); }, resume$0: function() { var t1, t2; t1 = this._state; if ((t1 & 8) !== 0) return; if (t1 >= 128) { t1 -= 128; this._state = t1; if (t1 < 128) { if ((t1 & 64) !== 0) { t2 = this._pending; t2 = !t2.get$isEmpty(t2); } else t2 = false; if (t2) this._pending.schedule$1(this); else { t1 = (t1 & 4294967291) >>> 0; this._state = t1; if ((t1 & 32) === 0) this._guardCallback$1(this.get$_onResume()); } } } }, cancel$0: function() { var t1 = (this._state & 4294967279) >>> 0; this._state = t1; if ((t1 & 8) !== 0) return this._cancelFuture; this._cancel$0(); return this._cancelFuture; }, _cancel$0: function() { var t1 = (this._state | 8) >>> 0; this._state = t1; if ((t1 & 64) !== 0) this._pending.cancelSchedule$0(); if ((this._state & 32) === 0) this._pending = null; this._cancelFuture = this._onCancel$0(); }, _async$_add$1: function(data) { var t1 = this._state; if ((t1 & 8) !== 0) return; if (t1 < 32) this._sendData$1(data); else this._addPending$1(new P._DelayedData(data, null)); }, _close$0: function() { var t1 = this._state; if ((t1 & 8) !== 0) return; t1 = (t1 | 2) >>> 0; this._state = t1; if (t1 < 32) this._sendDone$0(); else this._addPending$1(C.C__DelayedDone); }, _onPause$0: [function() { }, "call$0", "get$_onPause", 0, 0, 0], _onResume$0: [function() { }, "call$0", "get$_onResume", 0, 0, 0], _onCancel$0: function() { }, _addPending$1: function($event) { var pending, t1; pending = this._pending; if (pending == null) { pending = new P._StreamImplEvents(null, null, 0); this._pending = pending; } pending.add$1(pending, $event); t1 = this._state; if ((t1 & 64) === 0) { t1 = (t1 | 64) >>> 0; this._state = t1; if (t1 < 128) this._pending.schedule$1(this); } }, _sendData$1: function(data) { var t1 = this._state; this._state = (t1 | 32) >>> 0; this._zone.runUnaryGuarded$2(this._onData, data); this._state = (this._state & 4294967263) >>> 0; this._checkState$1((t1 & 4) !== 0); }, _sendDone$0: function() { var t1, t2, t3; t1 = new P._BufferingStreamSubscription__sendDone_sendDone(this); this._cancel$0(); this._state = (this._state | 16) >>> 0; t2 = this._cancelFuture; t3 = J.getInterceptor(t2); if (typeof t2 === "object" && t2 !== null && !!t3.$isFuture) t2.whenComplete$1(t1); else t1.call$0(); }, _guardCallback$1: function(callback) { var t1 = this._state; this._state = (t1 | 32) >>> 0; callback.call$0(); this._state = (this._state & 4294967263) >>> 0; this._checkState$1((t1 & 4) !== 0); }, _checkState$1: function(wasInputPaused) { var t1, t2, isInputPaused; t1 = this._state; if ((t1 & 64) !== 0) { t2 = this._pending; t2 = t2.get$isEmpty(t2); } else t2 = false; if (t2) { t1 = (t1 & 4294967231) >>> 0; this._state = t1; if ((t1 & 4) !== 0) if (t1 < 128) { t2 = this._pending; t2 = t2 == null || t2.get$isEmpty(t2); } else t2 = false; else t2 = false; if (t2) { t1 = (t1 & 4294967291) >>> 0; this._state = t1; } } for (; true; wasInputPaused = isInputPaused) { if ((t1 & 8) !== 0) { this._pending = null; return; } isInputPaused = (t1 & 4) !== 0; if (wasInputPaused === isInputPaused) break; this._state = (t1 ^ 32) >>> 0; if (isInputPaused) this._onPause$0(); else this._onResume$0(); t1 = (this._state & 4294967263) >>> 0; this._state = t1; } if ((t1 & 64) !== 0 && t1 < 128) this._pending.schedule$1(this); }, static: {"": "_BufferingStreamSubscription__STATE_CANCEL_ON_ERROR,_BufferingStreamSubscription__STATE_CLOSED,_BufferingStreamSubscription__STATE_INPUT_PAUSED,_BufferingStreamSubscription__STATE_CANCELED,_BufferingStreamSubscription__STATE_WAIT_FOR_CANCEL,_BufferingStreamSubscription__STATE_IN_CALLBACK,_BufferingStreamSubscription__STATE_HAS_PENDING,_BufferingStreamSubscription__STATE_PAUSE_COUNT,_BufferingStreamSubscription__STATE_PAUSE_COUNT_SHIFT"} }, _BufferingStreamSubscription__sendDone_sendDone: { "": "Closure:0;this_0", call$0: function() { var t1, t2; t1 = this.this_0; t2 = t1._state; if ((t2 & 16) === 0) return; t1._state = (t2 | 42) >>> 0; t1._zone.runGuarded$1(t1._onDone); t1._state = (t1._state & 4294967263) >>> 0; } }, _StreamImpl: { "": "Stream;", listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) { var subscription = this._createSubscription$1(true === cancelOnError); subscription.onData$1(onData); subscription.onError$1(subscription, onError); subscription.onDone$1(onDone); return subscription; }, _createSubscription$1: function(cancelOnError) { var t1, t2; t1 = $.Zone__current; t2 = cancelOnError ? 1 : 0; return new P._BufferingStreamSubscription(null, null, null, t1, t2, null, null); }, $asStream: null }, _DelayedEvent: { "": "Object;next@" }, _DelayedData: { "": "_DelayedEvent;value,next", perform$1: function(dispatch) { dispatch._sendData$1(this.value); } }, _DelayedDone: { "": "Object;", perform$1: function(dispatch) { dispatch._sendDone$0(); }, get$next: function() { return; }, set$next: function(_) { throw H.wrapException(P.StateError$("No events after a done.")); } }, _PendingEvents: { "": "Object;", schedule$1: function(dispatch) { var t1 = this._state; if (t1 === 1) return; if (t1 >= 1) { this._state = 1; return; } P.scheduleMicrotask(new P._PendingEvents_schedule_closure(this, dispatch)); this._state = 1; }, cancelSchedule$0: function() { if (this._state === 1) this._state = 3; } }, _PendingEvents_schedule_closure: { "": "Closure:8;this_0,dispatch_1", call$0: function() { var t1, oldState; t1 = this.this_0; oldState = t1._state; t1._state = 0; if (oldState === 3) return; t1.handleNext$1(this.dispatch_1); } }, _StreamImplEvents: { "": "_PendingEvents;firstPendingEvent,lastPendingEvent,_state", get$isEmpty: function(_) { return this.lastPendingEvent == null; }, add$1: function(_, $event) { var t1 = this.lastPendingEvent; if (t1 == null) { this.lastPendingEvent = $event; this.firstPendingEvent = $event; } else { t1.set$next($event); this.lastPendingEvent = $event; } }, handleNext$1: function(dispatch) { var $event, t1; $event = this.firstPendingEvent; t1 = $event.get$next(); this.firstPendingEvent = t1; if (t1 == null) this.lastPendingEvent = null; $event.perform$1(dispatch); } }, _cancelAndError_closure: { "": "Closure:8;future_0,error_1,stackTrace_2", call$0: function() { return this.future_0._completeError$2(this.error_1, this.stackTrace_2); } }, _cancelAndErrorClosure_closure: { "": "Closure:15;subscription_0,future_1", call$2: function(error, stackTrace) { return P._cancelAndError(this.subscription_0, this.future_1, error, stackTrace); } }, _BaseZone: { "": "Object;", runGuarded$1: function(f) { var e, s, t1, exception; try { t1 = this.run$1(f); return t1; } catch (exception) { t1 = H.unwrapException(exception); e = t1; s = new H._StackTrace(exception, null); return this.handleUncaughtError$2(e, s); } }, runUnaryGuarded$2: function(f, arg) { var e, s, t1, exception; try { t1 = this.runUnary$2(f, arg); return t1; } catch (exception) { t1 = H.unwrapException(exception); e = t1; s = new H._StackTrace(exception, null); return this.handleUncaughtError$2(e, s); } }, bindCallback$2$runGuarded: function(f, runGuarded) { var registered = this.registerCallback$1(f); if (runGuarded) return new P._BaseZone_bindCallback_closure(this, registered); else return new P._BaseZone_bindCallback_closure0(this, registered); }, bindCallback$1: function(f) { return this.bindCallback$2$runGuarded(f, true); }, bindUnaryCallback$2$runGuarded: function(f, runGuarded) { var registered = this.registerUnaryCallback$1(f); if (runGuarded) return new P._BaseZone_bindUnaryCallback_closure(this, registered); else return new P._BaseZone_bindUnaryCallback_closure0(this, registered); } }, _BaseZone_bindCallback_closure: { "": "Closure:8;this_0,registered_1", call$0: function() { return this.this_0.runGuarded$1(this.registered_1); } }, _BaseZone_bindCallback_closure0: { "": "Closure:8;this_2,registered_3", call$0: function() { return this.this_2.run$1(this.registered_3); } }, _BaseZone_bindUnaryCallback_closure: { "": "Closure:10;this_0,registered_1", call$1: function(arg) { return this.this_0.runUnaryGuarded$2(this.registered_1, arg); } }, _BaseZone_bindUnaryCallback_closure0: { "": "Closure:10;this_2,registered_3", call$1: function(arg) { return this.this_2.runUnary$2(this.registered_3, arg); } }, _rootHandleUncaughtError_closure: { "": "Closure:8;error_0,stackTrace_1", call$0: function() { P._scheduleAsyncCallback(new P._rootHandleUncaughtError__closure(this.error_0, this.stackTrace_1)); } }, _rootHandleUncaughtError__closure: { "": "Closure:8;error_2,stackTrace_3", call$0: function() { var t1, trace, t2; t1 = this.error_2; P.print("Uncaught Error: " + H.S(t1)); trace = this.stackTrace_3; if (trace == null) { t2 = J.getInterceptor(t1); t2 = typeof t1 === "object" && t1 !== null && !!t2.$isError; } else t2 = false; if (t2) trace = t1.get$stackTrace(); if (trace != null) P.print("Stack Trace: \n" + H.S(trace) + "\n"); throw H.wrapException(t1); } }, _RootZone: { "": "_BaseZone;", $index: function(_, key) { return; }, handleUncaughtError$2: function(error, stackTrace) { return P._rootHandleUncaughtError(this, null, this, error, stackTrace); }, run$1: function(f) { return P._rootRun(this, null, this, f); }, runUnary$2: function(f, arg) { return P._rootRunUnary(this, null, this, f, arg); }, registerCallback$1: function(f) { return f; }, registerUnaryCallback$1: function(f) { return f; } } }], ["dart.collection", "dart:collection", , P, { "": "", _HashSet__newHashTable: function() { var table = Object.create(null); table[""] = table; delete table[""]; return table; }, _defaultEquals: [function(a, b) { return J.$eq(a, b); }, "call$2", "_defaultEquals$closure", 4, 0, 4], _defaultHashCode: [function(a) { return J.get$hashCode$(a); }, "call$1", "_defaultHashCode$closure", 2, 0, 5], HashMap_HashMap: function(equals, hashCode, isValidKey, $K, $V) { return H.setRuntimeTypeInfo(new P._HashMap(0, null, null, null, null), [$K, $V]); }, HashSet_HashSet$identity: function($E) { return H.setRuntimeTypeInfo(new P._IdentityHashSet(0, null, null, null, null), [$E]); }, _iterableToString: function(iterable) { var parts, t1; t1 = $.get$_toStringVisiting(); if (t1.contains$1(t1, iterable)) return "(...)"; t1 = $.get$_toStringVisiting(); t1.add$1(t1, iterable); parts = []; try { P._iterablePartsToStrings(iterable, parts); } finally { t1 = $.get$_toStringVisiting(); t1.remove$1(t1, iterable); } t1 = P.StringBuffer$("("); t1.writeAll$2(parts, ", "); t1.write$1(")"); return t1._contents; }, _iterablePartsToStrings: function(iterable, parts) { var it, $length, count, next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision; it = iterable.get$iterator(iterable); $length = 0; count = 0; while (true) { if (!($length < 80 || count < 3)) break; if (!it.moveNext$0()) return; next = H.S(it.get$current()); parts.push(next); $length += next.length + 2; ++count; } if (!it.moveNext$0()) { if (count <= 5) return; if (0 >= parts.length) return H.ioore(parts, 0); ultimateString = parts.pop(); if (0 >= parts.length) return H.ioore(parts, 0); penultimateString = parts.pop(); } else { penultimate = it.get$current(); ++count; if (!it.moveNext$0()) { if (count <= 4) { parts.push(H.S(penultimate)); return; } ultimateString = H.S(penultimate); if (0 >= parts.length) return H.ioore(parts, 0); penultimateString = parts.pop(); $length += ultimateString.length + 2; } else { ultimate = it.get$current(); ++count; for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) { ultimate0 = it.get$current(); ++count; if (count > 100) { while (true) { if (!($length > 75 && count > 3)) break; if (0 >= parts.length) return H.ioore(parts, 0); $length -= parts.pop().length + 2; --count; } parts.push("..."); return; } } penultimateString = H.S(penultimate); ultimateString = H.S(ultimate); $length += ultimateString.length + penultimateString.length + 4; } } if (count > parts.length + 2) { $length += 5; elision = "..."; } else elision = null; while (true) { if (!($length > 80 && parts.length > 3)) break; if (0 >= parts.length) return H.ioore(parts, 0); $length -= parts.pop().length + 2; if (elision == null) { $length += 5; elision = "..."; } } if (elision != null) parts.push(elision); parts.push(penultimateString); parts.push(ultimateString); }, LinkedHashMap_LinkedHashMap: function(equals, hashCode, isValidKey, $K, $V) { return H.setRuntimeTypeInfo(new P._LinkedHashMap(0, null, null, null, null, null, 0), [$K, $V]); }, LinkedHashSet_LinkedHashSet: function(equals, hashCode, isValidKey, $E) { return H.setRuntimeTypeInfo(new P._LinkedHashSet(0, null, null, null, null, null, 0), [$E]); }, Maps_mapToString: function(m) { var t1, result, i, t2; t1 = {}; for (i = 0; t2 = $.get$Maps__toStringList(), i < t2.length; ++i) if (t2[i] === m) return "{...}"; result = P.StringBuffer$(""); try { $.get$Maps__toStringList().push(m); result.write$1("{"); t1.first_0 = true; J.forEach$1$ax(m, new P.Maps_mapToString_closure(t1, result)); result.write$1("}"); } finally { t1 = $.get$Maps__toStringList(); if (0 >= t1.length) return H.ioore(t1, 0); t1.pop(); } return result.get$_contents(); }, _HashMap: { "": "Object;_collection$_length,_strings,_nums,_rest,_keys", get$length: function(_) { return this._collection$_length; }, get$keys: function() { return H.setRuntimeTypeInfo(new P.HashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]); }, get$values: function(_) { return H.MappedIterable_MappedIterable(H.setRuntimeTypeInfo(new P.HashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]), new P._HashMap_values_closure(this), H.getTypeArgumentByIndex(this, 0), H.getTypeArgumentByIndex(this, 1)); }, $index: function(_, key) { var strings, t1, entry, nums, rest, bucket, index; if (typeof key === "string" && key !== "__proto__") { strings = this._strings; if (strings == null) t1 = null; else { entry = strings[key]; t1 = entry === strings ? null : entry; } return t1; } else if (typeof key === "number" && (key & 0x3ffffff) === key) { nums = this._nums; if (nums == null) t1 = null; else { entry = nums[key]; t1 = entry === nums ? null : entry; } return t1; } else { rest = this._rest; if (rest == null) return; bucket = rest[this._computeHashCode$1(key)]; index = this._findBucketIndex$2(bucket, key); return index < 0 ? null : bucket[index + 1]; } }, $indexSet: function(_, key, value) { var strings, nums, rest, hash, bucket, index; if (typeof key === "string" && key !== "__proto__") { strings = this._strings; if (strings == null) { strings = P._HashMap__newHashTable(); this._strings = strings; } this._addHashTableEntry$3(strings, key, value); } else if (typeof key === "number" && (key & 0x3ffffff) === key) { nums = this._nums; if (nums == null) { nums = P._HashMap__newHashTable(); this._nums = nums; } this._addHashTableEntry$3(nums, key, value); } else { rest = this._rest; if (rest == null) { rest = P._HashMap__newHashTable(); this._rest = rest; } hash = this._computeHashCode$1(key); bucket = rest[hash]; if (bucket == null) { P._HashMap__setTableEntry(rest, hash, [key, value]); this._collection$_length = this._collection$_length + 1; this._keys = null; } else { index = this._findBucketIndex$2(bucket, key); if (index >= 0) bucket[index + 1] = value; else { bucket.push(key, value); this._collection$_length = this._collection$_length + 1; this._keys = null; } } } }, forEach$1: function(_, action) { var keys, $length, i, key; keys = this._computeKeys$0(); for ($length = keys.length, i = 0; i < $length; ++i) { key = keys[i]; action.call$2(key, this.$index(this, key)); if (keys !== this._keys) throw H.wrapException(P.ConcurrentModificationError$(this)); } }, _computeKeys$0: function() { var t1, result, strings, names, entries, index, i, nums, rest, bucket, $length, i0; t1 = this._keys; if (t1 != null) return t1; result = Array(this._collection$_length); result.fixed$length = init; strings = this._strings; if (strings != null) { names = Object.getOwnPropertyNames(strings); entries = names.length; for (index = 0, i = 0; i < entries; ++i) { result[index] = names[i]; ++index; } } else index = 0; nums = this._nums; if (nums != null) { names = Object.getOwnPropertyNames(nums); entries = names.length; for (i = 0; i < entries; ++i) { result[index] = +names[i]; ++index; } } rest = this._rest; if (rest != null) { names = Object.getOwnPropertyNames(rest); entries = names.length; for (i = 0; i < entries; ++i) { bucket = rest[names[i]]; $length = bucket.length; for (i0 = 0; i0 < $length; i0 += 2) { result[index] = bucket[i0]; ++index; } } } this._keys = result; return result; }, _addHashTableEntry$3: function(table, key, value) { if (table[key] == null) { this._collection$_length = this._collection$_length + 1; this._keys = null; } P._HashMap__setTableEntry(table, key, value); }, _computeHashCode$1: function(key) { return J.get$hashCode$(key) & 0x3ffffff; }, _findBucketIndex$2: function(bucket, key) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; i += 2) if (J.$eq(bucket[i], key)) return i; return -1; }, $isMap: true, static: {_HashMap__setTableEntry: function(table, key, value) { if (value == null) table[key] = table; else table[key] = value; }, _HashMap__newHashTable: function() { var table = Object.create(null); P._HashMap__setTableEntry(table, "", table); delete table[""]; return table; }} }, _HashMap_values_closure: { "": "Closure:10;this_0", call$1: function(each) { var t1 = this.this_0; return t1.$index(t1, each); } }, HashMapKeyIterable: { "": "IterableBase;_map", get$length: function(_) { return this._map._collection$_length; }, get$iterator: function(_) { var t1 = this._map; return new P.HashMapKeyIterator(t1, t1._computeKeys$0(), 0, null); }, forEach$1: function(_, f) { var t1, keys, $length, i; t1 = this._map; keys = t1._computeKeys$0(); for ($length = keys.length, i = 0; i < $length; ++i) { f.call$1(keys[i]); if (keys !== t1._keys) throw H.wrapException(P.ConcurrentModificationError$(t1)); } }, $asIterableBase: null }, HashMapKeyIterator: { "": "Object;_map,_keys,_offset,_collection$_current", get$current: function() { return this._collection$_current; }, moveNext$0: function() { var keys, offset, t1; keys = this._keys; offset = this._offset; t1 = this._map; if (keys !== t1._keys) throw H.wrapException(P.ConcurrentModificationError$(t1)); else if (offset >= keys.length) { this._collection$_current = null; return false; } else { this._collection$_current = keys[offset]; this._offset = offset + 1; return true; } } }, _LinkedHashMap: { "": "Object;_collection$_length,_strings,_nums,_rest,_first,_last,_modifications", get$length: function(_) { return this._collection$_length; }, get$keys: function() { return H.setRuntimeTypeInfo(new P.LinkedHashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]); }, get$values: function(_) { return H.MappedIterable_MappedIterable(H.setRuntimeTypeInfo(new P.LinkedHashMapKeyIterable(this), [H.getTypeArgumentByIndex(this, 0)]), new P._LinkedHashMap_values_closure(this), H.getTypeArgumentByIndex(this, 0), H.getTypeArgumentByIndex(this, 1)); }, containsKey$1: function(key) { var nums, rest; if ((key & 0x3ffffff) === key) { nums = this._nums; if (nums == null) return false; return nums[key] != null; } else { rest = this._rest; if (rest == null) return false; return this._findBucketIndex$2(rest[this._computeHashCode$1(key)], key) >= 0; } }, $index: function(_, key) { var strings, cell, nums, rest, bucket, index; if (typeof key === "string" && key !== "__proto__") { strings = this._strings; if (strings == null) return; cell = strings[key]; return cell == null ? null : cell.get$_value(); } else if (typeof key === "number" && (key & 0x3ffffff) === key) { nums = this._nums; if (nums == null) return; cell = nums[key]; return cell == null ? null : cell.get$_value(); } else { rest = this._rest; if (rest == null) return; bucket = rest[this._computeHashCode$1(key)]; index = this._findBucketIndex$2(bucket, key); if (index < 0) return; return bucket[index].get$_value(); } }, $indexSet: function(_, key, value) { var strings, nums, rest, hash, bucket, index; if (typeof key === "string" && key !== "__proto__") { strings = this._strings; if (strings == null) { strings = P._LinkedHashMap__newHashTable(); this._strings = strings; } this._addHashTableEntry$3(strings, key, value); } else if (typeof key === "number" && (key & 0x3ffffff) === key) { nums = this._nums; if (nums == null) { nums = P._LinkedHashMap__newHashTable(); this._nums = nums; } this._addHashTableEntry$3(nums, key, value); } else { rest = this._rest; if (rest == null) { rest = P._LinkedHashMap__newHashTable(); this._rest = rest; } hash = this._computeHashCode$1(key); bucket = rest[hash]; if (bucket == null) rest[hash] = [this._newLinkedCell$2(key, value)]; else { index = this._findBucketIndex$2(bucket, key); if (index >= 0) bucket[index].set$_value(value); else bucket.push(this._newLinkedCell$2(key, value)); } } }, remove$1: function(_, key) { var rest, bucket, index, cell; if (typeof key === "string" && key !== "__proto__") return this._removeHashTableEntry$2(this._strings, key); else if (typeof key === "number" && (key & 0x3ffffff) === key) return this._removeHashTableEntry$2(this._nums, key); else { rest = this._rest; if (rest == null) return; bucket = rest[this._computeHashCode$1(key)]; index = this._findBucketIndex$2(bucket, key); if (index < 0) return; cell = bucket.splice(index, 1)[0]; this._unlinkCell$1(cell); return cell.get$_value(); } }, forEach$1: function(_, action) { var cell, modifications; cell = this._first; modifications = this._modifications; for (; cell != null;) { action.call$2(cell.get$_key(), cell._value); if (modifications !== this._modifications) throw H.wrapException(P.ConcurrentModificationError$(this)); cell = cell._next; } }, _addHashTableEntry$3: function(table, key, value) { var cell = table[key]; if (cell == null) table[key] = this._newLinkedCell$2(key, value); else cell.set$_value(value); }, _removeHashTableEntry$2: function(table, key) { var cell; if (table == null) return; cell = table[key]; if (cell == null) return; this._unlinkCell$1(cell); delete table[key]; return cell.get$_value(); }, _newLinkedCell$2: function(key, value) { var cell, last; cell = new P.LinkedHashMapCell(key, value, null, null); if (this._first == null) { this._last = cell; this._first = cell; } else { last = this._last; cell._previous = last; last.set$_next(cell); this._last = cell; } this._collection$_length = this._collection$_length + 1; this._modifications = this._modifications + 1 & 67108863; return cell; }, _unlinkCell$1: function(cell) { var previous, next; previous = cell.get$_previous(); next = cell.get$_next(); if (previous == null) this._first = next; else previous.set$_next(next); if (next == null) this._last = previous; else next.set$_previous(previous); this._collection$_length = this._collection$_length - 1; this._modifications = this._modifications + 1 & 67108863; }, _computeHashCode$1: function(key) { return J.get$hashCode$(key) & 0x3ffffff; }, _findBucketIndex$2: function(bucket, key) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (J.$eq(bucket[i].get$_key(), key)) return i; return -1; }, toString$0: function(_) { return P.Maps_mapToString(this); }, $isMap: true, static: {_LinkedHashMap__newHashTable: function() { var table = Object.create(null); table[""] = table; delete table[""]; return table; }} }, _LinkedHashMap_values_closure: { "": "Closure:10;this_0", call$1: function(each) { var t1 = this.this_0; return t1.$index(t1, each); } }, LinkedHashMapCell: { "": "Object;_key<,_value@,_next@,_previous@" }, LinkedHashMapKeyIterable: { "": "IterableBase;_map", get$length: function(_) { return this._map._collection$_length; }, get$iterator: function(_) { var t1, t2; t1 = this._map; t2 = new P.LinkedHashMapKeyIterator(t1, t1._modifications, null, null); t2._cell = t1._first; return t2; }, forEach$1: function(_, f) { var t1, cell, modifications; t1 = this._map; cell = t1._first; modifications = t1._modifications; for (; cell != null;) { f.call$1(cell.get$_key()); if (modifications !== t1._modifications) throw H.wrapException(P.ConcurrentModificationError$(t1)); cell = cell._next; } }, $asIterableBase: null }, LinkedHashMapKeyIterator: { "": "Object;_map,_modifications,_cell,_collection$_current", get$current: function() { return this._collection$_current; }, moveNext$0: function() { var t1 = this._map; if (this._modifications !== t1._modifications) throw H.wrapException(P.ConcurrentModificationError$(t1)); else { t1 = this._cell; if (t1 == null) { this._collection$_current = null; return false; } else { this._collection$_current = t1.get$_key(); this._cell = t1._next; return true; } } } }, _HashSet: { "": "_HashSetBase;", get$iterator: function(_) { return new P.HashSetIterator(this, this._computeElements$0(), 0, null); }, get$length: function(_) { return this._collection$_length; }, contains$1: function(_, object) { var strings, nums, rest; if (typeof object === "string" && object !== "__proto__") { strings = this._strings; return strings == null ? false : strings[object] != null; } else if (typeof object === "number" && (object & 0x3ffffff) === object) { nums = this._nums; return nums == null ? false : nums[object] != null; } else { rest = this._rest; if (rest == null) return false; return this._findBucketIndex$2(rest[this._computeHashCode$1(object)], object) >= 0; } }, lookup$1: function(object) { var t1, rest, bucket, index; if (!(typeof object === "string" && object !== "__proto__")) t1 = typeof object === "number" && (object & 0x3ffffff) === object; else t1 = true; if (t1) return this.contains$1(this, object) ? object : null; rest = this._rest; if (rest == null) return; bucket = rest[this._computeHashCode$1(object)]; index = this._findBucketIndex$2(bucket, object); if (index < 0) return; return J.$index$asx(bucket, index); }, add$1: function(_, element) { var rest, hash, bucket; rest = this._rest; if (rest == null) { rest = P._HashSet__newHashTable(); this._rest = rest; } hash = this._computeHashCode$1(element); bucket = rest[hash]; if (bucket == null) rest[hash] = [element]; else { if (this._findBucketIndex$2(bucket, element) >= 0) return false; bucket.push(element); } this._collection$_length = this._collection$_length + 1; this._elements = null; return true; }, remove$1: function(_, object) { var rest, bucket, index; if (typeof object === "string" && object !== "__proto__") return this._removeHashTableEntry$2(this._strings, object); else if (typeof object === "number" && (object & 0x3ffffff) === object) return this._removeHashTableEntry$2(this._nums, object); else { rest = this._rest; if (rest == null) return false; bucket = rest[this._computeHashCode$1(object)]; index = this._findBucketIndex$2(bucket, object); if (index < 0) return false; this._collection$_length = this._collection$_length - 1; this._elements = null; bucket.splice(index, 1); return true; } }, _computeElements$0: function() { var t1, result, strings, names, entries, index, i, nums, rest, bucket, $length, i0; t1 = this._elements; if (t1 != null) return t1; result = Array(this._collection$_length); result.fixed$length = init; strings = this._strings; if (strings != null) { names = Object.getOwnPropertyNames(strings); entries = names.length; for (index = 0, i = 0; i < entries; ++i) { result[index] = names[i]; ++index; } } else index = 0; nums = this._nums; if (nums != null) { names = Object.getOwnPropertyNames(nums); entries = names.length; for (i = 0; i < entries; ++i) { result[index] = +names[i]; ++index; } } rest = this._rest; if (rest != null) { names = Object.getOwnPropertyNames(rest); entries = names.length; for (i = 0; i < entries; ++i) { bucket = rest[names[i]]; $length = bucket.length; for (i0 = 0; i0 < $length; ++i0) { result[index] = bucket[i0]; ++index; } } } this._elements = result; return result; }, _removeHashTableEntry$2: function(table, element) { if (table != null && table[element] != null) { delete table[element]; this._collection$_length = this._collection$_length - 1; this._elements = null; return true; } else return false; }, _computeHashCode$1: function(element) { return J.get$hashCode$(element) & 0x3ffffff; }, _findBucketIndex$2: function(bucket, element) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (J.$eq(bucket[i], element)) return i; return -1; }, $as_HashSetBase: null }, _IdentityHashSet: { "": "_HashSet;_collection$_length,_strings,_nums,_rest,_elements", _computeHashCode$1: function(key) { return H.objectHashCode(key) & 0x3ffffff; }, _findBucketIndex$2: function(bucket, element) { var $length, i, t1; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) { t1 = bucket[i]; if (t1 == null ? element == null : t1 === element) return i; } return -1; }, $as_HashSet: null }, HashSetIterator: { "": "Object;_set,_elements,_offset,_collection$_current", get$current: function() { return this._collection$_current; }, moveNext$0: function() { var elements, offset, t1; elements = this._elements; offset = this._offset; t1 = this._set; if (elements !== t1._elements) throw H.wrapException(P.ConcurrentModificationError$(t1)); else if (offset >= elements.length) { this._collection$_current = null; return false; } else { this._collection$_current = elements[offset]; this._offset = offset + 1; return true; } } }, _LinkedHashSet: { "": "_HashSetBase;_collection$_length,_strings,_nums,_rest,_first,_last,_modifications", get$iterator: function(_) { var t1 = new P.LinkedHashSetIterator(this, this._modifications, null, null); t1._cell = this._first; return t1; }, get$length: function(_) { return this._collection$_length; }, contains$1: function(_, object) { var strings, nums, rest; if (typeof object === "string" && object !== "__proto__") { strings = this._strings; if (strings == null) return false; return strings[object] != null; } else if (typeof object === "number" && (object & 0x3ffffff) === object) { nums = this._nums; if (nums == null) return false; return nums[object] != null; } else { rest = this._rest; if (rest == null) return false; return this._findBucketIndex$2(rest[this._computeHashCode$1(object)], object) >= 0; } }, lookup$1: function(object) { var t1, rest, bucket, index; if (!(typeof object === "string" && object !== "__proto__")) t1 = typeof object === "number" && (object & 0x3ffffff) === object; else t1 = true; if (t1) return this.contains$1(this, object) ? object : null; else { rest = this._rest; if (rest == null) return; bucket = rest[this._computeHashCode$1(object)]; index = this._findBucketIndex$2(bucket, object); if (index < 0) return; return J.$index$asx(bucket, index).get$_element(); } }, forEach$1: function(_, action) { var cell, modifications; cell = this._first; modifications = this._modifications; for (; cell != null;) { action.call$1(cell.get$_element()); if (modifications !== this._modifications) throw H.wrapException(P.ConcurrentModificationError$(this)); cell = cell._next; } }, add$1: function(_, element) { var nums, rest, hash, bucket; if ((element & 0x3ffffff) === element) { nums = this._nums; if (nums == null) { nums = P._LinkedHashSet__newHashTable(); this._nums = nums; } return this._addHashTableEntry$2(nums, element); } else { rest = this._rest; if (rest == null) { rest = P._LinkedHashSet__newHashTable(); this._rest = rest; } hash = this._computeHashCode$1(element); bucket = rest[hash]; if (bucket == null) rest[hash] = [this._newLinkedCell$1(element)]; else { if (this._findBucketIndex$2(bucket, element) >= 0) return false; bucket.push(this._newLinkedCell$1(element)); } return true; } }, _addHashTableEntry$2: function(table, element) { if (table[element] != null) return false; table[element] = this._newLinkedCell$1(element); return true; }, _newLinkedCell$1: function(element) { var cell, last; cell = new P.LinkedHashSetCell(element, null, null); if (this._first == null) { this._last = cell; this._first = cell; } else { last = this._last; cell._previous = last; last.set$_next(cell); this._last = cell; } this._collection$_length = this._collection$_length + 1; this._modifications = this._modifications + 1 & 67108863; return cell; }, _computeHashCode$1: function(element) { return J.get$hashCode$(element) & 0x3ffffff; }, _findBucketIndex$2: function(bucket, element) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (bucket[i].get$_element() === element) return i; return -1; }, $as_HashSetBase: null, static: {_LinkedHashSet__newHashTable: function() { var table = Object.create(null); table[""] = table; delete table[""]; return table; }} }, LinkedHashSetCell: { "": "Object;_element<,_next@,_previous@" }, LinkedHashSetIterator: { "": "Object;_set,_modifications,_cell,_collection$_current", get$current: function() { return this._collection$_current; }, moveNext$0: function() { var t1 = this._set; if (this._modifications !== t1._modifications) throw H.wrapException(P.ConcurrentModificationError$(t1)); else { t1 = this._cell; if (t1 == null) { this._collection$_current = null; return false; } else { this._collection$_current = t1.get$_element(); this._cell = t1._next; return true; } } } }, _HashSetBase: { "": "IterableBase;", toString$0: function(_) { return H.IterableMixinWorkaround_toStringIterable(this, "{", "}"); }, $asIterableBase: null }, IterableBase: { "": "Object;", forEach$1: function(_, f) { var t1; for (t1 = this.get$iterator(this); t1.moveNext$0();) f.call$1(t1.get$current()); }, get$length: function(_) { var it, count; it = this.get$iterator(this); for (count = 0; it.moveNext$0();) ++count; return count; }, elementAt$1: function(_, index) { var t1, remaining, element; if (index < 0) throw H.wrapException(P.RangeError$value(index)); for (t1 = this.get$iterator(this), remaining = index; t1.moveNext$0();) { element = t1.get$current(); if (remaining === 0) return element; --remaining; } throw H.wrapException(P.RangeError$value(index)); }, toString$0: function(_) { return P._iterableToString(this); } }, ListMixin: { "": "Object;", get$iterator: function(receiver) { return new H.ListIterator(receiver, this.get$length(receiver), 0, null); }, elementAt$1: function(receiver, index) { return this.$index(receiver, index); }, forEach$1: function(receiver, action) { var $length, i; $length = this.get$length(receiver); for (i = 0; i < $length; ++i) { action.call$1(this.$index(receiver, i)); if ($length !== this.get$length(receiver)) throw H.wrapException(P.ConcurrentModificationError$(receiver)); } }, toString$0: function(receiver) { var result, t1; t1 = $.get$_toStringVisiting(); if (t1.contains$1(t1, receiver)) return "[...]"; result = P.StringBuffer$(""); try { t1 = $.get$_toStringVisiting(); t1.add$1(t1, receiver); result.write$1("["); result.writeAll$2(receiver, ", "); result.write$1("]"); } finally { t1 = $.get$_toStringVisiting(); t1.remove$1(t1, receiver); } return result.get$_contents(); }, $isList: true, $asList: null }, Maps_mapToString_closure: { "": "Closure:9;box_0,result_1", call$2: function(k, v) { var t1 = this.box_0; if (!t1.first_0) this.result_1.write$1(", "); t1.first_0 = false; t1 = this.result_1; t1.write$1(k); t1.write$1(": "); t1.write$1(v); } }, ListQueue: { "": "IterableBase;_table,_head,_tail,_modificationCount", get$iterator: function(_) { return new P._ListQueueIterator(this, this._tail, this._modificationCount, this._head, null); }, forEach$1: function(_, action) { var modificationCount, i, t1; modificationCount = this._modificationCount; for (i = this._head; i !== this._tail; i = (i + 1 & this._table.length - 1) >>> 0) { t1 = this._table; if (i < 0 || i >= t1.length) return H.ioore(t1, i); action.call$1(t1[i]); if (modificationCount !== this._modificationCount) H.throwExpression(P.ConcurrentModificationError$(this)); } }, get$length: function(_) { return (this._tail - this._head & this._table.length - 1) >>> 0; }, toString$0: function(_) { return H.IterableMixinWorkaround_toStringIterable(this, "{", "}"); }, removeFirst$0: function() { var t1, t2, t3, result; t1 = this._head; if (t1 === this._tail) throw H.wrapException(P.StateError$("No elements")); this._modificationCount = this._modificationCount + 1; t2 = this._table; t3 = t2.length; if (t1 >= t3) return H.ioore(t2, t1); result = t2[t1]; this._head = (t1 + 1 & t3 - 1) >>> 0; return result; }, _add$1: function(element) { var t1, t2, t3, newTable, split; t1 = this._table; t2 = this._tail; t3 = t1.length; if (t2 >= t3) return H.ioore(t1, t2); t1[t2] = element; t2 = (t2 + 1 & t3 - 1) >>> 0; this._tail = t2; if (this._head === t2) { t1 = Array(t3 * 2); t1.fixed$length = init; newTable = H.setRuntimeTypeInfo(t1, [H.getTypeArgumentByIndex(this, 0)]); t1 = this._table; t2 = this._head; split = t1.length - t2; H.IterableMixinWorkaround_setRangeList(newTable, 0, split, t1, t2); t1 = this._head; t2 = this._table; H.IterableMixinWorkaround_setRangeList(newTable, split, split + t1, t2, 0); this._head = 0; this._tail = this._table.length; this._table = newTable; } this._modificationCount = this._modificationCount + 1; }, ListQueue$1: function(initialCapacity, $E) { var t1 = Array(8); t1.fixed$length = init; this._table = H.setRuntimeTypeInfo(t1, [$E]); }, $asIterableBase: null, static: {"": "ListQueue__INITIAL_CAPACITY"} }, _ListQueueIterator: { "": "Object;_queue,_end,_modificationCount,_collection$_position,_collection$_current", get$current: function() { return this._collection$_current; }, moveNext$0: function() { var t1, t2, t3; t1 = this._queue; if (this._modificationCount !== t1._modificationCount) H.throwExpression(P.ConcurrentModificationError$(t1)); t2 = this._collection$_position; if (t2 === this._end) { this._collection$_current = null; return false; } t1 = t1._table; t3 = t1.length; if (t2 >= t3) return H.ioore(t1, t2); this._collection$_current = t1[t2]; this._collection$_position = (t2 + 1 & t3 - 1) >>> 0; return true; } } }], ["dart.core", "dart:core", , P, { "": "", _symbolToString: function(symbol) { return H.Symbol_getName(symbol); }, Error_safeToString: function(object) { var buffer, t1, i, t2, codeUnit, charCodes; if (typeof object === "number" || typeof object === "boolean" || null == object) return J.toString$0(object); if (typeof object === "string") { buffer = new P.StringBuffer(""); buffer._contents = "\""; for (t1 = object.length, i = 0, t2 = "\""; i < t1; ++i) { codeUnit = C.JSString_methods.codeUnitAt$1(object, i); if (codeUnit <= 31) if (codeUnit === 10) { t2 = buffer._contents + "\\n"; buffer._contents = t2; } else if (codeUnit === 13) { t2 = buffer._contents + "\\r"; buffer._contents = t2; } else if (codeUnit === 9) { t2 = buffer._contents + "\\t"; buffer._contents = t2; } else { t2 = buffer._contents + "\\x"; buffer._contents = t2; if (codeUnit < 16) buffer._contents = t2 + "0"; else { buffer._contents = t2 + "1"; codeUnit -= 16; } t2 = codeUnit < 10 ? 48 + codeUnit : 87 + codeUnit; charCodes = P.List_List$filled(1, t2, J.JSInt); t2 = H.Primitives_stringFromCharCodes(charCodes); t2 = buffer._contents + t2; buffer._contents = t2; } else if (codeUnit === 92) { t2 = buffer._contents + "\\\\"; buffer._contents = t2; } else if (codeUnit === 34) { t2 = buffer._contents + "\\\""; buffer._contents = t2; } else { charCodes = P.List_List$filled(1, codeUnit, J.JSInt); t2 = H.Primitives_stringFromCharCodes(charCodes); t2 = buffer._contents + t2; buffer._contents = t2; } } t1 = t2 + "\""; buffer._contents = t1; return t1; } return "Instance of '" + H.Primitives_objectTypeName(object) + "'"; }, Exception_Exception: function(message) { return new P._ExceptionImplementation(message); }, identical: [function(a, b) { return a == null ? b == null : a === b; }, "call$2", "identical$closure", 4, 0, 6], identityHashCode: [function(object) { return H.objectHashCode(object); }, "call$1", "identityHashCode$closure", 2, 0, 7], List_List$filled: function($length, fill, $E) { var result, t1, i; result = J.JSArray_JSArray$fixed($length, $E); if ($length !== 0 && true) for (t1 = result.length, i = 0; i < t1; ++i) result[i] = fill; return result; }, List_List$from: function(other, growable, $E) { var list, t1, $length, fixedList, t2, i, t3; list = H.setRuntimeTypeInfo([], [$E]); for (t1 = J.get$iterator$ax(other); t1.moveNext$0();) list.push(t1.get$current()); if (growable) return list; $length = list.length; t1 = Array($length); t1.fixed$length = init; fixedList = H.setRuntimeTypeInfo(t1, [$E]); for (t1 = list.length, t2 = fixedList.length, i = 0; i < $length; ++i) { if (i >= t1) return H.ioore(list, i); t3 = list[i]; if (i >= t2) return H.ioore(fixedList, i); fixedList[i] = t3; } return fixedList; }, print: function(object) { var line = H.S(object); H.printString(line); }, NoSuchMethodError_toString_closure: { "": "Closure:16;box_0", call$2: function(key, value) { var t1 = this.box_0; if (t1.i_1 > 0) t1.sb_0.write$1(", "); t1.sb_0.write$1(P._symbolToString(key)); } }, DateTime: { "": "Object;millisecondsSinceEpoch,isUtc", $eq: function(_, other) { var t1; if (other == null) return false; t1 = J.getInterceptor(other); if (typeof other !== "object" || other === null || !t1.$isDateTime) return false; return this.millisecondsSinceEpoch === other.millisecondsSinceEpoch && this.isUtc === other.isUtc; }, get$hashCode: function(_) { return this.millisecondsSinceEpoch; }, toString$0: function(_) { var t1, t2, t3, y, m, d, h, min, sec, ms; t1 = new P.DateTime_toString_twoDigits(); t2 = this.isUtc; t3 = t2 ? H.Primitives_lazyAsJsDate(this).getUTCFullYear() + 0 : H.Primitives_lazyAsJsDate(this).getFullYear() + 0; y = new P.DateTime_toString_fourDigits().call$1(t3); m = t1.call$1(t2 ? H.Primitives_lazyAsJsDate(this).getUTCMonth() + 1 : H.Primitives_lazyAsJsDate(this).getMonth() + 1); d = t1.call$1(t2 ? H.Primitives_lazyAsJsDate(this).getUTCDate() + 0 : H.Primitives_lazyAsJsDate(this).getDate() + 0); h = t1.call$1(H.Primitives_getHours(this)); min = t1.call$1(H.Primitives_getMinutes(this)); sec = t1.call$1(H.Primitives_getSeconds(this)); t1 = t2 ? H.Primitives_lazyAsJsDate(this).getUTCMilliseconds() + 0 : H.Primitives_lazyAsJsDate(this).getMilliseconds() + 0; ms = new P.DateTime_toString_threeDigits().call$1(t1); if (t2) return H.S(y) + "-" + H.S(m) + "-" + H.S(d) + " " + H.S(h) + ":" + H.S(min) + ":" + H.S(sec) + "." + H.S(ms) + "Z"; else return H.S(y) + "-" + H.S(m) + "-" + H.S(d) + " " + H.S(h) + ":" + H.S(min) + ":" + H.S(sec) + "." + H.S(ms); }, DateTime$_now$0: function() { H.Primitives_lazyAsJsDate(this); }, $isDateTime: true, static: {"": "DateTime_MONDAY,DateTime_TUESDAY,DateTime_WEDNESDAY,DateTime_THURSDAY,DateTime_FRIDAY,DateTime_SATURDAY,DateTime_SUNDAY,DateTime_DAYS_PER_WEEK,DateTime_JANUARY,DateTime_FEBRUARY,DateTime_MARCH,DateTime_APRIL,DateTime_MAY,DateTime_JUNE,DateTime_JULY,DateTime_AUGUST,DateTime_SEPTEMBER,DateTime_OCTOBER,DateTime_NOVEMBER,DateTime_DECEMBER,DateTime_MONTHS_PER_YEAR,DateTime__MAX_MILLISECONDS_SINCE_EPOCH", DateTime$_now: function() { var t1 = new P.DateTime(Date.now(), false); t1.DateTime$_now$0(); return t1; }} }, DateTime_toString_fourDigits: { "": "Closure:17;", call$1: function(n) { var absN, sign; absN = Math.abs(n); sign = n < 0 ? "-" : ""; if (absN >= 1000) return "" + n; if (absN >= 100) return sign + "0" + H.S(absN); if (absN >= 10) return sign + "00" + H.S(absN); return sign + "000" + H.S(absN); } }, DateTime_toString_threeDigits: { "": "Closure:17;", call$1: function(n) { if (n >= 100) return "" + n; if (n >= 10) return "0" + n; return "00" + n; } }, DateTime_toString_twoDigits: { "": "Closure:17;", call$1: function(n) { if (n >= 10) return "" + n; return "0" + n; } }, Duration: { "": "Object;_duration<", $add: function(_, other) { return P.Duration$(0, 0, C.JSInt_methods.$add(this._duration, other.get$_duration()), 0, 0, 0); }, $sub: function(_, other) { return P.Duration$(0, 0, this._duration - other.get$_duration(), 0, 0, 0); }, $lt: function(_, other) { return C.JSInt_methods.$lt(this._duration, other.get$_duration()); }, $ge: function(_, other) { return C.JSInt_methods.$ge(this._duration, other.get$_duration()); }, $eq: function(_, other) { var t1; if (other == null) return false; t1 = J.getInterceptor(other); if (typeof other !== "object" || other === null || !t1.$isDuration) return false; return this._duration === other._duration; }, get$hashCode: function(_) { return this._duration & 0x1FFFFFFF; }, toString$0: function(_) { var t1, t2, twoDigitMinutes, twoDigitSeconds, sixDigitUs; t1 = new P.Duration_toString_twoDigits(); t2 = this._duration; if (t2 < 0) return "-" + H.S(P.Duration$(0, 0, -t2, 0, 0, 0)); twoDigitMinutes = t1.call$1(C.JSInt_methods.remainder$1(C.JSInt_methods._tdivFast$1(t2, 60000000), 60)); twoDigitSeconds = t1.call$1(C.JSInt_methods.remainder$1(C.JSInt_methods._tdivFast$1(t2, 1000000), 60)); sixDigitUs = new P.Duration_toString_sixDigits().call$1(C.JSInt_methods.remainder$1(t2, 1000000)); return "" + C.JSInt_methods._tdivFast$1(t2, 3600000000) + ":" + H.S(twoDigitMinutes) + ":" + H.S(twoDigitSeconds) + "." + H.S(sixDigitUs); }, $isDuration: true, static: {"": "Duration_MICROSECONDS_PER_MILLISECOND,Duration_MILLISECONDS_PER_SECOND,Duration_SECONDS_PER_MINUTE,Duration_MINUTES_PER_HOUR,Duration_HOURS_PER_DAY,Duration_MICROSECONDS_PER_SECOND,Duration_MICROSECONDS_PER_MINUTE,Duration_MICROSECONDS_PER_HOUR,Duration_MICROSECONDS_PER_DAY,Duration_MILLISECONDS_PER_MINUTE,Duration_MILLISECONDS_PER_HOUR,Duration_MILLISECONDS_PER_DAY,Duration_SECONDS_PER_HOUR,Duration_SECONDS_PER_DAY,Duration_MINUTES_PER_DAY,Duration_ZERO", Duration$: function(days, hours, microseconds, milliseconds, minutes, seconds) { return new P.Duration(days * 86400000000 + hours * 3600000000 + minutes * 60000000 + seconds * 1000000 + milliseconds * 1000 + microseconds); }} }, Duration_toString_sixDigits: { "": "Closure:17;", call$1: function(n) { if (n >= 100000) return "" + n; if (n >= 10000) return "0" + n; if (n >= 1000) return "00" + n; if (n >= 100) return "000" + n; if (n > 10) return "0000" + n; return "00000" + n; } }, Duration_toString_twoDigits: { "": "Closure:17;", call$1: function(n) { if (n >= 10) return "" + n; return "0" + n; } }, Error: { "": "Object;", get$stackTrace: function() { return new H._StackTrace(this.$thrownJsError, null); }, $isError: true }, NullThrownError: { "": "Error;", toString$0: function(_) { return "Throw of null."; } }, ArgumentError: { "": "Error;message", toString$0: function(_) { var t1 = this.message; if (t1 != null) return "Illegal argument(s): " + H.S(t1); return "Illegal argument(s)"; }, static: {ArgumentError$: function(message) { return new P.ArgumentError(message); }} }, RangeError: { "": "ArgumentError;message", toString$0: function(_) { return "RangeError: " + H.S(this.message); }, static: {RangeError$value: function(value) { return new P.RangeError("value " + H.S(value)); }, RangeError$range: function(value, start, end) { return new P.RangeError("value " + H.S(value) + " not in range " + start + ".." + H.S(end)); }} }, UnsupportedError: { "": "Error;message", toString$0: function(_) { return "Unsupported operation: " + this.message; }, static: {UnsupportedError$: function(message) { return new P.UnsupportedError(message); }} }, UnimplementedError: { "": "Error;message", toString$0: function(_) { var t1 = this.message; return t1 != null ? "UnimplementedError: " + H.S(t1) : "UnimplementedError"; }, $isError: true, static: {UnimplementedError$: function(message) { return new P.UnimplementedError(message); }} }, StateError: { "": "Error;message", toString$0: function(_) { return "Bad state: " + this.message; }, static: {StateError$: function(message) { return new P.StateError(message); }} }, ConcurrentModificationError: { "": "Error;modifiedObject", toString$0: function(_) { var t1 = this.modifiedObject; if (t1 == null) return "Concurrent modification during iteration."; return "Concurrent modification during iteration: " + H.S(P.Error_safeToString(t1)) + "."; }, static: {ConcurrentModificationError$: function(modifiedObject) { return new P.ConcurrentModificationError(modifiedObject); }} }, StackOverflowError: { "": "Object;", toString$0: function(_) { return "Stack Overflow"; }, get$stackTrace: function() { return; }, $isError: true }, CyclicInitializationError: { "": "Error;variableName", toString$0: function(_) { return "Reading static variable '" + this.variableName + "' during its initialization"; }, static: {CyclicInitializationError$: function(variableName) { return new P.CyclicInitializationError(variableName); }} }, _ExceptionImplementation: { "": "Object;message", toString$0: function(_) { var t1 = this.message; if (t1 == null) return "Exception"; return "Exception: " + H.S(t1); } }, Expando: { "": "Object;name", toString$0: function(_) { return "Expando:" + H.S(this.name); }, $index: function(_, object) { var values = H.Primitives_getProperty(object, "expando$values"); return values == null ? null : H.Primitives_getProperty(values, this._getKey$0()); }, $indexSet: function(_, object, value) { var values = H.Primitives_getProperty(object, "expando$values"); if (values == null) { values = new P.Object(); H.Primitives_setProperty(object, "expando$values", values); } H.Primitives_setProperty(values, this._getKey$0(), value); }, _getKey$0: function() { var key, t1; key = H.Primitives_getProperty(this, "expando$key"); if (key == null) { t1 = $.Expando__keyCount; $.Expando__keyCount = t1 + 1; key = "expando$key$" + t1; H.Primitives_setProperty(this, "expando$key", key); } return key; }, static: {"": "Expando__KEY_PROPERTY_NAME,Expando__EXPANDO_PROPERTY_NAME,Expando__keyCount"} }, Iterator: { "": "Object;" }, Null: { "": "Object;", toString$0: function(_) { return "null"; } }, Object: { "": ";", $eq: function(_, other) { return this === other; }, get$hashCode: function(_) { return H.Primitives_objectHashCode(this); }, toString$0: function(_) { return H.Primitives_objectToString(this); } }, StackTrace: { "": "Object;" }, StringBuffer: { "": "Object;_contents<", get$length: function(_) { return this._contents.length; }, write$1: function(obj) { var str = typeof obj === "string" ? obj : H.S(obj); this._contents = this._contents + str; }, writeAll$2: function(objects, separator) { var iterator, str; iterator = J.get$iterator$ax(objects); if (!iterator.moveNext$0()) return; if (separator.length === 0) do { str = iterator.get$current(); str = typeof str === "string" ? str : H.S(str); this._contents = this._contents + str; } while (iterator.moveNext$0()); else { this.write$1(iterator.get$current()); for (; iterator.moveNext$0();) { this._contents = this._contents + separator; str = iterator.get$current(); str = typeof str === "string" ? str : H.S(str); this._contents = this._contents + str; } } }, toString$0: function(_) { return this._contents; }, StringBuffer$1: function($content) { this._contents = $content; }, static: {StringBuffer$: function($content) { var t1 = new P.StringBuffer(""); t1.StringBuffer$1($content); return t1; }} }, Symbol: { "": "Object;" } }], ["dart.dom.html", "dart:html", , W, { "": "", ImageElement_ImageElement: function(height, src, width) { var e = document.createElement("img", null); if (src != null) J.set$src$x(e, src); return e; }, _JenkinsSmiHash_combine: function(hash, value) { hash = 536870911 & hash + value; hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0); return hash ^ hash >>> 6; }, _wrapZone: function(callback) { var t1 = $.Zone__current; if (t1 === C.C__RootZone) return callback; return t1.bindUnaryCallback$2$runGuarded(callback, true); }, HtmlElement: { "": "Element;", "%": "HTMLAppletElement|HTMLAreaElement|HTMLBRElement|HTMLBaseElement|HTMLBaseFontElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement|HTMLContentElement|HTMLDListElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLDivElement|HTMLFieldSetElement|HTMLFontElement|HTMLFrameElement|HTMLFrameSetElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMenuElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLShadowElement|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTemplateElement|HTMLTextAreaElement|HTMLTitleElement|HTMLUListElement|HTMLUnknownElement;HTMLElement" }, AnchorElement: { "": "HtmlElement;", toString$0: function(receiver) { return receiver.toString(); }, "%": "HTMLAnchorElement" }, CharacterData: { "": "Node;length=", "%": "CDATASection|CharacterData|Comment|ProcessingInstruction|Text" }, CssStyleDeclaration: { "": "Interceptor_CssStyleDeclarationBase;length=", setProperty$3: function(receiver, propertyName, value, priority) { var exception; try { if (priority == null) priority = ""; receiver.setProperty(propertyName, value, priority); if (!!receiver.setAttribute) receiver.setAttribute(propertyName, value); } catch (exception) { H.unwrapException(exception); } }, "%": "CSS2Properties|CSSStyleDeclaration|MSStyleCSSProperties" }, DomException: { "": "Interceptor;", toString$0: function(receiver) { return receiver.toString(); }, "%": "DOMException" }, Element: { "": "Node;", toString$0: function(receiver) { return receiver.localName; }, "%": ";Element" }, EmbedElement: { "": "HtmlElement;src}", "%": "HTMLEmbedElement" }, ErrorEvent: { "": "Event;error=", "%": "ErrorEvent" }, Event: { "": "Interceptor;", "%": "AudioProcessingEvent|AutocompleteErrorEvent|BeforeLoadEvent|BeforeUnloadEvent|CSSFontFaceLoadEvent|CloseEvent|CompositionEvent|CustomEvent|DeviceMotionEvent|DeviceOrientationEvent|DragEvent|FocusEvent|HashChangeEvent|IDBVersionChangeEvent|KeyboardEvent|MIDIConnectionEvent|MIDIMessageEvent|MSPointerEvent|MediaKeyEvent|MediaKeyMessageEvent|MediaKeyNeededEvent|MediaStreamEvent|MediaStreamTrackEvent|MessageEvent|MouseEvent|MouseScrollEvent|MouseWheelEvent|MutationEvent|OfflineAudioCompletionEvent|OverflowEvent|PageTransitionEvent|PointerEvent|PopStateEvent|ProgressEvent|RTCDTMFToneChangeEvent|RTCDataChannelEvent|RTCIceCandidateEvent|ResourceProgressEvent|SVGZoomEvent|SecurityPolicyViolationEvent|SpeechInputEvent|SpeechRecognitionEvent|SpeechSynthesisEvent|StorageEvent|TextEvent|TouchEvent|TrackEvent|TransitionEvent|UIEvent|WebGLContextEvent|WebKitAnimationEvent|WebKitTransitionEvent|WheelEvent|XMLHttpRequestProgressEvent;Event" }, EventTarget: { "": "Interceptor;", "%": "MediaStream;EventTarget" }, FormElement: { "": "HtmlElement;length=", "%": "HTMLFormElement" }, IFrameElement: { "": "HtmlElement;src}", "%": "HTMLIFrameElement" }, ImageElement: { "": "HtmlElement;src}", "%": "HTMLImageElement" }, InputElement: { "": "HtmlElement;src}", "%": "HTMLInputElement" }, MediaElement: { "": "HtmlElement;error=,src}", "%": "HTMLAudioElement|HTMLMediaElement|HTMLVideoElement" }, Node: { "": "EventTarget;", toString$0: function(receiver) { var t1 = receiver.nodeValue; return t1 == null ? J.Interceptor.prototype.toString$0.call(this, receiver) : t1; }, "%": "Attr|Document|DocumentFragment|DocumentType|Entity|HTMLDocument|Notation|SVGDocument|ShadowRoot;Node" }, NodeList: { "": "Interceptor_ListMixin_ImmutableListMixin;", get$length: function(receiver) { return receiver.length; }, $index: function(receiver, index) { var t1 = receiver.length; if (index >>> 0 !== index || index >= t1) throw H.wrapException(P.RangeError$range(index, 0, t1)); return receiver[index]; }, $indexSet: function(receiver, index, value) { throw H.wrapException(P.UnsupportedError$("Cannot assign element of immutable List.")); }, elementAt$1: function(receiver, index) { if (index < 0 || index >= receiver.length) return H.ioore(receiver, index); return receiver[index]; }, $isList: true, $asList: function() { return [W.Node]; }, $isJavaScriptIndexingBehavior: true, "%": "NodeList|RadioNodeList" }, ScriptElement: { "": "HtmlElement;src}", "%": "HTMLScriptElement" }, SelectElement: { "": "HtmlElement;length=", "%": "HTMLSelectElement" }, SourceElement: { "": "HtmlElement;src}", "%": "HTMLSourceElement" }, SpeechRecognitionError: { "": "Event;error=", "%": "SpeechRecognitionError" }, TrackElement: { "": "HtmlElement;src}", "%": "HTMLTrackElement" }, Window: { "": "EventTarget;", _requestAnimationFrame$1: function(receiver, callback) { return receiver.requestAnimationFrame(H.convertDartClosureToJS(callback, 1)); }, _ensureRequestAnimationFrame$0: function(receiver) { if (!!(receiver.requestAnimationFrame && receiver.cancelAnimationFrame)) return; (function($this) { var vendors = ['ms', 'moz', 'webkit', 'o']; for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) { $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame']; $this.cancelAnimationFrame = $this[vendors[i]+'CancelAnimationFrame'] || $this[vendors[i]+'CancelRequestAnimationFrame']; } if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return; $this.requestAnimationFrame = function(callback) { return window.setTimeout(function() { callback(Date.now()); }, 16 /* 16ms ~= 60fps */); }; $this.cancelAnimationFrame = function(id) { clearTimeout(id); } })(receiver); }, toString$0: function(receiver) { return receiver.toString(); }, "%": "DOMWindow|Window" }, _ClientRect: { "": "Interceptor;height=,left=,top=,width=", toString$0: function(receiver) { return "Rectangle (" + H.S(receiver.left) + ", " + H.S(receiver.top) + ") " + H.S(receiver.width) + " x " + H.S(receiver.height); }, $eq: function(receiver, other) { var t1, t2, t3; if (other == null) return false; t1 = J.getInterceptor$x(other); if (typeof other !== "object" || other === null || !t1.$isRectangle) return false; t2 = receiver.left; t3 = t1.get$left(other); if (t2 == null ? t3 == null : t2 === t3) { t2 = receiver.top; t3 = t1.get$top(other); if (t2 == null ? t3 == null : t2 === t3) { t2 = receiver.width; t3 = t1.get$width(other); if (t2 == null ? t3 == null : t2 === t3) { t2 = receiver.height; t1 = t1.get$height(other); t1 = t2 == null ? t1 == null : t2 === t1; } else t1 = false; } else t1 = false; } else t1 = false; return t1; }, get$hashCode: function(receiver) { var t1, t2, t3, t4, hash; t1 = J.get$hashCode$(receiver.left); t2 = J.get$hashCode$(receiver.top); t3 = J.get$hashCode$(receiver.width); t4 = J.get$hashCode$(receiver.height); t4 = W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(W._JenkinsSmiHash_combine(0, t1), t2), t3), t4); hash = 536870911 & t4 + ((67108863 & t4) << 3 >>> 0); hash ^= hash >>> 11; return 536870911 & hash + ((16383 & hash) << 15 >>> 0); }, $isRectangle: true, $asRectangle: function() { return [null]; }, "%": "ClientRect|DOMRect" }, Interceptor_CssStyleDeclarationBase: { "": "Interceptor+CssStyleDeclarationBase;" }, CssStyleDeclarationBase: { "": "Object;", set$bottom: function(receiver, value) { this.setProperty$3(receiver, "bottom", value, ""); }, set$left: function(receiver, value) { this.setProperty$3(receiver, "left", value, ""); }, set$position: function(receiver, value) { this.setProperty$3(receiver, "position", value, ""); }, set$right: function(receiver, value) { this.setProperty$3(receiver, "right", value, ""); }, set$textAlign: function(receiver, value) { this.setProperty$3(receiver, "text-align", value, ""); }, set$top: function(receiver, value) { this.setProperty$3(receiver, "top", value, ""); } }, Interceptor_ListMixin: { "": "Interceptor+ListMixin;", $isList: true, $asList: function() { return [W.Node]; } }, Interceptor_ListMixin_ImmutableListMixin: { "": "Interceptor_ListMixin+ImmutableListMixin;", $isList: true, $asList: function() { return [W.Node]; } }, ImmutableListMixin: { "": "Object;", get$iterator: function(receiver) { return new W.FixedSizeListIterator(receiver, this.get$length(receiver), -1, null); }, $isList: true, $asList: null }, FixedSizeListIterator: { "": "Object;_array,_length,_position,_current", moveNext$0: function() { var nextPosition, t1; nextPosition = this._position + 1; t1 = this._length; if (nextPosition < t1) { this._current = J.$index$asx(this._array, nextPosition); this._position = nextPosition; return true; } this._current = null; this._position = t1; return false; }, get$current: function() { return this._current; } } }], ["dart.dom.svg", "dart:svg", , P, { "": "", FEBlendElement: { "": "SvgElement;x=,y=", "%": "SVGFEBlendElement" }, FEColorMatrixElement: { "": "SvgElement;x=,y=", "%": "SVGFEColorMatrixElement" }, FEComponentTransferElement: { "": "SvgElement;x=,y=", "%": "SVGFEComponentTransferElement" }, FECompositeElement: { "": "SvgElement;x=,y=", "%": "SVGFECompositeElement" }, FEConvolveMatrixElement: { "": "SvgElement;x=,y=", "%": "SVGFEConvolveMatrixElement" }, FEDiffuseLightingElement: { "": "SvgElement;x=,y=", "%": "SVGFEDiffuseLightingElement" }, FEDisplacementMapElement: { "": "SvgElement;x=,y=", "%": "SVGFEDisplacementMapElement" }, FEFloodElement: { "": "SvgElement;x=,y=", "%": "SVGFEFloodElement" }, FEGaussianBlurElement: { "": "SvgElement;x=,y=", "%": "SVGFEGaussianBlurElement" }, FEImageElement: { "": "SvgElement;x=,y=", "%": "SVGFEImageElement" }, FEMergeElement: { "": "SvgElement;x=,y=", "%": "SVGFEMergeElement" }, FEMorphologyElement: { "": "SvgElement;x=,y=", "%": "SVGFEMorphologyElement" }, FEOffsetElement: { "": "SvgElement;x=,y=", "%": "SVGFEOffsetElement" }, FEPointLightElement: { "": "SvgElement;x=,y=", "%": "SVGFEPointLightElement" }, FESpecularLightingElement: { "": "SvgElement;x=,y=", "%": "SVGFESpecularLightingElement" }, FESpotLightElement: { "": "SvgElement;x=,y=", "%": "SVGFESpotLightElement" }, FETileElement: { "": "SvgElement;x=,y=", "%": "SVGFETileElement" }, FETurbulenceElement: { "": "SvgElement;x=,y=", "%": "SVGFETurbulenceElement" }, FilterElement: { "": "SvgElement;x=,y=", "%": "SVGFilterElement" }, ForeignObjectElement: { "": "GraphicsElement;x=,y=", "%": "SVGForeignObjectElement" }, GraphicsElement: { "": "SvgElement;", "%": "SVGAElement|SVGCircleElement|SVGClipPathElement|SVGDefsElement|SVGEllipseElement|SVGGElement|SVGLineElement|SVGPathElement|SVGPolygonElement|SVGPolylineElement|SVGSwitchElement;SVGGraphicsElement" }, ImageElement0: { "": "GraphicsElement;x=,y=", "%": "SVGImageElement" }, MaskElement: { "": "SvgElement;x=,y=", "%": "SVGMaskElement" }, PatternElement: { "": "SvgElement;x=,y=", "%": "SVGPatternElement" }, RectElement: { "": "GraphicsElement;x=,y=", "%": "SVGRectElement" }, SvgElement: { "": "Element;", "%": "SVGAltGlyphDefElement|SVGAltGlyphItemElement|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimationElement|SVGComponentTransferFunctionElement|SVGCursorElement|SVGDescElement|SVGFEDistantLightElement|SVGFEDropShadowElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEMergeNodeElement|SVGFontElement|SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement|SVGGlyphElement|SVGGlyphRefElement|SVGGradientElement|SVGHKernElement|SVGLinearGradientElement|SVGMPathElement|SVGMarkerElement|SVGMetadataElement|SVGMissingGlyphElement|SVGRadialGradientElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStyleElement|SVGSymbolElement|SVGTitleElement|SVGVKernElement|SVGViewElement;SVGElement" }, SvgSvgElement: { "": "GraphicsElement;x=,y=", "%": "SVGSVGElement" }, TextContentElement: { "": "GraphicsElement;", "%": "SVGTextPathElement;SVGTextContentElement" }, TextPositioningElement: { "": "TextContentElement;x=,y=", "%": "SVGAltGlyphElement|SVGTSpanElement|SVGTextElement|SVGTextPositioningElement" }, UseElement: { "": "GraphicsElement;x=,y=", "%": "SVGUseElement" } }], ["dart.math", "dart:math", , P, { "": "", _JenkinsSmiHash_combine0: function(hash, value) { hash = 536870911 & C.JSInt_methods.$add(hash, value); hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0); return hash ^ hash >>> 6; }, min: function(a, b) { var t1; if (a > b) return b; if (a < b) return a; if (typeof a === "number") if (a === 0) return (a + b) * a * b; if (a === 0) t1 = b === 0 ? 1 / b < 0 : b < 0; else t1 = false; if (t1 || isNaN(b)) return b; return a; }, _JSRandom: { "": "Object;", nextDouble$0: function() { return Math.random(); } } }], ["dart.typed_data", "dart:typed_data", , P, { "": "", TypedData: { "": "Interceptor;", _invalidIndex$2: function(receiver, index, $length) { var t1 = J.getInterceptor$n(index); if (t1.$lt(index, 0) || t1.$ge(index, $length)) throw H.wrapException(P.RangeError$range(index, 0, $length)); else throw H.wrapException(P.ArgumentError$("Invalid list index " + H.S(index))); }, "%": ";ArrayBufferView;_NativeTypedArray|_NativeTypedArray_ListMixin|_NativeTypedArray_ListMixin_FixedLengthListMixin|_NativeTypedArrayOfInt" }, Uint8List: { "": "_NativeTypedArrayOfInt;", get$length: function(receiver) { return receiver.length; }, $index: function(receiver, index) { var t1, t2; t1 = receiver.length; if (!(index >>> 0 != index)) { if (typeof index !== "number") return index.$ge(); t2 = index >= t1; } else t2 = true; if (t2) this._invalidIndex$2(receiver, index, t1); return receiver[index]; }, $indexSet: function(receiver, index, value) { var t1 = receiver.length; if (index >>> 0 != index || J.$ge$n(index, t1)) this._invalidIndex$2(receiver, index, t1); receiver[index] = value; }, "%": ";Uint8Array" }, _NativeTypedArray: { "": "TypedData;", get$length: function(receiver) { return receiver.length; }, $isJavaScriptIndexingBehavior: true }, _NativeTypedArrayOfInt: { "": "_NativeTypedArray_ListMixin_FixedLengthListMixin;", $isList: true, $asList: function() { return [J.JSInt]; } }, _NativeTypedArray_ListMixin: { "": "_NativeTypedArray+ListMixin;", $isList: true, $asList: function() { return [J.JSInt]; } }, _NativeTypedArray_ListMixin_FixedLengthListMixin: { "": "_NativeTypedArray_ListMixin+FixedLengthListMixin;" } }], ["dart2js._js_primitives", "dart:_js_primitives", , H, { "": "", printString: function(string) { if (typeof dartPrint == "function") { dartPrint(string); return; } if (typeof console == "object" && typeof console.log == "function") { console.log(string); return; } if (typeof window == "object") return; if (typeof print == "function") { print(string); return; } throw "Unable to print message: " + String(string); } }], ]); Isolate.$finishClasses($$, $, null); $$ = null; // Runtime type support W.Node.$isNode = true; W.Node.$isObject = true; J.JSInt.$isint = true; J.JSInt.$isnum = true; J.JSInt.$isObject = true; J.JSNumber.$isnum = true; J.JSNumber.$isObject = true; J.JSString.$isString = true; J.JSString.$isObject = true; P.Duration.$isDuration = true; P.Duration.$isObject = true; Q.ClockNumber.$isObject = true; Q.Ball.$isObject = true; J.JSArray.$isObject = true; W.ImageElement.$isNode = true; W.ImageElement.$isObject = true; H.RawReceivePortImpl.$isObject = true; H._IsolateEvent.$isObject = true; H._IsolateContext.$isObject = true; P.Symbol.$isSymbol = true; P.Symbol.$isObject = true; P.StackTrace.$isStackTrace = true; P.StackTrace.$isObject = true; P.Object.$isObject = true; J.JSBool.$isbool = true; J.JSBool.$isObject = true; P._EventSink.$is_EventSink = true; P._EventSink.$isObject = true; P.Future.$isFuture = true; P.Future.$isObject = true; J.JSDouble.$isdouble = true; J.JSDouble.$isnum = true; J.JSDouble.$isObject = true; P._DelayedEvent.$is_DelayedEvent = true; P._DelayedEvent.$isObject = true; P.DateTime.$isDateTime = true; P.DateTime.$isObject = true; P.StreamSubscription.$isStreamSubscription = true; P.StreamSubscription.$isObject = true; $.$signature_args2 = {func: "args2", args: [null, null]}; $.$signature_args1 = {func: "args1", args: [null]}; // getInterceptor methods J.getInterceptor = function(receiver) { if (typeof receiver == "number") { if (Math.floor(receiver) == receiver) return J.JSInt.prototype; return J.JSDouble.prototype; } if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return J.JSNull.prototype; if (typeof receiver == "boolean") return J.JSBool.prototype; if (receiver.constructor == Array) return J.JSArray.prototype; if (typeof receiver != "object") return receiver; if (receiver instanceof P.Object) return receiver; return J.getNativeInterceptor(receiver); }; J.getInterceptor$asx = function(receiver) { if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (receiver.constructor == Array) return J.JSArray.prototype; if (typeof receiver != "object") return receiver; if (receiver instanceof P.Object) return receiver; return J.getNativeInterceptor(receiver); }; J.getInterceptor$ax = function(receiver) { if (receiver == null) return receiver; if (receiver.constructor == Array) return J.JSArray.prototype; if (typeof receiver != "object") return receiver; if (receiver instanceof P.Object) return receiver; return J.getNativeInterceptor(receiver); }; J.getInterceptor$n = function(receiver) { if (typeof receiver == "number") return J.JSNumber.prototype; if (receiver == null) return receiver; if (!(receiver instanceof P.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }; J.getInterceptor$ns = function(receiver) { if (typeof receiver == "number") return J.JSNumber.prototype; if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (!(receiver instanceof P.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }; J.getInterceptor$s = function(receiver) { if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (!(receiver instanceof P.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }; J.getInterceptor$x = function(receiver) { if (receiver == null) return receiver; if (typeof receiver != "object") return receiver; if (receiver instanceof P.Object) return receiver; return J.getNativeInterceptor(receiver); }; J.$add$ns = function(receiver, a0) { if (typeof receiver == "number" && typeof a0 == "number") return receiver + a0; return J.getInterceptor$ns(receiver).$add(receiver, a0); }; J.$eq = function(receiver, a0) { if (receiver == null) return a0 == null; if (typeof receiver != "object") return a0 != null && receiver === a0; return J.getInterceptor(receiver).$eq(receiver, a0); }; J.$ge$n = function(receiver, a0) { if (typeof receiver == "number" && typeof a0 == "number") return receiver >= a0; return J.getInterceptor$n(receiver).$ge(receiver, a0); }; J.$index$asx = function(receiver, a0) { if (receiver.constructor == Array || typeof receiver == "string" || H.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) if (a0 >>> 0 === a0 && a0 < receiver.length) return receiver[a0]; return J.getInterceptor$asx(receiver).$index(receiver, a0); }; J.$indexSet$ax = function(receiver, a0, a1) { if ((receiver.constructor == Array || H.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) && !receiver.immutable$list && a0 >>> 0 === a0 && a0 < receiver.length) return receiver[a0] = a1; return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); }; J.forEach$1$ax = function(receiver, a0) { return J.getInterceptor$ax(receiver).forEach$1(receiver, a0); }; J.get$error$x = function(receiver) { return J.getInterceptor$x(receiver).get$error(receiver); }; J.get$hashCode$ = function(receiver) { return J.getInterceptor(receiver).get$hashCode(receiver); }; J.get$iterator$ax = function(receiver) { return J.getInterceptor$ax(receiver).get$iterator(receiver); }; J.get$length$asx = function(receiver) { return J.getInterceptor$asx(receiver).get$length(receiver); }; J.roundToDouble$0$n = function(receiver) { return J.getInterceptor$n(receiver).roundToDouble$0(receiver); }; J.set$bottom$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$bottom(receiver, value); }; J.set$left$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$left(receiver, value); }; J.set$position$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$position(receiver, value); }; J.set$right$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$right(receiver, value); }; J.set$src$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$src(receiver, value); }; J.set$textAlign$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$textAlign(receiver, value); }; J.set$top$x = function(receiver, value) { return J.getInterceptor$x(receiver).set$top(receiver, value); }; J.toString$0 = function(receiver) { return J.getInterceptor(receiver).toString$0(receiver); }; C.C_DynamicRuntimeType = new H.DynamicRuntimeType(); C.C__DelayedDone = new P._DelayedDone(); C.C__JSRandom = new P._JSRandom(); C.C__RootZone = new P._RootZone(); C.Duration_0 = new P.Duration(0); C.JSArray_methods = J.JSArray.prototype; C.JSInt_methods = J.JSInt.prototype; C.JSNumber_methods = J.JSNumber.prototype; C.JSString_methods = J.JSString.prototype; C.JS_CONST_0 = function(hooks) { if (typeof dartExperimentalFixupGetTag != "function") return hooks; hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); }; C.JS_CONST_Fs4 = function(hooks) { return hooks; } ; C.JS_CONST_IX5 = function getTagFallback(o) { var constructor = o.constructor; if (typeof constructor == "function") { var name = constructor.name; if (typeof name == "string" && name !== "" && name !== "Object" && name !== "Function.prototype") { return name; } } var s = Object.prototype.toString.call(o); return s.substring(8, s.length - 1); }; C.JS_CONST_QJm = function(getTagFallback) { return function(hooks) { if (typeof navigator != "object") return hooks; var ua = navigator.userAgent; if (ua.indexOf("DumpRenderTree") >= 0) return hooks; if (ua.indexOf("Chrome") >= 0) { function confirm(p) { return typeof window == "object" && window[p] && window[p].name == p; } if (confirm("Window") && confirm("HTMLElement")) return hooks; } hooks.getTag = getTagFallback; }; }; C.JS_CONST_U4w = function(hooks) { var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; if (userAgent.indexOf("Firefox") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { "BeforeUnloadEvent": "Event", "DataTransfer": "Clipboard", "GeoGeolocation": "Geolocation", "WorkerMessageEvent": "MessageEvent", "XMLDocument": "!Document"}; function getTagFirefox(o) { var tag = getTag(o); return quickMap[tag] || tag; } hooks.getTag = getTagFirefox; }; C.JS_CONST_aQP = function() { function typeNameInChrome(o) { var name = o.constructor.name; if (name) return name; var s = Object.prototype.toString.call(o); return s.substring(8, s.length - 1); } function getUnknownTag(object, tag) { if (/^HTML[A-Z].*Element$/.test(tag)) { var name = Object.prototype.toString.call(object); if (name == "[object Object]") return null; return "HTMLElement"; } } function getUnknownTagGenericBrowser(object, tag) { if (object instanceof HTMLElement) return "HTMLElement"; return getUnknownTag(object, tag); } function prototypeForTag(tag) { if (typeof window == "undefined") return null; if (typeof window[tag] == "undefined") return null; var constructor = window[tag]; if (typeof constructor != "function") return null; return constructor.prototype; } function discriminator(tag) { return null; } var isBrowser = typeof navigator == "object"; return { getTag: typeNameInChrome, getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, prototypeForTag: prototypeForTag, discriminator: discriminator }; }; C.JS_CONST_gkc = function(hooks) { var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; if (userAgent.indexOf("Trident/") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { "BeforeUnloadEvent": "Event", "DataTransfer": "Clipboard", "HTMLDDElement": "HTMLElement", "HTMLDTElement": "HTMLElement", "HTMLPhraseElement": "HTMLElement", "Position": "Geoposition" }; function getTagIE(o) { var tag = getTag(o); var newTag = quickMap[tag]; if (newTag) return newTag; if (tag == "Object") { if (window.DataView && (o instanceof window.DataView)) return "DataView"; } return tag; } function prototypeForTagIE(tag) { var constructor = window[tag]; if (constructor == null) return null; return constructor.prototype; } hooks.getTag = getTagIE; hooks.prototypeForTag = prototypeForTagIE; }; C.JS_CONST_rr7 = function(hooks) { var getTag = hooks.getTag; var prototypeForTag = hooks.prototypeForTag; function getTagFixed(o) { var tag = getTag(o); if (tag == "Document") { if (!!o.xmlVersion) return "!Document"; return "!HTMLDocument"; } return tag; } function prototypeForTagFixed(tag) { if (tag == "Document") return null; return prototypeForTag(tag); } hooks.getTag = getTagFixed; hooks.prototypeForTag = prototypeForTagFixed; }; Isolate.makeConstantList = function(list) { list.immutable$list = init; list.fixed$length = init; return list; }; C.List_8eb = Isolate.makeConstantList(["images/ball-d9d9d9.png", "images/ball-009a49.png", "images/ball-13acfa.png", "images/ball-265897.png", "images/ball-b6b4b5.png", "images/ball-c0000b.png", "images/ball-c9c9c9.png"]); C.List_1_1_1_1 = Isolate.makeConstantList([1, 1, 1, 1]); C.List_1_0_0_1 = Isolate.makeConstantList([1, 0, 0, 1]); C.List_Xdq = Isolate.makeConstantList([C.List_1_1_1_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1]); C.List_0_0_0_1 = Isolate.makeConstantList([0, 0, 0, 1]); C.List_Xdq0 = Isolate.makeConstantList([C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1]); C.List_1_0_0_0 = Isolate.makeConstantList([1, 0, 0, 0]); C.List_Xdq1 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_1_1_1_1, C.List_1_0_0_0, C.List_1_0_0_0, C.List_1_1_1_1]); C.List_Xdq2 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_1_1_1_1]); C.List_Xdq3 = Isolate.makeConstantList([C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1]); C.List_Xdq4 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_1_0_0_0, C.List_1_0_0_0, C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_1_1_1_1]); C.List_Xdq5 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_1_0_0_0, C.List_1_0_0_0, C.List_1_1_1_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1]); C.List_Xdq6 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_0_0_0_1]); C.List_Xdq7 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1]); C.List_Xdq8 = Isolate.makeConstantList([C.List_1_1_1_1, C.List_1_0_0_1, C.List_1_0_0_1, C.List_1_1_1_1, C.List_0_0_0_1, C.List_0_0_0_1, C.List_1_1_1_1]); C.List_e3I = Isolate.makeConstantList([C.List_Xdq, C.List_Xdq0, C.List_Xdq1, C.List_Xdq2, C.List_Xdq3, C.List_Xdq4, C.List_Xdq5, C.List_Xdq6, C.List_Xdq7, C.List_Xdq8]); C.Type_6Vn = H.createRuntimeType('_NativeTypedArray'); C.Type_Hp8 = H.createRuntimeType('_NativeTypedArrayOfInt'); C.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; C.Window_methods = W.Window.prototype; $.controlPort = null; $.RawReceivePortImpl__nextFreeId = 1; $.Primitives_mirrorFunctionCacheName = "$cachedFunction"; $.Primitives_mirrorInvokeCacheName = "$cachedInvocation"; $.Closure_functionCounter = 0; $.BoundClosure_selfFieldNameCache = null; $.BoundClosure_receiverFieldNameCache = null; $.RuntimeFunctionType_inAssert = false; $.getTagFunction = null; $.alternateTagFunction = null; $.prototypeForTagFunction = null; $.dispatchRecordsForInstanceTags = null; $.interceptorsForUncacheableTags = null; $.initNativeDispatchFlag = null; $.Ball_random = null; $.fpsAverage = null; $.printToZone = null; $._callbacksAreEnqueued = false; $.Zone__current = C.C__RootZone; $.Expando__keyCount = 0; $.Device__isOpera = null; $.Device__isWebKit = null; Isolate.$lazy($, "globalThis", "globalThis", "get$globalThis", function() { return function() { return this; }(); }); Isolate.$lazy($, "globalWindow", "globalWindow", "get$globalWindow", function() { return $.get$globalThis().window; }); Isolate.$lazy($, "globalWorker", "globalWorker", "get$globalWorker", function() { return $.get$globalThis().Worker; }); Isolate.$lazy($, "globalPostMessageDefined", "globalPostMessageDefined", "get$globalPostMessageDefined", function() { return $.get$globalThis().postMessage !== void 0; }); Isolate.$lazy($, "thisScript", "IsolateNatives_thisScript", "get$IsolateNatives_thisScript", function() { return H.IsolateNatives_computeThisScript(); }); Isolate.$lazy($, "workerIds", "IsolateNatives_workerIds", "get$IsolateNatives_workerIds", function() { return new P.Expando(null); }); Isolate.$lazy($, "noSuchMethodPattern", "TypeErrorDecoder_noSuchMethodPattern", "get$TypeErrorDecoder_noSuchMethodPattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokeCallErrorOn({ toString: function() { return "$receiver$"; } })); }); Isolate.$lazy($, "notClosurePattern", "TypeErrorDecoder_notClosurePattern", "get$TypeErrorDecoder_notClosurePattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokeCallErrorOn({ $method$: null, toString: function() { return "$receiver$"; } })); }); Isolate.$lazy($, "nullCallPattern", "TypeErrorDecoder_nullCallPattern", "get$TypeErrorDecoder_nullCallPattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokeCallErrorOn(null)); }); Isolate.$lazy($, "nullLiteralCallPattern", "TypeErrorDecoder_nullLiteralCallPattern", "get$TypeErrorDecoder_nullLiteralCallPattern", function() { return H.TypeErrorDecoder_extractPattern(function() { var $argumentsExpr$ = '$arguments$' try { null.$method$($argumentsExpr$); } catch (e) { return e.message; } }()); }); Isolate.$lazy($, "undefinedCallPattern", "TypeErrorDecoder_undefinedCallPattern", "get$TypeErrorDecoder_undefinedCallPattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokeCallErrorOn(void 0)); }); Isolate.$lazy($, "undefinedLiteralCallPattern", "TypeErrorDecoder_undefinedLiteralCallPattern", "get$TypeErrorDecoder_undefinedLiteralCallPattern", function() { return H.TypeErrorDecoder_extractPattern(function() { var $argumentsExpr$ = '$arguments$' try { (void 0).$method$($argumentsExpr$); } catch (e) { return e.message; } }()); }); Isolate.$lazy($, "nullPropertyPattern", "TypeErrorDecoder_nullPropertyPattern", "get$TypeErrorDecoder_nullPropertyPattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokePropertyErrorOn(null)); }); Isolate.$lazy($, "nullLiteralPropertyPattern", "TypeErrorDecoder_nullLiteralPropertyPattern", "get$TypeErrorDecoder_nullLiteralPropertyPattern", function() { return H.TypeErrorDecoder_extractPattern(function() { try { null.$method$; } catch (e) { return e.message; } }()); }); Isolate.$lazy($, "undefinedPropertyPattern", "TypeErrorDecoder_undefinedPropertyPattern", "get$TypeErrorDecoder_undefinedPropertyPattern", function() { return H.TypeErrorDecoder_extractPattern(H.TypeErrorDecoder_provokePropertyErrorOn(void 0)); }); Isolate.$lazy($, "undefinedLiteralPropertyPattern", "TypeErrorDecoder_undefinedLiteralPropertyPattern", "get$TypeErrorDecoder_undefinedLiteralPropertyPattern", function() { return H.TypeErrorDecoder_extractPattern(function() { try { (void 0).$method$; } catch (e) { return e.message; } }()); }); Isolate.$lazy($, "_toStringList", "IterableMixinWorkaround__toStringList", "get$IterableMixinWorkaround__toStringList", function() { return []; }); Isolate.$lazy($, "_asyncCallbacks", "_asyncCallbacks", "get$_asyncCallbacks", function() { var t1, t2; t1 = {func: "void_", void: true}; t2 = H.setRuntimeTypeInfo(new P.ListQueue(null, 0, 0, 0), [t1]); t2.ListQueue$1(null, t1); return t2; }); Isolate.$lazy($, "_toStringVisiting", "_toStringVisiting", "get$_toStringVisiting", function() { return P.HashSet_HashSet$identity(null); }); Isolate.$lazy($, "_toStringList", "Maps__toStringList", "get$Maps__toStringList", function() { return []; }); // Native classes init.functionAliases = {}; ; init.metadata = [{func: "void_", void: true}, {func: "void__dynamic", void: true, args: [null]}, {func: "void__dynamic__StackTrace", void: true, args: [null], opt: [P.StackTrace]}, , {func: "bool__dynamic_dynamic", ret: J.JSBool, args: [null, null]}, {func: "int__dynamic", ret: J.JSInt, args: [null]}, {func: "bool__Object_Object", ret: J.JSBool, args: [P.Object, P.Object]}, {func: "int__Object", ret: J.JSInt, args: [P.Object]}, {func: "args0"}, {func: "args2", args: [null, null]}, {func: "args1", args: [null]}, {func: "dynamic__dynamic_String", args: [null, J.JSString]}, {func: "dynamic__String", args: [J.JSString]}, {func: "void__num", void: true, args: [J.JSNumber]}, {func: "dynamic__dynamic__dynamic", args: [null], opt: [null]}, {func: "dynamic__dynamic_StackTrace", args: [null, P.StackTrace]}, {func: "dynamic__Symbol_dynamic", args: [P.Symbol, null]}, {func: "String__int", ret: J.JSString, args: [J.JSInt]}, ]; $ = null; Isolate = Isolate.$finishIsolateConstructor(Isolate); $ = new Isolate(); function convertToFastObject(properties) { function MyClass() {}; MyClass.prototype = properties; new MyClass(); return properties; } A = convertToFastObject(A); B = convertToFastObject(B); C = convertToFastObject(C); D = convertToFastObject(D); E = convertToFastObject(E); F = convertToFastObject(F); G = convertToFastObject(G); H = convertToFastObject(H); J = convertToFastObject(J); K = convertToFastObject(K); L = convertToFastObject(L); M = convertToFastObject(M); N = convertToFastObject(N); O = convertToFastObject(O); P = convertToFastObject(P); Q = convertToFastObject(Q); R = convertToFastObject(R); S = convertToFastObject(S); T = convertToFastObject(T); U = convertToFastObject(U); V = convertToFastObject(V); W = convertToFastObject(W); X = convertToFastObject(X); Y = convertToFastObject(Y); Z = convertToFastObject(Z); !function() { var objectProto = Object.prototype; for (var i = 0;; i++) { var property = "___dart_dispatch_record_ZxYxX_0_"; if (i > 0) property = rootProperty + "_" + i; if (!(property in objectProto)) return init.dispatchPropertyName = property; } }(); // BEGIN invoke [main]. ;(function (callback) { if (typeof document === "undefined") { callback(null); return; } if (document.currentScript) { callback(document.currentScript); return; } var scripts = document.scripts; function onLoad(event) { for (var i = 0; i < scripts.length; ++i) { scripts[i].removeEventListener("load", onLoad, false); } callback(event.target); } for (var i = 0; i < scripts.length; ++i) { scripts[i].addEventListener("load", onLoad, false); } })(function(currentScript) { init.currentScript = currentScript; if (typeof dartMainRunner === "function") { dartMainRunner(function() { H.startRootIsolate(Q.main$closure()); }); } else { H.startRootIsolate(Q.main$closure()); } }); // END invoke [main]. function init() { Isolate.$isolateProperties = {}; function generateAccessor(fieldDescriptor, accessors, cls) { var fieldInformation = fieldDescriptor.split("-"); var field = fieldInformation[0]; var len = field.length; var code = field.charCodeAt(len - 1); var reflectable; if (fieldInformation.length > 1) reflectable = true; else reflectable = false; code = code >= 60 && code <= 64 ? code - 59 : code >= 123 && code <= 126 ? code - 117 : code >= 37 && code <= 43 ? code - 27 : 0; if (code) { var getterCode = code & 3; var setterCode = code >> 2; var accessorName = field = field.substring(0, len - 1); var divider = field.indexOf(":"); if (divider > 0) { accessorName = field.substring(0, divider); field = field.substring(divider + 1); } if (getterCode) { var args = getterCode & 2 ? "receiver" : ""; var receiver = getterCode & 1 ? "this" : "receiver"; var body = "return " + receiver + "." + field; var property = cls + ".prototype.get$" + accessorName + "="; var fn = "function(" + args + "){" + body + "}"; if (reflectable) accessors.push(property + "$reflectable(" + fn + ");\n"); else accessors.push(property + fn + ";\n"); } if (setterCode) { var args = setterCode & 2 ? "receiver, value" : "value"; var receiver = setterCode & 1 ? "this" : "receiver"; var body = receiver + "." + field + " = value"; var property = cls + ".prototype.set$" + accessorName + "="; var fn = "function(" + args + "){" + body + "}"; if (reflectable) accessors.push(property + "$reflectable(" + fn + ");\n"); else accessors.push(property + fn + ";\n"); } } return field; } Isolate.$isolateProperties.$generateAccessor = generateAccessor; function defineClass(name, cls, fields) { var accessors = []; var str = "function " + cls + "("; var body = ""; for (var i = 0; i < fields.length; i++) { if (i != 0) str += ", "; var field = generateAccessor(fields[i], accessors, cls); var parameter = "parameter_" + field; str += parameter; body += "this." + field + " = " + parameter + ";\n"; } str += ") {\n" + body + "}\n"; str += cls + ".builtin$cls=\"" + name + "\";\n"; str += "$desc=$collectedClasses." + cls + ";\n"; str += "if($desc instanceof Array) $desc = $desc[1];\n"; str += cls + ".prototype = $desc;\n"; if (typeof defineClass.name != "string") { str += cls + ".name=\"" + cls + "\";\n"; } str += accessors.join(""); return str; } var inheritFrom = function() { function tmp() { } var hasOwnProperty = Object.prototype.hasOwnProperty; return function(constructor, superConstructor) { tmp.prototype = superConstructor.prototype; var object = new tmp(); var properties = constructor.prototype; for (var member in properties) if (hasOwnProperty.call(properties, member)) object[member] = properties[member]; object.constructor = constructor; constructor.prototype = object; return object; }; }(); Isolate.$finishClasses = function(collectedClasses, isolateProperties, existingIsolateProperties) { var pendingClasses = {}; if (!init.allClasses) init.allClasses = {}; var allClasses = init.allClasses; var hasOwnProperty = Object.prototype.hasOwnProperty; if (typeof dart_precompiled == "function") { var constructors = dart_precompiled(collectedClasses); } else { var combinedConstructorFunction = "function $reflectable(fn){fn.$reflectable=1;return fn};\n" + "var $desc;\n"; var constructorsList = []; } for (var cls in collectedClasses) { if (hasOwnProperty.call(collectedClasses, cls)) { var desc = collectedClasses[cls]; if (desc instanceof Array) desc = desc[1]; var classData = desc[""], supr, name = cls, fields = classData; if (typeof classData == "string") { var split = classData.split("/"); if (split.length == 2) { name = split[0]; fields = split[1]; } } var s = fields.split(";"); fields = s[1] == "" ? [] : s[1].split(","); supr = s[0]; split = supr.split(":"); if (split.length == 2) { supr = split[0]; var functionSignature = split[1]; if (functionSignature) desc.$signature = function(s) { return function() { return init.metadata[s]; }; }(functionSignature); } if (supr && supr.indexOf("+") > 0) { s = supr.split("+"); supr = s[0]; var mixin = collectedClasses[s[1]]; if (mixin instanceof Array) mixin = mixin[1]; for (var d in mixin) { if (hasOwnProperty.call(mixin, d) && !hasOwnProperty.call(desc, d)) desc[d] = mixin[d]; } } if (typeof dart_precompiled != "function") { combinedConstructorFunction += defineClass(name, cls, fields); constructorsList.push(cls); } if (supr) pendingClasses[cls] = supr; } } if (typeof dart_precompiled != "function") { combinedConstructorFunction += "return [\n " + constructorsList.join(",\n ") + "\n]"; var constructors = new Function("$collectedClasses", combinedConstructorFunction)(collectedClasses); combinedConstructorFunction = null; } for (var i = 0; i < constructors.length; i++) { var constructor = constructors[i]; var cls = constructor.name; var desc = collectedClasses[cls]; var globalObject = isolateProperties; if (desc instanceof Array) { globalObject = desc[0] || isolateProperties; desc = desc[1]; } allClasses[cls] = constructor; globalObject[cls] = constructor; } constructors = null; var finishedClasses = {}; init.interceptorsByTag = Object.create(null); init.leafTags = {}; function finishClass(cls) { var hasOwnProperty = Object.prototype.hasOwnProperty; if (hasOwnProperty.call(finishedClasses, cls)) return; finishedClasses[cls] = true; var superclass = pendingClasses[cls]; if (!superclass || typeof superclass != "string") return; finishClass(superclass); var constructor = allClasses[cls]; var superConstructor = allClasses[superclass]; if (!superConstructor) superConstructor = existingIsolateProperties[superclass]; var prototype = inheritFrom(constructor, superConstructor); if (hasOwnProperty.call(prototype, "%")) { var nativeSpec = prototype["%"].split(";"); if (nativeSpec[0]) { var tags = nativeSpec[0].split("|"); for (var i = 0; i < tags.length; i++) { init.interceptorsByTag[tags[i]] = constructor; init.leafTags[tags[i]] = true; } } if (nativeSpec[1]) { tags = nativeSpec[1].split("|"); if (nativeSpec[2]) { var subclasses = nativeSpec[2].split("|"); for (var i = 0; i < subclasses.length; i++) { var subclass = allClasses[subclasses[i]]; subclass.$nativeSuperclassTag = tags[0]; } } for (i = 0; i < tags.length; i++) { init.interceptorsByTag[tags[i]] = constructor; init.leafTags[tags[i]] = false; } } } } for (var cls in pendingClasses) finishClass(cls); }; Isolate.$lazy = function(prototype, staticName, fieldName, getterName, lazyValue) { var sentinelUndefined = {}; var sentinelInProgress = {}; prototype[fieldName] = sentinelUndefined; prototype[getterName] = function() { var result = $[fieldName]; try { if (result === sentinelUndefined) { $[fieldName] = sentinelInProgress; try { result = $[fieldName] = lazyValue(); } finally { if (result === sentinelUndefined) { if ($[fieldName] === sentinelInProgress) { $[fieldName] = null; } } } } else { if (result === sentinelInProgress) H.throwCyclicInit(staticName); } return result; } finally { $[getterName] = function() { return this[fieldName]; }; } }; }; Isolate.$finishIsolateConstructor = function(oldIsolate) { var isolateProperties = oldIsolate.$isolateProperties; function Isolate() { var hasOwnProperty = Object.prototype.hasOwnProperty; for (var staticName in isolateProperties) if (hasOwnProperty.call(isolateProperties, staticName)) this[staticName] = isolateProperties[staticName]; function ForceEfficientMap() { } ForceEfficientMap.prototype = this; new ForceEfficientMap(); } Isolate.prototype = oldIsolate.prototype; Isolate.prototype.constructor = Isolate; Isolate.$isolateProperties = isolateProperties; Isolate.$finishClasses = oldIsolate.$finishClasses; Isolate.makeConstantList = oldIsolate.makeConstantList; return Isolate; }; } })() function dart_precompiled($collectedClasses) { var $desc; function HtmlElement() { } HtmlElement.builtin$cls = "HtmlElement"; if (!"name" in HtmlElement) HtmlElement.name = "HtmlElement"; $desc = $collectedClasses.HtmlElement; if ($desc instanceof Array) $desc = $desc[1]; HtmlElement.prototype = $desc; function AnchorElement() { } AnchorElement.builtin$cls = "AnchorElement"; if (!"name" in AnchorElement) AnchorElement.name = "AnchorElement"; $desc = $collectedClasses.AnchorElement; if ($desc instanceof Array) $desc = $desc[1]; AnchorElement.prototype = $desc; function AnimationEvent() { } AnimationEvent.builtin$cls = "AnimationEvent"; if (!"name" in AnimationEvent) AnimationEvent.name = "AnimationEvent"; $desc = $collectedClasses.AnimationEvent; if ($desc instanceof Array) $desc = $desc[1]; AnimationEvent.prototype = $desc; function AreaElement() { } AreaElement.builtin$cls = "AreaElement"; if (!"name" in AreaElement) AreaElement.name = "AreaElement"; $desc = $collectedClasses.AreaElement; if ($desc instanceof Array) $desc = $desc[1]; AreaElement.prototype = $desc; function AudioElement() { } AudioElement.builtin$cls = "AudioElement"; if (!"name" in AudioElement) AudioElement.name = "AudioElement"; $desc = $collectedClasses.AudioElement; if ($desc instanceof Array) $desc = $desc[1]; AudioElement.prototype = $desc; function AutocompleteErrorEvent() { } AutocompleteErrorEvent.builtin$cls = "AutocompleteErrorEvent"; if (!"name" in AutocompleteErrorEvent) AutocompleteErrorEvent.name = "AutocompleteErrorEvent"; $desc = $collectedClasses.AutocompleteErrorEvent; if ($desc instanceof Array) $desc = $desc[1]; AutocompleteErrorEvent.prototype = $desc; function BRElement() { } BRElement.builtin$cls = "BRElement"; if (!"name" in BRElement) BRElement.name = "BRElement"; $desc = $collectedClasses.BRElement; if ($desc instanceof Array) $desc = $desc[1]; BRElement.prototype = $desc; function BaseElement() { } BaseElement.builtin$cls = "BaseElement"; if (!"name" in BaseElement) BaseElement.name = "BaseElement"; $desc = $collectedClasses.BaseElement; if ($desc instanceof Array) $desc = $desc[1]; BaseElement.prototype = $desc; function BeforeLoadEvent() { } BeforeLoadEvent.builtin$cls = "BeforeLoadEvent"; if (!"name" in BeforeLoadEvent) BeforeLoadEvent.name = "BeforeLoadEvent"; $desc = $collectedClasses.BeforeLoadEvent; if ($desc instanceof Array) $desc = $desc[1]; BeforeLoadEvent.prototype = $desc; function BeforeUnloadEvent() { } BeforeUnloadEvent.builtin$cls = "BeforeUnloadEvent"; if (!"name" in BeforeUnloadEvent) BeforeUnloadEvent.name = "BeforeUnloadEvent"; $desc = $collectedClasses.BeforeUnloadEvent; if ($desc instanceof Array) $desc = $desc[1]; BeforeUnloadEvent.prototype = $desc; function BodyElement() { } BodyElement.builtin$cls = "BodyElement"; if (!"name" in BodyElement) BodyElement.name = "BodyElement"; $desc = $collectedClasses.BodyElement; if ($desc instanceof Array) $desc = $desc[1]; BodyElement.prototype = $desc; function ButtonElement() { } ButtonElement.builtin$cls = "ButtonElement"; if (!"name" in ButtonElement) ButtonElement.name = "ButtonElement"; $desc = $collectedClasses.ButtonElement; if ($desc instanceof Array) $desc = $desc[1]; ButtonElement.prototype = $desc; function CDataSection() { } CDataSection.builtin$cls = "CDataSection"; if (!"name" in CDataSection) CDataSection.name = "CDataSection"; $desc = $collectedClasses.CDataSection; if ($desc instanceof Array) $desc = $desc[1]; CDataSection.prototype = $desc; function CanvasElement() { } CanvasElement.builtin$cls = "CanvasElement"; if (!"name" in CanvasElement) CanvasElement.name = "CanvasElement"; $desc = $collectedClasses.CanvasElement; if ($desc instanceof Array) $desc = $desc[1]; CanvasElement.prototype = $desc; function CharacterData() { } CharacterData.builtin$cls = "CharacterData"; if (!"name" in CharacterData) CharacterData.name = "CharacterData"; $desc = $collectedClasses.CharacterData; if ($desc instanceof Array) $desc = $desc[1]; CharacterData.prototype = $desc; CharacterData.prototype.get$length = function(receiver) { return receiver.length; }; function CloseEvent() { } CloseEvent.builtin$cls = "CloseEvent"; if (!"name" in CloseEvent) CloseEvent.name = "CloseEvent"; $desc = $collectedClasses.CloseEvent; if ($desc instanceof Array) $desc = $desc[1]; CloseEvent.prototype = $desc; function Comment() { } Comment.builtin$cls = "Comment"; if (!"name" in Comment) Comment.name = "Comment"; $desc = $collectedClasses.Comment; if ($desc instanceof Array) $desc = $desc[1]; Comment.prototype = $desc; function CompositionEvent() { } CompositionEvent.builtin$cls = "CompositionEvent"; if (!"name" in CompositionEvent) CompositionEvent.name = "CompositionEvent"; $desc = $collectedClasses.CompositionEvent; if ($desc instanceof Array) $desc = $desc[1]; CompositionEvent.prototype = $desc; function ContentElement() { } ContentElement.builtin$cls = "ContentElement"; if (!"name" in ContentElement) ContentElement.name = "ContentElement"; $desc = $collectedClasses.ContentElement; if ($desc instanceof Array) $desc = $desc[1]; ContentElement.prototype = $desc; function CssFontFaceLoadEvent() { } CssFontFaceLoadEvent.builtin$cls = "CssFontFaceLoadEvent"; if (!"name" in CssFontFaceLoadEvent) CssFontFaceLoadEvent.name = "CssFontFaceLoadEvent"; $desc = $collectedClasses.CssFontFaceLoadEvent; if ($desc instanceof Array) $desc = $desc[1]; CssFontFaceLoadEvent.prototype = $desc; function CssStyleDeclaration() { } CssStyleDeclaration.builtin$cls = "CssStyleDeclaration"; if (!"name" in CssStyleDeclaration) CssStyleDeclaration.name = "CssStyleDeclaration"; $desc = $collectedClasses.CssStyleDeclaration; if ($desc instanceof Array) $desc = $desc[1]; CssStyleDeclaration.prototype = $desc; CssStyleDeclaration.prototype.get$length = function(receiver) { return receiver.length; }; function CustomEvent() { } CustomEvent.builtin$cls = "CustomEvent"; if (!"name" in CustomEvent) CustomEvent.name = "CustomEvent"; $desc = $collectedClasses.CustomEvent; if ($desc instanceof Array) $desc = $desc[1]; CustomEvent.prototype = $desc; function DListElement() { } DListElement.builtin$cls = "DListElement"; if (!"name" in DListElement) DListElement.name = "DListElement"; $desc = $collectedClasses.DListElement; if ($desc instanceof Array) $desc = $desc[1]; DListElement.prototype = $desc; function DataListElement() { } DataListElement.builtin$cls = "DataListElement"; if (!"name" in DataListElement) DataListElement.name = "DataListElement"; $desc = $collectedClasses.DataListElement; if ($desc instanceof Array) $desc = $desc[1]; DataListElement.prototype = $desc; function DetailsElement() { } DetailsElement.builtin$cls = "DetailsElement"; if (!"name" in DetailsElement) DetailsElement.name = "DetailsElement"; $desc = $collectedClasses.DetailsElement; if ($desc instanceof Array) $desc = $desc[1]; DetailsElement.prototype = $desc; function DeviceMotionEvent() { } DeviceMotionEvent.builtin$cls = "DeviceMotionEvent"; if (!"name" in DeviceMotionEvent) DeviceMotionEvent.name = "DeviceMotionEvent"; $desc = $collectedClasses.DeviceMotionEvent; if ($desc instanceof Array) $desc = $desc[1]; DeviceMotionEvent.prototype = $desc; function DeviceOrientationEvent() { } DeviceOrientationEvent.builtin$cls = "DeviceOrientationEvent"; if (!"name" in DeviceOrientationEvent) DeviceOrientationEvent.name = "DeviceOrientationEvent"; $desc = $collectedClasses.DeviceOrientationEvent; if ($desc instanceof Array) $desc = $desc[1]; DeviceOrientationEvent.prototype = $desc; function DialogElement() { } DialogElement.builtin$cls = "DialogElement"; if (!"name" in DialogElement) DialogElement.name = "DialogElement"; $desc = $collectedClasses.DialogElement; if ($desc instanceof Array) $desc = $desc[1]; DialogElement.prototype = $desc; function DivElement() { } DivElement.builtin$cls = "DivElement"; if (!"name" in DivElement) DivElement.name = "DivElement"; $desc = $collectedClasses.DivElement; if ($desc instanceof Array) $desc = $desc[1]; DivElement.prototype = $desc; function Document() { } Document.builtin$cls = "Document"; if (!"name" in Document) Document.name = "Document"; $desc = $collectedClasses.Document; if ($desc instanceof Array) $desc = $desc[1]; Document.prototype = $desc; function DocumentFragment() { } DocumentFragment.builtin$cls = "DocumentFragment"; if (!"name" in DocumentFragment) DocumentFragment.name = "DocumentFragment"; $desc = $collectedClasses.DocumentFragment; if ($desc instanceof Array) $desc = $desc[1]; DocumentFragment.prototype = $desc; function DocumentType() { } DocumentType.builtin$cls = "DocumentType"; if (!"name" in DocumentType) DocumentType.name = "DocumentType"; $desc = $collectedClasses.DocumentType; if ($desc instanceof Array) $desc = $desc[1]; DocumentType.prototype = $desc; function DomError() { } DomError.builtin$cls = "DomError"; if (!"name" in DomError) DomError.name = "DomError"; $desc = $collectedClasses.DomError; if ($desc instanceof Array) $desc = $desc[1]; DomError.prototype = $desc; function DomException() { } DomException.builtin$cls = "DomException"; if (!"name" in DomException) DomException.name = "DomException"; $desc = $collectedClasses.DomException; if ($desc instanceof Array) $desc = $desc[1]; DomException.prototype = $desc; function Element() { } Element.builtin$cls = "Element"; if (!"name" in Element) Element.name = "Element"; $desc = $collectedClasses.Element; if ($desc instanceof Array) $desc = $desc[1]; Element.prototype = $desc; function EmbedElement() { } EmbedElement.builtin$cls = "EmbedElement"; if (!"name" in EmbedElement) EmbedElement.name = "EmbedElement"; $desc = $collectedClasses.EmbedElement; if ($desc instanceof Array) $desc = $desc[1]; EmbedElement.prototype = $desc; EmbedElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function ErrorEvent() { } ErrorEvent.builtin$cls = "ErrorEvent"; if (!"name" in ErrorEvent) ErrorEvent.name = "ErrorEvent"; $desc = $collectedClasses.ErrorEvent; if ($desc instanceof Array) $desc = $desc[1]; ErrorEvent.prototype = $desc; ErrorEvent.prototype.get$error = function(receiver) { return receiver.error; }; function Event() { } Event.builtin$cls = "Event"; if (!"name" in Event) Event.name = "Event"; $desc = $collectedClasses.Event; if ($desc instanceof Array) $desc = $desc[1]; Event.prototype = $desc; function EventTarget() { } EventTarget.builtin$cls = "EventTarget"; if (!"name" in EventTarget) EventTarget.name = "EventTarget"; $desc = $collectedClasses.EventTarget; if ($desc instanceof Array) $desc = $desc[1]; EventTarget.prototype = $desc; function FieldSetElement() { } FieldSetElement.builtin$cls = "FieldSetElement"; if (!"name" in FieldSetElement) FieldSetElement.name = "FieldSetElement"; $desc = $collectedClasses.FieldSetElement; if ($desc instanceof Array) $desc = $desc[1]; FieldSetElement.prototype = $desc; function FileError() { } FileError.builtin$cls = "FileError"; if (!"name" in FileError) FileError.name = "FileError"; $desc = $collectedClasses.FileError; if ($desc instanceof Array) $desc = $desc[1]; FileError.prototype = $desc; function FocusEvent() { } FocusEvent.builtin$cls = "FocusEvent"; if (!"name" in FocusEvent) FocusEvent.name = "FocusEvent"; $desc = $collectedClasses.FocusEvent; if ($desc instanceof Array) $desc = $desc[1]; FocusEvent.prototype = $desc; function FormElement() { } FormElement.builtin$cls = "FormElement"; if (!"name" in FormElement) FormElement.name = "FormElement"; $desc = $collectedClasses.FormElement; if ($desc instanceof Array) $desc = $desc[1]; FormElement.prototype = $desc; FormElement.prototype.get$length = function(receiver) { return receiver.length; }; function HRElement() { } HRElement.builtin$cls = "HRElement"; if (!"name" in HRElement) HRElement.name = "HRElement"; $desc = $collectedClasses.HRElement; if ($desc instanceof Array) $desc = $desc[1]; HRElement.prototype = $desc; function HashChangeEvent() { } HashChangeEvent.builtin$cls = "HashChangeEvent"; if (!"name" in HashChangeEvent) HashChangeEvent.name = "HashChangeEvent"; $desc = $collectedClasses.HashChangeEvent; if ($desc instanceof Array) $desc = $desc[1]; HashChangeEvent.prototype = $desc; function HeadElement() { } HeadElement.builtin$cls = "HeadElement"; if (!"name" in HeadElement) HeadElement.name = "HeadElement"; $desc = $collectedClasses.HeadElement; if ($desc instanceof Array) $desc = $desc[1]; HeadElement.prototype = $desc; function HeadingElement() { } HeadingElement.builtin$cls = "HeadingElement"; if (!"name" in HeadingElement) HeadingElement.name = "HeadingElement"; $desc = $collectedClasses.HeadingElement; if ($desc instanceof Array) $desc = $desc[1]; HeadingElement.prototype = $desc; function HtmlDocument() { } HtmlDocument.builtin$cls = "HtmlDocument"; if (!"name" in HtmlDocument) HtmlDocument.name = "HtmlDocument"; $desc = $collectedClasses.HtmlDocument; if ($desc instanceof Array) $desc = $desc[1]; HtmlDocument.prototype = $desc; function HtmlHtmlElement() { } HtmlHtmlElement.builtin$cls = "HtmlHtmlElement"; if (!"name" in HtmlHtmlElement) HtmlHtmlElement.name = "HtmlHtmlElement"; $desc = $collectedClasses.HtmlHtmlElement; if ($desc instanceof Array) $desc = $desc[1]; HtmlHtmlElement.prototype = $desc; function IFrameElement() { } IFrameElement.builtin$cls = "IFrameElement"; if (!"name" in IFrameElement) IFrameElement.name = "IFrameElement"; $desc = $collectedClasses.IFrameElement; if ($desc instanceof Array) $desc = $desc[1]; IFrameElement.prototype = $desc; IFrameElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function ImageElement() { } ImageElement.builtin$cls = "ImageElement"; if (!"name" in ImageElement) ImageElement.name = "ImageElement"; $desc = $collectedClasses.ImageElement; if ($desc instanceof Array) $desc = $desc[1]; ImageElement.prototype = $desc; ImageElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function InputElement() { } InputElement.builtin$cls = "InputElement"; if (!"name" in InputElement) InputElement.name = "InputElement"; $desc = $collectedClasses.InputElement; if ($desc instanceof Array) $desc = $desc[1]; InputElement.prototype = $desc; InputElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function KeyboardEvent() { } KeyboardEvent.builtin$cls = "KeyboardEvent"; if (!"name" in KeyboardEvent) KeyboardEvent.name = "KeyboardEvent"; $desc = $collectedClasses.KeyboardEvent; if ($desc instanceof Array) $desc = $desc[1]; KeyboardEvent.prototype = $desc; function KeygenElement() { } KeygenElement.builtin$cls = "KeygenElement"; if (!"name" in KeygenElement) KeygenElement.name = "KeygenElement"; $desc = $collectedClasses.KeygenElement; if ($desc instanceof Array) $desc = $desc[1]; KeygenElement.prototype = $desc; function LIElement() { } LIElement.builtin$cls = "LIElement"; if (!"name" in LIElement) LIElement.name = "LIElement"; $desc = $collectedClasses.LIElement; if ($desc instanceof Array) $desc = $desc[1]; LIElement.prototype = $desc; function LabelElement() { } LabelElement.builtin$cls = "LabelElement"; if (!"name" in LabelElement) LabelElement.name = "LabelElement"; $desc = $collectedClasses.LabelElement; if ($desc instanceof Array) $desc = $desc[1]; LabelElement.prototype = $desc; function LegendElement() { } LegendElement.builtin$cls = "LegendElement"; if (!"name" in LegendElement) LegendElement.name = "LegendElement"; $desc = $collectedClasses.LegendElement; if ($desc instanceof Array) $desc = $desc[1]; LegendElement.prototype = $desc; function LinkElement() { } LinkElement.builtin$cls = "LinkElement"; if (!"name" in LinkElement) LinkElement.name = "LinkElement"; $desc = $collectedClasses.LinkElement; if ($desc instanceof Array) $desc = $desc[1]; LinkElement.prototype = $desc; function MapElement() { } MapElement.builtin$cls = "MapElement"; if (!"name" in MapElement) MapElement.name = "MapElement"; $desc = $collectedClasses.MapElement; if ($desc instanceof Array) $desc = $desc[1]; MapElement.prototype = $desc; function MediaElement() { } MediaElement.builtin$cls = "MediaElement"; if (!"name" in MediaElement) MediaElement.name = "MediaElement"; $desc = $collectedClasses.MediaElement; if ($desc instanceof Array) $desc = $desc[1]; MediaElement.prototype = $desc; MediaElement.prototype.get$error = function(receiver) { return receiver.error; }; MediaElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function MediaError() { } MediaError.builtin$cls = "MediaError"; if (!"name" in MediaError) MediaError.name = "MediaError"; $desc = $collectedClasses.MediaError; if ($desc instanceof Array) $desc = $desc[1]; MediaError.prototype = $desc; function MediaKeyError() { } MediaKeyError.builtin$cls = "MediaKeyError"; if (!"name" in MediaKeyError) MediaKeyError.name = "MediaKeyError"; $desc = $collectedClasses.MediaKeyError; if ($desc instanceof Array) $desc = $desc[1]; MediaKeyError.prototype = $desc; function MediaKeyEvent() { } MediaKeyEvent.builtin$cls = "MediaKeyEvent"; if (!"name" in MediaKeyEvent) MediaKeyEvent.name = "MediaKeyEvent"; $desc = $collectedClasses.MediaKeyEvent; if ($desc instanceof Array) $desc = $desc[1]; MediaKeyEvent.prototype = $desc; function MediaKeyMessageEvent() { } MediaKeyMessageEvent.builtin$cls = "MediaKeyMessageEvent"; if (!"name" in MediaKeyMessageEvent) MediaKeyMessageEvent.name = "MediaKeyMessageEvent"; $desc = $collectedClasses.MediaKeyMessageEvent; if ($desc instanceof Array) $desc = $desc[1]; MediaKeyMessageEvent.prototype = $desc; function MediaKeyNeededEvent() { } MediaKeyNeededEvent.builtin$cls = "MediaKeyNeededEvent"; if (!"name" in MediaKeyNeededEvent) MediaKeyNeededEvent.name = "MediaKeyNeededEvent"; $desc = $collectedClasses.MediaKeyNeededEvent; if ($desc instanceof Array) $desc = $desc[1]; MediaKeyNeededEvent.prototype = $desc; function MediaStream() { } MediaStream.builtin$cls = "MediaStream"; if (!"name" in MediaStream) MediaStream.name = "MediaStream"; $desc = $collectedClasses.MediaStream; if ($desc instanceof Array) $desc = $desc[1]; MediaStream.prototype = $desc; function MediaStreamEvent() { } MediaStreamEvent.builtin$cls = "MediaStreamEvent"; if (!"name" in MediaStreamEvent) MediaStreamEvent.name = "MediaStreamEvent"; $desc = $collectedClasses.MediaStreamEvent; if ($desc instanceof Array) $desc = $desc[1]; MediaStreamEvent.prototype = $desc; function MediaStreamTrackEvent() { } MediaStreamTrackEvent.builtin$cls = "MediaStreamTrackEvent"; if (!"name" in MediaStreamTrackEvent) MediaStreamTrackEvent.name = "MediaStreamTrackEvent"; $desc = $collectedClasses.MediaStreamTrackEvent; if ($desc instanceof Array) $desc = $desc[1]; MediaStreamTrackEvent.prototype = $desc; function MenuElement() { } MenuElement.builtin$cls = "MenuElement"; if (!"name" in MenuElement) MenuElement.name = "MenuElement"; $desc = $collectedClasses.MenuElement; if ($desc instanceof Array) $desc = $desc[1]; MenuElement.prototype = $desc; function MessageEvent() { } MessageEvent.builtin$cls = "MessageEvent"; if (!"name" in MessageEvent) MessageEvent.name = "MessageEvent"; $desc = $collectedClasses.MessageEvent; if ($desc instanceof Array) $desc = $desc[1]; MessageEvent.prototype = $desc; function MetaElement() { } MetaElement.builtin$cls = "MetaElement"; if (!"name" in MetaElement) MetaElement.name = "MetaElement"; $desc = $collectedClasses.MetaElement; if ($desc instanceof Array) $desc = $desc[1]; MetaElement.prototype = $desc; function MeterElement() { } MeterElement.builtin$cls = "MeterElement"; if (!"name" in MeterElement) MeterElement.name = "MeterElement"; $desc = $collectedClasses.MeterElement; if ($desc instanceof Array) $desc = $desc[1]; MeterElement.prototype = $desc; function MidiConnectionEvent() { } MidiConnectionEvent.builtin$cls = "MidiConnectionEvent"; if (!"name" in MidiConnectionEvent) MidiConnectionEvent.name = "MidiConnectionEvent"; $desc = $collectedClasses.MidiConnectionEvent; if ($desc instanceof Array) $desc = $desc[1]; MidiConnectionEvent.prototype = $desc; function MidiMessageEvent() { } MidiMessageEvent.builtin$cls = "MidiMessageEvent"; if (!"name" in MidiMessageEvent) MidiMessageEvent.name = "MidiMessageEvent"; $desc = $collectedClasses.MidiMessageEvent; if ($desc instanceof Array) $desc = $desc[1]; MidiMessageEvent.prototype = $desc; function ModElement() { } ModElement.builtin$cls = "ModElement"; if (!"name" in ModElement) ModElement.name = "ModElement"; $desc = $collectedClasses.ModElement; if ($desc instanceof Array) $desc = $desc[1]; ModElement.prototype = $desc; function MouseEvent() { } MouseEvent.builtin$cls = "MouseEvent"; if (!"name" in MouseEvent) MouseEvent.name = "MouseEvent"; $desc = $collectedClasses.MouseEvent; if ($desc instanceof Array) $desc = $desc[1]; MouseEvent.prototype = $desc; function Navigator() { } Navigator.builtin$cls = "Navigator"; if (!"name" in Navigator) Navigator.name = "Navigator"; $desc = $collectedClasses.Navigator; if ($desc instanceof Array) $desc = $desc[1]; Navigator.prototype = $desc; function NavigatorUserMediaError() { } NavigatorUserMediaError.builtin$cls = "NavigatorUserMediaError"; if (!"name" in NavigatorUserMediaError) NavigatorUserMediaError.name = "NavigatorUserMediaError"; $desc = $collectedClasses.NavigatorUserMediaError; if ($desc instanceof Array) $desc = $desc[1]; NavigatorUserMediaError.prototype = $desc; function Node() { } Node.builtin$cls = "Node"; if (!"name" in Node) Node.name = "Node"; $desc = $collectedClasses.Node; if ($desc instanceof Array) $desc = $desc[1]; Node.prototype = $desc; function NodeList() { } NodeList.builtin$cls = "NodeList"; if (!"name" in NodeList) NodeList.name = "NodeList"; $desc = $collectedClasses.NodeList; if ($desc instanceof Array) $desc = $desc[1]; NodeList.prototype = $desc; function OListElement() { } OListElement.builtin$cls = "OListElement"; if (!"name" in OListElement) OListElement.name = "OListElement"; $desc = $collectedClasses.OListElement; if ($desc instanceof Array) $desc = $desc[1]; OListElement.prototype = $desc; function ObjectElement() { } ObjectElement.builtin$cls = "ObjectElement"; if (!"name" in ObjectElement) ObjectElement.name = "ObjectElement"; $desc = $collectedClasses.ObjectElement; if ($desc instanceof Array) $desc = $desc[1]; ObjectElement.prototype = $desc; function OptGroupElement() { } OptGroupElement.builtin$cls = "OptGroupElement"; if (!"name" in OptGroupElement) OptGroupElement.name = "OptGroupElement"; $desc = $collectedClasses.OptGroupElement; if ($desc instanceof Array) $desc = $desc[1]; OptGroupElement.prototype = $desc; function OptionElement() { } OptionElement.builtin$cls = "OptionElement"; if (!"name" in OptionElement) OptionElement.name = "OptionElement"; $desc = $collectedClasses.OptionElement; if ($desc instanceof Array) $desc = $desc[1]; OptionElement.prototype = $desc; function OutputElement() { } OutputElement.builtin$cls = "OutputElement"; if (!"name" in OutputElement) OutputElement.name = "OutputElement"; $desc = $collectedClasses.OutputElement; if ($desc instanceof Array) $desc = $desc[1]; OutputElement.prototype = $desc; function OverflowEvent() { } OverflowEvent.builtin$cls = "OverflowEvent"; if (!"name" in OverflowEvent) OverflowEvent.name = "OverflowEvent"; $desc = $collectedClasses.OverflowEvent; if ($desc instanceof Array) $desc = $desc[1]; OverflowEvent.prototype = $desc; function PageTransitionEvent() { } PageTransitionEvent.builtin$cls = "PageTransitionEvent"; if (!"name" in PageTransitionEvent) PageTransitionEvent.name = "PageTransitionEvent"; $desc = $collectedClasses.PageTransitionEvent; if ($desc instanceof Array) $desc = $desc[1]; PageTransitionEvent.prototype = $desc; function ParagraphElement() { } ParagraphElement.builtin$cls = "ParagraphElement"; if (!"name" in ParagraphElement) ParagraphElement.name = "ParagraphElement"; $desc = $collectedClasses.ParagraphElement; if ($desc instanceof Array) $desc = $desc[1]; ParagraphElement.prototype = $desc; function ParamElement() { } ParamElement.builtin$cls = "ParamElement"; if (!"name" in ParamElement) ParamElement.name = "ParamElement"; $desc = $collectedClasses.ParamElement; if ($desc instanceof Array) $desc = $desc[1]; ParamElement.prototype = $desc; function PopStateEvent() { } PopStateEvent.builtin$cls = "PopStateEvent"; if (!"name" in PopStateEvent) PopStateEvent.name = "PopStateEvent"; $desc = $collectedClasses.PopStateEvent; if ($desc instanceof Array) $desc = $desc[1]; PopStateEvent.prototype = $desc; function PositionError() { } PositionError.builtin$cls = "PositionError"; if (!"name" in PositionError) PositionError.name = "PositionError"; $desc = $collectedClasses.PositionError; if ($desc instanceof Array) $desc = $desc[1]; PositionError.prototype = $desc; function PreElement() { } PreElement.builtin$cls = "PreElement"; if (!"name" in PreElement) PreElement.name = "PreElement"; $desc = $collectedClasses.PreElement; if ($desc instanceof Array) $desc = $desc[1]; PreElement.prototype = $desc; function ProcessingInstruction() { } ProcessingInstruction.builtin$cls = "ProcessingInstruction"; if (!"name" in ProcessingInstruction) ProcessingInstruction.name = "ProcessingInstruction"; $desc = $collectedClasses.ProcessingInstruction; if ($desc instanceof Array) $desc = $desc[1]; ProcessingInstruction.prototype = $desc; function ProgressElement() { } ProgressElement.builtin$cls = "ProgressElement"; if (!"name" in ProgressElement) ProgressElement.name = "ProgressElement"; $desc = $collectedClasses.ProgressElement; if ($desc instanceof Array) $desc = $desc[1]; ProgressElement.prototype = $desc; function ProgressEvent() { } ProgressEvent.builtin$cls = "ProgressEvent"; if (!"name" in ProgressEvent) ProgressEvent.name = "ProgressEvent"; $desc = $collectedClasses.ProgressEvent; if ($desc instanceof Array) $desc = $desc[1]; ProgressEvent.prototype = $desc; function QuoteElement() { } QuoteElement.builtin$cls = "QuoteElement"; if (!"name" in QuoteElement) QuoteElement.name = "QuoteElement"; $desc = $collectedClasses.QuoteElement; if ($desc instanceof Array) $desc = $desc[1]; QuoteElement.prototype = $desc; function ResourceProgressEvent() { } ResourceProgressEvent.builtin$cls = "ResourceProgressEvent"; if (!"name" in ResourceProgressEvent) ResourceProgressEvent.name = "ResourceProgressEvent"; $desc = $collectedClasses.ResourceProgressEvent; if ($desc instanceof Array) $desc = $desc[1]; ResourceProgressEvent.prototype = $desc; function RtcDataChannelEvent() { } RtcDataChannelEvent.builtin$cls = "RtcDataChannelEvent"; if (!"name" in RtcDataChannelEvent) RtcDataChannelEvent.name = "RtcDataChannelEvent"; $desc = $collectedClasses.RtcDataChannelEvent; if ($desc instanceof Array) $desc = $desc[1]; RtcDataChannelEvent.prototype = $desc; function RtcDtmfToneChangeEvent() { } RtcDtmfToneChangeEvent.builtin$cls = "RtcDtmfToneChangeEvent"; if (!"name" in RtcDtmfToneChangeEvent) RtcDtmfToneChangeEvent.name = "RtcDtmfToneChangeEvent"; $desc = $collectedClasses.RtcDtmfToneChangeEvent; if ($desc instanceof Array) $desc = $desc[1]; RtcDtmfToneChangeEvent.prototype = $desc; function RtcIceCandidateEvent() { } RtcIceCandidateEvent.builtin$cls = "RtcIceCandidateEvent"; if (!"name" in RtcIceCandidateEvent) RtcIceCandidateEvent.name = "RtcIceCandidateEvent"; $desc = $collectedClasses.RtcIceCandidateEvent; if ($desc instanceof Array) $desc = $desc[1]; RtcIceCandidateEvent.prototype = $desc; function ScriptElement() { } ScriptElement.builtin$cls = "ScriptElement"; if (!"name" in ScriptElement) ScriptElement.name = "ScriptElement"; $desc = $collectedClasses.ScriptElement; if ($desc instanceof Array) $desc = $desc[1]; ScriptElement.prototype = $desc; ScriptElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function SecurityPolicyViolationEvent() { } SecurityPolicyViolationEvent.builtin$cls = "SecurityPolicyViolationEvent"; if (!"name" in SecurityPolicyViolationEvent) SecurityPolicyViolationEvent.name = "SecurityPolicyViolationEvent"; $desc = $collectedClasses.SecurityPolicyViolationEvent; if ($desc instanceof Array) $desc = $desc[1]; SecurityPolicyViolationEvent.prototype = $desc; function SelectElement() { } SelectElement.builtin$cls = "SelectElement"; if (!"name" in SelectElement) SelectElement.name = "SelectElement"; $desc = $collectedClasses.SelectElement; if ($desc instanceof Array) $desc = $desc[1]; SelectElement.prototype = $desc; SelectElement.prototype.get$length = function(receiver) { return receiver.length; }; function ShadowElement() { } ShadowElement.builtin$cls = "ShadowElement"; if (!"name" in ShadowElement) ShadowElement.name = "ShadowElement"; $desc = $collectedClasses.ShadowElement; if ($desc instanceof Array) $desc = $desc[1]; ShadowElement.prototype = $desc; function ShadowRoot() { } ShadowRoot.builtin$cls = "ShadowRoot"; if (!"name" in ShadowRoot) ShadowRoot.name = "ShadowRoot"; $desc = $collectedClasses.ShadowRoot; if ($desc instanceof Array) $desc = $desc[1]; ShadowRoot.prototype = $desc; function SourceElement() { } SourceElement.builtin$cls = "SourceElement"; if (!"name" in SourceElement) SourceElement.name = "SourceElement"; $desc = $collectedClasses.SourceElement; if ($desc instanceof Array) $desc = $desc[1]; SourceElement.prototype = $desc; SourceElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function SpanElement() { } SpanElement.builtin$cls = "SpanElement"; if (!"name" in SpanElement) SpanElement.name = "SpanElement"; $desc = $collectedClasses.SpanElement; if ($desc instanceof Array) $desc = $desc[1]; SpanElement.prototype = $desc; function SpeechInputEvent() { } SpeechInputEvent.builtin$cls = "SpeechInputEvent"; if (!"name" in SpeechInputEvent) SpeechInputEvent.name = "SpeechInputEvent"; $desc = $collectedClasses.SpeechInputEvent; if ($desc instanceof Array) $desc = $desc[1]; SpeechInputEvent.prototype = $desc; function SpeechRecognitionError() { } SpeechRecognitionError.builtin$cls = "SpeechRecognitionError"; if (!"name" in SpeechRecognitionError) SpeechRecognitionError.name = "SpeechRecognitionError"; $desc = $collectedClasses.SpeechRecognitionError; if ($desc instanceof Array) $desc = $desc[1]; SpeechRecognitionError.prototype = $desc; SpeechRecognitionError.prototype.get$error = function(receiver) { return receiver.error; }; function SpeechRecognitionEvent() { } SpeechRecognitionEvent.builtin$cls = "SpeechRecognitionEvent"; if (!"name" in SpeechRecognitionEvent) SpeechRecognitionEvent.name = "SpeechRecognitionEvent"; $desc = $collectedClasses.SpeechRecognitionEvent; if ($desc instanceof Array) $desc = $desc[1]; SpeechRecognitionEvent.prototype = $desc; function SpeechSynthesisEvent() { } SpeechSynthesisEvent.builtin$cls = "SpeechSynthesisEvent"; if (!"name" in SpeechSynthesisEvent) SpeechSynthesisEvent.name = "SpeechSynthesisEvent"; $desc = $collectedClasses.SpeechSynthesisEvent; if ($desc instanceof Array) $desc = $desc[1]; SpeechSynthesisEvent.prototype = $desc; function StorageEvent() { } StorageEvent.builtin$cls = "StorageEvent"; if (!"name" in StorageEvent) StorageEvent.name = "StorageEvent"; $desc = $collectedClasses.StorageEvent; if ($desc instanceof Array) $desc = $desc[1]; StorageEvent.prototype = $desc; function StyleElement() { } StyleElement.builtin$cls = "StyleElement"; if (!"name" in StyleElement) StyleElement.name = "StyleElement"; $desc = $collectedClasses.StyleElement; if ($desc instanceof Array) $desc = $desc[1]; StyleElement.prototype = $desc; function TableCaptionElement() { } TableCaptionElement.builtin$cls = "TableCaptionElement"; if (!"name" in TableCaptionElement) TableCaptionElement.name = "TableCaptionElement"; $desc = $collectedClasses.TableCaptionElement; if ($desc instanceof Array) $desc = $desc[1]; TableCaptionElement.prototype = $desc; function TableCellElement() { } TableCellElement.builtin$cls = "TableCellElement"; if (!"name" in TableCellElement) TableCellElement.name = "TableCellElement"; $desc = $collectedClasses.TableCellElement; if ($desc instanceof Array) $desc = $desc[1]; TableCellElement.prototype = $desc; function TableColElement() { } TableColElement.builtin$cls = "TableColElement"; if (!"name" in TableColElement) TableColElement.name = "TableColElement"; $desc = $collectedClasses.TableColElement; if ($desc instanceof Array) $desc = $desc[1]; TableColElement.prototype = $desc; function TableElement() { } TableElement.builtin$cls = "TableElement"; if (!"name" in TableElement) TableElement.name = "TableElement"; $desc = $collectedClasses.TableElement; if ($desc instanceof Array) $desc = $desc[1]; TableElement.prototype = $desc; function TableRowElement() { } TableRowElement.builtin$cls = "TableRowElement"; if (!"name" in TableRowElement) TableRowElement.name = "TableRowElement"; $desc = $collectedClasses.TableRowElement; if ($desc instanceof Array) $desc = $desc[1]; TableRowElement.prototype = $desc; function TableSectionElement() { } TableSectionElement.builtin$cls = "TableSectionElement"; if (!"name" in TableSectionElement) TableSectionElement.name = "TableSectionElement"; $desc = $collectedClasses.TableSectionElement; if ($desc instanceof Array) $desc = $desc[1]; TableSectionElement.prototype = $desc; function TemplateElement() { } TemplateElement.builtin$cls = "TemplateElement"; if (!"name" in TemplateElement) TemplateElement.name = "TemplateElement"; $desc = $collectedClasses.TemplateElement; if ($desc instanceof Array) $desc = $desc[1]; TemplateElement.prototype = $desc; function Text() { } Text.builtin$cls = "Text"; if (!"name" in Text) Text.name = "Text"; $desc = $collectedClasses.Text; if ($desc instanceof Array) $desc = $desc[1]; Text.prototype = $desc; function TextAreaElement() { } TextAreaElement.builtin$cls = "TextAreaElement"; if (!"name" in TextAreaElement) TextAreaElement.name = "TextAreaElement"; $desc = $collectedClasses.TextAreaElement; if ($desc instanceof Array) $desc = $desc[1]; TextAreaElement.prototype = $desc; function TextEvent() { } TextEvent.builtin$cls = "TextEvent"; if (!"name" in TextEvent) TextEvent.name = "TextEvent"; $desc = $collectedClasses.TextEvent; if ($desc instanceof Array) $desc = $desc[1]; TextEvent.prototype = $desc; function TitleElement() { } TitleElement.builtin$cls = "TitleElement"; if (!"name" in TitleElement) TitleElement.name = "TitleElement"; $desc = $collectedClasses.TitleElement; if ($desc instanceof Array) $desc = $desc[1]; TitleElement.prototype = $desc; function TouchEvent() { } TouchEvent.builtin$cls = "TouchEvent"; if (!"name" in TouchEvent) TouchEvent.name = "TouchEvent"; $desc = $collectedClasses.TouchEvent; if ($desc instanceof Array) $desc = $desc[1]; TouchEvent.prototype = $desc; function TrackElement() { } TrackElement.builtin$cls = "TrackElement"; if (!"name" in TrackElement) TrackElement.name = "TrackElement"; $desc = $collectedClasses.TrackElement; if ($desc instanceof Array) $desc = $desc[1]; TrackElement.prototype = $desc; TrackElement.prototype.set$src = function(receiver, v) { return receiver.src = v; }; function TrackEvent() { } TrackEvent.builtin$cls = "TrackEvent"; if (!"name" in TrackEvent) TrackEvent.name = "TrackEvent"; $desc = $collectedClasses.TrackEvent; if ($desc instanceof Array) $desc = $desc[1]; TrackEvent.prototype = $desc; function TransitionEvent() { } TransitionEvent.builtin$cls = "TransitionEvent"; if (!"name" in TransitionEvent) TransitionEvent.name = "TransitionEvent"; $desc = $collectedClasses.TransitionEvent; if ($desc instanceof Array) $desc = $desc[1]; TransitionEvent.prototype = $desc; function UIEvent() { } UIEvent.builtin$cls = "UIEvent"; if (!"name" in UIEvent) UIEvent.name = "UIEvent"; $desc = $collectedClasses.UIEvent; if ($desc instanceof Array) $desc = $desc[1]; UIEvent.prototype = $desc; function UListElement() { } UListElement.builtin$cls = "UListElement"; if (!"name" in UListElement) UListElement.name = "UListElement"; $desc = $collectedClasses.UListElement; if ($desc instanceof Array) $desc = $desc[1]; UListElement.prototype = $desc; function UnknownElement() { } UnknownElement.builtin$cls = "UnknownElement"; if (!"name" in UnknownElement) UnknownElement.name = "UnknownElement"; $desc = $collectedClasses.UnknownElement; if ($desc instanceof Array) $desc = $desc[1]; UnknownElement.prototype = $desc; function VideoElement() { } VideoElement.builtin$cls = "VideoElement"; if (!"name" in VideoElement) VideoElement.name = "VideoElement"; $desc = $collectedClasses.VideoElement; if ($desc instanceof Array) $desc = $desc[1]; VideoElement.prototype = $desc; function WheelEvent() { } WheelEvent.builtin$cls = "WheelEvent"; if (!"name" in WheelEvent) WheelEvent.name = "WheelEvent"; $desc = $collectedClasses.WheelEvent; if ($desc instanceof Array) $desc = $desc[1]; WheelEvent.prototype = $desc; function Window() { } Window.builtin$cls = "Window"; if (!"name" in Window) Window.name = "Window"; $desc = $collectedClasses.Window; if ($desc instanceof Array) $desc = $desc[1]; Window.prototype = $desc; function _Attr() { } _Attr.builtin$cls = "_Attr"; if (!"name" in _Attr) _Attr.name = "_Attr"; $desc = $collectedClasses._Attr; if ($desc instanceof Array) $desc = $desc[1]; _Attr.prototype = $desc; function _ClientRect() { } _ClientRect.builtin$cls = "_ClientRect"; if (!"name" in _ClientRect) _ClientRect.name = "_ClientRect"; $desc = $collectedClasses._ClientRect; if ($desc instanceof Array) $desc = $desc[1]; _ClientRect.prototype = $desc; _ClientRect.prototype.get$height = function(receiver) { return receiver.height; }; _ClientRect.prototype.get$left = function(receiver) { return receiver.left; }; _ClientRect.prototype.get$top = function(receiver) { return receiver.top; }; _ClientRect.prototype.get$width = function(receiver) { return receiver.width; }; function _Entity() { } _Entity.builtin$cls = "_Entity"; if (!"name" in _Entity) _Entity.name = "_Entity"; $desc = $collectedClasses._Entity; if ($desc instanceof Array) $desc = $desc[1]; _Entity.prototype = $desc; function _HTMLAppletElement() { } _HTMLAppletElement.builtin$cls = "_HTMLAppletElement"; if (!"name" in _HTMLAppletElement) _HTMLAppletElement.name = "_HTMLAppletElement"; $desc = $collectedClasses._HTMLAppletElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLAppletElement.prototype = $desc; function _HTMLBaseFontElement() { } _HTMLBaseFontElement.builtin$cls = "_HTMLBaseFontElement"; if (!"name" in _HTMLBaseFontElement) _HTMLBaseFontElement.name = "_HTMLBaseFontElement"; $desc = $collectedClasses._HTMLBaseFontElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLBaseFontElement.prototype = $desc; function _HTMLDirectoryElement() { } _HTMLDirectoryElement.builtin$cls = "_HTMLDirectoryElement"; if (!"name" in _HTMLDirectoryElement) _HTMLDirectoryElement.name = "_HTMLDirectoryElement"; $desc = $collectedClasses._HTMLDirectoryElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLDirectoryElement.prototype = $desc; function _HTMLFontElement() { } _HTMLFontElement.builtin$cls = "_HTMLFontElement"; if (!"name" in _HTMLFontElement) _HTMLFontElement.name = "_HTMLFontElement"; $desc = $collectedClasses._HTMLFontElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLFontElement.prototype = $desc; function _HTMLFrameElement() { } _HTMLFrameElement.builtin$cls = "_HTMLFrameElement"; if (!"name" in _HTMLFrameElement) _HTMLFrameElement.name = "_HTMLFrameElement"; $desc = $collectedClasses._HTMLFrameElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLFrameElement.prototype = $desc; function _HTMLFrameSetElement() { } _HTMLFrameSetElement.builtin$cls = "_HTMLFrameSetElement"; if (!"name" in _HTMLFrameSetElement) _HTMLFrameSetElement.name = "_HTMLFrameSetElement"; $desc = $collectedClasses._HTMLFrameSetElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLFrameSetElement.prototype = $desc; function _HTMLMarqueeElement() { } _HTMLMarqueeElement.builtin$cls = "_HTMLMarqueeElement"; if (!"name" in _HTMLMarqueeElement) _HTMLMarqueeElement.name = "_HTMLMarqueeElement"; $desc = $collectedClasses._HTMLMarqueeElement; if ($desc instanceof Array) $desc = $desc[1]; _HTMLMarqueeElement.prototype = $desc; function _MutationEvent() { } _MutationEvent.builtin$cls = "_MutationEvent"; if (!"name" in _MutationEvent) _MutationEvent.name = "_MutationEvent"; $desc = $collectedClasses._MutationEvent; if ($desc instanceof Array) $desc = $desc[1]; _MutationEvent.prototype = $desc; function _Notation() { } _Notation.builtin$cls = "_Notation"; if (!"name" in _Notation) _Notation.name = "_Notation"; $desc = $collectedClasses._Notation; if ($desc instanceof Array) $desc = $desc[1]; _Notation.prototype = $desc; function _XMLHttpRequestProgressEvent() { } _XMLHttpRequestProgressEvent.builtin$cls = "_XMLHttpRequestProgressEvent"; if (!"name" in _XMLHttpRequestProgressEvent) _XMLHttpRequestProgressEvent.name = "_XMLHttpRequestProgressEvent"; $desc = $collectedClasses._XMLHttpRequestProgressEvent; if ($desc instanceof Array) $desc = $desc[1]; _XMLHttpRequestProgressEvent.prototype = $desc; function VersionChangeEvent() { } VersionChangeEvent.builtin$cls = "VersionChangeEvent"; if (!"name" in VersionChangeEvent) VersionChangeEvent.name = "VersionChangeEvent"; $desc = $collectedClasses.VersionChangeEvent; if ($desc instanceof Array) $desc = $desc[1]; VersionChangeEvent.prototype = $desc; function AElement() { } AElement.builtin$cls = "AElement"; if (!"name" in AElement) AElement.name = "AElement"; $desc = $collectedClasses.AElement; if ($desc instanceof Array) $desc = $desc[1]; AElement.prototype = $desc; function AltGlyphElement() { } AltGlyphElement.builtin$cls = "AltGlyphElement"; if (!"name" in AltGlyphElement) AltGlyphElement.name = "AltGlyphElement"; $desc = $collectedClasses.AltGlyphElement; if ($desc instanceof Array) $desc = $desc[1]; AltGlyphElement.prototype = $desc; function AnimateElement() { } AnimateElement.builtin$cls = "AnimateElement"; if (!"name" in AnimateElement) AnimateElement.name = "AnimateElement"; $desc = $collectedClasses.AnimateElement; if ($desc instanceof Array) $desc = $desc[1]; AnimateElement.prototype = $desc; function AnimateMotionElement() { } AnimateMotionElement.builtin$cls = "AnimateMotionElement"; if (!"name" in AnimateMotionElement) AnimateMotionElement.name = "AnimateMotionElement"; $desc = $collectedClasses.AnimateMotionElement; if ($desc instanceof Array) $desc = $desc[1]; AnimateMotionElement.prototype = $desc; function AnimateTransformElement() { } AnimateTransformElement.builtin$cls = "AnimateTransformElement"; if (!"name" in AnimateTransformElement) AnimateTransformElement.name = "AnimateTransformElement"; $desc = $collectedClasses.AnimateTransformElement; if ($desc instanceof Array) $desc = $desc[1]; AnimateTransformElement.prototype = $desc; function AnimatedLength() { } AnimatedLength.builtin$cls = "AnimatedLength"; if (!"name" in AnimatedLength) AnimatedLength.name = "AnimatedLength"; $desc = $collectedClasses.AnimatedLength; if ($desc instanceof Array) $desc = $desc[1]; AnimatedLength.prototype = $desc; function AnimatedLengthList() { } AnimatedLengthList.builtin$cls = "AnimatedLengthList"; if (!"name" in AnimatedLengthList) AnimatedLengthList.name = "AnimatedLengthList"; $desc = $collectedClasses.AnimatedLengthList; if ($desc instanceof Array) $desc = $desc[1]; AnimatedLengthList.prototype = $desc; function AnimatedNumber() { } AnimatedNumber.builtin$cls = "AnimatedNumber"; if (!"name" in AnimatedNumber) AnimatedNumber.name = "AnimatedNumber"; $desc = $collectedClasses.AnimatedNumber; if ($desc instanceof Array) $desc = $desc[1]; AnimatedNumber.prototype = $desc; function AnimatedNumberList() { } AnimatedNumberList.builtin$cls = "AnimatedNumberList"; if (!"name" in AnimatedNumberList) AnimatedNumberList.name = "AnimatedNumberList"; $desc = $collectedClasses.AnimatedNumberList; if ($desc instanceof Array) $desc = $desc[1]; AnimatedNumberList.prototype = $desc; function AnimationElement() { } AnimationElement.builtin$cls = "AnimationElement"; if (!"name" in AnimationElement) AnimationElement.name = "AnimationElement"; $desc = $collectedClasses.AnimationElement; if ($desc instanceof Array) $desc = $desc[1]; AnimationElement.prototype = $desc; function CircleElement() { } CircleElement.builtin$cls = "CircleElement"; if (!"name" in CircleElement) CircleElement.name = "CircleElement"; $desc = $collectedClasses.CircleElement; if ($desc instanceof Array) $desc = $desc[1]; CircleElement.prototype = $desc; function ClipPathElement() { } ClipPathElement.builtin$cls = "ClipPathElement"; if (!"name" in ClipPathElement) ClipPathElement.name = "ClipPathElement"; $desc = $collectedClasses.ClipPathElement; if ($desc instanceof Array) $desc = $desc[1]; ClipPathElement.prototype = $desc; function DefsElement() { } DefsElement.builtin$cls = "DefsElement"; if (!"name" in DefsElement) DefsElement.name = "DefsElement"; $desc = $collectedClasses.DefsElement; if ($desc instanceof Array) $desc = $desc[1]; DefsElement.prototype = $desc; function DescElement() { } DescElement.builtin$cls = "DescElement"; if (!"name" in DescElement) DescElement.name = "DescElement"; $desc = $collectedClasses.DescElement; if ($desc instanceof Array) $desc = $desc[1]; DescElement.prototype = $desc; function EllipseElement() { } EllipseElement.builtin$cls = "EllipseElement"; if (!"name" in EllipseElement) EllipseElement.name = "EllipseElement"; $desc = $collectedClasses.EllipseElement; if ($desc instanceof Array) $desc = $desc[1]; EllipseElement.prototype = $desc; function FEBlendElement() { } FEBlendElement.builtin$cls = "FEBlendElement"; if (!"name" in FEBlendElement) FEBlendElement.name = "FEBlendElement"; $desc = $collectedClasses.FEBlendElement; if ($desc instanceof Array) $desc = $desc[1]; FEBlendElement.prototype = $desc; FEBlendElement.prototype.get$x = function(receiver) { return receiver.x; }; FEBlendElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEColorMatrixElement() { } FEColorMatrixElement.builtin$cls = "FEColorMatrixElement"; if (!"name" in FEColorMatrixElement) FEColorMatrixElement.name = "FEColorMatrixElement"; $desc = $collectedClasses.FEColorMatrixElement; if ($desc instanceof Array) $desc = $desc[1]; FEColorMatrixElement.prototype = $desc; FEColorMatrixElement.prototype.get$x = function(receiver) { return receiver.x; }; FEColorMatrixElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEComponentTransferElement() { } FEComponentTransferElement.builtin$cls = "FEComponentTransferElement"; if (!"name" in FEComponentTransferElement) FEComponentTransferElement.name = "FEComponentTransferElement"; $desc = $collectedClasses.FEComponentTransferElement; if ($desc instanceof Array) $desc = $desc[1]; FEComponentTransferElement.prototype = $desc; FEComponentTransferElement.prototype.get$x = function(receiver) { return receiver.x; }; FEComponentTransferElement.prototype.get$y = function(receiver) { return receiver.y; }; function FECompositeElement() { } FECompositeElement.builtin$cls = "FECompositeElement"; if (!"name" in FECompositeElement) FECompositeElement.name = "FECompositeElement"; $desc = $collectedClasses.FECompositeElement; if ($desc instanceof Array) $desc = $desc[1]; FECompositeElement.prototype = $desc; FECompositeElement.prototype.get$x = function(receiver) { return receiver.x; }; FECompositeElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEConvolveMatrixElement() { } FEConvolveMatrixElement.builtin$cls = "FEConvolveMatrixElement"; if (!"name" in FEConvolveMatrixElement) FEConvolveMatrixElement.name = "FEConvolveMatrixElement"; $desc = $collectedClasses.FEConvolveMatrixElement; if ($desc instanceof Array) $desc = $desc[1]; FEConvolveMatrixElement.prototype = $desc; FEConvolveMatrixElement.prototype.get$x = function(receiver) { return receiver.x; }; FEConvolveMatrixElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEDiffuseLightingElement() { } FEDiffuseLightingElement.builtin$cls = "FEDiffuseLightingElement"; if (!"name" in FEDiffuseLightingElement) FEDiffuseLightingElement.name = "FEDiffuseLightingElement"; $desc = $collectedClasses.FEDiffuseLightingElement; if ($desc instanceof Array) $desc = $desc[1]; FEDiffuseLightingElement.prototype = $desc; FEDiffuseLightingElement.prototype.get$x = function(receiver) { return receiver.x; }; FEDiffuseLightingElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEDisplacementMapElement() { } FEDisplacementMapElement.builtin$cls = "FEDisplacementMapElement"; if (!"name" in FEDisplacementMapElement) FEDisplacementMapElement.name = "FEDisplacementMapElement"; $desc = $collectedClasses.FEDisplacementMapElement; if ($desc instanceof Array) $desc = $desc[1]; FEDisplacementMapElement.prototype = $desc; FEDisplacementMapElement.prototype.get$x = function(receiver) { return receiver.x; }; FEDisplacementMapElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEDistantLightElement() { } FEDistantLightElement.builtin$cls = "FEDistantLightElement"; if (!"name" in FEDistantLightElement) FEDistantLightElement.name = "FEDistantLightElement"; $desc = $collectedClasses.FEDistantLightElement; if ($desc instanceof Array) $desc = $desc[1]; FEDistantLightElement.prototype = $desc; function FEFloodElement() { } FEFloodElement.builtin$cls = "FEFloodElement"; if (!"name" in FEFloodElement) FEFloodElement.name = "FEFloodElement"; $desc = $collectedClasses.FEFloodElement; if ($desc instanceof Array) $desc = $desc[1]; FEFloodElement.prototype = $desc; FEFloodElement.prototype.get$x = function(receiver) { return receiver.x; }; FEFloodElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEFuncAElement() { } FEFuncAElement.builtin$cls = "FEFuncAElement"; if (!"name" in FEFuncAElement) FEFuncAElement.name = "FEFuncAElement"; $desc = $collectedClasses.FEFuncAElement; if ($desc instanceof Array) $desc = $desc[1]; FEFuncAElement.prototype = $desc; function FEFuncBElement() { } FEFuncBElement.builtin$cls = "FEFuncBElement"; if (!"name" in FEFuncBElement) FEFuncBElement.name = "FEFuncBElement"; $desc = $collectedClasses.FEFuncBElement; if ($desc instanceof Array) $desc = $desc[1]; FEFuncBElement.prototype = $desc; function FEFuncGElement() { } FEFuncGElement.builtin$cls = "FEFuncGElement"; if (!"name" in FEFuncGElement) FEFuncGElement.name = "FEFuncGElement"; $desc = $collectedClasses.FEFuncGElement; if ($desc instanceof Array) $desc = $desc[1]; FEFuncGElement.prototype = $desc; function FEFuncRElement() { } FEFuncRElement.builtin$cls = "FEFuncRElement"; if (!"name" in FEFuncRElement) FEFuncRElement.name = "FEFuncRElement"; $desc = $collectedClasses.FEFuncRElement; if ($desc instanceof Array) $desc = $desc[1]; FEFuncRElement.prototype = $desc; function FEGaussianBlurElement() { } FEGaussianBlurElement.builtin$cls = "FEGaussianBlurElement"; if (!"name" in FEGaussianBlurElement) FEGaussianBlurElement.name = "FEGaussianBlurElement"; $desc = $collectedClasses.FEGaussianBlurElement; if ($desc instanceof Array) $desc = $desc[1]; FEGaussianBlurElement.prototype = $desc; FEGaussianBlurElement.prototype.get$x = function(receiver) { return receiver.x; }; FEGaussianBlurElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEImageElement() { } FEImageElement.builtin$cls = "FEImageElement"; if (!"name" in FEImageElement) FEImageElement.name = "FEImageElement"; $desc = $collectedClasses.FEImageElement; if ($desc instanceof Array) $desc = $desc[1]; FEImageElement.prototype = $desc; FEImageElement.prototype.get$x = function(receiver) { return receiver.x; }; FEImageElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEMergeElement() { } FEMergeElement.builtin$cls = "FEMergeElement"; if (!"name" in FEMergeElement) FEMergeElement.name = "FEMergeElement"; $desc = $collectedClasses.FEMergeElement; if ($desc instanceof Array) $desc = $desc[1]; FEMergeElement.prototype = $desc; FEMergeElement.prototype.get$x = function(receiver) { return receiver.x; }; FEMergeElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEMergeNodeElement() { } FEMergeNodeElement.builtin$cls = "FEMergeNodeElement"; if (!"name" in FEMergeNodeElement) FEMergeNodeElement.name = "FEMergeNodeElement"; $desc = $collectedClasses.FEMergeNodeElement; if ($desc instanceof Array) $desc = $desc[1]; FEMergeNodeElement.prototype = $desc; function FEMorphologyElement() { } FEMorphologyElement.builtin$cls = "FEMorphologyElement"; if (!"name" in FEMorphologyElement) FEMorphologyElement.name = "FEMorphologyElement"; $desc = $collectedClasses.FEMorphologyElement; if ($desc instanceof Array) $desc = $desc[1]; FEMorphologyElement.prototype = $desc; FEMorphologyElement.prototype.get$x = function(receiver) { return receiver.x; }; FEMorphologyElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEOffsetElement() { } FEOffsetElement.builtin$cls = "FEOffsetElement"; if (!"name" in FEOffsetElement) FEOffsetElement.name = "FEOffsetElement"; $desc = $collectedClasses.FEOffsetElement; if ($desc instanceof Array) $desc = $desc[1]; FEOffsetElement.prototype = $desc; FEOffsetElement.prototype.get$x = function(receiver) { return receiver.x; }; FEOffsetElement.prototype.get$y = function(receiver) { return receiver.y; }; function FEPointLightElement() { } FEPointLightElement.builtin$cls = "FEPointLightElement"; if (!"name" in FEPointLightElement) FEPointLightElement.name = "FEPointLightElement"; $desc = $collectedClasses.FEPointLightElement; if ($desc instanceof Array) $desc = $desc[1]; FEPointLightElement.prototype = $desc; FEPointLightElement.prototype.get$x = function(receiver) { return receiver.x; }; FEPointLightElement.prototype.get$y = function(receiver) { return receiver.y; }; function FESpecularLightingElement() { } FESpecularLightingElement.builtin$cls = "FESpecularLightingElement"; if (!"name" in FESpecularLightingElement) FESpecularLightingElement.name = "FESpecularLightingElement"; $desc = $collectedClasses.FESpecularLightingElement; if ($desc instanceof Array) $desc = $desc[1]; FESpecularLightingElement.prototype = $desc; FESpecularLightingElement.prototype.get$x = function(receiver) { return receiver.x; }; FESpecularLightingElement.prototype.get$y = function(receiver) { return receiver.y; }; function FESpotLightElement() { } FESpotLightElement.builtin$cls = "FESpotLightElement"; if (!"name" in FESpotLightElement) FESpotLightElement.name = "FESpotLightElement"; $desc = $collectedClasses.FESpotLightElement; if ($desc instanceof Array) $desc = $desc[1]; FESpotLightElement.prototype = $desc; FESpotLightElement.prototype.get$x = function(receiver) { return receiver.x; }; FESpotLightElement.prototype.get$y = function(receiver) { return receiver.y; }; function FETileElement() { } FETileElement.builtin$cls = "FETileElement"; if (!"name" in FETileElement) FETileElement.name = "FETileElement"; $desc = $collectedClasses.FETileElement; if ($desc instanceof Array) $desc = $desc[1]; FETileElement.prototype = $desc; FETileElement.prototype.get$x = function(receiver) { return receiver.x; }; FETileElement.prototype.get$y = function(receiver) { return receiver.y; }; function FETurbulenceElement() { } FETurbulenceElement.builtin$cls = "FETurbulenceElement"; if (!"name" in FETurbulenceElement) FETurbulenceElement.name = "FETurbulenceElement"; $desc = $collectedClasses.FETurbulenceElement; if ($desc instanceof Array) $desc = $desc[1]; FETurbulenceElement.prototype = $desc; FETurbulenceElement.prototype.get$x = function(receiver) { return receiver.x; }; FETurbulenceElement.prototype.get$y = function(receiver) { return receiver.y; }; function FilterElement() { } FilterElement.builtin$cls = "FilterElement"; if (!"name" in FilterElement) FilterElement.name = "FilterElement"; $desc = $collectedClasses.FilterElement; if ($desc instanceof Array) $desc = $desc[1]; FilterElement.prototype = $desc; FilterElement.prototype.get$x = function(receiver) { return receiver.x; }; FilterElement.prototype.get$y = function(receiver) { return receiver.y; }; function ForeignObjectElement() { } ForeignObjectElement.builtin$cls = "ForeignObjectElement"; if (!"name" in ForeignObjectElement) ForeignObjectElement.name = "ForeignObjectElement"; $desc = $collectedClasses.ForeignObjectElement; if ($desc instanceof Array) $desc = $desc[1]; ForeignObjectElement.prototype = $desc; ForeignObjectElement.prototype.get$x = function(receiver) { return receiver.x; }; ForeignObjectElement.prototype.get$y = function(receiver) { return receiver.y; }; function GElement() { } GElement.builtin$cls = "GElement"; if (!"name" in GElement) GElement.name = "GElement"; $desc = $collectedClasses.GElement; if ($desc instanceof Array) $desc = $desc[1]; GElement.prototype = $desc; function GraphicsElement() { } GraphicsElement.builtin$cls = "GraphicsElement"; if (!"name" in GraphicsElement) GraphicsElement.name = "GraphicsElement"; $desc = $collectedClasses.GraphicsElement; if ($desc instanceof Array) $desc = $desc[1]; GraphicsElement.prototype = $desc; function ImageElement0() { } ImageElement0.builtin$cls = "ImageElement0"; if (!"name" in ImageElement0) ImageElement0.name = "ImageElement0"; $desc = $collectedClasses.ImageElement0; if ($desc instanceof Array) $desc = $desc[1]; ImageElement0.prototype = $desc; ImageElement0.prototype.get$x = function(receiver) { return receiver.x; }; ImageElement0.prototype.get$y = function(receiver) { return receiver.y; }; function LineElement() { } LineElement.builtin$cls = "LineElement"; if (!"name" in LineElement) LineElement.name = "LineElement"; $desc = $collectedClasses.LineElement; if ($desc instanceof Array) $desc = $desc[1]; LineElement.prototype = $desc; function LinearGradientElement() { } LinearGradientElement.builtin$cls = "LinearGradientElement"; if (!"name" in LinearGradientElement) LinearGradientElement.name = "LinearGradientElement"; $desc = $collectedClasses.LinearGradientElement; if ($desc instanceof Array) $desc = $desc[1]; LinearGradientElement.prototype = $desc; function MarkerElement() { } MarkerElement.builtin$cls = "MarkerElement"; if (!"name" in MarkerElement) MarkerElement.name = "MarkerElement"; $desc = $collectedClasses.MarkerElement; if ($desc instanceof Array) $desc = $desc[1]; MarkerElement.prototype = $desc; function MaskElement() { } MaskElement.builtin$cls = "MaskElement"; if (!"name" in MaskElement) MaskElement.name = "MaskElement"; $desc = $collectedClasses.MaskElement; if ($desc instanceof Array) $desc = $desc[1]; MaskElement.prototype = $desc; MaskElement.prototype.get$x = function(receiver) { return receiver.x; }; MaskElement.prototype.get$y = function(receiver) { return receiver.y; }; function MetadataElement() { } MetadataElement.builtin$cls = "MetadataElement"; if (!"name" in MetadataElement) MetadataElement.name = "MetadataElement"; $desc = $collectedClasses.MetadataElement; if ($desc instanceof Array) $desc = $desc[1]; MetadataElement.prototype = $desc; function PathElement() { } PathElement.builtin$cls = "PathElement"; if (!"name" in PathElement) PathElement.name = "PathElement"; $desc = $collectedClasses.PathElement; if ($desc instanceof Array) $desc = $desc[1]; PathElement.prototype = $desc; function PatternElement() { } PatternElement.builtin$cls = "PatternElement"; if (!"name" in PatternElement) PatternElement.name = "PatternElement"; $desc = $collectedClasses.PatternElement; if ($desc instanceof Array) $desc = $desc[1]; PatternElement.prototype = $desc; PatternElement.prototype.get$x = function(receiver) { return receiver.x; }; PatternElement.prototype.get$y = function(receiver) { return receiver.y; }; function PolygonElement() { } PolygonElement.builtin$cls = "PolygonElement"; if (!"name" in PolygonElement) PolygonElement.name = "PolygonElement"; $desc = $collectedClasses.PolygonElement; if ($desc instanceof Array) $desc = $desc[1]; PolygonElement.prototype = $desc; function PolylineElement() { } PolylineElement.builtin$cls = "PolylineElement"; if (!"name" in PolylineElement) PolylineElement.name = "PolylineElement"; $desc = $collectedClasses.PolylineElement; if ($desc instanceof Array) $desc = $desc[1]; PolylineElement.prototype = $desc; function RadialGradientElement() { } RadialGradientElement.builtin$cls = "RadialGradientElement"; if (!"name" in RadialGradientElement) RadialGradientElement.name = "RadialGradientElement"; $desc = $collectedClasses.RadialGradientElement; if ($desc instanceof Array) $desc = $desc[1]; RadialGradientElement.prototype = $desc; function RectElement() { } RectElement.builtin$cls = "RectElement"; if (!"name" in RectElement) RectElement.name = "RectElement"; $desc = $collectedClasses.RectElement; if ($desc instanceof Array) $desc = $desc[1]; RectElement.prototype = $desc; RectElement.prototype.get$x = function(receiver) { return receiver.x; }; RectElement.prototype.get$y = function(receiver) { return receiver.y; }; function ScriptElement0() { } ScriptElement0.builtin$cls = "ScriptElement0"; if (!"name" in ScriptElement0) ScriptElement0.name = "ScriptElement0"; $desc = $collectedClasses.ScriptElement0; if ($desc instanceof Array) $desc = $desc[1]; ScriptElement0.prototype = $desc; function SetElement() { } SetElement.builtin$cls = "SetElement"; if (!"name" in SetElement) SetElement.name = "SetElement"; $desc = $collectedClasses.SetElement; if ($desc instanceof Array) $desc = $desc[1]; SetElement.prototype = $desc; function StopElement() { } StopElement.builtin$cls = "StopElement"; if (!"name" in StopElement) StopElement.name = "StopElement"; $desc = $collectedClasses.StopElement; if ($desc instanceof Array) $desc = $desc[1]; StopElement.prototype = $desc; function StyleElement0() { } StyleElement0.builtin$cls = "StyleElement0"; if (!"name" in StyleElement0) StyleElement0.name = "StyleElement0"; $desc = $collectedClasses.StyleElement0; if ($desc instanceof Array) $desc = $desc[1]; StyleElement0.prototype = $desc; function SvgDocument() { } SvgDocument.builtin$cls = "SvgDocument"; if (!"name" in SvgDocument) SvgDocument.name = "SvgDocument"; $desc = $collectedClasses.SvgDocument; if ($desc instanceof Array) $desc = $desc[1]; SvgDocument.prototype = $desc; function SvgElement() { } SvgElement.builtin$cls = "SvgElement"; if (!"name" in SvgElement) SvgElement.name = "SvgElement"; $desc = $collectedClasses.SvgElement; if ($desc instanceof Array) $desc = $desc[1]; SvgElement.prototype = $desc; function SvgSvgElement() { } SvgSvgElement.builtin$cls = "SvgSvgElement"; if (!"name" in SvgSvgElement) SvgSvgElement.name = "SvgSvgElement"; $desc = $collectedClasses.SvgSvgElement; if ($desc instanceof Array) $desc = $desc[1]; SvgSvgElement.prototype = $desc; SvgSvgElement.prototype.get$x = function(receiver) { return receiver.x; }; SvgSvgElement.prototype.get$y = function(receiver) { return receiver.y; }; function SwitchElement() { } SwitchElement.builtin$cls = "SwitchElement"; if (!"name" in SwitchElement) SwitchElement.name = "SwitchElement"; $desc = $collectedClasses.SwitchElement; if ($desc instanceof Array) $desc = $desc[1]; SwitchElement.prototype = $desc; function SymbolElement() { } SymbolElement.builtin$cls = "SymbolElement"; if (!"name" in SymbolElement) SymbolElement.name = "SymbolElement"; $desc = $collectedClasses.SymbolElement; if ($desc instanceof Array) $desc = $desc[1]; SymbolElement.prototype = $desc; function TSpanElement() { } TSpanElement.builtin$cls = "TSpanElement"; if (!"name" in TSpanElement) TSpanElement.name = "TSpanElement"; $desc = $collectedClasses.TSpanElement; if ($desc instanceof Array) $desc = $desc[1]; TSpanElement.prototype = $desc; function TextContentElement() { } TextContentElement.builtin$cls = "TextContentElement"; if (!"name" in TextContentElement) TextContentElement.name = "TextContentElement"; $desc = $collectedClasses.TextContentElement; if ($desc instanceof Array) $desc = $desc[1]; TextContentElement.prototype = $desc; function TextElement() { } TextElement.builtin$cls = "TextElement"; if (!"name" in TextElement) TextElement.name = "TextElement"; $desc = $collectedClasses.TextElement; if ($desc instanceof Array) $desc = $desc[1]; TextElement.prototype = $desc; function TextPathElement() { } TextPathElement.builtin$cls = "TextPathElement"; if (!"name" in TextPathElement) TextPathElement.name = "TextPathElement"; $desc = $collectedClasses.TextPathElement; if ($desc instanceof Array) $desc = $desc[1]; TextPathElement.prototype = $desc; function TextPositioningElement() { } TextPositioningElement.builtin$cls = "TextPositioningElement"; if (!"name" in TextPositioningElement) TextPositioningElement.name = "TextPositioningElement"; $desc = $collectedClasses.TextPositioningElement; if ($desc instanceof Array) $desc = $desc[1]; TextPositioningElement.prototype = $desc; TextPositioningElement.prototype.get$x = function(receiver) { return receiver.x; }; TextPositioningElement.prototype.get$y = function(receiver) { return receiver.y; }; function TitleElement0() { } TitleElement0.builtin$cls = "TitleElement0"; if (!"name" in TitleElement0) TitleElement0.name = "TitleElement0"; $desc = $collectedClasses.TitleElement0; if ($desc instanceof Array) $desc = $desc[1]; TitleElement0.prototype = $desc; function UseElement() { } UseElement.builtin$cls = "UseElement"; if (!"name" in UseElement) UseElement.name = "UseElement"; $desc = $collectedClasses.UseElement; if ($desc instanceof Array) $desc = $desc[1]; UseElement.prototype = $desc; UseElement.prototype.get$x = function(receiver) { return receiver.x; }; UseElement.prototype.get$y = function(receiver) { return receiver.y; }; function ViewElement() { } ViewElement.builtin$cls = "ViewElement"; if (!"name" in ViewElement) ViewElement.name = "ViewElement"; $desc = $collectedClasses.ViewElement; if ($desc instanceof Array) $desc = $desc[1]; ViewElement.prototype = $desc; function ZoomEvent() { } ZoomEvent.builtin$cls = "ZoomEvent"; if (!"name" in ZoomEvent) ZoomEvent.name = "ZoomEvent"; $desc = $collectedClasses.ZoomEvent; if ($desc instanceof Array) $desc = $desc[1]; ZoomEvent.prototype = $desc; function _GradientElement() { } _GradientElement.builtin$cls = "_GradientElement"; if (!"name" in _GradientElement) _GradientElement.name = "_GradientElement"; $desc = $collectedClasses._GradientElement; if ($desc instanceof Array) $desc = $desc[1]; _GradientElement.prototype = $desc; function _SVGAltGlyphDefElement() { } _SVGAltGlyphDefElement.builtin$cls = "_SVGAltGlyphDefElement"; if (!"name" in _SVGAltGlyphDefElement) _SVGAltGlyphDefElement.name = "_SVGAltGlyphDefElement"; $desc = $collectedClasses._SVGAltGlyphDefElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGAltGlyphDefElement.prototype = $desc; function _SVGAltGlyphItemElement() { } _SVGAltGlyphItemElement.builtin$cls = "_SVGAltGlyphItemElement"; if (!"name" in _SVGAltGlyphItemElement) _SVGAltGlyphItemElement.name = "_SVGAltGlyphItemElement"; $desc = $collectedClasses._SVGAltGlyphItemElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGAltGlyphItemElement.prototype = $desc; function _SVGAnimateColorElement() { } _SVGAnimateColorElement.builtin$cls = "_SVGAnimateColorElement"; if (!"name" in _SVGAnimateColorElement) _SVGAnimateColorElement.name = "_SVGAnimateColorElement"; $desc = $collectedClasses._SVGAnimateColorElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGAnimateColorElement.prototype = $desc; function _SVGComponentTransferFunctionElement() { } _SVGComponentTransferFunctionElement.builtin$cls = "_SVGComponentTransferFunctionElement"; if (!"name" in _SVGComponentTransferFunctionElement) _SVGComponentTransferFunctionElement.name = "_SVGComponentTransferFunctionElement"; $desc = $collectedClasses._SVGComponentTransferFunctionElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGComponentTransferFunctionElement.prototype = $desc; function _SVGCursorElement() { } _SVGCursorElement.builtin$cls = "_SVGCursorElement"; if (!"name" in _SVGCursorElement) _SVGCursorElement.name = "_SVGCursorElement"; $desc = $collectedClasses._SVGCursorElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGCursorElement.prototype = $desc; function _SVGFEDropShadowElement() { } _SVGFEDropShadowElement.builtin$cls = "_SVGFEDropShadowElement"; if (!"name" in _SVGFEDropShadowElement) _SVGFEDropShadowElement.name = "_SVGFEDropShadowElement"; $desc = $collectedClasses._SVGFEDropShadowElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFEDropShadowElement.prototype = $desc; function _SVGFontElement() { } _SVGFontElement.builtin$cls = "_SVGFontElement"; if (!"name" in _SVGFontElement) _SVGFontElement.name = "_SVGFontElement"; $desc = $collectedClasses._SVGFontElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontElement.prototype = $desc; function _SVGFontFaceElement() { } _SVGFontFaceElement.builtin$cls = "_SVGFontFaceElement"; if (!"name" in _SVGFontFaceElement) _SVGFontFaceElement.name = "_SVGFontFaceElement"; $desc = $collectedClasses._SVGFontFaceElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontFaceElement.prototype = $desc; function _SVGFontFaceFormatElement() { } _SVGFontFaceFormatElement.builtin$cls = "_SVGFontFaceFormatElement"; if (!"name" in _SVGFontFaceFormatElement) _SVGFontFaceFormatElement.name = "_SVGFontFaceFormatElement"; $desc = $collectedClasses._SVGFontFaceFormatElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontFaceFormatElement.prototype = $desc; function _SVGFontFaceNameElement() { } _SVGFontFaceNameElement.builtin$cls = "_SVGFontFaceNameElement"; if (!"name" in _SVGFontFaceNameElement) _SVGFontFaceNameElement.name = "_SVGFontFaceNameElement"; $desc = $collectedClasses._SVGFontFaceNameElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontFaceNameElement.prototype = $desc; function _SVGFontFaceSrcElement() { } _SVGFontFaceSrcElement.builtin$cls = "_SVGFontFaceSrcElement"; if (!"name" in _SVGFontFaceSrcElement) _SVGFontFaceSrcElement.name = "_SVGFontFaceSrcElement"; $desc = $collectedClasses._SVGFontFaceSrcElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontFaceSrcElement.prototype = $desc; function _SVGFontFaceUriElement() { } _SVGFontFaceUriElement.builtin$cls = "_SVGFontFaceUriElement"; if (!"name" in _SVGFontFaceUriElement) _SVGFontFaceUriElement.name = "_SVGFontFaceUriElement"; $desc = $collectedClasses._SVGFontFaceUriElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGFontFaceUriElement.prototype = $desc; function _SVGGlyphElement() { } _SVGGlyphElement.builtin$cls = "_SVGGlyphElement"; if (!"name" in _SVGGlyphElement) _SVGGlyphElement.name = "_SVGGlyphElement"; $desc = $collectedClasses._SVGGlyphElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGGlyphElement.prototype = $desc; function _SVGGlyphRefElement() { } _SVGGlyphRefElement.builtin$cls = "_SVGGlyphRefElement"; if (!"name" in _SVGGlyphRefElement) _SVGGlyphRefElement.name = "_SVGGlyphRefElement"; $desc = $collectedClasses._SVGGlyphRefElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGGlyphRefElement.prototype = $desc; function _SVGHKernElement() { } _SVGHKernElement.builtin$cls = "_SVGHKernElement"; if (!"name" in _SVGHKernElement) _SVGHKernElement.name = "_SVGHKernElement"; $desc = $collectedClasses._SVGHKernElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGHKernElement.prototype = $desc; function _SVGMPathElement() { } _SVGMPathElement.builtin$cls = "_SVGMPathElement"; if (!"name" in _SVGMPathElement) _SVGMPathElement.name = "_SVGMPathElement"; $desc = $collectedClasses._SVGMPathElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGMPathElement.prototype = $desc; function _SVGMissingGlyphElement() { } _SVGMissingGlyphElement.builtin$cls = "_SVGMissingGlyphElement"; if (!"name" in _SVGMissingGlyphElement) _SVGMissingGlyphElement.name = "_SVGMissingGlyphElement"; $desc = $collectedClasses._SVGMissingGlyphElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGMissingGlyphElement.prototype = $desc; function _SVGVKernElement() { } _SVGVKernElement.builtin$cls = "_SVGVKernElement"; if (!"name" in _SVGVKernElement) _SVGVKernElement.name = "_SVGVKernElement"; $desc = $collectedClasses._SVGVKernElement; if ($desc instanceof Array) $desc = $desc[1]; _SVGVKernElement.prototype = $desc; function AudioProcessingEvent() { } AudioProcessingEvent.builtin$cls = "AudioProcessingEvent"; if (!"name" in AudioProcessingEvent) AudioProcessingEvent.name = "AudioProcessingEvent"; $desc = $collectedClasses.AudioProcessingEvent; if ($desc instanceof Array) $desc = $desc[1]; AudioProcessingEvent.prototype = $desc; function OfflineAudioCompletionEvent() { } OfflineAudioCompletionEvent.builtin$cls = "OfflineAudioCompletionEvent"; if (!"name" in OfflineAudioCompletionEvent) OfflineAudioCompletionEvent.name = "OfflineAudioCompletionEvent"; $desc = $collectedClasses.OfflineAudioCompletionEvent; if ($desc instanceof Array) $desc = $desc[1]; OfflineAudioCompletionEvent.prototype = $desc; function ContextEvent() { } ContextEvent.builtin$cls = "ContextEvent"; if (!"name" in ContextEvent) ContextEvent.name = "ContextEvent"; $desc = $collectedClasses.ContextEvent; if ($desc instanceof Array) $desc = $desc[1]; ContextEvent.prototype = $desc; function SqlError() { } SqlError.builtin$cls = "SqlError"; if (!"name" in SqlError) SqlError.name = "SqlError"; $desc = $collectedClasses.SqlError; if ($desc instanceof Array) $desc = $desc[1]; SqlError.prototype = $desc; function TypedData() { } TypedData.builtin$cls = "TypedData"; if (!"name" in TypedData) TypedData.name = "TypedData"; $desc = $collectedClasses.TypedData; if ($desc instanceof Array) $desc = $desc[1]; TypedData.prototype = $desc; function Uint8List() { } Uint8List.builtin$cls = "Uint8List"; if (!"name" in Uint8List) Uint8List.name = "Uint8List"; $desc = $collectedClasses.Uint8List; if ($desc instanceof Array) $desc = $desc[1]; Uint8List.prototype = $desc; function JS_CONST(code) { this.code = code; } JS_CONST.builtin$cls = "JS_CONST"; if (!"name" in JS_CONST) JS_CONST.name = "JS_CONST"; $desc = $collectedClasses.JS_CONST; if ($desc instanceof Array) $desc = $desc[1]; JS_CONST.prototype = $desc; function Interceptor() { } Interceptor.builtin$cls = "Interceptor"; if (!"name" in Interceptor) Interceptor.name = "Interceptor"; $desc = $collectedClasses.Interceptor; if ($desc instanceof Array) $desc = $desc[1]; Interceptor.prototype = $desc; function JSBool() { } JSBool.builtin$cls = "bool"; if (!"name" in JSBool) JSBool.name = "JSBool"; $desc = $collectedClasses.JSBool; if ($desc instanceof Array) $desc = $desc[1]; JSBool.prototype = $desc; function JSNull() { } JSNull.builtin$cls = "JSNull"; if (!"name" in JSNull) JSNull.name = "JSNull"; $desc = $collectedClasses.JSNull; if ($desc instanceof Array) $desc = $desc[1]; JSNull.prototype = $desc; function JavaScriptObject() { } JavaScriptObject.builtin$cls = "JavaScriptObject"; if (!"name" in JavaScriptObject) JavaScriptObject.name = "JavaScriptObject"; $desc = $collectedClasses.JavaScriptObject; if ($desc instanceof Array) $desc = $desc[1]; JavaScriptObject.prototype = $desc; function PlainJavaScriptObject() { } PlainJavaScriptObject.builtin$cls = "PlainJavaScriptObject"; if (!"name" in PlainJavaScriptObject) PlainJavaScriptObject.name = "PlainJavaScriptObject"; $desc = $collectedClasses.PlainJavaScriptObject; if ($desc instanceof Array) $desc = $desc[1]; PlainJavaScriptObject.prototype = $desc; function UnknownJavaScriptObject() { } UnknownJavaScriptObject.builtin$cls = "UnknownJavaScriptObject"; if (!"name" in UnknownJavaScriptObject) UnknownJavaScriptObject.name = "UnknownJavaScriptObject"; $desc = $collectedClasses.UnknownJavaScriptObject; if ($desc instanceof Array) $desc = $desc[1]; UnknownJavaScriptObject.prototype = $desc; function JSArray() { } JSArray.builtin$cls = "List"; if (!"name" in JSArray) JSArray.name = "JSArray"; $desc = $collectedClasses.JSArray; if ($desc instanceof Array) $desc = $desc[1]; JSArray.prototype = $desc; function JSNumber() { } JSNumber.builtin$cls = "num"; if (!"name" in JSNumber) JSNumber.name = "JSNumber"; $desc = $collectedClasses.JSNumber; if ($desc instanceof Array) $desc = $desc[1]; JSNumber.prototype = $desc; function JSInt() { } JSInt.builtin$cls = "int"; if (!"name" in JSInt) JSInt.name = "JSInt"; $desc = $collectedClasses.JSInt; if ($desc instanceof Array) $desc = $desc[1]; JSInt.prototype = $desc; function JSDouble() { } JSDouble.builtin$cls = "double"; if (!"name" in JSDouble) JSDouble.name = "JSDouble"; $desc = $collectedClasses.JSDouble; if ($desc instanceof Array) $desc = $desc[1]; JSDouble.prototype = $desc; function JSString() { } JSString.builtin$cls = "String"; if (!"name" in JSString) JSString.name = "JSString"; $desc = $collectedClasses.JSString; if ($desc instanceof Array) $desc = $desc[1]; JSString.prototype = $desc; function startRootIsolate_closure(entry_0) { this.entry_0 = entry_0; } startRootIsolate_closure.builtin$cls = "startRootIsolate_closure"; if (!"name" in startRootIsolate_closure) startRootIsolate_closure.name = "startRootIsolate_closure"; $desc = $collectedClasses.startRootIsolate_closure; if ($desc instanceof Array) $desc = $desc[1]; startRootIsolate_closure.prototype = $desc; function startRootIsolate_closure0(entry_1) { this.entry_1 = entry_1; } startRootIsolate_closure0.builtin$cls = "startRootIsolate_closure0"; if (!"name" in startRootIsolate_closure0) startRootIsolate_closure0.name = "startRootIsolate_closure0"; $desc = $collectedClasses.startRootIsolate_closure0; if ($desc instanceof Array) $desc = $desc[1]; startRootIsolate_closure0.prototype = $desc; function _Manager(nextIsolateId, currentManagerId, nextManagerId, currentContext, rootContext, topEventLoop, fromCommandLine, isWorker, supportsWorkers, isolates, mainManager, managers, entry) { this.nextIsolateId = nextIsolateId; this.currentManagerId = currentManagerId; this.nextManagerId = nextManagerId; this.currentContext = currentContext; this.rootContext = rootContext; this.topEventLoop = topEventLoop; this.fromCommandLine = fromCommandLine; this.isWorker = isWorker; this.supportsWorkers = supportsWorkers; this.isolates = isolates; this.mainManager = mainManager; this.managers = managers; this.entry = entry; } _Manager.builtin$cls = "_Manager"; if (!"name" in _Manager) _Manager.name = "_Manager"; $desc = $collectedClasses._Manager; if ($desc instanceof Array) $desc = $desc[1]; _Manager.prototype = $desc; function _IsolateContext(id, ports, weakPorts, isolateStatics) { this.id = id; this.ports = ports; this.weakPorts = weakPorts; this.isolateStatics = isolateStatics; } _IsolateContext.builtin$cls = "_IsolateContext"; if (!"name" in _IsolateContext) _IsolateContext.name = "_IsolateContext"; $desc = $collectedClasses._IsolateContext; if ($desc instanceof Array) $desc = $desc[1]; _IsolateContext.prototype = $desc; _IsolateContext.prototype.get$isolateStatics = function() { return this.isolateStatics; }; function _EventLoop(events, activeTimerCount) { this.events = events; this.activeTimerCount = activeTimerCount; } _EventLoop.builtin$cls = "_EventLoop"; if (!"name" in _EventLoop) _EventLoop.name = "_EventLoop"; $desc = $collectedClasses._EventLoop; if ($desc instanceof Array) $desc = $desc[1]; _EventLoop.prototype = $desc; function _EventLoop__runHelper_next(this_0) { this.this_0 = this_0; } _EventLoop__runHelper_next.builtin$cls = "_EventLoop__runHelper_next"; if (!"name" in _EventLoop__runHelper_next) _EventLoop__runHelper_next.name = "_EventLoop__runHelper_next"; $desc = $collectedClasses._EventLoop__runHelper_next; if ($desc instanceof Array) $desc = $desc[1]; _EventLoop__runHelper_next.prototype = $desc; function _IsolateEvent(isolate, fn, message) { this.isolate = isolate; this.fn = fn; this.message = message; } _IsolateEvent.builtin$cls = "_IsolateEvent"; if (!"name" in _IsolateEvent) _IsolateEvent.name = "_IsolateEvent"; $desc = $collectedClasses._IsolateEvent; if ($desc instanceof Array) $desc = $desc[1]; _IsolateEvent.prototype = $desc; function _MainManagerStub() { } _MainManagerStub.builtin$cls = "_MainManagerStub"; if (!"name" in _MainManagerStub) _MainManagerStub.name = "_MainManagerStub"; $desc = $collectedClasses._MainManagerStub; if ($desc instanceof Array) $desc = $desc[1]; _MainManagerStub.prototype = $desc; function IsolateNatives__processWorkerMessage_closure(entryPoint_0, args_1, message_2, isSpawnUri_3, replyTo_4) { this.entryPoint_0 = entryPoint_0; this.args_1 = args_1; this.message_2 = message_2; this.isSpawnUri_3 = isSpawnUri_3; this.replyTo_4 = replyTo_4; } IsolateNatives__processWorkerMessage_closure.builtin$cls = "IsolateNatives__processWorkerMessage_closure"; if (!"name" in IsolateNatives__processWorkerMessage_closure) IsolateNatives__processWorkerMessage_closure.name = "IsolateNatives__processWorkerMessage_closure"; $desc = $collectedClasses.IsolateNatives__processWorkerMessage_closure; if ($desc instanceof Array) $desc = $desc[1]; IsolateNatives__processWorkerMessage_closure.prototype = $desc; function _BaseSendPort() { } _BaseSendPort.builtin$cls = "_BaseSendPort"; if (!"name" in _BaseSendPort) _BaseSendPort.name = "_BaseSendPort"; $desc = $collectedClasses._BaseSendPort; if ($desc instanceof Array) $desc = $desc[1]; _BaseSendPort.prototype = $desc; function _NativeJsSendPort(_receivePort, _isolateId) { this._receivePort = _receivePort; this._isolateId = _isolateId; } _NativeJsSendPort.builtin$cls = "_NativeJsSendPort"; if (!"name" in _NativeJsSendPort) _NativeJsSendPort.name = "_NativeJsSendPort"; $desc = $collectedClasses._NativeJsSendPort; if ($desc instanceof Array) $desc = $desc[1]; _NativeJsSendPort.prototype = $desc; function _NativeJsSendPort_send_closure(box_0, this_1, shouldSerialize_2) { this.box_0 = box_0; this.this_1 = this_1; this.shouldSerialize_2 = shouldSerialize_2; } _NativeJsSendPort_send_closure.builtin$cls = "_NativeJsSendPort_send_closure"; if (!"name" in _NativeJsSendPort_send_closure) _NativeJsSendPort_send_closure.name = "_NativeJsSendPort_send_closure"; $desc = $collectedClasses._NativeJsSendPort_send_closure; if ($desc instanceof Array) $desc = $desc[1]; _NativeJsSendPort_send_closure.prototype = $desc; function _WorkerSendPort(_workerId, _receivePortId, _isolateId) { this._workerId = _workerId; this._receivePortId = _receivePortId; this._isolateId = _isolateId; } _WorkerSendPort.builtin$cls = "_WorkerSendPort"; if (!"name" in _WorkerSendPort) _WorkerSendPort.name = "_WorkerSendPort"; $desc = $collectedClasses._WorkerSendPort; if ($desc instanceof Array) $desc = $desc[1]; _WorkerSendPort.prototype = $desc; function RawReceivePortImpl(_id, _handler, _isClosed) { this._id = _id; this._handler = _handler; this._isClosed = _isClosed; } RawReceivePortImpl.builtin$cls = "RawReceivePortImpl"; if (!"name" in RawReceivePortImpl) RawReceivePortImpl.name = "RawReceivePortImpl"; $desc = $collectedClasses.RawReceivePortImpl; if ($desc instanceof Array) $desc = $desc[1]; RawReceivePortImpl.prototype = $desc; RawReceivePortImpl.prototype.get$_id = function() { return this._id; }; RawReceivePortImpl.prototype.get$_isClosed = function() { return this._isClosed; }; function ReceivePortImpl(_rawPort, _controller) { this._rawPort = _rawPort; this._controller = _controller; } ReceivePortImpl.builtin$cls = "ReceivePortImpl"; if (!"name" in ReceivePortImpl) ReceivePortImpl.name = "ReceivePortImpl"; $desc = $collectedClasses.ReceivePortImpl; if ($desc instanceof Array) $desc = $desc[1]; ReceivePortImpl.prototype = $desc; function _JsSerializer(_nextFreeRefId, _visited) { this._nextFreeRefId = _nextFreeRefId; this._visited = _visited; } _JsSerializer.builtin$cls = "_JsSerializer"; if (!"name" in _JsSerializer) _JsSerializer.name = "_JsSerializer"; $desc = $collectedClasses._JsSerializer; if ($desc instanceof Array) $desc = $desc[1]; _JsSerializer.prototype = $desc; function _JsCopier(_visited) { this._visited = _visited; } _JsCopier.builtin$cls = "_JsCopier"; if (!"name" in _JsCopier) _JsCopier.name = "_JsCopier"; $desc = $collectedClasses._JsCopier; if ($desc instanceof Array) $desc = $desc[1]; _JsCopier.prototype = $desc; function _JsDeserializer(_deserialized) { this._deserialized = _deserialized; } _JsDeserializer.builtin$cls = "_JsDeserializer"; if (!"name" in _JsDeserializer) _JsDeserializer.name = "_JsDeserializer"; $desc = $collectedClasses._JsDeserializer; if ($desc instanceof Array) $desc = $desc[1]; _JsDeserializer.prototype = $desc; function _JsVisitedMap(tagged) { this.tagged = tagged; } _JsVisitedMap.builtin$cls = "_JsVisitedMap"; if (!"name" in _JsVisitedMap) _JsVisitedMap.name = "_JsVisitedMap"; $desc = $collectedClasses._JsVisitedMap; if ($desc instanceof Array) $desc = $desc[1]; _JsVisitedMap.prototype = $desc; function _MessageTraverserVisitedMap() { } _MessageTraverserVisitedMap.builtin$cls = "_MessageTraverserVisitedMap"; if (!"name" in _MessageTraverserVisitedMap) _MessageTraverserVisitedMap.name = "_MessageTraverserVisitedMap"; $desc = $collectedClasses._MessageTraverserVisitedMap; if ($desc instanceof Array) $desc = $desc[1]; _MessageTraverserVisitedMap.prototype = $desc; function _MessageTraverser() { } _MessageTraverser.builtin$cls = "_MessageTraverser"; if (!"name" in _MessageTraverser) _MessageTraverser.name = "_MessageTraverser"; $desc = $collectedClasses._MessageTraverser; if ($desc instanceof Array) $desc = $desc[1]; _MessageTraverser.prototype = $desc; function _Copier() { } _Copier.builtin$cls = "_Copier"; if (!"name" in _Copier) _Copier.name = "_Copier"; $desc = $collectedClasses._Copier; if ($desc instanceof Array) $desc = $desc[1]; _Copier.prototype = $desc; function _Copier_visitMap_closure(box_0, this_1) { this.box_0 = box_0; this.this_1 = this_1; } _Copier_visitMap_closure.builtin$cls = "_Copier_visitMap_closure"; if (!"name" in _Copier_visitMap_closure) _Copier_visitMap_closure.name = "_Copier_visitMap_closure"; $desc = $collectedClasses._Copier_visitMap_closure; if ($desc instanceof Array) $desc = $desc[1]; _Copier_visitMap_closure.prototype = $desc; function _Serializer() { } _Serializer.builtin$cls = "_Serializer"; if (!"name" in _Serializer) _Serializer.name = "_Serializer"; $desc = $collectedClasses._Serializer; if ($desc instanceof Array) $desc = $desc[1]; _Serializer.prototype = $desc; function _Deserializer() { } _Deserializer.builtin$cls = "_Deserializer"; if (!"name" in _Deserializer) _Deserializer.name = "_Deserializer"; $desc = $collectedClasses._Deserializer; if ($desc instanceof Array) $desc = $desc[1]; _Deserializer.prototype = $desc; function TimerImpl(_once, _inEventLoop, _handle) { this._once = _once; this._inEventLoop = _inEventLoop; this._handle = _handle; } TimerImpl.builtin$cls = "TimerImpl"; if (!"name" in TimerImpl) TimerImpl.name = "TimerImpl"; $desc = $collectedClasses.TimerImpl; if ($desc instanceof Array) $desc = $desc[1]; TimerImpl.prototype = $desc; function TimerImpl_internalCallback(this_0, callback_1) { this.this_0 = this_0; this.callback_1 = callback_1; } TimerImpl_internalCallback.builtin$cls = "TimerImpl_internalCallback"; if (!"name" in TimerImpl_internalCallback) TimerImpl_internalCallback.name = "TimerImpl_internalCallback"; $desc = $collectedClasses.TimerImpl_internalCallback; if ($desc instanceof Array) $desc = $desc[1]; TimerImpl_internalCallback.prototype = $desc; function TimerImpl_internalCallback0(this_2, callback_3) { this.this_2 = this_2; this.callback_3 = callback_3; } TimerImpl_internalCallback0.builtin$cls = "TimerImpl_internalCallback0"; if (!"name" in TimerImpl_internalCallback0) TimerImpl_internalCallback0.name = "TimerImpl_internalCallback0"; $desc = $collectedClasses.TimerImpl_internalCallback0; if ($desc instanceof Array) $desc = $desc[1]; TimerImpl_internalCallback0.prototype = $desc; function ReflectionInfo(jsFunction, data, isAccessor, requiredParameterCount, optionalParameterCount, areOptionalParametersNamed, functionType) { this.jsFunction = jsFunction; this.data = data; this.isAccessor = isAccessor; this.requiredParameterCount = requiredParameterCount; this.optionalParameterCount = optionalParameterCount; this.areOptionalParametersNamed = areOptionalParametersNamed; this.functionType = functionType; } ReflectionInfo.builtin$cls = "ReflectionInfo"; if (!"name" in ReflectionInfo) ReflectionInfo.name = "ReflectionInfo"; $desc = $collectedClasses.ReflectionInfo; if ($desc instanceof Array) $desc = $desc[1]; ReflectionInfo.prototype = $desc; function TypeErrorDecoder(_pattern, _arguments, _argumentsExpr, _expr, _method, _receiver) { this._pattern = _pattern; this._arguments = _arguments; this._argumentsExpr = _argumentsExpr; this._expr = _expr; this._method = _method; this._receiver = _receiver; } TypeErrorDecoder.builtin$cls = "TypeErrorDecoder"; if (!"name" in TypeErrorDecoder) TypeErrorDecoder.name = "TypeErrorDecoder"; $desc = $collectedClasses.TypeErrorDecoder; if ($desc instanceof Array) $desc = $desc[1]; TypeErrorDecoder.prototype = $desc; TypeErrorDecoder.prototype.get$_receiver = function() { return this._receiver; }; function NullError(_message, _method) { this._message = _message; this._method = _method; } NullError.builtin$cls = "NullError"; if (!"name" in NullError) NullError.name = "NullError"; $desc = $collectedClasses.NullError; if ($desc instanceof Array) $desc = $desc[1]; NullError.prototype = $desc; function JsNoSuchMethodError(_message, _method, _receiver) { this._message = _message; this._method = _method; this._receiver = _receiver; } JsNoSuchMethodError.builtin$cls = "JsNoSuchMethodError"; if (!"name" in JsNoSuchMethodError) JsNoSuchMethodError.name = "JsNoSuchMethodError"; $desc = $collectedClasses.JsNoSuchMethodError; if ($desc instanceof Array) $desc = $desc[1]; JsNoSuchMethodError.prototype = $desc; JsNoSuchMethodError.prototype.get$_receiver = function() { return this._receiver; }; function UnknownJsTypeError(_message) { this._message = _message; } UnknownJsTypeError.builtin$cls = "UnknownJsTypeError"; if (!"name" in UnknownJsTypeError) UnknownJsTypeError.name = "UnknownJsTypeError"; $desc = $collectedClasses.UnknownJsTypeError; if ($desc instanceof Array) $desc = $desc[1]; UnknownJsTypeError.prototype = $desc; function unwrapException_saveStackTrace(ex_0) { this.ex_0 = ex_0; } unwrapException_saveStackTrace.builtin$cls = "unwrapException_saveStackTrace"; if (!"name" in unwrapException_saveStackTrace) unwrapException_saveStackTrace.name = "unwrapException_saveStackTrace"; $desc = $collectedClasses.unwrapException_saveStackTrace; if ($desc instanceof Array) $desc = $desc[1]; unwrapException_saveStackTrace.prototype = $desc; function _StackTrace(_exception, _trace) { this._exception = _exception; this._trace = _trace; } _StackTrace.builtin$cls = "_StackTrace"; if (!"name" in _StackTrace) _StackTrace.name = "_StackTrace"; $desc = $collectedClasses._StackTrace; if ($desc instanceof Array) $desc = $desc[1]; _StackTrace.prototype = $desc; function invokeClosure_closure(closure_0) { this.closure_0 = closure_0; } invokeClosure_closure.builtin$cls = "invokeClosure_closure"; if (!"name" in invokeClosure_closure) invokeClosure_closure.name = "invokeClosure_closure"; $desc = $collectedClasses.invokeClosure_closure; if ($desc instanceof Array) $desc = $desc[1]; invokeClosure_closure.prototype = $desc; function invokeClosure_closure0(closure_1, arg1_2) { this.closure_1 = closure_1; this.arg1_2 = arg1_2; } invokeClosure_closure0.builtin$cls = "invokeClosure_closure0"; if (!"name" in invokeClosure_closure0) invokeClosure_closure0.name = "invokeClosure_closure0"; $desc = $collectedClasses.invokeClosure_closure0; if ($desc instanceof Array) $desc = $desc[1]; invokeClosure_closure0.prototype = $desc; function invokeClosure_closure1(closure_3, arg1_4, arg2_5) { this.closure_3 = closure_3; this.arg1_4 = arg1_4; this.arg2_5 = arg2_5; } invokeClosure_closure1.builtin$cls = "invokeClosure_closure1"; if (!"name" in invokeClosure_closure1) invokeClosure_closure1.name = "invokeClosure_closure1"; $desc = $collectedClasses.invokeClosure_closure1; if ($desc instanceof Array) $desc = $desc[1]; invokeClosure_closure1.prototype = $desc; function invokeClosure_closure2(closure_6, arg1_7, arg2_8, arg3_9) { this.closure_6 = closure_6; this.arg1_7 = arg1_7; this.arg2_8 = arg2_8; this.arg3_9 = arg3_9; } invokeClosure_closure2.builtin$cls = "invokeClosure_closure2"; if (!"name" in invokeClosure_closure2) invokeClosure_closure2.name = "invokeClosure_closure2"; $desc = $collectedClasses.invokeClosure_closure2; if ($desc instanceof Array) $desc = $desc[1]; invokeClosure_closure2.prototype = $desc; function invokeClosure_closure3(closure_10, arg1_11, arg2_12, arg3_13, arg4_14) { this.closure_10 = closure_10; this.arg1_11 = arg1_11; this.arg2_12 = arg2_12; this.arg3_13 = arg3_13; this.arg4_14 = arg4_14; } invokeClosure_closure3.builtin$cls = "invokeClosure_closure3"; if (!"name" in invokeClosure_closure3) invokeClosure_closure3.name = "invokeClosure_closure3"; $desc = $collectedClasses.invokeClosure_closure3; if ($desc instanceof Array) $desc = $desc[1]; invokeClosure_closure3.prototype = $desc; function Closure() { } Closure.builtin$cls = "Closure"; if (!"name" in Closure) Closure.name = "Closure"; $desc = $collectedClasses.Closure; if ($desc instanceof Array) $desc = $desc[1]; Closure.prototype = $desc; function TearOffClosure() { } TearOffClosure.builtin$cls = "TearOffClosure"; if (!"name" in TearOffClosure) TearOffClosure.name = "TearOffClosure"; $desc = $collectedClasses.TearOffClosure; if ($desc instanceof Array) $desc = $desc[1]; TearOffClosure.prototype = $desc; function BoundClosure(_self, _target, _receiver, __js_helper$_name) { this._self = _self; this._target = _target; this._receiver = _receiver; this.__js_helper$_name = __js_helper$_name; } BoundClosure.builtin$cls = "BoundClosure"; if (!"name" in BoundClosure) BoundClosure.name = "BoundClosure"; $desc = $collectedClasses.BoundClosure; if ($desc instanceof Array) $desc = $desc[1]; BoundClosure.prototype = $desc; BoundClosure.prototype.get$_self = function() { return this._self; }; BoundClosure.prototype.get$_receiver = function() { return this._receiver; }; function RuntimeError(message) { this.message = message; } RuntimeError.builtin$cls = "RuntimeError"; if (!"name" in RuntimeError) RuntimeError.name = "RuntimeError"; $desc = $collectedClasses.RuntimeError; if ($desc instanceof Array) $desc = $desc[1]; RuntimeError.prototype = $desc; function RuntimeType() { } RuntimeType.builtin$cls = "RuntimeType"; if (!"name" in RuntimeType) RuntimeType.name = "RuntimeType"; $desc = $collectedClasses.RuntimeType; if ($desc instanceof Array) $desc = $desc[1]; RuntimeType.prototype = $desc; function RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, namedParameters) { this.returnType = returnType; this.parameterTypes = parameterTypes; this.optionalParameterTypes = optionalParameterTypes; this.namedParameters = namedParameters; } RuntimeFunctionType.builtin$cls = "RuntimeFunctionType"; if (!"name" in RuntimeFunctionType) RuntimeFunctionType.name = "RuntimeFunctionType"; $desc = $collectedClasses.RuntimeFunctionType; if ($desc instanceof Array) $desc = $desc[1]; RuntimeFunctionType.prototype = $desc; function DynamicRuntimeType() { } DynamicRuntimeType.builtin$cls = "DynamicRuntimeType"; if (!"name" in DynamicRuntimeType) DynamicRuntimeType.name = "DynamicRuntimeType"; $desc = $collectedClasses.DynamicRuntimeType; if ($desc instanceof Array) $desc = $desc[1]; DynamicRuntimeType.prototype = $desc; function TypeImpl(_typeName, _unmangledName) { this._typeName = _typeName; this._unmangledName = _unmangledName; } TypeImpl.builtin$cls = "TypeImpl"; if (!"name" in TypeImpl) TypeImpl.name = "TypeImpl"; $desc = $collectedClasses.TypeImpl; if ($desc instanceof Array) $desc = $desc[1]; TypeImpl.prototype = $desc; function initHooks_closure(getTag_0) { this.getTag_0 = getTag_0; } initHooks_closure.builtin$cls = "initHooks_closure"; if (!"name" in initHooks_closure) initHooks_closure.name = "initHooks_closure"; $desc = $collectedClasses.initHooks_closure; if ($desc instanceof Array) $desc = $desc[1]; initHooks_closure.prototype = $desc; function initHooks_closure0(getUnknownTag_1) { this.getUnknownTag_1 = getUnknownTag_1; } initHooks_closure0.builtin$cls = "initHooks_closure0"; if (!"name" in initHooks_closure0) initHooks_closure0.name = "initHooks_closure0"; $desc = $collectedClasses.initHooks_closure0; if ($desc instanceof Array) $desc = $desc[1]; initHooks_closure0.prototype = $desc; function initHooks_closure1(prototypeForTag_2) { this.prototypeForTag_2 = prototypeForTag_2; } initHooks_closure1.builtin$cls = "initHooks_closure1"; if (!"name" in initHooks_closure1) initHooks_closure1.name = "initHooks_closure1"; $desc = $collectedClasses.initHooks_closure1; if ($desc instanceof Array) $desc = $desc[1]; initHooks_closure1.prototype = $desc; function Balls(root, lastTime, balls) { this.root = root; this.lastTime = lastTime; this.balls = balls; } Balls.builtin$cls = "Balls"; if (!"name" in Balls) Balls.name = "Balls"; $desc = $collectedClasses.Balls; if ($desc instanceof Array) $desc = $desc[1]; Balls.prototype = $desc; function Balls_tick_closure(delta_0) { this.delta_0 = delta_0; } Balls_tick_closure.builtin$cls = "Balls_tick_closure"; if (!"name" in Balls_tick_closure) Balls_tick_closure.name = "Balls_tick_closure"; $desc = $collectedClasses.Balls_tick_closure; if ($desc instanceof Array) $desc = $desc[1]; Balls_tick_closure.prototype = $desc; function Balls_collideBalls_closure(this_0, delta_1) { this.this_0 = this_0; this.delta_1 = delta_1; } Balls_collideBalls_closure.builtin$cls = "Balls_collideBalls_closure"; if (!"name" in Balls_collideBalls_closure) Balls_collideBalls_closure.name = "Balls_collideBalls_closure"; $desc = $collectedClasses.Balls_collideBalls_closure; if ($desc instanceof Array) $desc = $desc[1]; Balls_collideBalls_closure.prototype = $desc; function Balls_collideBalls__closure(this_2, delta_3, b0_4) { this.this_2 = this_2; this.delta_3 = delta_3; this.b0_4 = b0_4; } Balls_collideBalls__closure.builtin$cls = "Balls_collideBalls__closure"; if (!"name" in Balls_collideBalls__closure) Balls_collideBalls__closure.name = "Balls_collideBalls__closure"; $desc = $collectedClasses.Balls_collideBalls__closure; if ($desc instanceof Array) $desc = $desc[1]; Balls_collideBalls__closure.prototype = $desc; function Ball(root, elem, x, y, vx, vy, ax, ay, age) { this.root = root; this.elem = elem; this.x = x; this.y = y; this.vx = vx; this.vy = vy; this.ax = ax; this.ay = ay; this.age = age; } Ball.builtin$cls = "Ball"; if (!"name" in Ball) Ball.name = "Ball"; $desc = $collectedClasses.Ball; if ($desc instanceof Array) $desc = $desc[1]; Ball.prototype = $desc; Ball.prototype.get$x = function(receiver) { return this.x; }; Ball.prototype.get$y = function(receiver) { return this.y; }; Ball.prototype.get$vx = function() { return this.vx; }; function CountDownClock(hours, minutes, seconds, displayedHour, displayedMinute, displayedSecond, balls) { this.hours = hours; this.minutes = minutes; this.seconds = seconds; this.displayedHour = displayedHour; this.displayedMinute = displayedMinute; this.displayedSecond = displayedSecond; this.balls = balls; } CountDownClock.builtin$cls = "CountDownClock"; if (!"name" in CountDownClock) CountDownClock.name = "CountDownClock"; $desc = $collectedClasses.CountDownClock; if ($desc instanceof Array) $desc = $desc[1]; CountDownClock.prototype = $desc; function ClockNumber(app, root, imgs, pixels, ballColor) { this.app = app; this.root = root; this.imgs = imgs; this.pixels = pixels; this.ballColor = ballColor; } ClockNumber.builtin$cls = "ClockNumber"; if (!"name" in ClockNumber) ClockNumber.name = "ClockNumber"; $desc = $collectedClasses.ClockNumber; if ($desc instanceof Array) $desc = $desc[1]; ClockNumber.prototype = $desc; function ClockNumber_setPixels_closure(this_0, img_1) { this.this_0 = this_0; this.img_1 = img_1; } ClockNumber_setPixels_closure.builtin$cls = "ClockNumber_setPixels_closure"; if (!"name" in ClockNumber_setPixels_closure) ClockNumber_setPixels_closure.name = "ClockNumber_setPixels_closure"; $desc = $collectedClasses.ClockNumber_setPixels_closure; if ($desc instanceof Array) $desc = $desc[1]; ClockNumber_setPixels_closure.prototype = $desc; function Colon(root) { this.root = root; } Colon.builtin$cls = "Colon"; if (!"name" in Colon) Colon.name = "Colon"; $desc = $collectedClasses.Colon; if ($desc instanceof Array) $desc = $desc[1]; Colon.prototype = $desc; function ListIterator(_iterable, _dev$_length, _index, _dev$_current) { this._iterable = _iterable; this._dev$_length = _dev$_length; this._index = _index; this._dev$_current = _dev$_current; } ListIterator.builtin$cls = "ListIterator"; if (!"name" in ListIterator) ListIterator.name = "ListIterator"; $desc = $collectedClasses.ListIterator; if ($desc instanceof Array) $desc = $desc[1]; ListIterator.prototype = $desc; function MappedIterable(_iterable, _f) { this._iterable = _iterable; this._f = _f; } MappedIterable.builtin$cls = "MappedIterable"; if (!"name" in MappedIterable) MappedIterable.name = "MappedIterable"; $desc = $collectedClasses.MappedIterable; if ($desc instanceof Array) $desc = $desc[1]; MappedIterable.prototype = $desc; function EfficientLengthMappedIterable(_iterable, _f) { this._iterable = _iterable; this._f = _f; } EfficientLengthMappedIterable.builtin$cls = "EfficientLengthMappedIterable"; if (!"name" in EfficientLengthMappedIterable) EfficientLengthMappedIterable.name = "EfficientLengthMappedIterable"; $desc = $collectedClasses.EfficientLengthMappedIterable; if ($desc instanceof Array) $desc = $desc[1]; EfficientLengthMappedIterable.prototype = $desc; function MappedIterator(_dev$_current, _iterator, _f) { this._dev$_current = _dev$_current; this._iterator = _iterator; this._f = _f; } MappedIterator.builtin$cls = "MappedIterator"; if (!"name" in MappedIterator) MappedIterator.name = "MappedIterator"; $desc = $collectedClasses.MappedIterator; if ($desc instanceof Array) $desc = $desc[1]; MappedIterator.prototype = $desc; function FixedLengthListMixin() { } FixedLengthListMixin.builtin$cls = "FixedLengthListMixin"; if (!"name" in FixedLengthListMixin) FixedLengthListMixin.name = "FixedLengthListMixin"; $desc = $collectedClasses.FixedLengthListMixin; if ($desc instanceof Array) $desc = $desc[1]; FixedLengthListMixin.prototype = $desc; function _AsyncError(error, stackTrace) { this.error = error; this.stackTrace = stackTrace; } _AsyncError.builtin$cls = "_AsyncError"; if (!"name" in _AsyncError) _AsyncError.name = "_AsyncError"; $desc = $collectedClasses._AsyncError; if ($desc instanceof Array) $desc = $desc[1]; _AsyncError.prototype = $desc; _AsyncError.prototype.get$error = function(receiver) { return this.error; }; _AsyncError.prototype.get$stackTrace = function() { return this.stackTrace; }; function Future() { } Future.builtin$cls = "Future"; if (!"name" in Future) Future.name = "Future"; $desc = $collectedClasses.Future; if ($desc instanceof Array) $desc = $desc[1]; Future.prototype = $desc; function _Future(_state, _zone, _resultOrListeners, _nextListener, _onValueCallback, _errorTestCallback, _onErrorCallback, _whenCompleteActionCallback) { this._state = _state; this._zone = _zone; this._resultOrListeners = _resultOrListeners; this._nextListener = _nextListener; this._onValueCallback = _onValueCallback; this._errorTestCallback = _errorTestCallback; this._onErrorCallback = _onErrorCallback; this._whenCompleteActionCallback = _whenCompleteActionCallback; } _Future.builtin$cls = "_Future"; if (!"name" in _Future) _Future.name = "_Future"; $desc = $collectedClasses._Future; if ($desc instanceof Array) $desc = $desc[1]; _Future.prototype = $desc; _Future.prototype.get$_zone = function() { return this._zone; }; _Future.prototype.get$_nextListener = function() { return this._nextListener; }; function _Future__addListener_closure(this_0, listener_1) { this.this_0 = this_0; this.listener_1 = listener_1; } _Future__addListener_closure.builtin$cls = "_Future__addListener_closure"; if (!"name" in _Future__addListener_closure) _Future__addListener_closure.name = "_Future__addListener_closure"; $desc = $collectedClasses._Future__addListener_closure; if ($desc instanceof Array) $desc = $desc[1]; _Future__addListener_closure.prototype = $desc; function _Future__chainFutures_closure(target_0) { this.target_0 = target_0; } _Future__chainFutures_closure.builtin$cls = "_Future__chainFutures_closure"; if (!"name" in _Future__chainFutures_closure) _Future__chainFutures_closure.name = "_Future__chainFutures_closure"; $desc = $collectedClasses._Future__chainFutures_closure; if ($desc instanceof Array) $desc = $desc[1]; _Future__chainFutures_closure.prototype = $desc; function _Future__chainFutures_closure0(target_1) { this.target_1 = target_1; } _Future__chainFutures_closure0.builtin$cls = "_Future__chainFutures_closure0"; if (!"name" in _Future__chainFutures_closure0) _Future__chainFutures_closure0.name = "_Future__chainFutures_closure0"; $desc = $collectedClasses._Future__chainFutures_closure0; if ($desc instanceof Array) $desc = $desc[1]; _Future__chainFutures_closure0.prototype = $desc; function _Future__asyncComplete_closure(this_0, value_1) { this.this_0 = this_0; this.value_1 = value_1; } _Future__asyncComplete_closure.builtin$cls = "_Future__asyncComplete_closure"; if (!"name" in _Future__asyncComplete_closure) _Future__asyncComplete_closure.name = "_Future__asyncComplete_closure"; $desc = $collectedClasses._Future__asyncComplete_closure; if ($desc instanceof Array) $desc = $desc[1]; _Future__asyncComplete_closure.prototype = $desc; function _Future__propagateToListeners_closure(box_2, listener_3) { this.box_2 = box_2; this.listener_3 = listener_3; } _Future__propagateToListeners_closure.builtin$cls = "_Future__propagateToListeners_closure"; if (!"name" in _Future__propagateToListeners_closure) _Future__propagateToListeners_closure.name = "_Future__propagateToListeners_closure"; $desc = $collectedClasses._Future__propagateToListeners_closure; if ($desc instanceof Array) $desc = $desc[1]; _Future__propagateToListeners_closure.prototype = $desc; function _Future__propagateToListeners_closure0(box_2, box_1, hasError_4, listener_5) { this.box_2 = box_2; this.box_1 = box_1; this.hasError_4 = hasError_4; this.listener_5 = listener_5; } _Future__propagateToListeners_closure0.builtin$cls = "_Future__propagateToListeners_closure0"; if (!"name" in _Future__propagateToListeners_closure0) _Future__propagateToListeners_closure0.name = "_Future__propagateToListeners_closure0"; $desc = $collectedClasses._Future__propagateToListeners_closure0; if ($desc instanceof Array) $desc = $desc[1]; _Future__propagateToListeners_closure0.prototype = $desc; function _Future__propagateToListeners__closure(box_2, listener_6) { this.box_2 = box_2; this.listener_6 = listener_6; } _Future__propagateToListeners__closure.builtin$cls = "_Future__propagateToListeners__closure"; if (!"name" in _Future__propagateToListeners__closure) _Future__propagateToListeners__closure.name = "_Future__propagateToListeners__closure"; $desc = $collectedClasses._Future__propagateToListeners__closure; if ($desc instanceof Array) $desc = $desc[1]; _Future__propagateToListeners__closure.prototype = $desc; function _Future__propagateToListeners__closure0(box_0, listener_7) { this.box_0 = box_0; this.listener_7 = listener_7; } _Future__propagateToListeners__closure0.builtin$cls = "_Future__propagateToListeners__closure0"; if (!"name" in _Future__propagateToListeners__closure0) _Future__propagateToListeners__closure0.name = "_Future__propagateToListeners__closure0"; $desc = $collectedClasses._Future__propagateToListeners__closure0; if ($desc instanceof Array) $desc = $desc[1]; _Future__propagateToListeners__closure0.prototype = $desc; function Stream() { } Stream.builtin$cls = "Stream"; if (!"name" in Stream) Stream.name = "Stream"; $desc = $collectedClasses.Stream; if ($desc instanceof Array) $desc = $desc[1]; Stream.prototype = $desc; function Stream_forEach_closure(box_0, this_1, action_2, future_3) { this.box_0 = box_0; this.this_1 = this_1; this.action_2 = action_2; this.future_3 = future_3; } Stream_forEach_closure.builtin$cls = "Stream_forEach_closure"; if (!"name" in Stream_forEach_closure) Stream_forEach_closure.name = "Stream_forEach_closure"; $desc = $collectedClasses.Stream_forEach_closure; if ($desc instanceof Array) $desc = $desc[1]; Stream_forEach_closure.prototype = $desc; function Stream_forEach__closure(action_4, element_5) { this.action_4 = action_4; this.element_5 = element_5; } Stream_forEach__closure.builtin$cls = "Stream_forEach__closure"; if (!"name" in Stream_forEach__closure) Stream_forEach__closure.name = "Stream_forEach__closure"; $desc = $collectedClasses.Stream_forEach__closure; if ($desc instanceof Array) $desc = $desc[1]; Stream_forEach__closure.prototype = $desc; function Stream_forEach__closure0() { } Stream_forEach__closure0.builtin$cls = "Stream_forEach__closure0"; if (!"name" in Stream_forEach__closure0) Stream_forEach__closure0.name = "Stream_forEach__closure0"; $desc = $collectedClasses.Stream_forEach__closure0; if ($desc instanceof Array) $desc = $desc[1]; Stream_forEach__closure0.prototype = $desc; function Stream_forEach_closure0(future_6) { this.future_6 = future_6; } Stream_forEach_closure0.builtin$cls = "Stream_forEach_closure0"; if (!"name" in Stream_forEach_closure0) Stream_forEach_closure0.name = "Stream_forEach_closure0"; $desc = $collectedClasses.Stream_forEach_closure0; if ($desc instanceof Array) $desc = $desc[1]; Stream_forEach_closure0.prototype = $desc; function Stream_length_closure(box_0) { this.box_0 = box_0; } Stream_length_closure.builtin$cls = "Stream_length_closure"; if (!"name" in Stream_length_closure) Stream_length_closure.name = "Stream_length_closure"; $desc = $collectedClasses.Stream_length_closure; if ($desc instanceof Array) $desc = $desc[1]; Stream_length_closure.prototype = $desc; function Stream_length_closure0(box_0, future_1) { this.box_0 = box_0; this.future_1 = future_1; } Stream_length_closure0.builtin$cls = "Stream_length_closure0"; if (!"name" in Stream_length_closure0) Stream_length_closure0.name = "Stream_length_closure0"; $desc = $collectedClasses.Stream_length_closure0; if ($desc instanceof Array) $desc = $desc[1]; Stream_length_closure0.prototype = $desc; function StreamSubscription() { } StreamSubscription.builtin$cls = "StreamSubscription"; if (!"name" in StreamSubscription) StreamSubscription.name = "StreamSubscription"; $desc = $collectedClasses.StreamSubscription; if ($desc instanceof Array) $desc = $desc[1]; StreamSubscription.prototype = $desc; function _StreamController() { } _StreamController.builtin$cls = "_StreamController"; if (!"name" in _StreamController) _StreamController.name = "_StreamController"; $desc = $collectedClasses._StreamController; if ($desc instanceof Array) $desc = $desc[1]; _StreamController.prototype = $desc; function _StreamController__subscribe_closure(this_0) { this.this_0 = this_0; } _StreamController__subscribe_closure.builtin$cls = "_StreamController__subscribe_closure"; if (!"name" in _StreamController__subscribe_closure) _StreamController__subscribe_closure.name = "_StreamController__subscribe_closure"; $desc = $collectedClasses._StreamController__subscribe_closure; if ($desc instanceof Array) $desc = $desc[1]; _StreamController__subscribe_closure.prototype = $desc; function _StreamController__recordCancel_complete(this_0) { this.this_0 = this_0; } _StreamController__recordCancel_complete.builtin$cls = "_StreamController__recordCancel_complete"; if (!"name" in _StreamController__recordCancel_complete) _StreamController__recordCancel_complete.name = "_StreamController__recordCancel_complete"; $desc = $collectedClasses._StreamController__recordCancel_complete; if ($desc instanceof Array) $desc = $desc[1]; _StreamController__recordCancel_complete.prototype = $desc; function _SyncStreamControllerDispatch() { } _SyncStreamControllerDispatch.builtin$cls = "_SyncStreamControllerDispatch"; if (!"name" in _SyncStreamControllerDispatch) _SyncStreamControllerDispatch.name = "_SyncStreamControllerDispatch"; $desc = $collectedClasses._SyncStreamControllerDispatch; if ($desc instanceof Array) $desc = $desc[1]; _SyncStreamControllerDispatch.prototype = $desc; function _AsyncStreamControllerDispatch() { } _AsyncStreamControllerDispatch.builtin$cls = "_AsyncStreamControllerDispatch"; if (!"name" in _AsyncStreamControllerDispatch) _AsyncStreamControllerDispatch.name = "_AsyncStreamControllerDispatch"; $desc = $collectedClasses._AsyncStreamControllerDispatch; if ($desc instanceof Array) $desc = $desc[1]; _AsyncStreamControllerDispatch.prototype = $desc; function _AsyncStreamController(_onListen, _onPause, _onResume, _onCancel, _varData, _state, _doneFuture) { this._onListen = _onListen; this._onPause = _onPause; this._onResume = _onResume; this._onCancel = _onCancel; this._varData = _varData; this._state = _state; this._doneFuture = _doneFuture; } _AsyncStreamController.builtin$cls = "_AsyncStreamController"; if (!"name" in _AsyncStreamController) _AsyncStreamController.name = "_AsyncStreamController"; $desc = $collectedClasses._AsyncStreamController; if ($desc instanceof Array) $desc = $desc[1]; _AsyncStreamController.prototype = $desc; _AsyncStreamController.prototype.get$_onListen = function() { return this._onListen; }; _AsyncStreamController.prototype.get$_onPause = function() { return this._onPause; }; _AsyncStreamController.prototype.get$_onResume = function() { return this._onResume; }; _AsyncStreamController.prototype.get$_onCancel = function() { return this._onCancel; }; function _StreamController__AsyncStreamControllerDispatch() { } _StreamController__AsyncStreamControllerDispatch.builtin$cls = "_StreamController__AsyncStreamControllerDispatch"; if (!"name" in _StreamController__AsyncStreamControllerDispatch) _StreamController__AsyncStreamControllerDispatch.name = "_StreamController__AsyncStreamControllerDispatch"; $desc = $collectedClasses._StreamController__AsyncStreamControllerDispatch; if ($desc instanceof Array) $desc = $desc[1]; _StreamController__AsyncStreamControllerDispatch.prototype = $desc; function _SyncStreamController(_onListen, _onPause, _onResume, _onCancel, _varData, _state, _doneFuture) { this._onListen = _onListen; this._onPause = _onPause; this._onResume = _onResume; this._onCancel = _onCancel; this._varData = _varData; this._state = _state; this._doneFuture = _doneFuture; } _SyncStreamController.builtin$cls = "_SyncStreamController"; if (!"name" in _SyncStreamController) _SyncStreamController.name = "_SyncStreamController"; $desc = $collectedClasses._SyncStreamController; if ($desc instanceof Array) $desc = $desc[1]; _SyncStreamController.prototype = $desc; _SyncStreamController.prototype.get$_onListen = function() { return this._onListen; }; _SyncStreamController.prototype.get$_onPause = function() { return this._onPause; }; _SyncStreamController.prototype.get$_onResume = function() { return this._onResume; }; _SyncStreamController.prototype.get$_onCancel = function() { return this._onCancel; }; function _StreamController__SyncStreamControllerDispatch() { } _StreamController__SyncStreamControllerDispatch.builtin$cls = "_StreamController__SyncStreamControllerDispatch"; if (!"name" in _StreamController__SyncStreamControllerDispatch) _StreamController__SyncStreamControllerDispatch.name = "_StreamController__SyncStreamControllerDispatch"; $desc = $collectedClasses._StreamController__SyncStreamControllerDispatch; if ($desc instanceof Array) $desc = $desc[1]; _StreamController__SyncStreamControllerDispatch.prototype = $desc; function _ControllerStream(_async$_controller) { this._async$_controller = _async$_controller; } _ControllerStream.builtin$cls = "_ControllerStream"; if (!"name" in _ControllerStream) _ControllerStream.name = "_ControllerStream"; $desc = $collectedClasses._ControllerStream; if ($desc instanceof Array) $desc = $desc[1]; _ControllerStream.prototype = $desc; function _ControllerSubscription(_async$_controller, _onData, _onError, _onDone, _zone, _state, _cancelFuture, _pending) { this._async$_controller = _async$_controller; this._onData = _onData; this._onError = _onError; this._onDone = _onDone; this._zone = _zone; this._state = _state; this._cancelFuture = _cancelFuture; this._pending = _pending; } _ControllerSubscription.builtin$cls = "_ControllerSubscription"; if (!"name" in _ControllerSubscription) _ControllerSubscription.name = "_ControllerSubscription"; $desc = $collectedClasses._ControllerSubscription; if ($desc instanceof Array) $desc = $desc[1]; _ControllerSubscription.prototype = $desc; function _EventSink() { } _EventSink.builtin$cls = "_EventSink"; if (!"name" in _EventSink) _EventSink.name = "_EventSink"; $desc = $collectedClasses._EventSink; if ($desc instanceof Array) $desc = $desc[1]; _EventSink.prototype = $desc; function _BufferingStreamSubscription(_onData, _onError, _onDone, _zone, _state, _cancelFuture, _pending) { this._onData = _onData; this._onError = _onError; this._onDone = _onDone; this._zone = _zone; this._state = _state; this._cancelFuture = _cancelFuture; this._pending = _pending; } _BufferingStreamSubscription.builtin$cls = "_BufferingStreamSubscription"; if (!"name" in _BufferingStreamSubscription) _BufferingStreamSubscription.name = "_BufferingStreamSubscription"; $desc = $collectedClasses._BufferingStreamSubscription; if ($desc instanceof Array) $desc = $desc[1]; _BufferingStreamSubscription.prototype = $desc; _BufferingStreamSubscription.prototype.get$_zone = function() { return this._zone; }; function _BufferingStreamSubscription__sendDone_sendDone(this_0) { this.this_0 = this_0; } _BufferingStreamSubscription__sendDone_sendDone.builtin$cls = "_BufferingStreamSubscription__sendDone_sendDone"; if (!"name" in _BufferingStreamSubscription__sendDone_sendDone) _BufferingStreamSubscription__sendDone_sendDone.name = "_BufferingStreamSubscription__sendDone_sendDone"; $desc = $collectedClasses._BufferingStreamSubscription__sendDone_sendDone; if ($desc instanceof Array) $desc = $desc[1]; _BufferingStreamSubscription__sendDone_sendDone.prototype = $desc; function _StreamImpl() { } _StreamImpl.builtin$cls = "_StreamImpl"; if (!"name" in _StreamImpl) _StreamImpl.name = "_StreamImpl"; $desc = $collectedClasses._StreamImpl; if ($desc instanceof Array) $desc = $desc[1]; _StreamImpl.prototype = $desc; function _DelayedEvent(next) { this.next = next; } _DelayedEvent.builtin$cls = "_DelayedEvent"; if (!"name" in _DelayedEvent) _DelayedEvent.name = "_DelayedEvent"; $desc = $collectedClasses._DelayedEvent; if ($desc instanceof Array) $desc = $desc[1]; _DelayedEvent.prototype = $desc; _DelayedEvent.prototype.get$next = function() { return this.next; }; _DelayedEvent.prototype.set$next = function(v) { return this.next = v; }; function _DelayedData(value, next) { this.value = value; this.next = next; } _DelayedData.builtin$cls = "_DelayedData"; if (!"name" in _DelayedData) _DelayedData.name = "_DelayedData"; $desc = $collectedClasses._DelayedData; if ($desc instanceof Array) $desc = $desc[1]; _DelayedData.prototype = $desc; function _DelayedDone() { } _DelayedDone.builtin$cls = "_DelayedDone"; if (!"name" in _DelayedDone) _DelayedDone.name = "_DelayedDone"; $desc = $collectedClasses._DelayedDone; if ($desc instanceof Array) $desc = $desc[1]; _DelayedDone.prototype = $desc; function _PendingEvents() { } _PendingEvents.builtin$cls = "_PendingEvents"; if (!"name" in _PendingEvents) _PendingEvents.name = "_PendingEvents"; $desc = $collectedClasses._PendingEvents; if ($desc instanceof Array) $desc = $desc[1]; _PendingEvents.prototype = $desc; function _PendingEvents_schedule_closure(this_0, dispatch_1) { this.this_0 = this_0; this.dispatch_1 = dispatch_1; } _PendingEvents_schedule_closure.builtin$cls = "_PendingEvents_schedule_closure"; if (!"name" in _PendingEvents_schedule_closure) _PendingEvents_schedule_closure.name = "_PendingEvents_schedule_closure"; $desc = $collectedClasses._PendingEvents_schedule_closure; if ($desc instanceof Array) $desc = $desc[1]; _PendingEvents_schedule_closure.prototype = $desc; function _StreamImplEvents(firstPendingEvent, lastPendingEvent, _state) { this.firstPendingEvent = firstPendingEvent; this.lastPendingEvent = lastPendingEvent; this._state = _state; } _StreamImplEvents.builtin$cls = "_StreamImplEvents"; if (!"name" in _StreamImplEvents) _StreamImplEvents.name = "_StreamImplEvents"; $desc = $collectedClasses._StreamImplEvents; if ($desc instanceof Array) $desc = $desc[1]; _StreamImplEvents.prototype = $desc; function _cancelAndError_closure(future_0, error_1, stackTrace_2) { this.future_0 = future_0; this.error_1 = error_1; this.stackTrace_2 = stackTrace_2; } _cancelAndError_closure.builtin$cls = "_cancelAndError_closure"; if (!"name" in _cancelAndError_closure) _cancelAndError_closure.name = "_cancelAndError_closure"; $desc = $collectedClasses._cancelAndError_closure; if ($desc instanceof Array) $desc = $desc[1]; _cancelAndError_closure.prototype = $desc; function _cancelAndErrorClosure_closure(subscription_0, future_1) { this.subscription_0 = subscription_0; this.future_1 = future_1; } _cancelAndErrorClosure_closure.builtin$cls = "_cancelAndErrorClosure_closure"; if (!"name" in _cancelAndErrorClosure_closure) _cancelAndErrorClosure_closure.name = "_cancelAndErrorClosure_closure"; $desc = $collectedClasses._cancelAndErrorClosure_closure; if ($desc instanceof Array) $desc = $desc[1]; _cancelAndErrorClosure_closure.prototype = $desc; function _BaseZone() { } _BaseZone.builtin$cls = "_BaseZone"; if (!"name" in _BaseZone) _BaseZone.name = "_BaseZone"; $desc = $collectedClasses._BaseZone; if ($desc instanceof Array) $desc = $desc[1]; _BaseZone.prototype = $desc; function _BaseZone_bindCallback_closure(this_0, registered_1) { this.this_0 = this_0; this.registered_1 = registered_1; } _BaseZone_bindCallback_closure.builtin$cls = "_BaseZone_bindCallback_closure"; if (!"name" in _BaseZone_bindCallback_closure) _BaseZone_bindCallback_closure.name = "_BaseZone_bindCallback_closure"; $desc = $collectedClasses._BaseZone_bindCallback_closure; if ($desc instanceof Array) $desc = $desc[1]; _BaseZone_bindCallback_closure.prototype = $desc; function _BaseZone_bindCallback_closure0(this_2, registered_3) { this.this_2 = this_2; this.registered_3 = registered_3; } _BaseZone_bindCallback_closure0.builtin$cls = "_BaseZone_bindCallback_closure0"; if (!"name" in _BaseZone_bindCallback_closure0) _BaseZone_bindCallback_closure0.name = "_BaseZone_bindCallback_closure0"; $desc = $collectedClasses._BaseZone_bindCallback_closure0; if ($desc instanceof Array) $desc = $desc[1]; _BaseZone_bindCallback_closure0.prototype = $desc; function _BaseZone_bindUnaryCallback_closure(this_0, registered_1) { this.this_0 = this_0; this.registered_1 = registered_1; } _BaseZone_bindUnaryCallback_closure.builtin$cls = "_BaseZone_bindUnaryCallback_closure"; if (!"name" in _BaseZone_bindUnaryCallback_closure) _BaseZone_bindUnaryCallback_closure.name = "_BaseZone_bindUnaryCallback_closure"; $desc = $collectedClasses._BaseZone_bindUnaryCallback_closure; if ($desc instanceof Array) $desc = $desc[1]; _BaseZone_bindUnaryCallback_closure.prototype = $desc; function _BaseZone_bindUnaryCallback_closure0(this_2, registered_3) { this.this_2 = this_2; this.registered_3 = registered_3; } _BaseZone_bindUnaryCallback_closure0.builtin$cls = "_BaseZone_bindUnaryCallback_closure0"; if (!"name" in _BaseZone_bindUnaryCallback_closure0) _BaseZone_bindUnaryCallback_closure0.name = "_BaseZone_bindUnaryCallback_closure0"; $desc = $collectedClasses._BaseZone_bindUnaryCallback_closure0; if ($desc instanceof Array) $desc = $desc[1]; _BaseZone_bindUnaryCallback_closure0.prototype = $desc; function _rootHandleUncaughtError_closure(error_0, stackTrace_1) { this.error_0 = error_0; this.stackTrace_1 = stackTrace_1; } _rootHandleUncaughtError_closure.builtin$cls = "_rootHandleUncaughtError_closure"; if (!"name" in _rootHandleUncaughtError_closure) _rootHandleUncaughtError_closure.name = "_rootHandleUncaughtError_closure"; $desc = $collectedClasses._rootHandleUncaughtError_closure; if ($desc instanceof Array) $desc = $desc[1]; _rootHandleUncaughtError_closure.prototype = $desc; function _rootHandleUncaughtError__closure(error_2, stackTrace_3) { this.error_2 = error_2; this.stackTrace_3 = stackTrace_3; } _rootHandleUncaughtError__closure.builtin$cls = "_rootHandleUncaughtError__closure"; if (!"name" in _rootHandleUncaughtError__closure) _rootHandleUncaughtError__closure.name = "_rootHandleUncaughtError__closure"; $desc = $collectedClasses._rootHandleUncaughtError__closure; if ($desc instanceof Array) $desc = $desc[1]; _rootHandleUncaughtError__closure.prototype = $desc; function _RootZone() { } _RootZone.builtin$cls = "_RootZone"; if (!"name" in _RootZone) _RootZone.name = "_RootZone"; $desc = $collectedClasses._RootZone; if ($desc instanceof Array) $desc = $desc[1]; _RootZone.prototype = $desc; function _HashMap(_collection$_length, _strings, _nums, _rest, _keys) { this._collection$_length = _collection$_length; this._strings = _strings; this._nums = _nums; this._rest = _rest; this._keys = _keys; } _HashMap.builtin$cls = "_HashMap"; if (!"name" in _HashMap) _HashMap.name = "_HashMap"; $desc = $collectedClasses._HashMap; if ($desc instanceof Array) $desc = $desc[1]; _HashMap.prototype = $desc; function _HashMap_values_closure(this_0) { this.this_0 = this_0; } _HashMap_values_closure.builtin$cls = "_HashMap_values_closure"; if (!"name" in _HashMap_values_closure) _HashMap_values_closure.name = "_HashMap_values_closure"; $desc = $collectedClasses._HashMap_values_closure; if ($desc instanceof Array) $desc = $desc[1]; _HashMap_values_closure.prototype = $desc; function HashMapKeyIterable(_map) { this._map = _map; } HashMapKeyIterable.builtin$cls = "HashMapKeyIterable"; if (!"name" in HashMapKeyIterable) HashMapKeyIterable.name = "HashMapKeyIterable"; $desc = $collectedClasses.HashMapKeyIterable; if ($desc instanceof Array) $desc = $desc[1]; HashMapKeyIterable.prototype = $desc; function HashMapKeyIterator(_map, _keys, _offset, _collection$_current) { this._map = _map; this._keys = _keys; this._offset = _offset; this._collection$_current = _collection$_current; } HashMapKeyIterator.builtin$cls = "HashMapKeyIterator"; if (!"name" in HashMapKeyIterator) HashMapKeyIterator.name = "HashMapKeyIterator"; $desc = $collectedClasses.HashMapKeyIterator; if ($desc instanceof Array) $desc = $desc[1]; HashMapKeyIterator.prototype = $desc; function _LinkedHashMap(_collection$_length, _strings, _nums, _rest, _first, _last, _modifications) { this._collection$_length = _collection$_length; this._strings = _strings; this._nums = _nums; this._rest = _rest; this._first = _first; this._last = _last; this._modifications = _modifications; } _LinkedHashMap.builtin$cls = "_LinkedHashMap"; if (!"name" in _LinkedHashMap) _LinkedHashMap.name = "_LinkedHashMap"; $desc = $collectedClasses._LinkedHashMap; if ($desc instanceof Array) $desc = $desc[1]; _LinkedHashMap.prototype = $desc; function _LinkedHashMap_values_closure(this_0) { this.this_0 = this_0; } _LinkedHashMap_values_closure.builtin$cls = "_LinkedHashMap_values_closure"; if (!"name" in _LinkedHashMap_values_closure) _LinkedHashMap_values_closure.name = "_LinkedHashMap_values_closure"; $desc = $collectedClasses._LinkedHashMap_values_closure; if ($desc instanceof Array) $desc = $desc[1]; _LinkedHashMap_values_closure.prototype = $desc; function LinkedHashMapCell(_key, _value, _next, _previous) { this._key = _key; this._value = _value; this._next = _next; this._previous = _previous; } LinkedHashMapCell.builtin$cls = "LinkedHashMapCell"; if (!"name" in LinkedHashMapCell) LinkedHashMapCell.name = "LinkedHashMapCell"; $desc = $collectedClasses.LinkedHashMapCell; if ($desc instanceof Array) $desc = $desc[1]; LinkedHashMapCell.prototype = $desc; LinkedHashMapCell.prototype.get$_key = function() { return this._key; }; LinkedHashMapCell.prototype.get$_value = function() { return this._value; }; LinkedHashMapCell.prototype.set$_value = function(v) { return this._value = v; }; LinkedHashMapCell.prototype.get$_next = function() { return this._next; }; LinkedHashMapCell.prototype.set$_next = function(v) { return this._next = v; }; LinkedHashMapCell.prototype.get$_previous = function() { return this._previous; }; LinkedHashMapCell.prototype.set$_previous = function(v) { return this._previous = v; }; function LinkedHashMapKeyIterable(_map) { this._map = _map; } LinkedHashMapKeyIterable.builtin$cls = "LinkedHashMapKeyIterable"; if (!"name" in LinkedHashMapKeyIterable) LinkedHashMapKeyIterable.name = "LinkedHashMapKeyIterable"; $desc = $collectedClasses.LinkedHashMapKeyIterable; if ($desc instanceof Array) $desc = $desc[1]; LinkedHashMapKeyIterable.prototype = $desc; function LinkedHashMapKeyIterator(_map, _modifications, _cell, _collection$_current) { this._map = _map; this._modifications = _modifications; this._cell = _cell; this._collection$_current = _collection$_current; } LinkedHashMapKeyIterator.builtin$cls = "LinkedHashMapKeyIterator"; if (!"name" in LinkedHashMapKeyIterator) LinkedHashMapKeyIterator.name = "LinkedHashMapKeyIterator"; $desc = $collectedClasses.LinkedHashMapKeyIterator; if ($desc instanceof Array) $desc = $desc[1]; LinkedHashMapKeyIterator.prototype = $desc; function _HashSet() { } _HashSet.builtin$cls = "_HashSet"; if (!"name" in _HashSet) _HashSet.name = "_HashSet"; $desc = $collectedClasses._HashSet; if ($desc instanceof Array) $desc = $desc[1]; _HashSet.prototype = $desc; function _IdentityHashSet(_collection$_length, _strings, _nums, _rest, _elements) { this._collection$_length = _collection$_length; this._strings = _strings; this._nums = _nums; this._rest = _rest; this._elements = _elements; } _IdentityHashSet.builtin$cls = "_IdentityHashSet"; if (!"name" in _IdentityHashSet) _IdentityHashSet.name = "_IdentityHashSet"; $desc = $collectedClasses._IdentityHashSet; if ($desc instanceof Array) $desc = $desc[1]; _IdentityHashSet.prototype = $desc; function HashSetIterator(_set, _elements, _offset, _collection$_current) { this._set = _set; this._elements = _elements; this._offset = _offset; this._collection$_current = _collection$_current; } HashSetIterator.builtin$cls = "HashSetIterator"; if (!"name" in HashSetIterator) HashSetIterator.name = "HashSetIterator"; $desc = $collectedClasses.HashSetIterator; if ($desc instanceof Array) $desc = $desc[1]; HashSetIterator.prototype = $desc; function _LinkedHashSet(_collection$_length, _strings, _nums, _rest, _first, _last, _modifications) { this._collection$_length = _collection$_length; this._strings = _strings; this._nums = _nums; this._rest = _rest; this._first = _first; this._last = _last; this._modifications = _modifications; } _LinkedHashSet.builtin$cls = "_LinkedHashSet"; if (!"name" in _LinkedHashSet) _LinkedHashSet.name = "_LinkedHashSet"; $desc = $collectedClasses._LinkedHashSet; if ($desc instanceof Array) $desc = $desc[1]; _LinkedHashSet.prototype = $desc; function LinkedHashSetCell(_element, _next, _previous) { this._element = _element; this._next = _next; this._previous = _previous; } LinkedHashSetCell.builtin$cls = "LinkedHashSetCell"; if (!"name" in LinkedHashSetCell) LinkedHashSetCell.name = "LinkedHashSetCell"; $desc = $collectedClasses.LinkedHashSetCell; if ($desc instanceof Array) $desc = $desc[1]; LinkedHashSetCell.prototype = $desc; LinkedHashSetCell.prototype.get$_element = function() { return this._element; }; LinkedHashSetCell.prototype.get$_next = function() { return this._next; }; LinkedHashSetCell.prototype.set$_next = function(v) { return this._next = v; }; LinkedHashSetCell.prototype.get$_previous = function() { return this._previous; }; LinkedHashSetCell.prototype.set$_previous = function(v) { return this._previous = v; }; function LinkedHashSetIterator(_set, _modifications, _cell, _collection$_current) { this._set = _set; this._modifications = _modifications; this._cell = _cell; this._collection$_current = _collection$_current; } LinkedHashSetIterator.builtin$cls = "LinkedHashSetIterator"; if (!"name" in LinkedHashSetIterator) LinkedHashSetIterator.name = "LinkedHashSetIterator"; $desc = $collectedClasses.LinkedHashSetIterator; if ($desc instanceof Array) $desc = $desc[1]; LinkedHashSetIterator.prototype = $desc; function _HashSetBase() { } _HashSetBase.builtin$cls = "_HashSetBase"; if (!"name" in _HashSetBase) _HashSetBase.name = "_HashSetBase"; $desc = $collectedClasses._HashSetBase; if ($desc instanceof Array) $desc = $desc[1]; _HashSetBase.prototype = $desc; function IterableBase() { } IterableBase.builtin$cls = "IterableBase"; if (!"name" in IterableBase) IterableBase.name = "IterableBase"; $desc = $collectedClasses.IterableBase; if ($desc instanceof Array) $desc = $desc[1]; IterableBase.prototype = $desc; function ListMixin() { } ListMixin.builtin$cls = "ListMixin"; if (!"name" in ListMixin) ListMixin.name = "ListMixin"; $desc = $collectedClasses.ListMixin; if ($desc instanceof Array) $desc = $desc[1]; ListMixin.prototype = $desc; function Maps_mapToString_closure(box_0, result_1) { this.box_0 = box_0; this.result_1 = result_1; } Maps_mapToString_closure.builtin$cls = "Maps_mapToString_closure"; if (!"name" in Maps_mapToString_closure) Maps_mapToString_closure.name = "Maps_mapToString_closure"; $desc = $collectedClasses.Maps_mapToString_closure; if ($desc instanceof Array) $desc = $desc[1]; Maps_mapToString_closure.prototype = $desc; function ListQueue(_table, _head, _tail, _modificationCount) { this._table = _table; this._head = _head; this._tail = _tail; this._modificationCount = _modificationCount; } ListQueue.builtin$cls = "ListQueue"; if (!"name" in ListQueue) ListQueue.name = "ListQueue"; $desc = $collectedClasses.ListQueue; if ($desc instanceof Array) $desc = $desc[1]; ListQueue.prototype = $desc; function _ListQueueIterator(_queue, _end, _modificationCount, _collection$_position, _collection$_current) { this._queue = _queue; this._end = _end; this._modificationCount = _modificationCount; this._collection$_position = _collection$_position; this._collection$_current = _collection$_current; } _ListQueueIterator.builtin$cls = "_ListQueueIterator"; if (!"name" in _ListQueueIterator) _ListQueueIterator.name = "_ListQueueIterator"; $desc = $collectedClasses._ListQueueIterator; if ($desc instanceof Array) $desc = $desc[1]; _ListQueueIterator.prototype = $desc; function NoSuchMethodError_toString_closure(box_0) { this.box_0 = box_0; } NoSuchMethodError_toString_closure.builtin$cls = "NoSuchMethodError_toString_closure"; if (!"name" in NoSuchMethodError_toString_closure) NoSuchMethodError_toString_closure.name = "NoSuchMethodError_toString_closure"; $desc = $collectedClasses.NoSuchMethodError_toString_closure; if ($desc instanceof Array) $desc = $desc[1]; NoSuchMethodError_toString_closure.prototype = $desc; function DateTime(millisecondsSinceEpoch, isUtc) { this.millisecondsSinceEpoch = millisecondsSinceEpoch; this.isUtc = isUtc; } DateTime.builtin$cls = "DateTime"; if (!"name" in DateTime) DateTime.name = "DateTime"; $desc = $collectedClasses.DateTime; if ($desc instanceof Array) $desc = $desc[1]; DateTime.prototype = $desc; function DateTime_toString_fourDigits() { } DateTime_toString_fourDigits.builtin$cls = "DateTime_toString_fourDigits"; if (!"name" in DateTime_toString_fourDigits) DateTime_toString_fourDigits.name = "DateTime_toString_fourDigits"; $desc = $collectedClasses.DateTime_toString_fourDigits; if ($desc instanceof Array) $desc = $desc[1]; DateTime_toString_fourDigits.prototype = $desc; function DateTime_toString_threeDigits() { } DateTime_toString_threeDigits.builtin$cls = "DateTime_toString_threeDigits"; if (!"name" in DateTime_toString_threeDigits) DateTime_toString_threeDigits.name = "DateTime_toString_threeDigits"; $desc = $collectedClasses.DateTime_toString_threeDigits; if ($desc instanceof Array) $desc = $desc[1]; DateTime_toString_threeDigits.prototype = $desc; function DateTime_toString_twoDigits() { } DateTime_toString_twoDigits.builtin$cls = "DateTime_toString_twoDigits"; if (!"name" in DateTime_toString_twoDigits) DateTime_toString_twoDigits.name = "DateTime_toString_twoDigits"; $desc = $collectedClasses.DateTime_toString_twoDigits; if ($desc instanceof Array) $desc = $desc[1]; DateTime_toString_twoDigits.prototype = $desc; function Duration(_duration) { this._duration = _duration; } Duration.builtin$cls = "Duration"; if (!"name" in Duration) Duration.name = "Duration"; $desc = $collectedClasses.Duration; if ($desc instanceof Array) $desc = $desc[1]; Duration.prototype = $desc; Duration.prototype.get$_duration = function() { return this._duration; }; function Duration_toString_sixDigits() { } Duration_toString_sixDigits.builtin$cls = "Duration_toString_sixDigits"; if (!"name" in Duration_toString_sixDigits) Duration_toString_sixDigits.name = "Duration_toString_sixDigits"; $desc = $collectedClasses.Duration_toString_sixDigits; if ($desc instanceof Array) $desc = $desc[1]; Duration_toString_sixDigits.prototype = $desc; function Duration_toString_twoDigits() { } Duration_toString_twoDigits.builtin$cls = "Duration_toString_twoDigits"; if (!"name" in Duration_toString_twoDigits) Duration_toString_twoDigits.name = "Duration_toString_twoDigits"; $desc = $collectedClasses.Duration_toString_twoDigits; if ($desc instanceof Array) $desc = $desc[1]; Duration_toString_twoDigits.prototype = $desc; function Error() { } Error.builtin$cls = "Error"; if (!"name" in Error) Error.name = "Error"; $desc = $collectedClasses.Error; if ($desc instanceof Array) $desc = $desc[1]; Error.prototype = $desc; function NullThrownError() { } NullThrownError.builtin$cls = "NullThrownError"; if (!"name" in NullThrownError) NullThrownError.name = "NullThrownError"; $desc = $collectedClasses.NullThrownError; if ($desc instanceof Array) $desc = $desc[1]; NullThrownError.prototype = $desc; function ArgumentError(message) { this.message = message; } ArgumentError.builtin$cls = "ArgumentError"; if (!"name" in ArgumentError) ArgumentError.name = "ArgumentError"; $desc = $collectedClasses.ArgumentError; if ($desc instanceof Array) $desc = $desc[1]; ArgumentError.prototype = $desc; function RangeError(message) { this.message = message; } RangeError.builtin$cls = "RangeError"; if (!"name" in RangeError) RangeError.name = "RangeError"; $desc = $collectedClasses.RangeError; if ($desc instanceof Array) $desc = $desc[1]; RangeError.prototype = $desc; function UnsupportedError(message) { this.message = message; } UnsupportedError.builtin$cls = "UnsupportedError"; if (!"name" in UnsupportedError) UnsupportedError.name = "UnsupportedError"; $desc = $collectedClasses.UnsupportedError; if ($desc instanceof Array) $desc = $desc[1]; UnsupportedError.prototype = $desc; function UnimplementedError(message) { this.message = message; } UnimplementedError.builtin$cls = "UnimplementedError"; if (!"name" in UnimplementedError) UnimplementedError.name = "UnimplementedError"; $desc = $collectedClasses.UnimplementedError; if ($desc instanceof Array) $desc = $desc[1]; UnimplementedError.prototype = $desc; function StateError(message) { this.message = message; } StateError.builtin$cls = "StateError"; if (!"name" in StateError) StateError.name = "StateError"; $desc = $collectedClasses.StateError; if ($desc instanceof Array) $desc = $desc[1]; StateError.prototype = $desc; function ConcurrentModificationError(modifiedObject) { this.modifiedObject = modifiedObject; } ConcurrentModificationError.builtin$cls = "ConcurrentModificationError"; if (!"name" in ConcurrentModificationError) ConcurrentModificationError.name = "ConcurrentModificationError"; $desc = $collectedClasses.ConcurrentModificationError; if ($desc instanceof Array) $desc = $desc[1]; ConcurrentModificationError.prototype = $desc; function StackOverflowError() { } StackOverflowError.builtin$cls = "StackOverflowError"; if (!"name" in StackOverflowError) StackOverflowError.name = "StackOverflowError"; $desc = $collectedClasses.StackOverflowError; if ($desc instanceof Array) $desc = $desc[1]; StackOverflowError.prototype = $desc; function CyclicInitializationError(variableName) { this.variableName = variableName; } CyclicInitializationError.builtin$cls = "CyclicInitializationError"; if (!"name" in CyclicInitializationError) CyclicInitializationError.name = "CyclicInitializationError"; $desc = $collectedClasses.CyclicInitializationError; if ($desc instanceof Array) $desc = $desc[1]; CyclicInitializationError.prototype = $desc; function _ExceptionImplementation(message) { this.message = message; } _ExceptionImplementation.builtin$cls = "_ExceptionImplementation"; if (!"name" in _ExceptionImplementation) _ExceptionImplementation.name = "_ExceptionImplementation"; $desc = $collectedClasses._ExceptionImplementation; if ($desc instanceof Array) $desc = $desc[1]; _ExceptionImplementation.prototype = $desc; function Expando(name) { this.name = name; } Expando.builtin$cls = "Expando"; if (!"name" in Expando) Expando.name = "Expando"; $desc = $collectedClasses.Expando; if ($desc instanceof Array) $desc = $desc[1]; Expando.prototype = $desc; function Iterator() { } Iterator.builtin$cls = "Iterator"; if (!"name" in Iterator) Iterator.name = "Iterator"; $desc = $collectedClasses.Iterator; if ($desc instanceof Array) $desc = $desc[1]; Iterator.prototype = $desc; function Null() { } Null.builtin$cls = "Null"; if (!"name" in Null) Null.name = "Null"; $desc = $collectedClasses.Null; if ($desc instanceof Array) $desc = $desc[1]; Null.prototype = $desc; function Object() { } Object.builtin$cls = "Object"; if (!"name" in Object) Object.name = "Object"; $desc = $collectedClasses.Object; if ($desc instanceof Array) $desc = $desc[1]; Object.prototype = $desc; function StackTrace() { } StackTrace.builtin$cls = "StackTrace"; if (!"name" in StackTrace) StackTrace.name = "StackTrace"; $desc = $collectedClasses.StackTrace; if ($desc instanceof Array) $desc = $desc[1]; StackTrace.prototype = $desc; function StringBuffer(_contents) { this._contents = _contents; } StringBuffer.builtin$cls = "StringBuffer"; if (!"name" in StringBuffer) StringBuffer.name = "StringBuffer"; $desc = $collectedClasses.StringBuffer; if ($desc instanceof Array) $desc = $desc[1]; StringBuffer.prototype = $desc; StringBuffer.prototype.get$_contents = function() { return this._contents; }; function Symbol() { } Symbol.builtin$cls = "Symbol"; if (!"name" in Symbol) Symbol.name = "Symbol"; $desc = $collectedClasses.Symbol; if ($desc instanceof Array) $desc = $desc[1]; Symbol.prototype = $desc; function Interceptor_CssStyleDeclarationBase() { } Interceptor_CssStyleDeclarationBase.builtin$cls = "Interceptor_CssStyleDeclarationBase"; if (!"name" in Interceptor_CssStyleDeclarationBase) Interceptor_CssStyleDeclarationBase.name = "Interceptor_CssStyleDeclarationBase"; $desc = $collectedClasses.Interceptor_CssStyleDeclarationBase; if ($desc instanceof Array) $desc = $desc[1]; Interceptor_CssStyleDeclarationBase.prototype = $desc; function CssStyleDeclarationBase() { } CssStyleDeclarationBase.builtin$cls = "CssStyleDeclarationBase"; if (!"name" in CssStyleDeclarationBase) CssStyleDeclarationBase.name = "CssStyleDeclarationBase"; $desc = $collectedClasses.CssStyleDeclarationBase; if ($desc instanceof Array) $desc = $desc[1]; CssStyleDeclarationBase.prototype = $desc; function Interceptor_ListMixin() { } Interceptor_ListMixin.builtin$cls = "Interceptor_ListMixin"; if (!"name" in Interceptor_ListMixin) Interceptor_ListMixin.name = "Interceptor_ListMixin"; $desc = $collectedClasses.Interceptor_ListMixin; if ($desc instanceof Array) $desc = $desc[1]; Interceptor_ListMixin.prototype = $desc; function Interceptor_ListMixin_ImmutableListMixin() { } Interceptor_ListMixin_ImmutableListMixin.builtin$cls = "Interceptor_ListMixin_ImmutableListMixin"; if (!"name" in Interceptor_ListMixin_ImmutableListMixin) Interceptor_ListMixin_ImmutableListMixin.name = "Interceptor_ListMixin_ImmutableListMixin"; $desc = $collectedClasses.Interceptor_ListMixin_ImmutableListMixin; if ($desc instanceof Array) $desc = $desc[1]; Interceptor_ListMixin_ImmutableListMixin.prototype = $desc; function ImmutableListMixin() { } ImmutableListMixin.builtin$cls = "ImmutableListMixin"; if (!"name" in ImmutableListMixin) ImmutableListMixin.name = "ImmutableListMixin"; $desc = $collectedClasses.ImmutableListMixin; if ($desc instanceof Array) $desc = $desc[1]; ImmutableListMixin.prototype = $desc; function FixedSizeListIterator(_array, _length, _position, _current) { this._array = _array; this._length = _length; this._position = _position; this._current = _current; } FixedSizeListIterator.builtin$cls = "FixedSizeListIterator"; if (!"name" in FixedSizeListIterator) FixedSizeListIterator.name = "FixedSizeListIterator"; $desc = $collectedClasses.FixedSizeListIterator; if ($desc instanceof Array) $desc = $desc[1]; FixedSizeListIterator.prototype = $desc; function _JSRandom() { } _JSRandom.builtin$cls = "_JSRandom"; if (!"name" in _JSRandom) _JSRandom.name = "_JSRandom"; $desc = $collectedClasses._JSRandom; if ($desc instanceof Array) $desc = $desc[1]; _JSRandom.prototype = $desc; function _NativeTypedArray() { } _NativeTypedArray.builtin$cls = "_NativeTypedArray"; if (!"name" in _NativeTypedArray) _NativeTypedArray.name = "_NativeTypedArray"; $desc = $collectedClasses._NativeTypedArray; if ($desc instanceof Array) $desc = $desc[1]; _NativeTypedArray.prototype = $desc; function _NativeTypedArrayOfInt() { } _NativeTypedArrayOfInt.builtin$cls = "_NativeTypedArrayOfInt"; if (!"name" in _NativeTypedArrayOfInt) _NativeTypedArrayOfInt.name = "_NativeTypedArrayOfInt"; $desc = $collectedClasses._NativeTypedArrayOfInt; if ($desc instanceof Array) $desc = $desc[1]; _NativeTypedArrayOfInt.prototype = $desc; function _NativeTypedArray_ListMixin() { } _NativeTypedArray_ListMixin.builtin$cls = "_NativeTypedArray_ListMixin"; if (!"name" in _NativeTypedArray_ListMixin) _NativeTypedArray_ListMixin.name = "_NativeTypedArray_ListMixin"; $desc = $collectedClasses._NativeTypedArray_ListMixin; if ($desc instanceof Array) $desc = $desc[1]; _NativeTypedArray_ListMixin.prototype = $desc; function _NativeTypedArray_ListMixin_FixedLengthListMixin() { } _NativeTypedArray_ListMixin_FixedLengthListMixin.builtin$cls = "_NativeTypedArray_ListMixin_FixedLengthListMixin"; if (!"name" in _NativeTypedArray_ListMixin_FixedLengthListMixin) _NativeTypedArray_ListMixin_FixedLengthListMixin.name = "_NativeTypedArray_ListMixin_FixedLengthListMixin"; $desc = $collectedClasses._NativeTypedArray_ListMixin_FixedLengthListMixin; if ($desc instanceof Array) $desc = $desc[1]; _NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = $desc; return [HtmlElement, AnchorElement, AnimationEvent, AreaElement, AudioElement, AutocompleteErrorEvent, BRElement, BaseElement, BeforeLoadEvent, BeforeUnloadEvent, BodyElement, ButtonElement, CDataSection, CanvasElement, CharacterData, CloseEvent, Comment, CompositionEvent, ContentElement, CssFontFaceLoadEvent, CssStyleDeclaration, CustomEvent, DListElement, DataListElement, DetailsElement, DeviceMotionEvent, DeviceOrientationEvent, DialogElement, DivElement, Document, DocumentFragment, DocumentType, DomError, DomException, Element, EmbedElement, ErrorEvent, Event, EventTarget, FieldSetElement, FileError, FocusEvent, FormElement, HRElement, HashChangeEvent, HeadElement, HeadingElement, HtmlDocument, HtmlHtmlElement, IFrameElement, ImageElement, InputElement, KeyboardEvent, KeygenElement, LIElement, LabelElement, LegendElement, LinkElement, MapElement, MediaElement, MediaError, MediaKeyError, MediaKeyEvent, MediaKeyMessageEvent, MediaKeyNeededEvent, MediaStream, MediaStreamEvent, MediaStreamTrackEvent, MenuElement, MessageEvent, MetaElement, MeterElement, MidiConnectionEvent, MidiMessageEvent, ModElement, MouseEvent, Navigator, NavigatorUserMediaError, Node, NodeList, OListElement, ObjectElement, OptGroupElement, OptionElement, OutputElement, OverflowEvent, PageTransitionEvent, ParagraphElement, ParamElement, PopStateEvent, PositionError, PreElement, ProcessingInstruction, ProgressElement, ProgressEvent, QuoteElement, ResourceProgressEvent, RtcDataChannelEvent, RtcDtmfToneChangeEvent, RtcIceCandidateEvent, ScriptElement, SecurityPolicyViolationEvent, SelectElement, ShadowElement, ShadowRoot, SourceElement, SpanElement, SpeechInputEvent, SpeechRecognitionError, SpeechRecognitionEvent, SpeechSynthesisEvent, StorageEvent, StyleElement, TableCaptionElement, TableCellElement, TableColElement, TableElement, TableRowElement, TableSectionElement, TemplateElement, Text, TextAreaElement, TextEvent, TitleElement, TouchEvent, TrackElement, TrackEvent, TransitionEvent, UIEvent, UListElement, UnknownElement, VideoElement, WheelEvent, Window, _Attr, _ClientRect, _Entity, _HTMLAppletElement, _HTMLBaseFontElement, _HTMLDirectoryElement, _HTMLFontElement, _HTMLFrameElement, _HTMLFrameSetElement, _HTMLMarqueeElement, _MutationEvent, _Notation, _XMLHttpRequestProgressEvent, VersionChangeEvent, AElement, AltGlyphElement, AnimateElement, AnimateMotionElement, AnimateTransformElement, AnimatedLength, AnimatedLengthList, AnimatedNumber, AnimatedNumberList, AnimationElement, CircleElement, ClipPathElement, DefsElement, DescElement, EllipseElement, FEBlendElement, FEColorMatrixElement, FEComponentTransferElement, FECompositeElement, FEConvolveMatrixElement, FEDiffuseLightingElement, FEDisplacementMapElement, FEDistantLightElement, FEFloodElement, FEFuncAElement, FEFuncBElement, FEFuncGElement, FEFuncRElement, FEGaussianBlurElement, FEImageElement, FEMergeElement, FEMergeNodeElement, FEMorphologyElement, FEOffsetElement, FEPointLightElement, FESpecularLightingElement, FESpotLightElement, FETileElement, FETurbulenceElement, FilterElement, ForeignObjectElement, GElement, GraphicsElement, ImageElement0, LineElement, LinearGradientElement, MarkerElement, MaskElement, MetadataElement, PathElement, PatternElement, PolygonElement, PolylineElement, RadialGradientElement, RectElement, ScriptElement0, SetElement, StopElement, StyleElement0, SvgDocument, SvgElement, SvgSvgElement, SwitchElement, SymbolElement, TSpanElement, TextContentElement, TextElement, TextPathElement, TextPositioningElement, TitleElement0, UseElement, ViewElement, ZoomEvent, _GradientElement, _SVGAltGlyphDefElement, _SVGAltGlyphItemElement, _SVGAnimateColorElement, _SVGComponentTransferFunctionElement, _SVGCursorElement, _SVGFEDropShadowElement, _SVGFontElement, _SVGFontFaceElement, _SVGFontFaceFormatElement, _SVGFontFaceNameElement, _SVGFontFaceSrcElement, _SVGFontFaceUriElement, _SVGGlyphElement, _SVGGlyphRefElement, _SVGHKernElement, _SVGMPathElement, _SVGMissingGlyphElement, _SVGVKernElement, AudioProcessingEvent, OfflineAudioCompletionEvent, ContextEvent, SqlError, TypedData, Uint8List, JS_CONST, Interceptor, JSBool, JSNull, JavaScriptObject, PlainJavaScriptObject, UnknownJavaScriptObject, JSArray, JSNumber, JSInt, JSDouble, JSString, startRootIsolate_closure, startRootIsolate_closure0, _Manager, _IsolateContext, _EventLoop, _EventLoop__runHelper_next, _IsolateEvent, _MainManagerStub, IsolateNatives__processWorkerMessage_closure, _BaseSendPort, _NativeJsSendPort, _NativeJsSendPort_send_closure, _WorkerSendPort, RawReceivePortImpl, ReceivePortImpl, _JsSerializer, _JsCopier, _JsDeserializer, _JsVisitedMap, _MessageTraverserVisitedMap, _MessageTraverser, _Copier, _Copier_visitMap_closure, _Serializer, _Deserializer, TimerImpl, TimerImpl_internalCallback, TimerImpl_internalCallback0, ReflectionInfo, TypeErrorDecoder, NullError, JsNoSuchMethodError, UnknownJsTypeError, unwrapException_saveStackTrace, _StackTrace, invokeClosure_closure, invokeClosure_closure0, invokeClosure_closure1, invokeClosure_closure2, invokeClosure_closure3, Closure, TearOffClosure, BoundClosure, RuntimeError, RuntimeType, RuntimeFunctionType, DynamicRuntimeType, TypeImpl, initHooks_closure, initHooks_closure0, initHooks_closure1, Balls, Balls_tick_closure, Balls_collideBalls_closure, Balls_collideBalls__closure, Ball, CountDownClock, ClockNumber, ClockNumber_setPixels_closure, Colon, ListIterator, MappedIterable, EfficientLengthMappedIterable, MappedIterator, FixedLengthListMixin, _AsyncError, Future, _Future, _Future__addListener_closure, _Future__chainFutures_closure, _Future__chainFutures_closure0, _Future__asyncComplete_closure, _Future__propagateToListeners_closure, _Future__propagateToListeners_closure0, _Future__propagateToListeners__closure, _Future__propagateToListeners__closure0, Stream, Stream_forEach_closure, Stream_forEach__closure, Stream_forEach__closure0, Stream_forEach_closure0, Stream_length_closure, Stream_length_closure0, StreamSubscription, _StreamController, _StreamController__subscribe_closure, _StreamController__recordCancel_complete, _SyncStreamControllerDispatch, _AsyncStreamControllerDispatch, _AsyncStreamController, _StreamController__AsyncStreamControllerDispatch, _SyncStreamController, _StreamController__SyncStreamControllerDispatch, _ControllerStream, _ControllerSubscription, _EventSink, _BufferingStreamSubscription, _BufferingStreamSubscription__sendDone_sendDone, _StreamImpl, _DelayedEvent, _DelayedData, _DelayedDone, _PendingEvents, _PendingEvents_schedule_closure, _StreamImplEvents, _cancelAndError_closure, _cancelAndErrorClosure_closure, _BaseZone, _BaseZone_bindCallback_closure, _BaseZone_bindCallback_closure0, _BaseZone_bindUnaryCallback_closure, _BaseZone_bindUnaryCallback_closure0, _rootHandleUncaughtError_closure, _rootHandleUncaughtError__closure, _RootZone, _HashMap, _HashMap_values_closure, HashMapKeyIterable, HashMapKeyIterator, _LinkedHashMap, _LinkedHashMap_values_closure, LinkedHashMapCell, LinkedHashMapKeyIterable, LinkedHashMapKeyIterator, _HashSet, _IdentityHashSet, HashSetIterator, _LinkedHashSet, LinkedHashSetCell, LinkedHashSetIterator, _HashSetBase, IterableBase, ListMixin, Maps_mapToString_closure, ListQueue, _ListQueueIterator, NoSuchMethodError_toString_closure, DateTime, DateTime_toString_fourDigits, DateTime_toString_threeDigits, DateTime_toString_twoDigits, Duration, Duration_toString_sixDigits, Duration_toString_twoDigits, Error, NullThrownError, ArgumentError, RangeError, UnsupportedError, UnimplementedError, StateError, ConcurrentModificationError, StackOverflowError, CyclicInitializationError, _ExceptionImplementation, Expando, Iterator, Null, Object, StackTrace, StringBuffer, Symbol, Interceptor_CssStyleDeclarationBase, CssStyleDeclarationBase, Interceptor_ListMixin, Interceptor_ListMixin_ImmutableListMixin, ImmutableListMixin, FixedSizeListIterator, _JSRandom, _NativeTypedArray, _NativeTypedArrayOfInt, _NativeTypedArray_ListMixin, _NativeTypedArray_ListMixin_FixedLengthListMixin]; } ================================================ FILE: _archive/apps/samples/dart/dart/numbers.dart ================================================ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. part of clock; class ClockNumber { static const int WIDTH = 4; static const int HEIGHT = 7; CountDownClock app; Element root; List> imgs; List> pixels; int ballColor; ClockNumber(this.app, double pos, this.ballColor) { imgs = new List>(HEIGHT); root = new DivElement(); makeAbsolute(root); setElementPosition(root, pos, 0.0); for (int y = 0; y < HEIGHT; ++y) { imgs[y] = new List(WIDTH); } for (int y = 0; y < HEIGHT; ++y) { for (int x = 0; x < WIDTH; ++x) { imgs[y][x] = new ImageElement(); root.nodes.add(imgs[y][x]); makeAbsolute(imgs[y][x]); setElementPosition(imgs[y][x], x * CountDownClock.BALL_WIDTH, y * CountDownClock.BALL_HEIGHT); } } } void setPixels(List> px) { for (int y = 0; y < HEIGHT; ++y) { for (int x = 0; x < WIDTH; ++x) { ImageElement img = imgs[y][x]; if (pixels != null) { if ((pixels[y][x] != 0) && (px[y][x] == 0)) { scheduleMicrotask(() { var r = img.getBoundingClientRect(); double absx = r.left; double absy = r.top; app.balls.add(absx, absy, ballColor); }); } } img.src = px[y][x] != 0 ? Balls.PNGS[ballColor] : Balls.PNGS[6]; } } pixels = px; } } class Colon { Element root; Colon(double xpos, double ypos) { root = new DivElement(); makeAbsolute(root); setElementPosition(root, xpos, ypos); ImageElement dot = new ImageElement(src: Balls.PNGS[Balls.DK_GRAY_BALL_INDEX]); root.nodes.add(dot); makeAbsolute(dot); setElementPosition(dot, 0.0, 2.0 * CountDownClock.BALL_HEIGHT); dot = new ImageElement(src: Balls.PNGS[Balls.DK_GRAY_BALL_INDEX]); root.nodes.add(dot); makeAbsolute(dot); setElementPosition(dot, 0.0, 4.0 * CountDownClock.BALL_HEIGHT); } } class ClockNumbers { static const PIXELS = const [ const [ const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ], const [ const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 0 ], const[ 1, 0, 0, 0 ], const[ 1, 1, 1, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ], const [ const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 0 ], const[ 1, 0, 0, 0 ], const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 0 ], const[ 1, 0, 0, 0 ], const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ], const [ const[ 1, 1, 1, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 0, 0, 1 ], const[ 1, 1, 1, 1 ], const[ 0, 0, 0, 1 ], const[ 0, 0, 0, 1 ], const[ 1, 1, 1, 1 ] ] ]; } ================================================ FILE: _archive/apps/samples/dart/js/browser_dart_csp_safe.js ================================================ // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. (function() { // Bootstrap support for Dart scripts on the page as this script. if (navigator.userAgent.indexOf('(Dart)') === -1) { // TODO: // - Support in-browser compilation. // - Handle inline Dart scripts. // Use "precompiled" version, which is CSP safe. Required for packaged apps. var jsSuffix = '.dart.precompiled.js'; // Fall back to compiled JS. Run through all the scripts and // replace them if they have a type that indicate that they source // in Dart code (type="application/dart"). var scripts = document.getElementsByTagName("script"); var length = scripts.length; for (var i = 0; i < length; ++i) { if (scripts[i].type == "application/dart") { // Remap foo.dart to foo.dart.js. if (scripts[i].src && scripts[i].src != '') { var script = document.createElement('script'); script.src = scripts[i].src.replace(/\.dart(?=\?|$)/, jsSuffix); var parent = scripts[i].parentNode; // TODO(vsm): Find a solution for issue 8455 that works with more // than one script. document.currentScript = script; parent.replaceChild(script, scripts[i]); } } } } })(); ================================================ FILE: _archive/apps/samples/dart/js/main.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('clock.html', {id: 'clock', innerBounds: {width: 800, height: 550}}); }); ================================================ FILE: _archive/apps/samples/dart/manifest.json ================================================ { "manifest_version": 2, "name": "Hello Dart! Sample", "version": "2", "minimum_chrome_version": "23", "icons": {"128": "images/dart_icon.png"}, "app": { "background": { "scripts": ["js/main.js"] } } } ================================================ FILE: _archive/apps/samples/dart/pubspec.yaml ================================================ name: dart-clock-packaged-app-sample dependencies: browser: any ================================================ FILE: _archive/apps/samples/dart/sample_support_metadata.json ================================================ { "sample": "dart", "files_with_snippets": [ ], "ios": {"works": true, "comments": "Visual issues caused by fixed-size layout"} } ================================================ FILE: _archive/apps/samples/desktop-capture/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Desktop Capture Shows how to grab a desktop capture feed using getUserMedia. Requires the appropriate permissions (`desktopCapture`) to be set in the manifest file. ## APIs * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) * [desktopCapture](https://developer.chrome.com/apps/desktopCapture) ## Screenshot ![screenshot](/_archive/apps/samples/desktop-capture/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/desktop-capture/app.js ================================================ /* Copyright 2014 Intel Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Author: Dongseong Hwang (dongseong.hwang@intel.com) */ /** * Grabs the desktop capture feed from the browser, requesting * desktop capture. Requires the permissions * for desktop capture to be set in the manifest. * * @see https://developer.chrome.com/apps/desktopCapture */ var desktop_sharing = false; var local_stream = null; function toggle() { if (!desktop_sharing) { chrome.desktopCapture.chooseDesktopMedia(["screen", "window"], onAccessApproved); } else { desktop_sharing = false; if (local_stream) local_stream.stop(); local_stream = null; document.querySelector('button').innerHTML = "Enable Capture"; console.log('Desktop sharing stopped...'); } } function onAccessApproved(desktop_id) { if (!desktop_id) { console.log('Desktop Capture access rejected.'); return; } desktop_sharing = true; document.querySelector('button').innerHTML = "Disable Capture"; console.log("Desktop sharing started.. desktop_id:" + desktop_id); navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: desktop_id, minWidth: 1280, maxWidth: 1280, minHeight: 720, maxHeight: 720 } } }, gotStream, getUserMediaError); function gotStream(stream) { local_stream = stream; document.querySelector('video').src = URL.createObjectURL(stream); stream.onended = function() { if (desktop_sharing) { toggle(); } }; } function getUserMediaError(e) { console.log('getUserMediaError: ' + JSON.stringify(e, null, '---')); } } /** * Click handler to init the desktop capture grab */ document.querySelector('button').addEventListener('click', function(e) { toggle(); }); ================================================ FILE: _archive/apps/samples/desktop-capture/background.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "desktopCaptureID", innerBounds: { width: 700, height: 600 } }); }); ================================================ FILE: _archive/apps/samples/desktop-capture/index.html ================================================

          ================================================ FILE: _archive/apps/samples/desktop-capture/manifest.json ================================================ { "name": "Desktop Capture Sample", "version": "2", "manifest_version": 2, "icons": { "16": "desktop.png", "128": "desktop.png" }, "app": { "background": { "scripts": ["background.js"] } }, "permissions": [ "desktopCapture" ] } ================================================ FILE: _archive/apps/samples/dialog-element/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Dialog Element The WHATWG defines a new element called `` that can be used to define modal and modeless dialogs within an HTML page. This example shows how to use this new element. NOTE: This sample requires M31 or later in Chrome, and if necessary you might have to enable experimental web features in the chrome://flags page. ```javascript var dialog = document.querySelector('#dialog1'); document.querySelector('#show').addEventListener("click", function(evt) { dialog.showModal(); }); document.querySelector('#close').addEventListener("click", function(evt) { dialog.close("thanks!"); }); dialog.addEventListener("close", function(evt) { document.querySelector('#result').textContent = "You closed the dialog with: " + dialog.returnValue; }); // called when the user Cancels the dialog, for example by hitting the ESC key dialog.addEventListener("cancel", function(evt) { dialog.close("canceled"); }); ``` ## Resources * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/dialog-element/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/dialog-element/dialog.js ================================================ window.addEventListener("load", function(e) { var dialog = document.querySelector('#dialog1'); document.querySelector('#show').addEventListener("click", function(evt) { dialog.showModal(); }); document.querySelector('#close').addEventListener("click", function(evt) { dialog.close("thanks!"); }); dialog.addEventListener("close", function(evt) { document.querySelector('#result').textContent = "You closed the dialog with: " + dialog.returnValue; }); // called when the user Cancels the dialog, for example by hitting the ESC key dialog.addEventListener("cancel", function(evt) { dialog.close("canceled"); }); }); ================================================ FILE: _archive/apps/samples/dialog-element/index.html ================================================ Hello World

          Dialog Title

          This is the dialog content

          Dialog Element Example

          Demonstrates how to use the <dialog> element in a Chrome App to implement in-app dialogs

          ================================================ FILE: _archive/apps/samples/dialog-element/main.js ================================================ /** * Listens for the app launching then creates the window * * @see https://developer.chrome.com/docs/extensions/reference/app_runtime * @see https://developer.chrome.com/docs/extensions/reference/app_window */ chrome.app.runtime.onLaunched.addListener(function() { // Center window on screen. var screenWidth = screen.availWidth; var screenHeight = screen.availHeight; var width = 600; var height = 400; chrome.app.window.create('index.html', { id: "window1", outerBounds: { width: width, height: height, left: Math.round((screenWidth-width)/2), top: Math.round((screenHeight-height)/2) } }); }); ================================================ FILE: _archive/apps/samples/dialog-element/manifest.json ================================================ { "manifest_version": 2, "name": "Dialog Element Example", "version": "2", "minimum_chrome_version": "31", "app": { "background": { "scripts": ["main.js"] } } } ================================================ FILE: _archive/apps/samples/dialog-element/styles.css ================================================ dialog { border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 6px; box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); padding: 0; } dialog::backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.7); } dialog h1 { background-color: #eee; font-size: 14pt; text-align: center; font-weight: bold; margin: 0; padding: 4pt; border-bottom: 1px solid black; } dialog div { padding: 10pt; } p { font-size: 14pt; } ================================================ FILE: _archive/apps/samples/diff/README.md ================================================ ![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-extensions-samples/main/_archive/apps/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") # Diff A non-trivial application to diff two files choosen by the user. This app shows how you can open for reading and for writing files in the user's computer, as long as the file was explicitly selected by the user. It uses the Filesystem API, which is an extension of the HTML5 Filesystem API. ## Try it: [Diff Tool Sample](https://chrome.google.com/webstore/detail/diff-tool/knammbkafbpckgibgjilgpcnpacmecme) ## APIs * [Local Storage API](http://developer.chrome.com/apps/storage) to save history of selected files * [Filesystem API](http://developer.chrome.com/apps/app_storage.html) to allow the user to pick arbitrary files from the disk and save them back. * [Runtime](https://developer.chrome.com/docs/extensions/reference/app_runtime) * [Window](https://developer.chrome.com/docs/extensions/reference/app_window) ## Screenshot ![screenshot](/_archive/apps/samples/diff/assets/screenshot_1280_800.png) ================================================ FILE: _archive/apps/samples/diff/css/editor.css ================================================ .ace_editor { position: absolute; overflow: hidden; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace; font-size: 12px; } .ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; } .ace_content { position: absolute; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; cursor: text; } .ace_composition { position: absolute; background: #555; color: #DDD; z-index: 4; } .ace_gutter { position: absolute; overflow : hidden; height: 100%; width: auto; cursor: default; z-index: 1000; } .ace_gutter.horscroll { box-shadow: 0px 0px 20px rgba(0,0,0,0.4); } .ace_gutter-cell { padding-left: 19px; padding-right: 6px; } .ace_gutter-cell.ace_error { background-image: url("data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B"); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_warning { background-image: url("data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B"); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_info { background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7"); background-repeat: no-repeat; background-position: 2px center; } .ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0; } .ace_editor .ace_sb div { position: absolute; width: 1px; left: 0; } .ace_editor .ace_print_margin_layer { z-index: 0; position: absolute; overflow: hidden; margin: 0; left: 0; height: 100%; width: 100%; } .ace_editor .ace_print_margin { position: absolute; height: 100%; } .ace_editor textarea { position: fixed; z-index: 0; width: 10px; height: 30px; opacity: 0; background: transparent; appearance: none; -moz-appearance: none; border: none; resize: none; outline: none; overflow: hidden; } .ace_layer { z-index: 1; position: absolute; overflow: hidden; white-space: nowrap; height: 100%; width: 100%; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; /* setting pointer-events: auto; on node under the mouse, which changes during scroll, will break mouse wheel scrolling in Safari */ pointer-events: none; } .ace_gutter .ace_layer { position: relative; min-width: 40px; text-align: right; pointer-events: auto; } .ace_text-layer { color: black; } .ace_cjk { display: inline-block; text-align: center; } .ace_cursor-layer { z-index: 4; } .ace_cursor { z-index: 4; position: absolute; } .ace_cursor.ace_hidden { opacity: 0.2; } .ace_editor.multiselect .ace_cursor { border-left-width: 1px; } .ace_line { white-space: nowrap; } .ace_marker-layer .ace_step { position: absolute; z-index: 3; } .ace_marker-layer .ace_selection { position: absolute; z-index: 5; } .ace_marker-layer .ace_bracket { position: absolute; z-index: 6; } .ace_marker-layer .ace_active_line { position: absolute; z-index: 2; } .ace_gutter .ace_gutter_active_line{ background-color : #dcdcdc; } .ace_marker-layer .ace_selected_word { position: absolute; z-index: 4; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } .ace_line .ace_fold { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; display: inline-block; height: 11px; margin-top: -2px; vertical-align: middle; background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"), url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82"); background-repeat: no-repeat, repeat-x; background-position: center center, top left; color: transparent; border: 1px solid black; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; cursor: pointer; pointer-events: auto; } .ace_dark .ace_fold { } .ace_fold:hover{ background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"), url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82"); background-repeat: no-repeat, repeat-x; background-position: center center, top left; } .ace_dragging .ace_content { cursor: move; } .ace_folding-enabled > .ace_gutter-cell { padding-right: 13px; } .ace_fold-widget { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; margin: 0 -12px 1px 1px; display: inline-block; height: 14px; width: 11px; vertical-align: text-bottom; background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82"); background-repeat: no-repeat; background-position: center 5px; border-radius: 3px; } .ace_fold-widget.end { background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82"); } .ace_fold-widget.closed { background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82"); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7); -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7); -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); background-position: center 4px; } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255); -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255); -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); box-shadow:inset 0 1px 1px rgba(255, 255, 255); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } .ace_fold-widget.invalid { background-color: #FFB4B4; border-color: #DE5555; } ================================================ FILE: _archive/apps/samples/diff/css/style.css ================================================ /** * Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. **/ body { background: #fff; color: #222; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; margin: 10px; min-width: 1230px; } .title { color: #dd4b39; font-size: 20px; margin-bottom: 1em; } .button { background-color: #f5f5f5; background-image: linear-gradient(top, #f5f5f5, #f1f1f1); background-image: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 2px; -webkit-border-radius: 2px; color: #444; cursor: default; display: inline-block; font-size: 11px; font-weight: bold; height: 27px; line-height: 27px; margin-right: 16px; min-width: 54px; padding: 0 8px; text-align: center; transition: all 0.218s; -webkit-transition: all 0.218s; white-space: nowrap; } .button:hover { background-color: #f8f8f8; background-image: -webkit-linear-gradient(top, #f8f8f8, #f1f1f1); background-image: linear-gradient(top, #f8f8f8, #f1f1f1); border: 1px solid #c6c6Cc; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); color: #222; transition: all 0.0s; -webkit-transition: all 0.0s; } .button:active { background-color: #f6f6f6; background-image: -webkit-linear-gradient(top, #f6f6f6, #f1f1f1); background-image: linear-gradient(top, #f6f6f6, #f1f1f1); border: 1px solid #c6c6c6; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); color: #333; } .button.blue { background-color: #4d90fe; background-image: -webkit-linear-gradient(top, #4d90fe, #4787ed); background-image: linear-gradient(top, #4d90fe, #4787ed); border: 1px solid #3079ed; color: #fff; } .menubutton { position: relative; margin-top: 4px; } .menubutton .label { display: inline-block; font-size: 14px; font-weight: normal; margin-left: 5px; overflow: hidden; width: 310px; text-align: left; } .menubutton .indicator { background: url('../img/triangle-down.png') center no-repeat; float: right; height: 11px; margin-left: 7px; margin-top: -20px; opacity: 0.7; transform: none; -webkit-transform: none; width: 7px; } .menubutton:hover .indicator { border-left-color: #999; opacity: 1; } .menubutton .menulist { background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); filter: alpha(opacity=00); height: 0; left: -9999px; margin-top: 0px; opacity: 0; outline: 1px solid rgba(0, 0, 0, 0.2); padding: 0px; position: absolute; text-align: left; transition: 0; white-space: nowrap; width: 100%; z-index: 99; } .menubutton .menulist.shown { filter: alpha(opacity=100); height: auto; left: 0; opacity: 1.0; transition: 0; -webkit-transition: 0; } .menubutton .menulist.scroll.shown { max-height: 174px; overflow: auto; } .menulist .menulistitem { color: #333; cursor: default; display: block; font-size: 13px; font-weight: normal; margin: 0px; margin-bottom: 4px; overflow: hidden; padding: 2px 40px 2px 12px; position: relative; } .menulist .menulistitem:hover, .menulist .menulistitem.selected { background-color: #f1f1f1; color: #222; transition: background 0s; -webkit-transition: background 0s; } .menulist .menulistitem .delete { background: url('../img/x.png') center no-repeat; background-size: auto 15px; cursor: default; filter: alpha(opacity=70); height: 10px; opacity: 0.7; position: absolute; right: 5px; top: 10px; width: 10px; } .menulist .menulistitem .delete:hover { opacity: 1; } input[type=text] { background-color: #fff; border: 1px solid #d9d9d9; border-top: 1px solid #c0c0c0; box-sizing: border-box; -webkit-box-sizing: border-box; border-radius: 1 px; -webkit-border-radius: 1px; color: #333; display: inline-block; height: 29px; line-height: 27px; padding-left: 8px; vertical-align: top; } input[type=text]:hover { border: 1px solid #b9b9b9; border-top: 1px solid #a0a0a0; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.1); } input[type=text]:focus { border: 1px solid #4d90fe; box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.3); outline: none; } #modal-shield { background: #fff; bottom: 0; filter: alpha(opacity=75); left: 0; opacity: 0.75; position: fixed; right: 0; top: 0; transition: all 0.218s; -webkit-transition: all 0.218s; z-index: 99; } .modal-dialog { background: white; border: 1px solid #ccc; box-shadow: 0 4px 16px rgba(0,0,0,0.2); -webkit-box-shadow: 0 4px 16px rgba(0,0,0,0.2); height: auto; left: 50%; margin-left: -256px; opacity: 0.0; outline: 1px solid rgba(0,0,0,0.2); overflow: hidden; padding: 30px 42px; position: fixed; right: auto; top: 72px; transform: scale(1.05); -webkit-transform: scale(1.05); transition: all 0.218s; -webkit-transition: all 0.218s; width: 512px; z-index: 100; } .modal-dialog.visible { opacity: 1.0; transform: scale(1.0); -webkit-transform: scale(1.0); } .modal-dialog h1 { color: #222; font-family: inherit; font-size: 16px; font-style: inherit; font-weight: normal; line-height: 24px; margin: 0; margin-bottom: 1em; padding: 0; vertical-align: baseline; } .modal-dialog .close-button { background: url('../img/x.png') center no-repeat; cursor: default; filter: alpha(opacity=70); height: 44px; opacity: 0.7; position: absolute; right: 0; top: 0; width: 44px; } .modal-dialog .close-button:hover { filter: alpha(opacity=100); opacity: 1; } .prompt label { display: block; margin-bottom: 16px; } .prompt input[type=text] { width: 100%; } input[type=text].form-error{ border: 1px solid #dd4b39; } .error-message{ color: #dd4b39; padding: 0px; } .offline { margin-bottom: 10px; margin-top: -5px; } .offline div.text { color: #999; font-size: 14px; margin-left: 24px; margin-top: -18px; position: absolute; } .offline .loader { background-color: #999; border-color: #999; border-radius: 50%; -webkit-border-radius: 50%; display: block; height: 19px; position: relative; width: 19px; } .offline .loader .bolt { background: url('../img/offline_lightning.png') center no-repeat; height: 14px; left: 50%; margin-left: -4px; margin-top: -7px; position: absolute; top: 50%; transition: opacity 0.218s linear 0.44s; -webkit-transition: opacity 0.218s linear 0.44s; width: 8px; } .tooltip { background: #2d2d2d; box-shadow: 1px 2px 4px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 1px 4px rgba(0,0,0,0.2); box-sizing: border-box; -webkit-box-sizing: border-box; color: #FFF; display: block; font-size: 11px; font-weight: bold; height: 29px; line-height: 29px; outline: 1px solid rgba(255,255,255,0.5); padding: 0 10px; position: absolute; text-align: center; transition: opacity 0.13s; -webkit-transition: opacity 0.13s; white-space: nowrap; z-index: 2000; } .tooltip.visible { opacity: 1.0; } .tooltip .pointer { border-left: 5px solid transparent; border-bottom: 5px solid #2d2d2d; border-right: 5px solid transparent; border-top: transparent; display: block; font-size: 0px; height: 0; left: 24px; line-height: 0px; margin: 0 0 0 -5px; outline: none; position: absolute; top: -5px; width: 0; } ::-webkit-scrollbar { width: 10px; height: 10px; border: 1px solid #eee; } ::-webkit-scrollbar-thumb { background: #ddd; border: 1px solid #d5d5d5; } #left-side { float: left; height: 100%; margin-right: 5px; min-height: 768px; position: relative; width: 44px; } #left-side .button.new-diff { cursor: pointer; float: left; height: 30px; margin: 4px; min-height: 30px; min-width: 36px; padding: 0px; width: 36px; } #left-side .button.new-diff img { height: 24px; margin-top: 3px; width: 24px; } #left-side .tooltip.new-diff { top: 42px; } #left-side #prev-chunk { background: url('../img/arrow-up.jpg') center no-repeat; background-size: auto 20px; cursor: pointer; height: 30px; left: 13px; position: absolute; top: 75px; width: 20px; } #left-side .tooltip.prev-chunk { left: 0px; top: 110px; } #left-side .tooltip.prev-chunk .pointer { left: 23px; } #left-side #next-chunk { background: url('../img/arrow-down.jpg') center no-repeat; background-size: auto 20px; cursor: pointer; height: 30px; left: 13px; position: absolute; top: 105px; width: 20px; } #left-side .tooltip.next-chunk { left: 0px; top: 135px; } #left-side .tooltip.next-chunk .pointer { left: 23px; } #left-side #expand-all, #left-side #collapse-all { cursor: pointer; height: 20px; position: absolute; top: 45px; width: 20px; } #left-side #expand-all { background: url('../img/plus_all.png') center no-repeat; left: 2px; } #left-side .tooltip.expand-all { top: 73px; left: 0px; } #left-side .tooltip.expand-all .pointer { left: 15px; } #left-side #collapse-all { background: url('../img/minus_all.png') center no-repeat; left: 21px; } #left-side .tooltip.collapse-all { top: 73px; left: 18px; } #left-side .tooltip.collapse-all .pointer { left: 15px; } #left-side #expand-all.disabled, #left-side #collapse-all.disabled, #left-side #prev-chunk.disabled, #left-side #next-chunk.disabled { cursor: default; opacity: 0.25; } #arrow-container, #check-container { border-bottom: 2px solid #666; border-top: 2px solid #666; float: left; height: 705px; margin-top: 43px; overflow: auto; position: relative; width: 30px; } #arrow-container::-webkit-scrollbar, #check-container::-webkit-scrollbar { display: none; } #arrow-container .arrow { background: url('../img/arrow-right.png') center no-repeat; background-size: auto 85px; height: 16px; opacity: 0; } #check-container .check { background: url('../img/arrow-left.png') center no-repeat; background-size: auto 85px; height: 20px; margin-bottom: -4px; opacity: 0; } #arrow-container .undo, #check-container .undo, #arrow-container .holder, #check-container .holder { background: url('../img/undo.svg') right no-repeat; height: 16px; opacity: 0; } #arrow-container .visible, #check-container .visible { cursor: pointer; opacity: 1; } #arrow-container.arrow-edit, #check-container.check-edit { opacity: 0; } #file0-container, #file1-container { float: left; min-height: 755px; position: relative; width: 45%; } #file0-container { min-width: 555px; } #file1-container { min-width: 530px; } div.file-name { float: left; font-size: 16px; padding-top: 15px; } span.file-name-info { color: #777; font-size: 11px; } .file-diff, #editor { background: #fff; border: 2px solid #666; color: #666; float: left; font-family: mono, courier, monospace; font-size: 10px; height: 705px; line-height: 16px; margin-bottom: 10px; margin-top: 10px; overflow: auto; top: 35px; white-space: nowrap; width: 100%; } #file0-container .file-diff::-webkit-scrollbar { display: none; } #file0-container .file-diff { border-right: 1px solid #999; } #file1-container .file-diff { border-left: 1px solid #999; } div.button.edit, div.button.save { float: right; height: 20px; margin-left: 16px; margin-right: 0px; margin-top: 10px; min-height: 20px; min-width: 20px; } .tooltip.save { right: 0px; top: 39px; } .tooltip.save .pointer { left: 43px; } .tooltip.edit { right: 55px; top: 39px; } div.button.done { float: right; margin-right: 0px; margin-top: 4px; min-width: 20px; } .edit img, .save img { height: 16px; margin: 2px; width: 16px; } .file-diff > div { float: left; min-height: 16px; min-width: 100%; position: relative; white-space: nowrap; } .file-diff div.collapsed-num { background: #ddf; color: #000; font-family: Helvetica, Arial, sans-serif; text-align: center; } .file-diff div .expand { background-color: #fff; border-right: 1px solid #999; float: left; height: 48px; margin-left: -1px; margin-top: -16px; padding-left: 3px; position: absolute; width: 21px; } .file-diff div.selected-chunk .expand { width: 20px; } .file-diff div .expand.plus { background: url('../img/plus.png') center no-repeat; cursor: pointer; z-index: 10; } .file-diff div .expand.minus { background: url('../img/minus.png') center no-repeat; cursor: pointer; z-index: 10; } .file-diff div.blank { background: #eee; } #file1-container .file-diff div.ins, #file1-container .file-diff div.del { background: #dfd; } #file0-container .file-diff div.del, #file0-container .file-diff div.ins { background: #fee; } .file-diff div.blank.del, .file-diff div.blank.ins { display: none; } .file-diff div.selected-chunk { border-left: 1px solid #000; border-right: 1px solid #000; color: #000; } .file-diff div.selected-chunk.first { border-top: 1px solid #000; box-shadow: 0 -4px 4px -3px #666; } .file-diff div.selected-chunk.last { border-bottom: 1px solid #000; box-shadow: 0 4px 4px -3px #666; } .file-diff div div.lineNum { border-right: 1px solid #999; float: left; overflow: hidden; text-align: center; width: 35px; } #file0-container .file-diff div div.lineNum { position: absolute; left: 26px; } #file0-container .file-diff div div.text { position: absolute; left: 68px; } #file1-container .file-diff div div.text { position: absolute; left: 42px; } .file-diff div span { float: left; position: relative; } .file-diff div span.ins { background: #9f9; } .file-diff div span.del { background: #faa; } #file0-container .file-diff div span.ins { display: none; } #file1-container .file-diff div span.del { display: none; } #file0-container .file-diff div.fix, #file1-container .file-diff div.fix, #file0-container .file-diff div.correct, #file1-container .file-diff div.correct { background: none; } #file0-container .file-diff div.fix span.del { background: none; } #file1-container .file-diff div.fix span.ins { display: none; } #file1-container .file-diff div.fix span.del { display: block; background: none; } #file0-container .file-diff div.correct span.ins { display: block; background: none; } #file0-container .file-diff div.correct span.del { display: none; } .file-diff div.correct span { background: none; } #num-diffs { float: right; margin-right: 12px; margin-top: 15px; } .modal-dialog.new-diff .choose-file { float: left; margin-bottom: 16px; } .modal-dialog.new-diff label { float: left; margin-right: 16px; margin-top: 5px; } .modal-dialog.new-diff input { float: left; margin-bottom: 16px; width: 320px; } .error-message { float: left; margin-bottom: 8px; margin-top: -14px; opacity: 0; } .error-message.visible { opacity: 1; } .modal-dialog.new-diff .loading { margin-left: 16px; position: relative; } .modal-dialog.new-diff .loading .loader { float: left; margin: 4px; } .hidden { display: none; } .modal-dialog.new-diff .url.hidden { display: none; } br.clear { clear: both; } br.clear-right { clear: right; } ================================================ FILE: _archive/apps/samples/diff/js/background.js ================================================ /** * Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. **/ function onLaunched(launchData) { chrome.app.window.create('main.html', { id: "diffWinID", innerBounds: { width: 1270, height: 800 } }); } chrome.app.runtime.onLaunched.addListener(onLaunched); ================================================ FILE: _archive/apps/samples/diff/js/diff.js ================================================ /** * Copyright (c) 2012 The Chromium 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 dmp = new diff_match_patch(); dmp.Diff_Timeout = 1; var clicked; var selectedChunk = 0; var totalChunks; var totalCollapsible = 0; var numCollapsed; $(document).ready(function() { var buttons = [ '#new-diff', '#save', '#edit', '#expand-all', '#collapse-all', '#next-chunk', '#prev-chunk' ]; for (var i = 0; i < buttons.length; i++) { $(buttons[i]).hover( function() { var button = $(this).attr('id'); $('.tooltip.' + button).removeClass('hidden'); }, function() { var button = $(this).attr('id'); $('.tooltip.' + button).addClass('hidden'); } ); } // Check for connection every 5 seconds setInterval(function() { if (navigator.onLine) { $('.offline').addClass('hidden'); $('.url').removeClass('hidden'); } else { $('.offline').removeClass('hidden'); $('.url').addClass('hidden'); } }, 500); $('.file-diff > div').click(function() { console.log(this); selectChunk(this); }); for (i = 0; i < 2; i++) { $('.file-diff.' + i).scroll(function() { var i = $(this).attr('class').split(' ')[1]; $('.file-diff.' + ((parseInt(i) + 1) % 2)).scrollTop( $('.file-diff.' + i).scrollTop()); $('#arrow-container').scrollTop($('.file-diff.' + i).scrollTop()); $('#check-container').scrollTop($('.file-diff.' + i).scrollTop()); }); } $('#arrow-container').scroll(function() { $('.file-diff').scrollTop($('#arrow-container').scrollTop()); $('#check-container').scrollTop($('#arrow-container').scrollTop()); }); $('#check-container').scroll(function() { $('.file-diff').scrollTop($('#check-container').scrollTop()); $('#arrow-container').scrollTop($('#check-container').scrollTop()); }); $('#collapse-all').click(function () { collapseAllMatches(); }); $('#expand-all').click(function () { expandAllMatches(); }); $('#prev-chunk').click(function() { selectPrevChunk(); }); $('#next-chunk').click(function() { selectNextChunk(); }); $(document).keyup(function(event) { var target = event.target || event.srcElement; var targetName = target.tagName.toLowerCase(); if (!disableShortcuts()) { keyboardShortcut(event); } }); }); function keyboardShortcut(event) { if (event.which == 74) selectNextChunk(); else if (event.which == 75) selectPrevChunk(); else if ((event.which == 76) && (selectedChunk > 0) && (selectedChunk <= totalChunks)) moveChunk('chunk-' + selectedChunk); else if ((event.which == 82) && (selectedChunk > 0) && (selectedChunk <= totalChunks)) checkRight('chunk-' + selectedChunk); else if (event.which == 69) expandAllMatches(); else if (event.which == 67) collapseAllMatches(); } function disableShortcuts () { return ( !$('#modal-shield').hasClass('hidden') || $('.button.edit').hasClass('hidden') ) } function getText(fileNum) { var lines = $('.file-diff.' + fileNum + ' div').children('.text'); var text = ''; for (var i = 0; i < lines.length; i++) { if (!isBlankLine($(lines[i]).parent(), null) && !$(lines[i]).hasClass('hidden')) { var line = $(lines[i]).children(); for (var j = 0; j < line.length; j++) { if ($(lines[i]).hasClass('merged')) { if (fileNum == 1 && !$(line[j]).hasClass('ins')) text += $(line[j]).html(); if (fileNum == 0 && !$(line[j]).hasClass('del')) text += $(line[j]).html(); } else { if (fileNum == 0 && !$(line[j]).hasClass('ins')) text += $(line[j]).html(); if (fileNum == 1 && !$(line[j]).hasClass('del')) text += $(line[j]).html(); } } text += '\n'; } } text = escapeHtml(text); return text; } function escapeHtml(text) { var text = text.replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/ /g, ' '); return text; } function ajaxErrorMessage(xhr) { message = 'Please enter a valid URL'; switch (xhr.status) { case 401: message = 'You do not have permission to view that URL'; break; case 403: message = 'You do not have permission to view that URL'; break; case 404: message = 'The URL you entered could not be found'; break; case 500: message = 'There was a server error'; break; } return message; } function getChunk(line) { return $(line).attr('class').replace('del ', '') .replace('ins ', '') .replace('blank ', '') .replace('first ', '') .replace('chunk ', '') .replace('fix ', '') .replace('correct ', '') .split(' ')[1]; } function getRealLine(line) { var classes = $(line).attr('class'); classes = classes.replace('del ', '') .replace('ins ', '') .replace('blank ', '') .replace('first ', '') .replace('fix ', '') .replace('correct ', '') .replace('chunk ', ''); var realLine = classes.split(' ')[0]; return realLine; } function computeDiff(file1, file2) { var d = dmp.diff_main(file1, file2); dmp.diff_cleanupSemantic(d); var ds = createHtmlLines(d); if (texts[0] != '') $('.file-diff.0').html(ds[0]); if (texts[1] != '') $('.file-diff.1').html(ds[1]); setLineTypes(); setLineNums(); if (texts[0] != '' && texts[1] != '') { setNumDiffs(true); setArrowsAndChecks(); createCollapsibleMatches(); $('.button.save').removeClass('hidden'); $('.button.edit').removeClass('hidden'); $('#collapse-all').removeClass('hidden'); $('#expand-all').removeClass('hidden'); } } function patchToFile2(file1, patchText) { var patches = dmp.patch_fromText(patchText); var patchData = dmp.patch_apply(patches, file1); return patchData[0]; } function createHtmlLines(diffs) { var pattern_amp = /&/g; var pattern_lt = //g; var pattern_para = /\n/g; var pattern_cr = /\r/g; var pattern_space = / /g; var pattern_para_sign = /