From df590adf817f672c23a99be565d65374584db5b3 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sun, 27 Feb 2011 01:54:27 +0100 Subject: [PATCH] install page: links to check the sound --- src/messenger/webim/default.css | 10 ++++ src/messenger/webim/install/index.php | 13 ++++++ src/messenger/webim/js/164/soundcheck.js | 1 + src/messenger/webim/js/source/build.xml | 51 +++++++++++---------- src/messenger/webim/js/source/soundcheck.js | 12 +++++ src/messenger/webim/locales/en/properties | 5 +- src/messenger/webim/view/install_index.php | 12 +++++ 7 files changed, 78 insertions(+), 26 deletions(-) create mode 100644 src/messenger/webim/js/164/soundcheck.js create mode 100644 src/messenger/webim/js/source/soundcheck.js diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index 1ed25c6a..da66fc0a 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -787,6 +787,16 @@ table.awaiting td.visitor { margin-left: 2em; } +#check-nv, #check-nm { + color: #2f7599; + text-decoration: none; +} + +#check-nv:hover, #check-nm:hover { + text-decoration: underline; +} + + /* chat */ .message { diff --git a/src/messenger/webim/install/index.php b/src/messenger/webim/install/index.php index 26807ade..37b29a68 100644 --- a/src/messenger/webim/install/index.php +++ b/src/messenger/webim/install/index.php @@ -31,6 +31,7 @@ $page = array( $page['done'] = array(); $page['nextstep'] = false; $page['nextnotice'] = false; +$page['soundcheck'] = false; $errors = array(); function check_webimroot() @@ -143,6 +144,16 @@ function check_columns($link) return true; } +function check_sound() { + global $page; + + $page['soundcheck'] = true; + $page['done'][] = getlocal2("install.5.text", array( + "".getlocal("install.5.newvisitor")."", + "".getlocal("install.5.newmessage")."" + )); +} + function check_status() { global $page, $webimroot, $settings, $dbversion; @@ -171,6 +182,8 @@ function check_status() return; } + check_sound(); + $page['done'][] = getlocal("installed.message"); $page['nextstep'] = getlocal("installed.login_link"); diff --git a/src/messenger/webim/js/164/soundcheck.js b/src/messenger/webim/js/164/soundcheck.js new file mode 100644 index 00000000..1b2b2692 --- /dev/null +++ b/src/messenger/webim/js/164/soundcheck.js @@ -0,0 +1 @@ +pr.ir({'a#check-nv':function(vh){vh.onclick=function(){ys(wroot+'/sounds/new_user.wav');} ;} ,'a#check-nm':function(vh){vh.onclick=function(){ys(wroot+'/sounds/new_message.wav')} ;} } ); \ No newline at end of file diff --git a/src/messenger/webim/js/source/build.xml b/src/messenger/webim/js/source/build.xml index 684473f0..5ba2f890 100644 --- a/src/messenger/webim/js/source/build.xml +++ b/src/messenger/webim/js/source/build.xml @@ -2,33 +2,34 @@ ]> - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + - - - + + + diff --git a/src/messenger/webim/js/source/soundcheck.js b/src/messenger/webim/js/source/soundcheck.js new file mode 100644 index 00000000..34c41582 --- /dev/null +++ b/src/messenger/webim/js/source/soundcheck.js @@ -0,0 +1,12 @@ +Behaviour.register({ + 'a#check-nv' : function(el) { + el.onclick = function() { + playSound(wroot + '/sounds/new_user.wav'); + }; + }, + 'a#check-nm' : function(el) { + el.onclick = function() { + playSound(wroot + '/sounds/new_message.wav') + }; + } +}); diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index f33e39f3..95efb873 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -173,7 +173,10 @@ install.3.create=Create required tables. install.3.tables_exist=Requred tables are created. install.4.create=Update tables install.4.done=Tables structure is up to date. -install.4.notice=Structure of your tables should be adjusted for new version of Messenger. +install.4.notice=Structure of your tables should be adjusted for new version of Messenger. +install.5.text=Click to check the sound: {0} and {1} +install.5.newmessage=New Message +install.5.newvisitor=New Visitor install.connection.error=Could not connect, please check server settings in config.php. Error: {0} install.done=Completed: install.err.back=Resvole problem and try again. Press back to return to wizard. diff --git a/src/messenger/webim/view/install_index.php b/src/messenger/webim/view/install_index.php index 20c739b8..f988eb1e 100644 --- a/src/messenger/webim/view/install_index.php +++ b/src/messenger/webim/view/install_index.php @@ -25,6 +25,18 @@ if(isset($page) && isset($page['localeLinks'])) { $page['title'] = getlocal("install.title"); $page['fixedwrap'] = true; +function tpl_header() { global $page, $webimroot, $jsver; + if($page['soundcheck']) { +?> + + + +