View Full Version : How do i insert javascript into all my sites

12-26-2005, 04:25 PM

I've builded a Web Photo Album and trying to put some proctection over my images by disabling the right click. I've tried with one page/image and it works fine.
Now, is there a function or tools that i can run for it to insert the javascript(disabling the right click) into every sites/images automatically without me manually going into each and every one to add-in the script ??


Creative Insanity
12-26-2005, 05:47 PM
1. disabling right click does not work.
Once people view your site your images are in their cache anyway.
2. No right click is easy to get around if anyone really wants them.
They can view source and grab from there or just click and drag the image to the title bar.
Placed them in a swf file.

12-26-2005, 07:44 PM
thanks for the reply and suggestion. Never thought of Flash, as i'm not familiar with it. I'll give it a go but it will probably take some time.
At the mean time, can i insert a line of code into all my pages in a batch run or some simple functions like "insert and update all" ??
Just wanna know if its possible in Dreamweaver or any workaround ??


12-28-2005, 08:00 AM
php has built in functions for creating flash movies. You would never be able to create an award winning flash site using these functions but i am sure you could use them to dynamicaly suck in your images and generate a SWF file with it

You need the libswf library to compile PHP with support for this extension. You can download libswf at

ftp://ftp.sgi.com/sgi/graphics/grafica/flash ('ftp://ftp.sgi.com/sgi/graphics/grafica/flash').

function ref...
swf_actiongeturl - Get a URL from a Shockwave Flash movie
swf_actiongotoframe - Play a frame and then stop
swf_actiongotolabel - Display a frame with the specified label
swf_actionnextframe - Go foward one frame
swf_actionplay - Start playing the flash movie from the current frame
swf_actionprevframe - Go backwards one frame
swf_actionsettarget - Set the context for actions
swf_actionstop - Stop playing the flash movie at the current frame
swf_actiontogglequality - Toggle between low and high quality
swf_actionwaitforframe - Skip actions if a frame has not been loaded
swf_addbuttonrecord - Controls location, appearance and active area of the current button
swf_addcolor - Set the global add color to the rgba value specified
swf_closefile - Close the current Shockwave Flash file
swf_definebitmap - Define a bitmap
swf_definefont - Defines a font
swf_defineline - Define a line
swf_definepoly - Define a polygon
swf_definerect - Define a rectangle
swf_definetext - Define a text string
swf_endbutton - End the definition of the current button
swf_enddoaction - End the current action
swf_endshape - Completes the definition of the current shape
swf_endsymbol - End the definition of a symbol
swf_fontsize - Change the font size
swf_fontslant - Set the font slant
swf_fonttracking - Set the current font tracking
swf_getbitmapinfo - Get information about a bitmap
swf_getfontinfo - The height in pixels of a capital A and a lowercase x
swf_getframe - Get the frame number of the current frame
swf_labelframe - Label the current frame
swf_lookat - Define a viewing transformation
swf_modifyobject - Modify an object
swf_mulcolor - Sets the global multiply color to the rgba value specified
swf_nextid - Returns the next free object id
swf_oncondition - Describe a transition used to trigger an action list
swf_openfile - Open a new Shockwave Flash file
swf_ortho2 - Defines 2D orthographic mapping of user coordinates onto the current viewport
swf_ortho - Defines an orthographic mapping of user coordinates onto the current viewport
swf_perspective - Define a perspective projection transformation
swf_placeobject - Place an object onto the screen
swf_polarview - Define the viewer's position with polar coordinates
swf_popmatrix - Restore a previous transformation matrix
swf_posround - Enables or Disables the rounding of the translation when objects are placed or moved
swf_pushmatrix - Push the current transformation matrix back unto the stack
swf_removeobject - Remove an object
swf_rotate - Rotate the current transformation
swf_scale - Scale the current transformation
swf_setfont - Change the current font
swf_setframe - Switch to a specified frame
swf_shapearc - Draw a circular arc
swf_shapecurveto3 - Draw a cubic bezier curve
swf_shapecurveto - Draw a quadratic bezier curve between two points
swf_shapefillbitmapclip - Set current fill mode to clipped bitmap
swf_shapefillbitmaptile - Set current fill mode to tiled bitmap
swf_shapefilloff - Turns off filling
swf_shapefillsolid - Set the current fill style to the specified color
swf_shapelinesolid - Set the current line style
swf_shapelineto - Draw a line
swf_shapemoveto - Move the current position
swf_showframe - Display the current frame
swf_startbutton - Start the definition of a button
swf_startdoaction - Start a description of an action list for the current frame
swf_startshape - Start a complex shape
swf_startsymbol - Define a symbol
swf_textwidth - Get the width of a string
swf_translate - Translate the current transformations
swf_viewport - Select an area for future drawing

12-28-2005, 05:43 PM
but how do you put javascript on all of your pages

12-29-2005, 09:38 AM
but how do you put javascript on all of your pages

im sorry. I think those replies were a little too advanced

can you add a little more to your question as i am lost

12-29-2005, 07:30 PM
if you wanted to add a script to a page but have it on all the pages in the same place how would you do that instead of going through each page and adding the script

Creative Insanity
12-29-2005, 07:36 PM
In the same location? Hmm.. is there any program that can do that?
Since you are not searching or replacing anything there is no way that I can see this can be done.

12-29-2005, 07:44 PM

Sorry, maybe my title is abit misleading. Let's start over again, i've builded a photo gallery and the photo gallery is in a slide show format where there is two main navigation button, Previous and Next. So that means every image/photo has its own html file which is navigated by the Previous and Next button. The photo gallery has around 50 images and each images has its own html file. So i got around 50 html files.

Is to disable the right click (to disallow save). It may not be full prove but this is good enough until i get the Flash running.

Javascript to disable the right click.
<script language="javascript" src="../disable.js"> </script>

Does Dreamweaver has a function that can insert the above code into all 50 html in one go instead of doing one html at a time ??

12-29-2005, 07:51 PM
didnt see the reply.. so i guess, the answer to my question is No. Thanks..
Gotta get the Flash up then...:)

Creative Insanity
12-29-2005, 07:57 PM
I am going to say no, but rj would know more about this since he knows more about DW than anyone here.
Since there is only a find - replace in the Ctrl +F option I am convinced the answer is no.

12-29-2005, 08:38 PM
and your plan is faulty as well :)
Most people I know do File->Save..

12-30-2005, 09:55 AM
so basically there is no answer to add javascript to all images/pages :angry: without replacing anything-how that sucks :ph34r:

12-30-2005, 12:46 PM
Dreamweaver templates were created for sitewide consistencies like that.