Commit 523dc609 authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

fix(users/papeis): correção de validação unique de papeis

feat(dashboard): add add dropdown para troca deroca de  para alteração de papeis

feat(anexo): implementação não finalizada de anexoB
parent ffed7a02
<?php
namespace App\Http\Controllers;
use App\Models\Anexo;
use App\Models\Util\Menu;
use App\Models\Util\YesOrNo;
use Illuminate\Http\Request;
class AnexoController extends Controller
{
public function edit($user_pad_id)
{
$model = Anexo::whereUserPadId($user_pad_id)->first();
$menu = Menu::PADS;
$yesOrNo = YesOrNo::listYesOrNo();
$semestres = Anexo::listSemestre();
$categorias = Anexo::listCategoria();
//usado para testes;
$model = new Anexo();
return view('pad.anexo.update', [
'model' => $model,
'menu' => $menu,
'yesOrNo' => $yesOrNo,
'semestres' => $semestres,
'categorias' => $categorias,
]);
}
//implementar Request com FormRequest
public function update(Request $request, $user_pad_id)
{
dd($request->all());
}
}
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Imports\UsersImport;
use App\Models\User;
use App\Models\UserType;
use App\Models\Util\MaskHelper;
use App\Models\Util\Menu;
use App\Models\Util\Status;
use Illuminate\Http\Request;
......@@ -29,14 +30,16 @@ class UserController extends Controller
public function updatePerfil(Request $request)
{
$validator = User::validator($request->all());
$user_id = Auth::user()->id;
$validator = User::validator($request->all(), $user_id);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator->errors());
}
$user = User::find(Auth::user()->id);
$user = User::find($user_id);
$user->fill($request->all());
$user->document = MaskHelper::documentOnlyNumber($user->document);
$user->save();
return redirect()->route('edit_perfil')->with('success', 'Salvo com sucesso!');
......@@ -107,7 +110,6 @@ class UserController extends Controller
public function actionEdit(Request $request, $id)
{
$model = User::find($id);
$profiles = $model->profiles;
$status = [
......@@ -154,6 +156,21 @@ class UserController extends Controller
dd($id);
}
public function actionChangeProfile($user_id, $user_type_id)
{
$profiles = UserType::whereUserId($user_id)->whereStatus(Status::ATIVO)->get();
$profiles->each(function(UserType $model) {
$model->selected = false;
$model->save();
});
$profile = UserType::whereId($user_type_id)->first();
$profile->selected = true;
$profile->save();
return redirect('dashboard');
}
public function actionImport(Request $request)
{
$request->validate(['file' => 'required|mimes:csv,txt,xlx,xls,xlsx,pdf|max:2048']);
......
......@@ -15,9 +15,24 @@ class UserTypeController extends Controller
{
$validator = Validator::make($request->all(), UserType::rules(), UserType::messages());
if($validator->fails())
{
$profiles = UserType::whereUserId($request->user_id)->get();
$profiles->each(function(UserType $model) {
$model->selected = false;
$model->save();
});
$modelDeleted = UserType::whereUserId($request->user_id)->whereType($request->type)->onlyTrashed()->first();
if($modelDeleted)
{
$modelDeleted->restore();
$modelDeleted->status = $request->status;
$modelDeleted->selected = true;
$modelDeleted->save();
return redirect()
->route('user_edit', ['id' => $request->user_id, 'tab_active' => 'paper'])
->with('success', 'Papel cadastrado com Sucesso!');
}
$model = new UserType();
......@@ -31,13 +46,24 @@ class UserTypeController extends Controller
}
public function actionUpdate(Request $request, $id)
{
{
$model = UserType::find($id);
$model->status = $request->status;
//voltar e corrigir expressao logica
if($model->status == Status::INATIVO) {
$model->selected = false;
}
$model->save();
return redirect()
->route('user_edit', ['id' => $request->user_id, 'tab_active' => 'paper'])
->with('success', 'Papel atualizado com Sucesso!');
}
public function actionDelete($id)
{
$model = UserType::find($id);
$model->selected = false;
$model->delete();
return redirect()
......@@ -57,6 +83,7 @@ class UserTypeController extends Controller
'model' => $model,
'types' => $types,
'status' => $status,
'operation' => 'create'
]);
}
......@@ -72,6 +99,7 @@ class UserTypeController extends Controller
'model' => $model,
'types' => $types,
'status' => $status,
'operation' => 'update',
]);
}
......@@ -80,9 +108,10 @@ class UserTypeController extends Controller
$id = $request->id;
$user_id = $request->user_id;
$type = $request->type;
$operation = $request->operation;
$validator = Validator::make(
$request->all(), UserType::rules($id, $user_id, $type), UserType::messages()
$request->all(), UserType::rules($id, $user_id, $type, $operation), UserType::messages()
);
if($validator->passes()) {
......
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use PhpParser\Node\Expr\BooleanNot;
class AnexoRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
];
}
/**
* Get the validation messages that apply to the request.
*
* @return array
*/
public function messages()
{
return [
];
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Anexo extends Model
{
use SoftDeletes;
public const SEMESTE_1 = 1;
public const SEMESTE_2 = 2;
public const CATEGORIA_ = 1;
// public const CATEGORIA_ = 2;
// public const CATEGORIA_ = 3;
// public const CATEGORIA_ = 4;
// public const CATEGORIA_ = 5;
protected $table = "anexo_b";
protected $fillable = [
'user_pad_id',
'campus_id',
'curso_id',
'semestre',
'matricula',
'carga_horaria',
'categoria_nivel',
'afastamento_total',
'afastamento_total_desc',
'afastamento_parcial',
'afastamento_parcial_desc',
'direcao_sindical',
'licenca',
];
protected $dates = ['deleted_at'];
public static function listSemestre($value = null) {
$values = [
self::SEMESTE_1 => '1º SEMESTRE - JANEIRO - JULHO',
self::SEMESTE_2 => '2º SEMESTRE - AGOSTO - DEZEMBRO',
];
return $value !== null? $values[$value] : $values;
}
public static function listCategoria($value = null) {
$values = [
];
return $value !== null? $values[$value] : $values;
}
}
......@@ -24,7 +24,7 @@ class User extends Authenticatable
* The attributes that are mass assignable.
* @var array<int, string>
*/
protected $fillable = ['name', 'email', 'password', 'status', 'curso_id', 'campus_id'];
protected $fillable = ['name', 'email', 'password', 'status', 'curso_id', 'campus_id', 'document'];
/**
* The attributes that should be hidden for serialization.
......@@ -43,7 +43,7 @@ class User extends Authenticatable
protected $dates = ['deleted_at'];
public static function validator(array $attributes, $id = null)
public static function validator(array $attributes, $id = null, $ignoreStatus = true)
{
$rules = [
'name' => ['required', 'min:4'],
......@@ -51,9 +51,9 @@ class User extends Authenticatable
'curso_id' => ['integer'],
'campus_id' => ['integer'],
'status' => [
Rule::requiredIf ( function() use($id)
Rule::requiredIf ( function() use($ignoreStatus)
{
return (bool) $id;
return !$ignoreStatus;
}),
Rule::in([Status::ATIVO, Status::INATIVO]),
'required_with:id',
......@@ -161,15 +161,21 @@ class User extends Authenticatable
return $this->belongsTo(Unidade::class);
}
/**
* Return UserType
*
* @param integer $type_profile
* @return UserType
*/
public function profile($type_profile)
{
return UserType::initQuery()->whereUser($this->id)->whereType($type_profile)->first();
{
return UserType::whereUserId($this->id)->whereType($type_profile)->first();
}
/** @return UserType[]|null */
public function profiles()
{
return $this->hasMany(UserType::class);
{
return $this->hasMany(UserType::class)->whereStatus(Status::ATIVO);
}
/**
......@@ -177,7 +183,7 @@ class User extends Authenticatable
*/
public function profileSelected()
{
return $this->profiles()->where('selected', true)->first();
return $this->profiles()->whereSelected(true)->first();
}
/**
......
......@@ -21,6 +21,9 @@ class UserType extends Model
const COORDINATOR = 4; // Coordenador
const EVALUATOR = 5; // Avaliador
/** @var string with "create", "update" */
public $operation = 'create';
protected $table = 'user_type';
protected $fillable = ['user_id', 'pad_id', 'type', 'status', 'selected'];
......@@ -58,21 +61,25 @@ class UserType extends Model
return new UserTypeQuery(get_called_class());
}
public static function rules($id = null, $user_id = null, $type = null) {
public static function rules($id = null, $user_id = null, $type = null, $operation = 'create')
{
$typeRules = ['integer', Rule::in(array_keys(self::listType()))];
if($operation === 'create')
{
array_push($typeRules, 'required');
array_push($typeRules,
Rule::unique('user_type')->where(function($query) use ($user_id, $type) {
return $query->where('user_id', $user_id)->where('type', $type)->where('deleted_at', NULL);
})
);
}
return [
//add migration with deleted_at column
'user_id' => ['required', 'integer'],
'status' => ['required', 'integer', Rule::in([Status::ATIVO, Status::INATIVO])],
// 'selected' => []
'type' => [
'required',
'integer',
Rule::in(array_keys(self::listType())),
Rule::unique('user_type')->where(function($query) use($id, $user_id, $type)
{
return $query->where('user_id', '=', $user_id)->where('type', '=', $type);
})->ignore($id)
],
'type' => $typeRules
];
}
......@@ -90,10 +97,6 @@ class UserType extends Model
'status.required' => 'O campo "Status" é obrigatório!',
'status.in' => 'Selecione uma opção da lista de "Status"!',
'status.integer' => 'O campo "Status" deve cónter um inteiro!',
//selected
];
}
......@@ -101,10 +104,10 @@ class UserType extends Model
$values = [
self::ADMIN => 'Administrador',
self::TEACHER => 'Professor',
self::DIRECTOR => 'Diretor',
self::EVALUATOR => 'Avaliador',
self::COORDINATOR => 'Coordenador',
self::EVALUATOR => 'Evaluator',
self::DIRECTOR => 'Diretor',
self::TEACHER => 'Professor',
];
return $value !== null? $values[$value] : $values;
......
<?php
namespace App\Models\Util;
class MaskHelper
{
/**
* @param string $document
* @param array $clean
* @return string
* */
public static function documentOnlyNumber(string $document, array $clean = ['.', '-'])
{
return str_replace($clean, '', $document);
}
}
\ No newline at end of file
<?php
namespace App\Models\Util;
class YesOrNo
{
public const YES = 1;
public const NO = 0;
public static function listYesOrNo($value = null) {
$values = [
self::YES => 'SIM',
self::NO => 'NÃO',
];
return $value !== null? $values[$value] : $values;
}
}
\ No newline at end of file
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAnexoBTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('anexo_b', function (Blueprint $table) {
$table->id();
$table->foreignId('user_pad_id')->notNull();
$table->foreignId('campus_id');
$table->foreignId('curso_id');
$table->tinyInteger('semestre');
$table->string('matricula');
$table->double('carga_horaria');
$table->tinyInteger('categoria_nivel');
$table->boolean('afastamento_total');
$table->string('afastamento_total_desc');
$table->boolean('afastamento_parcial');
$table->string('afastamento_parcial_desc');
$table->boolean('direcao_sindical');
$table->string('licenca');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('anexo_b');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterUsersAddDocumentColumnTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('document')->after('campus_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('document');
});
}
}
index.html
css/*
img/*
js/*
node_modules/
bower_components/
.sparkleshare
libpeerconnection.log
.versions
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"esnext": true,
"expr": true,
"globals": {
"console": false,
"define": false,
"document": false,
"expect": false,
"module": false,
"require": false,
"window": false
},
"immed": true,
"indent": 4,
"latedef": false,
"maxcomplexity": 15,
"newcap": true,
"noarg": true,
"node": true,
"noempty": true,
"nonstandard": true,
"quotmark": "single",
"regexp": true,
"smarttabs": true,
"strict": false,
"trailing": true,
"undef": true,
"unused": true
}
language: node_js
node_js:
- "8.9.3"
before_script:
- npm install -g grunt-cli
- npm install
script: grunt test
== v1.14.16 (Jul/31 2019 16:32 +0100 by Igor Escobar) ==
Bugfixes:
* Fixed oldVal being updated prior to caret position calculation
* Solve loading JQuery as module on Meteor
== v1.14.15 (Mar/08 2018 22:59 +0000 by Igor Escobar) ==
Bugfixes:
* rolling back change to fix caret positioning. it didn’t worked on some devices
== v1.14.14 (Mar/02 2018 16:55 +0000 by Igor Escobar) ==
Bugfixes:
* fixing mask positioning delays
* unmask: also removing place holder if added on the first place.
* unmask: unsetting maxlength if we set it in the first place
== v1.14.13 (Dec/11 2017 18:59 +0000 by Igor Escobar) ==
Bugfixes:
* fixes caret issue explained on #636
* fixing use strict issue
== v1.14.12 (Oct/04 2017 09:57 +0100 by Igor Escobar) ==
Bugfixes:
* bug fixing on caret positioning on some devices
== v1.14.11 (May/30 2017 21:53 +0100 by Igor Escobar) ==
Bugfixes:
* fixing a lot of caret positioning issues. Thanks to @onuradsay
== v1.14.10 (Feb/13 2017 14:18 +0000 by Igor Escobar) ==
Bugfixes:
* fixing exception when oValue in undefined
== v1.14.9 (Jan/25 2017 11:17 +0000 by Igor Escobar) ==
Bugfixes:
* don’t use input event when using samsung browser or old chrome versions
== v1.14.8 (Dec/26 2016 13:18 +0000 by Igor Escobar) ==
Bugfixes:
* fixing caret on android with chrome 28
== v1.14.7 (Dec/25 2016 03:51 +0000 by Igor Escobar) ==
Bugfixes:
* improving caret positioning when cursor is on the middle
== v1.14.6 (Dec/24 2016 17:14 +0000 by Igor Escobar) ==
Bugfixes:
* fix caret positioning with multiple mask chars
== v1.14.5 (Dec/24 2016 14:42 +0000 by Igor Escobar) ==
Changes:
* fixing reserved word
== v1.14.4 (Dec/24 2016 14:38 +0000 by Igor Escobar) ==
Bugfixes:
* fixing android cursor positioning (special thanks to @felipejunges and @fernandobandeira)
== v1.14.3 (Nov/28 2016 11:53 +0000 by Igor Escobar) ==
Bugfixes:
* fixing caret positioning on safari
== v1.14.2 (Nov/27 2016 20:04 +0000 by Igor Escobar) ==
Bugfixes:
* apply auto maxlength in case the mask doesn't have recursive pattern
== v1.14.1 (Nov/27 2016 19:20 +0000 by Igor Escobar) ==
Bugfixes:
* Fix input value mangling when inserting before a static mask character
* fixing caret position issue
== v1.14.0 (Apr/03 2016 17:52 +0100 by Igor Escobar) ==
Bugfixes:
* Fix cursor jumping while editing in non-IE browsers. Thanks to @archwyrm
Features:
* adding masked function for better angular use
== v1.13.9 (Mar/20 2016 16:17 +0000 by Igor Escobar) ==
Changes:
* giving the opportunity to pass watchInputs locally
== v1.13.8 (Mar/06 2016 23:25 +0000 by Igor Escobar) ==
Changes:
* adding support for meteor
== v1.13.7 (Mar/06 2016 22:46 +0000 by Igor Escobar) ==
Bugfixes:
* fixing onChange behaviour
== v1.13.6 (Mar/06 2016 22:14 +0000 by Igor Escobar) ==
Bugfixes:
* fixing deploy procedure
== v1.13.5 (Mar/06 2016 22:01 +0000 by Igor Escobar) ==
Changes:
* adding clearIfNotMatch to globalOptions
Bugfixes:
* fixing some bugs when using non-input elements
* fixing mobile issues at #348.
* using input event when supported
== v1.13.4 (Aug/07 2015 14:21 +0100 by Igor Escobar) ==
Bugfixes:
* Add check to ensure that there are input elements before using them
== v1.13.3 (Jul/16 2015 16:11 +0100 by Igor Escobar) ==
Changes:
* adding main property to package.json
== v1.13.2 (Jul/16 2015 16:06 +0100 by Igor Escobar) ==
Bugfixes:
* change event wasnt being triggered in some cases
== v1.13.1 (Jul/07 2015 15:38 +0100 by Igor Escobar) ==
Bugfixes:
* destroying input event too
== v1.13.0 (Jul/07 2015 15:26 +0100 by Igor Escobar) ==
Changes:
* removing the autocomplete default.
Bugfixes:
* fixing bower file thanks to @lazyants
Features:
* prevent glitch when invalid chars.
* turning off autocomplete when browsers doesn't support oninput event.
== v1.12.0 (Jul/07 2015 11:37 +0100 by Igor Escobar) ==
Features:
* giving an alternative to the autocomplete/autofill problem.
== v1.11.4 (Feb/26 2015 22:11 +0000 by Igor Escobar) ==
Changes:
* grunt, jshint and better applyDataMask. Thanks to @lagden
* automated deploy to npm
== v1.11.3 (Jan/28 2015 15:41 +0000 by Igor Escobar) ==
Changes:
* Added commonjs module definition
== v1.11.2 (Dec/26 2014 15:36 +0000 by Igor Escobar) ==
Bugfixes:
* unreachable code
== v1.11.1 (Dec/26 2014 15:34 +0000 by Igor Escobar) ==
Bugfixes:
* unreachable code
== v1.11.0 (Dec/26 2014 15:33 +0000 by Igor Escobar) ==
Features:
* implementing selectOnFocus and data-mask-selectonfocus option
* adding public method called: .applyDataMask in case you want to decide whether to apply masks in data-mask fields
== v1.10.13 (Nov/19 2014 16:06 +0000 by Igor Escobar) ==
Bugfixes:
* fixing bug with watchInputs feature when mask is used as a function and not a string.
== v1.10.12 (Nov/06 2014 13:08 +0000 by Igor Escobar) ==
Changes:
* making a few improvements to make selection, copy events easier
== v1.10.11 (Nov/06 2014 11:26 +0000 by Igor Escobar) ==
Bugfixes:
* we need to revaluate dataMask flags everytime
== v1.10.10 (Nov/06 2014 10:41 +0000 by Igor Escobar) ==
Bugfixes:
* fixing dynamically data-mask added elements
== v1.10.9 (Nov/05 2014 10:52 +0000 by Igor Escobar) ==
Bugfixes:
* data-mask wasnt working
== v1.10.8 (Nov/01 2014 13:49 +0000 by Igor Escobar) ==
Changes:
* we dont need to seek for data-mask every time
== v1.10.7 (Nov/01 2014 13:18 +0000 by Igor Escobar) ==
Changes:
* little optimization
== v1.10.6 (Oct/28 2014 13:59 +0000 by Igor Escobar) ==
Bugfixes:
* fixing weird cursor problems in weird cases.
* dynamically added inputs wasnt working
== v1.10.5 (Oct/23 2014 11:41 +0100 by Igor Escobar) ==
Bugfixes:
* fixing weird cursor problems in weird cases.
== v1.10.4 (Oct/23 2014 11:02 +0100 by Igor Escobar) ==
Bugfixes:
* fixing on the fly mask change feature.
== v1.10.3 (Oct/22 2014 09:50 +0100 by Igor Escobar) ==
Bugfixes:
* fixing unmask method.
== v1.10.2 (Oct/20 2014 16:38 +0100 by Igor Escobar) ==
Bugfixes:
* onChange event fired at the wrong time when the field already has a value.
== v1.10.1 (Oct/20 2014 16:08 +0100 by Igor Escobar) ==
Bugfixes:
* fixing onChange event behaviour
== v1.10.0 (Oct/20 2014 10:56 +0100 by Igor Escobar) ==
Features:
* adding a way to change global settings like translation object and the byPassKeys object.
== v1.9.2 (Oct/20 2014 10:08 +0100 by Igor Escobar) ==
Bugfixes:
* fixing fallback digits implementation. Thanks @A1rPun
== v1.9.1 (Oct/18 2014 12:27 +0100 by Igor Escobar) ==
Bugfixes:
* cant convert circular json exception
== v1.9.0 (Oct/18 2014 12:07 +0100 by Igor Escobar) ==
Features:
* adding onInvalid callback
== v1.8.0 (Oct/17 2014 11:35 +0100 by Igor Escobar) ==
Changes:
* removing automatic maxlength support
* making a few optimizations to make it faster and retro compatible with other libraries
* creating globalOptions to make it more fast and flexible
Bugfixes:
* fixing issue #196
Features:
* adding the fallback translation option
== v1.7.8 (Oct/15 2014 10:55 +0100 by Igor Escobar) ==
Bugfixes:
* change event may experience issues
* avoid maximum call stack trace error
== v1.7.7 (Sep/10 2014 22:31 +0100 by Igor Escobar) ==
Bugfixes:
* fixing clojure compile issue
== v1.7.6 (Sep/10 2014 22:14 +0100 by Igor Escobar) ==
Bugfixes:
* fixing clearifnotmatch in masks with literal digits
== v1.7.5 (Sep/09 2014 15:43 +0100 by Igor Escobar) ==
Bugfixes:
* fixing paste inside of empty fields.
== v1.7.4 (Aug/11 2014 14:53 +0100 by Igor Escobar) ==
Changes:
* smaller and reliable code
== v1.7.3 (Aug/11 2014 11:28 +0100 by Igor Escobar) ==
Bugfixes:
* fixing issue #185
== v1.7.2 (Aug/08 2014 11:11 +0100 by Igor Escobar) ==
Changes:
* smaller code
Bugfixes:
* fixing remove bug
== v1.7.1 (Aug/08 2014 00:55 +0100 by Igor Escobar) ==
Changes:
* upgrading zepto, smaller syntax and fixing build
== v1.7.0 (Aug/07 2014 23:56 +0100 by Igor Escobar) ==
Features:
* applying masks to dynamically added elements. (html/javascript notation)
== v1.6.5 (Jun/30 2014 10:24 +0100 by Igor Escobar) ==
Bugfixes:
* fixing clearIfNotMatch feature in cases of optional and recursive digits
== v1.6.4 (May/08 2014 23:54 +0100 by Igor Escobar) ==
Changes:
* testing some deployment stunts
== v1.6.3 (May/08 2014 23:51 +0100 by Igor Escobar) ==
Changes:
* testing some deployment stunts
== v1.6.2 (May/08 2014 23:45 +0100 by Igor Escobar) ==
Bugfixes:
* fuckin typo
== v1.6.1 (May/08 2014 23:39 +0100 by Igor Escobar) ==
Bugfixes:
* fixing autofocus bug
== v1.6.0 (May/07 2014 21:13 +0100 by Igor Escobar) ==
Bugfixes:
* fixing autofocus bug
Features:
* adding support to the clearIfNotMatch option
* HTML5 placeholder support
== v1.5.7 (May/01 2014 18:37 +0100 by Igor Escobar) ==
Changes:
* some cleanup and stuff
== v1.5.6 (May/01 2014 18:30 +0100 by Igor Escobar) ==
Bugfixes:
* Bug in calculating difference between mask characters between old and new field values
* Fix stack limit exceeded
== v1.5.5 (Apr/27 2014 13:47 +0100 by Igor Escobar) ==
Changes:
* UMD (Universal Module Definition) patterns for JavaScript modules
Bugfixes:
* caret position correction
* 114 - Fix onChange Event error
== v1.5.4 (Feb/09 2014 12:02 +0000 by Igor Escobar) ==
Changes:
* optmizing code
== v1.5.3 (Feb/08 2014 14:59 +0000 by Igor Escobar) ==
Bugfixes:
* fixing ctrl a bug
== v1.5.2 (Dec/20 2013 16:35 +0000 by Igor Escobar) ==
Changes:
* smaller source code
== v1.5.1 (Dec/18 2013 22:34 +0000 by Igor Escobar) ==
Changes:
* fixing some code climate problems
== v1.5.0 (Dec/18 2013 22:10 +0000 by Igor Escobar) ==
Bugfixes:
* fixing getCleanVal()
Features:
* new public method called cleanVal
== v1.4.2 (Dec/16 2013 15:48 +0000 by Igor Escobar) ==
Bugfixes:
* Dirty fix for masks not completing with a literal
== v1.4.1 (Dec/09 2013 21:23 +0000 by Igor Escobar) ==
Changes:
* revising ignored keys
== v1.4.0 (Nov/28 2013 18:06 +0000 by Igor Escobar) ==
Features:
* caret positioning implementation
== v1.3.1 (Oct/08 2013 20:38 +0100 by Igor Escobar) ==
Changes:
* adding more keys to ignore list to make the char navigation smoothly
Bugfixes:
* Sounds like 'options' has disappeared for some reason
== v1.3.0 (Sep/13 2013 10:37 +0100 by Igor Escobar) ==
Features:
* creating the maxlength option
== v1.2.0 (Sep/07 2013 12:07 +0100 by Igor Escobar) ==
Features:
* adding the possibility to put recursive digits inside masks
== v1.1.3 (Sep/04 2013 21:21 +0100 by Igor Escobar) ==
Bugfixes:
* fixing late masking
== v1.1.2 (Aug/26 2013 15:08 +0100 by Igor Escobar) ==
Bugfixes:
* fixing mask on div,span etc
== v1.1.1 (Aug/26 2013 14:42 +0100 by Igor Escobar) ==
Bugfixes:
* better callback handling
== v1.1.0 (Aug/24 2013 15:59 +0100 by Igor Escobar) ==
Features:
* adding onchange support
== v1.0.3 (Aug/23 2013 23:10 +0100 by Igor Escobar) ==
Changes:
* optimizations to mask on non html fields
== v1.0.2 (Aug/23 2013 22:46 +0100 by Igor Escobar) ==
Bugfixes:
* adding remask method do improve callback performance
== v1.0.1 (Aug/23 2013 22:01 +0100 by Igor Escobar) ==
Changes:
* normal releases again
== v1.0.0 (Aug/23 2013 21:59 +0100 by Igor Escobar) ==
Features:
* huge refactoring focusing no reduce source code weight and bugfixing
== v0.11.5 (Aug/20 2013 17:11 +0100 by Igor Escobar) ==
Bugfixes:
* bug fixing when mask range is bigger than 2 digits.
== v0.11.4 (Aug/19 2013 10:24 +0100 by Igor Escobar) ==
Changes:
* adding de delete key to byPassKeys
== v0.11.3 (Aug/18 2013 00:48 +0100 by Igor Escobar) ==
Bugfixes:
* fixing zepto compatibily
== v0.11.2 (Aug/17 2013 18:39 +0100 by Igor Escobar) ==
Bugfixes:
* jmask iterate all items
== v0.11.1 (Aug/17 2013 18:32 +0100 by Igor Escobar) ==
Changes:
* a little bit smaller source code
== v0.11.0 (Aug/16 2013 21:27 +0100 by Igor Escobar) ==
Bugfixes:
* Altered "ignored keys" hook to run events (i.e. onKeyPress) afterwards. Otherwise, we miss key triggered events when the user deletes the entire text box, etc.
Features:
* adding support to method getCleanVal
== v0.10.1 (Jul/26 2013 09:35 +0100 by ) ==
== v0.10.0 (Jul/19 2013 23:07 +0100 by Igor Escobar) ==
Features:
* adding data-mask support
== v0.9.1 (Jul/19 2013 22:35 +0100 by Igor Escobar) ==
Changes:
* jQuery-Mask-Plugin is now available at bower.io
Bugfixes:
* fixing addEventListener on IE7
== v0.9.0 (Apr/24 2013 07:44 +0100 by Igor Escobar) ==
Features:
* Adding compatibility with Zepto.js
== v0.8.0 (Apr/07 2013 18:39 +0100 by Igor Escobar) ==
Features:
* applying masks anything != than input :)
* implementing the possibility of range chars ex: A{1,3}
== v0.7.11 (Apr/05 2013 22:12 +0100 by Igor Escobar) ==
Changes:
* now when you type a wrong char, the plugin will make your text fit inside of the mask instead of lose your data.
== v0.7.10 (Apr/04 2013 22:14 +0100 by Igor Escobar) ==
Changes:
* changing yui-compressor to clojure-compiler
== v0.7.9 (Apr/04 2013 22:04 +0100 by Igor Escobar) ==
Changes:
* refactoring and implementation of optional mask digits
Bugfixes:
* fixing maxlength and adding a smarter mask removal. issue #18
== v0.7.8 (Mar/30 2013 00:48 +0000 by Igor Escobar) ==
Changes:
* a few changes to get the code smallest possible.
* removing unnecessary methods and making code smaller.
== v0.7.7 (Mar/29 2013 12:38 +0000 by Igor Escobar) ==
Bugfixes:
* fixing copy and paste problem related on issue #15
== v0.7.6 (Mar/29 2013 00:28 +0000 by Igor Escobar) ==
Bugfixes:
* correcting mask formatationg problem related on issue #16
== v0.7.5 (Mar/03 2013 20:56 +0000 by Igor Escobar) ==
Changes:
* generating .gz file on deploy
== v0.7.4 (Mar/03 2013 20:38 +0000 by Igor Escobar) ==
Changes:
* changing minifier jsmin to yui compressor.
== v0.7.3 (Mar/02 2013 01:12 +0000 by Igor Escobar) ==
Bugfixes:
* bug fixing when typed wrong data type on mixing masks.
== v0.7.2 (Feb/24 2013 22:02 +0000 by Igor Escobar) ==
Bugfixes:
* fuckin stupid comma.
== v0.7.1 (Feb/24 2013 21:57 +0000 by Igor Escobar) ==
Changes:
* testing the private method maskToRegex
* a little bit of changes to make the code more testable
== v0.7.0 (Feb/12 2013 00:30 +0000 by Igor Escobar) ==
Features:
* Now you can decide for jquery mask plugin how to interpret 0 to 9, A and S and even teach him how to reconize patterns.
== v0.6.3 (Feb/11 2013 12:20 +0000 by Igor Escobar) ==
Bugfixes:
* When the user paste a text and the last char is valid sanitize may fail
== v0.6.2 (Feb/11 2013 00:02 +0000 by Igor Escobar) ==
Bugfixes:
* allowing the user type the same character as the mask without erasing it.
== v0.6.1 (Jan/20 2013 23:57 +0000 by Igor Escobar) ==
Changes:
* changing the way ta deployment occurs to correct jquery plugins deployments.
== v0.6.0 (Jan/18 2013 17:19 +0000 by Igor Escobar) ==
Changes:
* Now pushing jQuery Mask Plugin to jQuery Plugins Repository
== v0.5.4 (Jan/17 2013 23:06 +0000 by Igor Escobar) ==
Changes:
* upgrading jquery plugins manifest file
== v0.5.3 (Jan/17 2013 22:48 +0000 by Igor Escobar) ==
Bugfixes:
* correctly generating jmask version inside of jquery mask source
== v0.5.2 (Jan/17 2013 22:43 +0000 by Igor Escobar) ==
Changes:
* Now pushing to jQuery Plugin Repository
== v0.5.1 (Jan/07 2013 23:33 +0000 by Igor Escobar) ==
Changes:
* improving the deploy process with the new stepup's upgrade.
== v0.5.0 (Oct/27 2012 13:40 +0100 by Igor Escobar) ==
Bugfixes:
* Bug fixes on OnSupport method with Firefox.
Features:
* the first parameter of the .mask() function, now accepts a string or a anonymous function
== v0.4.7 (Aug/06 2012 22:56 +0100 by Igor Escobar) ==
Changes:
* Nothing big, just class refactoring
== v0.4.6 (Aug/06 2012 01:25 +0100 by Igor Escobar) ==
Changes:
- better OOP design
- implementing the jquery data object on each mask field
- implementing the public method .remove to disable and remove the mask
== v0.4.5 (Aug/04 2012 01:31 +0100 by Igor Escobar) ==
Changes:
- improving support to complex jquery selectors
- performance improvement.
- callback handling improvement
== v0.4.4 (Jun/03 2012 21:01 +0100 by Igor Escobar) ==
Bugfixes:
* Bug fixes on Internet Explorer 8.
== v0.4.3 (Mar/19 2012 21:52 +0000 by Igor Escobar) ==
Bugfixes:
* Corrigindo bug para mascaras com +
== v0.4.2 (Mar/18 2012 15:28 +0000 by Igor Escobar) ==
Bugfixes:
* Mascara não pararecia no firefox
== v0.4.1 (Mar/18 2012 15:01 +0000 by Igor Escobar) ==
Bugfixes:
* Corrigindo tim das macaras.
== v0.4.0 (Mar/18 2012 14:51 +0000 by Igor Escobar) ==
Features:
* Implementado mascara reversa para moeda/cpf/rg/etc.
* Nova engine.
== v0.3.0 (Mar/14 2012 10:14 +0000 by Igor Escobar) ==
Changes:
* License and comments up to date.
Features:
* On-the-fly mask change.
* onComplete and onKeyPress new callbacks.
== v0.2.5 (Mar/13 2012 22:55 +0000 by Igor Escobar) ==
Bugfixes:
- Corrigindo ctrl+v com mascara errada. - Cortando dados que exceder a mascara no ctrl+v ou se segurar alguma tecla. - Refatorando algumas partes do código.
== v0.2.4 (Mar/13 2012 11:06 +0000 by Igor Escobar) ==
Changes:
* Codigo refatorado, otimizado, validação mais precisa e efetiva.
== v0.2.3 (Mar/13 2012 01:01 +0000 by Igor Escobar) ==
Changes:
* Melhorando expressoes regulares.
== v0.2.2 (Mar/13 2012 00:50 +0000 by Igor Escobar) ==
Bugfixes:
* Corrindo regex de validação
== v0.2.1 (Mar/13 2012 00:41 +0000 by Igor Escobar) ==
Bugfixes:
* Corrigida validação alphanumerica.
== v0.2.0 (Mar/13 2012 00:24 +0000 by Igor Escobar) ==
Features:
- Input Data Type Validation.
- Automatic MaxLength (When are not defined).
- Live Event Implemented for Ajax-based Apps.
- Mixed mask with validation.
* S for string digit
* A for alphanumeric digit
* 0 to 9 for numeric digit.
== v0.1.1 (Mar/10 2012 14:05 +0000 by Igor Escobar) ==
Bugfixes:
* Implementando Crossbrowser event handling.
== v0.1.0 (Mar/10 2012 13:10 +0000 by Igor Escobar) ==
Features:
* Implementando mascaras com espaço para data e hora
== v0.0.1 (Mar/10 2012 04:42 +0000 by Igor Escobar) ==
Changes:
* Refatorando o codigo para suportar multiplas instancias
### Have you take a look into our docs?
https://igorescobar.github.io/jQuery-Mask-Plugin/
### Want to contribute? Make sure you read this first
https://github.com/igorescobar/jQuery-Mask-Plugin#contributing
Is this plugin helping you out? Buy me a beer and cheers! :beer:
:bowtie: https://www.paypal.me/igorcescobar
FROM phusion/baseimage:0.9.17
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Java 8 for Google's clojure compiler
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer git unzip ruby-full && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN mkdir /app
RUN mkdir /app/clojure-compiler
# Clojure compiler
RUN \
curl -O http://dl.google.com/closure-compiler/compiler-latest.zip && \
unzip compiler-latest.zip -d /app/clojure-compiler && \
chmod a+x /app/clojure-compiler && \
rm compiler-latest.zip
RUN gem install bundler pry step-up --no-rdoc --no-ri
# Install Node.js
RUN curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
RUN apt-get install --yes nodejs
RUN npm install -g grunt-cli
WORKDIR /app/jquery-mask-plugin
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: ['src/{,*/}*.js']
},
connect: {
server: {
options: {
port: 9001,
base: './'
}
}
},
qunit: {
all: {
options: {
urls: [
'http://localhost:9001/test/test-for-jquery-1.11.1.html',
'http://localhost:9001/test/test-for-jquery-1.7.2.html',
'http://localhost:9001/test/test-for-jquery-1.8.3.html',
'http://localhost:9001/test/test-for-jquery-1.9.1.html',
'http://localhost:9001/test/test-for-jquery-2.1.1.html',
'http://localhost:9001/test/test-for-jquery-3.0.0.html',
'http://localhost:9001/test/test-for-zepto.html'
]
}
}
}
});
// A convenient task alias.
grunt.registerTask('test', ['jshint', 'connect', 'qunit']);
grunt.registerTask('default', ['test']);
};
### Have you take a look into our docs?
https://igorescobar.github.io/jQuery-Mask-Plugin/
### Make sure your read this before opening a new issue:
https://github.com/igorescobar/jQuery-Mask-Plugin#problems-or-questions
#### Device
[...]
#### Browser (and version)?
[...]
#### Functional `jsfiddle` exemplifying your problem:
You can use this one as exemple: http://jsfiddle.net/igorescobar/6pco4om7/
#### Describe de problem depth:
[...]
Is this plugin helping you out? Buy me a beer and cheers! :beer:
:bowtie: https://www.paypal.me/igorcescobar
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment