Category Archives: CSS3

Ribbon JS 4.2.0 is Out

I’ve just released a new minor version of Ribbon JS, introducing several new methods, a new event and API interface for setting declarative discrete data to tools, commands and tabs (setting/getting of this data is also available through the new ribbon methods and returned by some of the events of the control). Check the demo of the discrete data setting here.

Release Notes:

  • Version 4.2.0 is fully compatible with versions 4.0.0 and above.
  • Optional tool/command/tab property: props – Ribbon JS now allows the setting of discrete custom properties to tabs, tools and commands. These properties can be set either in the configuration of a tool or tab (the props key) or set/get via the setToolProps, getToolProps, getTabProps and setTabProps methods of the ribbon. The data of the prop keys is returned also by the events, triggered by the ribbon.
  • Method getReleaseNotes() – Programmatically open ribbonjs.com/release-notes and display the release notes of the current version of Ribbon JS.
  • Method getToolData(name) – Get the data associated with the queried tool by it’s name.
  • Method setToolProps(name, key, value) – Set the optional props key (check the Ribbon JS configuration documentation) to a tool/command definition for more info about this key. The required parameters are tool/command name (String) of the tool/command, key (String or Number) name and value (Any).
  • Method getToolProps(name) – Get the props object, associated with a tool or command.
  • Method getTabProps(name) – Get the props object, associated with a tab, queried by its name.
  • Method setTabProps(name, key, value) – Set the optional props key ( check the Ribbon JS configuration documentation) to a tab for more info about this key. The required parameters are tab name (String) of the tool/command, key (String or Number) name and value (Any).
  • Event: “acidjs-ribbon-toggle” – The event is triggered when tab button is clicked (in this case the event always returns {expanded: true}) or when the ribbon is collapsed or expanded either by clicking the expand/collapse button in the top right corner of the control or programmatically via the expand() and collapse() methods.

About Ribbon JS:

Ribbon JS is arguably the best recreation of the MS Officetm ribbon bar, using JavaScript, CSS3, and HTML5. It is a lightweight control, which is ready to use on websites, web-based WYSIWYG editors, sophisticated back-end systems, mail applications, complex file managers, and JavaScript-heavy apps. It has everything you would expect from a ribbon bar – comprehensive and fully documented API, amazing command handling, huge set of inbuilt tools, capability to add custom tools via client-side templates, cool looks and is also available optionally wrapped as a full-blown HTML5 WebComponent. Last but not least, it only takes a few minutes to deploy, configure, and run.

ribbon.js.scr

Screenshots:

ribbonjs.4.1.0

Discounted Ribbon JS Licenses Until Mid-March

Are you planning to purchase a license for Ribbon JS? Now is the time – until mid-March 2015, all licenses are sold at serious discounted price, so get one today.

ribbon.js.scr

Ribbon JS is arguably the best recreation of the MS Officetm ribbon bar, using JavaScript, CSS3, and HTML5. It is a lightweight control, which is ready to use on websites, web-based WYSIWYG editors, sophisticated back-end systems, mail applications, complex file managers, and JavaScript-heavy apps. It has everything you would expect from a ribbon bar – comprehensive and fully documented API, amazing command handling, huge set of inbuilt tools, capability to add custom tools via client-side templates, cool looks and is also available optionally wrapped as a full-blown HTML5 WebComponent. Last but not least, it only takes a few minutes to deploy, configure, and run.

Ribbon JS 4.1.0 is Out

I’ve just released a new minor version for Ribbon JS introducing a couple of new features, properties and methods. The new version is fully backwards compatible with the previous versions of the control (4.0.0 and above), so it is safe to upgrade. The HTML5 Web Component for Ribbon JS has also been updated to support the latest additions.

ribbon.js.scr

Release Notes

  • New highlightTabsGroup method, allowing contextual tab grouping. The method supports custom colors and labels.
  • New unhighlightTabsGroup method, which removes a tab group, set via the highlightTabsGroup method.
  • New enableFlatStyles method, allowing to set flat (Metro) look and feel to the ribbon.
  • New disableFlatStyles method, setting back the classic (pre Office 2013) styles to the ribbon.
  • New appIconUrl property, set in the constructor of a ribbon, allowing custom top left application icon. The property is optional, and the default icon is the HTML5 badge.
  • New flat property (optional, Boolean), set in the constructor of a ribbon. If set to true applies flat (Metro) look and feel to the ribbon. Its default value is false.

Screenshots

ribbonjs.4.1.0

