HTML, CSS, JS and other unsorted stuff

Archive: May 2012

Opera 12 release date

,

Originally posted by desktopteam:

We are getting close to the first 12.00 Release Candidate (...)

Source

My guess:
Before June, I'd say RC1 at the 26th ...

What do you think?

Buttonator 0.9.28 - Opera button generator reloaded

, , ,

ButtOnator - the Opera button generator updated with the new actions and skin icon codes of Opera 12.

With the buttonator you can build normal Opera buttons that contain the built in button actions - but that's not all:

You can insert bookmarklets or normal formatted JavaScript as first parameter. The buttonator will strip all superfluous whitespace while preserving literal strings and escape nested quotes like
" 'foo' " or ' "foo" '
and problematic characters in a way that it doesn't break the button code.

You can click on the '>>' to view and select one of the available icons.

The buttonator builds the code as soon as you put the focus outside the input fields or switch to another field. You get 4 versions of the button code:
  1. Direct install code. Just click on the preview or drag and drop it to the toolbar of your liking, done.
  2. BB Code to set links in the most common forums (like the my.opera forums too)
  3. Normal Link code <a href etc. for normal webpages.
  4. A buttonator link if you want to provide the option to edit the button



You can either use the button generator from my private website online or you can save the HTML file and use it locally. Everything is contained in a single HTML file. smile

Print with Internet Explorer right from Opera

,

Printing in Opera, bØrked since 1997.

Exaggerated? Yes, but not much. Printing is one of weakest points of Opera - at least in Opera for Windows (no *x or M* here, sorry)

A member of the my.opera community asked me, if I could write an extension, that opens the Internet Explorer for printing web pages (yes, the Internet Explorer can indeed print websites) but I had to decline the request for two reasons:
I am not that good in writing extensions and, what is more important, extensions, as they are now, can't do that.

But Opera wouldn't be Opera without the nice hackish solution for (almost) all kinds of problems: Buttons.

... but there is another problem:
The Internet Explorer doesn't support a print command in it's command line, so the button needs some help from a little VBScript file.



Part one of the hack: The Button

The button will not work without the VBS file in the right place!
Print in IE <-click to install the the button and drag and drop it to the toolbar of your liking.

Button code in human readable form:
opera:/button/Execute Program,"iexplore","%u","Print in IE","Print Document"&Delay,2000&Execute Program,"ie_print_preview_v01.vbs"


Part two of the hack: The VBScript

Copy the following, paste it into Notepad or any other text editor of your choice and save it as
ie_print_preview_v01.vbs
in the "Windows" folder of your system. To do this, open the Explorer, type %windir% into the address bar and hit the enter key, or navigate to the windows folder by clicking. The folder is usually called C:\WINDOWS)

' VB Script Document
set WshShell = CreateObject("WScript.Shell")
WshShell.appactivate "iexplore"
WScript.Sleep 100
WshShell.SendKeys "%f"
WshShell.appactivate "iexplore"
WScript.Sleep 100
WshShell.SendKeys "v"

Parameters
  • "%f" stands for Alt+F (File) in the English version of the Internet Explorer, replace it by "%d" for Alt+D (Datei) in the German version or the appropriate letter that causes the same action in your system's language.
  • "v" works for the English and the German version, please change it to the correct letter for your system too.


How it works
Both parts work together by first opening the Internet Explorer with the web page, then waiting for 2s and then sending the keyboard shortcuts for print preview.

Modifications
If you want to save the VBS with a different name or need to modify the delay because your Internet Explorer starts too slow (someone told me that disabling Flash in IE helps wink) you need to modify the button too.

Here the buttOnator link for making your life easier smile
The "Delay" is in milliseconds, 1000ms = 1s
If you want to save the VBScript to another location or if you want to rename it, you must insert the whole path, e.g.:
D:\myhacksfolder\the_print_script.vbs
(do not change the .vbs file extension)

Thanks
to Unrealmirakulix for the question and a part of the VBS. smile


Some Opera Icons

,

I always had the problem to distinguish between the various Opera installs on my computer, so I decided to make some slightly cusomized icons I can use for shortcuts instead of the original icons.



The icons come in sizes from 16*16px up to 256*256px with color resolutions from 16 colors (does anyone still use that confused ) to true color.

Download: opera-icons.zip 877KB

In Windows:
  1. Unzip the zip to a folder where you can find again.
  2. Right-click on each opera.exe you want to start.
  3. Choose Send to Desktop or Create Shortcut.
  4. Right-click the new shortcut icon on the desktop.
  5. Select Properties > Change icon.
  6. Browse to Browse to the icon (.ico) file you want to use in the folder you created in step 1.

How to make an extension that does all of this?

, ,

1. The extension should do something with a webpage by the means of an injected script.

2. The injected script should start
  1. on click of a button
  2. on keyboard shortcut
  3. on mouse gesture (optional, if the user wants to set up a gesture)


3. The extension should have
  1. an options page for the more complicated settings
  2. a help page for all people who need to read up what some of the settings could mean
  3. a popup for live settings


4. The popup should
  1. not open on the normal click that starts the injected script
  2. be able to change some preferences


5. The preferences' changes in the popup should be
  1. applied to page without the need to reload the page.
  2. saved to the extension's preferences, as soon as the popup closes (or live, if possible).


6. The preferences set in the options page or the popup should be applied even when the extension's injected script is started by keyboard or mouse gesture.

Read more...