diff --git a/pandora/static/js/pandora.js b/pandora/static/js/pandora.js index 6342ed61..b1444c8a 100644 --- a/pandora/static/js/pandora.js +++ b/pandora/static/js/pandora.js @@ -50,6 +50,70 @@ $(function(){ marginLeft: "4px" }); app.menu = new Ox.MainMenu({ + extras: [ + new Ox.Input({ + autocomplete: function(option, value, callback) { + var field = option.substring(6).toLowerCase(); + if(typeof(callback) == 'undefined') { + callback = value; + value = null; + } + Ox.debug('app.menu.find.autocomplete: option: ', option, 'value: ', value, ', callback:',callback); + Ox.debug('app.menu.find.autocomplete: field: ', field); + if(field == 'all') { + callback([]); + } else if (value) { + value = value.toLowerCase(); + //var order = $.inArray(field, ['year', 'date'])?'-':''; + app.request('find', { + query: { + conditions: [ + { + key: field, + value: value, + operator: '~' + } + ] + }, + list: 'all', + sort: [{key:field, operator: ''}], + keys: [field], + range: [0, 10] + }, function(result) { + var items = $.map( + result.data.items, + function(item, i) { return item.title; } + ); + callback(items); + }); + } + }, + clear: true, + highlight: false, + id: "find", + label: [ + { id: "all", title: "Find: All" }, + { id: "title", title: "Find: Title" }, + { id: "director", title: "Find: Director" }, + { id: "country", title: "Find: Country" }, + { id: "year", title: "Find: Year" }, + { id: "language", title: "Find: Language" }, + { id: "writer", title: "Find: Writer" }, + { id: "producer", title: "Find: Producer" }, + { id: "cinematographer", title: "Find: Cinematographer" }, + { id: "editor", title: "Find: Editor" }, + { id: "actor", title: "Find: Actor" }, + { id: "character", title: "Find: Character" }, + { id: "name", title: "Find: Name" }, + { id: "genre", title: "Find: Genre" }, + { id: "keyword", title: "Find: Keyword" }, + { id: "summary", title: "Find: Summary" }, + { id: "dialog", title: "Find: Dialog" } + ], + labelWidth: 96 + }).width(320), + loadingIcon + ], menus: [ { id: "pandoraMM", @@ -291,8 +355,6 @@ $(function(){ 'padding-top': '48px', }); - Ox.print(-1); - var submit = function() { app.request('login', loginForm.values(), function(result) { if(result.status.code == 200) { @@ -307,17 +369,11 @@ $(function(){ }); } - Ox.print(0); - var d = new Ox.Container(); var registerInfo = new Ox.Panel(); - Ox.print(1); - registerInfo.append(Ox.Element().css({'margin-left': '4px'}).append('
Forgot your password? Recover Password
Dont have an account? Register Now')); - Ox.print(2); - var panel = Ox.SplitPanel({ elements: [ { @@ -331,8 +387,6 @@ $(function(){ orientation: "vertical" }).appendTo(d); - Ox.print(3); - var $dialog = new Ox.Dialog({ title: "Login", width: inputWidth+24,