For faster navigation, this Iframe is preloading the Wikiwand page for MooTools.

MooTools

MooTools
開発元 MooTools開発チーム
最新版
1.6 / 2016年1月14日 (8年前) (2016-01-14)[1]
リポジトリ ウィキデータを編集
プログラミング
言語
JavaScript
種別 Ajaxフレームワーク / JavaScriptフレームワーク
ライセンス MIT License
公式サイト http://mootools.net
テンプレートを表示

MooTools は、オープンソースの軽量でモジュラーなオブジェクト指向 JavaScript Webアプリケーションフレームワークであり、MIT License でリリースされている。その目的は、Web開発者にブラウザから独立したエレガントで柔軟で効率的なJavaScriptを書く手段を提供することである。MooTools には、CSSDOM要素、ネイティブなJavaScriptオブジェクト、Ajax要求などを操作する組み込み関数がある。また、詳細なAPI文書が用意されており[2]、開発の効率化に寄与する。

利点

[編集]

MooToolsはネイティブなJavaScript以上の利点をユーザーに提供することを目指している。例えば、次のような利点がある。

  • 拡張性があるモジュラーなフレームワークであり、開発者は使用するコンポーネントを選択できる[3]
  • オブジェクト指向の慣習とDRY原則に従う[4]
  • Flash開発者が使うような最適化された遷移を伴う特殊効果コンポーネントがある[5]
  • DOMを拡張し、開発者が容易にDOM要素を追加・更新・選択・削除できる[6]

コンポーネント

[編集]

MooToolsには多くのコンポーネントがあるが、各アプリケーションで全てをロードする必要はない。コンポーネントは以下のように分類されている。

  • Core: 他のコンポーネントで必要となるユーティリティ関数の集まり[7]
  • Class: Classオブジェクト実装のための基本ライブラリ[8]
  • Natives: JavaScriptのネイティブオブジェクトの拡張。機能や互換性を強化し、新たなメソッドを追加し、コーディングを単純化している。
  • Element: HTML要素オブジェクトへの各種拡張と互換性強化[9]
  • Fx: 要素のアニメーション効果のためのAPI[10]
  • Request: XHRインタフェース、クッキー、JSONHTML検索専用ツールなどを提供[11]
  • Window: ウィンドウサイズなどのクライアント固有情報へのインタフェース(ブラウザ非依存)[12]

ブラウザとの互換性

[編集]

MooToolsは以下の各ブラウザのバージョンで評価し動作確認されている[13]

オブジェクト指向プログラミング

[編集]

MooToolsは多くのオブジェクト指向言語と似たようなしっかりしたクラス生成と継承のシステムを備えている。例えば、以下は英語版Wikipediaにあるこちらのポリモーフィズムの例と同じことをMooToolsで実現したものである。

 var Animal = new Class({

    initialize: function(name){
        this.name = name;
    }
    
 });
 
 var Cat = new Class({ 
    Extends: Animal,
    
    talk: function(){
        return 'Meow!';
    }
    
 });
 
 var Dog = new Class({
    
    Extends: Animal,
    
    talk: function(){
        return 'Arf! Arf';
    }
    
 });
 
 var Animals = {
    a: new Cat('Missy'),
    b: new Cat('Mr. Bojangles'),
    c: new Dog('Lassie')
 };
 
 for(var animal in Animals) alert(animal.name + ': ' + animal.talk());
 
 // alerts the following:
 //
 // Missy: Meow!
 // Mr. Bojangles: Meow!
 // Lassie: Arf! Arf!

関連項目

[編集]

脚注・出典

[編集]

外部リンク

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
MooTools
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?