madrobby / scriptaculous Goto Github PK
View Code? Open in Web Editor NEWscript.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
Home Page: http://script.aculo.us/
License: MIT License
script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
Home Page: http://script.aculo.us/
License: MIT License
I have a Autocomplete on a dialog-like, but then I click the scroll bar or when I try to drag it, the list closes. I was looking this link:https://prototype.lighthouseapp.com/projects/8887/tickets/114-autocomplete-div-scrollbar-closes-suggest-list and tried to implement that solution but nothing. I have an error that says event.srcElement.focus() not defined. Looks like the event object its not passed to the onBlur function.
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?
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("
} finally {
out.close();
}
}
}
I've googled few days for this issue but to no avail. Hope you guys
could help!
Test.Unit.Assertions class has the function benchmark defined twice. One of the instances should be removed.
This official demo does not work in my IE 10.
http://madrobby.github.io/scriptaculous/effect-opacity/
I recently updated my site to get Sortables working in IE 10. They work but I see no transparency when dragging my elements around. Instead they are completely invisible.
It seems the default effect applied while dragging does not work at all in IE 10.
in a div despite being faded has its content elements are clickable
(a div containing bootstrap badge in my case , which was click able and had a css for mouse pointer)
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.
-G
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?
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
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
i'm going to patch and send a pull request.
...which will be overwritten if you pass afterSetup as callback in the options. And I think BlindDown does that too.
Setting the id to item_1 works but item-1 does not.
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
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 = "";
}
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
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).
whats the meaning of scriptaculous.
i guess scriptaculous = script . aculo . us.
Hi when i load a page with jquery containing scriptaculous, after being loaded the page goes into and infinite redirection to itself. Do you have a fix for that ?
Problem:
var div = Builder.node("div", {style: {top: 10px, left: 20px}});
Builder._attributes just copies the dict to the style member of the
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.
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
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
Hello,
I'm using Sortable on some lists and i'm having a issue with drag n' drop. Looking at Google for common issues i found a patch about 2 years ago: http://dev.rubyonrails.org/ticket/5109
I applyed the patch and this solved the behavior issue. Can you check these?
Thanks
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
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!
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.
DA = draggable
DO = droppable
Scenario:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.