~ubuntu-branches/debian/jessie/gnome-shell/jessie

« back to all changes in this revision

Viewing changes to js/ui/docDisplay.js

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-05-30 13:19:38 UTC
  • mfrom: (18.1.24 experimental)
  • Revision ID: package-import@ubuntu.com-20120530131938-i3trc1g1p3is2u6x
Tags: 3.4.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
2
 
 
3
 
const DocInfo = imports.misc.docInfo;
4
 
const Params = imports.misc.params;
5
 
const Search = imports.ui.search;
6
 
 
7
 
 
8
 
function DocSearchProvider() {
9
 
    this._init();
10
 
}
11
 
 
12
 
DocSearchProvider.prototype = {
13
 
    __proto__: Search.SearchProvider.prototype,
14
 
 
15
 
    _init: function(name) {
16
 
        Search.SearchProvider.prototype._init.call(this, _("RECENT ITEMS"));
17
 
        this._docManager = DocInfo.getDocManager();
18
 
    },
19
 
 
20
 
    getResultMeta: function(resultId) {
21
 
        let docInfo = this._docManager.lookupByUri(resultId);
22
 
        if (!docInfo)
23
 
            return null;
24
 
        return { 'id': resultId,
25
 
                 'name': docInfo.name,
26
 
                 'createIcon': function(size) {
27
 
                                   return docInfo.createIcon(size);
28
 
                               }
29
 
               };
30
 
    },
31
 
 
32
 
    activateResult: function(id, params) {
33
 
        params = Params.parse(params, { workspace: -1,
34
 
                                        timestamp: 0 });
35
 
 
36
 
        let docInfo = this._docManager.lookupByUri(id);
37
 
        docInfo.launch(params.workspace);
38
 
    },
39
 
 
40
 
    getInitialResultSet: function(terms) {
41
 
        return this._docManager.initialSearch(terms);
42
 
    },
43
 
 
44
 
    getSubsearchResultSet: function(previousResults, terms) {
45
 
        return this._docManager.subsearch(previousResults, terms);
46
 
    }
47
 
};