Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim Steil
Can you test that?

Jim


On Sat, Nov 7, 2020, 10:30 PM mostwanted  wrote:

> I dont think i wrote this  *$(data('id') == id)* properly but data('id')
> is supposed to return the data-id attribute of the hidden span i'm trying
> to show
>
> On Saturday, November 7, 2020 at 10:32:53 PM UTC+2 Jim S wrote:
>
>> I'm confused by this:
>>
>> $(data('id') == id).fadeIn(); // Select the contact with that id.
>>
>> What is data('id') supposed to return?
>>
>> Or is this some jquery thing I'm not aware of?
>>
>> -Jim
>>
>> On Saturday, November 7, 2020 at 1:57:01 PM UTC-6, mostwanted wrote:
>>>
>>> Yah there is more ot it, is there something specific you were looking
>>> for? Some javascript functions I have saved seperately like the one being
>>> called by the function in the controller
>>> *( _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>> )*
>>> On Saturday, November 7, 2020 at 9:38:42 PM UTC+2 Jim S wrote:
>>>
 There is more to it, right?  I see lots of javascript functions in
 there with no definition.

 -Jim


 On Saturday, November 7, 2020 at 1:23:26 PM UTC-6, mostwanted wrote:
>
> 
> 
> SESOA™
> Kgolagano Ya Kgwebo™
> 
> 
> 
> 
> 
> $(document).ready(function(){
> $('a.service').on("click",function() {
> const id = $(this).attr('id'); // Extract the data-id attribute of the
> link.
>
> $(data('id')==id).fadeIn(); // Select the contact with that id.
> //e.preventDefault();
>
> });
> });
> 
>  onkeyup="livesearch(this.value);" autofocus="" data-toggle="tooltip"
> data-placement="bottom" title="" data-original-title="Search by service or
> product">
> loading ... class="service" href="/init/default/companies/4" id="rescaww"
> onclick="updatesearch(jQuery('#rescaww').html())" style="font-weight:
> bold;">Carpentry and Wood Work data-id="resCab">loading ... href="/init/default/companies/20"
> id="rescab" onclick="updatesearch(jQuery('#rescab').html())"
> style="font-weight: bold;">Cab data-id="resCar Electricity">loading ... href="/init/default/companies/21"
> id="rescaeltcty" onclick="updatesearch(jQuery('#rescaeltcty').html())"
> style="font-weight: bold;">Car Electricity class="link_loader" data-id="resPrivate Clinics  Health Care">loading
> ... href="/init/default/companies/29" id="resprvtclncs"
> onclick="updatesearch(jQuery('#resprvtclncs').html())" style="font-weight:
> bold;">Private Clinics  Health Care class="link_loader" data-id="resFood Catering">loading ... href="/init/default/companies/30" id="resfdctrng"
> onclick="updatesearch(jQuery('#resfdctrng').html())" style="font-weight:
> bold;">Food Catering data-id="resElectrical Installation">loading ... href="/init/default/companies/38"
> id="reselctrcn" onclick="updatesearch(jQuery('#reselctrcn').html())"
> style="font-weight: bold;">Electrical Installation class="link_loader" data-id="resAcademic Tutoring">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/41" id="resadmcttrn"
> onclick="updatesearch(jQuery('#resadmcttrn').html())" style="font-weight:
> bold;">Academic Tutoring data-id="resLandscaping and Gardening">loading ... href="/init/default/companies/56" id="reslnscpngdng"
> onclick="updatesearch(jQuery('#reslnscpngdng').html())" 
> style="font-weight:
> bold;">Landscaping and Gardening data-id="resInternet Cafe">loading ... href="/init/default/companies/73"
> id="resintcf" onclick="updatesearch(jQuery('#resintcf').html())"
> style="font-weight: bold;">Internet Cafe class="link_loader" data-id="resCalligrapher">loading ... href="/init/default/companies/76" id="resclgrph"
> onclick="updatesearch(jQuery('#resclgrph').html())" style="font-weight:
> bold;">Calligrapher data-id="resPre-school, Day Care Center, Creche">loading ... class="fa
> fa-spinner fa-spin"> href="/init/default/companies/79" id="rescreche"
> onclick="updatesearch(jQuery('#rescreche').html())" style="font-weight:
> bold;">Pre-school, Day Care Center, Creche class="link_loader" data-id="resCar, Mats and Sofa Washes">loading 
> ... class="fa fa-spinner fa-spin"> href="/init/default/companies/80" id="rescmw"
> onclick="updatesearch(jQuery('#rescmw').html())" style="font-weight:
> bold;">Car, Mats and Sofa Washes data-id="resCattle Breeding">loading ... href="/init/default/companies/91"
> id="rescbrdn" onclick="updatesearch(jQuery('#rescbrdn').html())"
> style="font-weight: bold;">Cattle Breeding class="link_loader" data-id="resCattle Trailer Hiring">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/98" id="resctrhrn"
> onclick="updatesearch(jQuery('#resctrhrn').html())" style="font-weight:
> bold;">Cattle Trailer Hiring 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted
I dont think i wrote this  *$(data('id') == id)* properly but data('id') is 
supposed to return the data-id attribute of the hidden span i'm trying to 
show

On Saturday, November 7, 2020 at 10:32:53 PM UTC+2 Jim S wrote:

> I'm confused by this:
>
> $(data('id') == id).fadeIn(); // Select the contact with that id.
>
> What is data('id') supposed to return?
>
> Or is this some jquery thing I'm not aware of?
>
> -Jim
>
> On Saturday, November 7, 2020 at 1:57:01 PM UTC-6, mostwanted wrote:
>>
>> Yah there is more ot it, is there something specific you were looking 
>> for? Some javascript functions I have saved seperately like the one being 
>> called by the function in the controller 
>> *( _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name 
>> )*
>> On Saturday, November 7, 2020 at 9:38:42 PM UTC+2 Jim S wrote:
>>
>>> There is more to it, right?  I see lots of javascript functions in there 
>>> with no definition.
>>>
>>> -Jim
>>>
>>>
>>> On Saturday, November 7, 2020 at 1:23:26 PM UTC-6, mostwanted wrote:

 
 
 SESOA™
 Kgolagano Ya Kgwebo™
 
 
 
 
 
 $(document).ready(function(){
 $('a.service').on("click",function() {
 const id = $(this).attr('id'); // Extract the data-id attribute of the 
 link.

 $(data('id')==id).fadeIn(); // Select the contact with that id.
 //e.preventDefault();

 });
 });
 
 >>> onkeyup="livesearch(this.value);" autofocus="" data-toggle="tooltip" 
 data-placement="bottom" title="" data-original-title="Search by service or 
 product">
 loading ...>>> class="service" href="/init/default/companies/4" id="rescaww" 
 onclick="updatesearch(jQuery('#rescaww').html())" style="font-weight: 
 bold;">Carpentry and Wood Work>>> data-id="resCab">loading ...>>> href="/init/default/companies/20" 
 id="rescab" onclick="updatesearch(jQuery('#rescab').html())" 
 style="font-weight: bold;">Cab>>> data-id="resCar Electricity">loading ...>>> href="/init/default/companies/21" 
 id="rescaeltcty" onclick="updatesearch(jQuery('#rescaeltcty').html())" 
 style="font-weight: bold;">Car Electricity>>> class="link_loader" data-id="resPrivate Clinics  Health Care">loading 
 ...>>> href="/init/default/companies/29" id="resprvtclncs" 
 onclick="updatesearch(jQuery('#resprvtclncs').html())" style="font-weight: 
 bold;">Private Clinics  Health Care>>> class="link_loader" data-id="resFood Catering">loading ...>>> href="/init/default/companies/30" id="resfdctrng" 
 onclick="updatesearch(jQuery('#resfdctrng').html())" style="font-weight: 
 bold;">Food Catering>>> data-id="resElectrical Installation">loading ...>>> href="/init/default/companies/38" 
 id="reselctrcn" onclick="updatesearch(jQuery('#reselctrcn').html())" 
 style="font-weight: bold;">Electrical Installation>>> class="link_loader" data-id="resAcademic Tutoring">loading ...>>> class="fa fa-spinner fa-spin" href="/init/default/companies/41" id="resadmcttrn" 
 onclick="updatesearch(jQuery('#resadmcttrn').html())" style="font-weight: 
 bold;">Academic Tutoring>>> data-id="resLandscaping and Gardening">loading ...>>> href="/init/default/companies/56" id="reslnscpngdng" 
 onclick="updatesearch(jQuery('#reslnscpngdng').html())" 
 style="font-weight: 
 bold;">Landscaping and Gardening>>> data-id="resInternet Cafe">loading ...>>> href="/init/default/companies/73" 
 id="resintcf" onclick="updatesearch(jQuery('#resintcf').html())" 
 style="font-weight: bold;">Internet Cafe>>> class="link_loader" data-id="resCalligrapher">loading ...>>> href="/init/default/companies/76" id="resclgrph" 
 onclick="updatesearch(jQuery('#resclgrph').html())" style="font-weight: 
 bold;">Calligrapher>>> data-id="resPre-school, Day Care Center, Creche">loading ...>>> class="fa 
 fa-spinner fa-spin" href="/init/default/companies/79" id="rescreche" 
 onclick="updatesearch(jQuery('#rescreche').html())" style="font-weight: 
 bold;">Pre-school, Day Care Center, Creche>>> class="link_loader" data-id="resCar, Mats and Sofa Washes">loading 
 ...>>> class="fa fa-spinner fa-spin" href="/init/default/companies/80" id="rescmw" 
 onclick="updatesearch(jQuery('#rescmw').html())" style="font-weight: 
 bold;">Car, Mats and Sofa Washes>>> data-id="resCattle Breeding">loading ...>>> href="/init/default/companies/91" 
 id="rescbrdn" onclick="updatesearch(jQuery('#rescbrdn').html())" 
 style="font-weight: bold;">Cattle Breeding>>> class="link_loader" data-id="resCattle Trailer Hiring">loading ...>>> class="fa fa-spinner fa-spin" href="/init/default/companies/98" id="resctrhrn" 
 onclick="updatesearch(jQuery('#resctrhrn').html())" style="font-weight: 
 bold;">Cattle Trailer Hiring>>> data-id="resScaffold Structure Hiring">loading ...>>> href="/init/default/companies/101" id="resssh" 
 onclick="updatesearch(jQuery('#resssh').html())" 

