Sha256: 478a3d79ef7db54f4eab2b68d33aa7748ee8111baf5619b7d70476df278246db
Contents?: true
Size: 1019 Bytes
Versions: 6
Compression:
Stored size: 1019 Bytes
Contents
module Locomotive module Middlewares class InlineEditor def initialize(app, opts = {}) @app = app end def call(env) response = @app.call(env) unless response[1]['Editable'].blank? html = response.last.body.to_s.gsub '</body>', %( <a href="_admin" onmouseout="this.style.backgroundPosition='0px 0px'" onmouseover="this.style.backgroundPosition='0px -45px'" onmousedown="this.style.backgroundPosition='0px -90px'" onmouseup="this.style.backgroundPosition='0px 0px'" style="display: block;z-index: 1031;position: fixed;top: 10px; right: 10px;width: 48px; height: 45px;text-indent:-9999px;text-decoration:none;background: transparent url\('/assets/locomotive/icons/start.png'\) no-repeat 0 0;"> Admin</a> </body> ) [response[0], response[1], [html]] else response end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems