Ext原码学习之Ext.js】的更多相关文章

1 // JavaScript Document 2 //定义全局Ext变量 3 var Ext = Ext ||{}; 4 Ext._startTime = new Date().getTime(); 5 (function(){ 6 var global = this, 7 objectPrototype = Object.prototype, 8 toString = objectPrototype.toString, 9 //是否支持for循环可枚举 10 enumerables = t…
// JavaScript Document (function(){ var TemplateClass = function(){}, ExtObject = Ext.Object = { chain:Object.create || function(object) { TemplateClass.prototype = object; var result = new TemplateClass(); TemplateClass.prototype = null; return resu…
// JavaScript Document Ext.apply(Ext,{ userAgent:navigator.userAgent.toLowerCase(), cache:{}, isSeed:1000, windowId:'ext-window', documentId:'ext-document', isReady:false, enableGarbageCollector:true, enableListenerCollection:true, rootHierarchyState…
// JavaScript Document //Array 方法 (function(){ var arrayPrototype = Array.prototype, slice = arrayPrototype.slice, supportsSplice = (function(){ var array = [],lengthBefore,j = 20; if(!array.splice) { return false; } while(j--) { array.push("A")…
The UI-即上图左下角metamask-ui部分,即其图形化界面 The MetaMask UI is essentially just a website that can be configured by passing it the API and state subscriptions from above. Anyone could make a UI that consumes these, effectively reskinning MetaMask. MetaMask UI…
得益于前辈的分享,做了一个h5录音的demo.效果图如下: 点击开始录音会先弹出确认框: 首次确认允许后,再次录音不需要再确认,但如果用户点击禁止,则无法录音: 点击发送 将录音内容发送到对话框中.点击即可播放.点击获取录音即可下载最后一次的音频: 播放下载都是围绕blob文件.播放就是让隐藏的audio标签的地址指向内存中的blob: this.play = function (audio,blob) { blob=blob||this.getBlob().blob; audio.src =…
以查询历史记录为例: 1.在上层history.js中通过chrome.send()来向底层发送事件请求和相关参数,其中'queryHistory'为信号名称,[this.searchText_, this.offset_, this.rangeInDays_, endTime, maxResults]为向底层传递的参数: chrome.send('queryHistory',[this.searchText_, this.offset_, this.rangeInDays_, endTime,…
protobuf.js的结构和webpack的加载之后的结构很相似.这样的模块化组合是个不错的结构方式.1个是适应了不同的加载方式,2个模块直接很独立.webpack的功能更全一点.但如果自己封装js库这样够用了.而且模块对外统一接口 module.exports.这和node很像. (function(global, undefined) { "use strict"; (function prelude(modules, cache, entries) { function $re…
1. process 这个process是什么?为何都没有引入就可以使用了呢? process 对象是一个 global (全局变量),提供有关信息,控制当前 Node.js 进程.作为一个对象,它对于 Node.js 应用程序始终是可用的,故无需使用 require(); 那procee.env呢?是啥? process.env属性返回一个包含用户环境信息的对象 2. builds 编译的对象的配置,蓝色框 框起来的是对此对象的注释,这个的解释就是只运行时(CommonJS). 使用bundl…
jQuery 源码学习是对js的能力提升很有帮助的一个方法,废话不说,我们来开始学习啦 我们学习的源码是jquery-2.0.3已经不支持IE6,7,8了,因为可以少学很多hack和兼容的方法. jquery-2.0.3的代码结构如下 首先最外层为一个闭包, 代码执行的最后一句为window.$ = window.jquery = jquery 让闭包中的变量暴露倒全局中. 传参传入window是为了便于压缩 传入undefined是为了undifined被修改,他是window的属性,可以被修…