[web2py] web2py ajax function in py4web

2020-11-07 Thread 黄祥
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function
how to achieve this in py4web ?

thx n best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e243892b-4690-4580-b4f9-817ebb98a4e8n%40googlegroups.com.


Re: [web2py] Hosting my web2py application

2020-11-07 Thread Dave S


On Tuesday, October 27, 2020 at 11:21:28 AM UTC-7, Chris wrote:
>
> Hi, you can check the install script of waf2py and get the part where the 
> apache server is installed with web2py. you may need to adjust the paths. 
> This is for a debian system
>
>
>
> https://github.com/ITSec-Chile/Waf2Py/blob/master/installer/waf2py_installer.sh
>
>
There's a more up-to-date script for Nginx, and Mossimo and others don't 
recommend Apache any more, unless you already know it well or have a legacy 
installation.  It's gotten kind of crufty, I'm told, due to the way new 
features were added.

Working with nginx isn't difficult for most uses -- after all, I figured 
out how to use it on my site, and I'm no guru for either web2py or nginx.  
I have not tried the windows version of nginx.  For big sites, you probably 
want the paid version and the add ons for micro APIs, etc, but the free 
version running on AWS linux handles 24x7 at more than 1 request per second.

/dps

 

> —
> Cheers.
> Chris.
>
> On martes, oct. 27, 2020 at 12:44 p. m., mostwanted  > wrote:
> How do I setup a private home server to host my web2py application? What 
> do i need & how do i put it together? If anyone has done it before please 
> share the process or direct me to where I can find the information.
>
> Regards;
>
> Mostwanted
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/6d1e2e29-a423-43d2-b9fe-1e6cae251f26n%40googlegroups.com
>  
> 
> .
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/712d77e0-47c4-46c0-912f-63477afe08b7o%40googlegroups.com.


[web2py] Re: Upload images to folder outside web2py

2020-11-07 Thread Dave S


On Monday, November 2, 2020 at 7:35:45 AM UTC-8, Annet wrote:
>
> I forgot to say, uploading an image works, if the folder isn't
> there it is being created, otherwise the image is uploaded
> to the folder.
>
> Best,
>
> Annet
>
>
Is this related to slashes being dropped, as in Gael's question?
https://groups.google.com/d/msg/web2py/b5mApXO-9Io/FICcx2JlBgAJ>

/dps

 

