-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-complete of search not working on 'post' page #2795
Comments
Hey, can I have a link to .html file that is being loaded on https://publiclab.org/post ? |
Should be at /app/views/editor/rich.html.erb -- hope that helps!!!
On Nov 15, 2018 5:09 PM, "Rohan Singh" <[email protected]> wrote:
Hey, can I have a link to .html file that is being loaded on
https://publiclab.org/post ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2795 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ8YqEz1NcNTqMufhiUlnvxe6dZraks5uveX6gaJpZM4Ugtkl>
.
|
Hey @jywarren , Can you tell me how you see that, It has been a problem for me to locate the files that are being loaded :/ |
Hi @rohancl . This is what I have learned so far. Hopefully it is helpful, but some of it may be wrong. |
Got it, thanks @kevinzluo |
Problem in contributingHey @jywarren @kevinzluo , I have completed the task, but I still think I need some help here,What I didI checked the links, and found that the code in post.js which contains the code for auto- completion of the search bar isn't actually linked to the post page. (or to rich.html.erb) And also that it is dependent on typeahead.jquery.js to function properly/ So, I checked for the typeahead.jquery.js (located in /public/lib/typeahead.js/dist/typeahead.jquery.js) [NOTE: The /public/lib folder is present here, but not on this repository] script tag in rich.html.erb and I got the link1: Now, I copied and pasted the code of post.js into the starting of typeahead.jquery.js (along with the pre existing code) The ProblemThere is no such file as /public/lib in this repository. So where do I commit my code ?What I tried doing, but failedI did notice that the /public/lib folder is created only if you install plots locally on a machine and thus it's not on this repository, So I thought instead of editing typeahead.jquery.js, I could move post.js in /public folder and directly link it to rich.html.erb like this:I also did notice that post.js requires the typeahead.jquery.js file for proper function,
|
@jywarren Please help. |
Hi @rohancl, the |
I could not understand this completely, can I edit typeahead.jquery.js anywhere on this repository ? |
No need to edit typeahead.jquery.js file as it is a file from outer source just like bootstrap. We only use it and never change it. |
Ok, I am somewhat getting it.... But how do i import this file into the post.js then ? |
and also, Why is application.js all quoted out, it contains of all comments.... Please explain, Thanks ^.^ |
Those are not comments. It is actually the way for importing a js file. |
so we are linking a js file inside a js file right ? |
Yeah right and these js files can be used in any of the views. |
That means I can bring typeahead.jquery.js into post.js by typing in: //=require typeahead.js/dist/typeahead.jquery.js . right ? |
Yeah that's what you have to do |
I dont understand why you are keeping anything in public folder. I think it should be kept inside |
that was because I could not link the file anywhere else i tried writing: I know I am probably doing something dumb, Please help @Souravirus |
Can you send a PR? So, that I can see what exactly you are doing. |
Yeah sure, wait a moment.... |
#3996 |
Please add the //= require line in application.js as I have told you before. Also there should be space between /= and require. I guess you haven't given any space in there. Please see to this. |
Oh sorry I forgot to commit the application.js part, but I have it updated in my localhost. |
What's the error now? |
Aha! Cool you are making progress here.
The public url route will be /lib/... Instead of /app/assets/ which is the
internal system path.
Or lib is for yarn dependencies. Actually there is a JavaScript method that
rails supplies... Let me find it...
…On Sat, Nov 17, 2018, 10:17 AM Rohan Singh ***@***.*** wrote:
Also, along with the linking error in the inspect element tab, I am
getting this too:
[image: newerr]
<https://user-images.githubusercontent.com/29266591/48662569-c3ca7c80-eaa9-11e8-8578-2d63665e5407.png>
Tell me if it's a problem, because as far as I know, this is an outsource
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2795 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ6Sb4uGFtcDvPh7Ej2_z3vT2DKZnks5uwChNgaJpZM4Ugtkl>
.
|
Here:
<%= javascript_include_tag "post" %>
In this, the root will refer to anything in /app/assets/javascripts/
But I didn't think the post js file was related to auto completion. So
maybe this isn't needed and you need to find why jQuery autocompletion is
not loaded in the rich editor?
I definitely see it in the first few lines of this file already -
https://github.com/publiclab/plots2/blob/master/app/views/editor/rich.html.erb
…On Sat, Nov 17, 2018, 10:54 AM Jeffrey Warren ***@***.*** wrote:
Aha! Cool you are making progress here.
The public url route will be /lib/... Instead of /app/assets/ which is the
internal system path.
Or lib is for yarn dependencies. Actually there is a JavaScript method
that rails supplies... Let me find it...
On Sat, Nov 17, 2018, 10:17 AM Rohan Singh ***@***.***
wrote:
> Also, along with the linking error in the inspect element tab, I am
> getting this too:
>
> [image: newerr]
> <https://user-images.githubusercontent.com/29266591/48662569-c3ca7c80-eaa9-11e8-8578-2d63665e5407.png>
> Tell me if it's a problem, because as far as I know, this is an outsource
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2795 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AABfJ6Sb4uGFtcDvPh7Ej2_z3vT2DKZnks5uwChNgaJpZM4Ugtkl>
> .
>
|
Hey @Souravirus @jywarren , Is the file that has autocompletition code already linked to rich.html.erb ? |
Is this task already done or picked up by someone? |
@rohancl yes it is - see the top few lines of @oorjitchowdhary -- maybe you could help @rohancl take the next step on this one? |
I saw this task was free and claimed it. Can I work on it? |
Yeah sure @JonathanXu1 |
I believe that the reason the auto-complete isn't working properly is because the neccessary scripts and css were not included in rich.html.erb. I dug around and found /public/lib/publiclab-editor/examples/autocomplete.html, which has very similar code to rich.html.erb. See it here. Essentially the header has been modified like such: So I copied the script and css tags to the rich page and modified the directories to the rich local, where I now get the following error: I'm not familiar with ruby on rails, and I'm not really sure if I'm going in the right direction. Any help would be appreciated! @Souravirus @jywarren |
Hello. I am very confused currently. On a side note, I believe the issue is a result of the inclusion of typeahead.jquery.js, which is changing the properties of the search field, here: plots2/app/views/editor/rich.html.erb Line 7 in ba05350
When I check the documentation it seems to only be a "standalone UI view", so I do not think it is actually essential to the tags module which still works once I remove it. If no one else has this task currently claimed on GCI, I will submit a PR tomorrow with more detail on my findings. |
Hi @kevinzluo, this issue is currently available as it is abandoned by 2 students. So, you can surely submit a PR to address this issue. Thank you!! |
Please describe the problem (or idea)
The auto complete is not working on search input on https://publiclab.org/post page
We are preparing to participate in Google Code-in, and have reserved this issue for participants in GCI - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.
The text was updated successfully, but these errors were encountered: