File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 3535 <input type="submit" name="login_submit" value="Log In">
3636 </form>
3737-->
38- < form name ="loginForm " id ="login " action ="# " onsubmit ="return login( this); ">
38+ < form name ="loginForm " id ="login " action ="# " onsubmit ="return errWrap(login, this); ">
3939 < span class ="input input--nao ">
4040 < input class ="input__field input__field--nao " type ="text " name ="username " id ="username " placeholder ="Enter A Username "/>
4141 < label class ="input__label input__label--nao " for ="username ">
6060-->
6161
6262
63- < form name ="callForm " id ="call " action ="# " onsubmit ="return makeCall( this); ">
63+ < form name ="callForm " id ="call " action ="# " onsubmit ="return errWrap(makeCall, this); ">
6464 < span class ="input input--nao ">
6565 < input class ="input__field input__field--nao " type ="text " name ="number " id ="call " placeholder ="Enter User To Call! "/>
6666 < label class ="input__label input__label--nao " for ="number ">
165165 $ ( '#logs' ) . append ( "<p>" + log + "</p>" ) ;
166166}
167167
168+ function errWrap ( fxn , form ) {
169+ try {
170+ return fxn ( form ) ;
171+ } catch ( err ) {
172+ alert ( "WebRTC is currently only supported by Chrome, Opera, and Firefox" ) ;
173+ return false ;
174+ }
175+ }
176+
168177</ script >
169178
170179< script >
Original file line number Diff line number Diff line change 2929</ div >
3030
3131
32- < form name ="streamForm " id ="stream " action ="# " onsubmit ="return stream( this); ">
32+ < form name ="streamForm " id ="stream " action ="# " onsubmit ="return errWrap(stream, this); ">
3333 < span class ="input input--nao ">
3434 < input class ="input__field input__field--nao " type ="text " name ="streamname " placeholder ="Enter Stream Name " id ="streamname "/>
3535 < label class ="input__label input__label--nao " for ="streamname ">
4747</ form >
4848
4949
50- < form name ="watchForm " id ="watch " action ="# " onsubmit ="return watch( this); ">
50+ < form name ="watchForm " id ="watch " action ="# " onsubmit ="return errWrap(watch, this); ">
5151 < span class ="input input--nao ">
5252 < input class ="input__field input__field--nao " type ="text " name ="number " placeholder ="Enter Stream To Watch! "/>
5353 < label class ="input__label input__label--nao " for ="number ">
187187 embed_code . appendChild ( document . createTextNode ( embed . outerHTML ) ) ;
188188}
189189
190+ function errWrap ( fxn , form ) {
191+ try {
192+ return fxn ( form ) ;
193+ } catch ( err ) {
194+ alert ( "WebRTC is currently only supported by Chrome, Opera, and Firefox" ) ;
195+ return false ;
196+ }
197+ }
198+
190199</ script >
191200
192201< script >
You can’t perform that action at this time.
0 commit comments