Skip to content
This repository

blade + spark + liveui ? #184

Closed
daslicht opened this Issue · 5 comments

3 participants

daslicht Blake Miner Norman Khine
daslicht

Hi,
I try to follow the wiki about LiveUI but how to use the generated standalone spark ?

I have created a simple test project here, probably we can put a working example together:

https://github.com/daslicht/blade-spark

~Marc

Blake Miner
Owner
bminer commented

Mark,

I fixed the broken link in the wiki to build the standalone Spark file. The script file, once executed against the Meteor master branch, generates spark.js, which you place in your /public directory. Spark is only included on the client side with a single <script> tag, loaded before the Blade Live UI plugin. In addition, the Blade runtime must be loaded on the client side before the Blade Live UI Plugin.

You probably want a view that looks something like this:

doctype 5
html
    head
        block title(pageTitle)
            title=pageTitle
        script(type="text/javascript" src="/spark.js")
        script(type="text/javascript" src="/blade/blade.js")
        script(type="text/javascript" src="/blade/plugins/liveui.js")
    body
        block content

Hope that helps enough for now. Unfortunately, work is very busy at the moment, and I have been neglecting Blade a bit. :(

-Blake

Blake Miner
Owner
bminer commented

Closing this issue for now, but please feel free to post back here. :)

Blake Miner bminer closed this
Norman Khine

here is what i did in my express, blade application but still did not work!

/views/index.blade

include "../layout/layout.blade"
replace block page
    #div
        input(type='button', value='Click me!')
            {clicks}
                clicks++;
    - var plural = clicks == 1 ? "" : "s"
    p You clicked the button #{clicks} time#{plural}

/app/controllers/index.coffee

exports.index = (req, res) ->
  res.render "index",
    clicks: 0

/layout/layout.blade

!!! 5
//[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]
//[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]
//[if IE 8]>         <html class="no-js lt-ie9"> <![endif]
//[if gt IE 8]>      <html class="no-js"> <![endif]
html
    include "includes/head.blade"
    include "includes/scripts.blade"
    body
        //[if lt IE 7]> <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p> <![endif]
        block body
        #wrap
            include "../views/projects.blade"
            include "../views/header.blade"
            #page
                block page
        include "../views/footer.blade"
        include "includes/foot.blade"

and includes/scripts.blade

script(type="text/javascript" src="/js/vendor/spark.min.js")
script(type="text/javascript" src="/blade/blade.js")
script(type="text/javascript" src="/blade/plugins/liveui.js")
script(type="text/javascript")
    |!
        window.jQuery || document.write('<script src="/js/vendor/jquery/jquery.min.js"><\/script>')

//script(type="text/javascript" src="//jamuhl.github.io/i18next/public/download/versions/i18next-1.6.0.min.js")
script(type="text/javascript")
    |!
        window.i18next || document.write('<script src="/js/vendor/i18next/i18next-1.6.0.min.js"><\/script>')

//script(type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-url-parser/2.2.1/purl.min.js")
script(type="text/javascript")
    |!
        window.purl || document.write('<script src="/js/vendor/purl.min.js"><\/script>')

//script(type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.2/jquery.cookie.min.js")
script(type="text/javascript")
    |!
        window.cookie || document.write('<script src="/js/vendor/jquery/jquery.cookie.min.js"><\/script>')

//script(type="text/javascript" src="/js/vendor/jquery/jquery.validate.min.js")
script(type="text/javascript")
    |!
        document.write('<script src="/js/vendor/jquery/jquery.validate.min.js"><\/script>')

//script(type="text/javascript" src="https://login.persona.org/include.js")
script(type="text/javascript")
    |!
        window.cookie || document.write('<script src="https://login.persona.org/include.js"><\/script>')

//script(type="text/javascript" src="/js/persona.js")
script(type="text/javascript")
    |!
        window.cookie || document.write('<script src="/js/persona.js"><\/script>')

TZM/tzm-blade@758e80c

i've added it to the home page on http://www.zmgc.net

any advice much appreciated on how to get this to work.

Blake Miner
Owner

@nkhine - Please send me an email directly (http://blakeminer.com), and we can talk about the problem there rather than chatting on the Github issue tracker.

Could you also provide me more information about the error that you are experiencing?

Norman Khine

ok i sent you an email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.