Skip to content

Commit

Permalink
Updated doc: iris.isLocalhost and iris.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel Sanchez committed Feb 12, 2014
1 parent bc5d4a6 commit a3f04b4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Iris exposes all of its methods and properties on the `iris` object:
- [iris.noCache(args)](#irisnocacheargs)
- [iris.enableLog(args)](#irisenablelogargs)
- [iris.log(args)](#irislogargs)
- [iris.isLocalhost()](#irisislocalhost)
- [Util](#util)
- [iris.ajax(settings)](#irisajaxsettings)
- [iris.val(obj, label)](#irisvalobj-label)
Expand Down Expand Up @@ -45,6 +46,7 @@ Iris exposes all of its methods and properties on the `iris` object:
- [iris.ui(function(self){...}, path)](#irisuifunctionself-path)
- [iris.tmpl(path, html)](#iristmplpath-html)
- [iris.resource(function(self){...}, path)](#irisresourcefunctionself-path)
- [iris.debug(enabled)](#irisdebugenabled)
- [Classes](#classes)
- [iris.Settable Class](#irissettable-class)
- [self.setting(label[, value])](#selfsettinglabel-value)
Expand Down Expand Up @@ -175,6 +177,17 @@ iris.enableLog("127.0.1.30");
iris.log("This is only printed in 127.0.1.30");
```

### iris.isLocalhost()
*Since*: `v0.5.7`

Returns `true` if `document.location.href` contains `localhost` or `127.0.0.1`.

```javascript
if ( iris.isLocalhost() ) {
// do something
}
```


## Util
### iris.ajax(settings)
Expand Down Expand Up @@ -800,6 +813,19 @@ iris.resource(function(self){
iris.resource(iris.path.resource.js);
```

### iris.debug(enabled)
*Since*: `v0.5.7`

Enables or disables the iris debug mode.
When iris debug mode is enabled, the application is listening for the combination of keys: `Ctrl + Alt + Shift + D` to show or hide the debug information layer. By default it is enabled in local enviroments (`127.0.0.1` and `localhost`).
If the the combination of keys is detected, the application prints/hide a visual lines to highlight the components (screens and UIs) and prints information about its presenter and template paths, hash-URL or data-id.

```javascript
// Force to disable iris debug mode
//('Ctrl + Alt + Shift + D' wont work)
iris.debug(false);
```

## Classes

### iris.Settable Class
Expand Down

0 comments on commit a3f04b4

Please sign in to comment.