Browse Source

Added a bunch of new elements to settings and cleaned up existing ones.

pull/75/head
Simon Eisenmann 11 years ago
parent
commit
8e58e6a5dc
  1. 5
      src/styles/components/_settings.scss
  2. 2
      static/css/main.min.css
  3. 31
      static/js/filters/displayuserid.js
  4. 6
      static/js/filters/filters.js
  5. 143
      static/partials/settings.html

5
src/styles/components/_settings.scss

@ -89,3 +89,8 @@
padding-bottom: 10px; padding-bottom: 10px;
} }
} }
settings-advanced {
padding-top: 15px;
display: block;
}

2
static/css/main.min.css vendored

File diff suppressed because one or more lines are too long

31
static/js/filters/displayuserid.js

@ -0,0 +1,31 @@
/*
* Spreed WebRTC.
* Copyright (C) 2013-2014 struktur AG
*
* This file is part of Spreed WebRTC.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define([], function() {
// displayUserid
return [function() {
return function(id) {
// This filter does nothing - it is there for plugin support.
return id;
};
}];
});

6
static/js/filters/filters.js

@ -23,12 +23,14 @@ define([
'filters/displayname', 'filters/displayname',
'filters/buddyimagesrc', 'filters/buddyimagesrc',
'filters/displayconference'], function(_, displayName, buddyImageSrc, displayConference) { 'filters/displayconference',
'filters/displayuserid'], function(_, displayName, buddyImageSrc, displayConference, displayUserid) {
var filters = { var filters = {
displayName: displayName, displayName: displayName,
buddyImageSrc: buddyImageSrc, buddyImageSrc: buddyImageSrc,
displayConference: displayConference displayConference: displayConference,
displayUserid: displayUserid
}; };
var initialize = function(angModule) { var initialize = function(angModule) {

143
static/partials/settings.html

@ -3,33 +3,35 @@
<div class="form-horizontal" on-enter="saveSettings(user)" on-escape="reset()" <div class="form-horizontal" on-enter="saveSettings(user)" on-escape="reset()"
<fieldset> <fieldset>
<legend>{{_('Profile')}}</legend> <settings-profile>
<div class="form-group"> <legend>{{_('Profile')}}</legend>
<label class="col-xs-4 control-label">{{_('Your picture')}}</label> <div class="form-group">
<label class="col-xs-4 control-label">{{_('Your picture')}}</label>
<div class="col-xs-8">
<label>
<buddy-picture></buddy-picture>
</label>
</div>
</div>
<div class="form-group">
<label class="col-xs-4 control-label">{{_('Your name')}}</label>
<div class="col-xs-8"> <div class="col-xs-8">
<label> <input type="text" class="form-control" ng-model="user.displayName" placeholder="{{_('Name')}}" />
<buddy-picture/>
</label>
</div> </div>
</div>
<div class="form-group">
<label class="col-xs-4 control-label">{{_('Your name')}}</label>
<div class="col-xs-8">
<input type="text" class="form-control" ng-model="user.displayName" placeholder="{{_('Name')}}" />
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-xs-4 control-label">{{_('Status message')}}</label>
<label class="col-xs-4 control-label">{{_('Status message')}}</label> <div class="col-xs-8">
<div class="col-xs-8"> <input type="text" class="form-control" ng-model="user.message" placeholder="{{_('What\'s on your mind?')}}" />
<input type="text" class="form-control" ng-model="user.message" placeholder="{{_('What\'s on your mind?')}}" /> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <div class="col-xs-8 col-xs-offset-4">
<div class="col-xs-8 col-xs-offset-4"> <p class="help-block">{{_('Profile information is public.')}}</p>
{{_('Profile information is public.')}} </div>
</div> </div>
</div> </settings-profile>
<div ng-controller="UsersettingsController as usersettings"> <settings-account ng-controller="UsersettingsController as usersettings">
<div ng-if="(withUsers && withUsersRegistration) || userid"> <div ng-if="(withUsers && withUsersRegistration) || userid">
<legend>{{_('Account')}}</legend> <legend>{{_('Account')}}</legend>
<div class="form-group"> <div class="form-group">
@ -37,32 +39,32 @@
<div ng-switch="withUsersMode"> <div ng-switch="withUsersMode">
<form ng-switch-when="certificate" class="col-xs-8" target="users_registration_certificate_iframe"> <form ng-switch-when="certificate" class="col-xs-8" target="users_registration_certificate_iframe">
<div ng-if="!userid"> <div ng-if="!userid">
<keygen style="display:none" name="pubkey"/> <keygen class="hidden" name="pubkey"/>
<label ng-if="!userid && withUsersRegistration && usersettings.registerUserid"> <label ng-if="!userid && withUsersRegistration && usersettings.registerUserid">
<button class="btn btn-small btn-primary" ng-click="usersettings.registerUserid($event.target)">{{_('Register')}}</button> <button class="btn btn-small btn-primary" ng-click="usersettings.registerUserid($event.target)">{{_('Register')}}</button>
</label> </label>
<iframe style="display:none" name="users_registration_certificate_iframe"></iframe> <iframe class="hidden" name="users_registration_certificate_iframe"></iframe>
</div> </div>
<div ng-if="userid"> <div ng-if="userid">
<pre class="small">{{userid}}</pre> <pre class="small">{{userid|displayUserid}}</pre>
<span class-"help-block">{{_('Authenticated by certificate. To log out you have to remove your certificate from the browser.')}}</span> <span class-"help-block">{{_('Authenticated by certificate. To log out you have to remove your certificate from the browser.')}}</span>
</div> </div>
</form> </form>
<div ng-switch-default class="col-xs-8"> <div ng-switch-default class="col-xs-8">
<div ng-if="!userid && withUsersRegistration"> <div ng-if="!userid && withUsersRegistration">
<label ng-if="usersettings.loginUserid"> <label ng-if="usersettings.loginUserid">
<button class="btn btn-small btn-primary" ng-click="usersettings.loginUserid()">{{_('Sign in')}}</button> <button class="btn btn-small btn-primary btn-sign-in" ng-click="usersettings.loginUserid()">{{_('Sign in')}}</button>
</label> </label>
<label ng-if="usersettings.registerUserid"> <label ng-if="usersettings.registerUserid">
<button class="btn btn-small btn-link" ng-click="usersettings.registerUserid($event.target)">{{_('Create an account')}}</button> <button class="btn btn-small btn-link btn-create-account" ng-click="usersettings.registerUserid($event.target)">{{_('Create an account')}}</button>
</label> </label>
</div> </div>
<pre class="small" ng-if="userid">{{userid}}</pre> <pre class="small" ng-if="userid">{{userid|displayUserid}}</pre>
<label ng-if="userid && withUsersForget && usersettings.forgetUserid"> <label ng-if="userid && withUsersForget && usersettings.forgetUserid">
<button class="btn btn-small btn-default" ng-click="usersettings.forgetUserid()">{{_('Sign out')}}</button> <button class="btn btn-small btn-default btn-sign-out" ng-click="usersettings.forgetUserid()">{{_('Sign out')}}</button>
</label> </label>
<label ng-if="userid && usersettings.accountUserid"> <label ng-if="userid && usersettings.accountUserid">
<button class="btn btn-small btn-link" ng-click="usersettings.accountUserid()">{{_('Manage account')}}</button> <button class="btn btn-small btn-link btn-manage-account" ng-click="usersettings.accountUserid()">{{_('Manage account')}}</button>
</label> </label>
</div> </div>
</div> </div>
@ -74,8 +76,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </settings-account>
<div ng-show="mediaSources.supported || isChrome"> <settings-media ng-show="mediaSources.supported || isChrome">
<legend>{{_('Media')}}</legend> <legend>{{_('Media')}}</legend>
<div ng-show="mediaSources.supported"> <div ng-show="mediaSources.supported">
<div class="form-group"> <div class="form-group">
@ -101,36 +103,38 @@
</div> </div>
</div> </div>
</div> </div>
</div> </settings-media>
<legend>{{_('Settings')}}</legend> <settings-settings>
<div class="form-group"> <legend>{{_('Settings')}}</legend>
<label class="col-xs-4 control-label">{{_('Language')}}</label> <div class="form-group">
<div class="col-xs-8"> <label class="col-xs-4 control-label">{{_('Language')}}</label>
<select class="form-control" ng-model="user.settings.language" ng-options="l.code as l.name for l in availableLanguages | orderBy:'code'"></select> <div class="col-xs-8">
<span class="help-block">{{_('Language changes become active on reload.')}}</span> <select class="form-control" ng-model="user.settings.language" ng-options="l.code as l.name for l in availableLanguages | orderBy:'code'"></select>
<span class="help-block">{{_('Language changes become active on reload.')}}</span>
</div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-xs-4 control-label">{{_('Default room')}}</label>
<label class="col-xs-4 control-label">{{_('Default room')}}</label> <div class="col-xs-8">
<div class="col-xs-8"> <input type="text" class="form-control" ng-model="user.settings.defaultRoom" placeholder="{{_('Main')}}" />
<input type="text" class="form-control" ng-model="user.settings.defaultRoom" placeholder="{{_('Main')}}" /> <span class="help-block">{{_('Set alternative room to join at start.')}}</span>
<span class="help-block">{{_('Set alternative room to join at start.')}}</span> </div>
</div> </div>
</div> <div class="form-group" ng-show="desktopNotify.supported">
<div class="form-group" ng-show="desktopNotify.supported"> <label class="col-xs-4 control-label">{{_('Desktop notification')}}</label>
<label class="col-xs-4 control-label">{{_('Desktop notification')}}</label> <div class="col-xs-8">
<div class="col-xs-8"> <p class="form-control-static" ng-switch="desktopNotify.level">
<p class="form-control-static" ng-switch="desktopNotify.level"> <a ng-switch-when="default" class="btn btn-small btn-success" ng-click="requestDesktopNotifyPermission()">{{_('Enable')}}</a>
<a ng-switch-when="default" class="btn btn-small btn-success" ng-click="requestDesktopNotifyPermission()">{{_('Enable')}}</a> <span class="text-error" ng-switch-when="denied"><i class="fa fa-exclamation-triangle"></i>{{_('Denied - check your browser settings')}}</span>
<span class="text-error" ng-switch-when="denied"><i class="fa fa-exclamation-triangle"></i>{{_('Denied - check your browser settings')}}</span> <span class="text-success" ng-switch-when="granted"><i class="fa fa-ok"></i>{{_('Allowed')}}</span>
<span class="text-success" ng-switch-when="granted"><i class="fa fa-ok"></i>{{_('Allowed')}}</span> </p>
</p> </div>
</div> </div>
</div> </settings-settings>
<div settings-extra></div> <settings-extra settings-extra></settings-extra>
<div class="collapse" collapse="showAdvancedSettings" style="padding-top:15px"> <settings-advanced class="collapse" collapse="showAdvancedSettings">
<legend>{{_('Advanced settings')}}</legend> <legend>{{_('Advanced settings')}}</legend>
@ -161,17 +165,9 @@
</div> </div>
<!--<div ng-show="isChrome"> <settings-advanced-extra settings-advanced-extra></settings-advanced-extra>
<legend>{{_('Experimental settings')}}</legend>
<div></div> </settings-advanced>
</div>-->
<div settings-advanced-extra></div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-xs-4 control-label"></div> <div class="col-xs-4 control-label"></div>
@ -183,14 +179,17 @@
<hr/> <hr/>
<div class="form-group"> <div class="form-group">
<div class="col-xs-4 control-label"></div> <div class="col-xs-8 col-xs-offset-4">
<div class="col-xs-8"> <div class="checkbox">
<div class="checkbox" style="padding-bottom:1em">
<label> <label>
<input type="checkbox" ng-model="rememberSettings"> {{_('Remember settings')}} <input type="checkbox" ng-model="rememberSettings"> {{_('Remember settings')}}
</label> </label>
<p class="text-warning" style="margin-top:4px" ng-show="userid &&!rememberSettings && loadedUserlogin"><strong>{{_('Your ID will still be kept - press the log out button above to delete the ID.')}}</strong></p> <p class="text-warning" ng-show="userid &&!rememberSettings && loadedUserlogin"><strong>{{_('Your ID will still be kept - press the log out button above to delete the ID.')}}</strong></p>
</div> </div>
</div>
</div>
<div class="form-group">
<div class="col-xs-8 col-xs-offset-4">
<a ng-click="layout.settings=false" class="btn btn-default">{{_('Close')}}</a> <a ng-click="layout.settings=false" class="btn btn-default">{{_('Close')}}</a>
</div> </div>
</div> </div>

Loading…
Cancel
Save