Quantcast

[pmapper-users] search one layer

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[pmapper-users] search one layer

Bogumil
Hello,
Is it possible to get one default search field turned on in the moment
of starting of application window?
I have only one layer to search and I would like to avoid every time
selecting layer to search.


all the best

Bogumił

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Armin Burger
not a very elegant solution, but should work:

add the following block at the end of your
    /config/[your-config]/custom.js
file

$.extend(PM.Query,
{
     createSearchItems: function(url) {
         $.ajax({
             url: url,
             dataType: "json",
             success: function(response){
                 var searchJson = response.searchJson;
                 var action = response.action;

                 //---------------------------
                 delete searchJson.options[0];
                 //---------------------------

                 if (action == 'searchitem') {
                     PM.Query.createSearchInput(searchJson);
                 } else {
                     var searchHtml = PM.Query.json2Select(searchJson, "0");
                     $('#searchoptions').html(searchHtml);
                 }
             },
             error: function (XMLHttpRequest, textStatus, errorThrown) {
                 if (window.console) console.log(errorThrown);
             }
         });
     }

});




or use

                 //---------------------------
                 if (Object.keys(searchJson.options).length < 3) {
                     delete searchJson.options[0];
                 }
                 //---------------------------

to do this just in case the search has just 1 layer defined for search,
in case you once will add another one you don't remember what you once
modified...


On 07/22/2014 07:25 PM, Bogumił Szady wrote:

> Hello,
> Is it possible to get one default search field turned on in the moment
> of starting of application window?
> I have only one layer to search and I would like to avoid every time
> selecting layer to search.
>
>
> all the best
>
> Bogumił
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Bogumil
Hello,
Thanks. I have tried to insert this modification.
I see my layer defined, but without white box on the right to put the
search attribute.
Where is the the problem?

best

Bogumił


W dniu 2014-07-22 23:11, Armin Burger pisze:

> not a very elegant solution, but should work:
>
> add the following block at the end of your
>      /config/[your-config]/custom.js
> file
>
> $.extend(PM.Query,
> {
>       createSearchItems: function(url) {
>           $.ajax({
>               url: url,
>               dataType: "json",
>               success: function(response){
>                   var searchJson = response.searchJson;
>                   var action = response.action;
>
>                   //---------------------------
>                   delete searchJson.options[0];
>                   //---------------------------
>
>                   if (action == 'searchitem') {
>                       PM.Query.createSearchInput(searchJson);
>                   } else {
>                       var searchHtml = PM.Query.json2Select(searchJson, "0");
>                       $('#searchoptions').html(searchHtml);
>                   }
>               },
>               error: function (XMLHttpRequest, textStatus, errorThrown) {
>                   if (window.console) console.log(errorThrown);
>               }
>           });
>       }
>
> });
>
>
>
>
> or use
>
>                   //---------------------------
>                   if (Object.keys(searchJson.options).length < 3) {
>                       delete searchJson.options[0];
>                   }
>                   //---------------------------
>
> to do this just in case the search has just 1 layer defined for search,
> in case you once will add another one you don't remember what you once
> modified...
>
>
> On 07/22/2014 07:25 PM, Bogumił Szady wrote:
>> Hello,
>> Is it possible to get one default search field turned on in the moment
>> of starting of application window?
>> I have only one layer to search and I would like to avoid every time
>> selecting layer to search.
>>
>>
>> all the best
>>
>> Bogumił
>>
>> ------------------------------------------------------------------------------
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck
>> Code Sight - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Armin Burger-2
Ok, the change event is not applied if no change happens... Try the
following for the custom.js which should also improve the labels and
logic in this case:

