`
suyang119
  • 浏览: 16850 次
社区版块
存档分类
最新评论

Upgrade from 1.2 to 1.3

 
阅读更多
This is a list of the API changes made from 1.2 to 1.3. It allows you to drop the compatibility layer mostly by doing search and replace. If you just want to update to MooTools Core 1.3 with your existing code, see Update from 1.2 to 1.3.

Core
$chk(value) => (value != null)
$A(item) => Array.from(item) // Note: Array.from does not always return a new array but just ensures that the return value is an array.
$splat => Array.from
$clear => use the native clearTimeout when using fn.delay, use clearInterval when using fn.periodical.
$defined => (value != null)
$each => use Array.each for arrays, Object.each for objects
$empty => No replacement, use function(){}
$extend(source, extended) => Object.append(source, extended)
$merge(a, b) => Object.merge({}, a, b)
$mixin(a, b) => Object.merge(a, b)
$lambda => Function.from
$random => Number.random
$time => Date.now
$type => typeOf // Note: returns a string 'null' on empty objects as opposed to "false" in 1.2
$unlink => Array.clone or Object.clone
$arguments => No replacement
Native => Type (see Core.js)
Array.type / String.type / Number.type / … => Type.isArray / Type.isString / Type.isNumber / …
Hash and $H were deprecated and moved from Core to More. Use plain objects instead of Hash. You can find methods to manipulate objects on Object. You can find all 1.2 functionality of Hash in MooTools More 1.3.
Browser
Engine detection was changed in favor of user-agent detection. Browser.Engine was deprecated and according properties on the Browser object were added:

Browser.Engine.trident => Browser.ie
Browser.Engine.gecko => Browser.firefox
Browser.Engine.webkit => Browser.safari or Browser.chrome
Browser.Engine.presto => Browser.opera
Browser.Platform.ipod => Browser.Platform.ios
$exec => Browser.exec
Array
$pick => Array.pick or [a, b, c].pick()
Array.extend => Array.append
Function
$try => Function.attempt
myFn.run(args, bind) => myFn.apply(bind, Array.from(args));
myFn.create => Use the according functions like .pass, .bind, .delay, .periodical
myFn.bindWithEvent => deprecated
myFn.bind(this, [arg1, arg2, arg3]) => myFn.bind(this, arg1, arg2, arg3) OR myFn.pass([arg1, arg2, arg3], this)
Element
element.injectInside, .injectBefore, .injectAfter, .injectBottom, .injectTop => element.inject(context, where); // where = inside, bottom, …
element.grabTop, … => element.grab(context, where) // see above
element.hasChild(item) => item !== element && element.contains(item)
$$ now only accepts a single selector, an array or arguments of elements
Selectors.Pseudo => Slick.definePseudo(name, fn)
分享到:
评论

相关推荐

    simple-tags

    * Version 1.7.1-rc1.2 : RC 1.2 (this version must be test !) * Fix compatibility PHP4 * Version 1.7.1-rc1.1 : RC 1.1 (this version must be test !) * Fix a bug with activation hook. * Version 1.7.1-...

    Maven-The Complete Reference.pdf

    To upgrade Maven, simply download the new version and replace the existing installation. Ensure that you update the `M2_HOME` and `PATH` environment variables if necessary. **2.6 Uninstalling Maven**...

    Solaris 10 System Administration Essentials

    11.3.1 Changing root from a User to a Role 318 11.3.2 Viewing the List of Roles 319 11.3.3 Assigning a Role to a Local User 319 Chapter 12 Solaris Zones 321 12.1 Overview 321 12.2 How Zones Work 323 ...

    polycom宝利通视频会议软件3.9 2018

    Your Demonstration License is limited to sixty (60) calendar days from LICENSE ACTIVATION (“DEMONSTRATION PERIOD”). Limited Use Software. Portions of the full-use version of the SOFTWARE PRODUCT...

    网易云课程“Linux 入门基础”课程学习笔记

    **1.2 安装CentOS 6.3 X86** - **关于CentOS**:CentOS是一个基于Red Hat Enterprise Linux(RHEL)源代码的社区支持的企业级操作系统,其目标是提供一个稳定、高预测性且免费的企业级计算平台。它与RHEL在功能上...

    Practical Mod Perl

    Transition from mod_cgi Scripts to Apache Handlers Section 6.8. Loading and Reloading Modules Section 6.9. Handling the "User Pressed Stop Button" Case Section 6.10. Handling Server ...

    linux mysql安装与使用指令大全

    sudo apt-get upgrade sudo apt-get install build-essential cmake libssl-dev libbz2-dev libreadline-dev liblzma-dev ``` #### 1.2 下载 MySQL 安装包 可以下载 MySQL 的官方二进制分发版,例如:`mysql-3.22....

    TortoiseSVN和TortoiseMerge的中文帮助文档(chm格式)

    The commit dialog, showing the upgrade notification 表格清单 2.1. 版本库访问 URL 5.1. 列出可用的命令行开关 5.2. 列出可用的命令行开关 5.3. 支持 COM/自动化 方法 C.1. 菜单入口和取值 D.1. 有效命令及选项...

    selenium高级自动化(图文教程)-抢先版

    **1.2 pip降级Selenium 3.0** ##### 1.2.1 遇到问题 有时由于某些特定的需求,可能需要使用Selenium的旧版本。例如,如果项目中存在不兼容的代码或者依赖项,就需要考虑降级Selenium版本。 ##### 1.2.2 解决方案 ...

    selenium webdriver基于python源码案例.pdf

    - **安装过程**:双击安装包进行安装,安装时选择“Add Python to PATH”选项。建议不将Python安装在C盘,路径使用英文字符且避免包含空格。 - **1.1.3 设置环境变量** 完成Python安装后,需要设置环境变量以...

    selenium自动化

    from selenium import webdriver driver = webdriver.Chrome() driver.quit() ``` 如果能够正常运行并关闭 Chrome 浏览器,说明安装成功。 ##### 1.1.6 浏览器 Selenium 支持多种浏览器,包括 Chrome、Firefox、...

    Oracle 数据库备份与恢复总结.pdf

    - **恢复目录的建立、升级与删除**: 使用`create catalog`、`upgrade catalog`和`drop catalog`命令。 - **同步或重置CROSSCHECK命令(交叉校验)**: 使用`crosscheck`或`resync`命令。 - **修改备份的可用状态、保存...

    在Linux环境下开发一个简单的Web应用项目

    **步骤 1.2 安装Python和pip** 如果系统尚未安装Python和pip,可以使用以下命令进行安装: ```bash sudo apt install python3 python3-pip -y ``` **步骤 1.3 安装Flask** 安装Flask框架,这是本项目的主要Web...

    测试培训教材

    All open test architecture API classes and methods can be referenced from the VAPI-XP user interface so that you can easily include them in your test script. About Working with System Tests You ...

    ROS安装配置与语法介绍文档

    ##### 1.2 设置软件源 在安装ROS之前,需要确保系统的软件包列表是最新的,并且正确设置了ROS的软件源。首先,通过以下命令更新系统软件包列表: ```bash sudo apt update sudo apt upgrade ``` 接着安装必要的...

    MySQL 5.6 Reference Manual

    1.3. LuaFileSystem Library License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Global site tag (gtag.js) - Google Analytics