From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../architecture-examples/jquery/css/app.css | 4 + .../architecture-examples/jquery/index.html | 61 + .../todomvc/architecture-examples/jquery/js/app.js | 196 + .../jquery/node_modules/director/LICENSE | 19 + .../jquery/node_modules/director/bower.json | 9 + .../jquery/node_modules/director/dist/director.js | 725 ++ .../node_modules/director/dist/director.min.js | 7 + .../jquery/node_modules/director/dist/ender.js | 3 + .../jquery/node_modules/director/package.json | 41 + .../node_modules/handlebars/dist/handlebars.js | 4713 +++++++++ .../jquery/node_modules/jquery/dist/jquery.js | 10220 +++++++++++++++++++ .../jquery/node_modules/todomvc-app-css/index.css | 376 + .../node_modules/todomvc-app-css/package.json | 58 + .../jquery/node_modules/todomvc-app-css/readme.md | 28 + .../jquery/node_modules/todomvc-common/base.css | 141 + .../jquery/node_modules/todomvc-common/base.js | 249 + .../node_modules/todomvc-common/package.json | 54 + .../jquery/node_modules/todomvc-common/readme.md | 15 + .../architecture-examples/jquery/package.json | 10 + .../todomvc/architecture-examples/jquery/readme.md | 33 + 20 files changed, 16962 insertions(+) create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/css/app.css create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/index.html create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/js/app.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.min.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/ender.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/package.json create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/handlebars/dist/handlebars.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/jquery/dist/jquery.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-app-css/index.css create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-app-css/package.json create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-app-css/readme.md create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-common/base.css create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-common/base.js create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-common/package.json create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/todomvc-common/readme.md create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/package.json create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/readme.md (limited to 'third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery') diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/css/app.css b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/css/app.css new file mode 100644 index 0000000000..ec723b01c1 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/css/app.css @@ -0,0 +1,4 @@ +#main, +#footer { + display: none; +} diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/index.html b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/index.html new file mode 100644 index 0000000000..63610b2cc4 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/index.html @@ -0,0 +1,61 @@ + + + + + jQuery • TodoMVC + + + + + +
+ +
+ + +
    +
    +
    +
    + + + + + + + + + + diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/js/app.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/js/app.js new file mode 100644 index 0000000000..f345d098c0 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/js/app.js @@ -0,0 +1,196 @@ +/*global jQuery, Handlebars, Router */ +jQuery(function ($) { + 'use strict'; + + Handlebars.registerHelper('eq', function (a, b, options) { + return a === b ? options.fn(this) : options.inverse(this); + }); + + + var util = { + uuid: function () { + /*jshint bitwise:false */ + var i, random; + var uuid = ''; + + for (i = 0; i < 32; i++) { + random = Math.random() * 16 | 0; + if (i === 8 || i === 12 || i === 16 || i === 20) { + uuid += '-'; + } + uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16); + } + + return uuid; + }, + pluralize: function (count, word) { + return count === 1 ? word : word + 's'; + }, + store: function (namespace, data) { + return []; + } + }; + + var App = { + ENTER_KEY: 13, + ESCAPE_KEY: 27, + init: function () { + this.todos = util.store('todos-jquery'); + this.todoTemplate = Handlebars.compile($('#todo-template').html()); + this.footerTemplate = Handlebars.compile($('#footer-template').html()); + this.bindEvents(); + + new Router({ + '/:filter': function (filter) { + this.filter = filter; + this.render(); + }.bind(this) + }).init('/all'); + + var dummyNodeToNotifyAppIsReady = document.createElement('div'); + dummyNodeToNotifyAppIsReady.id = 'appIsReady'; + document.body.appendChild(dummyNodeToNotifyAppIsReady); + }, + bindEvents: function () { + $('#new-todo').on('keyup', this.create.bind(this)); + $('#toggle-all').on('change', this.toggleAll.bind(this)); + $('#footer').on('click', '#clear-completed', this.destroyCompleted.bind(this)); + $('#todo-list') + .on('change', '.toggle', this.toggle.bind(this)) + .on('dblclick', 'label', this.edit.bind(this)) + .on('keyup', '.edit', this.editKeyup.bind(this)) + .on('focusout', '.edit', this.update.bind(this)) + .on('click', '.destroy', this.destroy.bind(this)); + }, + render: function () { + var todos = this.getFilteredTodos(); + $('#todo-list').html(this.todoTemplate(todos)); + $('#main').toggle(todos.length > 0); + $('#toggle-all').prop('checked', this.getActiveTodos().length === 0); + this.renderFooter(); + $('#new-todo').focus(); + util.store('todos-jquery', this.todos); + }, + renderFooter: function () { + var todoCount = this.todos.length; + var activeTodoCount = this.getActiveTodos().length; + var template = this.footerTemplate({ + activeTodoCount: activeTodoCount, + activeTodoWord: util.pluralize(activeTodoCount, 'item'), + completedTodos: todoCount - activeTodoCount, + filter: this.filter + }); + + $('#footer').toggle(todoCount > 0).html(template); + }, + toggleAll: function (e) { + var isChecked = $(e.target).prop('checked'); + + this.todos.forEach(function (todo) { + todo.completed = isChecked; + }); + + this.render(); + }, + getActiveTodos: function () { + return this.todos.filter(function (todo) { + return !todo.completed; + }); + }, + getCompletedTodos: function () { + return this.todos.filter(function (todo) { + return todo.completed; + }); + }, + getFilteredTodos: function () { + if (this.filter === 'active') { + return this.getActiveTodos(); + } + + if (this.filter === 'completed') { + return this.getCompletedTodos(); + } + + return this.todos; + }, + destroyCompleted: function () { + this.todos = this.getActiveTodos(); + this.filter = 'all'; + this.render(); + }, + // accepts an element from inside the `.item` div and + // returns the corresponding index in the `todos` array + indexFromEl: function (el) { + var id = $(el).closest('li').data('id'); + var todos = this.todos; + var i = todos.length; + + while (i--) { + if (todos[i].id === id) { + return i; + } + } + }, + create: function (e) { + var $input = $(e.target); + var val = $.trim($input.val()); + + if (e.which !== this.ENTER_KEY || !val) { + return; + } + + this.todos.push({ + id: util.uuid(), + title: val, + completed: false + }); + + $input.val(''); + + this.render(); + }, + toggle: function (e) { + var i = this.indexFromEl(e.target); + this.todos[i].completed = !this.todos[i].completed; + this.render(); + }, + edit: function (e) { + var $input = $(e.target).closest('li').addClass('editing').find('.edit'); + $input.val($input.val()).focus(); + }, + editKeyup: function (e) { + if (e.which === this.ENTER_KEY) { + e.target.blur(); + } + + if (e.which === this.ESCAPE_KEY) { + $(e.target).data('abort', true).blur(); + } + }, + update: function (e) { + var el = e.target; + var $el = $(el); + var val = $el.val().trim(); + + if (!val) { + this.destroy(e); + return; + } + + if ($el.data('abort')) { + $el.data('abort', false); + } else { + this.todos[this.indexFromEl(el)].title = val; + } + + this.render(); + }, + destroy: function (e) { + this.todos.splice(this.indexFromEl(e.target), 1); + this.render(); + } + }; + + window.app = App; + window.app.init(); +}); diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE new file mode 100644 index 0000000000..8a49810850 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Charlie Robbins, Paolo Fragomeni, & the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json new file mode 100644 index 0000000000..f939bb470e --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json @@ -0,0 +1,9 @@ +{ + "name": "director", + "version": "1.2.7", + "dependencies": {}, + "main": "build/director.js", + "scripts": [ + "build/director.js" + ] +} diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js new file mode 100644 index 0000000000..1038878723 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js @@ -0,0 +1,725 @@ + + +// +// Generated on Tue Dec 16 2014 12:13:47 GMT+0100 (CET) by Charlie Robbins, Paolo Fragomeni & the Contributors (Using Codesurgeon). +// Version 1.2.6 +// + +(function (exports) { + +/* + * browser.js: Browser specific functionality for director. + * + * (C) 2011, Charlie Robbins, Paolo Fragomeni, & the Contributors. + * MIT LICENSE + * + */ + +var dloc = document.location; + +function dlocHashEmpty() { + // Non-IE browsers return '' when the address bar shows '#'; Director's logic + // assumes both mean empty. + return dloc.hash === '' || dloc.hash === '#'; +} + +var listener = { + mode: 'modern', + hash: dloc.hash, + history: false, + + check: function () { + var h = dloc.hash; + if (h != this.hash) { + this.hash = h; + this.onHashChanged(); + } + }, + + fire: function () { + if (this.mode === 'modern') { + this.history === true ? window.onpopstate() : window.onhashchange(); + } + else { + this.onHashChanged(); + } + }, + + init: function (fn, history) { + var self = this; + this.history = history; + + if (!Router.listeners) { + Router.listeners = []; + } + + function onchange(onChangeEvent) { + for (var i = 0, l = Router.listeners.length; i < l; i++) { + Router.listeners[i](onChangeEvent); + } + } + + //note IE8 is being counted as 'modern' because it has the hashchange event + if ('onhashchange' in window && (document.documentMode === undefined + || document.documentMode > 7)) { + // At least for now HTML5 history is available for 'modern' browsers only + if (this.history === true) { + // There is an old bug in Chrome that causes onpopstate to fire even + // upon initial page load. Since the handler is run manually in init(), + // this would cause Chrome to run it twise. Currently the only + // workaround seems to be to set the handler after the initial page load + // http://code.google.com/p/chromium/issues/detail?id=63040 + setTimeout(function() { + window.onpopstate = onchange; + }, 500); + } + else { + window.onhashchange = onchange; + } + this.mode = 'modern'; + } + else { + // + // IE support, based on a concept by Erik Arvidson ... + // + var frame = document.createElement('iframe'); + frame.id = 'state-frame'; + frame.style.display = 'none'; + document.body.appendChild(frame); + this.writeFrame(''); + + if ('onpropertychange' in document && 'attachEvent' in document) { + document.attachEvent('onpropertychange', function () { + if (event.propertyName === 'location') { + self.check(); + } + }); + } + + window.setInterval(function () { self.check(); }, 50); + + this.onHashChanged = onchange; + this.mode = 'legacy'; + } + + Router.listeners.push(fn); + + return this.mode; + }, + + destroy: function (fn) { + if (!Router || !Router.listeners) { + return; + } + + var listeners = Router.listeners; + + for (var i = listeners.length - 1; i >= 0; i--) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + } + } + }, + + setHash: function (s) { + // Mozilla always adds an entry to the history + if (this.mode === 'legacy') { + this.writeFrame(s); + } + + if (this.history === true) { + window.history.pushState({}, document.title, s); + // Fire an onpopstate event manually since pushing does not obviously + // trigger the pop event. + this.fire(); + } else { + dloc.hash = (s[0] === '/') ? s : '/' + s; + } + return this; + }, + + writeFrame: function (s) { + // IE support... + var f = document.getElementById('state-frame'); + var d = f.contentDocument || f.contentWindow.document; + d.open(); + d.write("