Icontem

JS Rulers Guides: Place and draw guides and rulers like Photoshop

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   Screenshots Screenshots   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2013-10-08 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 137 All time: 303 This week: 41Up
Version License JavaScript version Categories  
rulers-guides 1.0.0MIT/X Consortium ...1.0Utilities and Tools
Description Author  

This object can be used to place and draw guides and rulers like Photoshop.

It can render horizontal and vertical rulers that show coordinates in pixels on the page borders.

The user can drag guide lines from the rules in a similar way that works in Photoshop.

The user may toggle the visibility of rules and guides using special control keys.

Innovation Award  
JavaScript Programming Innovation award winner
September 2013
Winner
Guides are lines that are useful to align objects placed in a space.

This object can render guide lines that the user can drag them by clicking on rulers that are displayed on the side just like in the Photoshop program.

Manuel Lemos
Picture of Mark Rolich
Name: Mark Rolich <contact>
Classes: 11 packages by
Country: Armenia Armenia
Age: 34
All time rank: 161 in Armenia Armenia
Week rank: 29 Down1 in Armenia Armenia Equal
Innovation award
Innovation award
Nominee: 5x

Winner: 1x

Details provided by the author  
RulersGuides.js
=================

This Javascript package creates Photoshop-like guides and rulers interface on a web page.

<a href="http://mark-rolich.github.io/RulersGuides.js/" target="_blank"><strong>DEMO</strong></a>

Main window:

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/main.png" />

Menu:

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/menu.png" />

Guides are created by click-and-dragging corresponding horizontal or vertical ruler.
Guide position is shown while dragging and on mouse over.

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/guides.png" />

It is possible to open/save created guides as grids
(Note: grids will be saved on a page location basis, so it's not possible to use the same grids in another browser window/tab).

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/save_grid.png" />&nbsp;
<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/open_grid.png" />

Rulers can be unlocked, so that one of the rulers will scroll along the page and the other will be always visible.

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/unlock.png" />

Guides can be snapped to defined number of pixels.

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/snap_to.png" />

Detailed info mode is available, which shows position and size of regions created by the guides.
Works on guide position change too.

<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/detailed_info1.png" />
<img src="http://mark-rolich.github.io/RulersGuides.js/screenshots/detailed_info2.png" />

Guides can be snapped to DOM elements (experimental, use with caution, can be slow or unresponsive on complex pages with lots of elements).

Following hotkeys are available:

* Toggle rulers - `Ctrl + Alt + R`
* Toggle guides - `Ctrl + Alt + G`
* Toggle rulers and guides - `Ctrl + Alt + A`
* Clear all guides - `Ctrl + Alt + D`
* Save grid dialog - `Ctrl + Alt + S`
* Open grid dialog - `Ctrl + Alt + O`
* Lock/unlock rulers - `Ctrl + Alt + L`
* Open Snap to dialog - `Ctrl + Alt + C`
* Toggle detailed info - `Ctrl + Alt + I`
* Toggle snap to DOM - `Ctrl + Alt + E`

Look-and-feel can be adjusted using CSS.

RulersGuides.js is available as a bookmarklet, please see bookmarklet.js file provided with the package.

For IE users there is a bookmarklet_ie.js file, which loads necessary packages externally due to IE bookmark size restriction.

You can copy and include them locally by changing paths in the bookmarklet.

RulersGuides.js is available as an extension for Google Chrome browser, download it [here](http://mark-rolich.github.io/RulersGuides.js/RulersGuides.crx),
and drag and drop downloaded file to extensions tab (chrome://extensions).

RulersGuides.js requires Event.js and Dragdrop.js packages, which can be acquired at the following links:

Event.js

* [Github](https://github.com/mark-rolich/Event.js)
* [JS Classes](http://www.jsclasses.org/package/212-JavaScript-Handle-events-in-a-browser-independent-manner.html)

Dragdrop.js

* [Github](https://github.com/mark-rolich/Dragdrop.js)
* [JS Classes](http://www.jsclasses.org/package/215-JavaScript-Handle-drag-and-drop-events-of-page-elements.html)

Browser Compatibility
--------------------

Currently tested in:

* Chrome 24
* Firefox 18
* IE 7, 8 and 9 (without grid saving functionality)
* Safari for Windows 5.1.7

Bug tracker
-----------

Have a bug? Please create an issue here on GitHub!

https://github.com/mark-rolich/RulersGuides.js/issues

Copyright and License
---------------------

The MIT License (MIT)

Copyright (c) 2013 Mark Rolich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Screenshots  
  • Screenshot2
  • Screenshot1
  Files folder image Files  
File Role Description
Files folder imagedemo (2 files)
Accessible without login Plain text file bookmarklet.js Appl. Bookmarklet
Accessible without login Plain text file bookmarklet_ie.js Appl. IE bookmaklet
Accessible without login Plain text file mit-license.txt Lic. LICENSE
Accessible without login Plain text file README.md Doc. README
Accessible without login Plain text file rulersguides.css Data Main css file
Plain text file RulersGuides.js Class Main class

  Files folder image Files  /  demo  
File Role Description
  Accessible without login Plain text file index.css Data demo css file
  Accessible without login Plain text file index.html Example demo

Downloadrulers-guides-2013-10-08.zip 63KB
Downloadrulers-guides-2013-10-08.tar.gz 43KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Event Download .zip .tar.gz For cross-browser event handling Required
Drag and Drop Download .zip .tar.gz For drag-n-drop functionality Required
 Version Control Unique User Downloads Download Rankings  
 80%Total:137All time:303
 This week:0This week:41Up