Friday, 30. January 2009, 13:15:14
Basic Syntax for Creating Buttons
You can find the details on the Opera Wiki, but I will try to keep it simple to start with. To post a link in these forums that will create a button when dragged to a toolbar, use URL codes around button code like this:opera:/button/Command, parameter1, parameter2, Title, Icon
For example, the URL, opera:/button/Print document will create a link like this: Print
To add an alternative command to the button, use a plus sign followed by the second command:
opera:/button/Print document + Show print options to create this link: Print/Options
Clicking the button created by this link will show the print dialogue, while holding the button will show the Print Options dialogue.
Friday, 30. January 2009, 13:28:34
Use the > separator for alternate commands — that is, if the first is not currently valid, the second command will be executed. Combining this with the plus separator, we can have three different commands on one button:
A URL like this: opera:/button/Select author mode,,, -1291441751 > Select user mode,,, -2101137707 + Show popup menu, "Style Menu" will create this link: Style
The large number is the title of the button. This number can be found by searching the language file, e.g. english.lng, found in your Opera installation folder, where you will see that the text strings in English are “User Mode” and Author Mode. This button will therefore work in other languages too. The title of the button when be displayed in the tooltip when the user hovers the mouse cursor over the button.
We can change the button design to remove the drop down button by using “Show hidden popup menu” instead of “Show popup menu.”
Style With this button, there is no drop list, which saves space, but the user has to click and hold the button to show the hidden popup menu.
A URL like this: opera:/button/Select author mode,,, -1291441751 > Select user mode,,, -2101137707 + Show popup menu, "Style Menu" will create this link: Style
The large number is the title of the button. This number can be found by searching the language file, e.g. english.lng, found in your Opera installation folder, where you will see that the text strings in English are “User Mode” and Author Mode. This button will therefore work in other languages too. The title of the button when be displayed in the tooltip when the user hovers the mouse cursor over the button.
We can change the button design to remove the drop down button by using “Show hidden popup menu” instead of “Show popup menu.”
Style With this button, there is no drop list, which saves space, but the user has to click and hold the button to show the hidden popup menu.
Friday, 30. January 2009, 13:43:48
The icon is the fifth item in the button code. We can change the icon by using a different icon name.
opera:/button/Show preferences,20,,,"Panel History" + Go to page, "opera:cache" will create this button with the History panel icon.
This one, Cache uses the Spam icon.
Valid names to use for icons can be found in skin.ini for your current skin.
Please see: Your Skins Images for a full list.
opera:/button/Show preferences,20,,,"Panel History" + Go to page, "opera:cache" will create this button with the History panel icon.
This one, Cache uses the Spam icon.
Valid names to use for icons can be found in skin.ini for your current skin.
Please see: Your Skins Images for a full list.
Monday, 16. February 2009, 11:20:01 (edited)
How to add button with javascript
1) Convert a js-code to one line with packer or similar tools.
2) Replace «%» on «%%» (need for Opera), «javascript:» on «javascript%3A», «[» on «%5B», «]» on «%5D», «<» on «%3C», «>» on «%3E» and «#» on «%23» with button Convert js for button.
3) Insert button as usual «{url=opera:/button/Go to page, "javascript%3A...",,"Title","Icons"}Name{/url}».
Sample:
Source code for button. And button «Get Flash» what shows links on Flash and Flash-video.
1) Convert a js-code to one line with packer or similar tools.
2) Replace «%» on «%%» (need for Opera), «javascript:» on «javascript%3A», «[» on «%5B», «]» on «%5D», «<» on «%3C», «>» on «%3E» and «#» on «%23» with button Convert js for button.
3) Insert button as usual «{url=opera:/button/Go to page, "javascript%3A...",,"Title","Icons"}Name{/url}».
Sample:
Source code for button. And button «Get Flash» what shows links on Flash and Flash-video.
Saturday, 30. May 2009, 22:05:31
Hi
I want to add this play-high-quality-if-available.js to a button ? and if is posible toggle between
normal quiality and high quality
I want to add this play-high-quality-if-available.js to a button ? and if is posible toggle between
normal quiality and high quality
Forums » Custom Buttons for Opera » Custom Buttons » Button Syntax and Icons