$.extend(PM.Query,
{
     createSearchItems: function(url) {
         $.ajax({
             url: url,
             dataType: "json",
             success: function(response){
                 var searchJson = response.searchJson;
                 var action = response.action;

                 if (action == 'searchitem') {
                     PM.Query.createSearchInput(searchJson);
                 } else {
                     delete searchJson.options[0];
                     var searchHtml = PM.Query.json2Select(searchJson, "0");
                     $('#searchoptions').html(searchHtml);
                     PM.Query.setSearchInput();
                     $('#searchoptions').html(_p("Search
for")).css({"white-space": "nowrap"});
                 }
             },
             error: function (XMLHttpRequest, textStatus, errorThrown) {
                 if (window.console) console.log(errorThrown);
             }
         });
     }

});


On 07/23/2014 08:58 AM, Bogumił Szady wrote:

> Hello,
> Thanks. I have tried to insert this modification.
> I see my layer defined, but without white box on the right to put the
> search attribute.
> Where is the the problem?
>
> best
>
> Bogumił
>
>
> W dniu 2014-07-22 23:11, Armin Burger pisze:
>> not a very elegant solution, but should work:
>>
>> add the following block at the end of your
>>       /config/[your-config]/custom.js
>> file
>>
>> $.extend(PM.Query,
>> {
>>        createSearchItems: function(url) {
>>            $.ajax({
>>                url: url,
>>                dataType: "json",
>>                success: function(response){
>>                    var searchJson = response.searchJson;
>>                    var action = response.action;
>>
>>                    //---------------------------
>>                    delete searchJson.options[0];
>>                    //---------------------------
>>
>>                    if (action == 'searchitem') {
>>                        PM.Query.createSearchInput(searchJson);
>>                    } else {
>>                        var searchHtml = PM.Query.json2Select(searchJson, "0");
>>                        $('#searchoptions').html(searchHtml);
>>                    }
>>                },
>>                error: function (XMLHttpRequest, textStatus, errorThrown) {
>>                    if (window.console) console.log(errorThrown);
>>                }
>>            });
>>        }
>>
>> });
>>
>>
>>
>>
>> or use
>>
>>                    //---------------------------
>>                    if (Object.keys(searchJson.options).length < 3) {
>>                        delete searchJson.options[0];
>>                    }
>>                    //---------------------------
>>
>> to do this just in case the search has just 1 layer defined for search,
>> in case you once will add another one you don't remember what you once
>> modified...
>>
>>
>> On 07/22/2014 07:25 PM, Bogumił Szady wrote:
>>> Hello,
>>> Is it possible to get one default search field turned on in the moment
>>> of starting of application window?
>>> I have only one layer to search and I would like to avoid every time
>>> selecting layer to search.
>>>
>>>
>>> all the best
>>>
>>> Bogumił
>>>
>>> ------------------------------------------------------------------------------
>>> Want fast and easy access to all the code in your enterprise? Index and
>>> search up to 200,000 lines of code with a free copy of Black Duck
>>> Code Sight - the same software that powers the world's largest code
>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> pmapper-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>>
>> ------------------------------------------------------------------------------
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck
>> Code Sight - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Bogumil
I have tried and it doesn't work.
Like before I have normal "search for" label and then I have to select
my one layer to search.
:(

Bogumił


W dniu 2014-07-23 20:38, Armin Burger pisze:

> Ok, the change event is not applied if no change happens... Try the
> following for the custom.js which should also improve the labels and
> logic in this case:
>
> $.extend(PM.Query,
> {
>       createSearchItems: function(url) {
>           $.ajax({
>               url: url,
>               dataType: "json",
>               success: function(response){
>                   var searchJson = response.searchJson;
>                   var action = response.action;
>
>                   if (action == 'searchitem') {
>                       PM.Query.createSearchInput(searchJson);
>                   } else {
>                       delete searchJson.options[0];
>                       var searchHtml = PM.Query.json2Select(searchJson, "0");
>                       $('#searchoptions').html(searchHtml);
>                       PM.Query.setSearchInput();
>                       $('#searchoptions').html(_p("Search
> for")).css({"white-space": "nowrap"});
>                   }
>               },
>               error: function (XMLHttpRequest, textStatus, errorThrown) {
>                   if (window.console) console.log(errorThrown);
>               }
>           });
>       }
>
> });
>
>
> On 07/23/2014 08:58 AM, Bogumił Szady wrote:
>> Hello,
>> Thanks. I have tried to insert this modification.
>> I see my layer defined, but without white box on the right to put the
>> search attribute.
>> Where is the the problem?
>>
>> best
>>
>> Bogumił
>>
>>
>> W dniu 2014-07-22 23:11, Armin Burger pisze:
>>> not a very elegant solution, but should work:
>>>
>>> add the following block at the end of your
>>>        /config/[your-config]/custom.js
>>> file
>>>
>>> $.extend(PM.Query,
>>> {
>>>         createSearchItems: function(url) {
>>>             $.ajax({
>>>                 url: url,
>>>                 dataType: "json",
>>>                 success: function(response){
>>>                     var searchJson = response.searchJson;
>>>                     var action = response.action;
>>>
>>>                     //---------------------------
>>>                     delete searchJson.options[0];
>>>                     //---------------------------
>>>
>>>                     if (action == 'searchitem') {
>>>                         PM.Query.createSearchInput(searchJson);
>>>                     } else {
>>>                         var searchHtml = PM.Query.json2Select(searchJson, "0");
>>>                         $('#searchoptions').html(searchHtml);
>>>                     }
>>>                 },
>>>                 error: function (XMLHttpRequest, textStatus, errorThrown) {
>>>                     if (window.console) console.log(errorThrown);
>>>                 }
>>>             });
>>>         }
>>>
>>> });
>>>
>>>
>>>
>>>
>>> or use
>>>
>>>                     //---------------------------
>>>                     if (Object.keys(searchJson.options).length < 3) {
>>>                         delete searchJson.options[0];
>>>                     }
>>>                     //---------------------------
>>>
>>> to do this just in case the search has just 1 layer defined for search,
>>> in case you once will add another one you don't remember what you once
>>> modified...
>>>
>>>
>>> On 07/22/2014 07:25 PM, Bogumił Szady wrote:
>>>> Hello,
>>>> Is it possible to get one default search field turned on in the moment
>>>> of starting of application window?
>>>> I have only one layer to search and I would like to avoid every time
>>>> selecting layer to search.
>>>>
>>>>
>>>> all the best
>>>>
>>>> Bogumił
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Want fast and easy access to all the code in your enterprise? Index and
>>>> search up to 200,000 lines of code with a free copy of Black Duck
>>>> Code Sight - the same software that powers the world's largest code
>>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>>> http://p.sf.net/sfu/bds
>>>> _______________________________________________
>>>> pmapper-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>>>
>>> ------------------------------------------------------------------------------
>>> Want fast and easy access to all the code in your enterprise? Index and
>>> search up to 200,000 lines of code with a free copy of Black Duck
>>> Code Sight - the same software that powers the world's largest code
>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> pmapper-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>> ------------------------------------------------------------------------------
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck
>> Code Sight - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Bogumil
In reply to this post by Armin Burger-2
I suppose some error in brackets (syntax error).
I am trying to find...

Bogumil

W dniu 2014-07-23 20:38, Armin Burger pisze:

> Ok, the change event is not applied if no change happens... Try the
> following for the custom.js which should also improve the labels and
> logic in this case:
>
> $.extend(PM.Query,
> {
>       createSearchItems: function(url) {
>           $.ajax({
>               url: url,
>               dataType: "json",
>               success: function(response){
>                   var searchJson = response.searchJson;
>                   var action = response.action;
>
>                   if (action == 'searchitem') {
>                       PM.Query.createSearchInput(searchJson);
>                   } else {
>                       delete searchJson.options[0];
>                       var searchHtml = PM.Query.json2Select(searchJson, "0");
>                       $('#searchoptions').html(searchHtml);
>                       PM.Query.setSearchInput();
>                       $('#searchoptions').html(_p("Search
> for")).css({"white-space": "nowrap"});
>                   }
>               },
>               error: function (XMLHttpRequest, textStatus, errorThrown) {
>                   if (window.console) console.log(errorThrown);
>               }
>           });
>       }
>
> });
>
>
> On 07/23/2014 08:58 AM, Bogumił Szady wrote:
>> Hello,
>> Thanks. I have tried to insert this modification.
>> I see my layer defined, but without white box on the right to put the
>> search attribute.
>> Where is the the problem?
>>
>> best
>>
>> Bogumił
>>
>>
>> W dniu 2014-07-22 23:11, Armin Burger pisze:
>>> not a very elegant solution, but should work:
>>>
>>> add the following block at the end of your
>>>        /config/[your-config]/custom.js
>>> file
>>>
>>> $.extend(PM.Query,
>>> {
>>>         createSearchItems: function(url) {
>>>             $.ajax({
>>>                 url: url,
>>>                 dataType: "json",
>>>                 success: function(response){
>>>                     var searchJson = response.searchJson;
>>>                     var action = response.action;
>>>
>>>                     //---------------------------
>>>                     delete searchJson.options[0];
>>>                     //---------------------------
>>>
>>>                     if (action == 'searchitem') {
>>>                         PM.Query.createSearchInput(searchJson);
>>>                     } else {
>>>                         var searchHtml = PM.Query.json2Select(searchJson, "0");
>>>                         $('#searchoptions').html(searchHtml);
>>>                     }
>>>                 },
>>>                 error: function (XMLHttpRequest, textStatus, errorThrown) {
>>>                     if (window.console) console.log(errorThrown);
>>>                 }
>>>             });
>>>         }
>>>
>>> });
>>>
>>>
>>>
>>>
>>> or use
>>>
>>>                     //---------------------------
>>>                     if (Object.keys(searchJson.options).length < 3) {
>>>                         delete searchJson.options[0];
>>>                     }
>>>                     //---------------------------
>>>
>>> to do this just in case the search has just 1 layer defined for search,
>>> in case you once will add another one you don't remember what you once
>>> modified...
>>>
>>>
>>> On 07/22/2014 07:25 PM, Bogumił Szady wrote:
>>>> Hello,
>>>> Is it possible to get one default search field turned on in the moment
>>>> of starting of application window?
>>>> I have only one layer to search and I would like to avoid every time
>>>> selecting layer to search.
>>>>
>>>>
>>>> all the best
>>>>
>>>> Bogumił
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Want fast and easy access to all the code in your enterprise? Index and
>>>> search up to 200,000 lines of code with a free copy of Black Duck
>>>> Code Sight - the same software that powers the world's largest code
>>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>>> http://p.sf.net/sfu/bds
>>>> _______________________________________________
>>>> pmapper-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>>>
>>> ------------------------------------------------------------------------------
>>> Want fast and easy access to all the code in your enterprise? Index and
>>> search up to 200,000 lines of code with a free copy of Black Duck
>>> Code Sight - the same software that powers the world's largest code
>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> pmapper-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>> ------------------------------------------------------------------------------
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck
>> Code Sight - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] search one layer

Bogumil
In reply to this post by Armin Burger-2
It works....
Thanks a lot!

Bogumił
W dniu 2014-07-23 20:38, Armin Burger pisze:

> $.extend(PM.Query,
> {
>       createSearchItems: function(url) {
>           $.ajax({
>               url: url,
>               dataType: "json",
>               success: function(response){
>                   var searchJson = response.searchJson;
>                   var action = response.action;
>
>                   if (action == 'searchitem') {
>                       PM.Query.createSearchInput(searchJson);
>                   } else {
>                       delete searchJson.options[0];
>                       var searchHtml = PM.Query.json2Select(searchJson, "0");
>                       $('#searchoptions').html(searchHtml);
>                       PM.Query.setSearchInput();
>                       $('#searchoptions').html(_p("Search
> for")).css({"white-space": "nowrap"});
>                   }
>               },
>               error: function (XMLHttpRequest, textStatus, errorThrown) {
>                   if (window.console) console.log(errorThrown);
>               }
>           });
>       }
>
> });

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Loading...