Re: A little text string in the login page. How?

42 views
Skip to first unread message

Samuli Järvelä

unread,
May 10, 2013, 1:41:32 AM5/10/13
to moll...@googlegroups.com
Easiest way would be to put the text inside div #mollify, as this will be cleared when the main view is shown. Otherwise you'd have to create something similar to custom login plugin (no need to make the actual login part, but only listen to the login events and show/hide the content accordingly).



On 9.5.2013, at 16:37 , andrea....@shift.it wrote:

I've to put a notice in the login page telling the user that, for the public area, he can login with a specified user and password. I've tried to put it in the index.html but the string also appear in the internal pages. How can I make it appear only in the login page?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Mollify" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mollified+...@googlegroups.com.
To post to this group, send email to moll...@googlegroups.com.
Visit this group at http://groups.google.com/group/mollified?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

andrea....@shift.it

unread,
May 10, 2013, 3:25:18 AM5/10/13
to moll...@googlegroups.com, sam...@jarvela.com
Thanks. I've tried to put the string inside the mollify div but nothing is shown. That's why I've asked here... The other solution is not feasible for me since I'm not a programmer.

Just for curiosity. Would not be simpler to implement a lighter and less complicated login system. I really can't understand how it works and why I'm not able to write something in this page...

Thanks!

Samuli Järvelä

unread,
May 10, 2013, 4:08:51 AM5/10/13
to moll...@googlegroups.com
OK, I remembered it wrong, the div is emptied already on login page.

I find your request a bit odd. Naturally people find things difficult that they don't understand. But what exactly would be "simple enough" that non-programmers would understand it? I doubt that's a goal any app developer aims at, after all, this is a web application, and if you want to customize it you just need to understand how it works.

However, I agree that the GWT platform brings unnecessary complexity, and I'm currently writing version 2.0 which makes all this different. New version will be 100% templated and thus easier to customize. Still, I doubt that all non-programmers would understand it (and I'm not even trying to achieve that).

But until that, here's how you can have your login message in the index.html (marked important parts in red):

<html>
<head>
<title>Mollify page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="client/themes/basic/style.css">
<script type="text/javascript" language="javascript" src="client/init.js"></script>
<script type="text/javascript" language="javascript" src="client/localization/texts_en.js"></script>
<script type="text/javascript" language="javascript" src="backend/plugin/Plupload/client/texts_en.js"></script>
<script type="text/javascript">
mollify.init({
// your configuration here
"plugins": [
new CustomMessagePlugin() // THIS IS IMPORTANT
]
});
function CustomMessagePlugin() {
this.getPluginInfo = function() { return { id: "custom-message-plugin" }; }

this.initialize = function(env) {
env.addEventHandler(function(e){
if (e.type == 'SESSION_START') {
var session = e.payload;
if (session['authenticated'])
$("#login-message").hide();
else
$("#login-message").show();
}});
}

}
</script>
<script type="text/javascript" language="javascript" src="client/org.sjarvela.Mollify.nocache.js"></script>
</head>

<body>
<div id="login-message">your login message here</div>
<div id="mollify"></div>
</body>
</html>

andrea....@shift.it

unread,
May 10, 2013, 4:41:14 AM5/10/13
to moll...@googlegroups.com, sam...@jarvela.com
Thank you very much. I really don't want to criticize your beautiful work. I see many script for my works and you pointed out exactly what I meant with "unnecessary complexity". I'll try your mod and I'll let you know. Thank you very very much...


On Friday, May 10, 2013 7:41:32 AM UTC+2, Samuli Järvelä wrote:

andrea....@shift.it

unread,
May 10, 2013, 4:45:41 AM5/10/13
to moll...@googlegroups.com, sam...@jarvela.com
I've tried to replace my code here

<html>
<head>
<title>Mondialpol S.p.A. - Download center</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="client/themes/basic/style.css">

<script type="text/javascript" language="javascript" src="client/include/jquery.js"></script>
<script type="text/javascript" language="javascript" src="client/include/jquery.tmpl.min.js"></script>
<script type="text/javascript" language="javascript" src="client/include/ZeroClipboard.js"></script>
<script type="text/javascript" language="javascript" src="client/init.js"></script>
<script type="text/javascript" language="javascript" src="client/localization/texts_it.js"></script>
<script type="text/javascript">
ZeroClipboard.setMoviePath('client/include/ZeroClipboard.swf');
mollify.init({
"service-path": "backend/",
});
</script>
<script type="text/javascript" language="javascript" src="client/org.sjarvela.Mollify.nocache.js"></script>
</head>

<body>
<div id="mollify"></div>
</body>
</html>

with your code but I've got this error


On Friday, May 10, 2013 7:41:32 AM UTC+2, Samuli Järvelä wrote:

Samuli Järvelä

unread,
May 10, 2013, 4:50:54 AM5/10/13
to moll...@googlegroups.com
Oh don't replace the page, just add those I marked with red. Now the client is trying to access backend with wrong url, you probably removed the service path.

andrea....@shift.it

unread,
May 10, 2013, 5:07:45 AM5/10/13
to moll...@googlegroups.com, sam...@jarvela.com
Sorry but since the two piece of code are different I'm not really able to add your red parts. For example you say to add 


new CustomMessagePlugin() // THIS IS IMPORTANT

here

"plugins": [
new CustomMessagePlugin() // THIS IS IMPORTANT
]

But I don't see "plugins" in my code. Can you apply these mods in my code so that I can copy/paste it?

Samuli Järvelä

unread,
May 10, 2013, 11:24:00 AM5/10/13
to moll...@googlegroups.com
In my opinion, if you are not able to edit HTML and/or javascript, you are a bit over your head here. Unfortunately this is as far as I can assist you, I simply don't have the time to do this kind of customization for everyone. If you need further assistance, please take a look at my paid services at mollify.org.

Here's your page added with the stuff I sent:


<html>
<head>
<title>Mondialpol S.p.A. - Download center</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="client/themes/basic/style.css">

<script type="text/javascript" language="javascript" src="client/include/jquery.js"></script>
<script type="text/javascript" language="javascript" src="client/include/jquery.tmpl.min.js"></script>
<script type="text/javascript" language="javascript" src="client/include/ZeroClipboard.js"></script>
<script type="text/javascript" language="javascript" src="client/init.js"></script>
<script type="text/javascript" language="javascript" src="client/localization/texts_it.js"></script>
<script type="text/javascript">
ZeroClipboard.setMoviePath('client/include/ZeroClipboard.swf');
mollify.init({
"service-path": "backend/",
"plugins": [ new CustomMessagePlugin() ]
});

function CustomMessagePlugin() {
this.getPluginInfo = function() { return { id: "custom-message-plugin" }; }

this.initialize = function(env) {
env.addEventHandler(function(e){
if (e.type == 'SESSION_START') {
var session = e.payload;
if (session['authenticated'])
$("#login-message").hide();
else
$("#login-message").show();
}});
}

}
</script>
<script type="text/javascript" language="javascript" src="client/org.sjarvela.Mollify.nocache.js"></script>
</head>

<body>
<div id="login-message">your login message here</div>
<div id="mollify"></div>
</body>
</html>

andrea....@shift.it

unread,
May 10, 2013, 12:55:03 PM5/10/13
to moll...@googlegroups.com, sam...@jarvela.com
Thank you very much. As said I'm not a coder but be sure that if I'd need some advanced modification I'll get back to your paid services...

Thanks again...
Reply all
Reply to author
Forward
0 new messages