summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2010-01-11 11:39:37 +0000
committerLynx Linden <lynx@lindenlab.com>2010-01-11 11:39:37 +0000
commit07aa9421e68163432a1c3022617675fc9065f180 (patch)
treeb6d2939596c8d2acde1ca3db8f1d5aa154d52e54 /indra
parentd24cd96ef83263a0fe1f5853d6e5cd67f59ed16a (diff)
EXT-4145: Added a secondlife:///app/search SLapp
Displays the search floater and performs a search. You can specify an optional category and an optional search string. See the wiki docs for usage details: https://wiki.lindenlab.com/wiki/Viewer_2.0_SLapps
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatersearch.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp
index c6d9fee630..a7401fdb6f 100644
--- a/indra/newview/llfloatersearch.cpp
+++ b/indra/newview/llfloatersearch.cpp
@@ -32,6 +32,9 @@
*/
#include "llviewerprecompiledheaders.h"
+
+#include "llcommandhandler.h"
+#include "llfloaterreg.h"
#include "llfloatersearch.h"
#include "llmediactrl.h"
#include "lllogininstance.h"
@@ -41,6 +44,42 @@
#include "llviewercontrol.h"
#include "llweb.h"
+// support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps
+class LLSearchHandler : public LLCommandHandler
+{
+public:
+ // requires trusted browser to trigger
+ LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { }
+ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ const size_t parts = tokens.size();
+
+ // get the (optional) category for the search
+ std::string category;
+ if (parts > 0)
+ {
+ category = tokens[0].asString();
+ }
+
+ // get the (optional) search string
+ std::string search_text;
+ if (parts > 1)
+ {
+ search_text = tokens[1].asString();
+ }
+
+ // create the LLSD arguments for the search floater
+ LLSD args;
+ args["category"] = category;
+ args["id"] = LLURI::unescape(search_text);
+
+ // open the search floater and perform the requested search
+ LLFloaterReg::showInstance("search", args);
+ return true;
+ }
+};
+LLSearchHandler gSearchHandler;
+
LLFloaterSearch::LLFloaterSearch(const LLSD& key) :
LLFloater(key),
LLViewerMediaObserver(),