> Op maandag 2 november 2020 om 16:17:48 UTC+1 schreef Annet:
>
>>
>> To upload images to separate folders outside web2py I set the upload 
>> folder with the model definition:
>>
>> UPLOADSDIR = '/home/me/apps/static/'
>>
>> db.define_table('mytable',
>> Field('image', 'upload', autodelete=True, uploadfolder=os.path.join(
>> UPLOADSDIR, 'vertexID%s' % session.vertexID),
>> ...)
>>
>>
>> I use the standard download function:
>>
>> def download():
>> return response.download(request, db)
>>
>>
>> The form:
>>
>> form = SQLFORM(table, row, deletable=True, upload=URL('default', 
>> 'download'), showid=False, buttons=buttons)
>> if hasattr(request.vars.image, 'filename'):
>> form.vars.imagefilename = request.vars.image.filename
>>
>>
>> and to process the form:
>>
>> if form.process().accepted:
>> if row and form.vars.image__delete:
>> file = row.image
>> os.remove(os.path.join(UPLOADSDIR, 'vertex%s' % 
>> session.back_end_vertexid, file))
>>
>>
>> In web2py 2.17.2 this all worked without problem, however, after 
>> upgrading to
>> web2py 2.20 it no longer works. The image doesn't show in the form, it's 
>> marked
>> with a broken link icon, and when I click the file link I get a page not 
>> found error.
>> Also when I upload a new image, the old one isn't being deleted, so the 
>> images pile
>> up in the folder.
>>
>> I hope someone knows how to solve this issue.
>>
>>
>> Kind regards,
>>
>> Annet
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f9d55e8e-a9ce-472d-b304-998392167af2o%40googlegroups.com.


[web2py] Re: No such file or directory UPLOAD

2020-11-07 Thread Dave S


On Sunday, November 1, 2020 at 1:46:51 PM UTC-8, Gaël Princivalle wrote:
>
> I've found that in this function the upload folder was without a '/' at 
> the beginning.
> On Webfaction it was working fine, on Opalstack no.
>
> I think it's due more to the Web2py version than to the hosting.
> On Webfaction I've PIL (not Pillow) Python 2.7.5 with Web2py 2.14.6. and 
> it works fine.
> On Opalstack I've Pillow Python 2.7.5 with Web2py 2.20.4.
> Anyway I've updated 'upload/' to '/upload/' and it works.
> If it could be useful for someone else, as this SMARTHUMB function has 
> been shared here.
>
> def SMARTHUMB(image, box, fit=False, name="thumb"):
> #Downsample the image.
> #@param img: Image -  an Image-object
> #@param box: tuple(x, y) - the bounding box of the result image
> #@param fit: boolean - crop the image to fill the box
> if image:
> request = current.request
> img = Image.open(request.folder +* 'uploads/'* + image)
> #preresize image with factor 2, 4, 8 and fast algorithm
> factor = 1
> while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / 
> factor > 2 * box[1]:
> factor *= 2
> if factor > 1:
> img.thumbnail((img.size[0] / factor, img.size[1] / factor), 
> Image.NEAREST)
>
> #calculate the cropping box and get the cropped part
> if fit:
> x1 = y1 = 0
> x2, y2 = img.size
> wRatio = 1.0 * x2 / box[0]
> hRatio = 1.0 * y2 / box[1]
> if hRatio > wRatio:
> y1 = int(y2 / 2 - box[1] * wRatio / 2)
> y2 = int(y2 / 2 + box[1] * wRatio / 2)
> else:
> x1 = int(x2 / 2 - box[0] * hRatio / 2)
> x2 = int(x2 / 2 + box[0] * hRatio / 2)
> img = img.crop((x1, y1, x2, y2))
>
> #Resize the image with best quality algorithm ANTI-ALIAS
> img.thumbnail(box, Image.ANTIALIAS)
>
> root, ext = os.path.splitext(image)
> thumb = '%s_%s%s' % (root, name, ext)
> img.save(request.folder +  *'uploads/'* + thumb)
> return thumb
>

An interesting routine, but I just use PIL's thumbnail() method.  Could you 
explain the advantages of your routine?

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b25f8fc6-1586-4ac1-aae3-b2daa3d6153co%40googlegroups.com.


Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim S
I'm confused by this:

$(data('id') == id).fadeIn(); // Select the contact with that id.

What is data('id') supposed to return?

Or is this some jquery thing I'm not aware of?

-Jim

On Saturday, November 7, 2020 at 1:57:01 PM UTC-6, mostwanted wrote:
>
> Yah there is more ot it, is there something specific you were looking for? 
> Some javascript functions I have saved seperately like the one being called 
> by the function in the controller 
> *( _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name )*
> On Saturday, November 7, 2020 at 9:38:42 PM UTC+2 Jim S wrote:
>
>> There is more to it, right?  I see lots of javascript functions in there 
>> with no definition.
>>
>> -Jim
>>
>>
>> On Saturday, November 7, 2020 at 1:23:26 PM UTC-6, mostwanted wrote:
>>>
>>> 
>>> 
>>> SESOA™
>>> Kgolagano Ya Kgwebo™
>>> 
>>> 
>>> 
>>> 
>>> 
>>> $(document).ready(function(){
>>> $('a.service').on("click",function() {
>>> const id = $(this).attr('id'); // Extract the data-id attribute of the 
>>> link.
>>>
>>> $(data('id')==id).fadeIn(); // Select the contact with that id.
>>> //e.preventDefault();
>>>
>>> });
>>> });
>>> 
>>> >> onkeyup="livesearch(this.value);" autofocus="" data-toggle="tooltip" 
>>> data-placement="bottom" title="" data-original-title="Search by service or 
>>> product">
>>> >> class="link_loader" data-id="resCarpentry and Wood Work">loading ...>> class="fa fa-spinner fa-spin">>> href="/init/default/companies/4" id="rescaww" 
>>> onclick="updatesearch(jQuery('#rescaww').html())" style="font-weight: 
>>> bold;">Carpentry and Wood Work>> data-id="resCab">loading ...>> id="rescab" onclick="updatesearch(jQuery('#rescab').html())" 
>>> style="font-weight: bold;">Cab>> data-id="resCar Electricity">loading ...>> id="rescaeltcty" onclick="updatesearch(jQuery('#rescaeltcty').html())" 
>>> style="font-weight: bold;">Car Electricity>> class="link_loader" data-id="resPrivate Clinics  Health Care">loading 
>>> ...>> href="/init/default/companies/29" id="resprvtclncs" 
>>> onclick="updatesearch(jQuery('#resprvtclncs').html())" style="font-weight: 
>>> bold;">Private Clinics  Health Care>> class="link_loader" data-id="resFood Catering">loading ...>> href="/init/default/companies/30" id="resfdctrng" 
>>> onclick="updatesearch(jQuery('#resfdctrng').html())" style="font-weight: 
>>> bold;">Food Catering>> data-id="resElectrical Installation">loading ...>> id="reselctrcn" onclick="updatesearch(jQuery('#reselctrcn').html())" 
>>> style="font-weight: bold;">Electrical Installation>> class="link_loader" data-id="resAcademic Tutoring">loading ...>> class="fa fa-spinner fa-spin">>> href="/init/default/companies/41" id="resadmcttrn" 
>>> onclick="updatesearch(jQuery('#resadmcttrn').html())" style="font-weight: 
>>> bold;">Academic Tutoring>> data-id="resLandscaping and Gardening">loading ...>> href="/init/default/companies/56" id="reslnscpngdng" 
>>> onclick="updatesearch(jQuery('#reslnscpngdng').html())" style="font-weight: 
>>> bold;">Landscaping and Gardening>> data-id="resInternet Cafe">loading ...>> id="resintcf" onclick="updatesearch(jQuery('#resintcf').html())" 
>>> style="font-weight: bold;">Internet Cafe>> class="link_loader" data-id="resCalligrapher">loading ...>> href="/init/default/companies/76" id="resclgrph" 
>>> onclick="updatesearch(jQuery('#resclgrph').html())" style="font-weight: 
>>> bold;">Calligrapher>> data-id="resPre-school, Day Care Center, Creche">loading ...>> href="/init/default/companies/79" id="rescreche" 
>>> onclick="updatesearch(jQuery('#rescreche').html())" style="font-weight: 
>>> bold;">Pre-school, Day Care Center, Creche>> class="link_loader" data-id="resCar, Mats and Sofa Washes">loading ...>> class="fa fa-spinner fa-spin">>> href="/init/default/companies/80" id="rescmw" 
>>> onclick="updatesearch(jQuery('#rescmw').html())" style="font-weight: 
>>> bold;">Car, Mats and Sofa Washes>> data-id="resCattle Breeding">loading ...>> id="rescbrdn" onclick="updatesearch(jQuery('#rescbrdn').html())" 
>>> style="font-weight: bold;">Cattle Breeding>> class="link_loader" data-id="resCattle Trailer Hiring">loading ...>> class="fa fa-spinner fa-spin">>> href="/init/default/companies/98" id="resctrhrn" 
>>> onclick="updatesearch(jQuery('#resctrhrn').html())" style="font-weight: 
>>> bold;">Cattle Trailer Hiring>> data-id="resScaffold Structure Hiring">loading ...>> href="/init/default/companies/101" id="resssh" 
>>> onclick="updatesearch(jQuery('#resssh').html())" style="font-weight: 
>>> bold;">Scaffold Structure Hiring>> data-id="resCar Parts  Components">loading ...>> href="/init/default/companies/106" id="rescpac" 
>>> onclick="updatesearch(jQuery('#rescpac').html())" style="font-weight: 
>>> bold;">Car Parts  Components>> data-id="resElectrical Parts  Components">loading ...>> href="/init/default/companies/107" id="resepac" 
>>> onclick="updatesearch(jQuery('#resepac').html())" style="font-weight: 
>>> bold;">Electrical Parts  Components>> class="product" 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted
Yah there is more ot it, is there something specific you were looking for? 
Some javascript functions I have saved seperately like the one being called 
by the function in the controller 
*( _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name )*
On Saturday, November 7, 2020 at 9:38:42 PM UTC+2 Jim S wrote:

> There is more to it, right?  I see lots of javascript functions in there 
> with no definition.
>
> -Jim
>
>
> On Saturday, November 7, 2020 at 1:23:26 PM UTC-6, mostwanted wrote:
>>
>> 
>> 
>> SESOA™
>> Kgolagano Ya Kgwebo™
>> 
>> 
>> 
>> 
>> 
>> $(document).ready(function(){
>> $('a.service').on("click",function() {
>> const id = $(this).attr('id'); // Extract the data-id attribute of the 
>> link.
>>
>> $(data('id')==id).fadeIn(); // Select the contact with that id.
>> //e.preventDefault();
>>
>> });
>> });
>> 
>> > onkeyup="livesearch(this.value);" autofocus="" data-toggle="tooltip" 
>> data-placement="bottom" title="" data-original-title="Search by service or 
>> product">
>> > class="link_loader" data-id="resCarpentry and Wood Work">loading ...> class="fa fa-spinner fa-spin">> href="/init/default/companies/4" id="rescaww" 
>> onclick="updatesearch(jQuery('#rescaww').html())" style="font-weight: 
>> bold;">Carpentry and Wood Work> data-id="resCab">loading ...> id="rescab" onclick="updatesearch(jQuery('#rescab').html())" 
>> style="font-weight: bold;">Cab> data-id="resCar Electricity">loading ...> id="rescaeltcty" onclick="updatesearch(jQuery('#rescaeltcty').html())" 
>> style="font-weight: bold;">Car Electricity> class="link_loader" data-id="resPrivate Clinics  Health Care">loading 
>> ...> href="/init/default/companies/29" id="resprvtclncs" 
>> onclick="updatesearch(jQuery('#resprvtclncs').html())" style="font-weight: 
>> bold;">Private Clinics  Health Care> class="link_loader" data-id="resFood Catering">loading ...> href="/init/default/companies/30" id="resfdctrng" 
>> onclick="updatesearch(jQuery('#resfdctrng').html())" style="font-weight: 
>> bold;">Food Catering> data-id="resElectrical Installation">loading ...> id="reselctrcn" onclick="updatesearch(jQuery('#reselctrcn').html())" 
>> style="font-weight: bold;">Electrical Installation> class="link_loader" data-id="resAcademic Tutoring">loading ...> class="fa fa-spinner fa-spin">> href="/init/default/companies/41" id="resadmcttrn" 
>> onclick="updatesearch(jQuery('#resadmcttrn').html())" style="font-weight: 
>> bold;">Academic Tutoring> data-id="resLandscaping and Gardening">loading ...> href="/init/default/companies/56" id="reslnscpngdng" 
>> onclick="updatesearch(jQuery('#reslnscpngdng').html())" style="font-weight: 
>> bold;">Landscaping and Gardening> data-id="resInternet Cafe">loading ...> id="resintcf" onclick="updatesearch(jQuery('#resintcf').html())" 
>> style="font-weight: bold;">Internet Cafe> class="link_loader" data-id="resCalligrapher">loading ...> href="/init/default/companies/76" id="resclgrph" 
>> onclick="updatesearch(jQuery('#resclgrph').html())" style="font-weight: 
>> bold;">Calligrapher> data-id="resPre-school, Day Care Center, Creche">loading ...> href="/init/default/companies/79" id="rescreche" 
>> onclick="updatesearch(jQuery('#rescreche').html())" style="font-weight: 
>> bold;">Pre-school, Day Care Center, Creche> class="link_loader" data-id="resCar, Mats and Sofa Washes">loading ...> class="fa fa-spinner fa-spin">> href="/init/default/companies/80" id="rescmw" 
>> onclick="updatesearch(jQuery('#rescmw').html())" style="font-weight: 
>> bold;">Car, Mats and Sofa Washes> data-id="resCattle Breeding">loading ...> id="rescbrdn" onclick="updatesearch(jQuery('#rescbrdn').html())" 
>> style="font-weight: bold;">Cattle Breeding> class="link_loader" data-id="resCattle Trailer Hiring">loading ...> class="fa fa-spinner fa-spin">> href="/init/default/companies/98" id="resctrhrn" 
>> onclick="updatesearch(jQuery('#resctrhrn').html())" style="font-weight: 
>> bold;">Cattle Trailer Hiring> data-id="resScaffold Structure Hiring">loading ...> href="/init/default/companies/101" id="resssh" 
>> onclick="updatesearch(jQuery('#resssh').html())" style="font-weight: 
>> bold;">Scaffold Structure Hiring> data-id="resCar Parts  Components">loading ...> href="/init/default/companies/106" id="rescpac" 
>> onclick="updatesearch(jQuery('#rescpac').html())" style="font-weight: 
>> bold;">Car Parts  Components> data-id="resElectrical Parts  Components">loading ...> href="/init/default/companies/107" id="resepac" 
>> onclick="updatesearch(jQuery('#resepac').html())" style="font-weight: 
>> bold;">Electrical Parts  Components> class="product" href="/init/default/companies2/1" id="rescabp" 
>> onclick="updatesearch(jQuery('#rescabp').html())" style="font-weight: 
>> bold;">Cakes and Bakery Products> href="/init/default/companies2/10" id="resbcaf" 
>> onclick="updatesearch(jQuery('#resbcaf').html())" style="font-weight: 
>> bold;">Business Cards and Flyers> href="/init/default/companies2/14" id="resbc" 
>> 

[web2py] music and programming

2020-11-07 Thread 黄祥
developing app for learning music
https://sugizo.pythonanywhere.com/music
critic and suggestion welcome both music and programming side

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/46b29681-b3e4-4648-84a0-1d2cb7c3bb8bn%40googlegroups.com.


Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim S
There is more to it, right?  I see lots of javascript functions in there 
with no definition.

-Jim


On Saturday, November 7, 2020 at 1:23:26 PM UTC-6, mostwanted wrote:
>
> 
> 
> SESOA™
> Kgolagano Ya Kgwebo™
> 
> 
> 
> 
> 
> $(document).ready(function(){
> $('a.service').on("click",function() {
> const id = $(this).attr('id'); // Extract the data-id attribute of the 
> link.
>
> $(data('id')==id).fadeIn(); // Select the contact with that id.
> //e.preventDefault();
>
> });
> });
> 
>  onkeyup="livesearch(this.value);" autofocus="" data-toggle="tooltip" 
> data-placement="bottom" title="" data-original-title="Search by service or 
> product">
>  class="link_loader" data-id="resCarpentry and Wood Work">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/4" id="rescaww" 
> onclick="updatesearch(jQuery('#rescaww').html())" style="font-weight: 
> bold;">Carpentry and Wood Work data-id="resCab">loading ... id="rescab" onclick="updatesearch(jQuery('#rescab').html())" 
> style="font-weight: bold;">Cab data-id="resCar Electricity">loading ... id="rescaeltcty" onclick="updatesearch(jQuery('#rescaeltcty').html())" 
> style="font-weight: bold;">Car Electricity class="link_loader" data-id="resPrivate Clinics  Health Care">loading 
> ... href="/init/default/companies/29" id="resprvtclncs" 
> onclick="updatesearch(jQuery('#resprvtclncs').html())" style="font-weight: 
> bold;">Private Clinics  Health Care class="link_loader" data-id="resFood Catering">loading ... href="/init/default/companies/30" id="resfdctrng" 
> onclick="updatesearch(jQuery('#resfdctrng').html())" style="font-weight: 
> bold;">Food Catering data-id="resElectrical Installation">loading ... id="reselctrcn" onclick="updatesearch(jQuery('#reselctrcn').html())" 
> style="font-weight: bold;">Electrical Installation class="link_loader" data-id="resAcademic Tutoring">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/41" id="resadmcttrn" 
> onclick="updatesearch(jQuery('#resadmcttrn').html())" style="font-weight: 
> bold;">Academic Tutoring data-id="resLandscaping and Gardening">loading ... href="/init/default/companies/56" id="reslnscpngdng" 
> onclick="updatesearch(jQuery('#reslnscpngdng').html())" style="font-weight: 
> bold;">Landscaping and Gardening data-id="resInternet Cafe">loading ... id="resintcf" onclick="updatesearch(jQuery('#resintcf').html())" 
> style="font-weight: bold;">Internet Cafe class="link_loader" data-id="resCalligrapher">loading ... href="/init/default/companies/76" id="resclgrph" 
> onclick="updatesearch(jQuery('#resclgrph').html())" style="font-weight: 
> bold;">Calligrapher data-id="resPre-school, Day Care Center, Creche">loading ... href="/init/default/companies/79" id="rescreche" 
> onclick="updatesearch(jQuery('#rescreche').html())" style="font-weight: 
> bold;">Pre-school, Day Care Center, Creche class="link_loader" data-id="resCar, Mats and Sofa Washes">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/80" id="rescmw" 
> onclick="updatesearch(jQuery('#rescmw').html())" style="font-weight: 
> bold;">Car, Mats and Sofa Washes data-id="resCattle Breeding">loading ... id="rescbrdn" onclick="updatesearch(jQuery('#rescbrdn').html())" 
> style="font-weight: bold;">Cattle Breeding class="link_loader" data-id="resCattle Trailer Hiring">loading ... class="fa fa-spinner fa-spin"> href="/init/default/companies/98" id="resctrhrn" 
> onclick="updatesearch(jQuery('#resctrhrn').html())" style="font-weight: 
> bold;">Cattle Trailer Hiring data-id="resScaffold Structure Hiring">loading ... href="/init/default/companies/101" id="resssh" 
> onclick="updatesearch(jQuery('#resssh').html())" style="font-weight: 
> bold;">Scaffold Structure Hiring data-id="resCar Parts  Components">loading ... href="/init/default/companies/106" id="rescpac" 
> onclick="updatesearch(jQuery('#rescpac').html())" style="font-weight: 
> bold;">Car Parts  Components data-id="resElectrical Parts  Components">loading ... href="/init/default/companies/107" id="resepac" 
> onclick="updatesearch(jQuery('#resepac').html())" style="font-weight: 
> bold;">Electrical Parts  Components class="product" href="/init/default/companies2/1" id="rescabp" 
> onclick="updatesearch(jQuery('#rescabp').html())" style="font-weight: 
> bold;">Cakes and Bakery Products href="/init/default/companies2/10" id="resbcaf" 
> onclick="updatesearch(jQuery('#resbcaf').html())" style="font-weight: 
> bold;">Business Cards and Flyers href="/init/default/companies2/14" id="resbc" 
> onclick="updatesearch(jQuery('#resbc').html())" style="font-weight: 
> bold;">Brahman Cattle href="/init/default/companies2/21" id="resllcf" 
> onclick="updatesearch(jQuery('#resllcf').html())" style="font-weight: 
> bold;">Lab-Lab Cattle Feed href="/init/default/companies2/22" id="resngcf" 
> onclick="updatesearch(jQuery('#resngcf').html())" style="font-weight: 
> bold;">Nupia Grass Cattle Feed href="/init/default/companies2/23" id="resymcf" 
> 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted


SESOA™
Kgolagano Ya Kgwebo™





$(document).ready(function(){
$('a.service').on("click",function() {
const id = $(this).attr('id'); // Extract the data-id attribute of the link.

$(data('id')==id).fadeIn(); // Select the contact with that id.
//e.preventDefault();

});
});


loading ...Carpentry and Wood Workloading ...Cabloading ...Car Electricityloading 
...Private Clinics  Health Careloading ...Food Cateringloading ...Electrical Installationloading ...Academic Tutoringloading ...Landscaping and Gardeningloading ...Internet Cafeloading ...Calligrapherloading ...Pre-school, Day Care Center, Crecheloading ...Car, Mats and Sofa Washesloading ...Cattle Breedingloading ...Cattle Trailer Hiringloading ...Scaffold Structure Hiringloading ...Car Parts  Componentsloading ...Electrical Parts  ComponentsCakes and Bakery ProductsBusiness Cards and FlyersBrahman CattleLab-Lab Cattle FeedNupia Grass Cattle FeedYellow Maize Cattle FeedNO 
RESULTS IN PRIVATE SELLERS!


I'm not sure if this is what you are looking for but that is what is 
generated for the above screenshot i sent earlier. 
Sorry i couldnt format the code in editor text, ever since the platform 
changed I never know how to format the code to look like the code with all 
the necessary color coding!
On Saturday, November 7, 2020 at 8:09:47 PM UTC+2 Jim S wrote:

> Sorry, I was looking for the actual html code that is generated.  
>
> -Jim
>
>
> On Saturday, November 7, 2020 at 12:06:32 PM UTC-6, mostwanted wrote:
>>
>> [image: Screenshot (38).png]
>> The links in the black box are the results generated when when a user 
>> searches for a service & those are the links that when clicked I need to 
>> display the hidden div next to them to show that the page is loading
>> On Saturday, November 7, 2020 at 7:49:47 PM UTC+2 Jim S wrote:
>>
>>> The page that was generated
>>>
>>> -Jim
>>>
>>> On Saturday, November 7, 2020 at 11:48:37 AM UTC-6, mostwanted wrote:

 What do you mean the final html Jim? Do you mean the actual code or the 
 page generated?

 On Saturday, November 7, 2020 at 7:08:36 PM UTC+2 Jim S wrote:

> Can you post the final html that is generated by web2py?
>
> -Jim
>
>
> On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:
>>
>> Hey Jim I did remove the _onclick function & tried to apply to the 
>> end of the listener as you've suggested but still nothing is happening, 
>> these links are not responsive & I dont know why!
>>
>> On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:
>>
>>> Can you remove the _onclick from that element and add that function 
>>> call to the end of your listener defined in document ready?
>>>
>>> -Jim
>>>
>>>
>>> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  
>>> wrote:
>>>
 _onclick="updatelivesearch(jQuery('#res%s').html())" % c.
 service_name

 This is a function that displays suggested names through ajax 
 auto-completion everytime a user types something on the 
 search-textfield. 
 When they type, a suggestion-div appears below the search-field with 
 suggested names as links ofcourse and when the users identifies the 
 name 
 they were looking for & clicks on it this function populates the 
 search-textfield with the clicked name & causes the suggestion-div 
 with 
 names to disappear.

 function updatelivesearch(value){
 jQuery("#livesearch").val(value);
 jQuery("#livesearchresults").hide();
 }

 Thanks alot for your input Jim i'll keep working on it, one way or 
 the other i'll figure it out.
 Gratitude.


 On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:

> What is the 
>
> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.
> service_name
>
> on your anchor tag inside your span?
>
> Can you try removing that?
>
> Since you have a listener for the click of that element already, 
> I'm not sure how it behaves if you have the onclick attribute set as 
> well.  
> Maybe there are some stronger javascript people that can jump in.
>
> -Jim
>
>
> On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted 
> wrote:
>>
>>
>> *" Are you trying to show the span when the link is clicked 
>> 'while' the page is loaded?  ":  *Yes sir
>>
>> *" I'm guessing you are clicking the link after the page is 
>> loaded ": *Yes sir
>>
>> *"Also, where in your javascript did you add the 
>> console.log()?":  *I added it inside the click function just 
>> before initialization of the id variable
>>
>> 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim S
Sorry, I was looking for the actual html code that is generated.  

-Jim


On Saturday, November 7, 2020 at 12:06:32 PM UTC-6, mostwanted wrote:
>
> [image: Screenshot (38).png]
> The links in the black box are the results generated when when a user 
> searches for a service & those are the links that when clicked I need to 
> display the hidden div next to them to show that the page is loading
> On Saturday, November 7, 2020 at 7:49:47 PM UTC+2 Jim S wrote:
>
>> The page that was generated
>>
>> -Jim
>>
>> On Saturday, November 7, 2020 at 11:48:37 AM UTC-6, mostwanted wrote:
>>>
>>> What do you mean the final html Jim? Do you mean the actual code or the 
>>> page generated?
>>>
>>> On Saturday, November 7, 2020 at 7:08:36 PM UTC+2 Jim S wrote:
>>>
 Can you post the final html that is generated by web2py?

 -Jim


 On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:
>
> Hey Jim I did remove the _onclick function & tried to apply to the end 
> of the listener as you've suggested but still nothing is happening, these 
> links are not responsive & I dont know why!
>
> On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:
>
>> Can you remove the _onclick from that element and add that function 
>> call to the end of your listener defined in document ready?
>>
>> -Jim
>>
>>
>> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:
>>
>>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.
>>> service_name
>>>
>>> This is a function that displays suggested names through ajax 
>>> auto-completion everytime a user types something on the 
>>> search-textfield. 
>>> When they type, a suggestion-div appears below the search-field with 
>>> suggested names as links ofcourse and when the users identifies the 
>>> name 
>>> they were looking for & clicks on it this function populates the 
>>> search-textfield with the clicked name & causes the suggestion-div with 
>>> names to disappear.
>>>
>>> function updatelivesearch(value){
>>> jQuery("#livesearch").val(value);
>>> jQuery("#livesearchresults").hide();
>>> }
>>>
>>> Thanks alot for your input Jim i'll keep working on it, one way or 
>>> the other i'll figure it out.
>>> Gratitude.
>>>
>>>
>>> On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:
>>>
 What is the 

 _onclick="updatelivesearch(jQuery('#res%s').html())" % c.
 service_name

 on your anchor tag inside your span?

 Can you try removing that?

 Since you have a listener for the click of that element already, 
 I'm not sure how it behaves if you have the onclick attribute set as 
 well.  
 Maybe there are some stronger javascript people that can jump in.

 -Jim


 On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted 
 wrote:
>
>
> *" Are you trying to show the span when the link is clicked 
> 'while' the page is loaded?  ":  *Yes sir
>
> *" I'm guessing you are clicking the link after the page is loaded 
> ": *Yes sir
>
> *"Also, where in your javascript did you add the console.log()?":  
> *I added it inside the click function just before initialization 
> of the id variable
>
> **$(document).ready(function(){
> $('.service').click(function(e) {
> *console.log( "Hello world!" );*
> const id = $(this).data('id'); 
> $('#' + id).fadeIn(); 
> e.preventDefault();
>
> });
> });
> ** 
> On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:
>
>> Ok, trying to better understand your intent.
>>
>> You said:
>>
>> I have a hidden span that i want displayed when a link is 
>> clisked while waiting for the page to load but this is not 
>> working! I dont know where I am going wrong but thought I had it 
>> right, 
>> please assist me.
>>
>> Are you trying to show the span when the link is clicked 'while' 
>> the page is loaded?  I'm guessing you are clicking the link after 
>> the page 
>> is loaded.  Can you confirm?
>>
>> Also, where in your javascript did you add the console.log()?
>>
>> -Jim
>>
>>
>> On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted 
>> wrote:
>>>
>>> I threw in  console.log("Hello world!");  but its not printing 
>>> anything on the console! The link events are not being handled!
>>>
>>>
>>> On Tuesday, November 3, 2020 at 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted
[image: Screenshot (38).png]
The links in the black box are the results generated when when a user 
searches for a service & those are the links that when clicked I need to 
display the hidden div next to them to show that the page is loading
On Saturday, November 7, 2020 at 7:49:47 PM UTC+2 Jim S wrote:

> The page that was generated
>
> -Jim
>
> On Saturday, November 7, 2020 at 11:48:37 AM UTC-6, mostwanted wrote:
>>
>> What do you mean the final html Jim? Do you mean the actual code or the 
>> page generated?
>>
>> On Saturday, November 7, 2020 at 7:08:36 PM UTC+2 Jim S wrote:
>>
>>> Can you post the final html that is generated by web2py?
>>>
>>> -Jim
>>>
>>>
>>> On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:

 Hey Jim I did remove the _onclick function & tried to apply to the end 
 of the listener as you've suggested but still nothing is happening, these 
 links are not responsive & I dont know why!

 On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:

> Can you remove the _onclick from that element and add that function 
> call to the end of your listener defined in document ready?
>
> -Jim
>
>
> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:
>
>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>
>> This is a function that displays suggested names through ajax 
>> auto-completion everytime a user types something on the 
>> search-textfield. 
>> When they type, a suggestion-div appears below the search-field with 
>> suggested names as links ofcourse and when the users identifies the name 
>> they were looking for & clicks on it this function populates the 
>> search-textfield with the clicked name & causes the suggestion-div with 
>> names to disappear.
>>
>> function updatelivesearch(value){
>> jQuery("#livesearch").val(value);
>> jQuery("#livesearchresults").hide();
>> }
>>
>> Thanks alot for your input Jim i'll keep working on it, one way or 
>> the other i'll figure it out.
>> Gratitude.
>>
>>
>> On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:
>>
>>> What is the 
>>>
>>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.
>>> service_name
>>>
>>> on your anchor tag inside your span?
>>>
>>> Can you try removing that?
>>>
>>> Since you have a listener for the click of that element already, I'm 
>>> not sure how it behaves if you have the onclick attribute set as well.  
>>> Maybe there are some stronger javascript people that can jump in.
>>>
>>> -Jim
>>>
>>>
>>> On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted 
>>> wrote:


 *" Are you trying to show the span when the link is clicked 'while' 
 the page is loaded?  ":  *Yes sir

 *" I'm guessing you are clicking the link after the page is loaded 
 ": *Yes sir

 *"Also, where in your javascript did you add the console.log()?":  *I 
 added it inside the click function just before initialization of the 
 id 
 variable

 **$(document).ready(function(){
 $('.service').click(function(e) {
 *console.log( "Hello world!" );*
 const id = $(this).data('id'); 
 $('#' + id).fadeIn(); 
 e.preventDefault();

 });
 });
 ** 
 On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:

> Ok, trying to better understand your intent.
>
> You said:
>
> I have a hidden span that i want displayed when a link is clisked 
> while waiting for the page to load but this is not working! I 
> dont know where I am going wrong but thought I had it right, please 
> assist 
> me.
>
> Are you trying to show the span when the link is clicked 'while' 
> the page is loaded?  I'm guessing you are clicking the link after the 
> page 
> is loaded.  Can you confirm?
>
> Also, where in your javascript did you add the console.log()?
>
> -Jim
>
>
> On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted 
> wrote:
>>
>> I threw in  console.log("Hello world!");  but its not printing 
>> anything on the console! The link events are not being handled!
>>
>>
>> On Tuesday, November 3, 2020 at 11:35:19 PM UTC+2 Jim S wrote:
>>
>>> Can you put some console.log() statements in your javascript 
>>> inside your function to see what is/isn't working?
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, November 3, 2020 at 12:10:06 PM UTC-6, mostwanted 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim S
The page that was generated

-Jim

On Saturday, November 7, 2020 at 11:48:37 AM UTC-6, mostwanted wrote:
>
> What do you mean the final html Jim? Do you mean the actual code or the 
> page generated?
>
> On Saturday, November 7, 2020 at 7:08:36 PM UTC+2 Jim S wrote:
>
>> Can you post the final html that is generated by web2py?
>>
>> -Jim
>>
>>
>> On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:
>>>
>>> Hey Jim I did remove the _onclick function & tried to apply to the end 
>>> of the listener as you've suggested but still nothing is happening, these 
>>> links are not responsive & I dont know why!
>>>
>>> On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:
>>>
 Can you remove the _onclick from that element and add that function 
 call to the end of your listener defined in document ready?

 -Jim


 On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:

> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>
> This is a function that displays suggested names through ajax 
> auto-completion everytime a user types something on the search-textfield. 
> When they type, a suggestion-div appears below the search-field with 
> suggested names as links ofcourse and when the users identifies the name 
> they were looking for & clicks on it this function populates the 
> search-textfield with the clicked name & causes the suggestion-div with 
> names to disappear.
>
> function updatelivesearch(value){
> jQuery("#livesearch").val(value);
> jQuery("#livesearchresults").hide();
> }
>
> Thanks alot for your input Jim i'll keep working on it, one way or the 
> other i'll figure it out.
> Gratitude.
>
>
> On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:
>
>> What is the 
>>
>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>
>> on your anchor tag inside your span?
>>
>> Can you try removing that?
>>
>> Since you have a listener for the click of that element already, I'm 
>> not sure how it behaves if you have the onclick attribute set as well.  
>> Maybe there are some stronger javascript people that can jump in.
>>
>> -Jim
>>
>>
>> On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted wrote:
>>>
>>>
>>> *" Are you trying to show the span when the link is clicked 'while' 
>>> the page is loaded?  ":  *Yes sir
>>>
>>> *" I'm guessing you are clicking the link after the page is loaded 
>>> ": *Yes sir
>>>
>>> *"Also, where in your javascript did you add the console.log()?":  *I 
>>> added it inside the click function just before initialization of the id 
>>> variable
>>>
>>> **$(document).ready(function(){
>>> $('.service').click(function(e) {
>>> *console.log( "Hello world!" );*
>>> const id = $(this).data('id'); 
>>> $('#' + id).fadeIn(); 
>>> e.preventDefault();
>>>
>>> });
>>> });
>>> ** 
>>> On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:
>>>
 Ok, trying to better understand your intent.

 You said:

 I have a hidden span that i want displayed when a link is clisked 
 while waiting for the page to load but this is not working! I dont 
 know where I am going wrong but thought I had it right, please assist 
 me.

 Are you trying to show the span when the link is clicked 'while' 
 the page is loaded?  I'm guessing you are clicking the link after the 
 page 
 is loaded.  Can you confirm?

 Also, where in your javascript did you add the console.log()?

 -Jim


 On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted 
 wrote:
>
> I threw in  console.log("Hello world!");  but its not printing 
> anything on the console! The link events are not being handled!
>
>
> On Tuesday, November 3, 2020 at 11:35:19 PM UTC+2 Jim S wrote:
>
>> Can you put some console.log() statements in your javascript 
>> inside your function to see what is/isn't working?
>>
>> -Jim
>>
>>
>> On Tuesday, November 3, 2020 at 12:10:06 PM UTC-6, mostwanted 
>> wrote:
>>>
>>> Hey Jim, I have but it shows no errors!
>>>
>>> On Tuesday, November 3, 2020 at 6:02:50 PM UTC+2 Jim S wrote:
>>>
 Have you checked your browser console to see if you have any 
 javascript errors?

 -Jim


 On Tuesday, November 3, 2020 at 3:36:22 AM UTC-6, mostwanted 
 wrote:
>
> I have a hidden 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted
What do you mean the final html Jim? Do you mean the actual code or the 
page generated?

On Saturday, November 7, 2020 at 7:08:36 PM UTC+2 Jim S wrote:

> Can you post the final html that is generated by web2py?
>
> -Jim
>
>
> On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:
>>
>> Hey Jim I did remove the _onclick function & tried to apply to the end of 
>> the listener as you've suggested but still nothing is happening, these 
>> links are not responsive & I dont know why!
>>
>> On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:
>>
>>> Can you remove the _onclick from that element and add that function call 
>>> to the end of your listener defined in document ready?
>>>
>>> -Jim
>>>
>>>
>>> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:
>>>
 _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name

 This is a function that displays suggested names through ajax 
 auto-completion everytime a user types something on the search-textfield. 
 When they type, a suggestion-div appears below the search-field with 
 suggested names as links ofcourse and when the users identifies the name 
 they were looking for & clicks on it this function populates the 
 search-textfield with the clicked name & causes the suggestion-div with 
 names to disappear.

 function updatelivesearch(value){
 jQuery("#livesearch").val(value);
 jQuery("#livesearchresults").hide();
 }

 Thanks alot for your input Jim i'll keep working on it, one way or the 
 other i'll figure it out.
 Gratitude.


 On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:

> What is the 
>
> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>
> on your anchor tag inside your span?
>
> Can you try removing that?
>
> Since you have a listener for the click of that element already, I'm 
> not sure how it behaves if you have the onclick attribute set as well.  
> Maybe there are some stronger javascript people that can jump in.
>
> -Jim
>
>
> On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted wrote:
>>
>>
>> *" Are you trying to show the span when the link is clicked 'while' 
>> the page is loaded?  ":  *Yes sir
>>
>> *" I'm guessing you are clicking the link after the page is loaded ": 
>> *Yes sir
>>
>> *"Also, where in your javascript did you add the console.log()?":  *I 
>> added it inside the click function just before initialization of the id 
>> variable
>>
>> **$(document).ready(function(){
>> $('.service').click(function(e) {
>> *console.log( "Hello world!" );*
>> const id = $(this).data('id'); 
>> $('#' + id).fadeIn(); 
>> e.preventDefault();
>>
>> });
>> });
>> ** 
>> On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:
>>
>>> Ok, trying to better understand your intent.
>>>
>>> You said:
>>>
>>> I have a hidden span that i want displayed when a link is clisked 
>>> while waiting for the page to load but this is not working! I dont 
>>> know where I am going wrong but thought I had it right, please assist 
>>> me.
>>>
>>> Are you trying to show the span when the link is clicked 'while' the 
>>> page is loaded?  I'm guessing you are clicking the link after the page 
>>> is 
>>> loaded.  Can you confirm?
>>>
>>> Also, where in your javascript did you add the console.log()?
>>>
>>> -Jim
>>>
>>>
>>> On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted 
>>> wrote:

 I threw in  console.log("Hello world!");  but its not printing 
 anything on the console! The link events are not being handled!


 On Tuesday, November 3, 2020 at 11:35:19 PM UTC+2 Jim S wrote:

> Can you put some console.log() statements in your javascript 
> inside your function to see what is/isn't working?
>
> -Jim
>
>
> On Tuesday, November 3, 2020 at 12:10:06 PM UTC-6, mostwanted 
> wrote:
>>
>> Hey Jim, I have but it shows no errors!
>>
>> On Tuesday, November 3, 2020 at 6:02:50 PM UTC+2 Jim S wrote:
>>
>>> Have you checked your browser console to see if you have any 
>>> javascript errors?
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, November 3, 2020 at 3:36:22 AM UTC-6, mostwanted 
>>> wrote:

 I have a hidden span that i want displayed when a link is 
 clisked while waiting for the page to load but this is not 
 working! I dont 
 know where I am going wrong but thought I had it right, please 
 assist me.

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread Jim S
Can you post the final html that is generated by web2py?

-Jim


On Saturday, November 7, 2020 at 10:52:29 AM UTC-6, mostwanted wrote:
>
> Hey Jim I did remove the _onclick function & tried to apply to the end of 
> the listener as you've suggested but still nothing is happening, these 
> links are not responsive & I dont know why!
>
> On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:
>
>> Can you remove the _onclick from that element and add that function call 
>> to the end of your listener defined in document ready?
>>
>> -Jim
>>
>>
>> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:
>>
>>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>>
>>> This is a function that displays suggested names through ajax 
>>> auto-completion everytime a user types something on the search-textfield. 
>>> When they type, a suggestion-div appears below the search-field with 
>>> suggested names as links ofcourse and when the users identifies the name 
>>> they were looking for & clicks on it this function populates the 
>>> search-textfield with the clicked name & causes the suggestion-div with 
>>> names to disappear.
>>>
>>> function updatelivesearch(value){
>>> jQuery("#livesearch").val(value);
>>> jQuery("#livesearchresults").hide();
>>> }
>>>
>>> Thanks alot for your input Jim i'll keep working on it, one way or the 
>>> other i'll figure it out.
>>> Gratitude.
>>>
>>>
>>> On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:
>>>
 What is the 

 _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name

 on your anchor tag inside your span?

 Can you try removing that?

 Since you have a listener for the click of that element already, I'm 
 not sure how it behaves if you have the onclick attribute set as well.  
 Maybe there are some stronger javascript people that can jump in.

 -Jim


 On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted wrote:
>
>
> *" Are you trying to show the span when the link is clicked 'while' 
> the page is loaded?  ":  *Yes sir
>
> *" I'm guessing you are clicking the link after the page is loaded ": 
> *Yes 
> sir
>
> *"Also, where in your javascript did you add the console.log()?":  *I 
> added it inside the click function just before initialization of the id 
> variable
>
> **$(document).ready(function(){
> $('.service').click(function(e) {
> *console.log( "Hello world!" );*
> const id = $(this).data('id'); 
> $('#' + id).fadeIn(); 
> e.preventDefault();
>
> });
> });
> ** 
> On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:
>
>> Ok, trying to better understand your intent.
>>
>> You said:
>>
>> I have a hidden span that i want displayed when a link is clisked 
>> while waiting for the page to load but this is not working! I dont 
>> know where I am going wrong but thought I had it right, please assist me.
>>
>> Are you trying to show the span when the link is clicked 'while' the 
>> page is loaded?  I'm guessing you are clicking the link after the page 
>> is 
>> loaded.  Can you confirm?
>>
>> Also, where in your javascript did you add the console.log()?
>>
>> -Jim
>>
>>
>> On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted wrote:
>>>
>>> I threw in  console.log("Hello world!");  but its not printing 
>>> anything on the console! The link events are not being handled!
>>>
>>>
>>> On Tuesday, November 3, 2020 at 11:35:19 PM UTC+2 Jim S wrote:
>>>
 Can you put some console.log() statements in your javascript inside 
 your function to see what is/isn't working?

 -Jim


 On Tuesday, November 3, 2020 at 12:10:06 PM UTC-6, mostwanted wrote:
>
> Hey Jim, I have but it shows no errors!
>
> On Tuesday, November 3, 2020 at 6:02:50 PM UTC+2 Jim S wrote:
>
>> Have you checked your browser console to see if you have any 
>> javascript errors?
>>
>> -Jim
>>
>>
>> On Tuesday, November 3, 2020 at 3:36:22 AM UTC-6, mostwanted 
>> wrote:
>>>
>>> I have a hidden span that i want displayed when a link is 
>>> clisked while waiting for the page to load but this is not working! 
>>> I dont 
>>> know where I am going wrong but thought I had it right, please 
>>> assist me.
>>>
>>> *CSS:*
>>> .link_loader
>>> {
>>> display: none;
>>> }
>>>
>>> *CONTROLLER*
>>> *#The yellow line is the hidden span that has the loader I want 
>>> to display*
>>> def ajaxlivesearch():
>>> keywords = 

Re: [web2py] Re: Displaying content based on the id attribute

2020-11-07 Thread mostwanted
Hey Jim I did remove the _onclick function & tried to apply to the end of 
the listener as you've suggested but still nothing is happening, these 
links are not responsive & I dont know why!

On Thursday, November 5, 2020 at 4:33:32 AM UTC+2 Jim S wrote:

> Can you remove the _onclick from that element and add that function call 
> to the end of your listener defined in document ready?
>
> -Jim
>
>
> On Wed, Nov 4, 2020 at 8:29 PM mostwanted  wrote:
>
>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>
>> This is a function that displays suggested names through ajax 
>> auto-completion everytime a user types something on the search-textfield. 
>> When they type, a suggestion-div appears below the search-field with 
>> suggested names as links ofcourse and when the users identifies the name 
>> they were looking for & clicks on it this function populates the 
>> search-textfield with the clicked name & causes the suggestion-div with 
>> names to disappear.
>>
>> function updatelivesearch(value){
>> jQuery("#livesearch").val(value);
>> jQuery("#livesearchresults").hide();
>> }
>>
>> Thanks alot for your input Jim i'll keep working on it, one way or the 
>> other i'll figure it out.
>> Gratitude.
>>
>>
>> On Wednesday, November 4, 2020 at 7:34:44 PM UTC+2 Jim S wrote:
>>
>>> What is the 
>>>
>>> _onclick="updatelivesearch(jQuery('#res%s').html())" % c.service_name
>>>
>>> on your anchor tag inside your span?
>>>
>>> Can you try removing that?
>>>
>>> Since you have a listener for the click of that element already, I'm not 
>>> sure how it behaves if you have the onclick attribute set as well.  Maybe 
>>> there are some stronger javascript people that can jump in.
>>>
>>> -Jim
>>>
>>>
>>> On Wednesday, November 4, 2020 at 11:23:45 AM UTC-6, mostwanted wrote:


 *" Are you trying to show the span when the link is clicked 'while' the 
 page is loaded?  ":  *Yes sir

 *" I'm guessing you are clicking the link after the page is loaded ": *Yes 
 sir

 *"Also, where in your javascript did you add the console.log()?":  *I 
 added it inside the click function just before initialization of the id 
 variable

 **$(document).ready(function(){
 $('.service').click(function(e) {
 *console.log( "Hello world!" );*
 const id = $(this).data('id'); 
 $('#' + id).fadeIn(); 
 e.preventDefault();

 });
 });
 ** 
 On Wednesday, November 4, 2020 at 4:09:12 PM UTC+2 Jim S wrote:

> Ok, trying to better understand your intent.
>
> You said:
>
> I have a hidden span that i want displayed when a link is clisked 
> while waiting for the page to load but this is not working! I dont 
> know where I am going wrong but thought I had it right, please assist me.
>
> Are you trying to show the span when the link is clicked 'while' the 
> page is loaded?  I'm guessing you are clicking the link after the page is 
> loaded.  Can you confirm?
>
> Also, where in your javascript did you add the console.log()?
>
> -Jim
>
>
> On Wednesday, November 4, 2020 at 12:34:02 AM UTC-6, mostwanted wrote:
>>
>> I threw in  console.log("Hello world!");  but its not printing 
>> anything on the console! The link events are not being handled!
>>
>>
>> On Tuesday, November 3, 2020 at 11:35:19 PM UTC+2 Jim S wrote:
>>
>>> Can you put some console.log() statements in your javascript inside 
>>> your function to see what is/isn't working?
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, November 3, 2020 at 12:10:06 PM UTC-6, mostwanted wrote:

 Hey Jim, I have but it shows no errors!

 On Tuesday, November 3, 2020 at 6:02:50 PM UTC+2 Jim S wrote:

> Have you checked your browser console to see if you have any 
> javascript errors?
>
> -Jim
>
>
> On Tuesday, November 3, 2020 at 3:36:22 AM UTC-6, mostwanted wrote:
>>
>> I have a hidden span that i want displayed when a link is clisked 
>> while waiting for the page to load but this is not working! I dont 
>> know 
>> where I am going wrong but thought I had it right, please assist me.
>>
>> *CSS:*
>> .link_loader
>> {
>> display: none;
>> }
>>
>> *CONTROLLER*
>> *#The yellow line is the hidden span that has the loader I want 
>> to display*
>> def ajaxlivesearch():
>> keywords = request.vars.keywords
>> print "Keywords: " + str(keywords)
>>
>> if keywords:
>> query = reduce(lambda 
>> a,b:a,[db.services.service_name.contains(k) for k in 
>> keywords.split()])
>> services = db(query).select()
>> items = []

[web2py] Re: Add to home screen

2020-11-07 Thread mostwanted
  Thanks alot, these links will come in handy
On Friday, November 6, 2020 at 12:56:47 AM UTC+2 snide...@gmail.com wrote:

>
>
> On Wednesday, May 27, 2020 at 3:08:15 AM UTC-7, mostwanted wrote:
>>
>> Whats the simplest way to get my web2py application to prompt users to 
>> add to screen? I have tried alot of things but none are working, there are 
>> no prompts happening! Some say its only achievable through a PWA design, i 
>> tried this 
>> https://groups.google.com/forum/#!searchin/web2py/pwa$20me%7Csort:date/web2py/rHBfs1zFG44/gKS6EOmlAgAJ
>>  
>>
>> nothing is working, if anyone has a way to achieve this with web2py i'd 
>> appreciate your assistance.
>>
>> Regards;
>>
>> Mostwanted
>>
>
>
> I found this reference, which helped me understand What The Heck you kids 
> were talking about.
>
> https://flaviocopes.com/progressive-web-apps/>
> https://flaviocopes.com/service-workers/>
>  
> Flavio is another Italian (in the northern lake district, I believe), but 
> his English is quite good.  He also has lots of tutorials about Vue, React, 
> javascript itself, CSS, and lots of stuff for the web-fingers.
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/68aeffdb-1acf-4456-ad57-4e00eda4b820n%40googlegroups.com.