Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Fwd: [Gnukhata-devel] separation of js code from mako files
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Krishnakant Mane  
View profile  
 More options Oct 26 2012, 6:00 am
From: Krishnakant Mane <krm...@gmail.com>
Date: Fri, 26 Oct 2012 15:30:44 +0530
Local: Fri, Oct 26 2012 6:00 am
Subject: Fwd: [Gnukhata-devel] separation of js code from mako files

Dear Pylons/ piramid developers,
I am forwarding this email from mailing list for GNUKhata
www.gnukhata.org, a free and open source accounting software which I am
leading.
Basically we use Pylons version 1.0 for the front end.
We are now planning to use some ui refinement library like bootstrap in
particular.
OUr developers have faced a problem integrating the tmpl_context (c)
related data with javascript.
The details on the problem follow in the forwarded email.
Kindly help.
happy hacking.
Krishnakant.

  Attached Message Part
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile  
 More options Oct 26 2012, 11:49 am
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Fri, 26 Oct 2012 08:49:06 -0700 (PDT)
Local: Fri, Oct 26 2012 11:49 am
Subject: Re: Fwd: [Gnukhata-devel] separation of js code from mako files
If i understand you correctly:

Before Editing :
   Your javascript was embedded in mako. and you had variables set in
javascript
After Editing :
   Your javascript is outside of mako, and you need to set variables

If that is your problem, the solution is to re-architect your
javascript so you can set variables in mako but call functions in a
static file.

static.js
    var MyApp = {
       _variable1 : false ,
       _variable2 : false ,
       doSomething : function(){ },
       doSomthingElse : function(input){ },
       flashMessage : function(message){ alert('message') },
    }

dynamic.mako :
    <script type="text/javascript">
       $(document).ready(function(){
           MyApp._variable1 = ${a};
           MyApp._variable2 = ${b};
           MyApp.doSomething();
           MyApp.doSomethingElse('${c}');
           MyApp.flashMessage('${hello}');
       })
    </script>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile  
 More options Oct 28 2012, 1:58 pm
From: Mike Orr <sluggos...@gmail.com>
Date: Sun, 28 Oct 2012 10:58:11 -0700
Local: Sun, Oct 28 2012 1:58 pm
Subject: Re: Fwd: [Gnukhata-devel] separation of js code from mako files
I have this problem in a Pylons applicaition I'm converting to
Pyrmaid. Right now I'm leaving the Javascript in place, but I'm
thinking about moving it to separate templates (not static files).
Then I can inject variables without having the Javascript mixed with
the HTML. It'll work if it doesn't need any request-specific data, or
if all the data can be passed as a few query parameters or is in the
session. That should cover most of my use cases but I'm not sure if
it'll cover all of them; I'm waiting till I convert the rest of the
application to tell.

--
Mike Orr <sluggos...@gmail.com>

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mengu  
View profile  
 More options Oct 28 2012, 5:29 pm
From: Mengu <whalb...@gmail.com>
Date: Sun, 28 Oct 2012 14:29:32 -0700 (PDT)
Local: Sun, Oct 28 2012 5:29 pm
Subject: Re: Fwd: [Gnukhata-devel] separation of js code from mako files
what about using backbone.js or angularjs?

On Oct 26, 12:00 pm, Krishnakant Mane <krm...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile  
 More options Oct 30 2012, 2:05 pm
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Tue, 30 Oct 2012 11:05:44 -0700 (PDT)
Local: Tues, Oct 30 2012 2:05 pm
Subject: Re: Fwd: [Gnukhata-devel] separation of js code from mako files

On Oct 28, 1:58 pm, Mike Orr <sluggos...@gmail.com> wrote:

> I have this problem in a Pylons applicaition I'm converting to
> Pyrmaid. Right now I'm leaving the Javascript in place, but I'm
> thinking about moving it to separate templates (not static files).
> Then I can inject variables without having the Javascript mixed with
> the HTML. It'll work if it doesn't need any request-specific data, or
> if all the data can be passed as a few query parameters or is in the
> session. That should cover most of my use cases but I'm not sure if
> it'll cover all of them; I'm waiting till I convert the rest of the
> application to tell.

If you can, i strongly suggest the method I had above.  It makes it
really simple for maintaining in team environments, because the JS
team just writes their 'api' , and the backend/frontend team just has
to integrate it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »