GithubHelp home page GithubHelp logo

madrobby / scriptaculous Goto Github PK

View Code? Open in Web Editor NEW
2.3K 76.0 526.0 1.33 MB

script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.

Home Page: http://script.aculo.us/

License: MIT License

Ruby 2.12% JavaScript 11.92% HTML 85.58% CSS 0.39%

scriptaculous's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scriptaculous's Issues

bumpy morph effect

When you run morph on a element that doesn't have a width set it gets abruptly oversized before initiating the morphing to the desired size. They only way to get around this is getting the element's width, setting it, and then morphing it. Wouldn't it make things easier if the morph function did all this by itself?

Autocomplete problem in IE

Well, I am doing a simple page to test ajax.autocompleter function as
in this link
--> http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter

However, it only works in Chrome and Firefox. IE7&8 do not give
responds no matter what I typed in the text field. (Supposedly, there
will be a list of suggestions but it just doesn't show up in IE.)

I am using scriptaculous.js v1.8.2 and prototype.js v1.6.0.3
I'll paste my code here juz in case I miss something.

My JSP page

<%@page contentType="text/html" pageEncoding="UTF-8"%>

    <script type="text/javascript" src="Javascript/prototype.js"></script> 
    <script type="text/javascript" src="Javascript/scriptaculous.js"></script> 
    <script type="text/javascript"> 
        function trigger() { 
            new Ajax.Autocompleter("auto","autocomplete","AutocompleteServlet",{ 
                minChars:1 
            }); 
        } 
    </script> 
    <style> 
        .autocomplete { 
            position:absolute; 
            width:250px; 
            background-color:white; 
            margin:0px; 
            padding:0px; 
            border:1px solid black; 
        } 
        .autocomplete ul { 
            list-style-type:none; 
            margin:0px; 
            padding:0px; 
        } 
        .autocomplete ul li.selected { background-color: #ffb;} 
        .autocomplete ul li { 
            list-style-type:none; 
            display:block; 
            margin:0; 
            padding:2px; 
            height:32px; 
            cursor:pointer; 
        } 
    </style> 
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    <title>Autocomplete</title> 
</head> 
<body> 
    <h1>Autocomplete</h1> 
    <form name="try" id="try" method="post"> 
        <input type="text" name="auto" id="auto" onkeyup="trigger()"/> 
        <div id="autocomplete" class="autocomplete"/> 
    </form> 
</body> 

My AutocompleteServlet

public class AutocompleteServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
System.out.println("Ajax is here!!");
try {
System.out.println("Ajax is here!!");
System.out.println(request.getParameter("auto"));
out.println("");
out.println("

  • Malaysia
  • ");
    out.println("
  • India
  • ");
    out.println("");

        } finally { 
            out.close(); 
        } 
    } 
    

    }

    I've googled few days for this issue but to no avail. Hope you guys
    could help!

    inplaceEditor Key Event Handlers

    v1.8.3

    Not sure the key event handling is right. registerListeners() assigns the key listeners to the target container, not the form input element. See my patch below.

    • Add assignment of onkeydown event handler to form INPUT in createEditField().

      line: ~505 - this._keyHandler = this.checkForEscapeOrReturn.bind(this);

    • Prevent blur event caused by escape from triggering a submit

      line: ~512 - if (Event.KEY_ESC == e.keyCode) { this.handleFormCancellation(e); }



      line: ~555 - Event.observe(fld, 'keydown', this._keyHandler);

    • Remove key event handlers from target container handlers.

      line: ~932 - REMOVE THIS LINE ALTOGETHER - "keydown: 'checkForEscapeOrReturn',

    -G

    Autocomplete Demos not working

    http://demo.script.aculo.us/ajax/autocompleter
    

    and

    http://demo.script.aculo.us/ajax/autocompleter_customized
    

    have been down since, at least, may.

    will they be brought up again?

    dropzone target fails if scrollable

    If the dropzone is within a scrollable container, the scroll-offset is not respected.
    For example, if you have a list of 5 dropzones within a container that displays the first 3 on one screen.
    If you now drag something into the 5th. dropzone, it will end in the 3rd dropzone, as the offset value is wrong.
    This was first recognized in version 1.7.1_beta1, but it has not been fixed until 1.9.0

    Draggable#updateDrag

    Hey,

    I've been trying to implement a drag-drop interface where a marker pops-up when a draggable is hovered over a droppable. The position of the marker (before / after) is determined based on the overlap between a draggable and the droppable it is hovered over. I am using the onHover callback of the droppable which seems to pass the overlap relative to the mouse pointer and not the bounding box.

    A little investigation brought me to Draggable#updateDrag which is one of the method used while calculating the overlap; here the pointer values returned are:

    var pointer = [Event.pointerX(event), Event.pointerY(event)];

    which are the mouse pointer values and not the coordinates of the bounding box. Shouldn't the bounding box coordinates be used to calculate the overlap or am I missing something?

    Thanks

    Slider.js trying to update none active handle at handleIdx of 0 not possible

    hello,

    My slider has 2 handles (handle1, handle2). While sliding handle2, I was trying to update the value of handle1 using the setValue(value, 0) was not possible. The main reason setValue method perform following check (handleIdx = handleIdx || this.activeHandleIdx || 0) to determine handleIdx. Since handle2 is active handle, telling setValue to update value handle1 at handleIdx=0 the check always return handleIdx=1.

    To see the fix go to http://github.com/ccote/scriptaculous/blob/master/src/slider.js

    Effect.SlideDown, Effect.SlideUp: oldInnerBottom = "NaNpx" in Opera

    Opera 10/Linux shows javascript errors after executing SlideUp/SlideDown effects in code
    ... setStyle({bottom: oldInnerBottom})
    because
    var oldInnerBottom = element.down().getStyle('bottom')
    will give result "NaNpx". There must be additional check, e.g.
    var oldInnerBottom = element.down().getStyle('bottom');
    if (oldInnerBottom == "NaNpx") {
    oldInnerBottom = "";
    }

    Is the creator alive ?

    Hi
    Please i can see that the creator of this project has commented last on this in 2011. Please how do we do to know that he is still alive ? Is the project being updated or is it dead. This is one of the most awesome project so please somebody let me know. Thanks

    z-index not properly restored after drag

    I have a draggable div that is postion: absolute, width/height: 300px, z-index: 100. Underneath I have a modal shield (a width/height: 100% layer of black with 50% opacity). The point is to allow the draggable div to be moved around the screen while keeping the modal shield at a lower z-index than the block. This prevents the rest of the underlying page from getting any clicks/interaction.

    What happens:
    After dragging the element around the page, once the drag has finished, the draggable div ends up with a z-index of 0. I would expect the z-index to be restored to its original state. By setting the parameter "z-index: 100", this only affects the z-index during drag. As a separate issue, setting the onEnd callback to set the z-index causes other issues (the drag never ends).

    Builder doesn't copy the style attribute correctly.

    Problem:

    var div = Builder.node("div", {style: {top: 10px, left: 20px}});
    

    Builder._attributes just copies the dict to the style member of the

    HTMLElement, but this doesn't work quite right because browsers don't really know how to type convert a dict to a CSSStyleDeclaration object. So you are forced to use a really long text string.

    It would be better if _attributes copies the attributes recursively. Something like this:

    for (var attr in attributes) {
      attr = JSON.parse(attr);
        if (attr) {
           for (k in attr) {
              element[attr][k] = attr[k];
           }
        }
    }
    

    The actual code will of course need to prevent cyclic references and set a depth of the copying if needed. This should take care of the general case where one wants to set the properties of any nested objects on any DOM elements.

    Document.Write Issue

    Is there any development still happening with this library? Chrome is reporting the following warning when trying to load the Scriptaculous script:

    A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/scriptaculous/1/effects.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.

    Any thoughts on a work around or any updates to the script happening anytime soon?

    Ben

    Message of Warning

    Hi, i'm using your framework with Modalbox. When i load the page, i receive the message in the bottom of the internet explorer:

    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
    Mon, 19 Apr 2010 12:46:57 UTC

    Message: Exception discarded and not detected
    Line: 53
    Caracter: 8
    Code: 0
    URI: http://127.0.0.1:8888/Files/scriptaculous.js

    There is some patch or some tip to resolve this?

    Thanks a lot! Very good framework, excellent work.

    Abraão

    Scriptaculous.init function: wrong order of try'n catch?

    Hi folks,

    I think theres a typo / bug in the init function

    var Scriptaculous = {
    Version: '1.8.3',
    require: function(libraryName) {
    try{
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
    } catch(e) {
    // for xhtml+xml served content, fall back to DOM methods
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = libraryName;
    document.getElementsByTagName('head')[0].appendChild(script);
    }
    }

    Shouldn't try and catch be otherwise?
    IMHO it will be "brute forced" for every browser that accepts document.write.
    Shouldn't first be tried to append it via DOM and only in case of error be bruteforced?

    Hope I'm not to dumb to understand this right ;-)

    Greets

    Fränzchen

    Effect.Move Absolute/Relative Behaviorr

    Hi there,
    It seems like there's a problem with the Move effect. It doesn't seem to recognize any difference between absolute and relative modes (if I have x:0, y:0, it doesn't move, no matter the mode).

    Is this an error, or does absolute mode base positioning off of some parent field I haven't yet recognized?

    Thanks!

    Draggable revert and ghosting error

    Whilst creating a Draggable element and initializing it with both ghosting set to true and revert set to true the parentNode of the clone is never found and thus errors out.

    Drag'n'Drop cannot be canceled

    DA = draggable
    DO = droppable

    Scenario:

    1. DA is dragging and can be accepted by DO
    2. By a timer element is added in DO => No more place for DA
    3. DA is dropped in DO
    4. How to reject DA to be dropped in DO ? no DA.cancel()

    Add bounce effect to Effect.Transitions

    To simulate an object under constant force (e.g. gravity) hitting a surface with a constant coefficient of restitution. The function I've defined below is a function generating function, which takes two parameters: the number of bounces and the coefficient of restitution (called "decay"). A number of pre-calculations are performed to improve the performance of the actual transition function.

    bounce: function(bounces, decay) {
      // default values
      if(decay == null) decay = 1/3;
      if(bounces == null) bounces = 2;
    
      // solve geometric series to calculate speed
      var rootd = Math.sqrt(decay);
      var rootdn = Math.sqrt(Math.pow(decay, bounces));
      var f = Math.pow((1 + rootd - (2 * rootdn)) / (1 - rootd), 2);
    
      // pre-calculate offsets
      var offsets = [];
      var offset = 0;
      var apex = 1;
      for(var b = 0; b < bounces; b++) {
        offsets.push(offset)
        offset += Math.sqrt(apex / f);
        apex *= decay;
        offset += Math.sqrt(apex / f);
      }
    
      // generate the bounce function
      return (function (pos) {
        var h = 0;
        var apex = 1;
        for(var b = 0; b < bounces; b++) {
          h = Math.max(h, apex - (f * Math.pow(pos - offsets[b], 2)));
          apex *= decay;
        }
        return 1 - h;
      });
    },
    

    Usage:
    transition: Effect.Transitions.bounce() // use default values of 5, 1/3
    or
    transition: Effect.Transitions.bounce(3) // 3 bounces, default decay (1/3)
    or
    transition: Effect.Transitions.bounce(4, 1/2) // 4 bounces, decay 1/2

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.