HTML / Javascript only recursive search? - javascript

I posted on a wishlist of a JS library that I wish their documentation search included results from more than just the titles of the pages. After I posted I realized that that may be difficult since when users download it from Github and use the docs on their local machine there is no server side code that will run such as PHP that could traverse the filesystem and parse all the results into an array, but before I just assume that there isn't a way to do it I thought I would ask.
When you look at this link: http://threejs.org/docs/index.html#Manual/Introduction/Creating_a_scene
If you type in anything that isn't part of the list on the left, it won't show up, such as if you type in goal nothing shows even though in the first sentence it says The goal of this section. Is there a way to put together a JS search that would traverse all the files that are on the list put the text into an array that could be searched without server side code?
I know Jquery would probably make the job easier, but I doubt he would include that in his repository, so as plain vanilla JS as possible would be preferred.

Related

How to implement fulltext search for offline website

I need a client-side fulltext search for big offline website. The site is opened by browser. I've made a research and found some solutions - fullproof, fuse.js, flexsearch.js, elasticlunr.js. I searched for js libs, because as i inderstand, it's the single solution (please correct me if i'm wrong).
Also i can't clearly understand some moments:
As i know, browsers due to security policy block all scripts' execution from javascripts files. I couldn't run examples from fullproof git because of this problem, but i managed to run flexsearch example, because script execution was included in html code with tag. Can i implement some search system for my local website because i don't use any local server for hosting (like xampp)?
From documentation for different js libs i undestand, that all they use for indexing either variable with list of key words or json file. Maybe i have a luck of information, but how i can use search system to find words/expressions from the whole website (it has a main page and a lot of included pages with information)? Do i have to create some sort of database or some json file?
I'll be very grateful for your answers, explanations, solutions or maybe examples about this problem, thank you!
Try using Tipuesearch, they have a very simple mechanism for implementing offline search in your website...Visit their site, download al lrequired repositories and follow the instructions to add the search functionality to your website...
I have implemented it with success in a sample movie website i was designing and the searches can be modified to come with images...
https://directory.fsf.org/wiki/Tipue-Search
Firts of all, browsers doesn't block js scripts execution. Secondly, i managed to find two ways to solve my problem - keywords search and fulltext search: 1) I created a database with keywords (json file) and used flexsearch library to search in this database. Example of usage u can find on their website, either an example of json file. 2) This time i created a database (json file), in which one recording is a text content of a website. Then again i used flexsearch to find a word in this database. After appropriate site was found, it opened up and the searched word was highlighted (u can find such js libraries in net). All the solutions don't require any internet connection and can be used for offline websites.

WebApp for Audio

I would like to build a webapp for audio „confoguration“. The basics are clear for me but there‘s one point I don‘t know how to accomplish it:
There will be several aufio files uploaded and included in the user dashboard. The user can see the files listed in their dashboard and should be now able to grab and drop them in a new space at the end of the site. After that they can export the whole new file. So out of 5 single audio files will be generated 1 whole file.
sorry.. do you get what I mean?
Thanks for your help!
You could use something like jQuery sortables in order to create the lists in your dashboard. Take a look here https://jqueryui.com/sortable/#connect-lists .
In case you don't want to use jQuery in your project, a search for "js sortable lists" should provide you with plenty other solutions.
In case I understood your question wrong and you are asking how to concatenate audio files, you may want to check out m4tthumphrey's ConcatAudioFilter https://gist.github.com/m4tthumphrey/a863aa64dd541cfb4472 to get an idea how this may be achieved.
(I assume you are using php serverside, as the post is tagged with php)
If you are asking about combining 5 audio files in one file. You can use ffmpeg. You can check the link, this is the node module for ffmpeg: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg.

How to I turn a python script into a web app?

Sorry for the noob question, but I created a script that web scrapes data off our sccm server and compares it to programs that need to be pushed to hostnames.
My script works perfectly when I run it in pycharm, but I would now like to make this program available to the other guys on my team via webpage, instead of them needing to borrow my computer everytime, LOL!
Is there a way I can use a javascript front end to let them enter their username, password and serial number, and than based off that info run my script?
I'm not a programmer to be honest so I apologize if this seems like a straightforward thing.
This would be difficult for someone to just 'answer' but maybe a rough outline could help?
I'm certainly no professional but this is the way I might approach the issue.
create HTML/CSS/JS front end page with a form
upon clicking the 'submit' button have the JS take form data and export it into a JSON (just did a quick search on 'execute python script on button click' and things like that to find some implementations of the idea)
pass the JSON from the page onto the server and have the python script open up the JSON for the arguments it needs to use
python 'wraps' the results up into a JSON file and gives it back to the front end where you have another JS script that unpacks the JSON file and gives it to the user requesting the info. Alternatively, you could have Python put the data into some sort of excel sheet or csv or whatever and have python email the results to the user.
Once all done you'd simply have an instance of Python and all the appropriate libraries sitting on the server ready to use. Pycharm is simply an editor for code. You could theoretically install python itself, and the appropriate libraries needed for your code and just give your folks the .py file itself and have them run the script out of CMD/Terminal and achieve the same result.
Like I say, no professional by any means, and I'm sure I skipped a couple steps but that's a general outline. Obviously in the forms you'd wanna have validation and such to make sure the appropriate data gets used to avoid errors.

Skeleton website that will parse external file and display in HTML

I am creating a website that is meant to be a sort of user start guide with an introduction page, an overview page, and a page featuring the actual guide which will feature step-by-step instructions for the user to follow. Since I don't have the specific content for the page, I'm " hard coding" the HTML with placeholder text. Going forward, I want to create a skeleton HTML framework that will parse the start guide files JavaScript and display the information on the page in its expected place. I'm strongly considering using XML (or JSON) files and parsing it with JavaScript and using browser DOM methods because that's what I know. However, I'm working on a team of people who most likely won't know how to convert the start guides (which are PDFs) into well-formed XML so I'm wondering, are there any alternative ways to do this? I know Word has the ability to save documents as HTML and XML but they don't create the proper attributes/tags to be parsed with the JavaScript I'd write.
TLDR: Are there files or alternative methods other than JSON and XML (something that non-tech savvy people will understand) that can be parsed and processed with JavaScript to display in a skeleton website?

Accessing Local Files with jQuery

I believe that this question has been asked in a few different forms, but I've read quite a few different responses.
At first, I had a web-application written with mostly jQuery that would make use of servlets to retrieve information from various locations JavaScript could not access (ie. Feeds, images from a server, etc.). Now, however, I've been told to do away with the servlets and application configuration classes so that this project of mine contains only HTML, CSS, and JavaScript/jQuery. Rather than pulling the images off of the server, I need to retrieve them from a local file on the computer. I know that allowing this might seem like terrible design, but it's what I've been asked to do. At any rate, what I really need to do is count the number of image files in a directory and then perhaps compile an array of the filenames themselves. I could do this fine in Java when using the servlets, but without them, I'm not sure how or even if this can be done.
I'm basically trying to use the jQuery Cycle plug-in to cycle through these images like a slideshow. I inject (or $("#div").append()) these images into the div by using a loop based on the number of images present.
So, is there a way I can do this with using JavaScript, HTML, jQuery plug-in, etc? I'd like to avoid using PHP and Java at this point...
You can't just read a directory with JavaScript; however, there appears to be a way to "exploit" how browsers function using http://www.irt.org/articles/js014/. It may not be pretty, but the demo works in the latest Chrome and IE7-9 for me. I'm sure some of the techniques could be updated to use cleaner code if you'd like to improve upon it.
EDIT:
Another technique you could use can be found in Javascript read files in folder
It definitely looks to be a cleaner solution. What I'd recommend is extracting the body contents to inject into a hidden div or using the path for an iframe that you can read from.

Categories

Resources