Skip to content
Myr

started flipping view extensions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Aaron Heckmann · committed by Aaron Heckmann · parent 0849768 · Browse files · 6 files+20 added−124 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+20 added−124 removed

  • other:+20 added−124 removed

6 files+20 added−124 removed

deleted:examples/chat/views/partials/message.haml.html-1 removed
deleted:examples/chat/views/chat.haml.html-9 removed
deleted:examples/chat/views/layout.haml.html-11 removed
deleted:examples/chat/views/style.sass.css-81 removed
1body2 :font-family "Helvetica Neue", "Lucida Grande", "Arial"3 :font-size 13px4 :text-align center5 =text-stroke 1px rgba(255, 255, 255, 0.1)6 :color #5557 8h1, h29 :margin 010 :font-size 22px11 :color #34343412h113 :text-shadow 1px 2px 2px #ddd14 :font-size 60px15 16img.bubble17 :position absolute18 :top -25px19 :left 120px20 21#wrapper22 :position relative23 :margin 100px auto24 :width 500px25 :text-align left26 27ul28 :margin 029 :padding 030 :max-height 300px31 :overflow-x hidden32 li33 :margin 5px 034 :padding 3px 8px35 :list-style none36 :border 1px solid #eee37 =border-radius 3px38 =border-radius 3px39 li:hover40 :cursor pointer41 :color #2E2E2E4243input[type=text]44 :padding 5px45 :border 1px solid #ddd46 :outline none47 =border-radius 2px48input[type=text]:focus49 :border-color #00C3FF5051input[type=submit]52 =border-radius 2px53 =box-shadow 0 1px 2px #ddd54 :padding 6px 10px55 :border solid 1px #99956 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ddd))57 :color #33358 :text-decoration none59 :cursor pointer60 :display inline-block61 :text-align center62 :text-shadow 0px 1px 1px #fff63 :line-height 164input[type=submit]:hover65 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#E6E4E4))66input[type=submit]:active67 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#c7c7c7))68input[name=name]69 :width 80px70 71a72 :color #1ABFF173 =transition-property padding74 =transition-duration 0.15s75a:hover76 :padding 0 5px77a:hover:before78 :content 'visit: '79 80#online81 :font-size 12px
modified:examples/chat/app.js+2 added-2 removed
modified:lib/express/plugins/view.js+18 added-20 removed
133 unmodified lines
134 * @api public135 */136137 render: function(view, options, callback) {138 var self = this,139 options = options || {},138 var options = options || {},139 type = options.partial ? 'partials' : 'views',140 path = set(type) + '/' + view,142 engine = path.split('.').slice(-2)[0],143 ext = extname(path),141 parts = view.split('.'),142 engine = parts.last,143 contentType = parts.slice(-2)[0],144 layout = options.layout === undefined ? 'layout' : options.layout145 content = cache[type][path] || fs.readFileSync(path)146 options.context = options.context || this146 if (type === 'views') self.contentType(ext)147 function render(content) {148 content = (engines[engine] = engines[engine] || require(engine)).render(content, options)149 if (layout)150 self.render(layout + '.' + engine + ext, options.mergeDeep({151 layout: false,152 locals: { body: content }153 }), callback)154 else if (type === 'partials')155 return content156 else if (callback)157 callback.call(self, null, content)158 else159 self.halt(200, content)147 content = (engines[engine] = engines[engine] || require(engine)).render(content, options)148 if (type === 'views') this.contentType(contentType)149 if (layout)150 this.render([layout, contentType, engine].join('.'), options.mergeDeep({151 layout: false,152 locals: { body: content }153 }), callback)154 else if (type === 'partials')155 return content156 else if (callback)157 callback.call(this, null, content)158 else159 this.halt(200, content)160 }161 return render(cache[type][path] || fs.readFileSync(path))160 }161 })162 }163 }
2 unmodified lines