diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index 1eab1be4f..7498a608b 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -10,20 +10,23 @@ class LoginController extends Zend_Controller_Action public function indexAction() { - if(Zend_Auth::getInstance()->hasIdentity()) - { - $this->_redirect('Nowplaying'); - } + if(Zend_Auth::getInstance()->hasIdentity()) + { + $this->_redirect('Nowplaying'); + } + + //uses separate layout without a navigation. + $this->_helper->layout->setLayout('login'); + + $request = $this->getRequest(); + $baseUrl = $request->getBaseUrl(); + + $this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/login.js','text/javascript'); - //uses separate layout without a navigation. - $this->_helper->layout->setLayout('login'); - - $request = $this->getRequest(); - $form = new Application_Form_Login(); + + $message = "Please enter your user name and password"; - $message = "Please enter your user name and password"; - if($request->isPost()) { // if the post contains recaptcha field, which means form had recaptcha field. diff --git a/airtime_mvc/public/js/airtime/login/login.js b/airtime_mvc/public/js/airtime/login/login.js new file mode 100644 index 000000000..ad45c0a22 --- /dev/null +++ b/airtime_mvc/public/js/airtime/login/login.js @@ -0,0 +1,3 @@ +$(document).ready(function(){ + $("#username").focus() +}) \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index 21bc50a88..a239dc0da 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -50,6 +50,16 @@ function hideForShoutcast(ele){ restrictOggBitrate(ele, false) } +function validate(ele,evt) { + var theEvent = evt || window.event; + var key = theEvent.keyCode || theEvent.which; + if ((ele.val().length >= 5 || (key < 48 || key > 57)) && !(key == 8 || key == 9 || key == 13 || key == 37 || key == 39 || key == 46)) { + theEvent.returnValue = false; + if(theEvent.preventDefault) theEvent.preventDefault(); + } + } + + function showForIcecast(ele){ var div = ele.closest("div") div.find("#outputMountpoint-label").show() @@ -69,6 +79,10 @@ $(document).ready(function() { rebuildStreamURL($(this)) }) + $("input:[id$=-port]").keypress(function(e){ + validate($(this),e) + }) + $("select:[id$=-output]").change(function(){ rebuildStreamURL($(this)) })