Ribbon JS is arguably the best recreation of the MS Officetm ribbon bar, using JavaScript, CSS3, and HTML5. It is a lightweight control, which is ready to use on websites, web-based WYSIWYG editors, sophisticated back-end systems, mail applications, complex file managers, and JavaScript-heavy apps. It has everything you would expect from a ribbon bar – comprehensive and fully documented API, amazing command handling, huge set of inbuilt tools, capability to add custom tools via client-side templates, cool looks and is also available optionally wrapped as a full-blown HTML5 WebComponent. Last but not least, it only takes a few minutes to deploy, configure, and run.

 

Tic-Tac-Toe Game Recreated as a HTML5 Web Component

Last night I finished my latest experiment in recreating the classic Tic-Tac-Toe game as a HTML5 Web Component. Here’s the result and a few details:

  • Two players take turns on the same computer. The next version will support one player vs. the computer.
  • Game lobby for selecting player names.
  • No images or JavaScript animations, CSS3 stuff only.
  • Small API.
  • Custom events, allowing the game to exchange data on the network or notify/interact by/with other components/controls on the page.
  • Localizable via inline JSON (check the code listing below).
  • Support for 3 board sizes.
  • Allowing multiple instances.

tic.tac.toe

The Markup

<acidjs-xticatactoe x="Martin" o="James"></acidjs-xticatactoe>
<acidjs-xticatactoe debug="true" size="large"></acidjs-xticatactoe>
<acidjs-xticatactoe size="small"></acidjs-xticatactoe>
<acidjs-xticatactoe debug="true">
    <code hidden>
    {
        "yourTurn": "du bist dran!",
        "startNewGame": "Neues Spiel starten",
        "start": "Start!",
        "playerXName": "Spieler X Name",
        "playerOName": "Spieler O Name",
        "choosePlayerXName": "Wählen Sie Name für Spieler X",
        "choosePlayerOName": "Wählen Sie Name für Spieler O",
        "youWin": "Sie gewinnen!",
        "draw": "Unentschieden :("
    }
    </code>
</acidjs-xticatactoe>

HTML Attributes

Apart from the standard HTML attributes (style, class, id, etc.), the tag also supports the following component-specific attributes:

  • x – Optional name for the “x” player. Default: "Tic".
  • o – Optional name for the “o” player. Default: "Tac".
  • debug – Optional. If set to true, the component will output console messages. Default Default: "false".
  • size – Optional size of the board. Default: "medium". Other possible values are "small" and "large".

JavaScript API

All standard JavaScript methods are supported, plus the component-specific:

  • init() – Initialize the game.
  • restart() – Restart the game (an alias of the init() method).
  • destroy() – Destroy the game and remove the board.

Events

The component publishes the following custom events, returning event and game-specific data. The distribution, which could be downloaded from this link contains these event bindings, so you can use your browser’s console to see what data is returned upon firing those events.

  • ttt:ready – Fired when game is ready to play.
  • ttt:win – Fired when game is a win.
  • ttt:draw – Fired when game is a draw.
  • ttt:playing – Fired upon user action.

Enjoy the weekend! If you share the same interest towards HTML5 Web Components as I do these days, make sure you read my relevant blog posts and further endeavors on my HTML5, CSS3 and JavaScript Experiments and Insight website.

Ebook Reader HTML5 Web Component

Inspired by this awesome solution, I just released a new HTML5 Web Component, recreating the layout and controls of e-book readers. Enter the X-Reader.

thumb

The Markup

<acidjs-xreader id="book-1" booktitle="A Clockwork Orange" author="Anthony Burgess" source="books/a-clockwork-orange.html"></acidjs-xreader>
<acidjs-xreader id="book-2" booktitle="Nineteen Eighty-Four" author="George Orwell" controls width="800" height="600" source="books/nineteen-eighty-four.html"></acidjs-xreader>
<acidjs-xreader id="book-3" width="320" height="240" defaultpage="1" source="books/lorem.html"></acidjs-xreader>

HTML Attributes

Apart from the standard HTML attributes (style, class, id, etc.), the tag also supports the following component-specific attributes:

  • source – Required. Book source.
  • booktitle – Optional. Book title.
  • author – Optional. Book author.
  • controls – Optional. If set, the paging controls will be displayed by default.
  • width – Optional width in pixels of the component. Default: 640.
  • height – Optional height in pixels of the component. Default: 480.
  • defaultpage – Optional default page. Default: 0.

JavaScript Methods, Getters, Setters and Custom Events

All standard JavaScript methods are supported, plus the component-specific:

  • getData() – Returns the data object, associated with the queried component.

If you share the same interest towards HTML5 Web Components as I do these days, make sure you read my relevant blog posts and further endeavors on my HTML5, CSS3 and JavaScript Experiments and Insight website.