Trouble finding a document in my FTP using Chrome/Inspect Element - javascript

My FTP
Currently looking through my directory of my site build. I'm hoping to edit a LINK , but having trouble finding where the actual pages to edit are.
I can find the link that needs editing (using Chrome/Inspect element) but unable to find the actual document in my FTP. Is there a tab or location that will show me the actual name?
The 'SOURCES' Tab DOES show me file names but that file does not exist in my actual directory.
SOURCES TAB
Chrome/ Inspect Element
Any place I'm not looking?
Thank You!

The easiest way to find any code/link is to download all files in local system and use any IDE to perform "FIND ALL FILES". Following is the way how I tackle this:
Once you installed Notepad++ software, open the Notepad++.
Press Ctrl+F to open the Find and replace tool.
Open Find in files tab. Fill in the Find what: field and select the directory for the search (folder with your site files, template package, theme folder, etc.)
Click on Find all button.
You will see the files and lines with the text you were looking for.

Related

atom.io : Open Files via Clickable Links within Javascript Comments

Is there way, in Atom, to open files that are mentioned in comments?
When I edit a code file, there are often other code files of interest that I may want to also open while working on that file. Sometimes these reference files are miles away and require numerous steps of navigation to open them via the left-pane tree structure.
I was thinking, it would be nice if I could put relative file paths into javascript comments in a manner that atom would understand that if I click that path it should open that file in a new tab.
I suspect this isn't an original idea, so I'm hoping someone can direct me to a solution that enables this type of functionality or make me aware of how it is already enabled but I must use some syntax I'm not currently using.
I found open-project-file and it seems like a nice fit.
Update: I tested it and it works great! You just click on the relative path (whether it is located in code or comment) and by hitting ctrl-shift-o it immediately opens the file in a new tab within the atom editor.

Add folder to favorites and change folder icon [Electron macOS]

