Demo/bin/Debug/front_end/resources/ServiceWorkerCacheViews.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// Copyright 2014 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.
/**
* @constructor
* @extends {WebInspector.VBox}
* @param {!WebInspector.ServiceWorkerCacheModel} model
* @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache
*/
WebInspector.ServiceWorkerCacheView = function(model, cache)
{
WebInspector.VBox.call(this);
this.registerRequiredCSS("resources/serviceWorkerCacheViews.css");
this._model = model;
this.element.classList.add("service-worker-cache-data-view");
this.element.classList.add("storage-view");
this._createEditorToolbar();
this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"), "refresh-toolbar-item");
this._refreshButton.addEventListener("click", this._refreshButtonClicked, this);
this._pageSize = 50;
this._skipCount = 0;
this.update(cache);
this._entries = [];
}
WebInspector.ServiceWorkerCacheView.prototype = {
/**
* @return {!WebInspector.DataGrid}
*/
_createDataGrid: function()
{
var columns = [];
columns.push({id: "number", title: WebInspector.UIString("#"), width: "50px"});
columns.push({id: "request", title: WebInspector.UIString("Request")});
columns.push({id: "response", title: WebInspector.UIString("Response")});
var dataGrid = new WebInspector.DataGrid(columns, undefined, this._deleteButtonClicked.bind(this), this._updateData.bind(this, true));
return dataGrid;
},
_createEditorToolbar: function()
{
var editorToolbar = new WebInspector.Toolbar(this.element);
editorToolbar.element.classList.add("data-view-toolbar");
this._pageBackButton = new WebInspector.ToolbarButton(WebInspector.UIString("Show previous page."), "play-backwards-toolbar-item");
this._pageBackButton.addEventListener("click", this._pageBackButtonClicked, this);
editorToolbar.appendToolbarItem(this._pageBackButton);
this._pageForwardButton = new WebInspector.ToolbarButton(WebInspector.UIString("Show next page."), "play-toolbar-item");
this._pageForwardButton.setEnabled(false);
this._pageForwardButton.addEventListener("click", this._pageForwardButtonClicked, this);
editorToolbar.appendToolbarItem(this._pageForwardButton);
后面还有 104 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。