How to check if mootools.js is actually being used within a web site? - mootools

I inherited a web site project that includes mootools.js (about 40k) in most of the scripts. However, I have not seen, intuitively, where it is being used and given the nature of this porject, ahem, I'm thinking it might not be being used at all!
I'm "under the gun" to ship this tonight (yup, it's a pre-Thanksgiving release). I have not used mootools.js so I'm not sure what to grep for or if there's a sure tell way to determine this. I don't want to have to JSLint it (or do I LOL). Any suggestions would be appreciated. Thanks.

Mootools grafts itself onto some of the native js stuff, so it might be hard to do just by code inspection unless you are very familiar with what MooTools gives you.
Remove it, run your automated tests.
Cause you have those, right?...

Remove it and see if anyone complains.
(You could try it on a test machine first, if you're not feeling brave.)

You can check your source code on some MooTools methods, for example, addEvent().
If it is used so here is the Mootols :)
Just check from the home page of http://mootools.net/
I also was interested on one site why they use jquery and mootools. So, I found addEvent() method. It is Mootols method.

You must have a dev version of the site. Just pull it out and go over pages see if stuff breaks. Mostly you will get unknown function type stuff, if there is any dependencies. Firebug is your friend.

1, Open firebug
2, Click the DOM tab
3, Check if the Mootools object exists (It will say the current version of mootools next to it).
Hope this helps
:)

Related

VS Code - HTML - Emmett Intellisense doesn't seem to be working as expected

I'm attempting to learn web development, and I'm taking an online course from udemy. I am still in the html coding stage and I don't get the correct attributes auto suggested when I type in "form" (without the quotes). I get this:
When the instructor does it, this is the result:
I'm certain I used to get the result the instructor got, but I don't now. I rolled back to version 1.33 of VS Code but that didn't help.
Any suggestions? I appreciate any and all help you can provide but please don't assume I can navigate to whatever setting needs to be changed Please provide the full path to allow me to get there! Thanks again.
So I just downloaded and installed Atom. When you type form and hit tab you get three attributes: class, action and method. I wonder why the defaults are different between the two editors. I prefer VS Code just for the visual appearance of it, and it seems to be the one everyone uses, but why the difference and is there a way to make them the same?

How to block people from viewing source code?

So I take this class, and I'm way ahead of everyone else and a lot of people steal code from my website, I have already disabled right clicking but it's rather easy to get around this, is their any way to stop people from being able to view my source code?
tl;dr: Nope.
You could look into obfuscation, as well as CSS & JS minification.
"If you steal from one author, it’s plagiarism; Steal from many, it’s art."
No, if someone wants it, they will get it, you can make it harder but, you will just alienate your users from normal functionality, focus on your backend code.
If they steal your code, your lector will hopefully notice, either way they only hurt themselves.
Afaik the only way to hide your source code is if you put it on the server-side.
It is not possible from hiding client-side source code from users - sorry.
One suggestion would be stopping the user from right-clicking but that might cause you more problems...
You could render the html pages server side and convert them into images which get sent to the client. You could then have some image maps that handle clicking on the various locations.
There isn't a perfect solution (100% bullet proof) to protect your JavaScript code on the client side, however there are some tools on the market that can help you to protect your code:
Code Compression/Minification (Usually don't protect the code)
Google Closure (Free)
Uglify JS (Free)
Code Obfuscation/Compression/Minification
JScrambler (Paid, but is on my opinion the best one on the market)
Jasob (Paid)
Stunnix (Paid, it seems to be outdated)
Hope this answers your question!

Anyone familiar with Vimeo? Trouble with js_onLoad, broken?

Hi all I was trying to get the vimeo "swfobject.html" example from git hub to work, but it simply doesn't work # github.com/vimeo/vimeo-api-examples/blob/master/moogaloop-api/javascript/swfobject.html
I debugged a bit, and realized it doesn't even enter the "js_onLoad" function. Does anyone know if this github code dated or is js_onLoad deprecated? I'm just trying to do a simple example of displaying the alert "hi" after the player is loaded, but I can't even get that far.
My very simple sample code is here: http://pastie.org/1110855. Does anyone see a problem?
Any fellow stackoverflowers versed in vimeo JS API? Cheers
I feel your pain. There's a bunch of inconsistent information about the vimeo API out there. But there are still parts that work. Check out the API Playground which works and demonstrates clearly how to do all sorts of useful things. The source code is on github. You can take apart the playground.html file and just leave in the parts that you need.
Important caveat about the playground.html file -- it doesn't work (for me) when running off a file:/// URL. It has to be coming off an http server to function at all. HTH.
I consider myself a bit of an expert on the Vimeo JS API. Their documentation and demo's are very poor, so I put together this little demo that I think it much easier to follow. It users jQuery and the iFrame embed method, but hopefully it helps:
http://labs.funkhausdesign.com/examples/vimeo/froogaloop2-api-basics.html
It shows how to listen for an event and fire a method.
After several experiments, it seems that events are only fired with the HTML5 version of the embed, not with the Flash version.
As the Universal Embed code (iframe) automatically selects the technology, I believe that the best way to go is to avoid using it and make your own embed.

track and display changes in html

I am looking for a tool to display/track changes in text a little bit like it is done on stackoverflow when a question is edited. Does anybody know of a tool to achieve that?
You may want to use diff for that.
If you can use PHP on your server there's a handy pear package to perform the task you require. Here's an example :
https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6174867.html
There's actually a actually Javascript implementations outhere as well, not tested though:
http://ejohn.org/projects/javascript-diff-algorithm/
http://aignes.net/
Commercial tool though. I have no idea of a F/OSS alternative.
A copy of my own answer from here.
What about DaisyDiff (Java and PHP vesions available).
Following features are really nice:
Works with badly formed HTML that can be found "in the wild".
The diffing is more specialized in HTML than XML tree differs. Changing part of a text node will not cause the entire node to be changed.
In addition to the default visual diff, HTML source can be diffed coherently.
Provides easy to understand descriptions of the changes.
The default GUI allows easy browsing of the modifications through keyboard shortcuts and links.

Simplest requested change that is complicated to implement?

I'm curious what change requests, from testers, clients, or managers, programmers have encountered that seemed really simple but were in fact really complicated.
Could you add an undo button? (To a custom WYSIWYG editor).
Back in my college days I worked on a side project for a client. It was a medium sized Win32 desktop application to do some 2D diagramming and every step of the way and every demo was great. The client liked it. Finally, I was ready to deliver it and be done when they asked if I could just make it run on the web first.
Classic "missing-requirement-kills-project" scenario.
How about adding a GUI to this command line app?
One thing I've hit was being asked to change a word in the title of a window. However, the title of the window was in fact localized in a library and was shared with several applications. Changing it's title in either title would mean either changing where it grabbed the data (ugly and inconsistent with the rest of the code), changing the dll (will impact other software), or adding a hard-coded fix (hacky).
"I'd like to use Oracle instead of SQLServer for the database."
"can you make it bigger?" in reference to the sizing of radio buttons.. back before CSS
"just make it more webbish"