Changeset 520

Show
Ignore:
Timestamp:
01/18/06 13:37:47 (3 years ago)
Author:
therve@gmail.com
Message:

Prepare export and namespaces

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mochikit/branches/scriptaculous/MochiKit/DragAndDrop.js

    r519 r520  
    11/*** 
    2 MochiKit.Effect 1.2 
     2MochiKit.DragAndDrop 1.2 
    33 
    44See <http://mochikit.com/> for documentation, downloads, license, etc. 
     
    88 
    99***/ 
     10 
     11if (typeof(dojo) != 'undefined') { 
     12    dojo.provide('MochiKit.DragAndDrop'); 
     13    dojo.require('MochiKit.Base'); 
     14    dojo.require('MochiKit.DOM'); 
     15    dojo.require('MochiKit.Effect'); 
     16    dojo.require('MochiKit.Iter'); 
     17} 
     18 
     19if (typeof(JSAN) != 'undefined') { 
     20    JSAN.use("MochiKit.Base", []); 
     21    JSAN.use("MochiKit.DOM", []); 
     22    JSAN.use("MochiKit.Effect", []); 
     23    JSAN.use("MochiKit.Iter", []); 
     24} 
     25 
     26try { 
     27    if (typeof(MochiKit.Base) == 'undefined' || 
     28        typeof(MochiKit.DOM) == 'undefined' || 
     29        typeof(MochiKit.Effect) == 'undefined' || 
     30        typeof(MochiKit.Iter) == 'undefined') { 
     31        throw ""; 
     32    } 
     33} catch (e) { 
     34    throw "MochiKit.DragAndDrop depends on MochiKit.Base, MochiKit.DOM, MochiKit.Effect and MochiKit.Iter!"; 
     35} 
    1036 
    1137if (typeof(MochiKit.DragAndDrop) == 'undefined') { 
     
    2349    return this.__repr__(); 
    2450}; 
     51 
     52MochiKit.DragAndDrop.EXPORT = [ 
     53    "Droppable", 
     54    "Draggable" 
     55]; 
     56 
     57MochiKit.DragAndDrop.EXPORT_OK = [ 
     58    "Droppables", 
     59    "Draggables" 
     60]; 
    2561 
    2662MochiKit.DragAndDrop.Droppables = { 
     
    332368            handle: false, 
    333369            starteffect: function (element) { 
    334                 new Effect.Opacity(element, 
     370                new MochiKit.Effect.Opacity(element, 
    335371                                   {duration:0.2, from:1.0, to:0.7}); 
    336372            }, 
     
    338374                var dur = Math.sqrt(Math.abs(top_offset^2) + 
    339375                          Math.abs(left_offset^2))*0.02; 
    340                 element._revert = new Effect.Move(element, 
     376                element._revert = new MochiKit.Effect.Move(element, 
    341377                            {x: -left_offset, y: -top_offset, duration: dur}); 
    342378            }, 
    343379            endeffect: function (element) { 
    344                 new Effect.Opacity(element, {duration:0.2, from:0.7, to:1.0}); 
     380                new MochiKit.Effect.Opacity(element, {duration:0.2, from:0.7, to:1.0}); 
    345381            }, 
    346382            zindex: 1000, 
     
    469505        if (this.options.ghosting) { 
    470506            // XXX: from a user point of view, it would be better to remove 
    471             // the node only *after* the Effect.Move end 
     507            // the node only *after* the MochiKit.Effect.Move end 
    472508            MochiKit.Position.relativize(this.element); 
    473509            MochiKit.DOM.removeElement(this._clone); 
     
    567603}; 
    568604 
     605MochiKit.DragAndDrop.__new__ = function () { 
     606    MochiKit.Base.nameFunctions(this); 
     607 
     608    this.EXPORT_TAGS = { 
     609        ":common": this.EXPORT, 
     610        ":all": MochiKit.Base.concat(this.EXPORT, this.EXPORT_OK) 
     611    }; 
     612}; 
     613 
     614MochiKit.DragAndDrop.__new__(); 
     615 
     616MochiKit.Base._exportSymbols(this, MochiKit.DragAndDrop); 
     617 
  • mochikit/branches/scriptaculous/MochiKit/Effects.js

    r519 r520  
    5454    return this.__repr__(); 
    5555}; 
     56 
     57MochiKit.Effect.EXPORT = [ 
     58    "tagifyText", 
     59    "multiple", 
     60    "toggle", 
     61    "Base", 
     62    "Parallel", 
     63    "Opacity", 
     64    "Move", 
     65    "Scale", 
     66    "Highlight", 
     67    "ScrollTo", 
     68    "Fade", 
     69    "Appear", 
     70    "Puff", 
     71    "BlindUp", 
     72    "BlindDown", 
     73    "SwitchOff", 
     74    "DropOut", 
     75    "Shake", 
     76    "SlideDown", 
     77    "SlideUp", 
     78    "Squish", 
     79    "Grow", 
     80    "Shrink", 
     81    "Pulsate", 
     82    "Fold" 
     83]; 
     84 
     85MochiKit.Effect.EXPORT_OK = [ 
     86    "PAIRS" 
     87]; 
    5688 
    5789MochiKit.Effect.tagifyText = function (element, /* optional */tagifyStyle) { 
     
    219251 
    220252    remove: function (effect) { 
    221         this.effects = MochiKit.Iter.filter(function (e) { 
     253        this.effects = MochiKit.Base.filter(function (e) { 
    222254            return e != effect; 
    223255        }, this.effects); 
     
    12771309}; 
    12781310 
     1311MochiKit.Effect.__new__ = function () { 
     1312    MochiKit.Base.nameFunctions(this); 
     1313 
     1314    this.EXPORT_TAGS = { 
     1315        ":common": this.EXPORT, 
     1316        ":all": MochiKit.Base.concat(this.EXPORT, this.EXPORT_OK) 
     1317    }; 
     1318}; 
     1319 
     1320MochiKit.Effect.__new__(); 
     1321 
     1322MochiKit.Base._exportSymbols(this, MochiKit.Effect); 
     1323