Since one week I'm looking for a solution to add a folder with a specific icon to the favorites sidebar (like Dropbox does it)
Is there any solution to do this with Electron or Objective C?
What I've found so far:
drag & drop it by yourself
fileicon
Programmatically add a folder to "Places" in Finder (don't know if I can extend electron)
Ok I've found this solution:
On macOS you can find this Folder
~/Library/Application Support/com.apple.sharedfilelist/
It contents some *.sfl files. You can edit them with this tool /usr/bin/sfltool. (It's installed on your mac >= 10.11 El Capitan automatically)
Example to add a folder to your favorites:
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///YOURPATH
I can run this command via require('child_process').exec in my electron app and add a folder icon with the fileicon module. (https://www.npmjs.com/package/fileicon)
This is a little bit dirty, but I don't know an other solution.
[UPDATE]: Read first comment
You can edit the sidebar on Mac using the com.apple.sidebarlists.plist preference file. The items will be in the favoriteitems dictionary.
The items you see are all set to being AlwaysVisible. You need to edit that file to add your own file.
I will give some links that might help you.
About the com.apple.sidebarlists.plist file,
http://www.thexlab.com/faqs/finder.html
Finding the com.apple.finder.plist,
https://discussions.apple.com/thread/4122582
Another post,
https://apple.stackexchange.com/questions/139305/how-can-i-add-new-folders-to-the-favorites-in-the-finder-sidebar

djangobyexample book - jquery bookmarklet not working at all

I'm working through Django By Example and in one chapter a jQuery bookmarklet is built within a Django app so that a user can easily save jpg images from a website into their user profile area within the Django app.
The tutorial does give exact instructions on what to do which I have followed and although I have managed to get the bookmarklet button to appear in my bookmarks bar in Chrome, nothing happens when I click it when browsing a webpage with jpg images.
This is my local Django dashboard where the bookmarklet button is added to the bookmarks bar and this part works fine
and this is how it must look like when clicked on the bookmarklet, this is the part where nothing happens for me when I clicked on bookmarklet.
(how to solve this?)
These are the relevant js files
https://github.com/davejonesbkk/bookmarks/blob/master/images/templates/bookmarklet_launcher.js
https://github.com/davejonesbkk/bookmarks/blob/master/images/static/js/bookmarklet.js
I believe the JavaScript launcher is unable to load the JavaScript files or the JS launcher itself is not getting loaded.
The JavaScript launcher is getting called through a Django template tag "include" inside the anchor tag.
this is the link:
https://github.com/davejonesbkk/bookmarks/blob/master/account/templates/account/dashboard.html
I tried debugging it through CTRL+SHIFT+I console where trouble showed that "include" tag not working properly.
Your include tag is split over two lines:
images from other websites → <a href="javascript:{% include
"bookmarklet_launcher.js" %}" class="button">Bookmark it</a><p>
Django does not support multiple line tags. Change it to:
images from other websites → Bookmark it<p>
I have faced the similar error while going through the book.
The bookmark button is not functioning,when i debugged it through chrome debugger,i could able to see errors at js level.I have made two changes to resolve these errors.
1.Error message: net::ERR_ABORTED
Action step:
In the book its mentioned that to place bookmarklet.js in images application directory,but in bookmarklet_launcher.js the source is refered to below path
http://127.0.0.1:8000/static/js/bookmarklet.js?r=
So place bookmarklet.js in /static/js/ directory inside images application(if folder structure not available create it).
2.Error message: net::ERR_ABORTED
There is one more file that should be placed which is bookmarklet.css which is being refereed at below line in bookmarklet.js.
href: static_url + 'css/bookmarklet.css?r=' + Math.floor(Math.random()*99999999999999999999)
Action step:
create a file bookmarklet.css inside /static/css/ directory and place the css code.Refer below link for css code:
Git Hub link for css code reference
1.After the above steps,restart the development server.
2.Drag the bookmark it button to create a bookmark in browser.
3.Open any website that is HTTP(not https) and click on bookmark it(The one which is bookmarked in browser not bookmark it button).
4.The below pop up appears
the problem is that template doesn't exist so try t do the following
**
1. make sure your include code in same line
2. make sure same name of the template exist on your project director /images/templates/file_name.js.
3. or go to setting and add your templates directory to templates.
4. if it load but no images views don't forget that you only accept jpeg and jpg images only
** so you can try another sites like wikipedia **
I was able to solve this by making sure that the url from ngrok tunnel in the bookmarklet.js and bookmarklet_luncher.js starts with https not http
Instead of this http://127.0.0.1:8000/static/js/bookmarklet.js?r= it should rather be
https://127.0.0.1:8000/static/js/bookmarklet.js?r=
After 4 hours of doing everything... googling, deleting code, and rewriting code...
Only had to hit Ctrl+C to stop server and re-run server .
Just take a break and come back to fix it :)
Mine works same as instructed in the book – no changes, no nothing.
Only restarted the server.

alfresco tag still in tagScope after deleting the file

I've a problem with the tags in alfresco. Here's the thing:
I create a file and add a tag within a script, then I copy that file in another folder. The tag tree count 2 files for the tag, so far it's ok. If I delete one or both files, the files are gone (obviously) but tags are still on the tree... I've tried to delete it with the tag managing tool in the admin console, I've tried to delete it in a script but nothing works, the tag is still in the tree with no files attached to it.
Anyone has something for that? I've search and found someone with the same problem but no solution...
I've finally found how to remove these tags. I put the answer here if someone has the same issue, I don't know if this solution is the best (there's probably something more elegant) but it works and after 2 days struggling with this that's all that matters to me :)
So I went to the node browser to find the node corresponding to my site, in the properties there tagScopeCache item that gives a path, I wrote this path and search for the node on the alfresco directory on the hard drive. I found the .bin file rename it in .txt so I was able to open it, inside there is the tag and the count for each of them. I've just delete the two tags which weren't in the site anymore. Then put the extension back to .bin and it works, tags are gone from the tree...

How to look at the Javascript that a page is using?

Are you able to see the coding of a Javascript function on a webpage your viewing? Is there a way using Google Chrome DevTools for example?
Specifically, I want to figure out how to code something like this
!Example 1
from this page
http://www.indeed.com/cmp/Bruce-Productions/jobs/Graphic-Designer-0a8d9cff06bf2790
Thanks in advance for any help!
Yes there is a way to look at all of a webpages html, Javascript files, and CSS using Chrome.
Open up the page in chrome, right click on the page and select inspect element (or press ctrl+shift+I).
From there you can navigate the different elements on the the page and the structure of the HTML file.
To get at the Javascript and CSS files switch over to the sources tab and look through the folders on the left to find the file you are looking for.
A word of warning, depending on the site the code that they are using may be minified (most all of the white space removed, and lots of variable names and other things shortened) or otherwise very difficult to read. If you are looking to do something more specific then I would recommend searching for that, or posting a question regarding that problem.
If you want to view the Javascript code, you can right-click the page, then select Inspect, then navigate to the javascript line by highlighting or selecting that line with .js extension and then position your pointer in the .js file, right-click & select Reveal in Sources panel.
In the browser you do right click to open a menu and select "View Source Code". Then you can read or save that page to analyze the content for any image or script.
But your question is so generic maybe you should try something basic and try to builds thing from there. Otherwise make a more specific question of what you want to do.
You can check it by opening the inspector in your browser and selecting the "coverage" menu. Then click on the "type" column until you find the .js files.
It is pretty much it, but you can read more details here: https://developer.chrome.com/docs/devtools/coverage/

Categories

Resources