* [MOD] Line separators

This commit is contained in:
nuxsmin
2015-07-31 14:05:56 +02:00
committed by nuxsmin
parent b5f6894ee2
commit 5875faaa6f
10 changed files with 203 additions and 181 deletions

View File

@@ -522,7 +522,7 @@ class Init
*/
private static function goLogin()
{
$controller = new Controller\MainC();
$controller = new Controller\MainC(null,'login');
$controller->getLogin();
$controller->view();
exit;

View File

@@ -196,6 +196,10 @@ a:hover, a:active, a:focus {
width: 100%;
}
#container.login {
padding-top: 10em;
}
#container.main {
position: absolute;
top: 0;
@@ -1487,7 +1491,7 @@ footer img {
#boxLogin {
width: 500px;
min-height: 150px;
margin: 75px auto;
margin: 0 auto;
padding: 3em;
background: url("../imgs/logo_full.svg") no-repeat #fff;
background-size: 300px auto;
@@ -1541,7 +1545,7 @@ footer img {
#boxLogout {
width: 250px;
margin: 0 auto;
margin: 5em auto 5em auto;
font-size: 14px;
text-align: center;
color: orange;
@@ -1552,7 +1556,7 @@ footer img {
#boxUpdated {
width: 350px;
margin: 0 auto;
margin: 5em auto 5em auto;
font-size: 14px;
text-align: center;
color: green;

View File

@@ -4,7 +4,7 @@
<title><?php echo $appInfo['appname'],' :: ',$appInfo['appdesc']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="<?php echo $logo; ?>">
<link rel="icon" type="image/png" href="<?php echo $logoIcon; ?>">
<link rel="stylesheet" href="<?php echo $cssLink;?>" />
<script type="text/javascript" src="<?php echo $jsLink?>"></script>
</head>

View File

@@ -1,41 +1,8 @@
<script type="text/javascript">
$(function () {
$(".sel-chosen-ns").chosen({disable_search: true, width: "250px"});
chosenDetect();
$(".sel-chosen-usergroup").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Grupo'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
$(".sel-chosen-user").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Usuario'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
$(".sel-chosen-profile").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Perfil'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
$(".sel-chosen-customer").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Cliente'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
$(".sel-chosen-category").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Categoría'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
passwordDetect();
$(".download").button({
icons: {primary: " ui-icon-arrowthickstop-1-s"}
@@ -43,68 +10,6 @@
$(".help-box").dialog({autoOpen: false, title: '<?php echo _('Ayuda'); ?>', width: screen.width / 2.5});
// Crear los iconos de acciones sobre claves
$('.passwordfield__input').each(function () {
var thisParent = $(this).parent();
var targetId = $(this).attr('id');
var btnMenu = '<button id="menu-speed-' + targetId + '" class="mdl-button mdl-js-button mdl-button--icon" type="button"><i class="material-icons">more_vert</i></button>';
btnMenu += '<ul class="mdl-menu mdl-js-menu" for="menu-speed-' + targetId + '">';
btnMenu += '<li class="mdl-menu__item passGen" data-targetid="' + targetId + '"><i class="material-icons">settings</i><?php echo _('Generar clave aleatoria'); ?></li>';
btnMenu += '<li class="mdl-menu__item passComplexity" data-targetid="' + targetId + '"><i class="material-icons">vpn_key</i><?php echo _('Complejidad'); ?></li>';
btnMenu += '<li class="mdl-menu__item reset" data-targetid="' + targetId + '"><i class="material-icons">refresh</i><?php echo _('Reset'); ?></li>';
thisParent.after('<div class="password-actions" />');
thisParent.next('.password-actions')
.prepend('<span class="passLevel passLevel-' + targetId + ' fullround" title="<?php echo _('Nivel de fortaleza de la clave'); ?>"></span>')
.prepend('<i class="showpass material-icons" title="<?php echo _('Mostrar Clave'); ?>" data-targetid="' + targetId + '">remove_red_eye</i>')
.prepend(btnMenu);
$(this).on('keyup', function () {
checkPassLevel($(this).val(), targetId);
});
});
// Crear los iconos de acciones sobre claves (sólo mostrar clave)
$('.passwordfield__input-show').each(function () {
var thisParent = $(this).parent();
var targetId = $(this).attr('id');
thisParent
.after('<i class="showpass material-icons" title="<?php echo _('Mostrar Clave'); ?>" data-targetid="' + targetId + '">remove_red_eye</i>');
});
// Crear evento para generar clave aleatoria
$('.passGen').each(function () {
$(this).on('click', function () {
var targetId = $(this).data('targetid');
password(11, true, true, targetId);
});
});
$('.passComplexity').each(function () {
$(this).on('click', function () {
complexityDialog();
});
});
// Crear evento para mostrar clave generada/introducida
$('.showpass').each(function () {
$(this).on('mouseover', function () {
var targetId = $(this).data('targetid');
$(this).attr('title', $('#' + targetId).val());
});
});
$('.reset').each(function () {
$(this).on('click', function () {
var targetId = $(this).data('targetid');
$('#' + targetId).val('');
$('#' + targetId + 'R').val('');
});
});
$(document).ready(function () {
// Stick the #nav to the top of the window
var nav = $('#actionsBar');

View File

@@ -1001,11 +1001,11 @@ function password(length, special, fancy, targetId) {
}
}
if(!complexity.numbers && randomNumber >= 48 && randomNumber <= 57){
if (!complexity.numbers && randomNumber >= 48 && randomNumber <= 57) {
continue;
}
if(!complexity.uppercase && randomNumber >= 65 && randomNumber <= 90){
if (!complexity.uppercase && randomNumber >= 65 && randomNumber <= 90) {
continue;
}
@@ -1184,6 +1184,7 @@ function getBrowser() {
return browser;
}
// Dialógo de configuración de complejidad de clave
function complexityDialog(targetId) {
$('<div></div>').dialog({
modal: true,
@@ -1241,4 +1242,116 @@ function complexityDialog(targetId) {
$(this).dialog("destroy");
}
});
}
// Detectar los campos select y añadir funciones
function chosenDetect() {
var selectWidth = "250px";
var searchTreshold = 10;
$(".sel-chosen-usergroup").chosen({
placeholder_text_single: LANG[21],
disable_search_threshold: searchTreshold,
no_results_text: LANG[26],
width: selectWidth
});
$(".sel-chosen-user").chosen({
placeholder_text_single: LANG[22],
disable_search_threshold: searchTreshold,
no_results_text: LANG[26],
width: selectWidth
});
$(".sel-chosen-profile").chosen({
placeholder_text_single: LANG[23],
disable_search_threshold: searchTreshold,
no_results_text: LANG[26],
width: selectWidth
});
$(".sel-chosen-customer").chosen({
placeholder_text_single: LANG[24],
disable_search_threshold: searchTreshold,
no_results_text: LANG[26],
width: selectWidth
});
$(".sel-chosen-category").chosen({
placeholder_text_single: LANG[25],
disable_search_threshold: searchTreshold,
no_results_text: LANG[26],
width: selectWidth
});
$(".sel-chosen-ns").chosen({disable_search: true, width: selectWidth});
}
// Detectar los campos de clave y añadir funciones
function passwordDetect() {
// Crear los iconos de acciones sobre claves
$('.passwordfield__input').each(function () {
var thisParent = $(this).parent();
var targetId = $(this).attr('id');
var btnMenu = '<button id="menu-speed-' + targetId + '" class="mdl-button mdl-js-button mdl-button--icon" type="button" title="' + LANG[27] + '"><i class="material-icons">more_vert</i></button>';
btnMenu += '<ul class="mdl-menu mdl-js-menu" for="menu-speed-' + targetId + '">';
btnMenu += '<li class="mdl-menu__item passGen" data-targetid="' + targetId + '"><i class="material-icons">settings</i>' + LANG[28] + '</li>';
btnMenu += '<li class="mdl-menu__item passComplexity" data-targetid="' + targetId + '"><i class="material-icons">vpn_key</i>' + LANG[29] + '</li>';
btnMenu += '<li class="mdl-menu__item reset" data-targetid="' + targetId + '"><i class="material-icons">refresh</i>' + LANG[30] + '</li>';
thisParent.after('<div class="password-actions" />');
thisParent.next('.password-actions')
.prepend('<span class="passLevel passLevel-' + targetId + ' fullround" title="' + LANG[31] + '"></span>')
.prepend('<i class="showpass material-icons" title="' + LANG[32] + '" data-targetid="' + targetId + '">remove_red_eye</i>')
.prepend(btnMenu);
$(this).on('keyup', function () {
checkPassLevel($(this).val(), targetId);
});
});
// Crear los iconos de acciones sobre claves (sólo mostrar clave)
$('.passwordfield__input-show').each(function () {
var thisParent = $(this).parent();
var targetId = $(this).attr('id');
thisParent
.after('<i class="showpass material-icons" title="' + LANG[32] + '" data-targetid="' + targetId + '">remove_red_eye</i>');
});
// Crear evento para generar clave aleatoria
$('.passGen').each(function () {
$(this).on('click', function () {
var targetId = $(this).data('targetid');
password(11, true, true, targetId);
});
});
$('.passComplexity').each(function () {
$(this).on('click', function () {
complexityDialog();
});
});
// Crear evento para mostrar clave generada/introducida
$('.showpass').each(function () {
$(this).on('mouseover', function () {
var targetId = $(this).data('targetid');
$(this).attr('title', $('#' + targetId).val());
});
});
// Reset de los campos de clave
$('.reset').each(function () {
$(this).on('click', function () {
var targetId = $(this).data('targetid');
$('#' + targetId).val('');
$('#' + targetId + 'R').val('');
// Actualizar objetos de MDL
componentHandler.upgradeDom();
});
});
}

View File

@@ -97,10 +97,4 @@
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<script>
$(function(){
$('#imgLogo').click(function(){$('#smpass').show();});
})
</script>
<?php endif; ?>

View File

@@ -42,7 +42,7 @@
<tr>
<td class="descField"><?php echo _('Perfil'); ?></td>
<td class="valField">
<select id="selProfile" name="profileid" class="select-box" <?php echo $isDisabled; ?> required>
<select id="selProfile" name="profileid" class="select-box sel-chosen-profile" <?php echo $isDisabled; ?> required>
<option value="0"></option>
<?php foreach ($profiles as $id => $name): ?>
<option
@@ -55,7 +55,7 @@
<tr>
<td class="descField"><?php echo _('Grupo'); ?></td>
<td class="valField">
<select id="selGroup" name="groupid" class="select-box" <?php echo $isDisabled; ?> required>
<select id="selGroup" name="groupid" class="select-box sel-chosen-usergroup" <?php echo $isDisabled; ?> required>
<option value="0"></option>
<?php foreach ($groups as $id => $name): ?>
<option
@@ -87,16 +87,11 @@
<td class="descField"><?php echo _('Clave'); ?></td>
<td class="valField">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="userpass" name="pass" type="password" required class="mdl-textfield__input fg-blue100"
<input id="userpass" name="pass" type="password" required class="mdl-textfield__input passwordfield__input fg-blue100"
maxlength="50" OnKeyUp="checkPassLevel(this.value)">
<label class="mdl-textfield__label"
for="userpass"><?php echo _('Clave'); ?></label>
</div>
<div class="password-actions" >
<i class="showpass material-icons" data-targetid="userpass" title="<?php echo _('Mostrar Clave'); ?>">remove_red_eye</i>
<i class="passGen material-icons" data-targetid="userpass" title="<?php echo _('Generar clave aleatoria'); ?>">settings</i>
<span class="passLevel passLevel-userpass fullround" title="<?php echo _('Nivel de fortaleza de la clave'); ?>"></span>
</div>
</td>
</tr>
@@ -207,42 +202,8 @@
</div>
<script>
$(function () {
$("#selProfile").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Perfil'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
$("#selGroup").chosen({
placeholder_text_single: "<?php echo _('Seleccionar Grupo'); ?>",
disable_search_threshold: 10,
no_results_text: "<?php echo _('Sin resultados'); ?>",
width: "250px"
});
chosenDetect();
// Crear evento para generar clave aleatoria
$('.passGen').each(function () {
$(this).on('click', function () {
var targetId = $(this).data('targetid');
password(11, true, true, targetId);
console.log();
console.log(targetId);
var mdl = new MaterialTextfield();
$('#' + targetId).parent().addClass(mdl.CssClasses_.IS_DIRTY).removeClass(mdl.CssClasses_.IS_INVALID);
$('#' + targetId + 'R').parent().addClass(mdl.CssClasses_.IS_DIRTY).removeClass(mdl.CssClasses_.IS_INVALID);
});
});
// Crear evento para mostrar clave generada/introducida
$('.showpass').each(function () {
$(this).on('mouseover', function () {
var targetId = $(this).data('targetid');
$(this).attr('title', $('#' + targetId).val());
});
});
passwordDetect();
});
</script>

View File

@@ -27,6 +27,8 @@ define('APP_ROOT', '..');
require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';
require_once 'strings.js.php';
$themeJsPath = VIEW_PATH . DIRECTORY_SEPARATOR . \SP\Init::$THEME . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'js.php';
$jsFilesBase = array(
@@ -45,33 +47,12 @@ $jsFilesBase = array(
array('href' => 'js/zxcvbn-async.js', 'min' => true)
);
$arrJsLang = array(
_('Error en la consulta'),
_('Ha ocurrido un error'),
_('Sesión finalizada'),
_('Borrar la cuenta?'),
_('Borrar el usuario?'),
_('Guarde la configuración para que sea efectiva'),
_('Clave Generada'),
_('Nivel alto'),
_('Nivel medio'),
_('Nivel bajo'),
_('Nivel muy alto'),
_('Utilizar al menos 8 caracteres'),
_('Borrar elemento?'),
_('Página no encontrada'),
_('Archivo no soportado para visualizar'),
_('Eliminar archivo?'),
_('Su navegador no soporta subir archivos con HTML5'),
_('Demasiados archivos'),
sprintf(_('No es posible guardar el archivo.%sTamaño máximo:'), '<br>'),
_('Extensión no permitida'),
_('Vaciar el registro de eventos?')
);
?>
//$js = "// i18n language array from PHP. Detected language: " . SP_Init::$LANG . "\n";
echo "var APP_ROOT = '" . SP\Init::$WEBURI . "';\n";
echo "var LANG = ['" . implode("','", SP\Util::arrayJSEscape($arrJsLang)) . "'];\n";
var APP_ROOT = '<?php echo SP\Init::$WEBURI; ?>';
var LANG = ['<?php echo implode("','", SP\Util::arrayJSEscape($stringsJsLang)) ?>'];
<?php
if (file_exists($themeJsPath)){
include $themeJsPath;

63
js/strings.js.php Normal file
View File

@@ -0,0 +1,63 @@
<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org
*
* This file is part of sysPass.
*
* sysPass is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sysPass 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*
*/
$stringsJsLang = array(
0 => _('Error en la consulta'),
1 => _('Ha ocurrido un error'),
2 => _('Sesión finalizada'),
3 => _('Borrar la cuenta?'),
4 => _('Borrar el usuario?'),
5 => _('Guarde la configuración para que sea efectiva'),
6 => _('Clave Generada'),
7 => _('Nivel alto'),
8 => _('Nivel medio'),
9 => _('Nivel bajo'),
10 => _('Nivel muy alto'),
11 => _('Utilizar al menos 8 caracteres'),
12 => _('Borrar elemento?'),
13 => _('Página no encontrada'),
14 => _('Archivo no soportado para visualizar'),
15 => _('Eliminar archivo?'),
16 => _('Su navegador no soporta subir archivos con HTML5'),
17 => _('Demasiados archivos'),
18 => sprintf(_('No es posible guardar el archivo.%sTamaño máximo:'), '<br>'),
19 => _('Extensión no permitida'),
20 => _('Vaciar el registro de eventos?'),
21 => _('Seleccionar Grupo'),
22 => _('Seleccionar Usuario'),
23 => _('Seleccionar Perfil'),
24 => _('Seleccionar Cliente'),
25 => _('Seleccionar Categoría'),
26 => _('Sin resultados'),
27 => _('Opciones de clave'),
28 => _('Generar clave aleatoria'),
29 => _('Complejidad'),
30 => _('Reset'),
31 => _('Nivel de fortaleza de la clave'),
32 => _('Mostrar Clave')
);

View File

@@ -60,6 +60,7 @@ class MainC extends Controller implements ActionsInterface
$this->view->assign('startTime', microtime());
$this->view->assign('page', $page);
$this->view->assign('loggedIn', \SP\Init::isLoggedIn());
$this->view->assign('logoIcon', Init::$WEBURI . '/imgs/logo.png');
$this->view->assign('logoNoText', Init::$WEBURI . '/imgs/logo.svg');
$this->view->assign('logo', Init::$WEBURI . '/imgs/logo_full.svg');