Changeset 534

add distrib for autocomplete

Feb 22 2008 * 11:23 (10 months ago)
Committed by seb

Affected files:

trunk/Rakefile (Unified diff)

r524r534
66 PUI_VERSION = 'trunk'
77
88 PUI_DEPENDENCIES = {
9 :core => nil,
10 :window => [ :core, :util, :shadow ],
11 :carousel => :core,
12 :dock => :core,
13 :shadow => [:core, :util],
14 :util => :core,
15 :context_menu => [ :shadow, :"util/iframe_shim.js"],
9 :core => nil,
10 :window => [ :core, :util, :shadow ],
11 :carousel => :core,
12 :dock => :core,
13 :shadow => [:core, :util],
14 :util => :core,
15 :context_menu => [ :shadow, :"util/iframe_shim.js"],
16 :auto_complete => [ :shadow, :"util/iframe_shim.js"],
1617 }
1718
1819 PUI_COMPONENTS = PUI_DEPENDENCIES.keys

trunk/doc/config/Menu.txt (Unified diff)

r530r534
22
33
44 Title: Prototype-UI
5 SubTitle: 523:524
5 SubTitle: 523:530
66
77 # You can add a footer to your documentation like this:
88 # Footer: [text]
------
6666 File: Dialog (window/dialog.js)
6767 } # Group: Window
6868
69 File: auto_complete/auto_complete.js (auto_complete/auto_complete.js)
6970 File: ContextMenu (context_menu/context_menu.js)
7071 File: Dock (dock/dock.js)
7172 File: Shadow (shadow/shadow.js)
------
7778 Function Index: Functions
7879 Interface Index: Interfaces
7980 Property Index: Properties
81 File Index: Files
8082 } # Group: Index
8183

trunk/src/auto_complete/auto_complete.js (Unified diff)

r533r534
187187 var current = null;
188188 // Seletc first
189189 if (!this.current)
190 current = this.autocompletionContainer.firstDescendant()
191 else if (element == "next")
190 current = this.autocompletionContainer.firstDescendant();
191 else if (element == "next") {
192192 current = this.current[element]() || this.autocompletionContainer.firstDescendant();
193 else if (element == "previous")
193 }
194 else if (element == "previous") {
194195 current = this.current[element]() || this.autocompletionContainer.childElements().last();
196 }
195197 else
196198 current = element;
197199
------
201203 this.current = current;
202204
203205 if (this.current)
204 this.current.addClassName(this.getClassName("current"));;
206 this.current.addClassName(this.getClassName("current"));
205207 },
206208
207209 // Add current selected element from completion to input
------
394396 .observe("keyup", this.keyup.bind(this))
395397 .observe("keydown", this.keydown.bind(this));
396398 this.container = new Element('ul', {className: this.getClassName("holder")})
397 .insert(new Element("li", {className: this.getClassName("input")}).insert(this.input))
399 .insert(new Element("li", {className: this.getClassName("input")}).insert(this.input));
398400
399401 this.element.insert({before: this.container});
400402 this.autocompletion.style.width = this.container.getWidth() - this.container.getBorderDimensions().width + "px";

trunk/test/functional/auto_complete/test_auto_complete.html (Unified diff)

r533r534
77
88 <script src="../../../lib/prototype.js" type="text/javascript"></script>
99 <script src="../../../lib/effects.js" type="text/javascript"></script>
10 <script src="../../../dist/prototype-ui.js" type="text/javascript"></script>
11 <script src="../../../src/auto_complete/auto_complete.js" type="text/javascript"></script>
10 <script src="../../../dist/auto_complete.js" type="text/javascript"></script>
1211 <link href="../../../themes/auto_complete/mac_os_x.css" rel="stylesheet" type="text/css" />
1312 <link href="../../../themes/shadow/auto_complete.css" rel="stylesheet" type="text/css">
1413 <style>
------
1918 </head>
2019
2120 <body id="test">
22 <h1>Prototype UI autocomplete Demo</h1>
21 <h1>Prototype UI autocomplete Demo</h1>
22 Type "e" for example to see autocompletion.<br/><br/>
2323 <form action="test_submit" method="get" accept-charset="utf-8">
2424 <div id="input-text">
2525 <input type="text" value="" id="pui-demo" />
------
4444 <button onclick="tlist2.update(); alert($F('facebook-demo'));return false;">Submit</button>
4545 <script type="text/javascript">
4646 Event.observe(window, "load", function() {
47 pui = new UI.AutoComplete('pui-demo', { infoMessage: "Type a user name",
47 pui = new UI.AutoComplete('pui-demo', { infoMessage: "Type a user name",
48 noMatchMessage: "Nothing found",
4849 shadow: "auto_complete"
4950 });
5051 pui.setAutocompleteList([{text:"Sébastien", value:1},

trunk/test/functional/auto_complete/test_auto_complete_ajax.html (Unified diff)

r533r534
33 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44 <head>
55 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6 <title>Prototype UI : functional test : AutoComplete</title>
6 <title>Prototype UI : functional test : AutoComplete Ajax mode</title>
77
88 <script src="../../../lib/prototype.js" type="text/javascript"></script>
99 <script src="../../../lib/effects.js" type="text/javascript"></script>
10 <script src="../../../dist/prototype-ui.js" type="text/javascript"></script>
11 <script src="../../../src/auto_complete/auto_complete.js" type="text/javascript"></script>
10 <script src="../../../dist/auto_complete.js" type="text/javascript"></script>
1211 <link href="../../../themes/auto_complete/default.css" rel="stylesheet" type="text/css" />
1312 <link href="../../../themes/shadow/drop_shadow.css" rel="stylesheet" type="text/css">
1413 <style>
------
1918 </head>
2019
2120 <body id="test">
22 <h1>Prototype UI autocomplete Demo</h1>
21 <h1>Prototype UI autocomplete Demo (Ajax)</h1>
22 Type "e" for example to see autocompletion.<br/><br/>
2323 <form action="test_submit" method="get" accept-charset="utf-8">
2424 <div id="input-text">
2525 <input type="text" value="" id="pui-demo" />