mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
Various code cleanup
This commit is contained in:
@@ -34,7 +34,8 @@ class DecryptAttachment extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.}
|
protected $signature
|
||||||
|
= 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.}
|
||||||
{directory:Where the file must be stored.}';
|
{directory:Where the file must be stored.}';
|
||||||
|
|
||||||
|
|
||||||
|
@@ -18,6 +18,11 @@ use FireflyIII\Support\Import\Prerequisites\PrerequisitesInterface;
|
|||||||
class BankController extends Controller
|
class BankController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public function postPrerequisites()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $bank
|
* @param string $bank
|
||||||
*/
|
*/
|
||||||
@@ -31,6 +36,7 @@ class BankController extends Controller
|
|||||||
if ($object->hasPrerequisites()) {
|
if ($object->hasPrerequisites()) {
|
||||||
$view = $object->getView();
|
$view = $object->getView();
|
||||||
$parameters = $object->getViewParameters();
|
$parameters = $object->getViewParameters();
|
||||||
|
|
||||||
return view($view, $parameters);
|
return view($view, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,8 +46,4 @@ class BankController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postPrerequisites() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@@ -56,26 +56,6 @@ class FileController extends Controller
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is step 1. Upload a file.
|
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$subTitle = trans('firefly.import_index_sub_title');
|
|
||||||
$subTitleIcon = 'fa-home';
|
|
||||||
$importFileTypes = [];
|
|
||||||
$defaultImportType = config('firefly.default_import_format');
|
|
||||||
|
|
||||||
foreach (array_keys(config('firefly.import_formats')) as $type) {
|
|
||||||
$importFileTypes[$type] = trans('firefly.import_file_type_' . $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('import.file.index', compact('subTitle', 'subTitleIcon', 'importFileTypes', 'defaultImportType'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is step 3. This repeats until the job is configured.
|
* This is step 3. This repeats until the job is configured.
|
||||||
*
|
*
|
||||||
@@ -140,6 +120,24 @@ class FileController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is step 1. Upload a file.
|
||||||
|
*
|
||||||
|
* @return View
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$subTitle = trans('firefly.import_index_sub_title');
|
||||||
|
$subTitleIcon = 'fa-home';
|
||||||
|
$importFileTypes = [];
|
||||||
|
$defaultImportType = config('firefly.default_import_format');
|
||||||
|
|
||||||
|
foreach (array_keys(config('firefly.import_formats')) as $type) {
|
||||||
|
$importFileTypes[$type] = trans('firefly.import_file_type_' . $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('import.file.index', compact('subTitle', 'subTitleIcon', 'importFileTypes', 'defaultImportType'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is step 2. It creates an Import Job. Stores the import.
|
* This is step 2. It creates an Import Job. Stores the import.
|
||||||
|
@@ -78,11 +78,11 @@ class TagController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Request $request
|
* Create a new tag.
|
||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function create(Request $request)
|
public function create()
|
||||||
{
|
{
|
||||||
$subTitle = trans('firefly.new_tag');
|
$subTitle = trans('firefly.new_tag');
|
||||||
$subTitleIcon = 'fa-tag';
|
$subTitleIcon = 'fa-tag';
|
||||||
@@ -100,6 +100,8 @@ class TagController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Delete a tag
|
||||||
|
*
|
||||||
* @param Tag $tag
|
* @param Tag $tag
|
||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
@@ -134,13 +136,13 @@ class TagController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Tag $tag
|
* Edit a tag
|
||||||
*
|
*
|
||||||
* @param TagRepositoryInterface $repository
|
* @param Tag $tag
|
||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function edit(Tag $tag, TagRepositoryInterface $repository)
|
public function edit(Tag $tag)
|
||||||
{
|
{
|
||||||
$subTitle = trans('firefly.edit_tag', ['tag' => $tag->tag]);
|
$subTitle = trans('firefly.edit_tag', ['tag' => $tag->tag]);
|
||||||
$subTitleIcon = 'fa-tag';
|
$subTitleIcon = 'fa-tag';
|
||||||
@@ -158,6 +160,8 @@ class TagController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* View all tags
|
||||||
|
*
|
||||||
* @param TagRepositoryInterface $repository
|
* @param TagRepositoryInterface $repository
|
||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
|
@@ -278,6 +278,7 @@ class ImportStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log::debug('getForeignCurrencyId: journal has no foreign currency.');
|
Log::debug('getForeignCurrencyId: journal has no foreign currency.');
|
||||||
|
|
||||||
// return null in other cases.
|
// return null in other cases.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ interface AttachmentRepositoryInterface
|
|||||||
*
|
*
|
||||||
* @return Attachment
|
* @return Attachment
|
||||||
*/
|
*/
|
||||||
public function findWithoutUser(int $id):Attachment;
|
public function findWithoutUser(int $id): Attachment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection
|
* @return Collection
|
||||||
|
@@ -20,6 +20,7 @@ interface Verifier
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Verify the given password against (some) service.
|
* Verify the given password against (some) service.
|
||||||
|
*
|
||||||
* @param string $password
|
* @param string $password
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
@@ -27,6 +27,13 @@ interface ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
public function getData(): array;
|
public function getData(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return possible warning to user.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getWarningMessage(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ImportJob $job
|
* @param ImportJob $job
|
||||||
*
|
*
|
||||||
@@ -43,11 +50,4 @@ interface ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
public function storeConfiguration(array $data): bool;
|
public function storeConfiguration(array $data): bool;
|
||||||
|
|
||||||
/**
|
|
||||||
* Return possible warning to user.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getWarningMessage(): string;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,16 @@ class Initial implements ConfigurationInterface
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return possible warning to user.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getWarningMessage(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ImportJob $job
|
* @param ImportJob $job
|
||||||
*
|
*
|
||||||
@@ -135,14 +145,4 @@ class Initial implements ConfigurationInterface
|
|||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return possible warning to user.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getWarningMessage(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -106,6 +106,16 @@ class Map implements ConfigurationInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return possible warning to user.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getWarningMessage(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ImportJob $job
|
* @param ImportJob $job
|
||||||
*
|
*
|
||||||
@@ -268,14 +278,4 @@ class Map implements ConfigurationInterface
|
|||||||
|
|
||||||
return $column;
|
return $column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return possible warning to user.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getWarningMessage(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -262,7 +262,7 @@ class Roles implements ConfigurationInterface
|
|||||||
$this->warning = '';
|
$this->warning = '';
|
||||||
}
|
}
|
||||||
if ($assigned === 0 || !$hasAmount) {
|
if ($assigned === 0 || !$hasAmount) {
|
||||||
$this->warning = trans('csv.roles_warning');
|
$this->warning = strval(trans('csv.roles_warning'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -16,13 +16,6 @@ use FireflyIII\User;
|
|||||||
|
|
||||||
interface PrerequisitesInterface
|
interface PrerequisitesInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Set the user for this Prerequisites-routine. Class is expected to implement and save this.
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
*/
|
|
||||||
public function setUser(User $user): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns view name that allows user to fill in prerequisites.
|
* Returns view name that allows user to fill in prerequisites.
|
||||||
*
|
*
|
||||||
@@ -44,4 +37,11 @@ interface PrerequisitesInterface
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasPrerequisites(): bool;
|
public function hasPrerequisites(): bool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the user for this Prerequisites-routine. Class is expected to implement and save this.
|
||||||
|
*
|
||||||
|
* @param User $user
|
||||||
|
*/
|
||||||
|
public function setUser(User $user): void;
|
||||||
}
|
}
|
@@ -17,6 +17,7 @@ return [
|
|||||||
[
|
[
|
||||||
'4.3' => 'Make sure you run the migrations and clear your cache. If you need more help, please check Github or the Firefly III website.',
|
'4.3' => 'Make sure you run the migrations and clear your cache. If you need more help, please check Github or the Firefly III website.',
|
||||||
'4.6.3' => 'This will be the last version to require PHP7.0. Future versions will require PHP7.1 minimum.',
|
'4.6.3' => 'This will be the last version to require PHP7.0. Future versions will require PHP7.1 minimum.',
|
||||||
|
'4.6.4' => 'This version of Firefly III requires PHP7.1.'
|
||||||
],
|
],
|
||||||
'install' =>
|
'install' =>
|
||||||
[
|
[
|
||||||
|
515
public/css/daterangepicker.css
vendored
515
public/css/daterangepicker.css
vendored
@@ -1,141 +1,213 @@
|
|||||||
.daterangepicker {
|
.daterangepicker {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
width: 278px;
|
width: 278px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
top: 100px;
|
top: 100px;
|
||||||
left: 20px;
|
left: 20px;
|
||||||
/* Calendars */ }
|
/* Calendars */
|
||||||
.daterangepicker:before, .daterangepicker:after {
|
}
|
||||||
|
|
||||||
|
.daterangepicker:before, .daterangepicker:after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||||
content: ''; }
|
content: '';
|
||||||
.daterangepicker:before {
|
}
|
||||||
|
|
||||||
|
.daterangepicker:before {
|
||||||
top: -7px;
|
top: -7px;
|
||||||
border-right: 7px solid transparent;
|
border-right: 7px solid transparent;
|
||||||
border-left: 7px solid transparent;
|
border-left: 7px solid transparent;
|
||||||
border-bottom: 7px solid #ccc; }
|
border-bottom: 7px solid #ccc;
|
||||||
.daterangepicker:after {
|
}
|
||||||
|
|
||||||
|
.daterangepicker:after {
|
||||||
top: -6px;
|
top: -6px;
|
||||||
border-right: 6px solid transparent;
|
border-right: 6px solid transparent;
|
||||||
border-bottom: 6px solid #fff;
|
border-bottom: 6px solid #fff;
|
||||||
border-left: 6px solid transparent; }
|
border-left: 6px solid transparent;
|
||||||
.daterangepicker.opensleft:before {
|
}
|
||||||
right: 9px; }
|
|
||||||
.daterangepicker.opensleft:after {
|
.daterangepicker.opensleft:before {
|
||||||
right: 10px; }
|
right: 9px;
|
||||||
.daterangepicker.openscenter:before {
|
}
|
||||||
|
|
||||||
|
.daterangepicker.opensleft:after {
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.openscenter:before {
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto; }
|
margin-right: auto;
|
||||||
.daterangepicker.openscenter:after {
|
}
|
||||||
|
|
||||||
|
.daterangepicker.openscenter:after {
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto; }
|
margin-right: auto;
|
||||||
.daterangepicker.opensright:before {
|
}
|
||||||
left: 9px; }
|
|
||||||
.daterangepicker.opensright:after {
|
.daterangepicker.opensright:before {
|
||||||
left: 10px; }
|
left: 9px;
|
||||||
.daterangepicker.dropup {
|
}
|
||||||
margin-top: -5px; }
|
|
||||||
.daterangepicker.dropup:before {
|
.daterangepicker.opensright:after {
|
||||||
top: initial;
|
left: 10px;
|
||||||
bottom: -7px;
|
}
|
||||||
border-bottom: initial;
|
|
||||||
border-top: 7px solid #ccc; }
|
.daterangepicker.dropup {
|
||||||
.daterangepicker.dropup:after {
|
margin-top: -5px;
|
||||||
top: initial;
|
}
|
||||||
bottom: -6px;
|
|
||||||
border-bottom: initial;
|
.daterangepicker.dropup:before {
|
||||||
border-top: 6px solid #fff; }
|
top: initial;
|
||||||
.daterangepicker.dropdown-menu {
|
bottom: -7px;
|
||||||
|
border-bottom: initial;
|
||||||
|
border-top: 7px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.dropup:after {
|
||||||
|
top: initial;
|
||||||
|
bottom: -6px;
|
||||||
|
border-bottom: initial;
|
||||||
|
border-top: 6px solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.dropdown-menu {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
z-index: 3001; }
|
z-index: 3001;
|
||||||
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
|
}
|
||||||
float: none; }
|
|
||||||
.daterangepicker.show-calendar .calendar {
|
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
|
||||||
display: block; }
|
float: none;
|
||||||
.daterangepicker .calendar {
|
}
|
||||||
|
|
||||||
|
.daterangepicker.show-calendar .calendar {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker .calendar {
|
||||||
display: none;
|
display: none;
|
||||||
max-width: 270px;
|
max-width: 270px;
|
||||||
margin: 4px; }
|
margin: 4px;
|
||||||
.daterangepicker .calendar.single .calendar-table {
|
}
|
||||||
border: none; }
|
|
||||||
.daterangepicker .calendar th, .daterangepicker .calendar td {
|
.daterangepicker .calendar.single .calendar-table {
|
||||||
white-space: nowrap;
|
border: none;
|
||||||
text-align: center;
|
}
|
||||||
min-width: 32px; }
|
|
||||||
.daterangepicker .calendar-table {
|
.daterangepicker .calendar th, .daterangepicker .calendar td {
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
min-width: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker .calendar-table {
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #fff; }
|
background-color: #fff;
|
||||||
.daterangepicker table {
|
}
|
||||||
|
|
||||||
|
.daterangepicker table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0; }
|
margin: 0;
|
||||||
.daterangepicker td, .daterangepicker th {
|
}
|
||||||
|
|
||||||
|
.daterangepicker td, .daterangepicker th {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
cursor: pointer; }
|
cursor: pointer;
|
||||||
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
|
}
|
||||||
background-color: #eee;
|
|
||||||
border-color: transparent;
|
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
|
||||||
color: inherit; }
|
background-color: #eee;
|
||||||
.daterangepicker td.week, .daterangepicker th.week {
|
border-color: transparent;
|
||||||
font-size: 80%;
|
color: inherit;
|
||||||
color: #ccc; }
|
}
|
||||||
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
|
|
||||||
|
.daterangepicker td.week, .daterangepicker th.week {
|
||||||
|
font-size: 80%;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: #999; }
|
color: #999;
|
||||||
.daterangepicker td.in-range {
|
}
|
||||||
|
|
||||||
|
.daterangepicker td.in-range {
|
||||||
background-color: #ebf4f8;
|
background-color: #ebf4f8;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: #000;
|
color: #000;
|
||||||
border-radius: 0; }
|
border-radius: 0;
|
||||||
.daterangepicker td.start-date {
|
}
|
||||||
border-radius: 4px 0 0 4px; }
|
|
||||||
.daterangepicker td.end-date {
|
.daterangepicker td.start-date {
|
||||||
border-radius: 0 4px 4px 0; }
|
border-radius: 4px 0 0 4px;
|
||||||
.daterangepicker td.start-date.end-date {
|
}
|
||||||
border-radius: 4px; }
|
|
||||||
.daterangepicker td.active, .daterangepicker td.active:hover {
|
.daterangepicker td.end-date {
|
||||||
|
border-radius: 0 4px 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker td.start-date.end-date {
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker td.active, .daterangepicker td.active:hover {
|
||||||
background-color: #357ebd;
|
background-color: #357ebd;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: #fff; }
|
color: #fff;
|
||||||
.daterangepicker th.month {
|
}
|
||||||
width: auto; }
|
|
||||||
.daterangepicker td.disabled, .daterangepicker option.disabled {
|
.daterangepicker th.month {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker td.disabled, .daterangepicker option.disabled {
|
||||||
color: #999;
|
color: #999;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
text-decoration: line-through; }
|
text-decoration: line-through;
|
||||||
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
|
}
|
||||||
|
|
||||||
|
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
height: auto;
|
height: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
cursor: default; }
|
cursor: default;
|
||||||
.daterangepicker select.monthselect {
|
}
|
||||||
|
|
||||||
|
.daterangepicker select.monthselect {
|
||||||
margin-right: 2%;
|
margin-right: 2%;
|
||||||
width: 56%; }
|
width: 56%;
|
||||||
.daterangepicker select.yearselect {
|
}
|
||||||
width: 40%; }
|
|
||||||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
|
.daterangepicker select.yearselect {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
margin-bottom: 0; }
|
margin-bottom: 0;
|
||||||
.daterangepicker .input-mini {
|
}
|
||||||
|
|
||||||
|
.daterangepicker .input-mini {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: #555;
|
color: #555;
|
||||||
@@ -145,43 +217,62 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin: 0 0 5px 0;
|
margin: 0 0 5px 0;
|
||||||
padding: 0 6px 0 28px;
|
padding: 0 6px 0 28px;
|
||||||
width: 100%; }
|
width: 100%;
|
||||||
.daterangepicker .input-mini.active {
|
}
|
||||||
border: 1px solid #08c;
|
|
||||||
border-radius: 4px; }
|
.daterangepicker .input-mini.active {
|
||||||
.daterangepicker .daterangepicker_input {
|
border: 1px solid #08c;
|
||||||
position: relative; }
|
border-radius: 4px;
|
||||||
.daterangepicker .daterangepicker_input i {
|
}
|
||||||
position: absolute;
|
|
||||||
left: 8px;
|
.daterangepicker .daterangepicker_input {
|
||||||
top: 8px; }
|
position: relative;
|
||||||
.daterangepicker.rtl .input-mini {
|
}
|
||||||
|
|
||||||
|
.daterangepicker .daterangepicker_input i {
|
||||||
|
position: absolute;
|
||||||
|
left: 8px;
|
||||||
|
top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .input-mini {
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-left: 6px; }
|
padding-left: 6px;
|
||||||
.daterangepicker.rtl .daterangepicker_input i {
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .daterangepicker_input i {
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 8px; }
|
right: 8px;
|
||||||
.daterangepicker .calendar-time {
|
}
|
||||||
|
|
||||||
|
.daterangepicker .calendar-time {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 5px auto;
|
margin: 5px auto;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 28px; }
|
padding-left: 28px;
|
||||||
.daterangepicker .calendar-time select.disabled {
|
}
|
||||||
color: #ccc;
|
|
||||||
cursor: not-allowed; }
|
.daterangepicker .calendar-time select.disabled {
|
||||||
|
color: #ccc;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
.ranges {
|
.ranges {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
float: none;
|
float: none;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
text-align: left; }
|
text-align: left;
|
||||||
.ranges ul {
|
}
|
||||||
|
|
||||||
|
.ranges ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%; }
|
width: 100%;
|
||||||
.ranges li {
|
}
|
||||||
|
|
||||||
|
.ranges li {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
border: 1px solid #f5f5f5;
|
border: 1px solid #f5f5f5;
|
||||||
@@ -189,81 +280,139 @@
|
|||||||
color: #08c;
|
color: #08c;
|
||||||
padding: 3px 12px;
|
padding: 3px 12px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
cursor: pointer; }
|
cursor: pointer;
|
||||||
.ranges li:hover {
|
}
|
||||||
background-color: #08c;
|
|
||||||
border: 1px solid #08c;
|
.ranges li:hover {
|
||||||
color: #fff; }
|
background-color: #08c;
|
||||||
.ranges li.active {
|
border: 1px solid #08c;
|
||||||
background-color: #08c;
|
color: #fff;
|
||||||
border: 1px solid #08c;
|
}
|
||||||
color: #fff; }
|
|
||||||
|
.ranges li.active {
|
||||||
|
background-color: #08c;
|
||||||
|
border: 1px solid #08c;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
/* Larger Screen Styling */
|
/* Larger Screen Styling */
|
||||||
@media (min-width: 564px) {
|
@media (min-width: 564px) {
|
||||||
.daterangepicker {
|
.daterangepicker {
|
||||||
width: auto; }
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker .ranges ul {
|
.daterangepicker .ranges ul {
|
||||||
width: 160px; }
|
width: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.single .ranges ul {
|
.daterangepicker.single .ranges ul {
|
||||||
width: 100%; }
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.single .calendar.left {
|
.daterangepicker.single .calendar.left {
|
||||||
clear: none; }
|
clear: none;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
|
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
|
||||||
float: left; }
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
|
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
|
||||||
float: right; }
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.ltr {
|
.daterangepicker.ltr {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
text-align: left; }
|
text-align: left;
|
||||||
.daterangepicker.ltr .calendar.left {
|
}
|
||||||
|
|
||||||
|
.daterangepicker.ltr .calendar.left {
|
||||||
clear: left;
|
clear: left;
|
||||||
margin-right: 0; }
|
margin-right: 0;
|
||||||
.daterangepicker.ltr .calendar.left .calendar-table {
|
}
|
||||||
border-right: none;
|
|
||||||
border-top-right-radius: 0;
|
.daterangepicker.ltr .calendar.left .calendar-table {
|
||||||
border-bottom-right-radius: 0; }
|
border-right: none;
|
||||||
.daterangepicker.ltr .calendar.right {
|
border-top-right-radius: 0;
|
||||||
margin-left: 0; }
|
border-bottom-right-radius: 0;
|
||||||
.daterangepicker.ltr .calendar.right .calendar-table {
|
}
|
||||||
border-left: none;
|
|
||||||
border-top-left-radius: 0;
|
.daterangepicker.ltr .calendar.right {
|
||||||
border-bottom-left-radius: 0; }
|
margin-left: 0;
|
||||||
.daterangepicker.ltr .left .daterangepicker_input {
|
}
|
||||||
padding-right: 12px; }
|
|
||||||
.daterangepicker.ltr .calendar.left .calendar-table {
|
.daterangepicker.ltr .calendar.right .calendar-table {
|
||||||
padding-right: 12px; }
|
border-left: none;
|
||||||
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
|
border-top-left-radius: 0;
|
||||||
float: left; }
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.ltr .left .daterangepicker_input {
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.ltr .calendar.left .calendar-table {
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
.daterangepicker.rtl {
|
.daterangepicker.rtl {
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
text-align: right; }
|
|
||||||
.daterangepicker.rtl .calendar.left {
|
|
||||||
clear: right;
|
|
||||||
margin-left: 0; }
|
|
||||||
.daterangepicker.rtl .calendar.left .calendar-table {
|
|
||||||
border-left: none;
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0; }
|
|
||||||
.daterangepicker.rtl .calendar.right {
|
|
||||||
margin-right: 0; }
|
|
||||||
.daterangepicker.rtl .calendar.right .calendar-table {
|
|
||||||
border-right: none;
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0; }
|
|
||||||
.daterangepicker.rtl .left .daterangepicker_input {
|
|
||||||
padding-left: 12px; }
|
|
||||||
.daterangepicker.rtl .calendar.left .calendar-table {
|
|
||||||
padding-left: 12px; }
|
|
||||||
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
float: right; } }
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .calendar.left {
|
||||||
|
clear: right;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .calendar.left .calendar-table {
|
||||||
|
border-left: none;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .calendar.right {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .calendar.right .calendar-table {
|
||||||
|
border-right: none;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .left .daterangepicker_input {
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .calendar.left .calendar-table {
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 730px) {
|
@media (min-width: 730px) {
|
||||||
.daterangepicker .ranges {
|
.daterangepicker .ranges {
|
||||||
width: auto; }
|
width: auto;
|
||||||
.daterangepicker.ltr .ranges {
|
}
|
||||||
float: left; }
|
|
||||||
.daterangepicker.rtl .ranges {
|
.daterangepicker.ltr .ranges {
|
||||||
float: right; }
|
float: left;
|
||||||
.daterangepicker .calendar.left {
|
}
|
||||||
clear: none !important; } }
|
|
||||||
|
.daterangepicker.rtl .ranges {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.daterangepicker .calendar.left {
|
||||||
|
clear: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -16,8 +16,8 @@ $(function () {
|
|||||||
configAccounting(currencySymbol);
|
configAccounting(currencySymbol);
|
||||||
|
|
||||||
// on submit of form, disable any button in form:
|
// on submit of form, disable any button in form:
|
||||||
$('form.form-horizontal').on('submit',function() {
|
$('form.form-horizontal').on('submit', function () {
|
||||||
$('button[type="submit"]').prop('disabled',true);
|
$('button[type="submit"]').prop('disabled', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
|
@@ -60,8 +60,6 @@ function failedJobImport(jqxhr, textStatus, error) {
|
|||||||
function reportOnJobImport(data) {
|
function reportOnJobImport(data) {
|
||||||
|
|
||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
default:
|
|
||||||
break;
|
|
||||||
case "configured":
|
case "configured":
|
||||||
// job is ready. Do not check again, just show the start-box. Hide the rest.
|
// job is ready. Do not check again, just show the start-box. Hide the rest.
|
||||||
$('.statusbox').hide();
|
$('.statusbox').hide();
|
||||||
@@ -94,9 +92,10 @@ function reportOnJobImport(data) {
|
|||||||
$('.status_finished').show();
|
$('.status_finished').show();
|
||||||
// show text:
|
// show text:
|
||||||
$('#import-status-more-info').html(data.finishedText);
|
$('#import-status-more-info').html(data.finishedText);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
if(!forceDemoOff) {
|
if (!forceDemoOff) {
|
||||||
$.getJSON(routeStepsUri).done(setupIntro)
|
$.getJSON(routeStepsUri).done(setupIntro)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -69,6 +69,7 @@ function removeMoney(e) {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopSorting() {
|
function stopSorting() {
|
||||||
"use strict";
|
"use strict";
|
||||||
$('.loadSpin').addClass('fa fa-refresh fa-spin');
|
$('.loadSpin').addClass('fa fa-refresh fa-spin');
|
||||||
|
@@ -39,7 +39,7 @@ $(function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// test rule triggers button:
|
// test rule triggers button:
|
||||||
$('.test_rule_triggers').click(testRuleTriggers);
|
$('.test_rule_triggers').click(testRuleTriggers);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -40,4 +40,5 @@ function initialize() {
|
|||||||
marker.setMap(map);
|
marker.setMap(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
google.maps.event.addDomListener(window, 'load', initialize);
|
google.maps.event.addDomListener(window, 'load', initialize);
|
||||||
|
@@ -99,6 +99,7 @@ function checkAll() {
|
|||||||
"use strict";
|
"use strict";
|
||||||
$('.select_all_single').prop('checked', true);
|
$('.select_all_single').prop('checked', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function uncheckAll() {
|
function uncheckAll() {
|
||||||
"use strict";
|
"use strict";
|
||||||
$('.select_all_single').prop('checked', false);
|
$('.select_all_single').prop('checked', false);
|
||||||
|
306
public/js/lib/bootstrap-multiselect.js
vendored
306
public/js/lib/bootstrap-multiselect.js
vendored
@@ -48,7 +48,7 @@
|
|||||||
ko.bindingHandlers.multiselect = {
|
ko.bindingHandlers.multiselect = {
|
||||||
after: ['options', 'value', 'selectedOptions', 'enable', 'disable'],
|
after: ['options', 'value', 'selectedOptions', 'enable', 'disable'],
|
||||||
|
|
||||||
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
|
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
|
||||||
var $element = $(element);
|
var $element = $(element);
|
||||||
var config = ko.toJS(valueAccessor());
|
var config = ko.toJS(valueAccessor());
|
||||||
|
|
||||||
@@ -58,17 +58,17 @@
|
|||||||
var options = allBindings.get('options');
|
var options = allBindings.get('options');
|
||||||
if (ko.isObservable(options)) {
|
if (ko.isObservable(options)) {
|
||||||
ko.computed({
|
ko.computed({
|
||||||
read: function() {
|
read: function () {
|
||||||
options();
|
options();
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
var ms = $element.data('multiselect');
|
var ms = $element.data('multiselect');
|
||||||
if (ms)
|
if (ms)
|
||||||
ms.updateOriginalOptions();//Not sure how beneficial this is.
|
ms.updateOriginalOptions();//Not sure how beneficial this is.
|
||||||
$element.multiselect('rebuild');
|
$element.multiselect('rebuild');
|
||||||
}, 1);
|
}, 1);
|
||||||
},
|
},
|
||||||
disposeWhenNodeIsRemoved: element
|
disposeWhenNodeIsRemoved: element
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,14 +79,14 @@
|
|||||||
var value = allBindings.get('value');
|
var value = allBindings.get('value');
|
||||||
if (ko.isObservable(value)) {
|
if (ko.isObservable(value)) {
|
||||||
ko.computed({
|
ko.computed({
|
||||||
read: function() {
|
read: function () {
|
||||||
value();
|
value();
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
$element.multiselect('refresh');
|
$element.multiselect('refresh');
|
||||||
}, 1);
|
}, 1);
|
||||||
},
|
},
|
||||||
disposeWhenNodeIsRemoved: element
|
disposeWhenNodeIsRemoved: element
|
||||||
}).extend({ rateLimit: 100, notifyWhenChangesStop: true });
|
}).extend({rateLimit: 100, notifyWhenChangesStop: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,14 +96,14 @@
|
|||||||
var selectedOptions = allBindings.get('selectedOptions');
|
var selectedOptions = allBindings.get('selectedOptions');
|
||||||
if (ko.isObservable(selectedOptions)) {
|
if (ko.isObservable(selectedOptions)) {
|
||||||
ko.computed({
|
ko.computed({
|
||||||
read: function() {
|
read: function () {
|
||||||
selectedOptions();
|
selectedOptions();
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
$element.multiselect('refresh');
|
$element.multiselect('refresh');
|
||||||
}, 1);
|
}, 1);
|
||||||
},
|
},
|
||||||
disposeWhenNodeIsRemoved: element
|
disposeWhenNodeIsRemoved: element
|
||||||
}).extend({ rateLimit: 100, notifyWhenChangesStop: true });
|
}).extend({rateLimit: 100, notifyWhenChangesStop: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,11 +120,11 @@
|
|||||||
var enable = allBindings.get('enable');
|
var enable = allBindings.get('enable');
|
||||||
if (ko.isObservable(enable)) {
|
if (ko.isObservable(enable)) {
|
||||||
ko.computed({
|
ko.computed({
|
||||||
read: function () {
|
read: function () {
|
||||||
setEnabled(enable());
|
setEnabled(enable());
|
||||||
},
|
},
|
||||||
disposeWhenNodeIsRemoved: element
|
disposeWhenNodeIsRemoved: element
|
||||||
}).extend({ rateLimit: 100, notifyWhenChangesStop: true });
|
}).extend({rateLimit: 100, notifyWhenChangesStop: true});
|
||||||
} else {
|
} else {
|
||||||
setEnabled(enable);
|
setEnabled(enable);
|
||||||
}
|
}
|
||||||
@@ -134,22 +134,22 @@
|
|||||||
var disable = allBindings.get('disable');
|
var disable = allBindings.get('disable');
|
||||||
if (ko.isObservable(disable)) {
|
if (ko.isObservable(disable)) {
|
||||||
ko.computed({
|
ko.computed({
|
||||||
read: function () {
|
read: function () {
|
||||||
setEnabled(!disable());
|
setEnabled(!disable());
|
||||||
},
|
},
|
||||||
disposeWhenNodeIsRemoved: element
|
disposeWhenNodeIsRemoved: element
|
||||||
}).extend({ rateLimit: 100, notifyWhenChangesStop: true });
|
}).extend({rateLimit: 100, notifyWhenChangesStop: true});
|
||||||
} else {
|
} else {
|
||||||
setEnabled(!disable);
|
setEnabled(!disable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
|
||||||
$element.multiselect('destroy');
|
$element.multiselect('destroy');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
|
update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
|
||||||
var $element = $(element);
|
var $element = $(element);
|
||||||
var config = ko.toJS(valueAccessor());
|
var config = ko.toJS(valueAccessor());
|
||||||
|
|
||||||
@@ -236,9 +236,9 @@
|
|||||||
* @param {jQuery} select
|
* @param {jQuery} select
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
buttonText: function(options, select) {
|
buttonText: function (options, select) {
|
||||||
if (this.disabledText.length > 0
|
if (this.disabledText.length > 0
|
||||||
&& (select.prop('disabled') || (options.length == 0 && this.disableIfEmpty))) {
|
&& (select.prop('disabled') || (options.length == 0 && this.disableIfEmpty))) {
|
||||||
|
|
||||||
return this.disabledText;
|
return this.disabledText;
|
||||||
}
|
}
|
||||||
@@ -246,9 +246,9 @@
|
|||||||
return this.nonSelectedText;
|
return this.nonSelectedText;
|
||||||
}
|
}
|
||||||
else if (this.allSelectedText
|
else if (this.allSelectedText
|
||||||
&& options.length === $('option', $(select)).length
|
&& options.length === $('option', $(select)).length
|
||||||
&& $('option', $(select)).length !== 1
|
&& $('option', $(select)).length !== 1
|
||||||
&& this.multiple) {
|
&& this.multiple) {
|
||||||
|
|
||||||
if (this.selectAllNumber) {
|
if (this.selectAllNumber) {
|
||||||
return this.allSelectedText + ' (' + options.length + ')';
|
return this.allSelectedText + ' (' + options.length + ')';
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
var selected = '';
|
var selected = '';
|
||||||
var delimiter = this.delimiterText;
|
var delimiter = this.delimiterText;
|
||||||
|
|
||||||
options.each(function() {
|
options.each(function () {
|
||||||
var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text();
|
var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text();
|
||||||
selected += label + delimiter;
|
selected += label + delimiter;
|
||||||
});
|
});
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
* @param {jQuery} select
|
* @param {jQuery} select
|
||||||
* @returns {@exp;selected@call;substr}
|
* @returns {@exp;selected@call;substr}
|
||||||
*/
|
*/
|
||||||
buttonTitle: function(options, select) {
|
buttonTitle: function (options, select) {
|
||||||
if (options.length === 0) {
|
if (options.length === 0) {
|
||||||
return this.nonSelectedText;
|
return this.nonSelectedText;
|
||||||
}
|
}
|
||||||
@@ -294,7 +294,7 @@
|
|||||||
return selected.substr(0, selected.length - this.delimiterText.length);
|
return selected.substr(0, selected.length - this.delimiterText.length);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkboxName: function(option) {
|
checkboxName: function (option) {
|
||||||
return false; // no checkbox name
|
return false; // no checkbox name
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -303,7 +303,7 @@
|
|||||||
* @param {jQuery} element
|
* @param {jQuery} element
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
optionLabel: function(element){
|
optionLabel: function (element) {
|
||||||
return $(element).attr('label') || $(element).text();
|
return $(element).attr('label') || $(element).text();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -312,7 +312,7 @@
|
|||||||
* @param {jQuery} element
|
* @param {jQuery} element
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
optionClass: function(element) {
|
optionClass: function (element) {
|
||||||
return $(element).attr('class') || '';
|
return $(element).attr('class') || '';
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
* @param {jQuery} option
|
* @param {jQuery} option
|
||||||
* @param {Boolean} checked
|
* @param {Boolean} checked
|
||||||
*/
|
*/
|
||||||
onChange : function(option, checked) {
|
onChange: function (option, checked) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -331,7 +331,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} event
|
* @param {jQuery} event
|
||||||
*/
|
*/
|
||||||
onDropdownShow: function(event) {
|
onDropdownShow: function (event) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -339,7 +339,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} event
|
* @param {jQuery} event
|
||||||
*/
|
*/
|
||||||
onDropdownHide: function(event) {
|
onDropdownHide: function (event) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} event
|
* @param {jQuery} event
|
||||||
*/
|
*/
|
||||||
onDropdownShown: function(event) {
|
onDropdownShown: function (event) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -355,19 +355,19 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} event
|
* @param {jQuery} event
|
||||||
*/
|
*/
|
||||||
onDropdownHidden: function(event) {
|
onDropdownHidden: function (event) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Triggered on select all.
|
* Triggered on select all.
|
||||||
*/
|
*/
|
||||||
onSelectAll: function() {
|
onSelectAll: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Triggered on deselect all.
|
* Triggered on deselect all.
|
||||||
*/
|
*/
|
||||||
onDeselectAll: function() {
|
onDeselectAll: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
* @param {jQuery} $select
|
* @param {jQuery} $select
|
||||||
* @param {jQuery} $container
|
* @param {jQuery} $container
|
||||||
*/
|
*/
|
||||||
onInitialized: function($select, $container) {
|
onInitialized: function ($select, $container) {
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -384,7 +384,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} $filter
|
* @param {jQuery} $filter
|
||||||
*/
|
*/
|
||||||
onFiltering: function($filter) {
|
onFiltering: function ($filter) {
|
||||||
|
|
||||||
},
|
},
|
||||||
enableHTML: false,
|
enableHTML: false,
|
||||||
@@ -438,7 +438,7 @@
|
|||||||
/**
|
/**
|
||||||
* Builds the container of the multiselect.
|
* Builds the container of the multiselect.
|
||||||
*/
|
*/
|
||||||
buildContainer: function() {
|
buildContainer: function () {
|
||||||
this.$container = $(this.options.buttonContainer);
|
this.$container = $(this.options.buttonContainer);
|
||||||
this.$container.on('show.bs.dropdown', this.options.onDropdownShow);
|
this.$container.on('show.bs.dropdown', this.options.onDropdownShow);
|
||||||
this.$container.on('hide.bs.dropdown', this.options.onDropdownHide);
|
this.$container.on('hide.bs.dropdown', this.options.onDropdownHide);
|
||||||
@@ -449,7 +449,7 @@
|
|||||||
/**
|
/**
|
||||||
* Builds the button of the multiselect.
|
* Builds the button of the multiselect.
|
||||||
*/
|
*/
|
||||||
buildButton: function() {
|
buildButton: function () {
|
||||||
this.$button = $(this.options.templates.button).addClass(this.options.buttonClass);
|
this.$button = $(this.options.templates.button).addClass(this.options.buttonClass);
|
||||||
if (this.$select.attr('class') && this.options.inheritClass) {
|
if (this.$select.attr('class') && this.options.inheritClass) {
|
||||||
this.$button.addClass(this.$select.attr('class'));
|
this.$button.addClass(this.$select.attr('class'));
|
||||||
@@ -465,13 +465,13 @@
|
|||||||
// Manually add button width if set.
|
// Manually add button width if set.
|
||||||
if (this.options.buttonWidth && this.options.buttonWidth !== 'auto') {
|
if (this.options.buttonWidth && this.options.buttonWidth !== 'auto') {
|
||||||
this.$button.css({
|
this.$button.css({
|
||||||
'width' : '100%', //this.options.buttonWidth,
|
'width': '100%', //this.options.buttonWidth,
|
||||||
'overflow' : 'hidden',
|
'overflow': 'hidden',
|
||||||
'text-overflow' : 'ellipsis'
|
'text-overflow': 'ellipsis'
|
||||||
});
|
});
|
||||||
this.$container.css({
|
this.$container.css({
|
||||||
'width': this.options.buttonWidth
|
'width': this.options.buttonWidth
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep the tab index from the select.
|
// Keep the tab index from the select.
|
||||||
@@ -486,7 +486,7 @@
|
|||||||
/**
|
/**
|
||||||
* Builds the ul representing the dropdown menu.
|
* Builds the ul representing the dropdown menu.
|
||||||
*/
|
*/
|
||||||
buildDropdown: function() {
|
buildDropdown: function () {
|
||||||
|
|
||||||
// Build ul.
|
// Build ul.
|
||||||
this.$ul = $(this.options.templates.ul);
|
this.$ul = $(this.options.templates.ul);
|
||||||
@@ -499,23 +499,23 @@
|
|||||||
if (this.options.maxHeight) {
|
if (this.options.maxHeight) {
|
||||||
// TODO: Add a class for this option to move the css declarations.
|
// TODO: Add a class for this option to move the css declarations.
|
||||||
this.$ul.css({
|
this.$ul.css({
|
||||||
'max-height': this.options.maxHeight + 'px',
|
'max-height': this.options.maxHeight + 'px',
|
||||||
'overflow-y': 'auto',
|
'overflow-y': 'auto',
|
||||||
'overflow-x': 'hidden'
|
'overflow-x': 'hidden'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.dropUp) {
|
if (this.options.dropUp) {
|
||||||
|
|
||||||
var height = Math.min(this.options.maxHeight, $('option[data-role!="divider"]', this.$select).length*26 + $('option[data-role="divider"]', this.$select).length*19 + (this.options.includeSelectAllOption ? 26 : 0) + (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering ? 44 : 0));
|
var height = Math.min(this.options.maxHeight, $('option[data-role!="divider"]', this.$select).length * 26 + $('option[data-role="divider"]', this.$select).length * 19 + (this.options.includeSelectAllOption ? 26 : 0) + (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering ? 44 : 0));
|
||||||
var moveCalc = height + 34;
|
var moveCalc = height + 34;
|
||||||
|
|
||||||
this.$ul.css({
|
this.$ul.css({
|
||||||
'max-height': height + 'px',
|
'max-height': height + 'px',
|
||||||
'overflow-y': 'auto',
|
'overflow-y': 'auto',
|
||||||
'overflow-x': 'hidden',
|
'overflow-x': 'hidden',
|
||||||
'margin-top': "-" + moveCalc + 'px'
|
'margin-top': "-" + moveCalc + 'px'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$container.append(this.$ul);
|
this.$container.append(this.$ul);
|
||||||
@@ -526,9 +526,9 @@
|
|||||||
*
|
*
|
||||||
* Uses createDivider and createOptionValue to create the necessary options.
|
* Uses createDivider and createOptionValue to create the necessary options.
|
||||||
*/
|
*/
|
||||||
buildDropdownOptions: function() {
|
buildDropdownOptions: function () {
|
||||||
|
|
||||||
this.$select.children().each($.proxy(function(index, element) {
|
this.$select.children().each($.proxy(function (index, element) {
|
||||||
|
|
||||||
var $element = $(element);
|
var $element = $(element);
|
||||||
// Support optgroups and options without a group simultaneously.
|
// Support optgroups and options without a group simultaneously.
|
||||||
@@ -557,7 +557,7 @@
|
|||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
// Bind the change event on the dropdown elements.
|
// Bind the change event on the dropdown elements.
|
||||||
$('li:not(.multiselect-group) input', this.$ul).on('change', $.proxy(function(event) {
|
$('li:not(.multiselect-group) input', this.$ul).on('change', $.proxy(function (event) {
|
||||||
var $target = $(event.target);
|
var $target = $(event.target);
|
||||||
|
|
||||||
var checked = $target.prop('checked') || false;
|
var checked = $target.prop('checked') || false;
|
||||||
@@ -635,25 +635,25 @@
|
|||||||
this.$select.change();
|
this.$select.change();
|
||||||
this.updateButtonText();
|
this.updateButtonText();
|
||||||
|
|
||||||
if(this.options.preventInputChangeEvent) {
|
if (this.options.preventInputChangeEvent) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
$('li a', this.$ul).on('mousedown', function(e) {
|
$('li a', this.$ul).on('mousedown', function (e) {
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
// Prevent selecting text by Shift+click
|
// Prevent selecting text by Shift+click
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('li a', this.$ul).on('touchstart click', $.proxy(function(event) {
|
$('li a', this.$ul).on('touchstart click', $.proxy(function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
var $target = $(event.target);
|
var $target = $(event.target);
|
||||||
|
|
||||||
if (event.shiftKey && this.options.multiple) {
|
if (event.shiftKey && this.options.multiple) {
|
||||||
if($target.is("label")){ // Handles checkbox selection manually (see https://github.com/davidstutz/bootstrap-multiselect/issues/431)
|
if ($target.is("label")) { // Handles checkbox selection manually (see https://github.com/davidstutz/bootstrap-multiselect/issues/431)
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$target = $target.find("input");
|
$target = $target.find("input");
|
||||||
$target.prop("checked", !$target.prop("checked"));
|
$target.prop("checked", !$target.prop("checked"));
|
||||||
@@ -697,7 +697,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remembers last clicked option
|
// Remembers last clicked option
|
||||||
if($target.is("input") && !$target.closest("li").is(".multiselect-item")){
|
if ($target.is("input") && !$target.closest("li").is(".multiselect-item")) {
|
||||||
this.lastToggledInput = $target;
|
this.lastToggledInput = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,7 +705,7 @@
|
|||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
// Keyboard support.
|
// Keyboard support.
|
||||||
this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function(event) {
|
this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function (event) {
|
||||||
if ($('input[type="text"]', this.$container).is(':focus')) {
|
if ($('input[type="text"]', this.$container).is(':focus')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -750,7 +750,7 @@
|
|||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
if (this.options.enableClickableOptGroups && this.options.multiple) {
|
if (this.options.enableClickableOptGroups && this.options.multiple) {
|
||||||
$("li.multiselect-group input", this.$ul).on("change", $.proxy(function(event) {
|
$("li.multiselect-group input", this.$ul).on("change", $.proxy(function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
var $target = $(event.target);
|
var $target = $(event.target);
|
||||||
@@ -775,7 +775,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.each($inputs, $.proxy(function(index, input) {
|
$.each($inputs, $.proxy(function (index, input) {
|
||||||
var value = $(input).val();
|
var value = $(input).val();
|
||||||
var $option = this.getOptionByValue(value);
|
var $option = this.getOptionByValue(value);
|
||||||
|
|
||||||
@@ -807,13 +807,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.enableCollapsibleOptGroups && this.options.multiple) {
|
if (this.options.enableCollapsibleOptGroups && this.options.multiple) {
|
||||||
$("li.multiselect-group .caret-container", this.$ul).on("click", $.proxy(function(event) {
|
$("li.multiselect-group .caret-container", this.$ul).on("click", $.proxy(function (event) {
|
||||||
var $li = $(event.target).closest('li');
|
var $li = $(event.target).closest('li');
|
||||||
var $inputs = $li.nextUntil("li.multiselect-group")
|
var $inputs = $li.nextUntil("li.multiselect-group")
|
||||||
.not('.multiselect-filter-hidden');
|
.not('.multiselect-filter-hidden');
|
||||||
|
|
||||||
var visible = true;
|
var visible = true;
|
||||||
$inputs.each(function() {
|
$inputs.each(function () {
|
||||||
visible = visible && $(this).is(':visible');
|
visible = visible && $(this).is(':visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -838,7 +838,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} element
|
* @param {jQuery} element
|
||||||
*/
|
*/
|
||||||
createOptionValue: function(element) {
|
createOptionValue: function (element) {
|
||||||
var $element = $(element);
|
var $element = $(element);
|
||||||
if ($element.is(':selected')) {
|
if ($element.is(':selected')) {
|
||||||
$element.prop('selected', true);
|
$element.prop('selected', true);
|
||||||
@@ -906,7 +906,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} element
|
* @param {jQuery} element
|
||||||
*/
|
*/
|
||||||
createDivider: function(element) {
|
createDivider: function (element) {
|
||||||
var $divider = $(this.options.templates.divider);
|
var $divider = $(this.options.templates.divider);
|
||||||
this.$ul.append($divider);
|
this.$ul.append($divider);
|
||||||
},
|
},
|
||||||
@@ -916,7 +916,7 @@
|
|||||||
*
|
*
|
||||||
* @param {jQuery} group
|
* @param {jQuery} group
|
||||||
*/
|
*/
|
||||||
createOptgroup: function(group) {
|
createOptgroup: function (group) {
|
||||||
var label = $(group).attr("label");
|
var label = $(group).attr("label");
|
||||||
var value = $(group).attr("value");
|
var value = $(group).attr("value");
|
||||||
var $li = $('<li class="multiselect-item multiselect-group"><a href="javascript:void(0);"><label><b></b></label></a></li>');
|
var $li = $('<li class="multiselect-item multiselect-group"><a href="javascript:void(0);"><label><b></b></label></a></li>');
|
||||||
@@ -945,7 +945,7 @@
|
|||||||
|
|
||||||
this.$ul.append($li);
|
this.$ul.append($li);
|
||||||
|
|
||||||
$("option", group).each($.proxy(function($, group) {
|
$("option", group).each($.proxy(function ($, group) {
|
||||||
this.createOptionValue(group);
|
this.createOptionValue(group);
|
||||||
}, this))
|
}, this))
|
||||||
},
|
},
|
||||||
@@ -955,7 +955,7 @@
|
|||||||
*
|
*
|
||||||
* Checks if a select all has already been created.
|
* Checks if a select all has already been created.
|
||||||
*/
|
*/
|
||||||
buildSelectAll: function() {
|
buildSelectAll: function () {
|
||||||
if (typeof this.options.selectAllValue === 'number') {
|
if (typeof this.options.selectAllValue === 'number') {
|
||||||
this.options.selectAllValue = this.options.selectAllValue.toString();
|
this.options.selectAllValue = this.options.selectAllValue.toString();
|
||||||
}
|
}
|
||||||
@@ -963,7 +963,7 @@
|
|||||||
var alreadyHasSelectAll = this.hasSelectAll();
|
var alreadyHasSelectAll = this.hasSelectAll();
|
||||||
|
|
||||||
if (!alreadyHasSelectAll && this.options.includeSelectAllOption && this.options.multiple
|
if (!alreadyHasSelectAll && this.options.includeSelectAllOption && this.options.multiple
|
||||||
&& $('option', this.$select).length > this.options.includeSelectAllIfMoreThan) {
|
&& $('option', this.$select).length > this.options.includeSelectAllIfMoreThan) {
|
||||||
|
|
||||||
// Check whether to add a divider after the select all.
|
// Check whether to add a divider after the select all.
|
||||||
if (this.options.includeSelectAllDivider) {
|
if (this.options.includeSelectAllDivider) {
|
||||||
@@ -1003,7 +1003,7 @@
|
|||||||
/**
|
/**
|
||||||
* Builds the filter.
|
* Builds the filter.
|
||||||
*/
|
*/
|
||||||
buildFilter: function() {
|
buildFilter: function () {
|
||||||
|
|
||||||
// Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
|
// Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
|
||||||
if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
|
if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
|
||||||
@@ -1015,9 +1015,9 @@
|
|||||||
$('input', this.$filter).attr('placeholder', this.options.filterPlaceholder);
|
$('input', this.$filter).attr('placeholder', this.options.filterPlaceholder);
|
||||||
|
|
||||||
// Adds optional filter clear button
|
// Adds optional filter clear button
|
||||||
if(this.options.includeFilterClearBtn) {
|
if (this.options.includeFilterClearBtn) {
|
||||||
var clearBtn = $(this.options.templates.filterClearBtn);
|
var clearBtn = $(this.options.templates.filterClearBtn);
|
||||||
clearBtn.on('click', $.proxy(function(event){
|
clearBtn.on('click', $.proxy(function (event) {
|
||||||
clearTimeout(this.searchTimeout);
|
clearTimeout(this.searchTimeout);
|
||||||
|
|
||||||
this.$filter.find('.multiselect-search').val('');
|
this.$filter.find('.multiselect-search').val('');
|
||||||
@@ -1035,24 +1035,24 @@
|
|||||||
|
|
||||||
this.$ul.prepend(this.$filter);
|
this.$ul.prepend(this.$filter);
|
||||||
|
|
||||||
this.$filter.val(this.query).on('click', function(event) {
|
this.$filter.val(this.query).on('click', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}).on('input keydown', $.proxy(function(event) {
|
}).on('input keydown', $.proxy(function (event) {
|
||||||
// Cancel enter key default behaviour
|
// Cancel enter key default behaviour
|
||||||
if (event.which === 13) {
|
if (event.which === 13) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is useful to catch "keydown" events after the browser has updated the control.
|
// This is useful to catch "keydown" events after the browser has updated the control.
|
||||||
clearTimeout(this.searchTimeout);
|
clearTimeout(this.searchTimeout);
|
||||||
|
|
||||||
this.searchTimeout = this.asyncFunction($.proxy(function() {
|
this.searchTimeout = this.asyncFunction($.proxy(function () {
|
||||||
|
|
||||||
if (this.query !== event.target.value) {
|
if (this.query !== event.target.value) {
|
||||||
this.query = event.target.value;
|
this.query = event.target.value;
|
||||||
|
|
||||||
var currentGroup, currentGroupVisible;
|
var currentGroup, currentGroupVisible;
|
||||||
$.each($('li', this.$ul), $.proxy(function(index, element) {
|
$.each($('li', this.$ul), $.proxy(function (index, element) {
|
||||||
var value = $('input', element).length > 0 ? $('input', element).val() : "";
|
var value = $('input', element).length > 0 ? $('input', element).val() : "";
|
||||||
var text = $('label', element).text();
|
var text = $('label', element).text();
|
||||||
|
|
||||||
@@ -1132,7 +1132,7 @@
|
|||||||
/**
|
/**
|
||||||
* Unbinds the whole plugin.
|
* Unbinds the whole plugin.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function () {
|
||||||
this.$container.remove();
|
this.$container.remove();
|
||||||
this.$select.show();
|
this.$select.show();
|
||||||
|
|
||||||
@@ -1205,8 +1205,8 @@
|
|||||||
* @param {Array} selectValues
|
* @param {Array} selectValues
|
||||||
* @param {Boolean} triggerOnChange
|
* @param {Boolean} triggerOnChange
|
||||||
*/
|
*/
|
||||||
select: function(selectValues, triggerOnChange) {
|
select: function (selectValues, triggerOnChange) {
|
||||||
if(!$.isArray(selectValues)) {
|
if (!$.isArray(selectValues)) {
|
||||||
selectValues = [selectValues];
|
selectValues = [selectValues];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1220,7 +1220,7 @@
|
|||||||
var $option = this.getOptionByValue(value);
|
var $option = this.getOptionByValue(value);
|
||||||
var $checkbox = this.getInputByValue(value);
|
var $checkbox = this.getInputByValue(value);
|
||||||
|
|
||||||
if($option === undefined || $checkbox === undefined) {
|
if ($option === undefined || $checkbox === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1271,8 +1271,8 @@
|
|||||||
* @param {Array} deselectValues
|
* @param {Array} deselectValues
|
||||||
* @param {Boolean} triggerOnChange
|
* @param {Boolean} triggerOnChange
|
||||||
*/
|
*/
|
||||||
deselect: function(deselectValues, triggerOnChange) {
|
deselect: function (deselectValues, triggerOnChange) {
|
||||||
if(!$.isArray(deselectValues)) {
|
if (!$.isArray(deselectValues)) {
|
||||||
deselectValues = [deselectValues];
|
deselectValues = [deselectValues];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1286,7 +1286,7 @@
|
|||||||
var $option = this.getOptionByValue(value);
|
var $option = this.getOptionByValue(value);
|
||||||
var $checkbox = this.getInputByValue(value);
|
var $checkbox = this.getInputByValue(value);
|
||||||
|
|
||||||
if($option === undefined || $checkbox === undefined) {
|
if ($option === undefined || $checkbox === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1325,21 +1325,21 @@
|
|||||||
var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
|
var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
|
||||||
var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
|
var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
|
||||||
|
|
||||||
if(justVisible) {
|
if (justVisible) {
|
||||||
$('input:enabled' , visibleLis).prop('checked', true);
|
$('input:enabled', visibleLis).prop('checked', true);
|
||||||
visibleLis.addClass(this.options.selectedClass);
|
visibleLis.addClass(this.options.selectedClass);
|
||||||
|
|
||||||
$('input:enabled' , visibleLis).each($.proxy(function(index, element) {
|
$('input:enabled', visibleLis).each($.proxy(function (index, element) {
|
||||||
var value = $(element).val();
|
var value = $(element).val();
|
||||||
var option = this.getOptionByValue(value);
|
var option = this.getOptionByValue(value);
|
||||||
$(option).prop('selected', true);
|
$(option).prop('selected', true);
|
||||||
}, this));
|
}, this));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('input:enabled' , allLis).prop('checked', true);
|
$('input:enabled', allLis).prop('checked', true);
|
||||||
allLis.addClass(this.options.selectedClass);
|
allLis.addClass(this.options.selectedClass);
|
||||||
|
|
||||||
$('input:enabled' , allLis).each($.proxy(function(index, element) {
|
$('input:enabled', allLis).each($.proxy(function (index, element) {
|
||||||
var value = $(element).val();
|
var value = $(element).val();
|
||||||
var option = this.getOptionByValue(value);
|
var option = this.getOptionByValue(value);
|
||||||
$(option).prop('selected', true);
|
$(option).prop('selected', true);
|
||||||
@@ -1370,21 +1370,21 @@
|
|||||||
var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
|
var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
|
||||||
var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
|
var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
|
||||||
|
|
||||||
if(justVisible) {
|
if (justVisible) {
|
||||||
$('input[type="checkbox"]:enabled' , visibleLis).prop('checked', false);
|
$('input[type="checkbox"]:enabled', visibleLis).prop('checked', false);
|
||||||
visibleLis.removeClass(this.options.selectedClass);
|
visibleLis.removeClass(this.options.selectedClass);
|
||||||
|
|
||||||
$('input[type="checkbox"]:enabled' , visibleLis).each($.proxy(function(index, element) {
|
$('input[type="checkbox"]:enabled', visibleLis).each($.proxy(function (index, element) {
|
||||||
var value = $(element).val();
|
var value = $(element).val();
|
||||||
var option = this.getOptionByValue(value);
|
var option = this.getOptionByValue(value);
|
||||||
$(option).prop('selected', false);
|
$(option).prop('selected', false);
|
||||||
}, this));
|
}, this));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('input[type="checkbox"]:enabled' , allLis).prop('checked', false);
|
$('input[type="checkbox"]:enabled', allLis).prop('checked', false);
|
||||||
allLis.removeClass(this.options.selectedClass);
|
allLis.removeClass(this.options.selectedClass);
|
||||||
|
|
||||||
$('input[type="checkbox"]:enabled' , allLis).each($.proxy(function(index, element) {
|
$('input[type="checkbox"]:enabled', allLis).each($.proxy(function (index, element) {
|
||||||
var value = $(element).val();
|
var value = $(element).val();
|
||||||
var option = this.getOptionByValue(value);
|
var option = this.getOptionByValue(value);
|
||||||
$(option).prop('selected', false);
|
$(option).prop('selected', false);
|
||||||
@@ -1407,7 +1407,7 @@
|
|||||||
*
|
*
|
||||||
* Rebuilds the dropdown, the filter and the select all option.
|
* Rebuilds the dropdown, the filter and the select all option.
|
||||||
*/
|
*/
|
||||||
rebuild: function() {
|
rebuild: function () {
|
||||||
this.$ul.html('');
|
this.$ul.html('');
|
||||||
|
|
||||||
// Important to distinguish between radios and checkboxes.
|
// Important to distinguish between radios and checkboxes.
|
||||||
@@ -1439,7 +1439,7 @@
|
|||||||
/**
|
/**
|
||||||
* The provided data will be used to build the dropdown.
|
* The provided data will be used to build the dropdown.
|
||||||
*/
|
*/
|
||||||
dataprovider: function(dataprovider) {
|
dataprovider: function (dataprovider) {
|
||||||
|
|
||||||
var groupCounter = 0;
|
var groupCounter = 0;
|
||||||
var $select = this.$select.empty();
|
var $select = this.$select.empty();
|
||||||
@@ -1451,11 +1451,11 @@
|
|||||||
groupCounter++;
|
groupCounter++;
|
||||||
|
|
||||||
$tag = $('<optgroup/>').attr({
|
$tag = $('<optgroup/>').attr({
|
||||||
label: option.label || 'Group ' + groupCounter,
|
label: option.label || 'Group ' + groupCounter,
|
||||||
disabled: !!option.disabled
|
disabled: !!option.disabled
|
||||||
});
|
});
|
||||||
|
|
||||||
forEach(option.children, function(subOption) { // add children option tags
|
forEach(option.children, function (subOption) { // add children option tags
|
||||||
var attributes = {
|
var attributes = {
|
||||||
value: subOption.value,
|
value: subOption.value,
|
||||||
label: subOption.label || subOption.value,
|
label: subOption.label || subOption.value,
|
||||||
@@ -1465,10 +1465,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Loop through attributes object and add key-value for each attribute
|
//Loop through attributes object and add key-value for each attribute
|
||||||
for (var key in subOption.attributes) {
|
for (var key in subOption.attributes) {
|
||||||
attributes['data-' + key] = subOption.attributes[key];
|
attributes['data-' + key] = subOption.attributes[key];
|
||||||
}
|
}
|
||||||
//Append original attributes + new data attributes to option
|
//Append original attributes + new data attributes to option
|
||||||
$tag.append($('<option/>').attr(attributes));
|
$tag.append($('<option/>').attr(attributes));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1484,7 +1484,7 @@
|
|||||||
};
|
};
|
||||||
//Loop through attributes object and add key-value for each attribute
|
//Loop through attributes object and add key-value for each attribute
|
||||||
for (var key in option.attributes) {
|
for (var key in option.attributes) {
|
||||||
attributes['data-' + key] = option.attributes[key];
|
attributes['data-' + key] = option.attributes[key];
|
||||||
}
|
}
|
||||||
//Append original attributes + new data attributes to option
|
//Append original attributes + new data attributes to option
|
||||||
$tag = $('<option/>').attr(attributes);
|
$tag = $('<option/>').attr(attributes);
|
||||||
@@ -1501,7 +1501,7 @@
|
|||||||
/**
|
/**
|
||||||
* Enable the multiselect.
|
* Enable the multiselect.
|
||||||
*/
|
*/
|
||||||
enable: function() {
|
enable: function () {
|
||||||
this.$select.prop('disabled', false);
|
this.$select.prop('disabled', false);
|
||||||
this.$button.prop('disabled', false)
|
this.$button.prop('disabled', false)
|
||||||
.removeClass('disabled');
|
.removeClass('disabled');
|
||||||
@@ -1510,7 +1510,7 @@
|
|||||||
/**
|
/**
|
||||||
* Disable the multiselect.
|
* Disable the multiselect.
|
||||||
*/
|
*/
|
||||||
disable: function() {
|
disable: function () {
|
||||||
this.$select.prop('disabled', true);
|
this.$select.prop('disabled', true);
|
||||||
this.$button.prop('disabled', true)
|
this.$button.prop('disabled', true)
|
||||||
.addClass('disabled');
|
.addClass('disabled');
|
||||||
@@ -1521,7 +1521,7 @@
|
|||||||
*
|
*
|
||||||
* @param {Array} options
|
* @param {Array} options
|
||||||
*/
|
*/
|
||||||
setOptions: function(options) {
|
setOptions: function (options) {
|
||||||
this.options = this.mergeOptions(options);
|
this.options = this.mergeOptions(options);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1531,7 +1531,7 @@
|
|||||||
* @param {Array} options
|
* @param {Array} options
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
mergeOptions: function(options) {
|
mergeOptions: function (options) {
|
||||||
return $.extend(true, {}, this.defaults, this.options, options);
|
return $.extend(true, {}, this.defaults, this.options, options);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1540,24 +1540,24 @@
|
|||||||
*
|
*
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
hasSelectAll: function() {
|
hasSelectAll: function () {
|
||||||
return $('li.multiselect-all', this.$ul).length > 0;
|
return $('li.multiselect-all', this.$ul).length > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update opt groups.
|
* Update opt groups.
|
||||||
*/
|
*/
|
||||||
updateOptGroups: function() {
|
updateOptGroups: function () {
|
||||||
var $groups = $('li.multiselect-group', this.$ul)
|
var $groups = $('li.multiselect-group', this.$ul)
|
||||||
var selectedClass = this.options.selectedClass;
|
var selectedClass = this.options.selectedClass;
|
||||||
|
|
||||||
$groups.each(function() {
|
$groups.each(function () {
|
||||||
var $options = $(this).nextUntil('li.multiselect-group')
|
var $options = $(this).nextUntil('li.multiselect-group')
|
||||||
.not('.multiselect-filter-hidden')
|
.not('.multiselect-filter-hidden')
|
||||||
.not('.disabled');
|
.not('.disabled');
|
||||||
|
|
||||||
var checked = true;
|
var checked = true;
|
||||||
$options.each(function() {
|
$options.each(function () {
|
||||||
var $input = $('input', this);
|
var $input = $('input', this);
|
||||||
|
|
||||||
if (!$input.prop('checked')) {
|
if (!$input.prop('checked')) {
|
||||||
@@ -1581,12 +1581,12 @@
|
|||||||
/**
|
/**
|
||||||
* Updates the select all checkbox based on the currently displayed and selected checkboxes.
|
* Updates the select all checkbox based on the currently displayed and selected checkboxes.
|
||||||
*/
|
*/
|
||||||
updateSelectAll: function(notTriggerOnSelectAll) {
|
updateSelectAll: function (notTriggerOnSelectAll) {
|
||||||
if (this.hasSelectAll()) {
|
if (this.hasSelectAll()) {
|
||||||
var allBoxes = $("li:not(.multiselect-item):not(.multiselect-filter-hidden):not(.multiselect-group):not(.disabled) input:enabled", this.$ul);
|
var allBoxes = $("li:not(.multiselect-item):not(.multiselect-filter-hidden):not(.multiselect-group):not(.disabled) input:enabled", this.$ul);
|
||||||
var allBoxesLength = allBoxes.length;
|
var allBoxesLength = allBoxes.length;
|
||||||
var checkedBoxesLength = allBoxes.filter(":checked").length;
|
var checkedBoxesLength = allBoxes.filter(":checked").length;
|
||||||
var selectAllLi = $("li.multiselect-all", this.$ul);
|
var selectAllLi = $("li.multiselect-all", this.$ul);
|
||||||
var selectAllInput = selectAllLi.find("input");
|
var selectAllInput = selectAllLi.find("input");
|
||||||
|
|
||||||
if (checkedBoxesLength > 0 && checkedBoxesLength === allBoxesLength) {
|
if (checkedBoxesLength > 0 && checkedBoxesLength === allBoxesLength) {
|
||||||
@@ -1603,7 +1603,7 @@
|
|||||||
/**
|
/**
|
||||||
* Update the button text and its title based on the currently selected options.
|
* Update the button text and its title based on the currently selected options.
|
||||||
*/
|
*/
|
||||||
updateButtonText: function() {
|
updateButtonText: function () {
|
||||||
var options = this.getSelected();
|
var options = this.getSelected();
|
||||||
|
|
||||||
// First update the displayed button text.
|
// First update the displayed button text.
|
||||||
@@ -1623,7 +1623,7 @@
|
|||||||
*
|
*
|
||||||
* @returns {jQUery}
|
* @returns {jQUery}
|
||||||
*/
|
*/
|
||||||
getSelected: function() {
|
getSelected: function () {
|
||||||
return $('option', this.$select).filter(":selected");
|
return $('option', this.$select).filter(":selected");
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1668,25 +1668,25 @@
|
|||||||
/**
|
/**
|
||||||
* Used for knockout integration.
|
* Used for knockout integration.
|
||||||
*/
|
*/
|
||||||
updateOriginalOptions: function() {
|
updateOriginalOptions: function () {
|
||||||
this.originalOptions = this.$select.clone()[0].options;
|
this.originalOptions = this.$select.clone()[0].options;
|
||||||
},
|
},
|
||||||
|
|
||||||
asyncFunction: function(callback, timeout, self) {
|
asyncFunction: function (callback, timeout, self) {
|
||||||
var args = Array.prototype.slice.call(arguments, 3);
|
var args = Array.prototype.slice.call(arguments, 3);
|
||||||
return setTimeout(function() {
|
return setTimeout(function () {
|
||||||
callback.apply(self || window, args);
|
callback.apply(self || window, args);
|
||||||
}, timeout);
|
}, timeout);
|
||||||
},
|
},
|
||||||
|
|
||||||
setAllSelectedText: function(allSelectedText) {
|
setAllSelectedText: function (allSelectedText) {
|
||||||
this.options.allSelectedText = allSelectedText;
|
this.options.allSelectedText = allSelectedText;
|
||||||
this.updateButtonText();
|
this.updateButtonText();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.multiselect = function(option, parameter, extraOptions) {
|
$.fn.multiselect = function (option, parameter, extraOptions) {
|
||||||
return this.each(function() {
|
return this.each(function () {
|
||||||
var data = $(this).data('multiselect');
|
var data = $(this).data('multiselect');
|
||||||
var options = typeof option === 'object' && option;
|
var options = typeof option === 'object' && option;
|
||||||
|
|
||||||
@@ -1709,7 +1709,7 @@
|
|||||||
|
|
||||||
$.fn.multiselect.Constructor = Multiselect;
|
$.fn.multiselect.Constructor = Multiselect;
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
$("select[data-role=multiselect]").multiselect();
|
$("select[data-role=multiselect]").multiselect();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
24
public/js/lib/bootstrap-sortable.js
vendored
24
public/js/lib/bootstrap-sortable.js
vendored
@@ -31,7 +31,7 @@
|
|||||||
initialize({});
|
initialize({});
|
||||||
}
|
}
|
||||||
else if (options.constructor === Boolean) {
|
else if (options.constructor === Boolean) {
|
||||||
initialize({ applyLast: options });
|
initialize({applyLast: options});
|
||||||
}
|
}
|
||||||
else if (options.sortingHeader !== undefined) {
|
else if (options.sortingHeader !== undefined) {
|
||||||
sortByColumn(options.sortingHeader);
|
sortByColumn(options.sortingHeader);
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var context = lookupSortContext($this),
|
var context = lookupSortContext($this),
|
||||||
bsSort = context.bsSort;
|
bsSort = context.bsSort;
|
||||||
|
|
||||||
$this.find('thead th[data-defaultsort!="disabled"]').each(function (index) {
|
$this.find('thead th[data-defaultsort!="disabled"]').each(function (index) {
|
||||||
var $header = $(this);
|
var $header = $(this);
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
function lookupSortContext($table) {
|
function lookupSortContext($table) {
|
||||||
var context = $table.data("bootstrap-sortable-context");
|
var context = $table.data("bootstrap-sortable-context");
|
||||||
if (context === undefined) {
|
if (context === undefined) {
|
||||||
context = { bsSort: [], lastSort: undefined };
|
context = {bsSort: [], lastSort: undefined};
|
||||||
$table.find('thead th[data-defaultsort!="disabled"]').each(function (index) {
|
$table.find('thead th[data-defaultsort!="disabled"]').each(function (index) {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var sortKey = $this.attr('data-sortkey');
|
var sortKey = $this.attr('data-sortkey');
|
||||||
@@ -185,8 +185,8 @@
|
|||||||
// Sorting mechanism separated
|
// Sorting mechanism separated
|
||||||
function doSort($this, $table) {
|
function doSort($this, $table) {
|
||||||
var sortColumn = parseFloat($this.attr('data-sortcolumn')),
|
var sortColumn = parseFloat($this.attr('data-sortcolumn')),
|
||||||
context = lookupSortContext($table),
|
context = lookupSortContext($table),
|
||||||
bsSort = context.bsSort;
|
bsSort = context.bsSort;
|
||||||
|
|
||||||
var colspan = $this.attr('colspan');
|
var colspan = $this.attr('colspan');
|
||||||
if (colspan) {
|
if (colspan) {
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
var fixedRows = [];
|
var fixedRows = [];
|
||||||
$(rows.filter('[data-disablesort="true"]').get().reverse()).each(function (index, fixedRow) {
|
$(rows.filter('[data-disablesort="true"]').get().reverse()).each(function (index, fixedRow) {
|
||||||
var $fixedRow = $(fixedRow);
|
var $fixedRow = $(fixedRow);
|
||||||
fixedRows.push({ index: rows.index($fixedRow), row: $fixedRow });
|
fixedRows.push({index: rows.index($fixedRow), row: $fixedRow});
|
||||||
$fixedRow.remove();
|
$fixedRow.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@
|
|||||||
var rowsToSort = rows.not('[data-disablesort="true"]');
|
var rowsToSort = rows.not('[data-disablesort="true"]');
|
||||||
if (rowsToSort.length != 0) {
|
if (rowsToSort.length != 0) {
|
||||||
var emptySorting = bsSort[sortKey] === 'asc' ? emptyEnd : false;
|
var emptySorting = bsSort[sortKey] === 'asc' ? emptyEnd : false;
|
||||||
sortEngine(rowsToSort, { emptyEnd: emptySorting, selector: 'td:nth-child(' + (sortColumn + 1) + ')', order: bsSort[sortKey], data: 'value' });
|
sortEngine(rowsToSort, {emptyEnd: emptySorting, selector: 'td:nth-child(' + (sortColumn + 1) + ')', order: bsSort[sortKey], data: 'value'});
|
||||||
}
|
}
|
||||||
|
|
||||||
// add back the fixed rows
|
// add back the fixed rows
|
||||||
@@ -274,12 +274,16 @@
|
|||||||
|
|
||||||
// jQuery 1.9 removed this object
|
// jQuery 1.9 removed this object
|
||||||
if (!$.browser) {
|
if (!$.browser) {
|
||||||
$.browser = { chrome: false, mozilla: false, opera: false, msie: false, safari: false };
|
$.browser = {chrome: false, mozilla: false, opera: false, msie: false, safari: false};
|
||||||
var ua = navigator.userAgent;
|
var ua = navigator.userAgent;
|
||||||
$.each($.browser, function (c) {
|
$.each($.browser, function (c) {
|
||||||
$.browser[c] = ((new RegExp(c, 'i').test(ua))) ? true : false;
|
$.browser[c] = ((new RegExp(c, 'i').test(ua))) ? true : false;
|
||||||
if ($.browser.mozilla && c === 'mozilla') { $.browser.mozilla = ((new RegExp('firefox', 'i').test(ua))) ? true : false; }
|
if ($.browser.mozilla && c === 'mozilla') {
|
||||||
if ($.browser.chrome && c === 'safari') { $.browser.safari = false; }
|
$.browser.mozilla = ((new RegExp('firefox', 'i').test(ua))) ? true : false;
|
||||||
|
}
|
||||||
|
if ($.browser.chrome && c === 'safari') {
|
||||||
|
$.browser.safari = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @version: 2.1.25
|
* @version: 2.1.25
|
||||||
* @author: Dan Grossman http://www.dangrossman.info/
|
* @author: Dan Grossman http://www.dangrossman.info/
|
||||||
* @copyright: Copyright (c) 2012-2017 Dan Grossman. All rights reserved.
|
* @copyright: Copyright (c) 2012-2017 Dan Grossman. All rights reserved.
|
||||||
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
|
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
|
||||||
* @website: http://www.daterangepicker.com/
|
* @website: http://www.daterangepicker.com/
|
||||||
*/
|
*/
|
||||||
// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
|
// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
|
||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
// Browser globals
|
// Browser globals
|
||||||
root.daterangepicker = factory(root.moment, root.jQuery);
|
root.daterangepicker = factory(root.moment, root.jQuery);
|
||||||
}
|
}
|
||||||
}(this, function(moment, $) {
|
}(this, function (moment, $) {
|
||||||
var DateRangePicker = function(element, options, cb) {
|
var DateRangePicker = function (element, options, cb) {
|
||||||
|
|
||||||
//default settings for options
|
//default settings for options
|
||||||
this.parentEl = 'body';
|
this.parentEl = 'body';
|
||||||
@@ -78,7 +78,8 @@
|
|||||||
firstDay: moment.localeData().firstDayOfWeek()
|
firstDay: moment.localeData().firstDayOfWeek()
|
||||||
};
|
};
|
||||||
|
|
||||||
this.callback = function() { };
|
this.callback = function () {
|
||||||
|
};
|
||||||
|
|
||||||
//some state information
|
//some state information
|
||||||
this.isShowing = false;
|
this.isShowing = false;
|
||||||
@@ -96,35 +97,35 @@
|
|||||||
//html template for the picker UI
|
//html template for the picker UI
|
||||||
if (typeof options.template !== 'string' && !(options.template instanceof $))
|
if (typeof options.template !== 'string' && !(options.template instanceof $))
|
||||||
options.template = '<div class="daterangepicker dropdown-menu">' +
|
options.template = '<div class="daterangepicker dropdown-menu">' +
|
||||||
'<div class="calendar left">' +
|
'<div class="calendar left">' +
|
||||||
'<div class="daterangepicker_input">' +
|
'<div class="daterangepicker_input">' +
|
||||||
'<input class="input-mini form-control" type="text" name="daterangepicker_start" value="" />' +
|
'<input class="input-mini form-control" type="text" name="daterangepicker_start" value="" />' +
|
||||||
'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
|
'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
|
||||||
'<div class="calendar-time">' +
|
'<div class="calendar-time">' +
|
||||||
'<div></div>' +
|
'<div></div>' +
|
||||||
'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
|
'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="calendar-table"></div>' +
|
'<div class="calendar-table"></div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="calendar right">' +
|
'<div class="calendar right">' +
|
||||||
'<div class="daterangepicker_input">' +
|
'<div class="daterangepicker_input">' +
|
||||||
'<input class="input-mini form-control" type="text" name="daterangepicker_end" value="" />' +
|
'<input class="input-mini form-control" type="text" name="daterangepicker_end" value="" />' +
|
||||||
'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
|
'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
|
||||||
'<div class="calendar-time">' +
|
'<div class="calendar-time">' +
|
||||||
'<div></div>' +
|
'<div></div>' +
|
||||||
'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
|
'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="calendar-table"></div>' +
|
'<div class="calendar-table"></div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="ranges">' +
|
'<div class="ranges">' +
|
||||||
'<div class="range_inputs">' +
|
'<div class="range_inputs">' +
|
||||||
'<button class="applyBtn" disabled="disabled" type="button"></button> ' +
|
'<button class="applyBtn" disabled="disabled" type="button"></button> ' +
|
||||||
'<button class="cancelBtn" type="button"></button>' +
|
'<button class="cancelBtn" type="button"></button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
|
this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
|
||||||
this.container = $(options.template).appendTo(this.parentEl);
|
this.container = $(options.template).appendTo(this.parentEl);
|
||||||
@@ -148,21 +149,21 @@
|
|||||||
this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
|
this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
|
||||||
|
|
||||||
if (typeof options.locale.monthNames === 'object')
|
if (typeof options.locale.monthNames === 'object')
|
||||||
this.locale.monthNames = options.locale.monthNames.slice();
|
this.locale.monthNames = options.locale.monthNames.slice();
|
||||||
|
|
||||||
if (typeof options.locale.firstDay === 'number')
|
if (typeof options.locale.firstDay === 'number')
|
||||||
this.locale.firstDay = options.locale.firstDay;
|
this.locale.firstDay = options.locale.firstDay;
|
||||||
|
|
||||||
if (typeof options.locale.applyLabel === 'string')
|
if (typeof options.locale.applyLabel === 'string')
|
||||||
this.locale.applyLabel = options.locale.applyLabel;
|
this.locale.applyLabel = options.locale.applyLabel;
|
||||||
|
|
||||||
if (typeof options.locale.cancelLabel === 'string')
|
if (typeof options.locale.cancelLabel === 'string')
|
||||||
this.locale.cancelLabel = options.locale.cancelLabel;
|
this.locale.cancelLabel = options.locale.cancelLabel;
|
||||||
|
|
||||||
if (typeof options.locale.weekLabel === 'string')
|
if (typeof options.locale.weekLabel === 'string')
|
||||||
this.locale.weekLabel = options.locale.weekLabel;
|
this.locale.weekLabel = options.locale.weekLabel;
|
||||||
|
|
||||||
if (typeof options.locale.customRangeLabel === 'string'){
|
if (typeof options.locale.customRangeLabel === 'string') {
|
||||||
//Support unicode chars in the custom range name.
|
//Support unicode chars in the custom range name.
|
||||||
var elem = document.createElement('textarea');
|
var elem = document.createElement('textarea');
|
||||||
elem.innerHTML = options.locale.customRangeLabel;
|
elem.innerHTML = options.locale.customRangeLabel;
|
||||||
@@ -287,7 +288,7 @@
|
|||||||
//if no start/end dates set, check if an input element contains initial values
|
//if no start/end dates set, check if an input element contains initial values
|
||||||
if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
|
if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
|
||||||
if ($(this.element).is('input[type=text]')) {
|
if ($(this.element).is('input[type=text]')) {
|
||||||
var val = $(this.element).val(),
|
var val = $(this.element).val(),
|
||||||
split = val.split(this.locale.separator);
|
split = val.split(this.locale.separator);
|
||||||
|
|
||||||
start = end = null;
|
start = end = null;
|
||||||
@@ -332,8 +333,8 @@
|
|||||||
|
|
||||||
// If the end of the range is before the minimum or the start of the range is
|
// If the end of the range is before the minimum or the start of the range is
|
||||||
// after the maximum, don't display this range option at all.
|
// after the maximum, don't display this range option at all.
|
||||||
if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day'))
|
if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day'))
|
||||||
|| (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day')))
|
|| (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day')))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Support unicode chars in the range names.
|
//Support unicode chars in the range names.
|
||||||
@@ -396,7 +397,7 @@
|
|||||||
|
|
||||||
//swap the position of the predefined ranges if opens right
|
//swap the position of the predefined ranges if opens right
|
||||||
if (typeof options.ranges !== 'undefined' && this.opens == 'right') {
|
if (typeof options.ranges !== 'undefined' && this.opens == 'right') {
|
||||||
this.container.find('.ranges').prependTo( this.container.find('.calendar.left').parent() );
|
this.container.find('.ranges').prependTo(this.container.find('.calendar.left').parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply CSS classes and labels to buttons
|
//apply CSS classes and labels to buttons
|
||||||
@@ -435,11 +436,11 @@
|
|||||||
|
|
||||||
if (this.element.is('input') || this.element.is('button')) {
|
if (this.element.is('input') || this.element.is('button')) {
|
||||||
this.element.on({
|
this.element.on({
|
||||||
'click.daterangepicker': $.proxy(this.show, this),
|
'click.daterangepicker': $.proxy(this.show, this),
|
||||||
'focus.daterangepicker': $.proxy(this.show, this),
|
'focus.daterangepicker': $.proxy(this.show, this),
|
||||||
'keyup.daterangepicker': $.proxy(this.elementChanged, this),
|
'keyup.daterangepicker': $.proxy(this.elementChanged, this),
|
||||||
'keydown.daterangepicker': $.proxy(this.keydown, this)
|
'keydown.daterangepicker': $.proxy(this.keydown, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
|
this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
|
||||||
}
|
}
|
||||||
@@ -462,7 +463,7 @@
|
|||||||
|
|
||||||
constructor: DateRangePicker,
|
constructor: DateRangePicker,
|
||||||
|
|
||||||
setStartDate: function(startDate) {
|
setStartDate: function (startDate) {
|
||||||
if (typeof startDate === 'string')
|
if (typeof startDate === 'string')
|
||||||
this.startDate = moment(startDate, this.locale.format);
|
this.startDate = moment(startDate, this.locale.format);
|
||||||
|
|
||||||
@@ -493,7 +494,7 @@
|
|||||||
this.updateMonthsInView();
|
this.updateMonthsInView();
|
||||||
},
|
},
|
||||||
|
|
||||||
setEndDate: function(endDate) {
|
setEndDate: function (endDate) {
|
||||||
if (typeof endDate === 'string')
|
if (typeof endDate === 'string')
|
||||||
this.endDate = moment(endDate, this.locale.format);
|
this.endDate = moment(endDate, this.locale.format);
|
||||||
|
|
||||||
@@ -523,15 +524,15 @@
|
|||||||
this.updateMonthsInView();
|
this.updateMonthsInView();
|
||||||
},
|
},
|
||||||
|
|
||||||
isInvalidDate: function() {
|
isInvalidDate: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
isCustomDate: function() {
|
isCustomDate: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateView: function() {
|
updateView: function () {
|
||||||
if (this.timePicker) {
|
if (this.timePicker) {
|
||||||
this.renderTimePicker('left');
|
this.renderTimePicker('left');
|
||||||
this.renderTimePicker('right');
|
this.renderTimePicker('right');
|
||||||
@@ -553,7 +554,7 @@
|
|||||||
this.updateFormInputs();
|
this.updateFormInputs();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateMonthsInView: function() {
|
updateMonthsInView: function () {
|
||||||
if (this.endDate) {
|
if (this.endDate) {
|
||||||
|
|
||||||
//if both dates are visible already, do nothing
|
//if both dates are visible already, do nothing
|
||||||
@@ -561,7 +562,7 @@
|
|||||||
(this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
|
(this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
|
||||||
&&
|
&&
|
||||||
(this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
|
(this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,12 +580,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {
|
if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {
|
||||||
this.rightCalendar.month = this.maxDate.clone().date(2);
|
this.rightCalendar.month = this.maxDate.clone().date(2);
|
||||||
this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');
|
this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateCalendars: function() {
|
updateCalendars: function () {
|
||||||
|
|
||||||
if (this.timePicker) {
|
if (this.timePicker) {
|
||||||
var hour, minute, second;
|
var hour, minute, second;
|
||||||
@@ -625,7 +626,7 @@
|
|||||||
this.calculateChosenLabel();
|
this.calculateChosenLabel();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderCalendar: function(side) {
|
renderCalendar: function (side) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build the matrix of dates that will populate the calendar
|
// Build the matrix of dates that will populate the calendar
|
||||||
@@ -727,12 +728,12 @@
|
|||||||
for (var m = 0; m < 12; m++) {
|
for (var m = 0; m < 12; m++) {
|
||||||
if ((!inMinYear || m >= minDate.month()) && (!inMaxYear || m <= maxDate.month())) {
|
if ((!inMinYear || m >= minDate.month()) && (!inMaxYear || m <= maxDate.month())) {
|
||||||
monthHtml += "<option value='" + m + "'" +
|
monthHtml += "<option value='" + m + "'" +
|
||||||
(m === currentMonth ? " selected='selected'" : "") +
|
(m === currentMonth ? " selected='selected'" : "") +
|
||||||
">" + this.locale.monthNames[m] + "</option>";
|
">" + this.locale.monthNames[m] + "</option>";
|
||||||
} else {
|
} else {
|
||||||
monthHtml += "<option value='" + m + "'" +
|
monthHtml += "<option value='" + m + "'" +
|
||||||
(m === currentMonth ? " selected='selected'" : "") +
|
(m === currentMonth ? " selected='selected'" : "") +
|
||||||
" disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
|
" disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
monthHtml += "</select>";
|
monthHtml += "</select>";
|
||||||
@@ -740,8 +741,8 @@
|
|||||||
var yearHtml = '<select class="yearselect">';
|
var yearHtml = '<select class="yearselect">';
|
||||||
for (var y = minYear; y <= maxYear; y++) {
|
for (var y = minYear; y <= maxYear; y++) {
|
||||||
yearHtml += '<option value="' + y + '"' +
|
yearHtml += '<option value="' + y + '"' +
|
||||||
(y === currentYear ? ' selected="selected"' : '') +
|
(y === currentYear ? ' selected="selected"' : '') +
|
||||||
'>' + y + '</option>';
|
'>' + y + '</option>';
|
||||||
}
|
}
|
||||||
yearHtml += '</select>';
|
yearHtml += '</select>';
|
||||||
|
|
||||||
@@ -762,7 +763,7 @@
|
|||||||
if (this.showWeekNumbers || this.showISOWeekNumbers)
|
if (this.showWeekNumbers || this.showISOWeekNumbers)
|
||||||
html += '<th class="week">' + this.locale.weekLabel + '</th>';
|
html += '<th class="week">' + this.locale.weekLabel + '</th>';
|
||||||
|
|
||||||
$.each(this.locale.daysOfWeek, function(index, dayOfWeek) {
|
$.each(this.locale.daysOfWeek, function (index, dayOfWeek) {
|
||||||
html += '<th>' + dayOfWeek + '</th>';
|
html += '<th>' + dayOfWeek + '</th>';
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -859,7 +860,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTimePicker: function(side) {
|
renderTimePicker: function (side) {
|
||||||
|
|
||||||
// Don't bother updating the time picker if it's currently disabled
|
// Don't bother updating the time picker if it's currently disabled
|
||||||
// because an end date hasn't been clicked yet
|
// because an end date hasn't been clicked yet
|
||||||
@@ -1020,7 +1021,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updateFormInputs: function() {
|
updateFormInputs: function () {
|
||||||
|
|
||||||
//ignore mouse movements while an above-calendar text input has focus
|
//ignore mouse movements while an above-calendar text input has focus
|
||||||
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
||||||
@@ -1038,8 +1039,8 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
move: function() {
|
move: function () {
|
||||||
var parentOffset = { top: 0, left: 0 },
|
var parentOffset = {top: 0, left: 0},
|
||||||
containerTop;
|
containerTop;
|
||||||
var parentRightEdge = $(window).width();
|
var parentRightEdge = $(window).width();
|
||||||
if (!this.parentEl.is('body')) {
|
if (!this.parentEl.is('body')) {
|
||||||
@@ -1058,62 +1059,66 @@
|
|||||||
|
|
||||||
if (this.opens == 'left') {
|
if (this.opens == 'left') {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
top: containerTop,
|
top: containerTop,
|
||||||
right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
|
right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
|
||||||
left: 'auto'
|
left: 'auto'
|
||||||
});
|
});
|
||||||
if (this.container.offset().left < 0) {
|
if (this.container.offset().left < 0) {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
right: 'auto',
|
right: 'auto',
|
||||||
left: 9
|
left: 9
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (this.opens == 'center') {
|
} else if (this.opens == 'center') {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
top: containerTop,
|
top: containerTop,
|
||||||
left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
|
left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
|
||||||
- this.container.outerWidth() / 2,
|
- this.container.outerWidth() / 2,
|
||||||
right: 'auto'
|
right: 'auto'
|
||||||
});
|
});
|
||||||
if (this.container.offset().left < 0) {
|
if (this.container.offset().left < 0) {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
right: 'auto',
|
right: 'auto',
|
||||||
left: 9
|
left: 9
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
top: containerTop,
|
top: containerTop,
|
||||||
left: this.element.offset().left - parentOffset.left,
|
left: this.element.offset().left - parentOffset.left,
|
||||||
right: 'auto'
|
right: 'auto'
|
||||||
});
|
});
|
||||||
if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
|
if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
|
||||||
this.container.css({
|
this.container.css({
|
||||||
left: 'auto',
|
left: 'auto',
|
||||||
right: 0
|
right: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function(e) {
|
show: function (e) {
|
||||||
if (this.isShowing) return;
|
if (this.isShowing) return;
|
||||||
|
|
||||||
// Create a click proxy that is private to this instance of datepicker, for unbinding
|
// Create a click proxy that is private to this instance of datepicker, for unbinding
|
||||||
this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
|
this._outsideClickProxy = $.proxy(function (e) {
|
||||||
|
this.outsideClick(e);
|
||||||
|
}, this);
|
||||||
|
|
||||||
// Bind global datepicker mousedown for hiding and
|
// Bind global datepicker mousedown for hiding and
|
||||||
$(document)
|
$(document)
|
||||||
.on('mousedown.daterangepicker', this._outsideClickProxy)
|
.on('mousedown.daterangepicker', this._outsideClickProxy)
|
||||||
// also support mobile devices
|
// also support mobile devices
|
||||||
.on('touchend.daterangepicker', this._outsideClickProxy)
|
.on('touchend.daterangepicker', this._outsideClickProxy)
|
||||||
// also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
|
// also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
|
||||||
.on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
|
.on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
|
||||||
// and also close when focus changes to outside the picker (eg. tabbing between controls)
|
// and also close when focus changes to outside the picker (eg. tabbing between controls)
|
||||||
.on('focusin.daterangepicker', this._outsideClickProxy);
|
.on('focusin.daterangepicker', this._outsideClickProxy);
|
||||||
|
|
||||||
// Reposition the picker if the window is resized while it's open
|
// Reposition the picker if the window is resized while it's open
|
||||||
$(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
|
$(window).on('resize.daterangepicker', $.proxy(function (e) {
|
||||||
|
this.move(e);
|
||||||
|
}, this));
|
||||||
|
|
||||||
this.oldStartDate = this.startDate.clone();
|
this.oldStartDate = this.startDate.clone();
|
||||||
this.oldEndDate = this.endDate.clone();
|
this.oldEndDate = this.endDate.clone();
|
||||||
@@ -1126,7 +1131,7 @@
|
|||||||
this.isShowing = true;
|
this.isShowing = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function(e) {
|
hide: function (e) {
|
||||||
if (!this.isShowing) return;
|
if (!this.isShowing) return;
|
||||||
|
|
||||||
//incomplete date selection, revert to last values
|
//incomplete date selection, revert to last values
|
||||||
@@ -1149,7 +1154,7 @@
|
|||||||
this.isShowing = false;
|
this.isShowing = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
toggle: function(e) {
|
toggle: function (e) {
|
||||||
if (this.isShowing) {
|
if (this.isShowing) {
|
||||||
this.hide();
|
this.hide();
|
||||||
} else {
|
} else {
|
||||||
@@ -1157,33 +1162,33 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
outsideClick: function(e) {
|
outsideClick: function (e) {
|
||||||
var target = $(e.target);
|
var target = $(e.target);
|
||||||
// if the page is clicked anywhere except within the daterangerpicker/button
|
// if the page is clicked anywhere except within the daterangerpicker/button
|
||||||
// itself then call this.hide()
|
// itself then call this.hide()
|
||||||
if (
|
if (
|
||||||
// ie modal dialog fix
|
// ie modal dialog fix
|
||||||
e.type == "focusin" ||
|
e.type == "focusin" ||
|
||||||
target.closest(this.element).length ||
|
target.closest(this.element).length ||
|
||||||
target.closest(this.container).length ||
|
target.closest(this.container).length ||
|
||||||
target.closest('.calendar-table').length
|
target.closest('.calendar-table').length
|
||||||
) return;
|
) return;
|
||||||
this.hide();
|
this.hide();
|
||||||
this.element.trigger('outsideClick.daterangepicker', this);
|
this.element.trigger('outsideClick.daterangepicker', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
showCalendars: function() {
|
showCalendars: function () {
|
||||||
this.container.addClass('show-calendar');
|
this.container.addClass('show-calendar');
|
||||||
this.move();
|
this.move();
|
||||||
this.element.trigger('showCalendar.daterangepicker', this);
|
this.element.trigger('showCalendar.daterangepicker', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
hideCalendars: function() {
|
hideCalendars: function () {
|
||||||
this.container.removeClass('show-calendar');
|
this.container.removeClass('show-calendar');
|
||||||
this.element.trigger('hideCalendar.daterangepicker', this);
|
this.element.trigger('hideCalendar.daterangepicker', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
hoverRange: function(e) {
|
hoverRange: function (e) {
|
||||||
|
|
||||||
//ignore mouse movements while an above-calendar text input has focus
|
//ignore mouse movements while an above-calendar text input has focus
|
||||||
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
||||||
@@ -1201,7 +1206,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
clickRange: function(e) {
|
clickRange: function (e) {
|
||||||
var label = e.target.getAttribute('data-range-key');
|
var label = e.target.getAttribute('data-range-key');
|
||||||
this.chosenLabel = label;
|
this.chosenLabel = label;
|
||||||
if (label == this.locale.customRangeLabel) {
|
if (label == this.locale.customRangeLabel) {
|
||||||
@@ -1222,7 +1227,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
clickPrev: function(e) {
|
clickPrev: function (e) {
|
||||||
var cal = $(e.target).parents('.calendar');
|
var cal = $(e.target).parents('.calendar');
|
||||||
if (cal.hasClass('left')) {
|
if (cal.hasClass('left')) {
|
||||||
this.leftCalendar.month.subtract(1, 'month');
|
this.leftCalendar.month.subtract(1, 'month');
|
||||||
@@ -1234,7 +1239,7 @@
|
|||||||
this.updateCalendars();
|
this.updateCalendars();
|
||||||
},
|
},
|
||||||
|
|
||||||
clickNext: function(e) {
|
clickNext: function (e) {
|
||||||
var cal = $(e.target).parents('.calendar');
|
var cal = $(e.target).parents('.calendar');
|
||||||
if (cal.hasClass('left')) {
|
if (cal.hasClass('left')) {
|
||||||
this.leftCalendar.month.add(1, 'month');
|
this.leftCalendar.month.add(1, 'month');
|
||||||
@@ -1246,7 +1251,7 @@
|
|||||||
this.updateCalendars();
|
this.updateCalendars();
|
||||||
},
|
},
|
||||||
|
|
||||||
hoverDate: function(e) {
|
hoverDate: function (e) {
|
||||||
|
|
||||||
//ignore mouse movements while an above-calendar text input has focus
|
//ignore mouse movements while an above-calendar text input has focus
|
||||||
//if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
//if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
|
||||||
@@ -1273,7 +1278,7 @@
|
|||||||
var rightCalendar = this.rightCalendar;
|
var rightCalendar = this.rightCalendar;
|
||||||
var startDate = this.startDate;
|
var startDate = this.startDate;
|
||||||
if (!this.endDate) {
|
if (!this.endDate) {
|
||||||
this.container.find('.calendar tbody td').each(function(index, el) {
|
this.container.find('.calendar tbody td').each(function (index, el) {
|
||||||
|
|
||||||
//skip week numbers, only look at dates
|
//skip week numbers, only look at dates
|
||||||
if ($(el).hasClass('week')) return;
|
if ($(el).hasClass('week')) return;
|
||||||
@@ -1295,7 +1300,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
clickDate: function(e) {
|
clickDate: function (e) {
|
||||||
|
|
||||||
if (!$(e.target).hasClass('available')) return;
|
if (!$(e.target).hasClass('available')) return;
|
||||||
|
|
||||||
@@ -1350,8 +1355,8 @@
|
|||||||
}
|
}
|
||||||
this.setEndDate(date.clone());
|
this.setEndDate(date.clone());
|
||||||
if (this.autoApply) {
|
if (this.autoApply) {
|
||||||
this.calculateChosenLabel();
|
this.calculateChosenLabel();
|
||||||
this.clickApply();
|
this.clickApply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1398,22 +1403,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
clickApply: function(e) {
|
clickApply: function (e) {
|
||||||
this.hide();
|
this.hide();
|
||||||
this.element.trigger('apply.daterangepicker', this);
|
this.element.trigger('apply.daterangepicker', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
clickCancel: function(e) {
|
clickCancel: function (e) {
|
||||||
this.startDate = this.oldStartDate;
|
this.startDate = this.oldStartDate;
|
||||||
this.endDate = this.oldEndDate;
|
this.endDate = this.oldEndDate;
|
||||||
this.hide();
|
this.hide();
|
||||||
this.element.trigger('cancel.daterangepicker', this);
|
this.element.trigger('cancel.daterangepicker', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
monthOrYearChanged: function(e) {
|
monthOrYearChanged: function (e) {
|
||||||
var isLeft = $(e.target).closest('.calendar').hasClass('left'),
|
var isLeft = $(e.target).closest('.calendar').hasClass('left'),
|
||||||
leftOrRight = isLeft ? 'left' : 'right',
|
leftOrRight = isLeft ? 'left' : 'right',
|
||||||
cal = this.container.find('.calendar.'+leftOrRight);
|
cal = this.container.find('.calendar.' + leftOrRight);
|
||||||
|
|
||||||
// Month must be Number for new moment versions
|
// Month must be Number for new moment versions
|
||||||
var month = parseInt(cal.find('.monthselect').val(), 10);
|
var month = parseInt(cal.find('.monthselect').val(), 10);
|
||||||
@@ -1452,9 +1457,9 @@
|
|||||||
this.updateCalendars();
|
this.updateCalendars();
|
||||||
},
|
},
|
||||||
|
|
||||||
timeChanged: function(e) {
|
timeChanged: function (e) {
|
||||||
|
|
||||||
var cal = $(e.target).closest('.calendar'),
|
var cal = $(e.target).closest('.calendar'),
|
||||||
isLeft = cal.hasClass('left');
|
isLeft = cal.hasClass('left');
|
||||||
|
|
||||||
var hour = parseInt(cal.find('.hourselect').val(), 10);
|
var hour = parseInt(cal.find('.hourselect').val(), 10);
|
||||||
@@ -1500,7 +1505,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
formInputsChanged: function(e) {
|
formInputsChanged: function (e) {
|
||||||
var isRight = $(e.target).closest('.calendar').hasClass('right');
|
var isRight = $(e.target).closest('.calendar').hasClass('right');
|
||||||
var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format);
|
var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format);
|
||||||
var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format);
|
var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format);
|
||||||
@@ -1524,7 +1529,7 @@
|
|||||||
this.updateView();
|
this.updateView();
|
||||||
},
|
},
|
||||||
|
|
||||||
formInputsFocused: function(e) {
|
formInputsFocused: function (e) {
|
||||||
|
|
||||||
// Highlight the focused input
|
// Highlight the focused input
|
||||||
this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active');
|
this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active');
|
||||||
@@ -1544,7 +1549,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
formInputsBlurred: function(e) {
|
formInputsBlurred: function (e) {
|
||||||
|
|
||||||
// this function has one purpose right now: if you tab from the first
|
// this function has one purpose right now: if you tab from the first
|
||||||
// text input to the second in the UI, the endDate is nulled so that
|
// text input to the second in the UI, the endDate is nulled so that
|
||||||
@@ -1562,14 +1567,14 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
elementChanged: function() {
|
elementChanged: function () {
|
||||||
if (!this.element.is('input')) return;
|
if (!this.element.is('input')) return;
|
||||||
if (!this.element.val().length) return;
|
if (!this.element.val().length) return;
|
||||||
if (this.element.val().length < this.locale.format.length) return;
|
if (this.element.val().length < this.locale.format.length) return;
|
||||||
|
|
||||||
var dateString = this.element.val().split(this.locale.separator),
|
var dateString = this.element.val().split(this.locale.separator),
|
||||||
start = null,
|
start = null,
|
||||||
end = null;
|
end = null;
|
||||||
|
|
||||||
if (dateString.length === 2) {
|
if (dateString.length === 2) {
|
||||||
start = moment(dateString[0], this.locale.format);
|
start = moment(dateString[0], this.locale.format);
|
||||||
@@ -1588,14 +1593,14 @@
|
|||||||
this.updateView();
|
this.updateView();
|
||||||
},
|
},
|
||||||
|
|
||||||
keydown: function(e) {
|
keydown: function (e) {
|
||||||
//hide on tab or enter
|
//hide on tab or enter
|
||||||
if ((e.keyCode === 9) || (e.keyCode === 13)) {
|
if ((e.keyCode === 9) || (e.keyCode === 13)) {
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateElement: function() {
|
updateElement: function () {
|
||||||
if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
|
if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
|
||||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||||
this.element.trigger('change');
|
this.element.trigger('change');
|
||||||
@@ -1605,7 +1610,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
remove: function() {
|
remove: function () {
|
||||||
this.container.remove();
|
this.container.remove();
|
||||||
this.element.off('.daterangepicker');
|
this.element.off('.daterangepicker');
|
||||||
this.element.removeData();
|
this.element.removeData();
|
||||||
@@ -1613,8 +1618,8 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.daterangepicker = function(options, callback) {
|
$.fn.daterangepicker = function (options, callback) {
|
||||||
this.each(function() {
|
this.each(function () {
|
||||||
var el = $(this);
|
var el = $(this);
|
||||||
if (el.data('daterangepicker'))
|
if (el.data('daterangepicker'))
|
||||||
el.data('daterangepicker').remove();
|
el.data('daterangepicker').remove();
|
||||||
|
5798
public/lib/adminlte/css/AdminLTE.css
vendored
5798
public/lib/adminlte/css/AdminLTE.css
vendored
File diff suppressed because it is too large
Load Diff
188
public/lib/adminlte/css/skins/skin-blue-light.css
vendored
188
public/lib/adminlte/css/skins/skin-blue-light.css
vendored
@@ -3,11 +3,13 @@
|
|||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
.skin-blue-light .main-header .navbar {
|
.skin-blue-light .main-header .navbar {
|
||||||
background-color: #3c8dbc;
|
background-color: #3c8dbc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .navbar .nav > li > a {
|
.skin-blue-light .main-header .navbar .nav > li > a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .navbar .nav > li > a:hover,
|
.skin-blue-light .main-header .navbar .nav > li > a:hover,
|
||||||
.skin-blue-light .main-header .navbar .nav > li > a:active,
|
.skin-blue-light .main-header .navbar .nav > li > a:active,
|
||||||
.skin-blue-light .main-header .navbar .nav > li > a:focus,
|
.skin-blue-light .main-header .navbar .nav > li > a:focus,
|
||||||
@@ -15,150 +17,186 @@
|
|||||||
.skin-blue-light .main-header .navbar .nav .open > a:hover,
|
.skin-blue-light .main-header .navbar .nav .open > a:hover,
|
||||||
.skin-blue-light .main-header .navbar .nav .open > a:focus,
|
.skin-blue-light .main-header .navbar .nav .open > a:focus,
|
||||||
.skin-blue-light .main-header .navbar .nav > .active > a {
|
.skin-blue-light .main-header .navbar .nav > .active > a {
|
||||||
background: rgba(0, 0, 0, 0.1);
|
background: rgba(0, 0, 0, 0.1);
|
||||||
color: #f6f6f6;
|
color: #f6f6f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .navbar .sidebar-toggle {
|
.skin-blue-light .main-header .navbar .sidebar-toggle {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
|
.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
|
||||||
color: #f6f6f6;
|
color: #f6f6f6;
|
||||||
background: rgba(0, 0, 0, 0.1);
|
background: rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .navbar .sidebar-toggle {
|
.skin-blue-light .main-header .navbar .sidebar-toggle {
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
|
|
||||||
background-color: #367fa9;
|
|
||||||
}
|
|
||||||
@media (max-width: 767px) {
|
|
||||||
.skin-blue-light .main-header .navbar .dropdown-menu li.divider {
|
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
.skin-blue-light .main-header .navbar .dropdown-menu li a {
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
|
||||||
.skin-blue-light .main-header .navbar .dropdown-menu li a:hover {
|
|
||||||
background: #367fa9;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
|
||||||
|
background-color: #367fa9;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.skin-blue-light .main-header .navbar .dropdown-menu li.divider {
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-blue-light .main-header .navbar .dropdown-menu li a {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-blue-light .main-header .navbar .dropdown-menu li a:hover {
|
||||||
|
background: #367fa9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .logo {
|
.skin-blue-light .main-header .logo {
|
||||||
background-color: #3c8dbc;
|
background-color: #3c8dbc;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-bottom: 0 solid transparent;
|
border-bottom: 0 solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header .logo:hover {
|
.skin-blue-light .main-header .logo:hover {
|
||||||
background-color: #3b8ab8;
|
background-color: #3b8ab8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-header li.user-header {
|
.skin-blue-light .main-header li.user-header {
|
||||||
background-color: #3c8dbc;
|
background-color: #3c8dbc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .content-header {
|
.skin-blue-light .content-header {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .wrapper,
|
.skin-blue-light .wrapper,
|
||||||
.skin-blue-light .main-sidebar,
|
.skin-blue-light .main-sidebar,
|
||||||
.skin-blue-light .left-side {
|
.skin-blue-light .left-side {
|
||||||
background-color: #f9fafc;
|
background-color: #f9fafc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .content-wrapper,
|
.skin-blue-light .content-wrapper,
|
||||||
.skin-blue-light .main-footer {
|
.skin-blue-light .main-footer {
|
||||||
border-left: 1px solid #d2d6de;
|
border-left: 1px solid #d2d6de;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .user-panel > .info,
|
.skin-blue-light .user-panel > .info,
|
||||||
.skin-blue-light .user-panel > .info > a {
|
.skin-blue-light .user-panel > .info > a {
|
||||||
color: #444444;
|
color: #444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li {
|
.skin-blue-light .sidebar-menu > li {
|
||||||
-webkit-transition: border-left-color 0.3s ease;
|
-webkit-transition: border-left-color 0.3s ease;
|
||||||
-o-transition: border-left-color 0.3s ease;
|
-o-transition: border-left-color 0.3s ease;
|
||||||
transition: border-left-color 0.3s ease;
|
transition: border-left-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li.header {
|
.skin-blue-light .sidebar-menu > li.header {
|
||||||
color: #848484;
|
color: #848484;
|
||||||
background: #f9fafc;
|
background: #f9fafc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li > a {
|
.skin-blue-light .sidebar-menu > li > a {
|
||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li:hover > a,
|
.skin-blue-light .sidebar-menu > li:hover > a,
|
||||||
.skin-blue-light .sidebar-menu > li.active > a {
|
.skin-blue-light .sidebar-menu > li.active > a {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
background: #f4f4f5;
|
background: #f4f4f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li.active {
|
.skin-blue-light .sidebar-menu > li.active {
|
||||||
border-left-color: #3c8dbc;
|
border-left-color: #3c8dbc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li.active > a {
|
.skin-blue-light .sidebar-menu > li.active > a {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-menu > li > .treeview-menu {
|
.skin-blue-light .sidebar-menu > li > .treeview-menu {
|
||||||
background: #f4f4f5;
|
background: #f4f4f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar a {
|
.skin-blue-light .sidebar a {
|
||||||
color: #444444;
|
color: #444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar a:hover {
|
.skin-blue-light .sidebar a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .treeview-menu > li > a {
|
.skin-blue-light .treeview-menu > li > a {
|
||||||
color: #777777;
|
color: #777777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .treeview-menu > li.active > a,
|
.skin-blue-light .treeview-menu > li.active > a,
|
||||||
.skin-blue-light .treeview-menu > li > a:hover {
|
.skin-blue-light .treeview-menu > li > a:hover {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .treeview-menu > li.active > a {
|
.skin-blue-light .treeview-menu > li.active > a {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form {
|
.skin-blue-light .sidebar-form {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border: 1px solid #d2d6de;
|
border: 1px solid #d2d6de;
|
||||||
margin: 10px 10px;
|
margin: 10px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form input[type="text"],
|
.skin-blue-light .sidebar-form input[type="text"],
|
||||||
.skin-blue-light .sidebar-form .btn {
|
.skin-blue-light .sidebar-form .btn {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form input[type="text"] {
|
.skin-blue-light .sidebar-form input[type="text"] {
|
||||||
color: #666;
|
color: #666;
|
||||||
border-top-left-radius: 2px;
|
border-top-left-radius: 2px;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
border-bottom-left-radius: 2px;
|
border-bottom-left-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form input[type="text"]:focus,
|
.skin-blue-light .sidebar-form input[type="text"]:focus,
|
||||||
.skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
.skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
.skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||||
border-left-color: #fff;
|
border-left-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .sidebar-form .btn {
|
.skin-blue-light .sidebar-form .btn {
|
||||||
color: #999;
|
color: #999;
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 2px;
|
border-top-right-radius: 2px;
|
||||||
border-bottom-right-radius: 2px;
|
border-bottom-right-radius: 2px;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu {
|
.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu {
|
||||||
border-left: 1px solid #d2d6de;
|
border-left: 1px solid #d2d6de;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue-light .main-footer {
|
.skin-blue-light .main-footer {
|
||||||
border-top-color: #d2d6de;
|
border-top-color: #d2d6de;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue.layout-top-nav .main-header > .logo {
|
.skin-blue.layout-top-nav .main-header > .logo {
|
||||||
background-color: #3c8dbc;
|
background-color: #3c8dbc;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-bottom: 0 solid transparent;
|
border-bottom: 0 solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||||
background-color: #3b8ab8;
|
background-color: #3b8ab8;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var currencies = [];
|
var currencies = [];
|
||||||
{% for currency in allCurrencies %}
|
{% for currency in allCurrencies %}
|
||||||
currencies[{{ currency.id }}] = "{{ currency.symbol }}";
|
currencies[{{ currency.id }}] = "{{ currency.symbol }}";
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -76,8 +76,10 @@
|
|||||||
</p>
|
</p>
|
||||||
<h4>But I thought SHA1 was broken?</h4>
|
<h4>But I thought SHA1 was broken?</h4>
|
||||||
<p>
|
<p>
|
||||||
Yes, but not in this context. As you can read on <a href="https://shattered.io/">the website detailing how they broke SHA1</a>, it is now
|
Yes, but not in this context. As you can read on <a href="https://shattered.io/">the website detailing how they broke SHA1</a>, it is
|
||||||
slightly easier to find a "collision": another string that results in the same SHA1-hash. It now only takes 10,000 years using a single-GPU machine.
|
now
|
||||||
|
slightly easier to find a "collision": another string that results in the same SHA1-hash. It now only takes 10,000 years using a
|
||||||
|
single-GPU machine.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This collision would not be equal to your password, nor would it be useful on (a site like) Firefly III. This application
|
This collision would not be equal to your password, nor would it be useful on (a site like) Firefly III. This application
|
||||||
|
@@ -156,14 +156,14 @@
|
|||||||
var budgetID = {{ budget.id }};
|
var budgetID = {{ budget.id }};
|
||||||
var budgetLimitID = 0;
|
var budgetLimitID = 0;
|
||||||
{% if budgetLimit.id %}
|
{% if budgetLimit.id %}
|
||||||
budgetLimitID = {{ budgetLimit.id }};
|
budgetLimitID = {{ budgetLimit.id }};
|
||||||
var budgetChartUri = '{{ route('chart.budget.budget-limit', [budget.id, budgetLimit.id] ) }}';
|
var budgetChartUri = '{{ route('chart.budget.budget-limit', [budget.id, budgetLimit.id] ) }}';
|
||||||
|
|
||||||
var expenseCategoryUri = '{{ route('chart.budget.expense-category', [budget.id, budgetLimit.id]) }}';
|
var expenseCategoryUri = '{{ route('chart.budget.expense-category', [budget.id, budgetLimit.id]) }}';
|
||||||
var expenseAssetUri = '{{ route('chart.budget.expense-asset', [budget.id, budgetLimit.id]) }}';
|
var expenseAssetUri = '{{ route('chart.budget.expense-asset', [budget.id, budgetLimit.id]) }}';
|
||||||
var expenseExpenseUri = '{{ route('chart.budget.expense-expense', [budget.id, budgetLimit.id]) }}';
|
var expenseExpenseUri = '{{ route('chart.budget.expense-expense', [budget.id, budgetLimit.id]) }}';
|
||||||
{% else %}
|
{% else %}
|
||||||
var budgetChartUri = '{{ route('chart.budget.budget', [budget.id] ) }}';
|
var budgetChartUri = '{{ route('chart.budget.budget', [budget.id] ) }}';
|
||||||
|
|
||||||
var expenseCategoryUri = '{{ route('chart.budget.expense-category', [budget.id]) }}';
|
var expenseCategoryUri = '{{ route('chart.budget.expense-category', [budget.id]) }}';
|
||||||
var expenseAssetUri = '{{ route('chart.budget.expense-asset', [budget.id]) }}';
|
var expenseAssetUri = '{{ route('chart.budget.expense-asset', [budget.id]) }}';
|
||||||
|
@@ -168,7 +168,8 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<small class="pull-left">
|
<small class="pull-left">
|
||||||
{{ 'need_more_help'|_ }}
|
{{ 'need_more_help'|_ }}
|
||||||
</small><br />
|
</small>
|
||||||
|
<br/>
|
||||||
<small class="pull-left">
|
<small class="pull-left">
|
||||||
{{ trans('firefly.reenable_intro_text')|raw }}
|
{{ trans('firefly.reenable_intro_text')|raw }}
|
||||||
</small>
|
</small>
|
||||||
@@ -204,8 +205,8 @@
|
|||||||
(function (i, s, o, g, r, a, m) {
|
(function (i, s, o, g, r, a, m) {
|
||||||
i['GoogleAnalyticsObject'] = r;
|
i['GoogleAnalyticsObject'] = r;
|
||||||
i[r] = i[r] || function () {
|
i[r] = i[r] || function () {
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
(i[r].q = i[r].q || []).push(arguments)
|
||||||
}, i[r].l = 1 * new Date();
|
}, i[r].l = 1 * new Date();
|
||||||
a = s.createElement(o),
|
a = s.createElement(o),
|
||||||
m = s.getElementsByTagName(o)[0];
|
m = s.getElementsByTagName(o)[0];
|
||||||
a.async = 1;
|
a.async = 1;
|
||||||
|
@@ -37,10 +37,10 @@
|
|||||||
(function (i, s, o, g, r, a, m) {
|
(function (i, s, o, g, r, a, m) {
|
||||||
i['GoogleAnalyticsObject'] = r;
|
i['GoogleAnalyticsObject'] = r;
|
||||||
i[r] = i[r] || function () {
|
i[r] = i[r] || function () {
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
(i[r].q = i[r].q || []).push(arguments)
|
||||||
}, i[r].l = 1 * new Date();
|
}, i[r].l = 1 * new Date();
|
||||||
a = s.createElement(o),
|
a = s.createElement(o),
|
||||||
m = s.getElementsByTagName(o)[0];
|
m = s.getElementsByTagName(o)[0];
|
||||||
a.async = 1;
|
a.async = 1;
|
||||||
a.src = g;
|
a.src = g;
|
||||||
m.parentNode.insertBefore(a, m)
|
m.parentNode.insertBefore(a, m)
|
||||||
|
@@ -48,10 +48,10 @@
|
|||||||
(function (i, s, o, g, r, a, m) {
|
(function (i, s, o, g, r, a, m) {
|
||||||
i['GoogleAnalyticsObject'] = r;
|
i['GoogleAnalyticsObject'] = r;
|
||||||
i[r] = i[r] || function () {
|
i[r] = i[r] || function () {
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
(i[r].q = i[r].q || []).push(arguments)
|
||||||
}, i[r].l = 1 * new Date();
|
}, i[r].l = 1 * new Date();
|
||||||
a = s.createElement(o),
|
a = s.createElement(o),
|
||||||
m = s.getElementsByTagName(o)[0];
|
m = s.getElementsByTagName(o)[0];
|
||||||
a.async = 1;
|
a.async = 1;
|
||||||
a.src = g;
|
a.src = g;
|
||||||
m.parentNode.insertBefore(a, m)
|
m.parentNode.insertBefore(a, m)
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
<h3 class="box-title">{{ 'account_status'|_ }}</h3>
|
<h3 class="box-title">{{ 'account_status'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body table-responsive no-padding">
|
<div class="box-body table-responsive no-padding">
|
||||||
<table class="table table-hover" id="accountStatus">
|
<table class="table table-hover" id="accountStatus">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ 'account'|_ }}</th>
|
<th>{{ 'account'|_ }}</th>
|
||||||
|
@@ -50,7 +50,8 @@
|
|||||||
<span class="input-group-addon">{{ journal.currency_symbol }}</span>
|
<span class="input-group-addon">{{ journal.currency_symbol }}</span>
|
||||||
<input name="amount[{{ journal.id }}]" class="form-control" autocomplete="off"
|
<input name="amount[{{ journal.id }}]" class="form-control" autocomplete="off"
|
||||||
step="any" type="number" value="{{ journal.amount }}">
|
step="any" type="number" value="{{ journal.amount }}">
|
||||||
<input type="hidden" name="transaction_currency_id[{{ journal.id }}]" value="{{ journal.transaction_currency_id }}">
|
<input type="hidden" name="transaction_currency_id[{{ journal.id }}]"
|
||||||
|
value="{{ journal.transaction_currency_id }}">
|
||||||
</div>
|
</div>
|
||||||
{% if journal.foreign_amount %}
|
{% if journal.foreign_amount %}
|
||||||
{# insert foreign data #}
|
{# insert foreign data #}
|
||||||
|
@@ -244,12 +244,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>
|
<p>
|
||||||
<i class="fa fa-copy fa-fw" aria-hidden="true"></i>
|
<i class="fa fa-copy fa-fw" aria-hidden="true"></i>
|
||||||
<a href="{{ route('transactions.clone', [journal.id]) }}">
|
<a href="{{ route('transactions.clone', [journal.id]) }}">
|
||||||
{{ ('clone_'~journal.transactionType.type|lower)|_ }}
|
{{ ('clone_'~journal.transactionType.type|lower)|_ }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<i class="fa fa-unsorted fa-fw" aria-hidden="true"></i>
|
<i class="fa fa-unsorted fa-fw" aria-hidden="true"></i>
|
||||||
<a href="{{ route('transactions.split.edit', journal.id) }}">
|
<a href="{{ route('transactions.split.edit', journal.id) }}">
|
||||||
|
@@ -130,9 +130,9 @@ class BudgetControllerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExpenseCategory(string $range)
|
public function testExpenseCategory(string $range)
|
||||||
{
|
{
|
||||||
$generator = $this->mock(GeneratorInterface::class);
|
$generator = $this->mock(GeneratorInterface::class);
|
||||||
$collector = $this->mock(JournalCollectorInterface::class);
|
$collector = $this->mock(JournalCollectorInterface::class);
|
||||||
$catRepos = $this->mock(CategoryRepositoryInterface::class);
|
$catRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||||
|
|
||||||
$transactions = factory(Transaction::class, 10)->make();
|
$transactions = factory(Transaction::class, 10)->make();
|
||||||
$categories = factory(Category::class, 10)->make();
|
$categories = factory(Category::class, 10)->make();
|
||||||
|
@@ -77,9 +77,9 @@ class NewUserControllerTest extends TestCase
|
|||||||
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'bank_name' => 'New bank',
|
'bank_name' => 'New bank',
|
||||||
'savings_balance' => '1000',
|
'savings_balance' => '1000',
|
||||||
'bank_balance' => '100',
|
'bank_balance' => '100',
|
||||||
];
|
];
|
||||||
$this->be($this->emptyUser());
|
$this->be($this->emptyUser());
|
||||||
$response = $this->post(route('new-user.submit'), $data);
|
$response = $this->post(route('new-user.submit'), $data);
|
||||||
|
@@ -278,7 +278,7 @@ class SingleControllerTest extends TestCase
|
|||||||
public function testStoreSuccess()
|
public function testStoreSuccess()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete('Mockery cannot yet handle PHP7.1 null argument method things.');
|
$this->markTestIncomplete('Mockery cannot yet handle PHP7.1 null argument method things.');
|
||||||
|
|
||||||
// mock results:
|
// mock results:
|
||||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||||
$journal = new TransactionJournal();
|
$journal = new TransactionJournal();
|
||||||
@@ -295,7 +295,6 @@ class SingleControllerTest extends TestCase
|
|||||||
$messages->add('attachments', 'Fake error');
|
$messages->add('attachments', 'Fake error');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// mock attachment helper, trigger an error AND and info thing.
|
// mock attachment helper, trigger an error AND and info thing.
|
||||||
$attachmentRepo = $this->mock(AttachmentHelperInterface::class);
|
$attachmentRepo = $this->mock(AttachmentHelperInterface::class);
|
||||||
$attachmentRepo->shouldReceive('saveAttachmentsForModel');
|
$attachmentRepo->shouldReceive('saveAttachmentsForModel');
|
||||||
|
Reference in New Issue
Block a user