https://github.com/rmosolgo/batmanjs-refresh
Refresh HTML and CSS in your batman.js app
https://github.com/rmosolgo/batmanjs-refresh
Last synced: 3 months ago
JSON representation
Refresh HTML and CSS in your batman.js app
- Host: GitHub
- URL: https://github.com/rmosolgo/batmanjs-refresh
- Owner: rmosolgo
- Created: 2014-03-25T17:49:02.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-21T20:06:21.000Z (over 11 years ago)
- Last Synced: 2024-12-28T03:43:02.806Z (about 1 year ago)
- Language: CoffeeScript
- Size: 398 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Batman Refresh
Batman Refresh ([JavaScript](https://raw.githubusercontent.com/rmosolgo/batmanjs-refresh/master/refresh.js), [CoffeeScript](https://raw.githubusercontent.com/rmosolgo/batmanjs-refresh/master/refresh.coffee)) is an add-on to batman.js to help your development workflow. It adds a few functions:
- `Batman.refreshHTML` reloads the `source` for all subviews of the layout view:
```javascript
Batman.refreshHTML()
```
- `Batman.refreshCSS` reloads all stylesheets on the page
```javascript
Batman.refreshCSS()
```
- `Batman.refreshAll` does both!
```javascript
Batman.refreshAll()
```
Also, you can use `Batman.View::refreshHTML` to refresh the HTML for a specific view. For example:
```javascript
myNode = document.getElementById("my-node")
view = $context(myNode)
view.refreshHTML() // reloads HTML from the server
```
No tests, no docs, but there is [annotated source code](http://rmosolgo.github.io/batmanjs-refresh/refresh.html) :)