rbrindley: branch 2.0 r4929 - /branches/2.0/config/skype.html
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Jun 23 12:57:47 CDT 2009
Author: rbrindley
Date: Tue Jun 23 12:57:44 2009
New Revision: 4929
URL: http://svn.asterisk.org/svn-view/asterisk-gui?view=rev&rev=4929
Log:
- Added the following to the Skype page
- <html>, <head>, <title>, and "Content-Type" <meta>
- moved js to the bottom
Modified:
branches/2.0/config/skype.html
Modified: branches/2.0/config/skype.html
URL: http://svn.asterisk.org/svn-view/asterisk-gui/branches/2.0/config/skype.html?view=diff&rev=4929&r1=4928&r2=4929
==============================================================================
--- branches/2.0/config/skype.html (original)
+++ branches/2.0/config/skype.html Tue Jun 23 12:57:44 2009
@@ -18,156 +18,34 @@
* at the top of the source tree.
*
-->
-<script src="js/jquery.js"></script>
-<script src="js/astman.js"></script>
-<script src="js/jquery.tooltip.js"></script>
-<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
-<style type="text/css">
-
- #table_AccountsList {
- border: 1px solid #666666;
- margin: 0px;
- text-align: center;
- padding : 1px;
- width: 95% ;
- }
- #table_AccountsList tr.heading { background: #FFFFFF;}
- #table_AccountsList tr.frow { background: #6b79a5; color: #CED7EF; }
- #table_AccountsList tr.frow td{ font-weight:bold; }
- #table_AccountsList tr td { padding : 3px; }
- #table_AccountsList tr.even { background: #DFDFDF; }
- #table_AccountsList tr.odd { background: #FFFFFF; }
- #table_AccountsList tr.even:hover, #table_AccountsList tr.odd:hover {
- background: #a8b6e5;
- cursor: default;
- }
-
-</style>
-<script>
-var SKYPE_CNF, EXTENSIONS_CNF;
-var EDIT_ACCOUNT ;
-
-var set_as_default_account = function(a){
- ASTGUI.updateaValue({ file: 'chan_skype.conf', context :'general', variable :'default_user', value : a });
- ASTGUI.feedback( { msg: 'Updated default Skype Account !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
- window.location.reload();
-};
-
-var MANAGE_ACCOUNTS = {
- listAccounts : function(){
- var TBL = ASTGUI.TABLE('table_AccountsList');
- TBL.clear();
- var DEFAULT_ACCOUNT = ( SKYPE_CNF.hasOwnProperty('general') && SKYPE_CNF['general'].default_user ) ? SKYPE_CNF['general'].default_user : '' ;
-
- for( account in SKYPE_CNF ){
- if( !SKYPE_CNF.hasOwnProperty(account) || account == 'general' ) continue;
-
- var img_name = ( DEFAULT_ACCOUNT == account ) ? 'images/edit.gif' : 'images/checkbox_blank.gif';
- var tmp_context = SKYPE_CNF[account].context || '' ;
- var dest_line = ( tmp_context && tmp_context.contains(ASTGUI.contexts.skypeIncomingContext) && EXTENSIONS_CNF.hasOwnProperty(tmp_context) ) ? EXTENSIONS_CNF[tmp_context][0] : '' ;
- var tmp = "<span class='guiButton' onclick=\"MANAGE_ACCOUNTS.edit_Account_form('" + account +"')\">Edit</span> "
- + "<span class='guiButtonDelete' onclick=\"MANAGE_ACCOUNTS.deleteAccount('" + account +"')\">Delete</span>" ;
-
-
- TBL.addRow({className : 'alt'});
-
- TBL.addCell({ html: "<A href='#' TITLE='Set this as the default skype account for placing calls through skype network'><img src="
- + img_name + " border=0 onclick=\"set_as_default_account('" + account +"')\"></A>" });
- TBL.addCell({ html: account, align: 'left' });
- TBL.addCell({ html: ASTGUI.parseContextLine.showAs(dest_line) , align:'left' });
- TBL.addCell({ html: tmp, align: 'center' });
+<html>
+<head>
+ <title>Manage Skype Accounts</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
+
+ <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
+ <style type="text/css">
+
+ #table_AccountsList {
+ border: 1px solid #666666;
+ margin: 0px;
+ text-align: center;
+ padding : 1px;
+ width: 95% ;
}
-
- if( TBL.rowCount() == 0 ){
- TBL.addRow();
- TBL.addCell({ html: "<BR>No Skype accounts configured. <BR> Please click on 'New Skype Account' button to send and receive calls via your skype account.<BR><BR>"});
- }else{
- TBL.addRow({className : 'frow'} , 0);
-
- TBL.addCell({ html: 'Default' });
- TBL.addCell({ html: 'Skype Account' , align: 'left' });
- TBL.addCell({ html: 'Incoming calls go to', align: 'left' });
- TBL.addCell({ html: '' });
+ #table_AccountsList tr.heading { background: #FFFFFF;}
+ #table_AccountsList tr.frow { background: #6b79a5; color: #CED7EF; }
+ #table_AccountsList tr.frow td{ font-weight:bold; }
+ #table_AccountsList tr td { padding : 3px; }
+ #table_AccountsList tr.even { background: #DFDFDF; }
+ #table_AccountsList tr.odd { background: #FFFFFF; }
+ #table_AccountsList tr.even:hover, #table_AccountsList tr.odd:hover {
+ background: #a8b6e5;
+ cursor: default;
}
- },
-
- deleteAccount : function(a, silentmode){ // MANAGE_ACCOUNTS.deleteAccount()
- if(!silentmode && !confirm("Delete account '"+ a + "' ?")) { return true; }
- var u = new listOfSynActions('chan_skype.conf') ;
- u.new_action('delcat', a, '', '');
- u.callActions();
-
- u.clearActions('extensions.conf');
- u.new_action('delcat', SKYPE_CNF[a].context , '', '');
- u.callActions();
-
- if( !silentmode ){
- ASTGUI.feedback({ msg:"Deleted skype account '" + a + "'", showfor: 3, color:'red', bgcolor:'#FFFFFF' });
- window.location.reload();
- }
- },
-
- saveAccount : function(){ // MANAGE_ACCOUNTS.saveAccount()
- if ( EDIT_ACCOUNT ){
- this.deleteAccount(EDIT_ACCOUNT, true);
- }
-
- var v = new listOfActions('chan_skype.conf');
- var catname = ASTGUI.getFieldValue('edit_account_text');
- var contextName = ASTGUI.contexts.skypeIncomingContext + catname ;
- v.new_action('newcat', catname, '', '');
- v.new_action('append', catname , 'secret', ASTGUI.getFieldValue('edit_account_secret'));
- v.new_action('append', catname , 'context', contextName);
- v.new_action('append', catname , 'exten', 's');
- v.new_action('append', catname , 'disallow', 'all');
- v.new_action('append', catname , 'allow', 'ulaw');
- v.new_action('append', catname , 'authpolicy', 'allow');
- v.callActions( function(){
-
- var W = new listOfSynActions('extensions.conf') ;
- W.new_action('newcat', contextName , '', '');
- W.new_action('append', contextName , 'exten', 's,1,' + ASTGUI.getFieldValue('edit_accountIncomingCalls_select') );
- W.callActions();
-
- ASTGUI.feedback( { msg:"updated account" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
- window.location.reload();
- });
- },
-
- new_Account_form : function(){ // MANAGE_ACCOUNTS.new_Account_form()
- EDIT_ACCOUNT = '';
- ASTGUI.resetTheseFields([ 'edit_account_text', 'edit_account_secret','edit_accountIncomingCalls_select' ]);
- $('#account_editdiv .dialog_title > span').html('Add a Skype Account');
- $('#account_editdiv').showWithBg();
- },
-
- edit_Account_form : function(a){ // MANAGE_ACCOUNTS.edit_Account_form()
- if(!a) return;
- EDIT_ACCOUNT = a;
-
- ASTGUI.updateFieldToValue( 'edit_account_text', EDIT_ACCOUNT );
- ASTGUI.updateFieldToValue( 'edit_account_secret', SKYPE_CNF[EDIT_ACCOUNT].secret );
-
- var dest_line = ( EXTENSIONS_CNF.hasOwnProperty( SKYPE_CNF[EDIT_ACCOUNT].context ) ) ? EXTENSIONS_CNF[ SKYPE_CNF[EDIT_ACCOUNT].context ][0] : '' ;
- ASTGUI.selectbox.selectDestinationOption( 'edit_accountIncomingCalls_select' , ASTGUI.parseContextLine.getAppWithArgs(dest_line) );
-
- $('#account_editdiv .dialog_title > span').html('Edit Account ' + EDIT_ACCOUNT );
- $('#account_editdiv').showWithBg();
- }
-
-};
-
-var localajaxinit = function(){
- top.document.title = 'Configure Skype Accounts' ;
- SKYPE_CNF = config2json({ filename:'chan_skype.conf', usf:1 });
- EXTENSIONS_CNF = config2json({ filename:'extensions.conf', usf:0 });
-
- var someArray = parent.miscFunctions.getAllDestinations() ;
- ASTGUI.selectbox.populateArray('edit_accountIncomingCalls_select', someArray);
-
- MANAGE_ACCOUNTS.listAccounts();
-};
-</script>
+
+ </style>
+</head>
<body bgcolor="EFEFEF">
<div class="iframeTitleBar">
Manage Skype Accounts
@@ -210,5 +88,133 @@
</table>
</div>
+ <script src="js/jquery.js"></script>
+ <script src="js/astman.js"></script>
+ <script src="js/jquery.tooltip.js"></script>
+ <script>
+ var SKYPE_CNF, EXTENSIONS_CNF;
+ var EDIT_ACCOUNT ;
+
+ var set_as_default_account = function(a){
+ ASTGUI.updateaValue({ file: 'chan_skype.conf', context :'general', variable :'default_user', value : a });
+ ASTGUI.feedback( { msg: 'Updated default Skype Account !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
+ window.location.reload();
+ };
+
+ var MANAGE_ACCOUNTS = {
+ listAccounts : function(){
+ var TBL = ASTGUI.TABLE('table_AccountsList');
+ TBL.clear();
+ var DEFAULT_ACCOUNT = ( SKYPE_CNF.hasOwnProperty('general') && SKYPE_CNF['general'].default_user ) ? SKYPE_CNF['general'].default_user : '' ;
+
+ for( account in SKYPE_CNF ){
+ if( !SKYPE_CNF.hasOwnProperty(account) || account == 'general' ) continue;
+
+ var img_name = ( DEFAULT_ACCOUNT == account ) ? 'images/edit.gif' : 'images/checkbox_blank.gif';
+ var tmp_context = SKYPE_CNF[account].context || '' ;
+ var dest_line = ( tmp_context && tmp_context.contains(ASTGUI.contexts.skypeIncomingContext) && EXTENSIONS_CNF.hasOwnProperty(tmp_context) ) ? EXTENSIONS_CNF[tmp_context][0] : '' ;
+ var tmp = "<span class='guiButton' onclick=\"MANAGE_ACCOUNTS.edit_Account_form('" + account +"')\">Edit</span> "
+ + "<span class='guiButtonDelete' onclick=\"MANAGE_ACCOUNTS.deleteAccount('" + account +"')\">Delete</span>" ;
+
+
+ TBL.addRow({className : 'alt'});
+
+ TBL.addCell({ html: "<A href='#' TITLE='Set this as the default skype account for placing calls through skype network'><img src="
+ + img_name + " border=0 onclick=\"set_as_default_account('" + account +"')\"></A>" });
+ TBL.addCell({ html: account, align: 'left' });
+ TBL.addCell({ html: ASTGUI.parseContextLine.showAs(dest_line) , align:'left' });
+ TBL.addCell({ html: tmp, align: 'center' });
+ }
+
+ if( TBL.rowCount() == 0 ){
+ TBL.addRow();
+ TBL.addCell({ html: "<BR>No Skype accounts configured. <BR> Please click on 'New Skype Account' button to send and receive calls via your skype account.<BR><BR>"});
+ }else{
+ TBL.addRow({className : 'frow'} , 0);
+
+ TBL.addCell({ html: 'Default' });
+ TBL.addCell({ html: 'Skype Account' , align: 'left' });
+ TBL.addCell({ html: 'Incoming calls go to', align: 'left' });
+ TBL.addCell({ html: '' });
+ }
+ },
+
+ deleteAccount : function(a, silentmode){ // MANAGE_ACCOUNTS.deleteAccount()
+ if(!silentmode && !confirm("Delete account '"+ a + "' ?")) { return true; }
+ var u = new listOfSynActions('chan_skype.conf') ;
+ u.new_action('delcat', a, '', '');
+ u.callActions();
+
+ u.clearActions('extensions.conf');
+ u.new_action('delcat', SKYPE_CNF[a].context , '', '');
+ u.callActions();
+
+ if( !silentmode ){
+ ASTGUI.feedback({ msg:"Deleted skype account '" + a + "'", showfor: 3, color:'red', bgcolor:'#FFFFFF' });
+ window.location.reload();
+ }
+ },
+
+ saveAccount : function(){ // MANAGE_ACCOUNTS.saveAccount()
+ if ( EDIT_ACCOUNT ){
+ this.deleteAccount(EDIT_ACCOUNT, true);
+ }
+
+ var v = new listOfActions('chan_skype.conf');
+ var catname = ASTGUI.getFieldValue('edit_account_text');
+ var contextName = ASTGUI.contexts.skypeIncomingContext + catname ;
+ v.new_action('newcat', catname, '', '');
+ v.new_action('append', catname , 'secret', ASTGUI.getFieldValue('edit_account_secret'));
+ v.new_action('append', catname , 'context', contextName);
+ v.new_action('append', catname , 'exten', 's');
+ v.new_action('append', catname , 'disallow', 'all');
+ v.new_action('append', catname , 'allow', 'ulaw');
+ v.new_action('append', catname , 'authpolicy', 'allow');
+ v.callActions( function(){
+
+ var W = new listOfSynActions('extensions.conf') ;
+ W.new_action('newcat', contextName , '', '');
+ W.new_action('append', contextName , 'exten', 's,1,' + ASTGUI.getFieldValue('edit_accountIncomingCalls_select') );
+ W.callActions();
+
+ ASTGUI.feedback( { msg:"updated account" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
+ window.location.reload();
+ });
+ },
+
+ new_Account_form : function(){ // MANAGE_ACCOUNTS.new_Account_form()
+ EDIT_ACCOUNT = '';
+ ASTGUI.resetTheseFields([ 'edit_account_text', 'edit_account_secret','edit_accountIncomingCalls_select' ]);
+ $('#account_editdiv .dialog_title > span').html('Add a Skype Account');
+ $('#account_editdiv').showWithBg();
+ },
+
+ edit_Account_form : function(a){ // MANAGE_ACCOUNTS.edit_Account_form()
+ if(!a) return;
+ EDIT_ACCOUNT = a;
+
+ ASTGUI.updateFieldToValue( 'edit_account_text', EDIT_ACCOUNT );
+ ASTGUI.updateFieldToValue( 'edit_account_secret', SKYPE_CNF[EDIT_ACCOUNT].secret );
+
+ var dest_line = ( EXTENSIONS_CNF.hasOwnProperty( SKYPE_CNF[EDIT_ACCOUNT].context ) ) ? EXTENSIONS_CNF[ SKYPE_CNF[EDIT_ACCOUNT].context ][0] : '' ;
+ ASTGUI.selectbox.selectDestinationOption( 'edit_accountIncomingCalls_select' , ASTGUI.parseContextLine.getAppWithArgs(dest_line) );
+
+ $('#account_editdiv .dialog_title > span').html('Edit Account ' + EDIT_ACCOUNT );
+ $('#account_editdiv').showWithBg();
+ }
+
+ };
+
+ var localajaxinit = function(){
+ top.document.title = 'Configure Skype Accounts' ;
+ SKYPE_CNF = config2json({ filename:'chan_skype.conf', usf:1 });
+ EXTENSIONS_CNF = config2json({ filename:'extensions.conf', usf:0 });
+
+ var someArray = parent.miscFunctions.getAllDestinations() ;
+ ASTGUI.selectbox.populateArray('edit_accountIncomingCalls_select', someArray);
+
+ MANAGE_ACCOUNTS.listAccounts();
+ };
+ </script>
</body>
-
+</html>
More information about the asterisk-gui-commits
mailing list