Mercurial > cosocket
changeset 81:2fc520114ed4
better support for i18n
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Thu, 30 Apr 2009 19:07:22 -0700 |
parents | 002868ce7212 |
children | 4b3c051d60c3 |
files | media/css/openwebchat.css media/js/openwebchat.js openwebchat.html |
diffstat | 3 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/media/css/openwebchat.css Thu Apr 30 18:58:37 2009 -0700 +++ b/media/css/openwebchat.css Thu Apr 30 19:07:22 2009 -0700 @@ -61,3 +61,7 @@ margin-top: 1em; margin-bottom: 1em; } + +#data { + display: none; +}
--- a/media/js/openwebchat.js Thu Apr 30 18:58:37 2009 -0700 +++ b/media/js/openwebchat.js Thu Apr 30 19:07:22 2009 -0700 @@ -27,7 +27,7 @@ localStorage = window.globalStorage[document.location.hostname]; if (!localStorage) - throw new OpenWebStorage.UnsupportedError('no local DOM storage'); + throw new OpenWebStorage.UnsupportedError('No local DOM storage'); self.set = function set(key, value) { localStorage[key] = JSON.stringify(value); @@ -130,7 +130,8 @@ '/conv' + document.location.pathname ); - $('#name').val(owStorage.get('name', "A Mysterious Stranger")); + $('#name').val(owStorage.get('name', + $('#data .default-name').text())); $('#name').blur( function() { owStorage.set('name', $(this).val());
--- a/openwebchat.html Thu Apr 30 18:58:37 2009 -0700 +++ b/openwebchat.html Thu Apr 30 19:07:22 2009 -0700 @@ -20,6 +20,9 @@ <p>Your name is <input type="text" id="name"/>.</p> <div id="bottom"></div> </div> +<div id="data"> + <div class="default-name">A Mysterious Stranger</div> +</div> <script src="/media/js/jquery.js"></script> <script src="/media/js/json2.js"></script> <script src="/media/js/openwebchat.js"></script>