Saving history of usage to offer suggestions - search

I have a small extension that perform local search.
It searches for the files matching that name in the local company files list and then opens a page with the results.
The extension has a text box where users type in the query.
The problem is that if I click the extension again and want to do a query that I already did previously, I need to type it out again.
I want the textbox to save history, and show suggestions when I start typing a new query.
How can I do this? The suggestion matching can be a very simple string matching, nothing fancy. But how/where canI save the history?

If you are asking about standard browser's autocomplete then I don't think there is a way to programmatically create it.
You can build your own with jQuery's autocomplete plugin, for example. You will just feed it previous queries and it will do the rest.
To store previous queries you can use localStorage, which you would need to access from a background page.

Related

Roku SceneGraph with Search Functionality

I'm creating a Roku app in SceneGraph and trying to near duplicate the search functionality I had using the old SDK. I'm stuck at only being able to display the mini keyboard. I'm trying to add buttons via buttongroup (i.e., Search, Cancel) but having two issues:
Not sure how to get the text string that's typed into the mini keyboard and store that in a variable or field so I can perform the search on it.
How to create a Search button and give it focus when user is ready to search for the string they entered.
Any help would be appreciated. Thanks.
SGDEX (Scenegraph Developer Extensions) is what you need. They have a view called "SearchView". Look it up.
Also...
RALE (Roku Advanced Layout Editor) has good search options. - I have been unable to find a decent Search sample. It would be cool if we could export the source code from RALE.
However if you haven't tried RALE. You could upload your script, then add search to it.

Best way to automate tasks in a browser

I want to automate several tasks that include copying numbers from a local list, then pasting each one in a certain box in a web page, then do several clicks on boxes that pop up in the browser, lastly, to copy some text from that page and paste it as the name of a file we save from that web page.
Is the best way to acheive that is with AutoHotKey or is there a better way?
No the component object model is built-in so you can automate the DOM just like javascript using IE's Built-in methods
A tutorial http://www.autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/#entry293231

How to keep autocomplete event active on Xpages

I've an xpages in which i set some fields to filter documents, with an autocomplete in one of these.
At the end, a button make a pdf based on this query fields (onClick action), and the pdf is presented to be saved or open.
Ad this point, autocomplete doesn't work anymore, i need to reload the xpage to make autocomplete active again, but i loose all other field values set in previous search.
Is it possible to keep autocomplete alive?
My guess is that you serve up an PDF directly from the page and no in a separate window. This will make the XPage to stall and will wait for a timeout of some kind.
I usually on the pdf generation button add this on a js timeout.
XSP.allowSubmit()
That usually works in the cases I have encountered.
Problem solved!
Just set the type ahead mode to Partial instead of Full
Thanks everyone

Notes toolbar button to archive selected (email) document

You can archive e-mails immediately by using the menu, Actions > Archive > Archive Selected Documents.
How can I create a toolbar button that I can click which will perform the above action?
I've already created toolbar buttons to move documents to folders so I'm semi-familiar with the process of creating a button entering formula language commands.
Not sure what you're question is, but having a stab at it. So you want to put the logic in the "toolbar" so you can run it on any database right ? You would have to be able to call the agent that does the job. Well, if you're doing this on mail files only, you can actually call the command
#Command([ToolsRunMacro];"Archive\\Archive Selected Documents");
You'll need the double backslash as it's an "escaped" after saving.
But if you're thinking of trying this to work on any database, you're in a bit of trouble.
Toolbars have a pretty sloppy way of looking for agents you want to run. Because, if you attempt to run an agent from the toolbar, the formula in the toolbar button assumes the database of the current view you are looking at, as the database with the agent as well.
This is no better than copying the agent into every other database that you want to run the agent on. That's why the above solution for archive, only works in mail files as the agent should be there in every case.
Otherwise, you are left with the overhead of copying the required agent around everywhere. To prove the point, a simple test. Create a toolbar button with the following formula.
#Prompt([Ok];"Hello Notes..";#Implode(#DbName;#Char(13)));
Now open any database. Note that the prompt actually shows you the details of the currently open database. This is where the toolbar button will look when trying to run that archive agent.
As there is no way to specify in Notes formula command, the database location in the #command([ToolsRunMacro]), we're unable to call a centralised agent to do the job that I think you're postulating.
A good idea, and a worthwhile problem for the vendor to solve, but this is one many things IBM has never addressed since ...way to long ago.
I would recommend tool called SWING PDF Converter.
It add's Lotus Notes toolbar button and can convert any Lotus Notes document to PDF.
It supports single document conversion from view, multiple documents conversion as separate PDF files, PDF package and bookmarks PDF document. You can also export data in XML and CSV format.

Custom navigation with Liknlist web part

I'm using a standard link list web part. What I want to achieve is before my users click on the link a pop-up javascript warning box will display, stating that they are leaving the domain. In regular anchor tag I would preceed the URL with javascript:ShowWarning('http://www.youtube.com');.
I've search the AllLinks table in the database but did not find the links was looking for.
Where or how are these stored?
Thanks,
Risho
Firstly, editing the SharePoint database directly is a really bad idea. You shouldn't do it unless you really, really know what you are doing, and even then you will probably break the system.
Secondly, any change made in the data will be what shows up in the editor, and I don't think the editor supports links that don't start with "http://".
A better approach is to use jquery to add the popup behaviour to the links when the page is loaded.

Resources