Browse Source

apply patch by puddlejumper to make the JS IE compatible

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
630acf1f2b
  1. 55
      template/mumble/mumble.htm

55
template/mumble/mumble.htm

@ -169,29 +169,29 @@
{ name: 'password', type: 'string' }, { name: 'password', type: 'string' },
{ name: 'owner', type: 'int' }, { name: 'owner', type: 'int' },
{ name: 'admin', type: 'bool' }, { name: 'admin', type: 'bool' },
{ name: 'delete', type: 'bool' },
{ name: 'delete', type: 'bool' }
]); ]);
userAdminStore = new Ext.data.Store({ userAdminStore = new Ext.data.Store({
url: '{% url mumble.views.users DBaseObject.id %}', url: '{% url mumble.views.users DBaseObject.id %}',
reader: new Ext.data.JsonReader({ reader: new Ext.data.JsonReader({
root: 'objects', root: 'objects',
fields: userRecord,
fields: userRecord
}), }),
autoLoad: true, autoLoad: true,
remoteSort: false,
remoteSort: false
}); });
adminColumn = new Ext.grid.CheckColumn({ adminColumn = new Ext.grid.CheckColumn({
header: '{% trans "Admin on root channel" %}', header: '{% trans "Admin on root channel" %}',
dataIndex: 'admin', dataIndex: 'admin',
width: 50,
width: 50
}); });
deleteColumn = new Ext.grid.CheckColumn({ deleteColumn = new Ext.grid.CheckColumn({
header: '{% trans "Delete" %}', header: '{% trans "Delete" %}',
dataIndex: 'delete', dataIndex: 'delete',
width: 50,
width: 50
}); });
ownerCombo = new Ext.form.ComboBox({ ownerCombo = new Ext.form.ComboBox({
@ -205,10 +205,10 @@
url: '{% url mumble.views.djangousers %}', url: '{% url mumble.views.djangousers %}',
reader: new Ext.data.JsonReader({ reader: new Ext.data.JsonReader({
fields: [ 'uid', 'uname' ], fields: [ 'uid', 'uname' ],
root: 'objects',
}),
autoLoad: true,
root: 'objects'
}), }),
autoLoad: true
})
}); });
{% endif %} {% endif %}
@ -226,13 +226,12 @@
activeTab: {{ DisplayTab }}, activeTab: {{ DisplayTab }},
items: [ items: [
{ contentEl: 'mumble_motd', title: '{% trans "Server Info" %}', autoScroll: true }, { contentEl: 'mumble_motd', title: '{% trans "Server Info" %}', autoScroll: true },
{ contentEl: 'mumble_registration',
title: '{% trans "Registration" %}',
autoScroll: true,
{ contentEl: 'mumble_registration', title: '{% trans "Registration" %}', autoScroll: true,
{% if user.is_authenticated %} {% if user.is_authenticated %}
listeners: { listeners: {
activate: function(){ Ext.fly("id_name").focus() },
},
activate: function(){ Ext.fly("id_name").focus() }
}
{% endif %} {% endif %}
}, },
{% if CurrentUserIsAdmin %} {% if CurrentUserIsAdmin %}
@ -251,8 +250,8 @@
dataIndex: 'name', dataIndex: 'name',
sortable: true, sortable: true,
editor: new Ext.form.TextField({ editor: new Ext.form.TextField({
allowBlank: false,
}),
allowBlank: false
})
}, { }, {
header: '{% trans "Account owner" %}', header: '{% trans "Account owner" %}',
dataIndex: 'owner', dataIndex: 'owner',
@ -264,19 +263,20 @@
for( i = 0; i < items.length; i++ ) for( i = 0; i < items.length; i++ )
if( items[i].data.uid == value ) if( items[i].data.uid == value )
return items[i].data.uname; return items[i].data.uname;
},
}
}, adminColumn, { }, adminColumn, {
header: '{% trans "Change password" %}', header: '{% trans "Change password" %}',
dataIndex: 'password', dataIndex: 'password',
editor: new Ext.form.TextField({ editor: new Ext.form.TextField({
inputType: 'password',
inputType: 'password'
}), }),
renderer: function( value ){ renderer: function( value ){
ret = ''; ret = '';
for( i = 0; i < value.length; i++ ) for( i = 0; i < value.length; i++ )
ret += '*'; ret += '*';
return ret; return ret;
},
}
}, deleteColumn ] ), }, deleteColumn ] ),
tbar: [{ tbar: [{
text: '{% trans "Add" %}', text: '{% trans "Add" %}',
@ -287,7 +287,7 @@
admin: false, admin: false,
owner: '', owner: '',
password: '', password: '',
'delete': false,
'delete': false
} ) ); } ) );
} }
}, { }, {
@ -300,11 +300,10 @@
data.push(rec.data); data.push(rec.data);
} }
} }
var conn = new Ext.data.Connection(); var conn = new Ext.data.Connection();
conn.request( { conn.request( {
url: userAdminStore.url, url: userAdminStore.url,
params: { data: Ext.encode( data ), },
params: { data: Ext.encode( data ) },
success: function(){ success: function(){
for( i = 0; i < userAdminStore.data.items.length; i++ ){ for( i = 0; i < userAdminStore.data.items.length; i++ ){
rec = userAdminStore.data.items[i]; rec = userAdminStore.data.items[i];
@ -314,26 +313,26 @@
rec.commit(); rec.commit();
} }
} }
},
}
} ); } );
} }
}, { }, {
text: '{% trans "Resync with Murmur" %}', text: '{% trans "Resync with Murmur" %}',
handler: function(){ handler: function(){
userAdminStore.reload({ userAdminStore.reload({
params: { 'resync': 'true' },
params: { 'resync': 'true' }
}); });
},
}
}], }],
plugins: [ adminColumn, deleteColumn ],
},
plugins: [ adminColumn, deleteColumn ]
}
{% endif %} {% endif %}
] ]
},
}
{% for item in ChannelTable %} {% for item in ChannelTable %}
{ contentEl: 'mumble_{{ item.id }}', id: 'carditem_{{ item.id }}' }, { contentEl: 'mumble_{{ item.id }}', id: 'carditem_{{ item.id }}' },
{% endfor %} {% endfor %}
],
]
}); });
Ext.get( 'link_server' ).on( 'click', function( event, target ){ Ext.get( 'link_server' ).on( 'click', function( event, target ){

Loading…
Cancel
Save