Skip to content
Browse files

slight cleanup and optimizations

  • Loading branch information...
1 parent 9156045 commit c3ca0af6186d128c3110422d54510406573e773b @jaekwon committed
Showing with 4 additions and 8 deletions.
  1. +1 −1 package.json
  2. +3 −7 src/coffeemugg.coffee
View
2 package.json
@@ -4,7 +4,7 @@
"version": "0.0.4",
"author": "Jae Kwon <jkwon.work@gmail.com>",
"repository": {"type": "git", "url": "git://github.com/jaekwon/coffeemugg.git"},
- "dependencies": {"coffee-script": ">= 1.1.2", "nogg": ">= 0.0.2"},
+ "dependencies": {"coffee-script": ">= 1.1.2"},
"devDependencies": {"jade": "0.13.0", "eco": "1.1.0-rc-1", "ejs": "0.4.3", "haml": "0.4.2", "coffeekup": "0.3.0"},
"keywords": ["template", "view", "coffeescript", "coffeekup"],
"main": "./lib/coffeemugg",
View
10 src/coffeemugg.coffee
@@ -1,15 +1,8 @@
if window?
coffeemugg = window.CoffeeMug = {}
coffee = if CoffeeScript? then CoffeeScript else null
- logger = {
- debug: (msg) -> console.log "debug: #{msg}"
- info: (msg) -> console.log "info: #{msg}"
- warn: (msg) -> console.log "warn: #{msg}"
- error: (msg) -> console.log "error: #{msg}"
- }
else
coffeemugg = exports
- logger = require('nogg').logger('coffeemugg')
coffee = require 'coffee-script'
coffeemugg.version = '0.0.2'
@@ -147,6 +140,7 @@ coffeemugg.CMContext = CMContext = (options={}) ->
classes.push i unless i is ''
@text " id=\"#{id}\"" if id
@text " class=\"#{classes.join ' '}\"" if classes.length > 0
+ null
render_attrs: (obj) ->
for k, v of obj
@@ -161,6 +155,7 @@ coffeemugg.CMContext = CMContext = (options={}) ->
# strings, numbers, objects and arrays are rendered "as is"
# http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.2.2
@text " #{k}=\"#{String(v).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}\""
+ null
render_contents: (contents, args...) ->
if typeof contents is 'function'
@@ -441,6 +436,7 @@ HTMLPlugin = (context) ->
parse_selector.call @, k, v
else
throw new Error "@css takes objects or arrays of objects"
+ null
return context

0 comments on commit c3ca0af

Please sign in to comment.
Something went wrong with that request. Please try again.