@ -0,0 +1,3 @@ |
||||
/src/logs/ |
||||
tts_framework/ |
||||
/src/tmp/ |
||||
@ -0,0 +1,63 @@ |
||||
<IfModule mod_rewrite.c> |
||||
Options +FollowSymLinks -Indexes |
||||
RewriteEngine On |
||||
# LOG AND DENY ACCESS TO CORE DIRs |
||||
RewriteRule "^(src|models|views|controllers|includes|forms|templates|sql|classes|settings|uploads|notes|configs|vendor|node_modules)/(.*)$" "index.php?route=/app/home&m=deny&f=$1/$2" [NC,L] |
||||
# TRACE and TRACK HTTP methods disabled to prevent XSS attacks |
||||
RewriteCond "%{REQUEST_METHOD}" "^TRAC[EK]" |
||||
RewriteRule ".*" "-" [L,R=405] |
||||
# API |
||||
# never rewrite for existing files, directories and links |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule "^(api|api2)/([^/]*)/([^/]*)/([^/]*)/([^/]*)$" "index.php?project=$2&route=/$3/$4&m=$5&$1=true" [QSA,L] |
||||
# Mobile |
||||
RewriteCond "%{HTTP_USER_AGENT}" "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule "^([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$" "index.php?project=$1&route=/$2/$3&m=$4&mobile=true" [QSA,L] |
||||
# Site |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule "^([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$" "index.php?project=$1&route=/$2/$3&m=$4" [QSA,L] |
||||
# always send 404 on missing files in these folders |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule "^(assets|skin|js|css|public)/(.*)$" "-" [R=404,L,NS] |
||||
# Short Hand Site |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule "^([^/]*)/([^/]*)/([^/]*)/$" "index.php?project=$1&route=/$2/$3&m=index" [QSA,L] |
||||
# rewrite everything not found to index.php |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-f" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-d" |
||||
RewriteCond "%{REQUEST_FILENAME}" "!-l" |
||||
RewriteRule ".*" "index.php" [L] |
||||
</IfModule> |
||||
|
||||
#ErrorDocument 404 /404.php |
||||
|
||||
<Files *.php> |
||||
Order allow,deny |
||||
Deny from all |
||||
</Files> |
||||
|
||||
<Files .gitignore> |
||||
Order allow,deny |
||||
Deny from all |
||||
</Files> |
||||
|
||||
<Files *.tpl> |
||||
Header set Content-Type "text/x-handlebars-template; charset=UTF-8" |
||||
AddCharset UTF-8 .tpl |
||||
</Files> |
||||
|
||||
<Files index.php> |
||||
Order allow,deny |
||||
Allow from all |
||||
</Files> |
||||
@ -0,0 +1,22 @@ |
||||
The MIT License |
||||
|
||||
Copyright (c) 2021 Robert Strutts |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining |
||||
a copy of this software and associated documentation files (the |
||||
"Software"), to deal in the Software without restriction, including |
||||
without limitation the rights to use, copy, modify, merge, publish, |
||||
distribute, sublicense, and/or sell copies of the Software, and to |
||||
permit persons to whom the Software is furnished to do so, subject to |
||||
the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be |
||||
included in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||
@ -0,0 +1,5 @@ |
||||
## TTS Project for use with the PHP - TTS Framework. |
||||
|
||||
Example demo/testing site. |
||||
|
||||
See - tts_framework README file for install guide. |
||||
@ -0,0 +1,24 @@ |
||||
#!/usr/bin/php |
||||
<?php |
||||
require 'src/main.php'; |
||||
|
||||
\tts\site_helper::set_default_project("mockup"); |
||||
|
||||
if (\tts\console_app::is_cli() === false) { |
||||
echo 'Unable to Start'; |
||||
exit; |
||||
} |
||||
|
||||
echo 'Starting...' . PHP_EOL; |
||||
|
||||
$PHPUNIT_Testing = false; |
||||
|
||||
$cli_args = \tts\site_helper::get_cli_args(); |
||||
\tts\main\setup::init(PROJECT_BASE_DIR, $cli_args, "get", $PHPUNIT_Testing); |
||||
|
||||
$found_route = \tts\router::execute(); |
||||
|
||||
if (!$found_route) { |
||||
$app = new \tts\app(); |
||||
$app->load_controller(); |
||||
} |
||||
@ -0,0 +1,25 @@ |
||||
#!/usr/bin/php |
||||
<?php |
||||
|
||||
require 'src/main.php'; |
||||
|
||||
\tts\site_helper::set_default_project("mockup"); |
||||
|
||||
if (\tts\console_app::is_cli() === false) { |
||||
echo 'Unable to Start'; |
||||
exit; |
||||
} |
||||
|
||||
echo 'Starting...' . PHP_EOL; |
||||
|
||||
$PHPUNIT_Testing = true; |
||||
$cli_args = \tts\site_helper::get_cli_args(); |
||||
|
||||
\tts\main\setup::init(PROJECT_BASE_DIR, $cli_args, "get", $PHPUNIT_Testing); |
||||
|
||||
$found_route = \tts\router::execute(); |
||||
|
||||
if (!$found_route) { |
||||
$app = new \tts\app(); |
||||
$app->load_controller(); |
||||
} |
||||
@ -0,0 +1,6 @@ |
||||
This favicon was generated using the following font: |
||||
|
||||
- Font Title: Ubuntu Mono |
||||
- Font Author: Copyright 2011 Canonical Ltd. Licensed under the Ubuntu Font Licence 1.0 |
||||
- Font Source: http://fonts.gstatic.com/s/ubuntumono/v14/KFO8CneDtsqEr0keqCMhbCc_Mn33tYhkf3O1GVg.ttf |
||||
- Font License: Ubuntu Font License, 1.0 (http://font.ubuntu.com/ufl/)) |
||||
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 469 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1 @@ |
||||
{"name":"","short_name":"","icons":[{"src":"./assets/favicon/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./assets/favicon/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} |
||||
@ -0,0 +1 @@ |
||||
alert('hi22'); |
||||
@ -0,0 +1,6 @@ |
||||
This favicon was generated using the following font: |
||||
|
||||
- Font Title: Ubuntu Mono |
||||
- Font Author: Copyright 2011 Canonical Ltd. Licensed under the Ubuntu Font Licence 1.0 |
||||
- Font Source: http://fonts.gstatic.com/s/ubuntumono/v14/KFO8CneDtsqEr0keqCMhbCc_Mn33tYhkf3O1GVg.ttf |
||||
- Font License: Ubuntu Font License, 1.0 (http://font.ubuntu.com/ufl/)) |
||||
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 588 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1 @@ |
||||
{"name":"","short_name":"","icons":[{"src":"./assets/favicon/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./assets/favicon/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} |
||||
@ -0,0 +1 @@ |
||||
//alert('hi');
|
||||
@ -0,0 +1,137 @@ |
||||
/* |
||||
Fluid Router Tool 2.0 ALPHA |
||||
Copyright 2016 Christopher Allen
|
||||
*/ |
||||
var the_tab; |
||||
maintenance_dash.prototype.main = function () { |
||||
return false; |
||||
the_tab = this.tab; |
||||
var dfd_MaintenanceDash_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).done(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_MaintenanceDash_main.resolve("ajax_complete"); |
||||
}); |
||||
return dfd_MaintenanceDash_main.promise(); |
||||
}; |
||||
|
||||
maintenance_dash.prototype.load_left = function () { |
||||
var dfd_MaintenanceLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({id: this.id, filter: this.filter}, "app/maintenance/maintenance-left-header.php", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/maintenance/maintenance-left-footer.php", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/maintenance/maintenance-left-body.php", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).done(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
dfd_MaintenanceLeft.resolve("ajax_done_left"); |
||||
}); |
||||
return dfd_MaintenanceLeft.promise(); |
||||
}; |
||||
|
||||
maintenance_dash.prototype.load_right = function () { |
||||
var dfd_Maintenance = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-header-dash.php", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-footer-dash.php", "main-container-right-footer"); |
||||
progress(); |
||||
var atrdbf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-body-dash.php", "main-container-right-body"); |
||||
if (the_tab == 'NewMaintenance') {
|
||||
var atrdmm = ajax_loader({id: this.id, filter: this.filter, tab: this.tab }, "app/page/right-menu-containers.php", "ajax-menu-container-right-body"); |
||||
}
|
||||
$.when(atrdhf, atrdff, atrdbf).done(function () { |
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
dfd_Maintenance.resolve("ajax_done_right"); |
||||
}); |
||||
return dfd_Maintenance.promise(); |
||||
}; |
||||
|
||||
maintenance_dash.prototype.start_up = function () { |
||||
var filter = this.filter; /* This Filter is used for HASH router navigate */ |
||||
var user_id = this.user_id; /* This user ID is used for AJAX Save */ |
||||
|
||||
debug_print('StartUp'); |
||||
// Scrool to the top of left container onLoad
|
||||
$("#main-container-left-body").scrollTop(-1); |
||||
// Activate the Dropdowns
|
||||
$('.dropdown').dropdown(drop_effect); |
||||
|
||||
/* |
||||
// $('#filter, #sections').dropdown({action: 'select', on: 'hover'});
|
||||
$('#propertyTable').tablesort(); |
||||
$('#propertyTable').on('tablesort:start', function (event, tablesort) { |
||||
debug_print("Starting the sort..."); |
||||
showLoading(); |
||||
}); |
||||
$('#propertyTable').on('tablesort:complete', function (event, tablesort) { |
||||
debug_print("Sort finished!"); |
||||
done_loading(); |
||||
}); |
||||
$('#propertyTable').searchable({ |
||||
searchField: '#propertySearch', |
||||
searchType: 'fuzzy', |
||||
onSearchActive: function () { |
||||
$("#main-container-left-body").scrollTop(0); |
||||
$("#topSearch").css("display", "none");
|
||||
$("#topSearchClose").css("display", "inline-block"); |
||||
}, |
||||
onSearchEmpty: function (elem) { |
||||
$("#topSearchClose").css("display", "none");
|
||||
$("#topSearch").css("display", "inline-block");
|
||||
} |
||||
}); |
||||
|
||||
$('#propertyTable tr:last').after('<tr id="noResults" class="noCount" style="display: none; cursor: default;"><td colspan="4" style="text-align: center; font-weight: 800;">No Tenants Found...</td></tr>'); |
||||
$("#propertySearch").on("keyup", function () { |
||||
|
||||
var activeRows = $('#propertyTable tr:not([style*="display: none"]):not(".noCount")').length; |
||||
var realRows = activeRows - 1; |
||||
$('#propertyCount').html(realRows); |
||||
if (activeRows == 1) { |
||||
$("#noResults").css("display", ""); |
||||
} else { |
||||
$("#noResults").css("display", "none"); |
||||
} |
||||
}); |
||||
|
||||
// Button Clear the search value
|
||||
$("#topSearchClose").off("click");
|
||||
$("#topSearchClose").on("click", function () { |
||||
$("#propertySearch").val(""); |
||||
$("#propertySearch").keyup(); |
||||
$("#propertySearch").focus(); |
||||
}); |
||||
|
||||
// Row click function for Tenant Profile
|
||||
$(".list-row").on("click", function () { |
||||
var id = $(this).data("id"); |
||||
// Profile the the Default route when you click a profile
|
||||
router.navigate('Maintenance/' + filter + '/' + id + '/Profile'); |
||||
}); |
||||
// Activate Popups (There is a CSS version, update to that ASAP)
|
||||
$('.item').popup({ |
||||
hoverable: true, |
||||
position: 'bottom center', |
||||
delay: { |
||||
show: 100, |
||||
hide: 0 |
||||
}, |
||||
transition: 'Vertical Flip' |
||||
}); |
||||
|
||||
*/ |
||||
done_loading(); |
||||
set_height(); |
||||
auto_right_menus(); |
||||
// $("#propertySearch").focus();
|
||||
|
||||
}; |
||||
@ -0,0 +1,68 @@ |
||||
maintenance_dash.prototype.new_maintenance = function () { |
||||
var tenant_id = this.id; /* This tenant ID is used by AJAX saves */ |
||||
var user_id = this.user_id; /* This User ID is used by AJAX saves */ |
||||
|
||||
// Add new tenant
|
||||
$('#newTenant') |
||||
.form({ |
||||
inline: true, |
||||
on: 'blur', |
||||
onSuccess: function () { |
||||
debug_print('#newTenant Form Passed Validation'); |
||||
|
||||
// do what you like with the input
|
||||
$input = $('<input type="hidden" name="user_id"/>').val(user_id); |
||||
$tenantInput = $('<input type="hidden" name="tenant_id"/>').val(tenant_id); |
||||
// append to the form
|
||||
$('#newTenant').append($input); |
||||
$('#newTenant').append($tenantInput); |
||||
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/save-tenant.php', |
||||
type: 'GET', |
||||
data: $(this).serialize(), |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
saved_toast('tenant'); |
||||
/* Go straight to the new profile */ |
||||
router.navigate(response); |
||||
} // END if !ERROR
|
||||
} |
||||
|
||||
}); |
||||
return false; |
||||
}, |
||||
fields: { |
||||
first_name: { |
||||
identifier: 'first_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants first name' |
||||
} |
||||
] |
||||
}, |
||||
last_name: { |
||||
identifier: 'last_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants last name' |
||||
} |
||||
] |
||||
}, |
||||
mainPhone: { |
||||
identifier: 'mainPhone', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the main phone number' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} |
||||
}); |
||||
|
||||
}; |
||||
@ -0,0 +1,70 @@ |
||||
/* |
||||
Fluid Router Tool 2.0 ALPHA |
||||
Copyright 2016 Christopher Allen
|
||||
*/ |
||||
|
||||
maintenance.prototype.main = function () { |
||||
return false; |
||||
var dfd_maintenance_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).done(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_maintenance_main.resolve("ajax_complete"); |
||||
}); |
||||
return dfd_maintenance_main.promise(); |
||||
}; |
||||
|
||||
maintenance.prototype.load_left = function (callback) { |
||||
var dfd_maintenanceLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({id: this.id, filter: this.filter}, "app/maintenance/maintenance-left-header.php", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/maintenance/maintenance-left-footer.php", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/maintenance/maintenance-left-body.php", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).done(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_maintenanceLeft.resolve("ajax_done_left"); |
||||
}); |
||||
return dfd_maintenanceLeft.promise(); |
||||
}; |
||||
|
||||
maintenance.prototype.load_right = function (callback) { |
||||
var dfd_maintenanceRight = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-header.php", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-footer.php", "main-container-right-footer"); |
||||
progress(); |
||||
var atrdbf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/maintenance/maintenance-right-body.php", "main-container-right-body"); |
||||
$.when(atrdhf, atrdff, atrdbf).done(function () { |
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_maintenanceRight.resolve("ajax_done_right"); |
||||
}); |
||||
return dfd_maintenanceRight.promise(); |
||||
}; |
||||
|
||||
maintenance.prototype.start_up = function () { |
||||
var filter = this.filter; /* filter is used by HASH router navigate */ |
||||
var user_id = this.user_id; /* This user ID is used for AJAX save */ |
||||
|
||||
debug_print('start_up'); |
||||
$('.dropdown').dropdown(drop_effect); |
||||
|
||||
done_loading(); |
||||
set_height(); |
||||
auto_right_menus(); |
||||
}; |
||||
@ -0,0 +1,13 @@ |
||||
page_not_found.prototype.main = function () { |
||||
$('#404-modal').modal('setting', 'closable', false).modal('show'); |
||||
}; |
||||
|
||||
function goto_dash() { |
||||
$('#404-modal').modal('hide'); |
||||
router.navigate('Tenants/Active/Dashboard'); |
||||
} |
||||
|
||||
function go_back() { |
||||
$('#404-modal').modal('hide'); |
||||
history.back(); |
||||
} |
||||
@ -0,0 +1,242 @@ |
||||
/* |
||||
Fluid Router Tool 2.0 ALPHA |
||||
Copyright 2016 Christopher Allen
|
||||
*/ |
||||
|
||||
properties_dash.prototype.main = function () { |
||||
var dfd_PropertiesDash_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).done(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_PropertiesDash_main.resolve("ajax_complete"); |
||||
}); |
||||
return dfd_PropertiesDash_main.promise(); |
||||
}; |
||||
|
||||
properties_dash.prototype.load_left = function () { |
||||
var dfd_PropertiesLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({id: this.id, filter: this.filter}, "app/properties/properties-left-header.php", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/properties/properties-left-footer.php", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/properties/properties-left-body.php", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).done(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
dfd_PropertiesLeft.resolve("ajax_done_left"); |
||||
}); |
||||
return dfd_PropertiesLeft.promise(); |
||||
}; |
||||
|
||||
properties_dash.prototype.load_right = function () { |
||||
var dfd_Properties = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-header-dash.php", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-footer-dash.php", "main-container-right-footer"); |
||||
progress(); |
||||
var atrdbf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-body-dash.php", "main-container-right-body"); |
||||
$.when(atrdhf, atrdff, atrdbf).done(function () { |
||||
/* Slide out right Effect for clicked profiles */ |
||||
// $('.rightSlide').css('opacity', '1');
|
||||
// $('.rightSlide')
|
||||
// .transition('fade right', '0ms')
|
||||
// .transition('fade right', '300ms');
|
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
dfd_Properties.resolve("ajax_done_right"); |
||||
}); |
||||
return dfd_Properties.promise(); |
||||
}; |
||||
|
||||
properties_dash.prototype.start_up = function () { |
||||
var filter = this.filter; /* This Filter is used for HASH router navigate */ |
||||
var user_id = this.user_id; /* This user ID is used for AJAX Save */ |
||||
|
||||
debug_print('StartUp'); |
||||
// Scrool to the top of left container onLoad
|
||||
$("#main-container-left-body").scrollTop(-1); |
||||
// Activate the Dropdowns
|
||||
$('.dropdown').dropdown(drop_effect); |
||||
// $('#filter, #sections').dropdown({action: 'select', on: 'hover'});
|
||||
$('#propertyTable').tablesort(); |
||||
$('#propertyTable').on('tablesort:start', function (event, tablesort) { |
||||
debug_print("Starting the sort..."); |
||||
showLoading(); |
||||
}); |
||||
$('#propertyTable').on('tablesort:complete', function (event, tablesort) { |
||||
debug_print("Sort finished!"); |
||||
done_loading(); |
||||
}); |
||||
$('#propertyTable').searchable({ |
||||
searchField: '#propertySearch', |
||||
searchType: 'fuzzy', |
||||
onSearchActive: function () { |
||||
$("#main-container-left-body").scrollTop(0); |
||||
$("#topSearch").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#topSearchClose").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
}, |
||||
onSearchEmpty: function (elem) { |
||||
$("#topSearchClose").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#topSearch").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
} |
||||
}); |
||||
|
||||
$('#propertyTable tr:last').after('<tr id="noResults" class="noCount" style="display: none; cursor: default;"><td colspan="4" style="text-align: center; font-weight: 800;">No Tenants Found...</td></tr>'); |
||||
$("#propertySearch").on("keyup", function () { /* Added 1-16-18 */ |
||||
/* Detect changes to search field to show no results box */ |
||||
var activeRows = $('#propertyTable tr:not([style*="display: none"]):not(".noCount")').length; |
||||
var realRows = activeRows - 1; |
||||
$('#propertyCount').html(realRows); |
||||
if (activeRows == 1) { |
||||
$("#noResults").css("display", ""); |
||||
} else { |
||||
$("#noResults").css("display", "none"); |
||||
} |
||||
}); |
||||
|
||||
// Button Clear the search value
|
||||
$("#topSearchClose").off("click"); /* Added 1-16-18 */ |
||||
$("#topSearchClose").on("click", function () { |
||||
/* Clear The Search Field */ |
||||
$("#propertySearch").val(""); |
||||
$("#propertySearch").keyup(); |
||||
$("#propertySearch").focus(); |
||||
}); |
||||
|
||||
// Row click function for Tenant Profile
|
||||
$(".list-row").on("click", function () { |
||||
var id = $(this).data("id"); |
||||
// Profile the the Default route when you click a profile
|
||||
router.navigate('Properties/' + filter + '/' + id + '/Profile'); |
||||
}); |
||||
// Activate Popups (There is a CSS version, update to that ASAP)
|
||||
$('.item').popup({ |
||||
hoverable: true, |
||||
position: 'bottom center', |
||||
delay: { |
||||
show: 100, |
||||
hide: 0 |
||||
}, |
||||
transition: 'Vertical Flip' |
||||
}); |
||||
|
||||
$('#newProp') |
||||
.form({ |
||||
inline: true, |
||||
on: 'blur', |
||||
onSuccess: function () { |
||||
|
||||
debug_print('#newProp Form Was Successfully Validated'); |
||||
|
||||
// do what you like with the input
|
||||
$input = $('<input type="hidden" name="user_id"/>').val(user_id); |
||||
|
||||
// append to the form
|
||||
$('#newProp').append($input); |
||||
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/properties/save-property.php', |
||||
type: 'POST', |
||||
data: $(this).serialize(), |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
saved_toast('property'); |
||||
// Go straight to the new profile
|
||||
router.navigate(response); |
||||
} // END IF !ERROR
|
||||
} |
||||
|
||||
}); |
||||
return false; |
||||
}, |
||||
fields: { |
||||
status: { |
||||
identifier: 'status', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Select Property Status' |
||||
} |
||||
] |
||||
}, |
||||
entity: { |
||||
identifier: 'entity', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Select Entity Account' |
||||
} |
||||
] |
||||
}, |
||||
rent: { |
||||
identifier: 'rent', |
||||
rules: [ |
||||
{ |
||||
type: 'decimal', |
||||
prompt: 'Enter a valid decimal amount: e.g. $0.00' |
||||
} |
||||
] |
||||
}, |
||||
deposit: { |
||||
identifier: 'deposit', |
||||
rules: [ |
||||
{ |
||||
type: 'decimal', |
||||
prompt: 'Enter a valid decimal amount: e.g. $0.00' |
||||
} |
||||
] |
||||
}, |
||||
houseNumber: { |
||||
identifier: 'houseNumber', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Enter House Number.' |
||||
} |
||||
] |
||||
}, |
||||
streetName: { |
||||
identifier: 'streetName', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Enter Street Name.' |
||||
} |
||||
] |
||||
}, |
||||
city: { |
||||
identifier: 'city', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Enter City Name' |
||||
} |
||||
] |
||||
}, |
||||
zip: { |
||||
identifier: 'zip', |
||||
rules: [ |
||||
{ |
||||
type: 'minLength[5]', |
||||
prompt: 'Enter 5 Digit ZIP Code' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} |
||||
}); |
||||
done_loading(); |
||||
set_height(); |
||||
auto_right_menus(); |
||||
|
||||
$("#propertySearch").focus(); |
||||
|
||||
}; |
||||
@ -0,0 +1,114 @@ |
||||
/* |
||||
Fluid Router Tool 2.0 ALPHA |
||||
Copyright 2016 Christopher Allen
|
||||
*/ |
||||
|
||||
properties.prototype.main = function () { |
||||
var dfd_Properties_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).done(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_Properties_main.resolve("ajax_complete"); |
||||
}); |
||||
return dfd_Properties_main.promise(); |
||||
}; |
||||
|
||||
properties.prototype.load_left = function (callback) { |
||||
var dfd_PropertiesLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({id: this.id, filter: this.filter}, "app/properties/properties-left-header.php", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/properties/properties-left-footer.php", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "app/properties/properties-left-body.php", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).done(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_PropertiesLeft.resolve("ajax_done_left"); |
||||
}); |
||||
return dfd_PropertiesLeft.promise(); |
||||
}; |
||||
|
||||
properties.prototype.load_right = function (callback) { |
||||
var dfd_PropertiesRight = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-header.php", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-footer.php", "main-container-right-footer"); |
||||
progress(); |
||||
var atrdbf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab}, "app/properties/properties-right-body.php", "main-container-right-body"); |
||||
$.when(atrdhf, atrdff, atrdbf).done(function () { |
||||
/* Slide out right Effect for clicked profiles */ |
||||
// $('.rightSlide').css('opacity', '1');
|
||||
// $('.rightSlide')
|
||||
// .transition('fade right', '0ms')
|
||||
// .transition('fade right', '300ms');
|
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_PropertiesRight.resolve("ajax_done_right"); |
||||
}); |
||||
return dfd_PropertiesRight.promise(); |
||||
}; |
||||
|
||||
properties.prototype.start_up = function () { |
||||
var filter = this.filter; /* filter is used by HASH router navigate */ |
||||
var user_id = this.user_id; /* This user ID is used for AJAX save */ |
||||
|
||||
debug_print('StartUp'); |
||||
// Unbind left mouse enter
|
||||
$("#main-container-left-body").off("mouseenter"); |
||||
// Hide search when in profile
|
||||
$("#propertySearchContainer").css("display", "none"); |
||||
// Show go back button
|
||||
$("#properties_back").css("display", "inline-block"); |
||||
// Unbind right mouse enter
|
||||
$("#main-container-right-body").off("mouseenter"); |
||||
//$('#propertyTable').tablesort();
|
||||
$('.phoneNum').mask('(000) 000-0000'); |
||||
$('.money').mask('#,##0.00', {reverse: true}); |
||||
$('#propertyTable').on('tablesort:start', function (event, tablesort) { |
||||
debug_print("Starting the sort..."); |
||||
showLoading(); |
||||
}); |
||||
$('#propertyTable').on('tablesort:complete', function (event, tablesort) { |
||||
debug_print("Sort finished!"); |
||||
done_loading(); |
||||
}); |
||||
$('#propertyTable').searchable({ |
||||
searchField: '#propertySearch' |
||||
}); |
||||
$('.dropdown').dropdown(drop_effect); |
||||
// Row click function for Tenant Profile
|
||||
$(".list-row").on("click", function () { |
||||
var id = $(this).data("id"); |
||||
// Profile the the Default route when you click a profile
|
||||
router.navigate('Properties/' + filter + '/' + id + '/Profile'); |
||||
}); |
||||
$('.ui.accordion').accordion(); |
||||
// Activate Popups (There is a CSS version, update to that ASAP)
|
||||
$('.item').popup({ |
||||
hoverable: true, |
||||
position: 'bottom center', |
||||
delay: { |
||||
show: 100, |
||||
hide: 0 |
||||
}, |
||||
transition: 'Vertical Flip' |
||||
}); |
||||
$("time.timeago").timeago(); |
||||
|
||||
done_loading(); |
||||
set_height(); |
||||
auto_right_menus(); |
||||
}; |
||||
@ -0,0 +1,49 @@ |
||||
properties.prototype.notes = function () { |
||||
var user_id = this.user_id; /* This User ID is used by AJAX saves */ |
||||
var PropertiesID = this.id; /* This PropertiesID is used for AJAX save */ |
||||
|
||||
// Validation for #editProperty
|
||||
$('#addNote') |
||||
.form({ |
||||
inline: false, |
||||
on: 'submit', |
||||
keyboardShortcuts: false, |
||||
onSuccess: function (e) { |
||||
e.preventDefault(); |
||||
debug_print('#addNote form has passed validation'); |
||||
debug_print("Adding note as user_id: " + user_id); |
||||
|
||||
var note = $("#note").val(); |
||||
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/properties/add-note.php', |
||||
type: 'GET', |
||||
data: {propertyID: PropertiesID, user_id: user_id, note: note}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
has_saved(response, xhr, 'note'); |
||||
var rside = cloneObject.loadRight('start_up'); |
||||
$.when( rside ).done(function () { |
||||
cloneObject.notes(); /* Must reload it-self to save another note */ |
||||
}); |
||||
} // END if !ERROR
|
||||
} |
||||
}); // <-- END: .ajax()
|
||||
}, |
||||
fields: { |
||||
note: { |
||||
identifier: 'note', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Error: Please enter your notes first then click the "Add Note" button.' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} // <-- END: fields
|
||||
|
||||
}); // <-- END: #addNote
|
||||
|
||||
}; // <-- END: code
|
||||
@ -0,0 +1,137 @@ |
||||
properties.prototype.profile = function () { |
||||
var user_id = this.user_id; /* This user ID is used for AJAX save */ |
||||
|
||||
// NOTE: Always unbind the last events that bubbled up the DOM tree.
|
||||
$(document).off('change enter', '.updateProperty'); |
||||
// Now bind the newly created event listeners.
|
||||
$(document).on("change enter", ".updateProperty", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var propertyid = $(this).attr('data-propertyID'); |
||||
var fieldname = $(this).attr('data-changed'); |
||||
var newvalue = $(this).val(); |
||||
makeChanges(propertyid, fieldname, newvalue); |
||||
}); // <-- END: onChane event (.updateProperty)
|
||||
|
||||
$(document).off('change enter', '.updatePropertySelect'); |
||||
$(document).on("change enter", ".updatePropertySelect", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var propertyid = $(this).find(':selected').attr('data-propertyID'); |
||||
var fieldname = $(this).find(':selected').attr('data-changed'); |
||||
var newvalue = $(this).find(':selected').val(); |
||||
makeChanges(propertyid, fieldname, newvalue); |
||||
}); // <-- END: onChane event (.updatePropertySelected)
|
||||
|
||||
|
||||
function makeChanges(propertyid, fieldname, newvalue) { |
||||
// validate the form before we proccess it.
|
||||
var validate = $('#editProperty').form('validate form'); |
||||
// Get the result of the validation.
|
||||
var validateResult = $('#editProperty').form('is valid'); |
||||
// If the form passes validation the begin processing.
|
||||
if (validateResult === true) { |
||||
// Get data attributes from the input that was changed.
|
||||
debug_print("Data Passed to AJAX: propertyid=" + propertyid + "&fieldname=" + fieldname + "&newvalue=" + newvalue); |
||||
|
||||
// Save the data then run loadLeft() to refresh left side and re bind event listeners.
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/properties/edit-property.php', |
||||
type: 'GET', |
||||
data: {id: propertyid, field: fieldname, val: newvalue, user_id: user_id}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
has_saved(response, xhr, fieldname); |
||||
|
||||
start_progress(); /* Restart percentage to 1 */ |
||||
cloneObject.load_left('start_up'); |
||||
|
||||
done_loading(); |
||||
} // END if !ERROR
|
||||
}// <-- END: on success
|
||||
|
||||
}); // <-- END: .ajax()
|
||||
|
||||
} // <-- END: validate Results
|
||||
} // End makeChanges() function
|
||||
|
||||
|
||||
// Validation for #editProperty
|
||||
$('#editProperty') |
||||
.form({ |
||||
inline: true, |
||||
on: 'submit', |
||||
keyboardShortcuts: false, |
||||
onSuccess: function () { |
||||
debug_print('#editProperty form has passed validation'); |
||||
|
||||
}, |
||||
fields: { |
||||
status: { |
||||
identifier: 'status', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Select Property Status' |
||||
} |
||||
] |
||||
}, |
||||
entity: { |
||||
identifier: 'entity', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Select Entity Account' |
||||
} |
||||
] |
||||
}, |
||||
rent: { |
||||
identifier: 'rent', |
||||
rules: [ |
||||
{ |
||||
type: 'decimal', |
||||
prompt: 'Enter a valid decimal amount: e.g. $0.00' |
||||
} |
||||
] |
||||
}, |
||||
deposit: { |
||||
identifier: 'deposit', |
||||
rules: [ |
||||
{ |
||||
type: 'decimal', |
||||
prompt: 'Enter a valid decimal amount: e.g. $0.00' |
||||
} |
||||
] |
||||
}, |
||||
name: { |
||||
identifier: 'street', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Enter Property Address.' |
||||
} |
||||
] |
||||
}, |
||||
city: { |
||||
identifier: 'city', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Enter City Name' |
||||
} |
||||
] |
||||
}, |
||||
zip: { |
||||
identifier: 'zip', |
||||
rules: [ |
||||
{ |
||||
type: 'minLength[5]', |
||||
prompt: 'Enter 5 Digit ZIP Code' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} // <-- END: fields
|
||||
|
||||
}); // <-- END: .form
|
||||
|
||||
}; |
||||
@ -0,0 +1,36 @@ |
||||
body.dragging, body.dragging * { |
||||
cursor: move !important; |
||||
} |
||||
.dragged { |
||||
position: absolute; |
||||
opacity: 0.5; |
||||
z-index: 2000; |
||||
} |
||||
ol { |
||||
padding-left: 0; |
||||
} |
||||
ol.vertical li { |
||||
display: block; |
||||
margin: 5px; |
||||
padding: 5px; |
||||
} |
||||
ol.vertical li.placeholder { |
||||
position: relative; |
||||
/** More li styles **/ |
||||
margin: 0; |
||||
padding: 0; |
||||
border: none; |
||||
} |
||||
ol.vertical li.placeholder:before { |
||||
position: absolute; |
||||
/** Define arrowhead **/ |
||||
content: ""; |
||||
width: 0; |
||||
height: 0; |
||||
margin-top: -5px; |
||||
left: -5px; |
||||
top: -4px; |
||||
border: 5px solid transparent; |
||||
border-left-color: red; |
||||
border-right: none; |
||||
} |
||||
@ -0,0 +1,52 @@ |
||||
var myList; |
||||
var myOrder; |
||||
|
||||
settings.prototype.filters = function () { |
||||
|
||||
$('#main-container-left-header').html(' '); |
||||
$('#main-container-left-footer').html(' '); |
||||
|
||||
var aheader = ajax_loader({filter: this.filter, tab: this.tab}, "app/settings/settings-filter-right-header.php", "main-container-right-header"); |
||||
var abody = ajax_loader({filter: this.filter, tab: this.tab}, "app/settings/settings-filter-right-body.php", "main-container-right-body"); |
||||
|
||||
$.when(abody).then(function () { |
||||
/* Has plugin loaded yet */ |
||||
if(jQuery().sortable) { |
||||
if (typeof myList == 'object') { |
||||
myList.sortable("destroy"); |
||||
} |
||||
do_sort();
|
||||
} else { |
||||
$.getScript('assets/js/jquery-sortable-min.js') |
||||
.done(function (script, textStatus) { |
||||
do_sort();
|
||||
}); |
||||
} |
||||
});
|
||||
}; |
||||
|
||||
function do_sort() { |
||||
myList = $("#statusFilter-list").sortable({ |
||||
handle : '.handle', |
||||
onDrop: function ($item, container, _super) { |
||||
var data = myList.sortable("serialize").get(); |
||||
var order = ''; |
||||
var a = data[0]; |
||||
for (i = 0; i < a.length; i++) { |
||||
var item = a[i]; |
||||
var number = item.listitem; |
||||
order += 'listItem[]=' + number + '&'; |
||||
} |
||||
myOrder = order;
|
||||
_super($item, container); |
||||
} |
||||
});
|
||||
} |
||||
|
||||
function save_order() { |
||||
if (myOrder != null) { |
||||
$.get("/dev/app/settings/settings-filter-order.php?"+myOrder, function(data, status) { |
||||
alert(data); |
||||
}); |
||||
} |
||||
} |
||||
@ -0,0 +1,61 @@ |
||||
settings.prototype.Main = function () { |
||||
var dfd_Settings_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).then(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_Settings_main.resolve("ajax_complete"); |
||||
}); |
||||
return dfd_Settings_main.promise(); |
||||
}; |
||||
|
||||
settings.prototype.load_left = function (callback) { |
||||
var dfd_SettingsLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({tab: this.tab}, "app/tenants/tenants-left-header.php", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({tab: this.tab}, "app/tenants/tenants-left-footer.php", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({tab: this.tab}, "app/settings/settings-left-body.php", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).then(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_SettingsLeft.resolve("ajax_done_left"); |
||||
}); |
||||
return dfd_SettingsLeft.promise(); |
||||
}; |
||||
|
||||
settings.prototype.load_right = function () { |
||||
var dfd_SettingsRight = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({id: this.id, tab: this.tab}, "app/tenants/tenants-right-header-dash.php", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, tab: this.tab}, "app/tenants/tenants-right-footer-dash.php", "main-container-right-footer"); |
||||
progress(); |
||||
var atrdbf = ajax_loader({id: this.id, tab: this.tab}, "app/settings/settings-right-body-dash.php", "main-container-right-body"); |
||||
$.when(atrdhf, atrdff, atrdbf).then(function () { |
||||
/* Slide out right Effect for clicked profiles */ |
||||
// $('.rightSlide').css('opacity', '1');
|
||||
// $('.rightSlide')
|
||||
// .transition('fade right', '0ms')
|
||||
// .transition('fade right', '300ms');
|
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
dfd_SettingsRight.resolve("ajax_done_right"); |
||||
}); |
||||
return dfd_SettingsRight.promise(); |
||||
}; |
||||
|
||||
settings.prototype.start_up = function () { |
||||
var filter = this.filter; /* This defines the filter for HASH navigate */ |
||||
debug_print('start_up'); |
||||
done_loading(); |
||||
$('.dropdown').dropdown(drop_effect); |
||||
}; |
||||
@ -0,0 +1,9 @@ |
||||
settings.prototype.new_filter = function () { |
||||
|
||||
$('#main-container-left-header').html(' '); |
||||
$('#main-container-left-footer').html(' '); |
||||
$('#main-container-right-header').html(' '); |
||||
|
||||
var atrdbf = ajax_loader({filter: this.filter, tab: this.tab}, "app/settings/settings-filter-new.php", "main-container-right-body"); |
||||
|
||||
}; |
||||
@ -0,0 +1,10 @@ |
||||
settings.prototype.users = function () { |
||||
|
||||
$('#main-container-left-header').html(' '); |
||||
$('#main-container-left-footer').html(' '); |
||||
|
||||
var atrdbf = ajax_loader({filter: this.filter, tab: this.tab}, "app/settings/settings-admin-right-header.php", "main-container-right-header"); |
||||
var atrdbf = ajax_loader({filter: this.filter, tab: this.tab}, "app/settings/settings-admin-right-body.php", "main-container-right-body"); |
||||
|
||||
|
||||
}; |
||||
@ -0,0 +1,293 @@ |
||||
var the_tab; |
||||
tenants_dash.prototype.main = function () { |
||||
open = []; /* Tracks if menu item was already open */ |
||||
the_tab = this.tab; |
||||
var dfd_TenantsDash_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).then(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_TenantsDash_main.resolve("ajax_complete"); |
||||
}).fail(function(msg) { |
||||
stop_progress(); |
||||
dfd_TenantsDash_main.reject("AJAX Failed loading..."); |
||||
}); |
||||
return dfd_TenantsDash_main.promise(); |
||||
}; |
||||
|
||||
tenants_dash.prototype.load_left = function (callback) { |
||||
var dfd_TenantsLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({filter: this.filter, selected: this.selected}, "tenants/header/left.html", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({filter: this.filter}, "tenants_dash/footer/left.html", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({filter: this.filter}, "tenants/tenants_list/view_for_json.html", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).then(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
|
||||
var fixed_th = ajax_loader({}, "tenants/header/fixed_th.html", "left-fixed-th-container"); |
||||
$.when(fixed_th).then(function () { |
||||
left_scroll(); |
||||
}); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_TenantsLeft.resolve("ajax_done_left"); |
||||
}).fail(function() { |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
dfd_TenantsLeft.reject('load_left -> AJAX Failed loading...'); |
||||
}); |
||||
return dfd_TenantsLeft.promise(); |
||||
}; |
||||
|
||||
tenants_dash.prototype.load_right = function () { |
||||
var dfd_TenantsRight = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
var atrdhf = ajax_loader({filter: this.filter, tab: this.tab}, "tenants_dash/header/right.html", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({filter: this.filter, tab: this.tab}, "tenants_dash/footer/right.html", "main-container-right-footer"); |
||||
progress(); |
||||
|
||||
/** Right Body defined here: */ |
||||
var right_body = 'tenants/notes/index.html'; |
||||
switch (the_tab) { |
||||
case 'Dashboard':
|
||||
right_body = 'tenants_dash/dashboard/index.html';
|
||||
$.get("tenants/todays_transactions/index.html", {trans_day: ''}, function (data) { |
||||
$("#transactionHistory").html(data); |
||||
}); |
||||
break; |
||||
case 'Reports': right_body = 'tenants/report/index.html'; break; |
||||
case 'NewTenant': right_body = 'tenants/new_tenant/index.html'; break; |
||||
case 'Maintenance': right_body = 'maintenance/list/index.html'; break;
|
||||
} |
||||
var atrdbf = ajax_loader({filter: this.filter, tab: this.tab}, right_body, "main-container-right-body"); |
||||
$.when(atrdhf, atrdff, atrdbf).then(function () { |
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
debug_print('Right'); |
||||
dfd_TenantsRight.resolve("ajax_done_right"); |
||||
}).fail(function() { |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
dfd_TenantsRight.reject('load_right -> AJAX Failed loading...'); |
||||
}); |
||||
return dfd_TenantsRight.promise(); |
||||
}; |
||||
|
||||
tenants_dash.prototype.refresh = function () { |
||||
|
||||
}; |
||||
|
||||
tenants_dash.prototype.start_up = function () { |
||||
var filter = this.filter; /* This defines the filter for HASH navigate */ |
||||
|
||||
// Restore scroll position
|
||||
var scroll_pos = get_cookie('scrollPos'); |
||||
if (scroll_pos > 0) { |
||||
$('#main-container-left-body').scrollTop(scroll_pos); |
||||
} |
||||
|
||||
debug_print('CleanUp'); |
||||
$('.money').mask('#,##0.00', {reverse: true}); |
||||
$('.ui.accordion').accordion();
|
||||
$('.dropdown').dropdown(drop_effect); /* Keep towards top of start_up ! */ |
||||
$('#tenantTable').stupidtable(); |
||||
$('#tenantTable').on('tablesort:start', function (event, tablesort) { |
||||
debug_print("Starting the sort..."); |
||||
showLoading(); |
||||
}); |
||||
$('#tenantTable').on('tablesort:complete', function (event, tablesort) { |
||||
debug_print("Sort finished!"); |
||||
done_loading(); |
||||
}); |
||||
|
||||
$('#tenantTable').searchable({ |
||||
searchField: '#tenantSearch', |
||||
searchType: 'fuzzy', |
||||
onSearchActive: function () { |
||||
$("#main-container-left-body").scrollTop(0); |
||||
$("#defaultSearch").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#closeSearch").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
//debug_print("Search Input is active"); /* Added 1-16-18 */
|
||||
|
||||
}, |
||||
onSearchEmpty: function (elem) { |
||||
//debug_print("Search Input is empty"); /* Added 1-16-18 */
|
||||
$("#closeSearch").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#defaultSearch").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
} |
||||
}); |
||||
|
||||
$('#tenantTable tr:last').after('<tr id="noResults" class="noCount" style="display: none; cursor: default;"><td colspan="4" style="text-align: center; font-weight: 800;">No Tenants Found...</td></tr>'); |
||||
$("#tenantSearch").on("keyup", function () { /* Added 1-16-18 */ |
||||
|
||||
/* Mark.js Added 1-31-18 */ |
||||
var keyword = $("#tenantSearch").val(); |
||||
if (keyword.length > 2) { |
||||
setTimeout(function() { |
||||
$('#tenantTable').unmark(); |
||||
$('#tenantTable').mark(keyword); |
||||
}, 90); |
||||
} else { |
||||
$('#tenantTable').unmark(); |
||||
} |
||||
|
||||
/* Detect changes to search field to show no results box */ |
||||
var activeRows = $('#tenantTable tr:not([style*="display: none"]):not(".noCount")').length; |
||||
var realRows = activeRows - 1; |
||||
$('#tenantCount').html(realRows); |
||||
if (activeRows == 1) { |
||||
//debug_print("No Results Found");
|
||||
$("#noResults").css("display", ""); |
||||
} else { |
||||
//debug_print("Results Found and showing");
|
||||
$("#noResults").css("display", "none"); |
||||
} |
||||
}); |
||||
|
||||
// Button Clear the search value
|
||||
$("#closeSearch").off("click"); /* Added 1-16-18 */ |
||||
$("#closeSearch").on("click", function () { |
||||
/* Clear The Search Field */ |
||||
$("#tenantSearch").val(""); |
||||
$("#tenantSearch").keyup(); |
||||
$("#tenantSearch").focus(); |
||||
}); |
||||
|
||||
|
||||
$('.phoneNum').mask('(000) 000-0000'); |
||||
|
||||
// Row click function for Tenant Profile
|
||||
$(".list-row").off("click"); /* Added 12-28-17 */ |
||||
$(".list-row").on("click", function(e) { |
||||
// Save Scroll Position
|
||||
if (! $(e.target).parents().hasClass('exclude') ) { |
||||
var scroll_pos = $('#main-container-left-body').scrollTop(); |
||||
set_cookie('scrollPos', scroll_pos, 60); |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid"); |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + lease_id); |
||||
} |
||||
}); |
||||
|
||||
$(".view-trans").off("click"); |
||||
$(".view-trans").on("click", function() { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid"); |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + lease_id); |
||||
}); |
||||
|
||||
$(".view-maintenance").off("click"); |
||||
$(".view-maintenance").on("click", function() { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid");
|
||||
router.navigate('Maintenance/' + id + '/New/' + lease_id); |
||||
}); |
||||
|
||||
|
||||
/* 7-7 New Feature to show alert on Inactive tenants |
||||
*
|
||||
*/ |
||||
$(".inactive-row").off("click"); |
||||
$(".inactive-row").on("click", function(e) { |
||||
var id = $(this).data("id"); |
||||
var LeaseID = $(this).data("leaseid"); |
||||
if (! $(e.target).parents().hasClass('exclude') ) { |
||||
$.confirm({ |
||||
container: "#main-container-left-body", |
||||
useBootstrap: false, |
||||
boxWidth: "80%", |
||||
position: 'sticky', |
||||
animation: 'bottom', |
||||
closeAnimation: 'bottom', |
||||
type: 'blue', |
||||
title: "Notice", |
||||
content: "This tenant is Inactive! Payments for this account is disabled.", |
||||
buttons: { |
||||
cancel: function() {}, |
||||
Proceed: { |
||||
text: "Continue", |
||||
btnClass: 'btn-blue', |
||||
action: function() { |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + LeaseID); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$(".trasactionClick").off("click"); |
||||
$("#main-container-right-body").on("click", ".trasactionClick", function () { |
||||
var id = $(this).data("id"); |
||||
var LeaseID = $(this).data("leaseid"); |
||||
/* Profile the the Default route when you click a profile */ |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + LeaseID); |
||||
}); |
||||
|
||||
$("#transDay").off("change"); |
||||
$("#transDay").on("change", function () { |
||||
// Get the transaction ID
|
||||
var trans_day = $(this).val(); |
||||
// Get transaction information
|
||||
$.get("tenants/todays_transactions/index.html", {trans_day: trans_day}, function (data) { |
||||
$("#transactionHistory").html(data); |
||||
}); |
||||
}); |
||||
|
||||
$("#filterStatus").dropdown({ |
||||
on: 'hover', |
||||
onChange: function (val) { |
||||
var entity_text = $('#filterEntity').dropdown('get value'); |
||||
window.update_tenants_list(val, entity_text); |
||||
cloneObject.start_up(); |
||||
} |
||||
}); |
||||
|
||||
$("#filterEntity").dropdown({ |
||||
on: 'hover', |
||||
onChange: function (val) {
|
||||
$.ajax({ |
||||
url: "app/home/set_entity.html", |
||||
type: 'GET', |
||||
data: {entity_id: val}, |
||||
async: true, |
||||
dataType: "html", |
||||
success: function (response) { |
||||
start_progress(); /* Restart percentage to 1 */ |
||||
var tenant_status_text = $('#filterStatus').dropdown('get value'); |
||||
window.update_tenants_list(tenant_status_text, val); |
||||
cloneObject.start_up(); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$("#tenantSearch").focus(); |
||||
/** |
||||
var past_week = moment().subtract(7, 'days').format('MM/DD/YYYY'); |
||||
var yymd_today = moment().format('MM/DD/YYYY'); |
||||
*/ |
||||
$('#transDay').daterangepicker({ |
||||
singleDatePicker: true, |
||||
showDropdowns: true, |
||||
autoApply: true, |
||||
opens: 'left', |
||||
// startDate: past_week,
|
||||
// endDate: yymd_today
|
||||
}, function(start, end, label) { |
||||
//console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
|
||||
}); |
||||
|
||||
done_loading(); |
||||
|
||||
}; |
||||
@ -0,0 +1,68 @@ |
||||
tenants_dash.prototype.new_tenant = function () { |
||||
var tenant_id = this.id; /* This tenant ID is used by AJAX saves */ |
||||
var user_id = this.user_id; /* This User ID is used by AJAX saves */ |
||||
|
||||
// Add new tenant
|
||||
$('#newTenant') |
||||
.form({ |
||||
inline: true, |
||||
on: 'blur', |
||||
onSuccess: function () { |
||||
debug_print('#newTenant Form Passed Validation'); |
||||
|
||||
// do what you like with the input
|
||||
$input = $('<input type="hidden" name="user_id"/>').val(user_id); |
||||
$tenantInput = $('<input type="hidden" name="tenant_id"/>').val(tenant_id); |
||||
// append to the form
|
||||
$('#newTenant').append($input); |
||||
$('#newTenant').append($tenantInput); |
||||
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/save-tenant.php', |
||||
type: 'GET', |
||||
data: $(this).serialize(), |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
saved_toast('tenant'); |
||||
/* Go straight to the new profile */ |
||||
router.navigate(response); |
||||
} // END if !ERROR
|
||||
} |
||||
|
||||
}); |
||||
return false; |
||||
}, |
||||
fields: { |
||||
first_name: { |
||||
identifier: 'first_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants first name' |
||||
} |
||||
] |
||||
}, |
||||
last_name: { |
||||
identifier: 'last_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants last name' |
||||
} |
||||
] |
||||
}, |
||||
mainPhone: { |
||||
identifier: 'mainPhone', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the main phone number' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} |
||||
}); |
||||
|
||||
}; |
||||
@ -0,0 +1,47 @@ |
||||
tenants_dash.prototype.reports = function () { |
||||
var user_id = this.user_id; /* This defines the User for AJAX Save */ |
||||
|
||||
$.get( "app/tenants/tenants-right-history-menu.php", function( data ) { |
||||
$( "#main-container-right-body-menu" ).html( data ); |
||||
// show_right_menu(true);
|
||||
right_scroll(); |
||||
$('#testingdrop').dropdown(drop_effect); |
||||
}); |
||||
|
||||
$(".filterReportList").off("change"); |
||||
$(".filterReportList").on("change", function () { |
||||
var report_entity_filter = $('#report_entity_filter').val(); |
||||
var report_month_filter = $('#report_month_filter').val(); |
||||
var report_year_filter = $('#report_year_filter').val(); |
||||
var report_type_filter = $('#report_type').val(); |
||||
|
||||
if (report_type_filter == '') { |
||||
alert('Please first select Report Type!');
|
||||
} else { |
||||
// Get transaction information
|
||||
$('#loadingReport').addClass('active'); |
||||
$.get("tenants/report/"+report_type_filter+".html", {entity_id: report_entity_filter, month: report_month_filter, year: report_year_filter}, function (data) { |
||||
$("#reportShell").html(data); |
||||
$('#loadingReport').removeClass('active'); |
||||
$('#printReport').removeClass('disabled'); |
||||
$('.filterReportList').removeClass('disabled'); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$("#printReport").off("click"); |
||||
$("#printReport").on("click", function () { |
||||
var report_entity_filter = $('#report_entity_filter').val(); |
||||
var report_month_filter = $('#report_month_filter').val(); |
||||
var report_year_filter = $('#report_year_filter').val(); |
||||
print_reports(report_entity_filter, report_month_filter, report_year_filter); |
||||
}); |
||||
|
||||
}; |
||||
|
||||
function print_reports(entity_id, month, year) { |
||||
var frame_id = 'print_reports'; |
||||
var report_type_filter = $('#report_type').val(); |
||||
var src = 'tenants/report/'+report_type_filter+'.html?use_html=true&entity_id='+entity_id+'&month='+month+'&year='+year; |
||||
print_frame(frame_id, src); |
||||
} |
||||
@ -0,0 +1,313 @@ |
||||
// Define Globals
|
||||
var user_id; |
||||
var transtype; |
||||
var baltype; |
||||
var theTenant; |
||||
var theFilter; |
||||
var transType;
|
||||
var transBal;
|
||||
var trans_id; |
||||
var lease_id; |
||||
|
||||
tenants.prototype.edit_transaction = function () { |
||||
user_id = this.user_id; /* This defines the User for AJAX Save */ |
||||
transtype = this.transtype; |
||||
baltype = this.baltype; |
||||
theTenant = this.id; |
||||
theFilter = this.filter; |
||||
transType = transtype;
|
||||
transBal = baltype;
|
||||
trans_id = $('#last_transaction').val(); |
||||
lease_id = this.lease_id; |
||||
|
||||
$('#printReceiptBtn').prop("disabled", true); |
||||
$('#processTransaction').css('opacity', '0'); // hide submit on startup
|
||||
|
||||
// New modal for creating transactions
|
||||
$(".createTransaction").off("click"); |
||||
$(".createTransaction").on("click", function() {
|
||||
var CTtransType = $(this).attr('data-transType'); |
||||
var CTtransBal = $(this).attr('data-transBal'); |
||||
router.navigate('Tenants/' + theFilter + '/' + theTenant + '/Transactions/'+lease_id+'/NewTransaction/Create/'+CTtransType+'/'+CTtransBal+'/Modal'); |
||||
}); |
||||
|
||||
// Create Transaction load form page
|
||||
$.get("app/tenants/create-new-transaction.php", {transType: transType, transBal: transBal, trans_id: trans_id}, function (data) { |
||||
|
||||
$("#newTransactionForm").html(data); |
||||
cloneObject.actions(); |
||||
|
||||
}); // end of GET creat new trans
|
||||
|
||||
}; |
||||
|
||||
tenants.prototype.actions = function () { |
||||
// Covert the HTML selects to semantic dropdowns (Added by Chris 8/15/2018)
|
||||
// Selection will drop down and reset.... which sucks...but looks good.
|
||||
$('#createNewTransaction select').dropdown(); |
||||
|
||||
$('#process-trans-type').html(transType);
|
||||
$('#process-trans-bal').html(transBal); |
||||
|
||||
$('#process-amount').html($("#amount_tendered").val()); |
||||
if (transType == "Payment") { |
||||
$("#payment_method_text").text("Payment Method"); |
||||
$("#payment_method").html("<option value='none' selected>Select Option</option><option value='Cash'>Cash</option><option value='Check'>Check</option><option value='moneyOrder'>Money Order</option><option value='moneyGram'>Money Gram</option><option value='westernUnion'>Western Union</option><option value='cashiersCheck'>Cashier's Check</option><option value='directDeposit'>Direct Deposit</option>"); |
||||
} else if (transType == "Receivable") { |
||||
$("#payment_method_text").text("Charge Type"); |
||||
$("#payment_method").html("<option value='Charge'>Account Charge</option>"); |
||||
}
|
||||
|
||||
// Start of Create Form
|
||||
var counter_for_trans = 0; |
||||
$(document).off('blur', '#createNewTransaction'); |
||||
$('#createNewTransaction') |
||||
.form({ |
||||
inline: true, |
||||
on: 'blur', |
||||
onSuccess: function (e) { |
||||
e.stopImmediatePropagation();
|
||||
if (counter_for_trans === 0) {
|
||||
counter_for_trans++;
|
||||
} else { |
||||
throw "Duplicate!"; |
||||
}
|
||||
|
||||
debug_print('#newTransaction Form Passed Validation'); |
||||
|
||||
// do what you like with the input
|
||||
$input = $('<input type="hidden" name="user_id"/>').val(user_id); |
||||
|
||||
// append to the form
|
||||
$('#createNewTransaction').append($input); |
||||
|
||||
$.ajax({ |
||||
// beforeSend: saving_toast,
|
||||
url: 'app/tenants/new-transaction.php', |
||||
type: 'GET', |
||||
data: $('#include-ids, #createNewTransaction').serialize(), |
||||
success: function (response, status, xhr) { |
||||
if (!check_for_error('transaction-message',response, xhr)) { |
||||
did_save('transaction-message', response, xhr, 'transaction'); |
||||
console.log('Receipt trans_id#'+response.transaction_id); |
||||
$('#printReceiptBtn').attr('data-trans-id', response.transaction_id); |
||||
$('#printReceiptBtn').prop("disabled", false); |
||||
$('#printReceiptBtn').css('opacity', '1'); |
||||
|
||||
if ($('#checkboxReceipt').checkbox('is checked') === true) { |
||||
if (response.transaction_id > 0) {
|
||||
print_frame('NewPrintReceipt', 'app/tenants/print-receipt.php?trans_id=' + response.transaction_id); |
||||
} |
||||
} |
||||
|
||||
} // END if !ERROR
|
||||
} |
||||
|
||||
}); // END ajax call
|
||||
return false; |
||||
}, |
||||
fields: { |
||||
trans_type: { |
||||
identifier: 'trans_type', |
||||
rules: [ { type: 'empty', prompt: 'Please select a transaction type' } ] |
||||
}, |
||||
balance_type: { |
||||
identifier: 'balance_type', |
||||
rules: [ { type: 'empty', prompt: 'Please select a balance type' } ] |
||||
}, |
||||
amount_tendered: { |
||||
identifier: 'amount_tendered', |
||||
rules: [ { type: 'decimalMoney', prompt: 'Please enter a decimal amount (Example: 100.00)' } ] |
||||
}, |
||||
payment_method: { |
||||
identifier: 'payment_method', |
||||
rules: [ { type: 'not[none]', prompt: 'Please select a payment method' } ] |
||||
} |
||||
}// END fields
|
||||
}); // END #newTransaction form
|
||||
|
||||
|
||||
// Make sure you cant select the wrong payment method
|
||||
$("#trans_type").off('change'); |
||||
$("#trans_type").on("change", function (event) { |
||||
var val = $(this).val(); |
||||
$('#process-trans-type').html(val); // transType
|
||||
// Only show the options that apply to the transaction type
|
||||
if (val == "Payment") { |
||||
$("#payment_method_text").text("Payment Method"); |
||||
$("#payment_method").html("<option value='none' selected>Select Option</option><option value='Cash'>Cash</option><option value='Check'>Check</option><option value='moneyOrder'>Money Order</option><option value='moneyGram'>Money Gram</option><option value='westernUnion'>Western Union</option><option value='cashiersCheck'>Cashier's Check</option><option value='directDeposit'>Direct Deposit</option>"); |
||||
checkForm(); |
||||
} else if (val == "Receivable") { |
||||
$("#payment_method_text").text("Charge Type"); |
||||
$("#payment_method").html("<option value='Charge' selected>Account Charge</option>"); |
||||
checkForm(); |
||||
} else if (val == "Credit") { |
||||
$("#payment_method_text").text("Credit Type"); |
||||
$("#payment_method").html("<option value='Credit' selected>Account Credit</option>"); |
||||
checkForm(); |
||||
} |
||||
}); |
||||
|
||||
$("#balance_type").off('change'); |
||||
$("#balance_type").on("change", function (event) { |
||||
var transBal = $("#balance_type").val(); |
||||
$('#process-trans-bal').html(transBal); |
||||
});
|
||||
|
||||
$("#amount_tendered").off('change'); |
||||
$("#amount_tendered").on("change", function (event) { |
||||
var amount = $("#amount_tendered").val(); |
||||
var decimal = amount.includes('.'); |
||||
if (decimal === false && amount > 9) { |
||||
$("#amount_tendered").val(String(amount) + '.00'); |
||||
$('#process-amount').html(String(amount) + '.00'); |
||||
} else { |
||||
$('#process-amount').html(amount); |
||||
} |
||||
// Check to see if form is valid
|
||||
checkForm(); |
||||
}); |
||||
|
||||
$('#payment_method').off("change");
|
||||
$('#payment_method').on("change", function (event) { |
||||
// Check to see if form is valid
|
||||
checkForm(); |
||||
}); |
||||
|
||||
$('#notes').off("change");
|
||||
$('#notes').on("change", function (event) { |
||||
// Check to see if form is valid
|
||||
checkForm(); |
||||
});
|
||||
|
||||
$(document).off("click", "#printReceiptBtn"); |
||||
$(document).on("click", "#printReceiptBtn", function () { |
||||
var trans_id = $('#printReceiptBtn').attr('data-trans-id'); |
||||
console.log("Trans ID: " + trans_id); |
||||
print_frame('NewReceipt', 'app/tenants/print-receipt.php?trans_id=' + trans_id); |
||||
}); |
||||
|
||||
setTimeout(function (){ $('#amount_tendered').focus(); }, 1000); |
||||
|
||||
|
||||
$(document).off("click", ".trasactionItem"); |
||||
$(document).on("click", ".trasactionItem", function () { |
||||
$("#print_frame").remove(); |
||||
var trans_id = $(this).data("id"); |
||||
router.navigate('Tenants/' + theFilter + '/' + theTenant + '/Transactions/'+lease_id+'/ViewTransaction/Details/'+trans_id+'/Modal'); |
||||
}); |
||||
|
||||
$("#closeTransaction").off("click"); |
||||
$("#closeTransaction").on("click", function() { |
||||
//alert("Navigating...");
|
||||
$('#newTransactionModal').modal('hide'); |
||||
router.navigate('Tenants/' + theFilter + '/' + theTenant + '/Transactions'); |
||||
}); |
||||
|
||||
$(document).off("click", "#processTransaction"); |
||||
$(document).on("click", "#processTransaction", function (event) { |
||||
$('#createNewTransaction').form('submit'); |
||||
$('#createNewTransaction').form('reset'); |
||||
}); |
||||
|
||||
$(".closeTrans").off("click"); |
||||
$(".closeTrans").on("click", function () { |
||||
$('#transactionModal').modal('hide'); |
||||
}); |
||||
|
||||
$('.coupled.modal').modal({allowMultiple: true }); |
||||
|
||||
$(document).off("click", ".printRecipt"); |
||||
$(document).on("click", ".printRecipt", function () { |
||||
var trans_id = $('#modalTransID').val() |
||||
$('#modalTransID').val(trans_id); |
||||
$('#print_frame').attr('src', 'app/tenants/print-receipt.php?trans_id=' + trans_id + ''); |
||||
$("#print_frame").get(0).contentWindow.print(); |
||||
$('#modalTransID').val(''); |
||||
}); |
||||
|
||||
$(".filterTrans").off("change"); |
||||
$(".filterTrans").on("change", function () { |
||||
var lease_id = $('#lease_id').val(); |
||||
var trans_type_filter = $('#trans_type_filter').val(); |
||||
var balance_type_filter = $('#balance_type_filter').val(); |
||||
var date_filter = $('#date_filter').val(); |
||||
// Get transaction information
|
||||
$.holdReady( true ); |
||||
$.get("app/tenants/view-transactions.php", {lease_id: lease_id, trans_type_filter: trans_type_filter, balance_type_filter: balance_type_filter, date_filter: date_filter}, function (data) { |
||||
$.holdReady( false ); |
||||
$("#transactionHistory").html(data); |
||||
}); |
||||
}); |
||||
|
||||
$(document).off("click", ".voidTransaction"); |
||||
$(document).on("click", ".voidTransaction", function () { |
||||
$('#voidModalTransID').val($('#modalTransID').val()); |
||||
$('#voidModal').modal('show'); |
||||
}); |
||||
|
||||
$(document).off("click", ".doVoid"); |
||||
$(document).on("click", ".doVoid", function () { |
||||
var void_id = $('#voidModalTransID').val(); |
||||
alert(void_id); |
||||
}); |
||||
|
||||
// hmm SHould be called EDIT...
|
||||
$('#newTransactionModal').modal({ |
||||
centered: false, |
||||
closable: false |
||||
}).modal('setting', 'transition', 'vertical flip') |
||||
.modal('show'); |
||||
|
||||
|
||||
}; |
||||
// End of Actions
|
||||
|
||||
|
||||
var vnotes = false; |
||||
function checkForm() { |
||||
var method = $("#payment_method").val(); |
||||
var notes = $("#notes").val(); |
||||
if (method == '' || method == 'Cash' || method == 'Charge' || method == 'Credit') { |
||||
var valid = true; |
||||
} else if (notes == '') { |
||||
var valid = false; |
||||
} else { |
||||
var valid = true; |
||||
} |
||||
if (valid === false) { |
||||
$('#createNewTransaction').form('add rule', 'notes', { identifier: 'notes', rules: [ { type: 'empty', prompt: 'Please enter reference#' } ] } ); |
||||
$('#createNewTransaction').form('validate field', 'notes'); |
||||
vnotes = true; |
||||
} else { |
||||
if (vnotes === true) { |
||||
$('#createNewTransaction').form('remove rule', 'notes'); |
||||
$('#createNewTransaction').form('validate field', 'notes'); |
||||
vnotes = false; |
||||
} |
||||
} |
||||
if ( valid === true && $('#createNewTransaction').form('is valid') ) { |
||||
console.log('Attempting to enable Process Transaction!'); |
||||
$('#processTransaction').removeClass('grey'); |
||||
$('#processTransaction').addClass('green'); |
||||
$('#processTransaction').removeClass('disabled'); |
||||
$('#processTransaction').css('opacity', '1'); // show
|
||||
} else { |
||||
$('#processTransaction').addClass('grey'); |
||||
$('#processTransaction').removeClass('green'); |
||||
$('#processTransaction').addClass('disabled'); |
||||
$('#processTransaction').css('opacity', '0'); |
||||
} |
||||
} |
||||
|
||||
function print_ledger() { |
||||
var trans_type_filter = $('#trans_type_filter').val(); |
||||
var balance_type_filter = $('#balance_type_filter').val(); |
||||
var date_filter = $('#date_filter').val(); |
||||
var lease_id = $('#lease_id').val(); |
||||
var printTrans = $('#printTrans').val(); |
||||
// console.log('trans_type_filter: '+trans_type_filter+' balance_type_filter: '+balance_type_filter+' lease_id: '+lease_id+' printTrans: '+printTrans);
|
||||
var frame_id = 'printTransReport'; |
||||
var src = 'app/tenants/print-transactions.php?lease_id=' + lease_id + '&trans_type_filter=' + trans_type_filter + '&balance_type_filter=' + balance_type_filter + '&date_filter=' + date_filter; |
||||
print_frame(frame_id, src); |
||||
} |
||||
@ -0,0 +1,218 @@ |
||||
tenants.prototype.lease = function () { |
||||
var tenant_id = this.id; /* This tenant ID is used by AJAX saves */ |
||||
var user_id = this.user_id; /* This User ID is used by AJAX saves */ |
||||
|
||||
//alert("In the lease Tab");
|
||||
// Select from Available Properties
|
||||
$("#availableSearch").on("change", function () { |
||||
var idProp = $(this).find(':selected').val(); |
||||
//alert(id);
|
||||
property_id = idProp; |
||||
|
||||
// do what you like with the input
|
||||
$hiddenPropertyID = $('<input type="hidden" id="property_id" name="property_id"/>').val(property_id); |
||||
|
||||
// append to the form
|
||||
$('#newLease').append($hiddenPropertyID); |
||||
|
||||
//var address = $(this).data("address");
|
||||
var address = $(this).find(':selected').data('address'); |
||||
|
||||
// do what you like with the input
|
||||
$hiddenAddress = $('<input type="hidden" id="property_address" name="property_address"/>').val(address); |
||||
|
||||
// append to the form
|
||||
$('#newLease').append($hiddenAddress); |
||||
$('#no-lease').css('display', 'none'); |
||||
$('#no-lease').transition('slide down', '0ms') |
||||
.transition('slide down', 300, function () { |
||||
$('#no-lease').css('display', 'none'); |
||||
}); |
||||
$('#lease-form').show(); |
||||
}); |
||||
|
||||
$('#editLease') |
||||
.form({ |
||||
inline: true, |
||||
fields: { |
||||
rent: { |
||||
identifier: 'rent', |
||||
rules: [ { type: 'decimalMoney', prompt: 'Please enter a valid decmial number (Example: 100.00)'} ] |
||||
}, |
||||
deposit: { |
||||
identifer: 'deposit', |
||||
rules: [ { type: 'decimalMoney', prompt: 'Please enter a valid decmial number (Example: 100.00)' } ] |
||||
},
|
||||
} |
||||
}); |
||||
|
||||
// Validation for #addLease
|
||||
$('#newLease') |
||||
.form({ |
||||
inline: true, |
||||
on: 'submit', |
||||
keyboardShortcuts: false, |
||||
onSuccess: function (e) { |
||||
e.preventDefault(); |
||||
debug_print('#newLease form has passed validation'); |
||||
debug_print("Adding Lease as user_id: " + user); |
||||
var property_id = $("#availableSearch").val(); |
||||
var property_address = $("#property_address").val(); |
||||
var occupants_num = $("#occupants_num").val(); |
||||
var list_occupants = $("#list_occupants").val(); |
||||
var billing_day = $("#billing_day").val(); |
||||
var water_payed_by = $("#water_payed_by").val(); |
||||
var consumers_payed_by = $("#consumers_payed_by").val(); |
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/add-lease.php', |
||||
type: 'GET', |
||||
async: true, |
||||
data: {tenant_id: tenant_id, property_id: property_id, user_id: user_id, occupants_num: occupants_num, list_occupants: list_occupants, billing_day: billing_day, property_address: property_address, water_payed_by: water_payed_by, consumers_payed_by: consumers_payed_by}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
start_progress(); /* Restart percentage to 1 */ |
||||
cloneObject.reload_right(); |
||||
cloneObject.load_left('start_up'); |
||||
has_saved(response, xhr, 'lease'); |
||||
|
||||
/* Make sure Lease was Created... */ |
||||
if (response.lease_id > 0) { |
||||
router.navigate('Tenants/Active/'+tenant_id+'/Profile/'+response.lease_id); |
||||
} |
||||
|
||||
} // END if !Error
|
||||
} |
||||
}); // <-- END: .ajax()
|
||||
|
||||
}, |
||||
fields: { |
||||
availableSearch: { |
||||
identifier: 'availableSearch', |
||||
rules: [ { type: 'empty', prompt: 'Please select a property to create a new lease.' } ] |
||||
}, |
||||
occupants_num: { |
||||
identifier: 'occupants_num', |
||||
rules: [ { type: 'empty', prompt: 'How many occupants are they?' } ] |
||||
}, |
||||
billing_day: { |
||||
identifier: 'billing_day', |
||||
rules: [ { type: 'empty', prompt: 'Select automatic rent billing date.' } ] |
||||
} |
||||
} // <-- END: fields
|
||||
|
||||
}); // <-- END: #addLease
|
||||
|
||||
|
||||
// UPDATE LEASE
|
||||
// NOTE: Always unbind the last events that bubbled up the DOM tree.
|
||||
$(document).off('change enter', '.updateLease'); |
||||
// Now bind the newly created event listeners.
|
||||
$(document).on("change enter", ".updateLease", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var leaseid = $(this).attr('data-leaseID'); |
||||
var fieldname = $(this).attr('data-changed'); |
||||
var newvalue = $(this).val(); |
||||
var tenantid = tenant_id; // Fixed on 12/19/2017
|
||||
// alert(tenantid+"-"+fieldname+"-"+newvalue);
|
||||
|
||||
make_changes_lease(leaseid, fieldname, newvalue, tenantid); |
||||
}); // <-- END: onChane event (.updateLease)
|
||||
|
||||
$(document).off('change enter', '.updateLeaseSelect'); |
||||
$(document).on("change enter", ".updateLeaseSelect", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var leaseid = $(this).find(':selected').attr('data-leaseID'); |
||||
var fieldname = $(this).find(':selected').attr('data-changed'); |
||||
var newvalue = $(this).find(':selected').val(); |
||||
var tenantid = tenant_id; |
||||
make_changes_lease(leaseid, fieldname, newvalue, tenantid); |
||||
}); // <-- END: onChane event (.updateLeaseSelected)
|
||||
|
||||
function make_changes_lease(leaseid, fieldname, newvalue, tenantid) { |
||||
var saving = ''; |
||||
// validate the form before we proccess it.
|
||||
var validate = $('#editLease').form('validate form'); |
||||
// Get the result of the validation.
|
||||
var validateResult = $('#editLease').form('is valid'); |
||||
// If the form passes validation the begin processing.
|
||||
if (validateResult === true) { |
||||
|
||||
// Get data attributes from the input that was changed.
|
||||
var leaseid = leaseid; |
||||
var fieldname = fieldname; |
||||
var newvalue = newvalue; |
||||
debug_print("Data Passed to AJAX: leaseid=" + leaseid + "&field=" + fieldname + "&newvalue=" + newvalue + "&tenant_id=" + tenantid); |
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/edit-lease.php', |
||||
type: 'GET', |
||||
async: true, |
||||
data: {id: leaseid, field: fieldname, val: newvalue, user_id: user_id, tenant_id: tenantid}, |
||||
success: function (response, status, xhr) { |
||||
if (!hasError(response, xhr)) { |
||||
hasSaved(response, xhr, fieldname); |
||||
|
||||
// Re load the right side without the animation for sticky message timestamp update
|
||||
if (fieldname == "status_msg") { |
||||
start_progress(); /* Restart percentage to 1 */ |
||||
cloneObject.reloadRight(); |
||||
done_loading(); |
||||
} |
||||
} // END if !Error check
|
||||
}// <-- END: on success
|
||||
|
||||
}); // <-- END: .ajax()
|
||||
|
||||
} // <-- END: validate Results
|
||||
} // End makeChanges() function
|
||||
|
||||
}; // END if Tab = Lease
|
||||
|
||||
tenants.prototype.reload_right = function () { |
||||
var rside = cloneObject.load_right('StartUp'); |
||||
$.when( rside ).done(function () { |
||||
cloneObject.Lease(); /* RE-bind self */ |
||||
stop_progress(); /* Make readonly fields styles */ |
||||
}); |
||||
}; |
||||
|
||||
tenants.prototype.confirm_close = function (leaseID, property_id, address) { |
||||
var tenant_id = this.id; /* This tenant ID is used by AJAX saves */ |
||||
var user_id = this.user_id; /* This User ID is used by AJAX saves */ |
||||
|
||||
$.confirm({ |
||||
container: "#lease", |
||||
useBootstrap: false, |
||||
boxWidth: "80%", |
||||
position: 'sticky', |
||||
animation: 'bottom', |
||||
closeAnimation: 'bottom', |
||||
type: 'red', |
||||
title: "Terminate Lease", |
||||
content: "Are you sure you want to Terminate this lease for: " + address + "?", |
||||
buttons: { |
||||
cancel: function() {}, |
||||
terminate: { |
||||
text: "Terminiate Lease", |
||||
btnClass: 'btn-red', |
||||
action: function() { |
||||
debug_print('Termanited Tenant: leaseID=' + leaseID + ',user_id=' + user_id + ',tenant_id=' + tenant_id + ',property_id=' + property_id); |
||||
$.ajax({ |
||||
url: 'app/tenants/close-lease.php', |
||||
type: 'GET', |
||||
async: true, |
||||
data: {leaseID: leaseID, user_id: user_id, tenant_id: tenant_id, property_id: property_id}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
cloneObject.reload_right(); |
||||
cloneObject.loadLeft('start_up'); |
||||
has_saved(response, xhr, 'Terminated Lease'); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
});
|
||||
}; // end of function confirmClose
|
||||
@ -0,0 +1,265 @@ |
||||
var the_tab; |
||||
tenants.prototype.main = function () { |
||||
open = []; /* Tracks if menu item was already open */ |
||||
the_tab = this.tab; |
||||
var dfd_Tenants_main = jQuery.Deferred(); |
||||
start_progress(); |
||||
$.when(this.load_left(), this.load_right()).done(function () { |
||||
stop_progress(); |
||||
debug_print('AJAX complete'); |
||||
dfd_Tenants_main.resolve("ajax_complete"); |
||||
}).fail(function(msg) { |
||||
stop_progress(); |
||||
dfd_Tenants_main.reject("AJAX Failed loading..."); |
||||
}); |
||||
|
||||
return dfd_Tenants_main.promise(); |
||||
}; |
||||
|
||||
tenants.prototype.load_left = function (callback) { |
||||
var RowID = this.id; /* This tenant Row ID is used by row selection function */ |
||||
var dfd_TenantsLeft = jQuery.Deferred(); |
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("main-container-left-footer").html(' '); /* keep padding while loading */ |
||||
var atldhf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected}, "tenants/header/left.html", "main-container-left-header"); |
||||
progress(); |
||||
var atldff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab, selected: this.selected}, "tenants/footer/left.html", "main-container-left-footer"); |
||||
progress(); |
||||
var atldbf = ajax_loader({id: this.id, filter: this.filter, selected: this.selected, lease_id: this.lease_id}, "tenants/tenants_list/view_for_json.html", "main-container-left-body"); |
||||
progress(); |
||||
$.when(atldhf, atldff, atldbf).done(function () { |
||||
progress(); |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
debug_print('Left'); |
||||
var fixed_th = ajax_loader({}, "tenants/header/fixed_th.html", "left-fixed-th-container"); |
||||
$.when(fixed_th).then(function () { |
||||
left_scroll(); |
||||
}); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
dfd_TenantsLeft.resolve("ajax_done_left"); |
||||
}).fail(function() { |
||||
$("#main-container-left-body").removeClass("loading"); |
||||
dfd_TenantsLeft.reject('load_left -> AJAX Failed loading...'); |
||||
}); |
||||
|
||||
return dfd_TenantsLeft.promise(); |
||||
}; |
||||
|
||||
tenants.prototype.load_right = function (callback) { |
||||
var dfd_TenantsRight = jQuery.Deferred(); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
|
||||
var atrdhf = ajax_loader({id: this.id, filter: this.filter, tab: this.tab, lease_id: this.lease_id}, "tenants/header/right.html", "main-container-right-header"); |
||||
progress(); |
||||
var atrdff = ajax_loader({id: this.id, filter: this.filter, tab: this.tab, selected: "true"}, "tenants/footer/right.html", "main-container-right-footer"); |
||||
progress(); |
||||
|
||||
if (this.tab == 'Transactions' || this.tab == 'ViewTransaction') {
|
||||
var atrdmm = ajax_loader({id: this.id, filter: this.filter, tab: this.tab, lease_id: this.lease_id, trans_id: this.trans_id, trans_type: this.trans_type, trans_bal: this.bal_type}, "tenants/containers/right_menu.html", "ajax-menu-container-right-body"); |
||||
} else { |
||||
var atrdmm = $.Deferred(); |
||||
atrdmm.resolve(); |
||||
} |
||||
|
||||
/** Right Body defined here: */ |
||||
var right_body = 'tenants/notes/index.html'; |
||||
switch (this.tab) { |
||||
case 'Profile': right_body = 'tenants/profile/index.html'; break; |
||||
case 'Notes': right_body = 'tenants/notes/index.html'; break; |
||||
case 'Lease': right_body = 'tenants/lease/index.html'; break; |
||||
case 'Activity': right_body = 'tenants/activity/index.html'; break; |
||||
case 'Transactions': right_body = 'tenants/transactions/index.html'; break; |
||||
case 'ViewTransaction': right_body = 'tenants/transactions/view_transaction.html'; break; |
||||
} |
||||
|
||||
var main_body_deferred = $.Deferred(); |
||||
var all_right_body_vars = {id: this.id, filter: this.filter, tab: this.tab, lease_id: this.lease_id, trans_id: this.trans_id, trans_type: this.trans_type, trans_bal: this.bal_type}; |
||||
$.when(atrdmm).done(function() { |
||||
atrdbf = ajax_loader(all_right_body_vars, right_body, "main-container-right-body"); |
||||
$.when(atrdbf).done(function() { |
||||
main_body_deferred.resolve(); |
||||
}); |
||||
}); |
||||
|
||||
$.when(main_body_deferred, atrdhf, atrdff).done(function () { |
||||
$('#main-container-right-body').scrollTop(0); |
||||
progress(); |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
if (typeof callback !== 'undefined' && cloneObject[callback]) { |
||||
cloneObject[callback](); |
||||
} |
||||
debug_print('Right'); |
||||
dfd_TenantsRight.resolve("ajax_done_right"); |
||||
}).fail(function() { |
||||
$("#main-container-right-body").removeClass("loading"); |
||||
dfd_TenantsRight.reject('load_right -> AJAX Failed loading...'); |
||||
}); |
||||
|
||||
return dfd_TenantsRight.promise(); |
||||
}; |
||||
|
||||
tenants.prototype.start_up = function () { |
||||
right_scroll(); // Double check that height is correct here...
|
||||
var filter = this.filter; /* This filter is used by HASH router navigate */ |
||||
$('.dropdown').dropdown(drop_effect); /* Keep towards top of start_up ! */ |
||||
debug_print('CleanUp FN - should be last now...'); |
||||
$('.ui.accordion').accordion(); |
||||
/* unbind the mouse enter left */ |
||||
$("#main-container-left-body").off("mouseenter"); |
||||
/* unbind the mouse enter right */ |
||||
$("#main-container-right-body").off("mouseenter"); |
||||
$('#tenantTable').stupidtable(); |
||||
$('.phoneNum').mask('(000) 000-0000'); |
||||
$('.money').mask('#,##0.00', {reverse: true}); |
||||
$('#tenantTable').on('tablesort:start', function (event, tablesort) { |
||||
debug_print("Starting the sort..."); |
||||
showLoading(); |
||||
}); |
||||
$('#tenantTable').on('tablesort:complete', function (event, tablesort) { |
||||
debug_print("Sort finished!"); |
||||
done_loading(); |
||||
}); |
||||
|
||||
$("#tenantSearch").on("keyup", function () { |
||||
/* Mark.js Added 1-31-18 */ |
||||
var keyword = $("#tenantSearch").val(); |
||||
if (keyword.length > 2) { |
||||
setTimeout(function() { |
||||
$('#tenantTable').unmark(); |
||||
$('#tenantTable').mark(keyword); |
||||
}, 90); |
||||
} else { |
||||
$('#tenantTable').unmark(); |
||||
} |
||||
}); |
||||
|
||||
$('#tenantTable').searchable({ |
||||
searchField: '#tenantSearch', |
||||
onSearchActive: function (term) { |
||||
$("#defaultSearch").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#closeSearch").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
}, |
||||
onSearchEmpty: function (elem) { |
||||
$("#closeSearch").css("display", "none"); /* Added 1-16-18 */ |
||||
$("#defaultSearch").css("display", "inline-block"); /* Added 1-16-18 */ |
||||
} |
||||
}); |
||||
|
||||
// Button Clear the search value
|
||||
$(".closeSearch").off("click"); /* Added 1-16-18 */ |
||||
$(".closeSearch").on("click", function () { |
||||
/* Clear The Search Field */ |
||||
$("#tenantSearch").val(""); |
||||
$("#tenantSearch").keyup(); |
||||
$("#tenantSearch").focus(); |
||||
}); |
||||
|
||||
$('.closeTenant').off("click"); |
||||
$('.closeTenant').on("click", function() { |
||||
/* Init Balence counters: to nothing then force it to Zeros */ |
||||
// $('#right-secondary-content').html('');
|
||||
// var ajax_right_secondary_content = ajax_loader({id: this.id}, "app/tenants/tenants-right-secondary-content-transactions.php", "right-secondary-content");
|
||||
});
|
||||
|
||||
/* Row click function for Tenant Profile */ |
||||
$(".list-row").off("click"); |
||||
$(".list-row").on("click", function (e) { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid"); |
||||
if (! $(e.target).parents().hasClass('exclude') ) { |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + lease_id); |
||||
} |
||||
}); |
||||
|
||||
$(".view-trans").off("click"); |
||||
$(".view-trans").on("click", function() { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid"); |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + lease_id); |
||||
}); |
||||
|
||||
$(".view-maintenance").off("click"); |
||||
$(".view-maintenance").on("click", function() { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid");
|
||||
router.navigate('Maintenance/' + id + '/New/' + lease_id); |
||||
}); |
||||
|
||||
/* 7-7 New Feature to show alert on Inactive tenants |
||||
*
|
||||
*/ |
||||
$(".inactive-row").off("click"); |
||||
$(".inactive-row").on("click", function(e) { |
||||
var id = $(this).data("id"); |
||||
var lease_id = $(this).data("leaseid"); |
||||
if (! $(e.target).parents().hasClass('exclude') ) { |
||||
$.confirm({ |
||||
container: "#main-container-left-body", |
||||
useBootstrap: false, |
||||
boxWidth: "80%", |
||||
position: 'sticky', |
||||
animation: 'bottom', |
||||
closeAnimation: 'bottom', |
||||
type: 'blue', |
||||
title: "Notice", |
||||
content: "This tenant is Inactive! Payments for this account is disabled.", |
||||
buttons: { |
||||
cancel: function() {}, |
||||
Proceed: { |
||||
text: "Continue", |
||||
btnClass: 'btn-blue', |
||||
action: function() { |
||||
filter = $('#filterStatus').dropdown('get value');
|
||||
router.navigate('Tenants/' + filter + '/' + id + '/Transactions/' + lease_id); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$("#filterStatus").dropdown({ |
||||
on: 'hover', |
||||
onChange: function (val) { |
||||
var entity_text = $('#filterEntity').dropdown('get value'); |
||||
window.update_tenants_list(val, entity_text); |
||||
cloneObject.start_up(); |
||||
} |
||||
}); |
||||
|
||||
$("#filterEntity").dropdown({ |
||||
on: 'hover', |
||||
onChange: function (val) {
|
||||
$.ajax({ |
||||
url: "app/home/set_entity.html", |
||||
type: 'GET', |
||||
data: {entity_id: val}, |
||||
async: true, |
||||
dataType: "html", |
||||
success: function (response) { |
||||
start_progress(); /* Restart percentage to 1 */ |
||||
var tenant_status_text = $('#filterStatus').dropdown('get value'); |
||||
window.update_tenants_list(tenant_status_text, val); |
||||
cloneObject.start_up(); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
/* |
||||
$('.ui.accordion').accordion({ |
||||
onChange: function () { |
||||
$('#main-container-right-body').perfectScrollbar('update'); // UPDATE .right-panel-scroll
|
||||
} |
||||
}); |
||||
*/ |
||||
$("#tenantSearch").focus(); |
||||
done_loading(); |
||||
|
||||
auto_right_menus(); |
||||
/* Fixes postion for transactions right body */ |
||||
$('#main-container-right-body').css('margin-top', '0');
|
||||
}; |
||||
@ -0,0 +1,275 @@ |
||||
// Define Globals
|
||||
var user_id, transtype, baltype, the_tenant, the_filter, trans_type, trans_bal, trans_id, the_tab, lease_id; |
||||
var counter_for_trans = 0, reloadonNewTransaction = false; |
||||
tenants.prototype.new_transaction = function () { |
||||
counter_for_trans = 0; // Reenable submit
|
||||
user_id = this.user_id; /* This defines the User for AJAX Save */ |
||||
transtype = this.transtype; |
||||
baltype = this.baltype; |
||||
the_tenant = this.id; |
||||
the_filter = this.filter; |
||||
the_tab = this.tab; |
||||
trans_id = this.transid; |
||||
lease_id = this.lease_id; |
||||
trans_type = transtype;
|
||||
trans_bal = baltype;
|
||||
|
||||
rem(); // Remind me if on Development Database...with a toast.
|
||||
$('#process-trans-type').html(trans_type);
|
||||
$('#process-trans-bal').html(trans_bal); |
||||
|
||||
$('#process-amount').html($("#amount_tendered").val()); |
||||
if (trans_type == "Payment") { |
||||
$('#checkboxReceipt').checkbox('check'); |
||||
$("#payment_method_text").text("Payment Method"); |
||||
$("#payment_method").html("<option value='none' selected>Select Option</option><option value='Cash'>Cash</option><option value='Check'>Check</option><option value='moneyOrder'>Money Order</option><option value='moneyGram'>Money Gram</option><option value='westernUnion'>Western Union</option><option value='cashiersCheck'>Cashier's Check</option><option value='directDeposit'>Direct Deposit</option>"); |
||||
} else if (trans_type == "Receivable") { |
||||
$('#checkboxReceipt').checkbox('uncheck'); |
||||
$("#payment_method_text").text("Charge Type"); |
||||
$("#payment_method").html("<option value='Charge'>Account Charge</option>"); |
||||
} |
||||
|
||||
// $('#createNewTransaction select').dropdown(drop_effect);
|
||||
|
||||
var form_submit = function () { |
||||
if (counter_for_trans === 0) {
|
||||
counter_for_trans++;
|
||||
} else { |
||||
throw "Duplicate!"; |
||||
}
|
||||
|
||||
debug_print('#newTransaction Form Passed Validation'); |
||||
// do what you like with the input
|
||||
$input = $('<input type="hidden" name="user_id"/>').val(user_id); |
||||
|
||||
// append to the form
|
||||
$('#createNewTransaction').append($input); |
||||
|
||||
$.ajax({ |
||||
// beforeSend: saving_toast,
|
||||
url: 'app/tenants/new-transaction.php', |
||||
type: 'GET', |
||||
data: $('#include-ids, #createNewTransaction').serialize(), |
||||
success: function (response, status, xhr) { |
||||
if (!check_for_error('transaction-message',response, xhr)) { |
||||
did_save('transaction-message', response, xhr, 'transaction'); |
||||
console.log('Receipt TransID#'+response.transaction_id); |
||||
/* Check to make sure Transaction was error Free */
|
||||
if (response.transaction_id > 0) { |
||||
|
||||
// $('#printReceiptBtn').attr('data-trans-id', response.transaction_id);
|
||||
// $('#printReceiptBtn').removeClass("disabled");
|
||||
// $('#printReceiptBtn').css('opacity', '1');
|
||||
$('#processNewTransaction').css('opacity', '0'); |
||||
$('#processNewTransaction').addClass('disabledHidden'); // Halfway is a css hack for btn opacity
|
||||
|
||||
if ($('#checkboxReceipt').checkbox('is checked') === true) { |
||||
if (response.transaction_id > 0) {
|
||||
print_frame('NewPrintReceipt', 'app/tenants/print-receipt.php?trans_id=' + response.transaction_id); |
||||
} |
||||
} |
||||
$('#createNewTransaction').form('reset'); |
||||
router.navigate('Tenants/' + the_filter + '/' + the_tenant + '/Transactions/'+lease_id+'/ViewTransaction/' + response.transaction_id + '/View'); |
||||
} |
||||
|
||||
|
||||
} // END if !ERROR
|
||||
} |
||||
|
||||
}); // END ajax call
|
||||
return false; |
||||
} |
||||
|
||||
// Start of Create Form
|
||||
$(document).off('blur', '#createNewTransaction'); |
||||
$('#createNewTransaction') |
||||
.form({ |
||||
inline: true, |
||||
on: 'blur', |
||||
onSuccess: function (e) { |
||||
e.stopImmediatePropagation();
|
||||
}, |
||||
fields: { |
||||
trans_type: { |
||||
identifier: 'trans_type', |
||||
rules: [ { type: 'empty', prompt: 'Please select a transaction type' } ] |
||||
}, |
||||
balance_type: { |
||||
identifier: 'balance_type', |
||||
rules: [ { type: 'empty', prompt: 'Please select a balance type' } ] |
||||
}, |
||||
amount_tendered: { |
||||
identifier: 'amount_tendered', |
||||
rules: [ { type: 'decimalMoney', prompt: 'Please enter a decimal amount (Example: 100.00)' } ] |
||||
}, |
||||
payment_method: { |
||||
identifier: 'payment_method', |
||||
rules: [ { type: 'not[none]', prompt: 'Please select a payment method' } ] |
||||
} |
||||
}// END fields
|
||||
}); // END #newTransaction form
|
||||
|
||||
|
||||
// Make sure you cant select the wrong payment method
|
||||
$("#trans_type").off('change'); |
||||
$("#trans_type").on("change", function (event) { |
||||
var val = $(this).val(); |
||||
$('#process-trans-type').html(val); // trans_type
|
||||
// Only show the options that apply to the transaction type
|
||||
if (val == "Payment") { |
||||
$('#amountTypeText').text('Payment Amount'); |
||||
//$('#checkboxReceipt').checkbox('check');
|
||||
$("#payment_method_text").text("Payment Method"); |
||||
$("#payment_method").html("<option value='none' selected>Select Option</option><option value='Cash'>Cash</option><option value='Check'>Check</option><option value='moneyOrder'>Money Order</option><option value='moneyGram'>Money Gram</option><option value='westernUnion'>Western Union</option><option value='cashiersCheck'>Cashier's Check</option><option value='directDeposit'>Direct Deposit</option>"); |
||||
checkFormNewTransaction(); |
||||
} else if (val == "Receivable") { |
||||
$('#amountTypeText').text('Receivable Amount'); |
||||
//$('#checkboxReceipt').checkbox('uncheck');
|
||||
$("#payment_method_text").text("Charge Type"); |
||||
$("#payment_method").html("<option value='Charge' selected>Account Charge</option>"); |
||||
checkFormNewTransaction(); |
||||
} else if (val == "Credit") { |
||||
$('#amountTypeText').text('Credit Amount'); |
||||
$("#payment_method_text").text("Credit Type"); |
||||
$("#payment_method").html("<option value='Credit' selected>Account Credit</option>"); |
||||
checkFormNewTransaction(); |
||||
} |
||||
}); |
||||
/* |
||||
$("#balance_type").off('change'); |
||||
$("#balance_type").on("change", function (event) { |
||||
var trans_bal = $("#balance_type").val(); |
||||
$('#process-trans-bal').html(trans_bal); |
||||
});
|
||||
*/ |
||||
$("#amount_tendered").off('change'); |
||||
$("#amount_tendered").on("change", function (event) { |
||||
var amount = $("#amount_tendered").val(); |
||||
var decimal = amount.includes('.'); |
||||
if (decimal === false && amount > 9) { |
||||
$("#amount_tendered").val(String(amount) + '.00'); |
||||
$('#process-amount').html(String(amount) + '.00'); |
||||
} else { |
||||
$('#process-amount').html(amount); |
||||
} |
||||
// Check to see if form is valid
|
||||
checkFormNewTransaction(); |
||||
}); |
||||
|
||||
$('#payment_method').off("change");
|
||||
$('#payment_method').on("change", function (event) { |
||||
if ($('#payment_method').val() == 'Cash') { |
||||
$('#refNumBlock').hide(); |
||||
} else { |
||||
$('#refNumBlock').show(); |
||||
|
||||
var method_text = ''; |
||||
switch($('#payment_method').val()) { |
||||
case 'Check': |
||||
method_text = 'Check'; |
||||
break; |
||||
case 'moneyOrder': |
||||
method_text = 'Money Order'; |
||||
break; |
||||
case 'moneyGram': |
||||
method_text = 'Money Gram'; |
||||
break; |
||||
case 'westernUnion': |
||||
method_text = 'Western Union';
|
||||
break; |
||||
case 'cashiersCheck': |
||||
method_text = 'Cashiers Check';
|
||||
break; |
||||
case 'directDeposit': |
||||
method_text = 'Direct Deposit';
|
||||
break; |
||||
} |
||||
|
||||
$('#refNumText').text(method_text + " #"); |
||||
$('#refrence_number').attr('placeholder', "Please enter the " + method_text + " #"); |
||||
} |
||||
// Check to see if form is valid
|
||||
checkFormNewTransaction(); |
||||
}); |
||||
|
||||
$('#refrence_number').off("change");
|
||||
$('#refrence_number').on("change", function (event) { |
||||
// Check to see if form is valid
|
||||
checkFormNewTransaction(); |
||||
});
|
||||
|
||||
// $(document).off("click", "#printReceiptBtn");
|
||||
// $(document).on("click", "#printReceiptBtn", function () {
|
||||
// var trans_id = $('#printReceiptBtn').attr('data-trans-id');
|
||||
// if (trans_id == '0') {
|
||||
// /**
|
||||
// * @ todo: Build a retry event here
|
||||
// */
|
||||
// console.log('Sorry, reciept generation error.')
|
||||
// } else {
|
||||
// console.log("Printing via Trans ID: " + trans_id);
|
||||
// print_frame('NewReceipt', 'app/tenants/print-receipt.php?trans_id=' + trans_id);
|
||||
// }
|
||||
// });
|
||||
|
||||
$(document).off("click", "#closeTransaction"); |
||||
$(document).on("click", "#closeTransaction", function () {
|
||||
router.navigate('Tenants/' + the_filter + '/' + the_tenant + '/Transactions/'+lease_id); |
||||
}); |
||||
|
||||
$(document).off("click", "#processNewTransaction"); |
||||
$(document).on("click", "#processNewTransaction", function (event) { |
||||
reloadonNewTransaction = true; |
||||
form_submit(); |
||||
}); |
||||
|
||||
}; |
||||
|
||||
var b_notes = false; |
||||
function checkFormNewTransaction() { |
||||
var method = $("#payment_method").val(); |
||||
var notes = $("#refrence_number").val(); |
||||
if (method == '' || method == 'Cash' || method == 'Charge' || method == 'Credit') { |
||||
var valid = true; |
||||
} else if (notes == '') { |
||||
var valid = false; |
||||
} else { |
||||
var valid = true; |
||||
} |
||||
|
||||
if (valid === false) { |
||||
$('#createNewTransaction').form('add rule', 'refrence_number', { identifier: 'refrence_number', rules: [ { type: 'empty', prompt: 'Please enter reference#' } ] } ); |
||||
$('#createNewTransaction').form('validate field', 'refrence_number'); |
||||
b_notes = true; |
||||
} else { |
||||
if (b_notes === true) { |
||||
$('#createNewTransaction').form('remove rule', 'refrence_number', ); |
||||
$('#createNewTransaction').form('validate field', 'refrence_number'); |
||||
b_notes = false; |
||||
} |
||||
} |
||||
if ( valid === true && $('#createNewTransaction').form('is valid') ) { |
||||
console.log('Attempting to enable Process Transaction!'); |
||||
// Validation Passed for New Transaction (Enabled the button)
|
||||
if ( $('#processNewTransaction').hasClass("disabled") ) { |
||||
$('#processNewTransaction').removeClass('disabled'); |
||||
} |
||||
if ( $('#processNewTransaction').hasClass("grey") ) { |
||||
$('#processNewTransaction').removeClass('grey'); |
||||
} |
||||
if ( ! $('#processNewTransaction').hasClass("green") ) { |
||||
$('#processNewTransaction').addClass('green'); |
||||
$('#processNewTransaction').css('opacity', '1');
|
||||
} |
||||
} else { |
||||
// Validation Failed
|
||||
if ( $('#processNewTransaction').hasClass("green") ) { |
||||
$('#processNewTransaction').removeClass('green'); |
||||
} |
||||
if ( ! $('#processNewTransaction').hasClass("grey") ) { |
||||
$('#processNewTransaction').addClass('grey'); |
||||
$('#processNewTransaction').addClass('disabled'); |
||||
$('#processNewTransaction').css('opacity', '0'); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,53 @@ |
||||
tenants.prototype.notes = function () { |
||||
var tenant_id = this.id; /* This tenant ID is used for AJAX save */ |
||||
var user_id = this.user_id; /* This User is used for AJAX save */ |
||||
|
||||
//alert("In the Notes Tab");
|
||||
// Validation for #addNote
|
||||
$('#addNote') |
||||
.form({ |
||||
inline: false, |
||||
on: 'submit', |
||||
keyboardShortcuts: false, |
||||
onSuccess: function (e) { |
||||
e.preventDefault(); |
||||
|
||||
debug_print('#addNote form has passed validation'); |
||||
var note = $("#note").val(); |
||||
var lease_id = $("#lease_id").val(); |
||||
|
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/add-note.php', |
||||
type: 'GET', |
||||
async: true, |
||||
data: {tenant_id: tenant_id, lease_id: lease_id, user_id: user_id, note: note}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
has_saved(response, xhr, 'note'); |
||||
start_progress(); /* Restart percentage to 1 */ |
||||
var rside = cloneObject.load_right('start_up'); |
||||
$.when( rside ).done(function () { |
||||
cloneObject.notes(); /* Reloaded, so add another note */ |
||||
}); |
||||
done_loading(); |
||||
} // END if !ERROR
|
||||
} |
||||
}); // <-- END: .ajax()
|
||||
}, |
||||
fields: { |
||||
note: { |
||||
identifier: 'note', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Error: Please enter your notes first then click the "Add Note" button.' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} // <-- END: fields
|
||||
|
||||
}); // <-- END: #addNote
|
||||
|
||||
}; |
||||
@ -0,0 +1,124 @@ |
||||
tenants.prototype.profile = function () { |
||||
var lease_id = this.lease_id; |
||||
// NOTE: Always unbind the last events that bubbled up the DOM tree.
|
||||
$(document).off('change enter', '.updateTenant'); |
||||
// Now bind the newly created event listeners.
|
||||
$(document).on("change enter", ".updateTenant", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var fieldname = $(this).attr('data-changed'); |
||||
var newvalue = $(this).val(); |
||||
cloneObject.make_profile_changes(fieldname, newvalue); |
||||
}); // <-- END: onChane event (.updateTenant)
|
||||
|
||||
$(document).off('change enter', '.updateTenantSelect'); |
||||
$(document).on("change enter", ".updateTenantSelect", function () { |
||||
// Get data attributes from the input that was changed.
|
||||
var fieldname = $(this).find(':selected').attr('data-changed'); |
||||
var newvalue = $(this).find(':selected').val(); |
||||
cloneObject.make_profile_changes(fieldname, newvalue); |
||||
}); // <-- END: onChane event (.updateTenantSelected)
|
||||
|
||||
// Validation for #editTenant
|
||||
$('#editTenant') |
||||
.form({ |
||||
inline: true, |
||||
on: 'submit', |
||||
keyboardShortcuts: false, |
||||
onSuccess: function () { |
||||
debug_print('#editTenant form has passed validation'); |
||||
}, |
||||
fields: { |
||||
status: { |
||||
identifier: 'status', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Select Tenant Status' |
||||
} |
||||
] |
||||
}, |
||||
first_name: { |
||||
identifier: 'first_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants first name' |
||||
} |
||||
] |
||||
}, |
||||
last_name: { |
||||
identifier: 'last_name', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the tenants last name' |
||||
} |
||||
] |
||||
}, |
||||
mainPhone: { |
||||
identifier: 'mainPhone', |
||||
rules: [ |
||||
{ |
||||
type: 'empty', |
||||
prompt: 'Please enter the primary phone number' |
||||
} |
||||
] |
||||
} |
||||
|
||||
} // <-- END: fields
|
||||
}); // <-- END: .form
|
||||
|
||||
}; |
||||
|
||||
tenants.prototype.make_profile_changes = function (fieldname, newvalue) { |
||||
var filter = this.filter; /* This filter is used by HASH router navigate */ |
||||
var tenant_id = this.id; /* This tenant ID is used for AJAX save */ |
||||
var user_id = this.user_id; /* This defines the User for AJAX call */ |
||||
// validate the form before we proccess it.
|
||||
var validate = $('#editTenant').form('validate form'); |
||||
// Get the result of the validation.
|
||||
var validateResult = $('#editTenant').form('is valid'); |
||||
// If the form passes validation the begin processing.
|
||||
if (validateResult === true) { |
||||
// Get data attributes from the input that was changed.
|
||||
debug_print("Data Passed to AJAX: tenant_id=" + tenant_id + "&fieldname=" + fieldname + "&newvalue=" + newvalue); |
||||
$.ajax({ |
||||
beforeSend: saving_toast, |
||||
url: 'app/tenants/edit-tenant.php', |
||||
type: 'GET', |
||||
async: true, |
||||
data: {id: tenant_id, field: fieldname, val: newvalue, user_id: user_id}, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
has_saved(response, xhr, fieldname); |
||||
|
||||
if (fieldname === "first_name" || fieldname === "last_name") { |
||||
window.setTimeout(function () { |
||||
document.location.reload(); |
||||
}, 3000); |
||||
return false; |
||||
} |
||||
|
||||
if (fieldname === "status") { |
||||
router.navigate('Tenants/' + newvalue + '/' + tenant_id + '/Profile/' + lease_id); |
||||
return false; |
||||
} |
||||
|
||||
cloneObject.load_left('start_up'); |
||||
|
||||
// Re load the right side without the animation for sticky message timstamp update
|
||||
if (fieldname === "status_msg") { |
||||
var rside = cloneObject.load_right('start_up'); |
||||
$.when(rside).done(function () { |
||||
cloneObject.profile(); /* RE-bind self */ |
||||
}); |
||||
} |
||||
|
||||
done_loading(); |
||||
} // END if !ERROR
|
||||
}// <-- END: on success
|
||||
|
||||
}); // <-- END: .ajax()
|
||||
|
||||
} // <-- END: validate Results
|
||||
}; // End make_profile_changes() function
|
||||
@ -0,0 +1,102 @@ |
||||
var trans_type_filter='All', balance_type_filter='All', date_filter='All'; |
||||
tenants.prototype.transactions = function () { |
||||
var user_id = this.user_id; /* This defines the User for AJAX Save */ |
||||
var the_tenant = this.id; |
||||
var the_filter = this.filter; |
||||
var the_tab = this.tab; |
||||
var lease_id = this.lease_id; |
||||
|
||||
$('#allTransactions').tablesort(); |
||||
/* |
||||
* 12-11-2018 Old code to Dim or hide on data table |
||||
$("#right-secondary-menu").off("hover");
|
||||
$('#right-secondary-menu').hover(function() { |
||||
//$('#allTransactions').hide();
|
||||
// $('#allTransactions').css('opacity', '0.3');
|
||||
// $('#allTransactions').dimmer({opacity: 0.3}).dimmer('show');
|
||||
}); |
||||
|
||||
$("#right-secondary-menu").off("mouseleave");
|
||||
$('#right-secondary-menu').mouseleave(function() { |
||||
$('#allTransactions').show(); |
||||
// $('#allTransactions').css('opacity', '1');
|
||||
// $('#allTransactions').dimmer('hide');
|
||||
}); |
||||
*/ |
||||
$(document).off("click", ".createTransaction"); |
||||
$(document).on("click", ".createTransaction", function () { |
||||
var transType = $(this).attr('data-transType'); |
||||
var transBal = $(this).attr('data-transBal'); |
||||
router.navigate('Tenants/' + the_filter + '/' + the_tenant + '/Transactions/'+lease_id+'/NewTransaction/'+transType+'/'+transBal+'/New'); |
||||
}); |
||||
|
||||
$(document).off("click", ".trasactionItem"); |
||||
$(document).on("click", ".trasactionItem", function () { |
||||
var transID = $(this).data("id"); |
||||
var transType = $(this).data('transType'); |
||||
var transBal = $(this).data('transBal'); |
||||
router.navigate('Tenants/' + the_filter + '/' + the_tenant + '/Transactions/'+lease_id+'/ViewTransaction/'+transID+'/View'); |
||||
}); |
||||
|
||||
$(".filter-TransType").off("click"); |
||||
$(".filter-TransType").on("click", function () { |
||||
$(".iTransType").each(function() { |
||||
$(this).removeClass('check'); |
||||
$(this).addClass('lighter'); |
||||
}); |
||||
|
||||
trans_type_filter = $(this).attr('data-filterTransType'); |
||||
|
||||
$("#i"+trans_type_filter).addClass('check'); |
||||
$("#i"+trans_type_filter).removeClass('lighter'); |
||||
|
||||
view_trans(lease_id); |
||||
}); |
||||
|
||||
$(".filter-TransBal").off("click"); |
||||
$(".filter-TransBal").on("click", function () { |
||||
$(".iTransBal").each(function() { |
||||
$(this).removeClass('check'); |
||||
$(this).addClass('lighter'); |
||||
}); |
||||
|
||||
balance_type_filter = $(this).attr('data-filterBalType'); |
||||
|
||||
$("#ib"+balance_type_filter).addClass('check'); |
||||
$("#ib"+balance_type_filter).removeClass('lighter'); |
||||
|
||||
view_trans(lease_id); |
||||
}); |
||||
|
||||
$(".filter-transDates").off("click"); |
||||
$(".filter-transDates").on("click", function () { |
||||
$(".itransDates").each(function() { |
||||
$(this).removeClass('check'); |
||||
$(this).addClass('lighter'); |
||||
}); |
||||
|
||||
date_filter = $(this).attr('data-transDate'); |
||||
|
||||
$("#ic"+date_filter).addClass('check'); |
||||
$("#ic"+date_filter).removeClass('lighter'); |
||||
|
||||
view_trans(lease_id); |
||||
}); |
||||
}; |
||||
|
||||
function view_trans(lease_id) { |
||||
var view_params = { lease_id: lease_id, trans_type_filter: trans_type_filter, balance_type_filter: balance_type_filter, date_filter: date_filter }; |
||||
$.get("app/tenants/view-transactions.php", view_params, function (data) { |
||||
$("#transactionHistory").html(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
/* Note this function is called printLedger as it is needed by an on CLick Event */ |
||||
function print_ledger() { |
||||
var lease_id = $('#lease_id').val(); /* from hidden input on tab-tran..... */ |
||||
var frame_id = 'printTransReport'; |
||||
var src = 'app/tenants/print-transactions.php?lease_id=' + lease_id + '&trans_type_filter=' + trans_type_filter + '&balance_type_filter=' + balance_type_filter + '&date_filter=' + date_filter; |
||||
debug_print(src); |
||||
print_frame(frame_id, src); |
||||
} |
||||
@ -0,0 +1,67 @@ |
||||
tenants.prototype.view_transaction = function () { |
||||
var user_id = this.user_id; //this.user_id; /* This defines the User for AJAX Save */
|
||||
var transtype = this.transtype; |
||||
var baltype = this.baltype; |
||||
var the_tenant = this.id; |
||||
var the_filter = this.filter; |
||||
var the_tab = this.tab; |
||||
var trans_id = this.transid; |
||||
var trans_type = transtype; |
||||
var trans_bal = baltype; |
||||
var lease_id = this.lease_id; |
||||
|
||||
$('#printReceiptBtn').prop("disabled", true); |
||||
|
||||
$('.edt').addClass('disabled'); |
||||
$('#editTransaction textarea').prop('disabled', true); |
||||
$('.dropdown').dropdown(drop_effect); /* Re-encode for new class...disabled */ |
||||
|
||||
$('#transactionNumber').text(trans_id); |
||||
|
||||
$('#hrefTenant').attr('href', "#Tenants/" + the_filter + "/" + the_tenant + "/Profile/" + lease_id); |
||||
$('#hrefLease').attr('href', '#Tenants/'+ the_filter + '/' + the_tenant + '/Lease/' + lease_id); |
||||
$('#hrefTransactions').attr('href', '#Tenants/'+ the_filter + '/' + the_tenant + '/Transactions/' + lease_id); |
||||
|
||||
$("#transDetailsClose").off("click"); |
||||
$("#transDetailsClose").on("click", function () { |
||||
router.navigate('Tenants/' + the_filter + '/' + the_tenant + '/Transactions/' + lease_id); |
||||
}); |
||||
|
||||
$(".editvTransaction").off('click'); |
||||
$(".editvTransaction").on("click", function () { |
||||
var val = $(this).attr("data-editType"); |
||||
if (val == 'void') { |
||||
alert(val); |
||||
} else if (val == 'transfer') { |
||||
$('.edt').removeClass('disabled'); |
||||
$('#editTransaction textarea').prop('disabled', false); |
||||
$('#editbtn').text('Save'); |
||||
$('.dropdown').dropdown(drop_effect); /* Re-encode for removed class of disabled */ |
||||
} |
||||
});
|
||||
|
||||
$(".printViewTransactions").off('click'); |
||||
$(".printViewTransactions").on("click", function () { |
||||
var val = $(this).attr("data-printCopy"); |
||||
var x = false; |
||||
switch(val) { |
||||
case 'both': x = 'both'; break; |
||||
case 'office': x = 'office'; break;
|
||||
case 'tenant': x = 'tenant'; break;
|
||||
} |
||||
if (x !== false) { |
||||
print_receipt_view_trans(trans_id, x); |
||||
} |
||||
}); |
||||
|
||||
}; |
||||
|
||||
function print_receipt_view_trans(transactionID, copy) { |
||||
if (transactionID == '0' || transactionID == null || transactionID === undefined) { |
||||
alert('Please close out and try again'); |
||||
} else { |
||||
var frameID = 'printTransDetails'; |
||||
var src = 'app/tenants/print-receipt.php?trans_id=' + transactionID + '©=' +copy; |
||||
print_frame(frameID, src); |
||||
} |
||||
} |
||||
@ -0,0 +1,388 @@ |
||||
.daterangepicker { |
||||
position: absolute; |
||||
color: inherit; |
||||
background-color: #fff; |
||||
border-radius: 4px; |
||||
border: 1px solid #ddd; |
||||
width: 278px; |
||||
max-width: none; |
||||
padding: 0; |
||||
margin-top: 7px; |
||||
top: 100px; |
||||
left: 20px; |
||||
z-index: 3001; |
||||
display: none; |
||||
font-family: arial; |
||||
font-size: 15px; |
||||
line-height: 1em; |
||||
} |
||||
|
||||
.daterangepicker:before, .daterangepicker:after { |
||||
position: absolute; |
||||
display: inline-block; |
||||
border-bottom-color: rgba(0, 0, 0, 0.2); |
||||
content: ''; |
||||
} |
||||
|
||||
.daterangepicker:before { |
||||
top: -7px; |
||||
border-right: 7px solid transparent; |
||||
border-left: 7px solid transparent; |
||||
border-bottom: 7px solid #ccc; |
||||
} |
||||
|
||||
.daterangepicker:after { |
||||
top: -6px; |
||||
border-right: 6px solid transparent; |
||||
border-bottom: 6px solid #fff; |
||||
border-left: 6px solid transparent; |
||||
} |
||||
|
||||
.daterangepicker.opensleft:before { |
||||
right: 9px; |
||||
} |
||||
|
||||
.daterangepicker.opensleft:after { |
||||
right: 10px; |
||||
} |
||||
|
||||
.daterangepicker.openscenter:before { |
||||
left: 0; |
||||
right: 0; |
||||
width: 0; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
} |
||||
|
||||
.daterangepicker.openscenter:after { |
||||
left: 0; |
||||
right: 0; |
||||
width: 0; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
} |
||||
|
||||
.daterangepicker.opensright:before { |
||||
left: 9px; |
||||
} |
||||
|
||||
.daterangepicker.opensright:after { |
||||
left: 10px; |
||||
} |
||||
|
||||
.daterangepicker.drop-up { |
||||
margin-top: -7px; |
||||
} |
||||
|
||||
.daterangepicker.drop-up:before { |
||||
top: initial; |
||||
bottom: -7px; |
||||
border-bottom: initial; |
||||
border-top: 7px solid #ccc; |
||||
} |
||||
|
||||
.daterangepicker.drop-up:after { |
||||
top: initial; |
||||
bottom: -6px; |
||||
border-bottom: initial; |
||||
border-top: 6px solid #fff; |
||||
} |
||||
|
||||
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { |
||||
float: none; |
||||
} |
||||
|
||||
.daterangepicker.single .drp-selected { |
||||
display: none; |
||||
} |
||||
|
||||
.daterangepicker.show-calendar .drp-calendar { |
||||
display: block; |
||||
} |
||||
|
||||
.daterangepicker.show-calendar .drp-buttons { |
||||
display: block; |
||||
} |
||||
|
||||
.daterangepicker.auto-apply .drp-buttons { |
||||
display: none; |
||||
} |
||||
|
||||
.daterangepicker .drp-calendar { |
||||
display: none; |
||||
max-width: 270px; |
||||
} |
||||
|
||||
.daterangepicker .drp-calendar.left { |
||||
padding: 8px 0 8px 8px; |
||||
} |
||||
|
||||
.daterangepicker .drp-calendar.right { |
||||
padding: 8px; |
||||
} |
||||
|
||||
.daterangepicker .drp-calendar.single .calendar-table { |
||||
border: none; |
||||
} |
||||
|
||||
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { |
||||
color: #fff; |
||||
border: solid black; |
||||
border-width: 0 2px 2px 0; |
||||
border-radius: 0; |
||||
display: inline-block; |
||||
padding: 3px; |
||||
} |
||||
|
||||
.daterangepicker .calendar-table .next span { |
||||
transform: rotate(-45deg); |
||||
-webkit-transform: rotate(-45deg); |
||||
} |
||||
|
||||
.daterangepicker .calendar-table .prev span { |
||||
transform: rotate(135deg); |
||||
-webkit-transform: rotate(135deg); |
||||
} |
||||
|
||||
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { |
||||
white-space: nowrap; |
||||
text-align: center; |
||||
vertical-align: middle; |
||||
min-width: 32px; |
||||
width: 32px; |
||||
height: 24px; |
||||
line-height: 24px; |
||||
font-size: 12px; |
||||
border-radius: 4px; |
||||
border: 1px solid transparent; |
||||
white-space: nowrap; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.daterangepicker .calendar-table { |
||||
border: 1px solid #fff; |
||||
border-radius: 4px; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.daterangepicker .calendar-table table { |
||||
width: 100%; |
||||
margin: 0; |
||||
border-spacing: 0; |
||||
border-collapse: collapse; |
||||
} |
||||
|
||||
.daterangepicker td.available:hover, .daterangepicker th.available:hover { |
||||
background-color: #eee; |
||||
border-color: transparent; |
||||
color: inherit; |
||||
} |
||||
|
||||
.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; |
||||
border-color: transparent; |
||||
color: #999; |
||||
} |
||||
|
||||
.daterangepicker td.in-range { |
||||
background-color: #ebf4f8; |
||||
border-color: transparent; |
||||
color: #000; |
||||
border-radius: 0; |
||||
} |
||||
|
||||
.daterangepicker td.start-date { |
||||
border-radius: 4px 0 0 4px; |
||||
} |
||||
|
||||
.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; |
||||
border-color: transparent; |
||||
color: #fff; |
||||
} |
||||
|
||||
.daterangepicker th.month { |
||||
width: auto; |
||||
} |
||||
|
||||
.daterangepicker td.disabled, .daterangepicker option.disabled { |
||||
color: #999; |
||||
cursor: not-allowed; |
||||
text-decoration: line-through; |
||||
} |
||||
|
||||
.daterangepicker select.monthselect, .daterangepicker select.yearselect { |
||||
font-size: 12px; |
||||
padding: 1px; |
||||
height: auto; |
||||
margin: 0; |
||||
cursor: default; |
||||
} |
||||
|
||||
.daterangepicker select.monthselect { |
||||
margin-right: 2%; |
||||
width: 56%; |
||||
} |
||||
|
||||
.daterangepicker select.yearselect { |
||||
width: 40%; |
||||
} |
||||
|
||||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { |
||||
width: 50px; |
||||
margin: 0 auto; |
||||
background: #eee; |
||||
border: 1px solid #eee; |
||||
padding: 2px; |
||||
outline: 0; |
||||
font-size: 12px; |
||||
} |
||||
|
||||
.daterangepicker .calendar-time { |
||||
text-align: center; |
||||
margin: 4px auto 0 auto; |
||||
line-height: 30px; |
||||
position: relative; |
||||
} |
||||
|
||||
.daterangepicker .calendar-time select.disabled { |
||||
color: #ccc; |
||||
cursor: not-allowed; |
||||
} |
||||
|
||||
.daterangepicker .drp-buttons { |
||||
clear: both; |
||||
text-align: right; |
||||
padding: 8px; |
||||
border-top: 1px solid #ddd; |
||||
display: none; |
||||
line-height: 12px; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
.daterangepicker .drp-selected { |
||||
display: inline-block; |
||||
font-size: 12px; |
||||
padding-right: 8px; |
||||
} |
||||
|
||||
.daterangepicker .drp-buttons .btn { |
||||
margin-left: 8px; |
||||
font-size: 12px; |
||||
font-weight: bold; |
||||
padding: 4px 8px; |
||||
} |
||||
|
||||
.daterangepicker.show-ranges .drp-calendar.left { |
||||
border-left: 1px solid #ddd; |
||||
} |
||||
|
||||
.daterangepicker .ranges { |
||||
float: none; |
||||
text-align: left; |
||||
margin: 0; |
||||
} |
||||
|
||||
.daterangepicker.show-calendar .ranges { |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
.daterangepicker .ranges ul { |
||||
list-style: none; |
||||
margin: 0 auto; |
||||
padding: 0; |
||||
width: 100%; |
||||
} |
||||
|
||||
.daterangepicker .ranges li { |
||||
font-size: 12px; |
||||
padding: 8px 12px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.daterangepicker .ranges li:hover { |
||||
background-color: #eee; |
||||
} |
||||
|
||||
.daterangepicker .ranges li.active { |
||||
background-color: #08c; |
||||
color: #fff; |
||||
} |
||||
|
||||
/* Larger Screen Styling */ |
||||
@media (min-width: 564px) { |
||||
.daterangepicker { |
||||
width: auto; } |
||||
.daterangepicker .ranges ul { |
||||
width: 140px; } |
||||
.daterangepicker.single .ranges ul { |
||||
width: 100%; } |
||||
.daterangepicker.single .drp-calendar.left { |
||||
clear: none; } |
||||
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .drp-calendar { |
||||
float: left; } |
||||
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .drp-calendar { |
||||
float: right; } |
||||
.daterangepicker.ltr { |
||||
direction: ltr; |
||||
text-align: left; } |
||||
.daterangepicker.ltr .drp-calendar.left { |
||||
clear: left; |
||||
margin-right: 0; } |
||||
.daterangepicker.ltr .drp-calendar.left .calendar-table { |
||||
border-right: none; |
||||
border-top-right-radius: 0; |
||||
border-bottom-right-radius: 0; } |
||||
.daterangepicker.ltr .drp-calendar.right { |
||||
margin-left: 0; } |
||||
.daterangepicker.ltr .drp-calendar.right .calendar-table { |
||||
border-left: none; |
||||
border-top-left-radius: 0; |
||||
border-bottom-left-radius: 0; } |
||||
.daterangepicker.ltr .drp-calendar.left .calendar-table { |
||||
padding-right: 8px; } |
||||
.daterangepicker.ltr .ranges, .daterangepicker.ltr .drp-calendar { |
||||
float: left; } |
||||
.daterangepicker.rtl { |
||||
direction: rtl; |
||||
text-align: right; } |
||||
.daterangepicker.rtl .drp-calendar.left { |
||||
clear: right; |
||||
margin-left: 0; } |
||||
.daterangepicker.rtl .drp-calendar.left .calendar-table { |
||||
border-left: none; |
||||
border-top-left-radius: 0; |
||||
border-bottom-left-radius: 0; } |
||||
.daterangepicker.rtl .drp-calendar.right { |
||||
margin-right: 0; } |
||||
.daterangepicker.rtl .drp-calendar.right .calendar-table { |
||||
border-right: none; |
||||
border-top-right-radius: 0; |
||||
border-bottom-right-radius: 0; } |
||||
.daterangepicker.rtl .drp-calendar.left .calendar-table { |
||||
padding-left: 12px; } |
||||
.daterangepicker.rtl .ranges, .daterangepicker.rtl .drp-calendar { |
||||
text-align: right; |
||||
float: right; } } |
||||
@media (min-width: 730px) { |
||||
.daterangepicker .ranges { |
||||
width: auto; } |
||||
.daterangepicker.ltr .ranges { |
||||
float: left; } |
||||
.daterangepicker.rtl .ranges { |
||||
float: right; } |
||||
.daterangepicker .drp-calendar.left { |
||||
clear: none !important; } } |
||||
@ -0,0 +1,976 @@ |
||||
/*! |
||||
* jquery-confirm v3.3.0 (http://craftpip.github.io/jquery-confirm/) |
||||
* Author: boniface pereira |
||||
* Website: www.craftpip.com |
||||
* Contact: hey@craftpip.com |
||||
* |
||||
* Copyright 2013-2017 jquery-confirm |
||||
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE) |
||||
*/ |
||||
@-webkit-keyframes jconfirm-spin { |
||||
from { |
||||
-webkit-transform: rotate(0deg); |
||||
transform: rotate(0deg); |
||||
} |
||||
to { |
||||
-webkit-transform: rotate(360deg); |
||||
transform: rotate(360deg); |
||||
} |
||||
} |
||||
@keyframes jconfirm-spin { |
||||
from { |
||||
-webkit-transform: rotate(0deg); |
||||
transform: rotate(0deg); |
||||
} |
||||
to { |
||||
-webkit-transform: rotate(360deg); |
||||
transform: rotate(360deg); |
||||
} |
||||
} |
||||
body[class*=jconfirm-no-scroll-] { |
||||
overflow: hidden !important; |
||||
} |
||||
.jconfirm { |
||||
/* position: sticky;*/ |
||||
top: 0; |
||||
left: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
z-index: 99999999; |
||||
font-family: inherit; |
||||
overflow: hidden; |
||||
} |
||||
.jconfirm .jconfirm-bg { |
||||
position: static; |
||||
top: 0; |
||||
left: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
-webkit-transition: opacity .4s; |
||||
transition: opacity .4s; |
||||
} |
||||
.jconfirm .jconfirm-bg.jconfirm-bg-h { |
||||
opacity: 0 !important; |
||||
} |
||||
.jconfirm .jconfirm-scrollpane { |
||||
-webkit-perspective: 200px; |
||||
perspective: 200px; |
||||
-webkit-perspective-origin: center; |
||||
perspective-origin: center; |
||||
display: table; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.jconfirm .jconfirm-row { |
||||
display: table-row; |
||||
width: 100%; |
||||
} |
||||
.jconfirm .jconfirm-cell { |
||||
display: table-cell; |
||||
vertical-align: middle; |
||||
} |
||||
.jconfirm .jconfirm-holder { |
||||
max-height: 100%; |
||||
padding: 10px 0; |
||||
} |
||||
.jconfirm .jconfirm-box-container { |
||||
-webkit-transition: -webkit-transform; |
||||
transition: -webkit-transform; |
||||
transition: transform; |
||||
transition: transform, -webkit-transform; |
||||
} |
||||
.jconfirm .jconfirm-box-container.jconfirm-no-transition { |
||||
-webkit-transition: none !important; |
||||
transition: none !important; |
||||
} |
||||
.jconfirm .jconfirm-box { |
||||
background: white; |
||||
border-radius: 4px; |
||||
position: relative; |
||||
outline: none; |
||||
padding: 15px 15px 0; |
||||
overflow: hidden; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
} |
||||
@-webkit-keyframes type-blue { |
||||
1%, |
||||
100% { |
||||
border-color: #3498db; |
||||
} |
||||
50% { |
||||
border-color: #5faee3; |
||||
} |
||||
} |
||||
@keyframes type-blue { |
||||
1%, |
||||
100% { |
||||
border-color: #3498db; |
||||
} |
||||
50% { |
||||
border-color: #5faee3; |
||||
} |
||||
} |
||||
@-webkit-keyframes type-green { |
||||
1%, |
||||
100% { |
||||
border-color: #2ecc71; |
||||
} |
||||
50% { |
||||
border-color: #54d98c; |
||||
} |
||||
} |
||||
@keyframes type-green { |
||||
1%, |
||||
100% { |
||||
border-color: #2ecc71; |
||||
} |
||||
50% { |
||||
border-color: #54d98c; |
||||
} |
||||
} |
||||
@-webkit-keyframes type-red { |
||||
1%, |
||||
100% { |
||||
border-color: #e74c3c; |
||||
} |
||||
50% { |
||||
border-color: #ed7669; |
||||
} |
||||
} |
||||
@keyframes type-red { |
||||
1%, |
||||
100% { |
||||
border-color: #e74c3c; |
||||
} |
||||
50% { |
||||
border-color: #ed7669; |
||||
} |
||||
} |
||||
@-webkit-keyframes type-orange { |
||||
1%, |
||||
100% { |
||||
border-color: #f1c40f; |
||||
} |
||||
50% { |
||||
border-color: #f4d03f; |
||||
} |
||||
} |
||||
@keyframes type-orange { |
||||
1%, |
||||
100% { |
||||
border-color: #f1c40f; |
||||
} |
||||
50% { |
||||
border-color: #f4d03f; |
||||
} |
||||
} |
||||
@-webkit-keyframes type-purple { |
||||
1%, |
||||
100% { |
||||
border-color: #9b59b6; |
||||
} |
||||
50% { |
||||
border-color: #b07cc6; |
||||
} |
||||
} |
||||
@keyframes type-purple { |
||||
1%, |
||||
100% { |
||||
border-color: #9b59b6; |
||||
} |
||||
50% { |
||||
border-color: #b07cc6; |
||||
} |
||||
} |
||||
@-webkit-keyframes type-dark { |
||||
1%, |
||||
100% { |
||||
border-color: #34495e; |
||||
} |
||||
50% { |
||||
border-color: #46627f; |
||||
} |
||||
} |
||||
@keyframes type-dark { |
||||
1%, |
||||
100% { |
||||
border-color: #34495e; |
||||
} |
||||
50% { |
||||
border-color: #46627f; |
||||
} |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-animated { |
||||
-webkit-animation-duration: 2s; |
||||
animation-duration: 2s; |
||||
-webkit-animation-iteration-count: infinite; |
||||
animation-iteration-count: infinite; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-blue { |
||||
border-top: solid 7px #3498db; |
||||
-webkit-animation-name: type-blue; |
||||
animation-name: type-blue; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-green { |
||||
border-top: solid 7px #2ecc71; |
||||
-webkit-animation-name: type-green; |
||||
animation-name: type-green; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-red { |
||||
border-top: solid 7px #e74c3c; |
||||
-webkit-animation-name: type-red; |
||||
animation-name: type-red; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-orange { |
||||
border-top: solid 7px #f1c40f; |
||||
-webkit-animation-name: type-orange; |
||||
animation-name: type-orange; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-purple { |
||||
border-top: solid 7px #9b59b6; |
||||
-webkit-animation-name: type-purple; |
||||
animation-name: type-purple; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-dark { |
||||
border-top: solid 7px #34495e; |
||||
-webkit-animation-name: type-dark; |
||||
animation-name: type-dark; |
||||
} |
||||
.jconfirm .jconfirm-box.loading { |
||||
height: 120px; |
||||
} |
||||
.jconfirm .jconfirm-box.loading:before { |
||||
content: ''; |
||||
position: absolute; |
||||
left: 0; |
||||
background: white; |
||||
right: 0; |
||||
top: 0; |
||||
bottom: 0; |
||||
border-radius: 10px; |
||||
z-index: 1; |
||||
} |
||||
.jconfirm .jconfirm-box.loading:after { |
||||
opacity: 0.6; |
||||
content: ''; |
||||
height: 30px; |
||||
width: 30px; |
||||
border: solid 3px transparent; |
||||
position: absolute; |
||||
left: 50%; |
||||
margin-left: -15px; |
||||
border-radius: 50%; |
||||
-webkit-animation: jconfirm-spin 1s infinite linear; |
||||
animation: jconfirm-spin 1s infinite linear; |
||||
border-bottom-color: dodgerblue; |
||||
top: 50%; |
||||
margin-top: -15px; |
||||
z-index: 2; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon { |
||||
height: 20px; |
||||
width: 20px; |
||||
position: absolute; |
||||
top: 10px; |
||||
right: 10px; |
||||
cursor: pointer; |
||||
opacity: .6; |
||||
text-align: center; |
||||
font-size: 27px !important; |
||||
line-height: 14px !important; |
||||
display: none; |
||||
z-index: 1; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon:empty { |
||||
display: none; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon .fa { |
||||
font-size: 16px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon .glyphicon { |
||||
font-size: 16px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon .zmdi { |
||||
font-size: 16px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-closeIcon:hover { |
||||
opacity: 1; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c { |
||||
display: block; |
||||
font-size: 22px; |
||||
line-height: 20px; |
||||
-webkit-user-select: none; |
||||
-moz-user-select: none; |
||||
-ms-user-select: none; |
||||
user-select: none; |
||||
cursor: default; |
||||
padding-bottom: 15px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c.jconfirm-hand { |
||||
cursor: move; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c { |
||||
font-size: inherit; |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i { |
||||
vertical-align: middle; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c:empty { |
||||
display: none; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title { |
||||
-webkit-user-select: none; |
||||
-moz-user-select: none; |
||||
-ms-user-select: none; |
||||
user-select: none; |
||||
font-size: inherit; |
||||
font-family: inherit; |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title:empty { |
||||
display: none; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane { |
||||
margin-bottom: 15px; |
||||
height: auto; |
||||
-webkit-transition: height 0.4s ease-in; |
||||
transition: height 0.4s ease-in; |
||||
display: inline-block; |
||||
width: 100%; |
||||
position: relative; |
||||
overflow-x: hidden; |
||||
overflow-y: auto; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane.no-scroll { |
||||
overflow-y: hidden; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar { |
||||
width: 3px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-track { |
||||
background: rgba(0, 0, 0, 0.1); |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-thumb { |
||||
background: #666; |
||||
border-radius: 3px; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content { |
||||
overflow: auto; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img { |
||||
max-width: 100%; |
||||
height: auto; |
||||
} |
||||
.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content:empty { |
||||
display: none; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons { |
||||
padding-bottom: 11px; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons > button { |
||||
margin-bottom: 4px; |
||||
margin-left: 2px; |
||||
margin-right: 2px; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button { |
||||
display: inline-block; |
||||
padding: 6px 12px; |
||||
font-size: 14px; |
||||
font-weight: 400; |
||||
line-height: 1.42857143; |
||||
text-align: center; |
||||
white-space: nowrap; |
||||
vertical-align: middle; |
||||
-ms-touch-action: manipulation; |
||||
touch-action: manipulation; |
||||
cursor: pointer; |
||||
-webkit-user-select: none; |
||||
-moz-user-select: none; |
||||
-ms-user-select: none; |
||||
user-select: none; |
||||
border-radius: 4px; |
||||
min-height: 1em; |
||||
-webkit-transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease; |
||||
transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease; |
||||
transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease; |
||||
transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease; |
||||
-webkit-tap-highlight-color: transparent; |
||||
border: none; |
||||
background-image: none; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue { |
||||
background-color: #3498db; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue:hover { |
||||
background-color: #2980b9; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green { |
||||
background-color: #2ecc71; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green:hover { |
||||
background-color: #27ae60; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red { |
||||
background-color: #e74c3c; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red:hover { |
||||
background-color: #c0392b; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange { |
||||
background-color: #f1c40f; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange:hover { |
||||
background-color: #f39c12; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default { |
||||
background-color: #ecf0f1; |
||||
color: #000; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default:hover { |
||||
background-color: #bdc3c7; |
||||
color: #000; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple { |
||||
background-color: #9b59b6; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple:hover { |
||||
background-color: #8e44ad; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark { |
||||
background-color: #34495e; |
||||
color: #FFF; |
||||
text-shadow: none; |
||||
-webkit-transition: background .2s; |
||||
transition: background .2s; |
||||
} |
||||
.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark:hover { |
||||
background-color: #2c3e50; |
||||
color: #FFF; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-red .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #e74c3c !important; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-blue .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #3498db !important; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-green .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #2ecc71 !important; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-purple .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #9b59b6 !important; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-orange .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #f1c40f !important; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-type-dark .jconfirm-title-c .jconfirm-icon-c { |
||||
color: #34495e !important; |
||||
} |
||||
.jconfirm .jconfirm-clear { |
||||
clear: both; |
||||
} |
||||
.jconfirm.jconfirm-rtl { |
||||
direction: rtl; |
||||
} |
||||
.jconfirm.jconfirm-rtl div.jconfirm-closeIcon { |
||||
left: 5px; |
||||
right: auto; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-bg, |
||||
.jconfirm.jconfirm-light .jconfirm-bg { |
||||
/* background-color: #444;*/ |
||||
background-color: transparent; |
||||
opacity: 1; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box, |
||||
.jconfirm.jconfirm-light .jconfirm-box { |
||||
-webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); |
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); |
||||
border-radius: 5px; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box .jconfirm-title-c .jconfirm-icon-c, |
||||
.jconfirm.jconfirm-light .jconfirm-box .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-right: 8px; |
||||
margin-left: 0px; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons, |
||||
.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons { |
||||
float: right; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button, |
||||
.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button { |
||||
text-transform: uppercase; |
||||
font-size: 14px; |
||||
font-weight: bold; |
||||
text-shadow: none; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default, |
||||
.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default { |
||||
-webkit-box-shadow: none; |
||||
box-shadow: none; |
||||
color: #333; |
||||
} |
||||
.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default:hover, |
||||
.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default:hover { |
||||
background: #ddd; |
||||
} |
||||
.jconfirm.jconfirm-white.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c, |
||||
.jconfirm.jconfirm-light.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-left: 8px; |
||||
margin-right: 0px; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-bg, |
||||
.jconfirm.jconfirm-dark .jconfirm-bg { |
||||
background-color: darkslategray; |
||||
opacity: .4; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box, |
||||
.jconfirm.jconfirm-dark .jconfirm-box { |
||||
-webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); |
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); |
||||
background: #444; |
||||
border-radius: 5px; |
||||
color: white; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box .jconfirm-title-c .jconfirm-icon-c, |
||||
.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-right: 8px; |
||||
margin-left: 0px; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons, |
||||
.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons { |
||||
float: right; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button, |
||||
.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button { |
||||
border: none; |
||||
background-image: none; |
||||
text-transform: uppercase; |
||||
font-size: 14px; |
||||
font-weight: bold; |
||||
text-shadow: none; |
||||
-webkit-transition: background .1s; |
||||
transition: background .1s; |
||||
color: white; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default, |
||||
.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default { |
||||
-webkit-box-shadow: none; |
||||
box-shadow: none; |
||||
color: #fff; |
||||
background: none; |
||||
} |
||||
.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default:hover, |
||||
.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default:hover { |
||||
background: #666; |
||||
} |
||||
.jconfirm.jconfirm-black.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c, |
||||
.jconfirm.jconfirm-dark.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-left: 8px; |
||||
margin-right: 0px; |
||||
} |
||||
.jconfirm .jconfirm-box.hilight.jconfirm-hilight-shake { |
||||
-webkit-animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; |
||||
animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; |
||||
-webkit-transform: translate3d(0, 0, 0); |
||||
transform: translate3d(0, 0, 0); |
||||
} |
||||
.jconfirm .jconfirm-box.hilight.jconfirm-hilight-glow { |
||||
-webkit-animation: glow 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; |
||||
animation: glow 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; |
||||
-webkit-transform: translate3d(0, 0, 0); |
||||
transform: translate3d(0, 0, 0); |
||||
} |
||||
@-webkit-keyframes shake { |
||||
10%, |
||||
90% { |
||||
-webkit-transform: translate3d(-2px, 0, 0); |
||||
transform: translate3d(-2px, 0, 0); |
||||
} |
||||
20%, |
||||
80% { |
||||
-webkit-transform: translate3d(4px, 0, 0); |
||||
transform: translate3d(4px, 0, 0); |
||||
} |
||||
30%, |
||||
50%, |
||||
70% { |
||||
-webkit-transform: translate3d(-8px, 0, 0); |
||||
transform: translate3d(-8px, 0, 0); |
||||
} |
||||
40%, |
||||
60% { |
||||
-webkit-transform: translate3d(8px, 0, 0); |
||||
transform: translate3d(8px, 0, 0); |
||||
} |
||||
} |
||||
@keyframes shake { |
||||
10%, |
||||
90% { |
||||
-webkit-transform: translate3d(-2px, 0, 0); |
||||
transform: translate3d(-2px, 0, 0); |
||||
} |
||||
20%, |
||||
80% { |
||||
-webkit-transform: translate3d(4px, 0, 0); |
||||
transform: translate3d(4px, 0, 0); |
||||
} |
||||
30%, |
||||
50%, |
||||
70% { |
||||
-webkit-transform: translate3d(-8px, 0, 0); |
||||
transform: translate3d(-8px, 0, 0); |
||||
} |
||||
40%, |
||||
60% { |
||||
-webkit-transform: translate3d(8px, 0, 0); |
||||
transform: translate3d(8px, 0, 0); |
||||
} |
||||
} |
||||
@-webkit-keyframes glow { |
||||
0%, |
||||
100% { |
||||
-webkit-box-shadow: 0 0 0px red; |
||||
box-shadow: 0 0 0px red; |
||||
} |
||||
50% { |
||||
-webkit-box-shadow: 0 0 30px red; |
||||
box-shadow: 0 0 30px red; |
||||
} |
||||
} |
||||
@keyframes glow { |
||||
0%, |
||||
100% { |
||||
-webkit-box-shadow: 0 0 0px red; |
||||
box-shadow: 0 0 0px red; |
||||
} |
||||
50% { |
||||
-webkit-box-shadow: 0 0 30px red; |
||||
box-shadow: 0 0 30px red; |
||||
} |
||||
} |
||||
/*Transition rules*/ |
||||
.jconfirm { |
||||
-webkit-perspective: 400px; |
||||
perspective: 400px; |
||||
} |
||||
.jconfirm .jconfirm-box { |
||||
opacity: 1; |
||||
-webkit-transition-property: all; |
||||
transition-property: all; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-top, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-left, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-right, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-bottom, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-opacity, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-zoom, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scale, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-none, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotate, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotatex, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotatey, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scaley, |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scalex { |
||||
opacity: 0; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotate { |
||||
-webkit-transform: rotate(90deg); |
||||
transform: rotate(90deg); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotatex { |
||||
-webkit-transform: rotateX(90deg); |
||||
transform: rotateX(90deg); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotatexr { |
||||
-webkit-transform: rotateX(-90deg); |
||||
transform: rotateX(-90deg); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotatey { |
||||
-webkit-transform: rotatey(90deg); |
||||
transform: rotatey(90deg); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-rotateyr { |
||||
-webkit-transform: rotatey(-90deg); |
||||
transform: rotatey(-90deg); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scaley { |
||||
-webkit-transform: scaley(1.5); |
||||
transform: scaley(1.5); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scalex { |
||||
-webkit-transform: scalex(1.5); |
||||
transform: scalex(1.5); |
||||
-webkit-transform-origin: center; |
||||
transform-origin: center; |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-top { |
||||
-webkit-transform: translate(0px, -100px); |
||||
transform: translate(0px, -100px); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-left { |
||||
-webkit-transform: translate(-100px, 0px); |
||||
transform: translate(-100px, 0px); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-right { |
||||
-webkit-transform: translate(100px, 0px); |
||||
transform: translate(100px, 0px); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-bottom { |
||||
-webkit-transform: translate(0px, 100px); |
||||
transform: translate(0px, 100px); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-zoom { |
||||
-webkit-transform: scale(1.2); |
||||
transform: scale(1.2); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-scale { |
||||
-webkit-transform: scale(0.5); |
||||
transform: scale(0.5); |
||||
} |
||||
.jconfirm .jconfirm-box.jconfirm-animation-none { |
||||
visibility: hidden; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-bg { |
||||
background-color: rgba(54, 70, 93, 0.95); |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box { |
||||
background-color: transparent; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-blue { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-green { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-red { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-orange { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-purple { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-dark { |
||||
border: none; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-closeIcon { |
||||
color: white; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c { |
||||
text-align: center; |
||||
color: white; |
||||
font-size: 28px; |
||||
font-weight: normal; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c > * { |
||||
padding-bottom: 25px; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c { |
||||
margin-right: 8px; |
||||
margin-left: 0px; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content-pane { |
||||
margin-bottom: 25px; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content { |
||||
text-align: center; |
||||
color: white; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons { |
||||
text-align: center; |
||||
} |
||||
.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons button { |
||||
font-size: 16px; |
||||
border-radius: 2px; |
||||
background: #303f53; |
||||
text-shadow: none; |
||||
border: none; |
||||
color: white; |
||||
padding: 10px; |
||||
min-width: 100px; |
||||
} |
||||
.jconfirm.jconfirm-supervan.jconfirm-rtl .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c { |
||||
margin-left: 8px; |
||||
margin-right: 0px; |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-bg { |
||||
background-color: rgba(0, 0, 0, 0.67); |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box { |
||||
background-color: white; |
||||
-webkit-box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12); |
||||
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12); |
||||
padding: 30px 25px 10px 25px; |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-right: 8px; |
||||
margin-left: 0px; |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-closeIcon { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-title-c { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
font-size: 22px; |
||||
font-weight: bold; |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-content { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons { |
||||
text-align: right; |
||||
} |
||||
.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons button { |
||||
text-transform: uppercase; |
||||
font-weight: 500; |
||||
} |
||||
.jconfirm.jconfirm-material.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-left: 8px; |
||||
margin-right: 0px; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-bg { |
||||
background-color: rgba(0, 0, 0, 0.21); |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box { |
||||
background-color: white; |
||||
-webkit-box-shadow: 0 3px 8px 0px rgba(0, 0, 0, 0.2); |
||||
box-shadow: 0 3px 8px 0px rgba(0, 0, 0, 0.2); |
||||
border: solid 1px rgba(0, 0, 0, 0.4); |
||||
padding: 15px 0 0; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-right: 8px; |
||||
margin-left: 0px; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-closeIcon { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-title-c { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
font-size: 22px; |
||||
font-weight: bold; |
||||
padding-left: 15px; |
||||
padding-right: 15px; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-content { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
padding: 0px 15px; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons { |
||||
text-align: right; |
||||
padding: 10px; |
||||
margin: -5px 0 0px; |
||||
border-top: solid 1px #ddd; |
||||
overflow: hidden; |
||||
border-radius: 0 0 4px 4px; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons button { |
||||
font-weight: 500; |
||||
} |
||||
.jconfirm.jconfirm-bootstrap.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c { |
||||
margin-left: 8px; |
||||
margin-right: 0px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-bg { |
||||
background-color: slategray; |
||||
opacity: .6; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box { |
||||
background-color: white; |
||||
-webkit-box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12); |
||||
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12); |
||||
padding: 30px 30px 15px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-closeIcon { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
top: 15px; |
||||
right: 15px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c { |
||||
color: rgba(0, 0, 0, 0.87); |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
margin-bottom: 10px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c { |
||||
-webkit-transition: -webkit-transform .5s; |
||||
transition: -webkit-transform .5s; |
||||
transition: transform .5s; |
||||
transition: transform .5s, -webkit-transform .5s; |
||||
-webkit-transform: scale(0); |
||||
transform: scale(0); |
||||
display: block; |
||||
margin-right: 0px; |
||||
margin-left: 0px; |
||||
margin-bottom: 10px; |
||||
font-size: 69px; |
||||
color: #aaa; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-content { |
||||
text-align: center; |
||||
font-size: 15px; |
||||
color: #777; |
||||
margin-bottom: 25px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons { |
||||
text-align: center; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button { |
||||
font-weight: bold; |
||||
text-transform: uppercase; |
||||
-webkit-transition: background .1s; |
||||
transition: background .1s; |
||||
padding: 10px 20px; |
||||
} |
||||
.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button + button { |
||||
margin-left: 4px; |
||||
} |
||||
.jconfirm.jconfirm-modern.jconfirm-open .jconfirm-box .jconfirm-title-c .jconfirm-icon-c { |
||||
-webkit-transform: scale(1); |
||||
transform: scale(1); |
||||
} |
||||
@ -0,0 +1,28 @@ |
||||
/** |
||||
* jQuery toast plugin created by Kamran Ahmed copyright MIT license 2014 |
||||
*/ |
||||
.jq-toast-wrap { display: block; position: fixed; width: 250px; pointer-events: none !important; margin: 0; padding: 0; letter-spacing: normal; z-index: 9000 !important; } |
||||
.jq-toast-wrap * { margin: 0; padding: 0; } |
||||
|
||||
.jq-toast-wrap.bottom-left { bottom: 20px; left: 20px; } |
||||
.jq-toast-wrap.bottom-right { bottom: 20px; right: 40px; } |
||||
.jq-toast-wrap.top-left { top: 20px; left: 20px; } |
||||
.jq-toast-wrap.top-right { top: 20px; right: 40px; } |
||||
|
||||
.jq-toast-single { display: block; width: 100%; padding: 10px; margin: 0px 0px 5px; border-radius: 4px; font-size: 12px; font-family: arial, sans-serif; line-height: 17px; position: relative; pointer-events: all !important; background-color: #444444; color: white; } |
||||
|
||||
.jq-toast-single h2 { font-family: arial, sans-serif; font-size: 14px; margin: 0px 0px 7px; background: none; color: inherit; line-height: inherit; letter-spacing: normal; } |
||||
.jq-toast-single a { color: #eee; text-decoration: none; font-weight: bold; border-bottom: 1px solid white; padding-bottom: 3px; font-size: 12px; } |
||||
|
||||
.jq-toast-single ul { margin: 0px 0px 0px 15px; background: none; padding:0px; } |
||||
.jq-toast-single ul li { list-style-type: disc !important; line-height: 17px; background: none; margin: 0; padding: 0; letter-spacing: normal; } |
||||
|
||||
.close-jq-toast-single { position: absolute; top: 3px; right: 7px; font-size: 14px; cursor: pointer; } |
||||
|
||||
.jq-toast-loader { display: block; position: absolute; top: -2px; height: 5px; width: 0%; left: 0; border-radius: 5px; background: red; } |
||||
.jq-toast-loaded { width: 100%; } |
||||
.jq-has-icon { padding: 10px 10px 10px 50px; background-repeat: no-repeat; background-position: 10px; } |
||||
.jq-icon-info { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII='); background-color: #31708f; color: #d9edf7; border-color: #bce8f1; } |
||||
.jq-icon-warning { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII='); background-color: #8a6d3b; color: #fcf8e3; border-color: #faebcc; } |
||||
.jq-icon-error { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII='); background-color: #a94442; color: #f2dede; border-color: #ebccd1; } |
||||
.jq-icon-success { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg=='); color: #dff0d8; background-color: #3c763d; border-color: #d6e9c6; } |
||||
@ -0,0 +1 @@ |
||||
.jq-toast-wrap,.jq-toast-wrap *{margin:0;padding:0}.jq-toast-wrap{display:block;position:fixed;width:250px;pointer-events:none!important;letter-spacing:normal;z-index:9000!important}.jq-toast-wrap.bottom-left{bottom:20px;left:20px}.jq-toast-wrap.bottom-right{bottom:20px;right:40px}.jq-toast-wrap.top-left{top:20px;left:20px}.jq-toast-wrap.top-right{top:20px;right:40px}.jq-toast-single{display:block;width:100%;padding:10px;margin:0 0 5px;border-radius:4px;font-size:12px;font-family:arial,sans-serif;line-height:17px;position:relative;pointer-events:all!important;background-color:#444;color:#fff}.jq-toast-single h2{font-family:arial,sans-serif;font-size:14px;margin:0 0 7px;background:0 0;color:inherit;line-height:inherit;letter-spacing:normal}.jq-toast-single a{color:#eee;text-decoration:none;font-weight:700;border-bottom:1px solid #fff;padding-bottom:3px;font-size:12px}.jq-toast-single ul{margin:0 0 0 15px;background:0 0;padding:0}.jq-toast-single ul li{list-style-type:disc!important;line-height:17px;background:0 0;margin:0;padding:0;letter-spacing:normal}.close-jq-toast-single{position:absolute;top:3px;right:7px;font-size:14px;cursor:pointer}.jq-toast-loader{display:block;position:absolute;top:-2px;height:5px;width:0;left:0;border-radius:5px;background:red}.jq-toast-loaded{width:100%}.jq-has-icon{padding:10px 10px 10px 50px;background-repeat:no-repeat;background-position:10px}.jq-icon-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=);background-color:#31708f;color:#d9edf7;border-color:#bce8f1}.jq-icon-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=);background-color:#8a6d3b;color:#fcf8e3;border-color:#faebcc}.jq-icon-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=);background-color:#a94442;color:#f2dede;border-color:#ebccd1}.jq-icon-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==);color:#dff0d8;background-color:#3c763d;border-color:#d6e9c6} |
||||
@ -0,0 +1,565 @@ |
||||
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,700,900);html{} |
||||
body{background:#D2D2C7; background: #EAEDED; background: #d4d4d4; font-size:14px;font-family:'Roboto', sans-serif!important; overflow-y: hidden;} |
||||
.dotLine{} |
||||
.ui.message.content{font-family:'Roboto', sans-serif!important;} |
||||
.ui.fluid.container{width:100%!important;} |
||||
.ui.table{font-size:15px;} |
||||
.ui.padded.table td, .ui.padded.table th{padding:0.91em;} |
||||
.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y{position:absolute;background-color:#888;-webkit-border-radius:0px;-moz-border-radius:0px;border-radius:0px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0px;width:9px;} |
||||
.stabs{left:0px;margin:13px 0px 0px 14px;width:96%;} |
||||
.ui.segment[class*="bottom attached"]{border-radius:0px;} |
||||
.ui.top.attached.menu>.item:first-child{border-radius:0px!important;} |
||||
.ui.inverted.menu .active.item{background:rgba(255,255,255,.15);color:#fff!important;font-weight:800;} |
||||
.ui.menu>.item:first-child{border-radius:0px; padding-left: 15px;} |
||||
.ui.form .field>label{display:block;margin:0 0 .28571429rem;color:rgb(51, 51, 51);font-weight:800;text-transform:none;font-size:14px;} |
||||
.ui.menu .item>.input input{font-size:14px;font-weight:600;font-family:'Roboto', sans-serif;border-radius:0px;} |
||||
.ui.table td:first-child{padding-left:15px!important;} |
||||
.ui.table thead td:first-child{border-top:none;padding-left:15px!important;} |
||||
.ui.table thead tr:first-child>th:first-child{border-radius:0px;padding-left:15px;} |
||||
.leftMenu div span{display:inline-block;-webkit-transition:none;transition:none;font-weight:800!important;} |
||||
.ui.dropdown>.text{display:inline-block;-webkit-transition:none;transition:none;font-weight:normal;} |
||||
.ui.table thead th{cursor:auto;background:#f9fafb;text-align:inherit;color:#333;vertical-align:inherit;font-weight:800;text-transform:none;border-bottom:none!important;border-left:none;} |
||||
.main-ui{width:100%;z-index:1;padding-top:15px;} |
||||
#main-container-left-body{position:relative;overflow:auto;padding:0px;padding:0px 0px 0px 0px;} |
||||
.table{border:none;} |
||||
.table tr{cursor:pointer;} |
||||
.ui.dropdown>.dropdown.icon{position:relative;margin:0.2em 0 0 0.6em;} |
||||
.ui.dropdown>.dropdown.icon{font-family:Dropdown;line-height:1;height:1em;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:600;font-style:normal;text-align:center;width:auto;} |
||||
/*.tabHeight{margin-top:-10px;}*/ |
||||
.ui.top.attached.header{font-family:'Roboto', sans-serif;background:#1B1C1D;color:#E1E1E1;font-weight:800;border-radius:0px;height:44px;} |
||||
.ui.inverted.menu{border:0px;background:#1b1c1d;box-shadow:none;border-radius:0px;} |
||||
.ui.menu{font-family:'Roboto', sans-serif;} |
||||
.ui.menu .item{position:relative;vertical-align:middle;line-height:1em;text-decoration:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:0 0;text-transform:none;color:rgba(0,0,0,.87);font-weight:400;-webkit-transition:background .1s ease,box-shadow .1s ease,color .1s ease;transition:background .1s ease,box-shadow .1s ease,color .1s ease;font-weight:800;font-size:1.04em!important;font-size:1.035em!important;} |
||||
.ui.bottom.attached.header{background:#1B1C1D;color:#e1e1e1;border-radius:0px;font-weight:600!important;font-size:1.015em;} |
||||
.ui.top.left.pointing.dropdown>.menu{top:100%;bottom:auto;left:0;right:auto;margin:0.7em 0 0;} |
||||
#sections.ui.top.left.pointing.dropdown>.menu:after{top:-.25em;left:0.2em;right:auto;margin:0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);} |
||||
.home.icon{font-size:1.2em;margin-left:-1px!important;margin-right:8px!important;} |
||||
.home.icon{font-size:1.2em;vertical-align:middle;margin-left:-1px!important;margin-right:4px!important;line-height:0.8em;} |
||||
.ui.inverted.menu .item, .ui.inverted.menu .item>a:not(.ui){background:#1b1c1d;color:#e1e1e1;} |
||||
.ui.inverted.menu .item:hover, .ui.inverted.menu .item>a:not(.ui){background:#2d2e2f!important;color:#f9fafb!important;} |
||||
.dividerRight{margin:23px 0px 8px 0px;border-top:1px solid #fff;border-bottom:1px solid #eee;} |
||||
.dividerRightAlt{margin:15px 0px 15px 0px;border-top:1px solid #fff;border-bottom:1px solid #e4e5e5;} |
||||
.ui.breadcrumb .active.section{font-weight:700;color:rgb(136, 136, 136);} |
||||
.segmentRight{box-shadow:none!important;margin-top:10px!important;padding-top:0px!important;padding-bottom:2px!important;background:rgb(249, 250, 251)!important;border:1px solid #eeeeee!important;} |
||||
.ui.table{font-size:1em;} |
||||
.ui.table{width:100%;background:#fff;margin:0;border:none;box-shadow:none;border-radius:0;text-align:left;color:#252525;border-collapse:separate;border-spacing:0;font-size:14px;} |
||||
#main-container-right-header>.ui.inverted.menu .active.item{background:rgba(255,255,255,.15);background:#F9FAFB!important;color:#333!important;padding-left:10px;font-weight:800;font-size:14px;} |
||||
#main-container-right-header> .ui.inverted.menu .active.item:hover{color:#333!important;} |
||||
.ui.form input:not([type]), .ui.form input[type=text], .ui.form input[type=email], .ui.form input[type=search], .ui.form input[type=password], .ui.form input[type=date], .ui.form input[type=datetime-local], .ui.form input[type=tel], .ui.form input[type=time], .ui.form input[type=url], .ui.form input[type=number]{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;margin:0;outline:0;-webkit-appearance:none;tap-highlight-color:rgba(255,255,255,0);line-height:1.2142em;padding:.67861429em 1em;font-size:1em;background:#fff;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 0 0 0 transparent inset;-webkit-transition:color .1s ease,border-color .1s ease;transition:color .1s ease,border-color .1s ease;font-family:'Roboto', sans-serif!important;font-weight:normal;} |
||||
.ui.table tr.active:hover{box-shadow:0 0 0 rgba(0,0,0,.87) inset;background:#555;color:#fff!important;} |
||||
.ui.selectable.table tr.active:hover, .ui.selectable.table tr:hover td.active{} |
||||
.ui.table tr.active{background:#f3f3f3;text-shadow:none;color:#252525;-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;font-weight:700!important;text-decoration:underline dotted red;} |
||||
.ui.table tr.active .statusText{text-decoration:none!important;border-bottom:1px dotted #999;} |
||||
.ui.striped.selectable.selectable.selectable.table tbody tr.active:hover{background:#f3f3f3!important;color:#252525!important;} |
||||
.last-td{padding-right:15px!important;} |
||||
.tenant_status_green{color:#029224;} |
||||
.tenant_status_orange{color:orange;} |
||||
.tenant_status_grey{color:grey;} |
||||
.tenant_status_red{color:red;} |
||||
.list-row.active > td:last-of-type{-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;} |
||||
.ui.table thead tr>th{color:#888;text-shadow:0px 1px 0px white;cursor:default;} |
||||
#main-container-left-header .ui.menu .dropdown.item .menu{left:0;min-width:calc(100% - 1px);background:#1b1c1d;margin:0;box-shadow:0 1px 3px 0 rgba(0,0,0,.08);margin-top:12px;border-radius:5px;} |
||||
#main-container-left-header .ui.pointing.dropdown>.menu:after{display:block;position:absolute;pointer-events:none;content:'';visibility:visible;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:1em;height:1em;box-shadow:-1px -1px 0 1px rgba(0,0,0,.1);background:#1b1c1d;z-index:2;top:-.5em;left:18px;margin:0 0 0 -.25em;} |
||||
#main-container-left-header .ui.menu .ui.dropdown .menu>.item{margin:0;font-size:1em!important;padding:.71428571em 1.14285714em!important;color:rgb(255, 255, 255)!important;text-transform:none!important;font-weight:600!important;box-shadow:none!important;-webkit-transition:none!important;transition:none!important;text-align:center;text-align:left;} |
||||
#main-container-left-header .ui.menu .ui.dropdown .menu>.item:hover{background:#3d3e3f!important;} |
||||
#main-container-left-header .ui.menu .ui.dropdown .menu .active.item, |
||||
#main-container-left-header .ui.menu .ui.dropdown .menu .active.item:hover{background:#555!important;font-weight:600!important;} |
||||
#main-container-left-header .ui.dropdown .menu>.divider{border-top:none;height:0;margin:.18em 0;padding:1px 0px 0px 10px;} |
||||
#main-container-left-header .menu2{margin-left:10px !important;} |
||||
#main-container-left-header .menu2:after{display:block;position:absolute;pointer-events:none;content:'';visibility:visible;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:1em;height:1em;box-shadow:none!important;border:none!important;background:#1b1c1d!important;z-index:2!important;top:8px!important;left:-2px!important;margin:0 0 0 -.25em;} |
||||
.ui.inverted.popup{background:#1b1c1d;color:#fff;border:none;box-shadow:none;font-weight:800;margin-top:25px;} |
||||
.ui.empty.circular.label, .ui.empty.circular.labels .label{min-width:0;min-height:0;overflow:hidden;width:.7em;height:.7em;vertical-align:middle;margin-right:9px!important;} |
||||
.ui.loading.segment:after{position:fixed;content:'';top:53%;left:25%;margin:-1.5em 0 0 -1.5em;width:3em;height:3em;-webkit-animation:segment-spin .6s linear;animation:segment-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 rgba(0,0,0,.1) rgba(0,0,0,.1);border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent;visibility:visible;z-index:101;} |
||||
.ui.loading.segment:before{position:absolute;content:'';top:0;left:0;background:rgba(249, 250, 251, 0);width:100%;height:800%;border-radius:.28571429rem;z-index:100;} |
||||
.ticker{width:100%;margin:0px 0px 0px 5px;font-family:'Roboto', sans-serif;font-weight:400;cursor:default;} |
||||
.ticker div{display:inline-block;word-wrap:break-word;} |
||||
.always-visible.ps-container > .ps-scrollbar-x-rail, |
||||
.always-visible.ps-container > .ps-scrollbar-y-rail{opacity:0.6;} |
||||
.ui.menu .item>i.icon{opacity:.9;float:none;margin:0 .35714286em 0 0;margin-left:4px;} |
||||
.closeTab{ |
||||
cursor: pointer; |
||||
position: absolute; |
||||
right: 0px; |
||||
line-height: 2.9em; |
||||
padding-left: 12px; |
||||
padding-right: 2px; |
||||
padding-bottom: 23px; |
||||
} |
||||
.closeTab:hover{background:#2d2e2f!important;color:#f9fafb!important;} |
||||
.saved{color:#039024;} |
||||
#rightFixed{height:42px;background:#f9fafb;position:fixed;box-shadow:0px 1px 0px #e4e5e5;} |
||||
|
||||
/* |
||||
.ui.dimmer{display:none;position:absolute;top:0!important;left:0!important;width:100%;height:100%;text-align:center;vertical-align:top;background-color:rgba(0, 0, 0, 0.96);opacity:0;line-height:1;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-transition:background-color .2s linear;transition:background-color .2s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:opacity;z-index:1000;} |
||||
|
||||
.ui.modal { |
||||
display: none; |
||||
position: absolute; |
||||
z-index: 1001; |
||||
top: 57px; |
||||
right: 20px; |
||||
width: 48.6%!important; |
||||
text-align: left; |
||||
background: #fff; |
||||
box-shadow: 1px 3px 3px 0 rgba(0,0,0,.2), 1px 3px 15px 2px rgba(0,0,0,.2); |
||||
-webkit-transform-origin: 50% 25%; |
||||
-ms-transform-origin: 50% 25%; |
||||
transform-origin: 50% 25%; |
||||
border-radius: 6px; |
||||
-webkit-user-select: text; |
||||
-moz-user-select: text; |
||||
-ms-user-select: text; |
||||
user-select: text; |
||||
will-change: top,left,margin,transform,opacity; |
||||
} |
||||
*/ |
||||
|
||||
.ui.large.input{font-size:1.11em;} |
||||
.ui.modal>.actions{background:#eeeeee;padding:1rem;border-top:1px solid rgba(34,36,38,.15);text-align:right;} |
||||
.saveSelect{width:60px;position:relative;float:right;margin:-41px -12px 0px 0px;} |
||||
.ui.comments .reply.form textarea{font-size:1em;height:6em;} |
||||
.ui.comments .comment .metadata{margin:0px 0px 4px 0px!important;font-size:0.822em;font-weight:600;color:#999;text-shadow:0px 1px 0px white;} |
||||
.ui.comments .comment .author{font-size:1.094em;font-weight:600;text-shadow:0px 1px 0px #f5f5f5;} |
||||
.ui.comments .comment .date{font-weight:400!important;color:#898989;font-size:1.089em;cursor:help;} |
||||
.noteDivider{margin-bottom:-4px!important;margin-top:12px!important;border-top:1px dotted #c2c2c2!important;border-bottom:1px dotted #fff!important;} |
||||
.ui.header .ui.label{font-size:'';margin-left:0.45rem;vertical-align:bottom;margin-top:-2px;line-height:0.7em;} |
||||
.ui.grey.labels .label, .ui.grey.label{background-color:#696969!important;border-color:#f9fafb !important;color:#ffffff !important;} |
||||
.ui.white.labels .label, .ui.white.label{background-color:#e5e5e5!important;border-color:#eee !important;color:#ffffff !important;} |
||||
.ui.accordion .title:not(.ui){padding:0.1em 0em;font-size:0.96em;color:rgb(136, 136, 136);font-weight:500;} |
||||
.ui.sortable.table thead th{background: transparent!important; white-space:nowrap;border-left:none!important;color:#757575;opacity:1;} |
||||
.ui.sortable.table thead th.sorted:after{} |
||||
.ui.sortable.table thead th.sorted, |
||||
.ui.sortable.table thead th.sorted:hover, |
||||
.ui.sortable.table thead th:hover{background:none;color:rgb(117, 117, 117);} |
||||
#topSearchClose{display:none;font-size:1.19em;line-height:0.75em;margin-right:-3px;font-weight:400;} |
||||
.pac-container{margin-top:14px;margin-left:0px;box-shadow:0px;font-family:'Roboto', sans-serif!important;} |
||||
.pac-container, .pac-item{padding-top:2px;padding-bottom:2px;padding-left:5px;cursor:pointer;border-bottom:1px dotted #c2c2c2!important;border-top:none!important;} |
||||
.pac-item-query{color:#252525!important;font-size:1.23em!important;} |
||||
.stitle{font-size:1.19em!important;font-weight:800!important;color:#858585!important;padding-left:0px!important;margin-left:-2px!important;text-shadow:0px 1px 0px white;} |
||||
.stitle:hover{color:#777!important;} |
||||
.stitle i{font-size:1.22em!important;vertical-align:middle!important;} |
||||
.ui.form .field{clear:both;margin:0em 0em 0em;} |
||||
.sectiondrop{margin:0px 0px 0px -2px!important;} |
||||
#main-container-right-body.ui.loading.segment:after{position:fixed;content:'';left:74%;} |
||||
/**.ui.attached.menu:not(.tabular){background: #f9fafb;box-shadow: inset 0px -1px 0px 0px #ffffff;}**/ |
||||
.ui.disabled.input, .ui.input input[disabled]{opacity:9;} |
||||
.ui.mini.modal>.header:not(.ui),.ui.small.modal>.header:not(.ui){font-size:1.3em}@media only screen and (max-width:767px){.ui.mini.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.mini.modal{width:35.2%;margin:0 0 0 -17.6%}}@media only screen and (min-width:992px){.ui.mini.modal{width:340px;margin:0 0 0 -170px}}@media only screen and (min-width:1200px){.ui.mini.modal{width:360px;margin:0 0 0 -180px}}@media only screen and (min-width:1920px){.ui.mini.modal{width:380px;margin:0 0 0 -190px}}@media only screen and (max-width:767px){.ui.tiny.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.tiny.modal{width:52.8%;margin:0 0 0 -26.4%}}@media only screen and (min-width:992px){.ui.tiny.modal{width:510px;margin:0 0 0 -255px}}@media only screen and (min-width:1200px){.ui.tiny.modal{width:540px;margin:0 0 0 -270px}}@media only screen and (min-width:1920px){.ui.tiny.modal{width:570px;margin:0 0 0 -285px}}@media only screen and (max-width:767px){.ui.small.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.small.modal{width:70.4%;margin:0 0 0 -35.2%}}@media only screen and (min-width:992px){.ui.small.modal{width:680px;margin:0 0 0 -340px}}@media only screen and (min-width:1200px){.ui.small.modal{width:720px;margin:0 0 0 -360px}}@media only screen and (min-width:1920px){.ui.small.modal{width:760px;margin:0 0 0 -380px}}.ui.large.modal>.header{font-size:1.6em}@media only screen and (max-width:767px){.ui.large.modal{width:95%;margin:0 0 0 -47.5%}}@media only screen and (min-width:768px){.ui.large.modal{width:88%;margin:0 0 0 -44%}}@media only screen and (min-width:992px){.ui.large.modal{width:1020px;margin:0 0 0 -510px}}@media only screen and (min-width:1200px){.ui.large.modal{width:1080px;margin:0 0 0 -540px}}@media only screen and (min-width:1920px){.ui.large.modal{width:1140px;margin:0 0 0 -570px}} |
||||
|
||||
.ui.attached.menu:not(.tabular) { |
||||
background: #F6F6F6; |
||||
background-color: #f9fafb; |
||||
border-bottom: 0px solid rgba(0,0,0,.25); |
||||
border-left: 1px solid #d4d4d5; |
||||
border-right: 1px solid #d4d4d5; |
||||
} |
||||
|
||||
.no-spin::-webkit-inner-spin-button { |
||||
-webkit-appearance: none; |
||||
} |
||||
|
||||
.no-spin::-webkit-clear-button { |
||||
display:none; |
||||
} |
||||
input[type=date] { |
||||
padding: 0px; |
||||
} |
||||
|
||||
.rightTable tbody tr:hover { |
||||
background: rgba(0, 0, 0, 0.04) !important; |
||||
} |
||||
|
||||
/*.ui.selectable.table tbody tr:hover, .ui.table tbody tr td.selectable:hover { |
||||
background: rgba(0, 0, 0, 0.05)!important; |
||||
color: rgba(0, 0, 0, 0.95); |
||||
}*/ |
||||
|
||||
.statusFilter:before { |
||||
box-shadow: 8px 0 0 blue; |
||||
} |
||||
|
||||
|
||||
.auto { cursor: auto; } |
||||
.default { cursor: default; } |
||||
.none { cursor: none; } |
||||
.context-menu { cursor: context-menu; } |
||||
.help { cursor: help; } |
||||
.pointer { cursor: pointer; } |
||||
.progress { cursor: progress; } |
||||
.wait { cursor: wait !important; } |
||||
.cell { cursor: cell; } |
||||
.crosshair { cursor: crosshair; } |
||||
.text { cursor: text; } |
||||
.vertical-text { cursor: vertical-text; } |
||||
.alias { cursor: alias; } |
||||
.copy { cursor: copy; } |
||||
.move { cursor: move; } |
||||
.no-drop { cursor: no-drop; } |
||||
.not-allowed { cursor: not-allowed; } |
||||
.all-scroll { cursor: all-scroll; } |
||||
.col-resize { cursor: col-resize; } |
||||
.row-resize { cursor: row-resize; } |
||||
.n-resize { cursor: n-resize; } |
||||
.e-resize { cursor: e-resize; } |
||||
.s-resize { cursor: s-resize; } |
||||
.w-resize { cursor: w-resize; } |
||||
.ns-resize { cursor: ns-resize; } |
||||
.ew-resize { cursor: ew-resize; } |
||||
.ne-resize { cursor: ne-resize; } |
||||
.nw-resize { cursor: nw-resize; } |
||||
.se-resize { cursor: se-resize; } |
||||
.sw-resize { cursor: sw-resize; } |
||||
.nesw-resize { cursor: nesw-resize; } |
||||
.nwse-resize { cursor: nwse-resize; } |
||||
|
||||
|
||||
/* Right Menu */ |
||||
#main-container-right-body-menu { |
||||
width: 100%; |
||||
margin-top: 0!important; |
||||
margin-bottom: 0; |
||||
border-radius: 0; |
||||
background: #f9fafb; |
||||
border: 0; |
||||
border-bottom: 1px solid #eeeeee; |
||||
} |
||||
|
||||
#main-container-right-body-menu #testingdrop .text { |
||||
cursor: pointer; |
||||
font-weight: 600; |
||||
color: rgb(117, 117, 117); |
||||
} |
||||
|
||||
.ui.menu .ui.dropdown .menu > .item { |
||||
cursor: pointer!important; |
||||
font-weight: 600!important; |
||||
color: rgb(117, 117, 117)!important; |
||||
} |
||||
|
||||
.ui.menu .item { |
||||
cursor: pointer; |
||||
font-weight: 600; |
||||
color: rgb(27, 28, 29); |
||||
} |
||||
|
||||
.ui.menu .item:before { |
||||
position: absolute; |
||||
content: ''; |
||||
top: 0%; |
||||
right: 0px; |
||||
height: 100%; |
||||
width: 1px; |
||||
background: -moz-linear-gradient(top, rgba(0,0,0,0) 15%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 85%); /* FF3.6-15 */ |
||||
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 15%,rgba(0,0,0,0.2) 50%,rgba(0,0,0,0) 85%); /* Chrome10-25,Safari5.1-6 */ |
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 15%,rgba(0,0,0,0.2) 50%,rgba(0,0,0,0) 85%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ |
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#00000000',GradientType=0 ); /* IE6-9 */ |
||||
} |
||||
|
||||
#allTransactionsFixed thead th { |
||||
background: #fdfdfd!important; |
||||
/**border-bottom: 1px solid rgba(0, 0, 0, 0.3)!important;**/ |
||||
} |
||||
|
||||
#allTransactions { |
||||
/* This removes the hidden thead */ |
||||
margin-top: -51px; |
||||
} |
||||
|
||||
.no-sort { |
||||
cursor: default!important; |
||||
} |
||||
|
||||
#transactionBreakdown { |
||||
background: #ffffff; |
||||
margin: 0px 0px 0px 0px; |
||||
padding: 2px 0px 1px 0px; |
||||
border: none; |
||||
border-bottom: 1px solid #d4d4d5; |
||||
border-bottom: 1px solid #e8e9e9; |
||||
} |
||||
|
||||
#transactionBreakdown .ui.basic.label { |
||||
-webkit-border-radius: 0px!important; |
||||
-moz-border-radius: 0px!important; |
||||
border-radius: 0px!important; |
||||
} |
||||
|
||||
.top-bar { |
||||
width: 100%; |
||||
height: 40px; |
||||
background: transparent; |
||||
color: #1b1c1d; |
||||
text-shadow: 0px 1px 0px #fdfdfd; |
||||
z-index: 2; |
||||
} |
||||
|
||||
#profile-menus .default.text{ |
||||
color: #1b1c1d; |
||||
} |
||||
|
||||
#clock { |
||||
line-height: 37px; |
||||
} |
||||
|
||||
#main-container-right-body { |
||||
/* |
||||
* Changed by Chris 12/27/2018 |
||||
* Previous Value: margin: -2px 0px 1px -1px; |
||||
* */ |
||||
margin: -2px 0px 1px -1px; |
||||
/* End Changes */ |
||||
border-top: 0px; |
||||
padding: 0px 0px 0px 0px; |
||||
cursor: default; |
||||
} |
||||
|
||||
|
||||
#right-secondary-menu, |
||||
#right-secondary-content, |
||||
#right-fixed-th { |
||||
|
||||
} |
||||
|
||||
#right-secondary-menu-container { |
||||
padding: 0; |
||||
border-bottom: 1px solid #e4e4e4; |
||||
border-top: none!important; |
||||
margin: -1px 0px 0px -1px; |
||||
} |
||||
|
||||
#right-secondary-menu { |
||||
border-top: none; |
||||
} |
||||
|
||||
#right-secondary-content { |
||||
padding: 0; |
||||
} |
||||
|
||||
#right-fixed-th { |
||||
margin: -2px 0px 2px -1px; |
||||
position: sticky; /* inherit */ |
||||
padding: 0px; |
||||
border-bottom: 1px solid #e4e5e5; |
||||
} |
||||
|
||||
#allTransactionsFixed { |
||||
/*border-bottom: 1px solid #dededf;*/ |
||||
} |
||||
|
||||
#newTransactionModal { |
||||
/*margin: 0rem 0rem 0rem auto !important;*/ |
||||
width: 96% !important; |
||||
margin-top: 0rem; |
||||
display: none; |
||||
} |
||||
|
||||
#newTransactionModal .header { |
||||
/* |
||||
background: #efefef; |
||||
padding: 14px 16px 13px 16px; |
||||
*/ |
||||
} |
||||
|
||||
#transModalHeaderBreadcrums { |
||||
|
||||
} |
||||
|
||||
|
||||
.ui.mini.statistics .statistic > .value, .ui.mini.statistic > .value { |
||||
font-size: 1.5rem !important; |
||||
font-weight: 900; |
||||
} |
||||
|
||||
.ui.statistics .statistic > .label, .ui.statistic > .label { |
||||
font-size: 0.958em; |
||||
font-weight: 800; |
||||
color: rgb(117, 117, 117); |
||||
text-transform: uppercase; |
||||
text-align: center; |
||||
} |
||||
|
||||
.ui.green.statistics .statistic > .value, .ui.statistics .green.statistic > .value, .ui.green.statistic > .value { |
||||
color: #008000; |
||||
} |
||||
|
||||
#newTransactionDrop .text, |
||||
#sections .text, |
||||
#filter .text, |
||||
#filterEntity .text { |
||||
cursor: pointer; |
||||
} |
||||
|
||||
#transactions { |
||||
padding: 0px; |
||||
margin: 0px; |
||||
} |
||||
|
||||
#transactionHistory { |
||||
/** WTF!?? margin-top: -50px; **/ |
||||
} |
||||
|
||||
.ui.divided.grid:not([class*="vertically divided"]) > .column:not(.row), .ui.divided.grid:not([class*="vertically divided"]) > .row > .column { |
||||
box-shadow: none; |
||||
} |
||||
|
||||
#main-container-right-header { |
||||
position:inherit; |
||||
} |
||||
|
||||
.trasactionItem:hover > td a { |
||||
/* code */ |
||||
color: #252525!important; |
||||
} |
||||
|
||||
#login-prompt-box { |
||||
width: 600px !important; |
||||
box-shadow: rgb(12, 12, 12) -1px 4px 10px !important; |
||||
margin-left: 0%!important; |
||||
margin-top: -5rem!important; |
||||
} |
||||
|
||||
#tenantTable { |
||||
margin-top: -41px; |
||||
} |
||||
|
||||
#tenantTable thead tr { |
||||
opacity: 0; |
||||
} |
||||
|
||||
#left-fixed-th-container { |
||||
position: relative; |
||||
background: #f9fafb; |
||||
} |
||||
|
||||
#tenantTableHeader thead tr { |
||||
} |
||||
|
||||
#tenantTableHeader thead tr th { |
||||
box-shadow: inset 0px -1px 0px #dededf; |
||||
} |
||||
|
||||
#transInfo { |
||||
padding: 20px 8px 20px 8px!important; |
||||
} |
||||
|
||||
.ui.dropdown .menu > .divider { |
||||
border-top: 1px solid rgba(34, 36, 38, 0.1); |
||||
height: 0em; |
||||
margin: 0em 0em; |
||||
} |
||||
|
||||
.transDayContainer input { |
||||
text-align: center; |
||||
width: 19ch; |
||||
font-weight: 600; |
||||
color: #828482; |
||||
} |
||||
|
||||
|
||||
#printReceiptBtn.ui.disabled { |
||||
opacity: 0!important; |
||||
} |
||||
|
||||
.disabledHidden.button, .ui.disabledHidden.button, .ui.button.disabledHidden:disabled, .ui.disabledHidden.button:hover, .ui.disabledHidden.active.button { |
||||
cursor: default; |
||||
opacity: 0 !important; |
||||
background-image: none !important; |
||||
-webkit-box-shadow: none !important; |
||||
box-shadow: none !important; |
||||
pointer-events: none !important; |
||||
} |
||||
|
||||
#processTransaction { |
||||
padding-top: 15px; |
||||
padding-bottom: 15px; |
||||
padding-left: 3em; |
||||
padding-right: 3em; |
||||
} |
||||
|
||||
.lighter { |
||||
color: #bbb; |
||||
} |
||||
|
||||
.transMenuDropDimmer span { |
||||
cursor: pointer!important; |
||||
} |
||||
|
||||
#transactionModal { |
||||
/* margin: 0rem 0rem 0rem auto !important; */ |
||||
width: 96% !important; |
||||
margin-top: 0rem; |
||||
} |
||||
|
||||
#right-menu-container { |
||||
z-index: 1; |
||||
} |
||||
|
||||
/* |
||||
@media screen and (min-width: 800px) { |
||||
body { |
||||
background-color: blue !important; |
||||
} |
||||
} |
||||
|
||||
@media screen and (min-width: 600px) { |
||||
body { |
||||
background-color: red !important; |
||||
} |
||||
} |
||||
*/ |
||||
|
||||
.trns-th { |
||||
width: auto; /* Transaction table TH Type */ |
||||
} |
||||
|
||||
.tth { |
||||
width: 16ch; /* Transaction table TH Balences */ |
||||
} |
||||
|
||||
.date-th { |
||||
width: 13ch; /* Transaction table TH Date */ |
||||
} |
||||
|
||||
#right-secondary-breadcrumbs { |
||||
padding: 12px 0px 15px 16px; |
||||
font-weight: 800; |
||||
} |
||||
|
||||
.left-list-amount-box-positive { |
||||
color: #fefefe; |
||||
background: #008000!important; |
||||
padding: 3px 6px; |
||||
border-radius: 10px; |
||||
font-size: 0.95em |
||||
} |
||||
|
||||
.left-list-amount-box-negative { |
||||
color: #fefefe; |
||||
background: #DB2828!important; |
||||
padding: 3px 6px; |
||||
border-radius: 10px; |
||||
font-size: 0.95em |
||||
} |
||||
|
||||
.left-list-amount-box-zero { |
||||
color: #767676; |
||||
background: none!important; |
||||
padding: 3px 6px; |
||||
border-radius: 10px; |
||||
font-size: 0.95em |
||||
} |
||||
|
||||
.ui.statistics .statistic > .value, .ui.statistic > .value { |
||||
color: inherit; /* Allows money colors below to Work! */ |
||||
} |
||||
|
||||
.money-negitive { |
||||
color: #DB2828; |
||||
} |
||||
|
||||
.money-positive { |
||||
color: #008000; |
||||
} |
||||
|
||||
.money-zero { |
||||
color: #767676; |
||||
} |
||||
@ -0,0 +1,56 @@ |
||||
@page { margin: 0 } |
||||
|
||||
section.sheet { |
||||
margin: 0cm 0cm 0cm 0cm; |
||||
page-break-before: avoid; |
||||
page-break-after: always; |
||||
page-break-inside: avoid; |
||||
|
||||
overflow: hidden; |
||||
position: relative; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
/** Paper sizes **/ |
||||
body.A3 .sheet { width: 297mm; height: 419mm } |
||||
body.A3.landscape .sheet { width: 420mm; height: 296mm } |
||||
body.A4 .sheet { width: 210mm; height: 296mm } |
||||
body.A4.landscape .sheet { width: 297mm; height: 209mm } |
||||
body.A5 .sheet { width: 148mm; height: 209mm } |
||||
body.A5.landscape .sheet { width: 210mm; height: 147mm } |
||||
body.letter .sheet { width: 216mm; height: 279mm } |
||||
body.letter.landscape .sheet { width: 280mm; height: 215mm } |
||||
body.legal .sheet { width: 216mm; height: 356mm } |
||||
body.legal.landscape .sheet { width: 357mm; height: 215mm } |
||||
body.receipt .sheet { width: 79mm; height: 180mm; } |
||||
body.receipt.landscape .sheet { width: 179mm; height: 78mm; } |
||||
|
||||
/** Padding area **/ |
||||
.sheet.padding-5mm { padding: 5mm } |
||||
.sheet.padding-10mm { padding: 10mm } |
||||
.sheet.padding-15mm { padding: 15mm } |
||||
.sheet.padding-20mm { padding: 20mm } |
||||
.sheet.padding-25mm { padding: 25mm } |
||||
|
||||
/** For screen preview **/ |
||||
@media screen { |
||||
body { background: #e0e0e0 } |
||||
.sheet { |
||||
background: white; |
||||
box-shadow: 0 .5mm 2mm rgba(0,0,0,.3); |
||||
margin: 5mm auto; |
||||
} |
||||
} |
||||
|
||||
/** Fix for Chrome issue #273306 **/ |
||||
@media print { |
||||
body.A3.landscape { width: 420mm } |
||||
body.A3, body.A4.landscape { width: 297mm } |
||||
body.A4, body.A5.landscape { width: 210mm } |
||||
body.A5 { width: 148mm } |
||||
body.letter, body.legal { width: 216mm } |
||||
body.letter.landscape { width: 280mm } |
||||
body.legal.landscape { width: 357mm } |
||||
body.receipt { width: 79mm } |
||||
body.receipt.landscape { width: 179mm } |
||||
} |
||||
@ -0,0 +1,25 @@ |
||||
.ps-container{-ms-touch-action:none;touch-action:none;overflow:hidden !important;-ms-overflow-style:none;} |
||||
|
||||
@media screen and (-ms-high-contrast:active), (-ms-high-contrast:none){.ps-container{overflow:auto !important;}} |
||||
.ps-container.ps-active-x > .ps-scrollbar-x-rail, |
||||
.ps-container.ps-active-y > .ps-scrollbar-y-rail{display:block;background-color:transparent;} |
||||
.ps-container.ps-in-scrolling{pointer-events:none;} |
||||
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail{background-color:#eee;opacity:0.9;} |
||||
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x{background-color:#999;} |
||||
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail{background-color:#eee;opacity:0.9;} |
||||
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y{background-color:#999;} |
||||
.ps-container > .ps-scrollbar-x-rail{display:none;position:absolute;-webkit-border-radius:0px;-moz-border-radius:0px;border-radius:0px;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;bottom:3px;height:8px;} |
||||
.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:0px;-moz-border-radius:0px;border-radius:0px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;bottom:0;height:8px;} |
||||
.ps-container > .ps-scrollbar-y-rail{display:none;position:absolute;-webkit-border-radius:0px;-moz-border-radius:0px;border-radius:0px;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;right:0px;width:9px;} |
||||
.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y{position:absolute;background-color:#888;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0px;width:9px;} |
||||
.ps-container:hover.ps-in-scrolling{pointer-events:none;} |
||||
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail{background-color:#eee;opacity:0.9;} |
||||
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x{background-color:#999;} |
||||
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail{background-color:#eee;opacity:0.9;} |
||||
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y{background-color:#999;} |
||||
.ps-container:hover > .ps-scrollbar-x-rail, |
||||
.ps-container:hover > .ps-scrollbar-y-rail{opacity:0.6;} |
||||
.ps-container:hover > .ps-scrollbar-x-rail:hover{background-color:#eee;opacity:0.9;} |
||||
.ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x{background-color:#999;} |
||||
.ps-container:hover > .ps-scrollbar-y-rail:hover{background-color:#eee;opacity:0.9;} |
||||
.ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y{background-color:#999;} |
||||
@ -0,0 +1,2 @@ |
||||
|
||||
.ps-container{-ms-touch-action:none;touch-action:none;overflow:hidden!important;-ms-overflow-style:none}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.ps-container{overflow:auto!important}}.ps-container.ps-active-x>.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block;background-color:transparent}.ps-container.ps-in-scrolling{pointer-events:none}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;bottom:3px;height:8px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;bottom:0;height:8px}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;right:0;width:9px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#888;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0;width:9px}.ps-container:hover.ps-in-scrolling{pointer-events:none}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} |
||||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,144 @@ |
||||
function ajax_failed(msg) { |
||||
$.toast({ |
||||
heading: 'Fail to load!', |
||||
showHideTransition: 'slide', |
||||
text: msg, |
||||
icon: 'error', |
||||
position: { |
||||
right: 35, |
||||
bottom: 65 |
||||
}, |
||||
hideAfter: 8000 // in milli seconds
|
||||
}); |
||||
} |
||||
|
||||
function ajax_status(response) { |
||||
if (response.status >= 200 && response.status < 300) { |
||||
return Promise.resolve( response ); |
||||
} else { |
||||
return Promise.reject(new Error(response.statusText)); |
||||
} |
||||
} |
||||
|
||||
function ajax_content(response) { |
||||
return response.text(); |
||||
} |
||||
|
||||
function ajax_loader(mydata, url, id) { |
||||
if ( empty(url) ) { |
||||
return Promise.reject('No URL given!'); |
||||
}
|
||||
|
||||
var request = $.ajax({ |
||||
url: url, |
||||
type: 'POST',
|
||||
data: mydata, |
||||
global: false, |
||||
async: true, |
||||
cache: false, |
||||
dataType: "html", |
||||
}); |
||||
request.done(function (data) { |
||||
$(function() { |
||||
$("#" + id).html(data); |
||||
}); |
||||
}).fail(function (err) { |
||||
var d = JSON.stringify(mydata, null); |
||||
console.log('data=' + d + ';url=' + url + ';id=' + id); |
||||
console.log('AJAX Load Error: ' + err.status + " " + err.statusText); |
||||
}); |
||||
return request; |
||||
} |
||||
|
||||
function ajax_failed(msg) { |
||||
$.toast({ |
||||
heading: 'Fail to load!', |
||||
showHideTransition: 'slide', |
||||
text: msg, |
||||
icon: 'error', |
||||
position: { |
||||
right: 35, |
||||
bottom: 65 |
||||
}, |
||||
hideAfter: 8000 // in milli seconds
|
||||
}); |
||||
} |
||||
|
||||
function ajax_get_loader(mydata, url, id) { |
||||
|
||||
var query = ""; |
||||
var alc = 0; |
||||
for (key in mydata) { |
||||
if (alc !== 0) { |
||||
url += "&"; |
||||
} |
||||
url += encodeURIComponent(key)+"="+encodeURIComponent(mydata[key]); |
||||
alc++; |
||||
} |
||||
|
||||
var promise = new Promise(function(resolve, reject) { |
||||
|
||||
fetch(url, { |
||||
method: 'GET', |
||||
mode: 'cors', |
||||
credentials: 'include', //'same-origin',
|
||||
headers: { |
||||
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8", |
||||
'accept': 'text/html' |
||||
}, |
||||
}) |
||||
.then(ajax_status) |
||||
.then(ajax_content) |
||||
.then(htmlText => { |
||||
$(function() { |
||||
$("#" + id).html(htmlText); |
||||
}); |
||||
}) |
||||
.then(function() { |
||||
return resolve('worked'); |
||||
}) |
||||
.catch(err => { |
||||
console.log("\r\nAJAX Alert: \r\n"); |
||||
console.warn("AJAX Loader URL: " + url); |
||||
console.error(err); |
||||
|
||||
ajax_failed("Refresh this page!"); |
||||
|
||||
return reject(err); |
||||
}); |
||||
|
||||
}); // End of promise...
|
||||
|
||||
return promise; |
||||
} |
||||
|
||||
|
||||
function get_json_data(mydata, url) { |
||||
var promise = new Promise(function(resolve, reject) { |
||||
|
||||
var myHeaders = new Headers({ |
||||
"Content-Type": "application/json", |
||||
});
|
||||
|
||||
fetch(url, { |
||||
method: 'POST', |
||||
credentials: 'omit', // Only will work with omit credentials!!!
|
||||
// mode: 'no-cors',
|
||||
headers: myHeaders, |
||||
body: JSON.stringify(mydata) |
||||
}) |
||||
.then(response => response.json()) |
||||
.then(data => { |
||||
return resolve(data); |
||||
}) |
||||
.catch(err => { |
||||
console.log("\r\n JSON Alert: \r\n"); |
||||
console.warn("URL Failed: " + url); |
||||
console.error(err); |
||||
return reject(err); |
||||
}); |
||||
|
||||
}); // End of promise...
|
||||
|
||||
return promise; |
||||
} |
||||
@ -0,0 +1,261 @@ |
||||
|
||||
(function(root, factory) { |
||||
if (typeof define === 'function' && define.amd) { |
||||
define(factory); |
||||
} else if (typeof exports === 'object') { |
||||
module.exports = factory(require, exports, module); |
||||
} else { |
||||
root.CountUp = factory(); |
||||
} |
||||
}(this, function(require, exports, module) { |
||||
|
||||
/* |
||||
|
||||
countUp.js |
||||
by @inorganik |
||||
|
||||
*/ |
||||
|
||||
// target = id of html element or var of previously selected html element where counting occurs
|
||||
// startVal = the value you want to begin at
|
||||
// endVal = the value you want to arrive at
|
||||
// decimals = number of decimal places, default 0
|
||||
// duration = duration of animation in seconds, default 2
|
||||
// options = optional object of options (see below)
|
||||
|
||||
var CountUp = function(target, startVal, endVal, decimals, duration, options) { |
||||
|
||||
var self = this; |
||||
self.version = function () { return '1.9.3'; }; |
||||
|
||||
// default options
|
||||
self.options = { |
||||
useEasing: true, // toggle easing
|
||||
useGrouping: true, // 1,000,000 vs 1000000
|
||||
separator: ',', // character to use as a separator
|
||||
decimal: '.', // character to use as a decimal
|
||||
easingFn: easeOutExpo, // optional custom easing function, default is Robert Penner's easeOutExpo
|
||||
formattingFn: formatNumber, // optional custom formatting function, default is formatNumber above
|
||||
prefix: '', // optional text before the result
|
||||
suffix: '', // optional text after the result
|
||||
numerals: [] // optionally pass an array of custom numerals for 0-9
|
||||
}; |
||||
|
||||
// extend default options with passed options object
|
||||
if (options && typeof options === 'object') { |
||||
for (var key in self.options) { |
||||
if (options.hasOwnProperty(key) && options[key] !== null) { |
||||
self.options[key] = options[key]; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (self.options.separator === '') { |
||||
self.options.useGrouping = false; |
||||
} |
||||
else { |
||||
// ensure the separator is a string (formatNumber assumes this)
|
||||
self.options.separator = '' + self.options.separator; |
||||
} |
||||
|
||||
// make sure requestAnimationFrame and cancelAnimationFrame are defined
|
||||
// polyfill for browsers without native support
|
||||
// by Opera engineer Erik Möller
|
||||
var lastTime = 0; |
||||
var vendors = ['webkit', 'moz', 'ms', 'o']; |
||||
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
||||
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; |
||||
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; |
||||
} |
||||
if (!window.requestAnimationFrame) { |
||||
window.requestAnimationFrame = function(callback, element) { |
||||
var currTime = new Date().getTime(); |
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime)); |
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); |
||||
lastTime = currTime + timeToCall; |
||||
return id; |
||||
}; |
||||
} |
||||
if (!window.cancelAnimationFrame) { |
||||
window.cancelAnimationFrame = function(id) { |
||||
clearTimeout(id); |
||||
}; |
||||
} |
||||
|
||||
function formatNumber(num) { |
||||
var neg = (num < 0), |
||||
x, x1, x2, x3, i, len; |
||||
num = Math.abs(num).toFixed(self.decimals); |
||||
num += ''; |
||||
x = num.split('.'); |
||||
x1 = x[0]; |
||||
x2 = x.length > 1 ? self.options.decimal + x[1] : ''; |
||||
if (self.options.useGrouping) { |
||||
x3 = ''; |
||||
for (i = 0, len = x1.length; i < len; ++i) { |
||||
if (i !== 0 && ((i % 3) === 0)) { |
||||
x3 = self.options.separator + x3; |
||||
} |
||||
x3 = x1[len - i - 1] + x3; |
||||
} |
||||
x1 = x3; |
||||
} |
||||
// optional numeral substitution
|
||||
if (self.options.numerals.length) { |
||||
x1 = x1.replace(/[0-9]/g, function(w) { |
||||
return self.options.numerals[+w]; |
||||
}) |
||||
x2 = x2.replace(/[0-9]/g, function(w) { |
||||
return self.options.numerals[+w]; |
||||
}) |
||||
} |
||||
return (neg ? '-' : '') + self.options.prefix + x1 + x2 + self.options.suffix; |
||||
} |
||||
// Robert Penner's easeOutExpo
|
||||
function easeOutExpo(t, b, c, d) { |
||||
return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b; |
||||
} |
||||
function ensureNumber(n) { |
||||
return (typeof n === 'number' && !isNaN(n)); |
||||
} |
||||
|
||||
self.initialize = function() {
|
||||
if (self.initialized) return true; |
||||
|
||||
self.error = ''; |
||||
self.d = (typeof target === 'string') ? document.getElementById(target) : target; |
||||
if (!self.d) {
|
||||
self.error = '[CountUp] target is null or undefined' |
||||
return false; |
||||
} |
||||
self.startVal = Number(startVal); |
||||
self.endVal = Number(endVal); |
||||
// error checks
|
||||
if (ensureNumber(self.startVal) && ensureNumber(self.endVal)) { |
||||
self.decimals = Math.max(0, decimals || 0); |
||||
self.dec = Math.pow(10, self.decimals); |
||||
self.duration = Number(duration) * 1000 || 2000; |
||||
self.countDown = (self.startVal > self.endVal); |
||||
self.frameVal = self.startVal; |
||||
self.initialized = true; |
||||
return true; |
||||
} |
||||
else { |
||||
self.error = '[CountUp] startVal ('+startVal+') or endVal ('+endVal+') is not a number'; |
||||
return false; |
||||
} |
||||
}; |
||||
|
||||
// Print value to target
|
||||
self.printValue = function(value) { |
||||
var result = self.options.formattingFn(value); |
||||
|
||||
if (self.d.tagName === 'INPUT') { |
||||
this.d.value = result; |
||||
} |
||||
else if (self.d.tagName === 'text' || self.d.tagName === 'tspan') { |
||||
this.d.textContent = result; |
||||
} |
||||
else { |
||||
this.d.innerHTML = result; |
||||
} |
||||
}; |
||||
|
||||
self.count = function(timestamp) { |
||||
|
||||
if (!self.startTime) { self.startTime = timestamp; } |
||||
|
||||
self.timestamp = timestamp; |
||||
var progress = timestamp - self.startTime; |
||||
self.remaining = self.duration - progress; |
||||
|
||||
// to ease or not to ease
|
||||
if (self.options.useEasing) { |
||||
if (self.countDown) { |
||||
self.frameVal = self.startVal - self.options.easingFn(progress, 0, self.startVal - self.endVal, self.duration); |
||||
} else { |
||||
self.frameVal = self.options.easingFn(progress, self.startVal, self.endVal - self.startVal, self.duration); |
||||
} |
||||
} else { |
||||
if (self.countDown) { |
||||
self.frameVal = self.startVal - ((self.startVal - self.endVal) * (progress / self.duration)); |
||||
} else { |
||||
self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration); |
||||
} |
||||
} |
||||
|
||||
// don't go past endVal since progress can exceed duration in the last frame
|
||||
if (self.countDown) { |
||||
self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal; |
||||
} else { |
||||
self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal; |
||||
} |
||||
|
||||
// decimal
|
||||
self.frameVal = Math.round(self.frameVal*self.dec)/self.dec; |
||||
|
||||
// format and print value
|
||||
self.printValue(self.frameVal); |
||||
|
||||
// whether to continue
|
||||
if (progress < self.duration) { |
||||
self.rAF = requestAnimationFrame(self.count); |
||||
} else { |
||||
if (self.callback) self.callback(); |
||||
} |
||||
}; |
||||
// start your animation
|
||||
self.start = function(callback) { |
||||
if (!self.initialize()) return; |
||||
self.callback = callback; |
||||
self.rAF = requestAnimationFrame(self.count); |
||||
}; |
||||
// toggles pause/resume animation
|
||||
self.pauseResume = function() { |
||||
if (!self.paused) { |
||||
self.paused = true; |
||||
cancelAnimationFrame(self.rAF); |
||||
} else { |
||||
self.paused = false; |
||||
delete self.startTime; |
||||
self.duration = self.remaining; |
||||
self.startVal = self.frameVal; |
||||
requestAnimationFrame(self.count); |
||||
} |
||||
}; |
||||
// reset to startVal so animation can be run again
|
||||
self.reset = function() { |
||||
self.paused = false; |
||||
delete self.startTime; |
||||
self.initialized = false; |
||||
if (self.initialize()) { |
||||
cancelAnimationFrame(self.rAF); |
||||
self.printValue(self.startVal); |
||||
} |
||||
}; |
||||
// pass a new endVal and start animation
|
||||
self.update = function (newEndVal) { |
||||
if (!self.initialize()) return; |
||||
newEndVal = Number(newEndVal); |
||||
if (!ensureNumber(newEndVal)) { |
||||
self.error = '[CountUp] update() - new endVal is not a number: '+newEndVal; |
||||
return; |
||||
} |
||||
self.error = ''; |
||||
if (newEndVal === self.frameVal) return; |
||||
cancelAnimationFrame(self.rAF); |
||||
self.paused = false; |
||||
delete self.startTime; |
||||
self.startVal = self.frameVal; |
||||
self.endVal = newEndVal; |
||||
self.countDown = (self.startVal > self.endVal); |
||||
self.rAF = requestAnimationFrame(self.count); |
||||
}; |
||||
|
||||
// format startVal on initialization
|
||||
if (self.initialize()) self.printValue(self.startVal); |
||||
}; |
||||
|
||||
return CountUp; |
||||
|
||||
})); |
||||
@ -0,0 +1 @@ |
||||
!function(a,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):a.CountUp=n()}(this,function(a,n,t){return function(a,n,t,e,i,r){var u=this;if(u.version=function(){return"1.9.3"},u.options={useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:function(a,n,t,e){return t*(1-Math.pow(2,-10*a/e))*1024/1023+n},formattingFn:function(a){var n,t,e,i,r,o,s=a<0;if(a=Math.abs(a).toFixed(u.decimals),n=(a+="").split("."),t=n[0],e=1<n.length?u.options.decimal+n[1]:"",u.options.useGrouping){for(i="",r=0,o=t.length;r<o;++r)0!==r&&r%3==0&&(i=u.options.separator+i),i=t[o-r-1]+i;t=i}return u.options.numerals.length&&(t=t.replace(/[0-9]/g,function(a){return u.options.numerals[+a]}),e=e.replace(/[0-9]/g,function(a){return u.options.numerals[+a]})),(s?"-":"")+u.options.prefix+t+e+u.options.suffix},prefix:"",suffix:"",numerals:[]},r&&"object"==typeof r)for(var o in u.options)r.hasOwnProperty(o)&&null!==r[o]&&(u.options[o]=r[o]);""===u.options.separator?u.options.useGrouping=!1:u.options.separator=""+u.options.separator;for(var s=0,l=["webkit","moz","ms","o"],m=0;m<l.length&&!window.requestAnimationFrame;++m)window.requestAnimationFrame=window[l[m]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[l[m]+"CancelAnimationFrame"]||window[l[m]+"CancelRequestAnimationFrame"];function d(a){return"number"==typeof a&&!isNaN(a)}window.requestAnimationFrame||(window.requestAnimationFrame=function(a,n){var t=(new Date).getTime(),e=Math.max(0,16-(t-s)),i=window.setTimeout(function(){a(t+e)},e);return s=t+e,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)}),u.initialize=function(){return!!u.initialized||(u.error="",u.d="string"==typeof a?document.getElementById(a):a,u.d?(u.startVal=Number(n),u.endVal=Number(t),d(u.startVal)&&d(u.endVal)?(u.decimals=Math.max(0,e||0),u.dec=Math.pow(10,u.decimals),u.duration=1e3*Number(i)||2e3,u.countDown=u.startVal>u.endVal,u.frameVal=u.startVal,u.initialized=!0):(u.error="[CountUp] startVal ("+n+") or endVal ("+t+") is not a number",!1)):!(u.error="[CountUp] target is null or undefined"))},u.printValue=function(a){var n=u.options.formattingFn(a);"INPUT"===u.d.tagName?this.d.value=n:"text"===u.d.tagName||"tspan"===u.d.tagName?this.d.textContent=n:this.d.innerHTML=n},u.count=function(a){u.startTime||(u.startTime=a);var n=(u.timestamp=a)-u.startTime;u.remaining=u.duration-n,u.options.useEasing?u.countDown?u.frameVal=u.startVal-u.options.easingFn(n,0,u.startVal-u.endVal,u.duration):u.frameVal=u.options.easingFn(n,u.startVal,u.endVal-u.startVal,u.duration):u.countDown?u.frameVal=u.startVal-(u.startVal-u.endVal)*(n/u.duration):u.frameVal=u.startVal+(u.endVal-u.startVal)*(n/u.duration),u.countDown?u.frameVal=u.frameVal<u.endVal?u.endVal:u.frameVal:u.frameVal=u.frameVal>u.endVal?u.endVal:u.frameVal,u.frameVal=Math.round(u.frameVal*u.dec)/u.dec,u.printValue(u.frameVal),n<u.duration?u.rAF=requestAnimationFrame(u.count):u.callback&&u.callback()},u.start=function(a){u.initialize()&&(u.callback=a,u.rAF=requestAnimationFrame(u.count))},u.pauseResume=function(){u.paused?(u.paused=!1,delete u.startTime,u.duration=u.remaining,u.startVal=u.frameVal,requestAnimationFrame(u.count)):(u.paused=!0,cancelAnimationFrame(u.rAF))},u.reset=function(){u.paused=!1,delete u.startTime,u.initialized=!1,u.initialize()&&(cancelAnimationFrame(u.rAF),u.printValue(u.startVal))},u.update=function(a){u.initialize()&&(d(a=Number(a))?(u.error="",a!==u.frameVal&&(cancelAnimationFrame(u.rAF),u.paused=!1,delete u.startTime,u.startVal=u.frameVal,u.endVal=a,u.countDown=u.startVal>u.endVal,u.rAF=requestAnimationFrame(u.count))):u.error="[CountUp] update() - new endVal is not a number: "+a)},u.initialize()&&u.printValue(u.startVal)}}); |
||||
@ -0,0 +1,424 @@ |
||||
/**** |
||||
* Grapnel |
||||
* https://github.com/bytecipher/grapnel
|
||||
* |
||||
* @author Greg Sabia Tucker <greg@bytecipher.io> |
||||
* @link http://bytecipher.io
|
||||
* @version 0.6.3 |
||||
* |
||||
* Released under MIT License. See LICENSE.txt or http://opensource.org/licenses/MIT
|
||||
*/ |
||||
|
||||
!(function(root) { |
||||
|
||||
function Grapnel(opts) { |
||||
"use strict"; |
||||
|
||||
var self = this; // Scope reference
|
||||
this.events = {}; // Event Listeners
|
||||
this.state = null; // Router state object
|
||||
this.options = opts || {}; // Options
|
||||
this.options.env = this.options.env || (!!(Object.keys(root).length === 0 && process && process.browser !== true) ? 'server' : 'client'); |
||||
this.options.mode = this.options.mode || (!!(this.options.env !== 'server' && this.options.pushState && root.history && root.history.pushState) ? 'pushState' : 'hashchange'); |
||||
this.version = '0.6.3'; // Version
|
||||
|
||||
if ('function' === typeof root.addEventListener) { |
||||
root.addEventListener('hashchange', function() { |
||||
self.trigger('hashchange'); |
||||
}); |
||||
|
||||
root.addEventListener('popstate', function(e) { |
||||
// Make sure popstate doesn't run on init -- this is a common issue with Safari and old versions of Chrome
|
||||
if (self.state && self.state.previousState === null) return false; |
||||
|
||||
self.trigger('navigate'); |
||||
}); |
||||
} |
||||
|
||||
return this; |
||||
}; |
||||
/** |
||||
* Create a RegExp Route from a string |
||||
* This is the heart of the router and I've made it as small as possible! |
||||
* |
||||
* @param {String} Path of route |
||||
* @param {Array} Array of keys to fill |
||||
* @param {Bool} Case sensitive comparison |
||||
* @param {Bool} Strict mode |
||||
*/ |
||||
Grapnel.regexRoute = function(path, keys, sensitive, strict) { |
||||
if (path instanceof RegExp) return path; |
||||
if (path instanceof Array) path = '(' + path.join('|') + ')'; |
||||
// Build route RegExp
|
||||
path = path.concat(strict ? '' : '/?') |
||||
.replace(/\/\(/g, '(?:/') |
||||
.replace(/\+/g, '__plus__') |
||||
.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional) { |
||||
keys.push({ |
||||
name: key, |
||||
optional: !!optional |
||||
}); |
||||
slash = slash || ''; |
||||
|
||||
return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + (optional || ''); |
||||
}) |
||||
.replace(/([\/.])/g, '\\$1') |
||||
.replace(/__plus__/g, '(.+)') |
||||
.replace(/\*/g, '(.*)'); |
||||
|
||||
return new RegExp('^' + path + '$', sensitive ? '' : 'i'); |
||||
}; |
||||
/** |
||||
* ForEach workaround utility |
||||
* |
||||
* @param {Array} to iterate |
||||
* @param {Function} callback |
||||
*/ |
||||
Grapnel._forEach = function(a, callback) { |
||||
if (typeof Array.prototype.forEach === 'function') return Array.prototype.forEach.call(a, callback); |
||||
// Replicate forEach()
|
||||
return function(c, next) { |
||||
for (var i = 0, n = this.length; i < n; ++i) { |
||||
c.call(next, this[i], i, this); |
||||
} |
||||
}.call(a, callback); |
||||
}; |
||||
/** |
||||
* Add an route and handler |
||||
* |
||||
* @param {String|RegExp} route name |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.prototype.get = Grapnel.prototype.add = function(route) { |
||||
var self = this, |
||||
middleware = Array.prototype.slice.call(arguments, 1, -1), |
||||
handler = Array.prototype.slice.call(arguments, -1)[0], |
||||
request = new Request(route); |
||||
|
||||
var invoke = function RouteHandler() { |
||||
// Build request parameters
|
||||
var req = request.parse(self.path()); |
||||
// Check if matches are found
|
||||
if (req.match) { |
||||
// Match found
|
||||
var extra = { |
||||
route: route, |
||||
params: req.params, |
||||
req: req, |
||||
regex: req.match |
||||
}; |
||||
// Create call stack -- add middleware first, then handler
|
||||
var stack = new CallStack(self, extra).enqueue(middleware.concat(handler)); |
||||
// Trigger main event
|
||||
self.trigger('match', stack, req); |
||||
// Continue?
|
||||
if (!stack.runCallback) return self; |
||||
// Previous state becomes current state
|
||||
stack.previousState = self.state; |
||||
// Save new state
|
||||
self.state = stack; |
||||
// Prevent this handler from being called if parent handler in stack has instructed not to propagate any more events
|
||||
if (stack.parent() && stack.parent().propagateEvent === false) { |
||||
stack.propagateEvent = false; |
||||
return self; |
||||
} |
||||
// Call handler
|
||||
stack.callback(); |
||||
} |
||||
// Returns self
|
||||
return self; |
||||
}; |
||||
// Event name
|
||||
var eventName = (self.options.mode !== 'pushState' && self.options.env !== 'server') ? 'hashchange' : 'navigate'; |
||||
// Invoke when route is defined, and once again when app navigates
|
||||
return invoke().on(eventName, invoke); |
||||
}; |
||||
/** |
||||
* Fire an event listener |
||||
* |
||||
* @param {String} event name |
||||
* @param {Mixed} [attributes] Parameters that will be applied to event handler |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.prototype.trigger = function(event) { |
||||
var self = this, |
||||
params = Array.prototype.slice.call(arguments, 1); |
||||
// Call matching events
|
||||
if (this.events[event]) { |
||||
Grapnel._forEach(this.events[event], function(fn) { |
||||
fn.apply(self, params); |
||||
}); |
||||
} |
||||
|
||||
return this; |
||||
}; |
||||
/** |
||||
* Add an event listener |
||||
* |
||||
* @param {String} event name (multiple events can be called when separated by a space " ") |
||||
* @param {Function} callback |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.prototype.on = Grapnel.prototype.bind = function(event, handler) { |
||||
var self = this, |
||||
events = event.split(' '); |
||||
|
||||
Grapnel._forEach(events, function(event) { |
||||
if (self.events[event]) { |
||||
self.events[event].push(handler); |
||||
} else { |
||||
self.events[event] = [handler]; |
||||
} |
||||
}); |
||||
|
||||
return this; |
||||
}; |
||||
/** |
||||
* Allow event to be called only once |
||||
* |
||||
* @param {String} event name(s) |
||||
* @param {Function} callback |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.prototype.once = function(event, handler) { |
||||
var ran = false; |
||||
|
||||
return this.on(event, function() { |
||||
if (ran) return false; |
||||
ran = true; |
||||
handler.apply(this, arguments); |
||||
handler = null; |
||||
return true; |
||||
}); |
||||
}; |
||||
/** |
||||
* @param {String} Route context (without trailing slash) |
||||
* @param {[Function]} Middleware (optional) |
||||
* @return {Function} Adds route to context |
||||
*/ |
||||
Grapnel.prototype.context = function(context) { |
||||
var self = this, |
||||
middleware = Array.prototype.slice.call(arguments, 1); |
||||
|
||||
return function() { |
||||
var value = arguments[0], |
||||
submiddleware = (arguments.length > 2) ? Array.prototype.slice.call(arguments, 1, -1) : [], |
||||
handler = Array.prototype.slice.call(arguments, -1)[0], |
||||
prefix = (context.slice(-1) !== '/' && value !== '/' && value !== '') ? context + '/' : context, |
||||
path = (value.substr(0, 1) !== '/') ? value : value.substr(1), |
||||
pattern = prefix + path; |
||||
|
||||
return self.add.apply(self, [pattern].concat(middleware).concat(submiddleware).concat([handler])); |
||||
} |
||||
}; |
||||
/** |
||||
* Navigate through history API |
||||
* |
||||
* @param {String} Pathname |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.prototype.navigate = function(path) { |
||||
return this.path(path).trigger('navigate'); |
||||
}; |
||||
|
||||
Grapnel.prototype.path = function(pathname) { |
||||
var self = this, |
||||
frag; |
||||
|
||||
if ('string' === typeof pathname) { |
||||
// Set path
|
||||
if (self.options.mode === 'pushState') { |
||||
frag = (self.options.root) ? (self.options.root + pathname) : pathname; |
||||
root.history.pushState({}, null, frag); |
||||
} else if (root.location) { |
||||
root.location.hash = (self.options.hashBang ? '!' : '') + pathname; |
||||
} else { |
||||
root._pathname = pathname || ''; |
||||
} |
||||
|
||||
return this; |
||||
} else if ('undefined' === typeof pathname) { |
||||
// Get path
|
||||
if (self.options.mode === 'pushState') { |
||||
frag = root.location.pathname.replace(self.options.root, ''); |
||||
} else if (self.options.mode !== 'pushState' && root.location) { |
||||
frag = (root.location.hash) ? root.location.hash.split((self.options.hashBang ? '#!' : '#'))[1] : ''; |
||||
} else { |
||||
frag = root._pathname || ''; |
||||
} |
||||
|
||||
return frag; |
||||
} else if (pathname === false) { |
||||
// Clear path
|
||||
if (self.options.mode === 'pushState') { |
||||
root.history.pushState({}, null, self.options.root || '/'); |
||||
} else if (root.location) { |
||||
root.location.hash = (self.options.hashBang) ? '!' : ''; |
||||
} |
||||
|
||||
return self; |
||||
} |
||||
}; |
||||
/** |
||||
* Create routes based on an object |
||||
* |
||||
* @param {Object} [Options, Routes] |
||||
* @param {Object Routes} |
||||
* @return {self} Router |
||||
*/ |
||||
Grapnel.listen = function() { |
||||
var opts, routes; |
||||
if (arguments[0] && arguments[1]) { |
||||
opts = arguments[0]; |
||||
routes = arguments[1]; |
||||
} else { |
||||
routes = arguments[0]; |
||||
} |
||||
// Return a new Grapnel instance
|
||||
return (function() { |
||||
// TODO: Accept multi-level routes
|
||||
for (var key in routes) { |
||||
this.add.call(this, key, routes[key]); |
||||
} |
||||
|
||||
return this; |
||||
}).call(new Grapnel(opts || {})); |
||||
}; |
||||
/** |
||||
* Create a call stack that can be enqueued by handlers and middleware |
||||
* |
||||
* @param {Object} Router |
||||
* @param {Object} Extend |
||||
* @return {self} CallStack |
||||
*/ |
||||
function CallStack(router, extendObj) { |
||||
this.stack = CallStack.global.slice(0); |
||||
this.router = router; |
||||
this.runCallback = true; |
||||
this.callbackRan = false; |
||||
this.propagateEvent = true; |
||||
this.value = router.path(); |
||||
|
||||
for (var key in extendObj) { |
||||
this[key] = extendObj[key]; |
||||
} |
||||
|
||||
return this; |
||||
}; |
||||
/** |
||||
* Build request parameters and allow them to be checked against a string (usually the current path) |
||||
* |
||||
* @param {String} Route |
||||
* @return {self} Request
|
||||
*/ |
||||
function Request(route) { |
||||
this.route = route; |
||||
this.keys = []; |
||||
this.regex = Grapnel.regexRoute(route, this.keys); |
||||
}; |
||||
// This allows global middleware
|
||||
CallStack.global = []; |
||||
/** |
||||
* Prevent a callback from being called |
||||
* |
||||
* @return {self} CallStack
|
||||
*/ |
||||
CallStack.prototype.preventDefault = function() { |
||||
this.runCallback = false; |
||||
}; |
||||
/** |
||||
* Prevent any future callbacks from being called |
||||
* |
||||
* @return {self} CallStack
|
||||
*/ |
||||
CallStack.prototype.stopPropagation = function() { |
||||
this.propagateEvent = false; |
||||
}; |
||||
/** |
||||
* Get parent state |
||||
* |
||||
* @return {Object} Previous state
|
||||
*/ |
||||
CallStack.prototype.parent = function() { |
||||
var hasParentEvents = !!(this.previousState && this.previousState.value && this.previousState.value == this.value); |
||||
return (hasParentEvents) ? this.previousState : false; |
||||
}; |
||||
/** |
||||
* Run a callback (calls to next) |
||||
* |
||||
* @return {self} CallStack
|
||||
*/ |
||||
CallStack.prototype.callback = function() { |
||||
this.callbackRan = true; |
||||
this.timeStamp = Date.now(); |
||||
this.next(); |
||||
}; |
||||
/** |
||||
* Add handler or middleware to the stack |
||||
* |
||||
* @param {Function|Array} Handler or a array of handlers |
||||
* @param {Int} Index to start inserting |
||||
* @return {self} CallStack
|
||||
*/ |
||||
CallStack.prototype.enqueue = function(handler, atIndex) { |
||||
var handlers = (!Array.isArray(handler)) ? [handler] : ((atIndex < handler.length) ? handler.reverse() : handler); |
||||
|
||||
while (handlers.length) { |
||||
this.stack.splice(atIndex || this.stack.length + 1, 0, handlers.shift()); |
||||
} |
||||
|
||||
return this; |
||||
}; |
||||
/** |
||||
* Call to next item in stack -- this adds the `req`, `event`, and `next()` arguments to all middleware |
||||
* |
||||
* @return {self} CallStack
|
||||
*/ |
||||
CallStack.prototype.next = function() { |
||||
var self = this; |
||||
|
||||
return this.stack.shift().call(this.router, this.req, this, function next() { |
||||
self.next.call(self); |
||||
}); |
||||
}; |
||||
/** |
||||
* Match a path string -- returns a request object if there is a match -- returns false otherwise |
||||
* |
||||
* @return {Object} req |
||||
*/ |
||||
Request.prototype.parse = function(path) { |
||||
var match = path.match(this.regex), |
||||
self = this; |
||||
|
||||
var req = { |
||||
params: {}, |
||||
keys: this.keys, |
||||
matches: (match || []).slice(1), |
||||
match: match |
||||
}; |
||||
// Build parameters
|
||||
Grapnel._forEach(req.matches, function(value, i) { |
||||
var key = (self.keys[i] && self.keys[i].name) ? self.keys[i].name : i; |
||||
// Parameter key will be its key or the iteration index. This is useful if a wildcard (*) is matched
|
||||
req.params[key] = (value) ? decodeURIComponent(value) : undefined; |
||||
}); |
||||
|
||||
return req; |
||||
}; |
||||
|
||||
// Append utility constructors to Grapnel
|
||||
Grapnel.CallStack = CallStack; |
||||
Grapnel.Request = Request; |
||||
|
||||
if ('function' === typeof root.define && !root.define.amd.grapnel) { |
||||
root.define(function(require, exports, module) { |
||||
root.define.amd.grapnel = true; |
||||
return Grapnel; |
||||
}); |
||||
} else if ('object' === typeof module && 'object' === typeof module.exports) { |
||||
module.exports = exports = Grapnel; |
||||
} else { |
||||
root.Grapnel = Grapnel; |
||||
} |
||||
|
||||
}).call({}, ('object' === typeof window) ? window : this); |
||||
@ -0,0 +1,260 @@ |
||||
/*** |
||||
umd: true |
||||
***/ |
||||
|
||||
(function () { |
||||
// Prepare
|
||||
var $, ScrollTo |
||||
$ = window.jQuery || require('jquery') |
||||
|
||||
// Fix scrolling animations on html/body on safari
|
||||
$.propHooks.scrollTop = $.propHooks.scrollLeft = { |
||||
get: function (elem, prop) { |
||||
var result = null |
||||
if ( elem.tagName === 'HTML' || elem.tagName === 'BODY' ) { |
||||
if ( prop === 'scrollLeft' ) { |
||||
result = window.scrollX |
||||
} |
||||
else if ( prop === 'scrollTop' ) { |
||||
result = window.scrollY |
||||
} |
||||
} |
||||
if ( result == null ) { |
||||
result = elem[prop] |
||||
} |
||||
return result |
||||
} |
||||
} |
||||
$.Tween.propHooks.scrollTop = $.Tween.propHooks.scrollLeft = { |
||||
get: function (tween) { |
||||
return $.propHooks.scrollTop.get(tween.elem, tween.prop) |
||||
}, |
||||
set: function (tween) { |
||||
// Our safari fix
|
||||
if ( tween.elem.tagName === 'HTML' || tween.elem.tagName === 'BODY' ) { |
||||
// Defaults
|
||||
tween.options.bodyScrollLeft = (tween.options.bodyScrollLeft || window.scrollX) |
||||
tween.options.bodyScrollTop = (tween.options.bodyScrollTop || window.scrollY) |
||||
|
||||
// Apply
|
||||
if ( tween.prop === 'scrollLeft' ) { |
||||
tween.options.bodyScrollLeft = Math.round(tween.now) |
||||
} |
||||
else if ( tween.prop === 'scrollTop' ) { |
||||
tween.options.bodyScrollTop = Math.round(tween.now) |
||||
} |
||||
|
||||
// Apply
|
||||
window.scrollTo(tween.options.bodyScrollLeft, tween.options.bodyScrollTop) |
||||
} |
||||
// jQuery's IE8 Fix
|
||||
else if ( tween.elem.nodeType && tween.elem.parentNode ) { |
||||
tween.elem[tween.prop] = tween.now |
||||
} |
||||
} |
||||
} |
||||
|
||||
// jQuery ScrollTo
|
||||
ScrollTo = { |
||||
// Configuration
|
||||
config: { |
||||
duration: 400, |
||||
easing: 'swing', |
||||
callback: null, |
||||
durationMode: 'each', |
||||
offsetTop: 0, |
||||
offsetLeft: 0 |
||||
}, |
||||
|
||||
// Set Configuration
|
||||
configure: function (options) { |
||||
// Apply Options to Config
|
||||
$.extend(ScrollTo.config, options || {}) |
||||
|
||||
// Chain
|
||||
return this |
||||
}, |
||||
|
||||
// Perform the Scroll Animation for the Collections
|
||||
// We use $inline here, so we can determine the actual offset start for each overflow:scroll item
|
||||
// Each collection is for each overflow:scroll item
|
||||
scroll: function (collections, config) { |
||||
// Prepare
|
||||
var collection, $container, $target, $inline, position, |
||||
containerScrollTop, containerScrollLeft, |
||||
containerScrollTopEnd, containerScrollLeftEnd, |
||||
startOffsetTop, targetOffsetTop, targetOffsetTopAdjusted, |
||||
startOffsetLeft, targetOffsetLeft, targetOffsetLeftAdjusted, |
||||
scrollOptions, |
||||
callback |
||||
|
||||
// Determine the Scroll
|
||||
collection = collections.pop() |
||||
$container = collection.$container |
||||
$target = collection.$target |
||||
|
||||
// Prepare the Inline Element of the Container
|
||||
$inline = $('<span/>').css({ |
||||
'position': 'absolute', |
||||
'top': '0px', |
||||
'left': '0px' |
||||
}) |
||||
position = $container.css('position') |
||||
|
||||
// Insert the Inline Element of the Container
|
||||
$container.css({position: 'relative'}) |
||||
$inline.appendTo($container) |
||||
|
||||
// Determine the top offset
|
||||
startOffsetTop = $inline.offset().top |
||||
targetOffsetTop = $target.offset().top |
||||
targetOffsetTopAdjusted = targetOffsetTop - startOffsetTop - parseInt(config.offsetTop, 10) |
||||
|
||||
// Determine the left offset
|
||||
startOffsetLeft = $inline.offset().left |
||||
targetOffsetLeft = $target.offset().left |
||||
targetOffsetLeftAdjusted = targetOffsetLeft - startOffsetLeft - parseInt(config.offsetLeft, 10) |
||||
|
||||
// Determine current scroll positions
|
||||
containerScrollTop = $container.prop('scrollTop') |
||||
containerScrollLeft = $container.prop('scrollLeft') |
||||
|
||||
// Reset the Inline Element of the Container
|
||||
$inline.remove() |
||||
$container.css({position: position}) |
||||
|
||||
// Prepare the scroll options
|
||||
scrollOptions = {} |
||||
|
||||
// Prepare the callback
|
||||
callback = function () { |
||||
// Check
|
||||
if ( collections.length === 0 ) { |
||||
// Callback
|
||||
if ( typeof config.callback === 'function' ) { |
||||
config.callback() |
||||
} |
||||
} |
||||
else { |
||||
// Recurse
|
||||
ScrollTo.scroll(collections, config) |
||||
} |
||||
// Return true
|
||||
return true |
||||
} |
||||
|
||||
// Handle if we only want to scroll if we are outside the viewport
|
||||
if ( config.onlyIfOutside ) { |
||||
// Determine current scroll positions
|
||||
containerScrollTopEnd = containerScrollTop + $container.height() |
||||
containerScrollLeftEnd = containerScrollLeft + $container.width() |
||||
|
||||
// Check if we are in the range of the visible area of the container
|
||||
if ( containerScrollTop < targetOffsetTopAdjusted && targetOffsetTopAdjusted < containerScrollTopEnd ) { |
||||
targetOffsetTopAdjusted = containerScrollTop |
||||
} |
||||
if ( containerScrollLeft < targetOffsetLeftAdjusted && targetOffsetLeftAdjusted < containerScrollLeftEnd ) { |
||||
targetOffsetLeftAdjusted = containerScrollLeft |
||||
} |
||||
} |
||||
|
||||
// Determine the scroll options
|
||||
if ( targetOffsetTopAdjusted !== containerScrollTop ) { |
||||
scrollOptions.scrollTop = targetOffsetTopAdjusted |
||||
} |
||||
if ( targetOffsetLeftAdjusted !== containerScrollLeft ) { |
||||
scrollOptions.scrollLeft = targetOffsetLeftAdjusted |
||||
} |
||||
|
||||
// Check to see if the scroll is necessary
|
||||
if ( $container.prop('scrollHeight') === $container.height() ) { |
||||
delete scrollOptions.scrollTop |
||||
} |
||||
if ( $container.prop('scrollWidth') === $container.width() ) { |
||||
delete scrollOptions.scrollLeft |
||||
} |
||||
|
||||
// Perform the scroll
|
||||
if ( scrollOptions.scrollTop != null || scrollOptions.scrollLeft != null ) { |
||||
$container.animate(scrollOptions, { |
||||
duration: config.duration, |
||||
easing: config.easing, |
||||
complete: callback |
||||
}) |
||||
} |
||||
else { |
||||
callback() |
||||
} |
||||
|
||||
// Return true
|
||||
return true |
||||
}, |
||||
|
||||
// ScrollTo the Element using the Options
|
||||
fn: function (options) { |
||||
// Prepare
|
||||
var collections, config, $container, container |
||||
collections = [] |
||||
|
||||
// Prepare
|
||||
var $target = $(this) |
||||
if ( $target.length === 0 ) { |
||||
// Chain
|
||||
return this |
||||
} |
||||
|
||||
// Handle Options
|
||||
config = $.extend({}, ScrollTo.config, options) |
||||
|
||||
// Fetch
|
||||
$container = $target.parent() |
||||
container = $container.get(0) |
||||
|
||||
// Cycle through the containers
|
||||
while ( ($container.length === 1) && (container !== document.body) && (container !== document) ) { |
||||
// Check Container for scroll differences
|
||||
var containerScrollTop, containerScrollLeft |
||||
containerScrollTop = $container.css('overflow-y') !== 'visible' && container.scrollHeight !== container.clientHeight |
||||
containerScrollLeft = $container.css('overflow-x') !== 'visible' && container.scrollWidth !== container.clientWidth |
||||
if ( containerScrollTop || containerScrollLeft ) { |
||||
// Push the Collection
|
||||
collections.push({ |
||||
'$container': $container, |
||||
'$target': $target |
||||
}) |
||||
// Update the Target
|
||||
$target = $container |
||||
} |
||||
// Update the Container
|
||||
$container = $container.parent() |
||||
container = $container.get(0) |
||||
} |
||||
|
||||
// Add the final collection
|
||||
collections.push({ |
||||
'$container': $('html'), |
||||
// document.body doesn't work in firefox, html works for all
|
||||
// internet explorer starts at the beggining
|
||||
'$target': $target |
||||
}) |
||||
|
||||
// Adjust the Config
|
||||
if ( config.durationMode === 'all' ) { |
||||
config.duration /= collections.length |
||||
} |
||||
|
||||
// Handle
|
||||
ScrollTo.scroll(collections, config) |
||||
|
||||
// Chain
|
||||
return this |
||||
} |
||||
} |
||||
|
||||
// Apply our extensions to jQuery
|
||||
$.ScrollTo = $.ScrollTo || ScrollTo |
||||
$.fn.ScrollTo = $.fn.ScrollTo || ScrollTo.fn |
||||
|
||||
// Export
|
||||
return ScrollTo |
||||
}).call(this) |
||||
@ -0,0 +1 @@ |
||||
(function(){var o,l;return o=window.jQuery||require("jquery"),o.propHooks.scrollTop=o.propHooks.scrollLeft={get:function(o,l){var t=null;return"HTML"!==o.tagName&&"BODY"!==o.tagName||("scrollLeft"===l?t=window.scrollX:"scrollTop"===l&&(t=window.scrollY)),null==t&&(t=o[l]),t}},o.Tween.propHooks.scrollTop=o.Tween.propHooks.scrollLeft={get:function(l){return o.propHooks.scrollTop.get(l.elem,l.prop)},set:function(o){"HTML"===o.elem.tagName||"BODY"===o.elem.tagName?(o.options.bodyScrollLeft=o.options.bodyScrollLeft||window.scrollX,o.options.bodyScrollTop=o.options.bodyScrollTop||window.scrollY,"scrollLeft"===o.prop?o.options.bodyScrollLeft=Math.round(o.now):"scrollTop"===o.prop&&(o.options.bodyScrollTop=Math.round(o.now)),window.scrollTo(o.options.bodyScrollLeft,o.options.bodyScrollTop)):o.elem.nodeType&&o.elem.parentNode&&(o.elem[o.prop]=o.now)}},l={config:{duration:400,easing:"swing",callback:null,durationMode:"each",offsetTop:0,offsetLeft:0},configure:function(t){return o.extend(l.config,t||{}),this},scroll:function(t,e){var r,n,s,c,i,p,f,a,d,u,g,h,T,w,m,L,b;return r=t.pop(),n=r.$container,s=r.$target,c=o("<span/>").css({position:"absolute",top:"0px",left:"0px"}),i=n.css("position"),n.css({position:"relative"}),c.appendTo(n),u=c.offset().top,g=s.offset().top,h=g-u-parseInt(e.offsetTop,10),T=c.offset().left,w=s.offset().left,m=w-T-parseInt(e.offsetLeft,10),p=n.prop("scrollTop"),f=n.prop("scrollLeft"),c.remove(),n.css({position:i}),L={},b=function(){return 0===t.length?"function"==typeof e.callback&&e.callback():l.scroll(t,e),!0},e.onlyIfOutside&&(a=p+n.height(),d=f+n.width(),p<h&&h<a&&(h=p),f<m&&m<d&&(m=f)),h!==p&&(L.scrollTop=h),m!==f&&(L.scrollLeft=m),n.prop("scrollHeight")===n.height()&&delete L.scrollTop,n.prop("scrollWidth")===n.width()&&delete L.scrollLeft,null!=L.scrollTop||null!=L.scrollLeft?n.animate(L,{duration:e.duration,easing:e.easing,complete:b}):b(),!0},fn:function(t){var e,r,n,s;e=[];var c=o(this);if(0===c.length)return this;for(r=o.extend({},l.config,t),s=(n=c.parent()).get(0);1===n.length&&s!==document.body&&s!==document;){var i,p;i="visible"!==n.css("overflow-y")&&s.scrollHeight!==s.clientHeight,p="visible"!==n.css("overflow-x")&&s.scrollWidth!==s.clientWidth,(i||p)&&(e.push({$container:n,$target:c}),c=n),s=(n=n.parent()).get(0)}return e.push({$container:o("html"),$target:c}),"all"===r.durationMode&&(r.duration/=e.length),l.scroll(e,r),this}},o.ScrollTo=o.ScrollTo||l,o.fn.ScrollTo=o.fn.ScrollTo||l.fn,l}).call(this); |
||||
@ -0,0 +1,19 @@ |
||||
!function(d,B,m,f){function v(a,b){var c=Math.max(0,a[0]-b[0],b[0]-a[1]),e=Math.max(0,a[2]-b[1],b[1]-a[3]);return c+e}function w(a,b,c,e){var k=a.length;e=e?"offset":"position";for(c=c||0;k--;){var g=a[k].el?a[k].el:d(a[k]),l=g[e]();l.left+=parseInt(g.css("margin-left"),10);l.top+=parseInt(g.css("margin-top"),10);b[k]=[l.left-c,l.left+g.outerWidth()+c,l.top-c,l.top+g.outerHeight()+c]}}function p(a,b){var c=b.offset();return{left:a.left-c.left,top:a.top-c.top}}function x(a,b,c){b=[b.left,b.top];c= |
||||
c&&[c.left,c.top];for(var e,k=a.length,d=[];k--;)e=a[k],d[k]=[k,v(e,b),c&&v(e,c)];return d=d.sort(function(a,b){return b[1]-a[1]||b[2]-a[2]||b[0]-a[0]})}function q(a){this.options=d.extend({},n,a);this.containers=[];this.options.rootGroup||(this.scrollProxy=d.proxy(this.scroll,this),this.dragProxy=d.proxy(this.drag,this),this.dropProxy=d.proxy(this.drop,this),this.placeholder=d(this.options.placeholder),a.isValidTarget||(this.options.isValidTarget=f))}function s(a,b){this.el=a;this.options=d.extend({}, |
||||
z,b);this.group=q.get(this.options);this.rootGroup=this.options.rootGroup||this.group;this.handle=this.rootGroup.options.handle||this.rootGroup.options.itemSelector;var c=this.rootGroup.options.itemPath;this.target=c?this.el.find(c):this.el;this.target.on(t.start,this.handle,d.proxy(this.dragInit,this));this.options.drop&&this.group.containers.push(this)}var z={drag:!0,drop:!0,exclude:"",nested:!0,vertical:!0},n={afterMove:function(a,b,c){},containerPath:"",containerSelector:"ol, ul",distance:0,delay:0, |
||||
handle:"",itemPath:"",itemSelector:"li",bodyClass:"dragging",draggedClass:"dragged",isValidTarget:function(a,b){return!0},onCancel:function(a,b,c,e){},onDrag:function(a,b,c,e){a.css(b)},onDragStart:function(a,b,c,e){a.css({height:a.outerHeight(),width:a.outerWidth()});a.addClass(b.group.options.draggedClass);d("body").addClass(b.group.options.bodyClass)},onDrop:function(a,b,c,e){a.removeClass(b.group.options.draggedClass).removeAttr("style");d("body").removeClass(b.group.options.bodyClass)},onMousedown:function(a, |
||||
b,c){if(!c.target.nodeName.match(/^(input|select|textarea)$/i))return c.preventDefault(),!0},placeholderClass:"placeholder",placeholder:'<li class="placeholder"></li>',pullPlaceholder:!0,serialize:function(a,b,c){a=d.extend({},a.data());if(c)return[b];b[0]&&(a.children=b);delete a.subContainers;delete a.sortable;return a},tolerance:0},r={},y=0,A={left:0,top:0,bottom:0,right:0},t={start:"touchstart.sortable mousedown.sortable",drop:"touchend.sortable touchcancel.sortable mouseup.sortable",drag:"touchmove.sortable mousemove.sortable", |
||||
scroll:"scroll.sortable"};q.get=function(a){r[a.group]||(a.group===f&&(a.group=y++),r[a.group]=new q(a));return r[a.group]};q.prototype={dragInit:function(a,b){this.$document=d(b.el[0].ownerDocument);var c=d(a.target).closest(this.options.itemSelector);c.length&&(this.item=c,this.itemContainer=b,!this.item.is(this.options.exclude)&&this.options.onMousedown(this.item,n.onMousedown,a)&&(this.setPointer(a),this.toggleListeners("on"),this.setupDelayTimer(),this.dragInitDone=!0))},drag:function(a){if(!this.dragging){if(!this.distanceMet(a)|| |
||||
!this.delayMet)return;this.options.onDragStart(this.item,this.itemContainer,n.onDragStart,a);this.item.before(this.placeholder);this.dragging=!0}this.setPointer(a);this.options.onDrag(this.item,p(this.pointer,this.item.offsetParent()),n.onDrag,a);a=this.getPointer(a);var b=this.sameResultBox,c=this.options.tolerance;(!b||b.top-c>a.top||b.bottom+c<a.top||b.left-c>a.left||b.right+c<a.left)&&!this.searchValidTarget()&&(this.placeholder.detach(),this.lastAppendedItem=f)},drop:function(a){this.toggleListeners("off"); |
||||
this.dragInitDone=!1;if(this.dragging){if(this.placeholder.closest("html")[0])this.placeholder.before(this.item).detach();else this.options.onCancel(this.item,this.itemContainer,n.onCancel,a);this.options.onDrop(this.item,this.getContainer(this.item),n.onDrop,a);this.clearDimensions();this.clearOffsetParent();this.lastAppendedItem=this.sameResultBox=f;this.dragging=!1}},searchValidTarget:function(a,b){a||(a=this.relativePointer||this.pointer,b=this.lastRelativePointer||this.lastPointer);for(var c= |
||||
x(this.getContainerDimensions(),a,b),e=c.length;e--;){var d=c[e][0];if(!c[e][1]||this.options.pullPlaceholder)if(d=this.containers[d],!d.disabled){if(!this.$getOffsetParent()){var g=d.getItemOffsetParent();a=p(a,g);b=p(b,g)}if(d.searchValidTarget(a,b))return!0}}this.sameResultBox&&(this.sameResultBox=f)},movePlaceholder:function(a,b,c,e){var d=this.lastAppendedItem;if(e||!d||d[0]!==b[0])b[c](this.placeholder),this.lastAppendedItem=b,this.sameResultBox=e,this.options.afterMove(this.placeholder,a,b)}, |
||||
getContainerDimensions:function(){this.containerDimensions||w(this.containers,this.containerDimensions=[],this.options.tolerance,!this.$getOffsetParent());return this.containerDimensions},getContainer:function(a){return a.closest(this.options.containerSelector).data(m)},$getOffsetParent:function(){if(this.offsetParent===f){var a=this.containers.length-1,b=this.containers[a].getItemOffsetParent();if(!this.options.rootGroup)for(;a--;)if(b[0]!=this.containers[a].getItemOffsetParent()[0]){b=!1;break}this.offsetParent= |
||||
b}return this.offsetParent},setPointer:function(a){a=this.getPointer(a);if(this.$getOffsetParent()){var b=p(a,this.$getOffsetParent());this.lastRelativePointer=this.relativePointer;this.relativePointer=b}this.lastPointer=this.pointer;this.pointer=a},distanceMet:function(a){a=this.getPointer(a);return Math.max(Math.abs(this.pointer.left-a.left),Math.abs(this.pointer.top-a.top))>=this.options.distance},getPointer:function(a){var b=a.originalEvent||a.originalEvent.touches&&a.originalEvent.touches[0]; |
||||
return{left:a.pageX||b.pageX,top:a.pageY||b.pageY}},setupDelayTimer:function(){var a=this;this.delayMet=!this.options.delay;this.delayMet||(clearTimeout(this._mouseDelayTimer),this._mouseDelayTimer=setTimeout(function(){a.delayMet=!0},this.options.delay))},scroll:function(a){this.clearDimensions();this.clearOffsetParent()},toggleListeners:function(a){var b=this;d.each(["drag","drop","scroll"],function(c,e){b.$document[a](t[e],b[e+"Proxy"])})},clearOffsetParent:function(){this.offsetParent=f},clearDimensions:function(){this.traverse(function(a){a._clearDimensions()})}, |
||||
traverse:function(a){a(this);for(var b=this.containers.length;b--;)this.containers[b].traverse(a)},_clearDimensions:function(){this.containerDimensions=f},_destroy:function(){r[this.options.group]=f}};s.prototype={dragInit:function(a){var b=this.rootGroup;!this.disabled&&!b.dragInitDone&&this.options.drag&&this.isValidDrag(a)&&b.dragInit(a,this)},isValidDrag:function(a){return 1==a.which||"touchstart"==a.type&&1==a.originalEvent.touches.length},searchValidTarget:function(a,b){var c=x(this.getItemDimensions(), |
||||
a,b),e=c.length,d=this.rootGroup,g=!d.options.isValidTarget||d.options.isValidTarget(d.item,this);if(!e&&g)return d.movePlaceholder(this,this.target,"append"),!0;for(;e--;)if(d=c[e][0],!c[e][1]&&this.hasChildGroup(d)){if(this.getContainerGroup(d).searchValidTarget(a,b))return!0}else if(g)return this.movePlaceholder(d,a),!0},movePlaceholder:function(a,b){var c=d(this.items[a]),e=this.itemDimensions[a],k="after",g=c.outerWidth(),f=c.outerHeight(),h=c.offset(),h={left:h.left,right:h.left+g,top:h.top, |
||||
bottom:h.top+f};this.options.vertical?b.top<=(e[2]+e[3])/2?(k="before",h.bottom-=f/2):h.top+=f/2:b.left<=(e[0]+e[1])/2?(k="before",h.right-=g/2):h.left+=g/2;this.hasChildGroup(a)&&(h=A);this.rootGroup.movePlaceholder(this,c,k,h)},getItemDimensions:function(){this.itemDimensions||(this.items=this.$getChildren(this.el,"item").filter(":not(."+this.group.options.placeholderClass+", ."+this.group.options.draggedClass+")").get(),w(this.items,this.itemDimensions=[],this.options.tolerance));return this.itemDimensions}, |
||||
getItemOffsetParent:function(){var a=this.el;return"relative"===a.css("position")||"absolute"===a.css("position")||"fixed"===a.css("position")?a:a.offsetParent()},hasChildGroup:function(a){return this.options.nested&&this.getContainerGroup(a)},getContainerGroup:function(a){var b=d.data(this.items[a],"subContainers");if(b===f){var c=this.$getChildren(this.items[a],"container"),b=!1;c[0]&&(b=d.extend({},this.options,{rootGroup:this.rootGroup,group:y++}),b=c[m](b).data(m).group);d.data(this.items[a], |
||||
"subContainers",b)}return b},$getChildren:function(a,b){var c=this.rootGroup.options,e=c[b+"Path"],c=c[b+"Selector"];a=d(a);e&&(a=a.find(e));return a.children(c)},_serialize:function(a,b){var c=this,e=this.$getChildren(a,b?"item":"container").not(this.options.exclude).map(function(){return c._serialize(d(this),!b)}).get();return this.rootGroup.options.serialize(a,e,b)},traverse:function(a){d.each(this.items||[],function(b){(b=d.data(this,"subContainers"))&&b.traverse(a)});a(this)},_clearDimensions:function(){this.itemDimensions= |
||||
f},_destroy:function(){var a=this;this.target.off(t.start,this.handle);this.el.removeData(m);this.options.drop&&(this.group.containers=d.grep(this.group.containers,function(b){return b!=a}));d.each(this.items||[],function(){d.removeData(this,"subContainers")})}};var u={enable:function(){this.traverse(function(a){a.disabled=!1})},disable:function(){this.traverse(function(a){a.disabled=!0})},serialize:function(){return this._serialize(this.el,!0)},refresh:function(){this.traverse(function(a){a._clearDimensions()})}, |
||||
destroy:function(){this.traverse(function(a){a._destroy()})}};d.extend(s.prototype,u);d.fn[m]=function(a){var b=Array.prototype.slice.call(arguments,1);return this.map(function(){var c=d(this),e=c.data(m);if(e&&u[a])return u[a].apply(e,b)||this;e||a!==f&&"object"!==typeof a||c.data(m,new s(c,a));return this})}}(jQuery,window,"sortable"); |
||||
@ -0,0 +1,693 @@ |
||||
/* =================================================== |
||||
* jquery-sortable.js v0.9.13 |
||||
* http://johnny.github.com/jquery-sortable/
|
||||
* =================================================== |
||||
* Copyright (c) 2012 Jonas von Andrian |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* * The name of the author may not be used to endorse or promote products |
||||
* derived from this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY |
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* ========================================================== */ |
||||
|
||||
|
||||
!function ( $, window, pluginName, undefined){ |
||||
var containerDefaults = { |
||||
// If true, items can be dragged from this container
|
||||
drag: true, |
||||
// If true, items can be droped onto this container
|
||||
drop: true, |
||||
// Exclude items from being draggable, if the
|
||||
// selector matches the item
|
||||
exclude: "", |
||||
// If true, search for nested containers within an item.If you nest containers,
|
||||
// either the original selector with which you call the plugin must only match the top containers,
|
||||
// or you need to specify a group (see the bootstrap nav example)
|
||||
nested: true, |
||||
// If true, the items are assumed to be arranged vertically
|
||||
vertical: true |
||||
}, // end container defaults
|
||||
groupDefaults = { |
||||
// This is executed after the placeholder has been moved.
|
||||
// $closestItemOrContainer contains the closest item, the placeholder
|
||||
// has been put at or the closest empty Container, the placeholder has
|
||||
// been appended to.
|
||||
afterMove: function ($placeholder, container, $closestItemOrContainer) { |
||||
}, |
||||
// The exact css path between the container and its items, e.g. "> tbody"
|
||||
containerPath: "", |
||||
// The css selector of the containers
|
||||
containerSelector: "ol, ul", |
||||
// Distance the mouse has to travel to start dragging
|
||||
distance: 0, |
||||
// Time in milliseconds after mousedown until dragging should start.
|
||||
// This option can be used to prevent unwanted drags when clicking on an element.
|
||||
delay: 0, |
||||
// The css selector of the drag handle
|
||||
handle: "", |
||||
// The exact css path between the item and its subcontainers.
|
||||
// It should only match the immediate items of a container.
|
||||
// No item of a subcontainer should be matched. E.g. for ol>div>li the itemPath is "> div"
|
||||
itemPath: "", |
||||
// The css selector of the items
|
||||
itemSelector: "li", |
||||
// The class given to "body" while an item is being dragged
|
||||
bodyClass: "dragging", |
||||
// The class giving to an item while being dragged
|
||||
draggedClass: "dragged", |
||||
// Check if the dragged item may be inside the container.
|
||||
// Use with care, since the search for a valid container entails a depth first search
|
||||
// and may be quite expensive.
|
||||
isValidTarget: function ($item, container) { |
||||
return true |
||||
}, |
||||
// Executed before onDrop if placeholder is detached.
|
||||
// This happens if pullPlaceholder is set to false and the drop occurs outside a container.
|
||||
onCancel: function ($item, container, _super, event) { |
||||
}, |
||||
// Executed at the beginning of a mouse move event.
|
||||
// The Placeholder has not been moved yet.
|
||||
onDrag: function ($item, position, _super, event) { |
||||
$item.css(position) |
||||
}, |
||||
// Called after the drag has been started,
|
||||
// that is the mouse button is being held down and
|
||||
// the mouse is moving.
|
||||
// The container is the closest initialized container.
|
||||
// Therefore it might not be the container, that actually contains the item.
|
||||
onDragStart: function ($item, container, _super, event) { |
||||
$item.css({ |
||||
height: $item.outerHeight(), |
||||
width: $item.outerWidth() |
||||
}) |
||||
$item.addClass(container.group.options.draggedClass) |
||||
$("body").addClass(container.group.options.bodyClass) |
||||
}, |
||||
// Called when the mouse button is being released
|
||||
onDrop: function ($item, container, _super, event) { |
||||
$item.removeClass(container.group.options.draggedClass).removeAttr("style") |
||||
$("body").removeClass(container.group.options.bodyClass) |
||||
}, |
||||
// Called on mousedown. If falsy value is returned, the dragging will not start.
|
||||
// Ignore if element clicked is input, select or textarea
|
||||
onMousedown: function ($item, _super, event) { |
||||
if (!event.target.nodeName.match(/^(input|select|textarea)$/i)) { |
||||
event.preventDefault() |
||||
return true |
||||
} |
||||
}, |
||||
// The class of the placeholder (must match placeholder option markup)
|
||||
placeholderClass: "placeholder", |
||||
// Template for the placeholder. Can be any valid jQuery input
|
||||
// e.g. a string, a DOM element.
|
||||
// The placeholder must have the class "placeholder"
|
||||
placeholder: '<li class="placeholder"></li>', |
||||
// If true, the position of the placeholder is calculated on every mousemove.
|
||||
// If false, it is only calculated when the mouse is above a container.
|
||||
pullPlaceholder: true, |
||||
// Specifies serialization of the container group.
|
||||
// The pair $parent/$children is either container/items or item/subcontainers.
|
||||
serialize: function ($parent, $children, parentIsContainer) { |
||||
var result = $.extend({}, $parent.data()) |
||||
|
||||
if(parentIsContainer) |
||||
return [$children] |
||||
else if ($children[0]){ |
||||
result.children = $children |
||||
} |
||||
|
||||
delete result.subContainers |
||||
delete result.sortable |
||||
|
||||
return result |
||||
}, |
||||
// Set tolerance while dragging. Positive values decrease sensitivity,
|
||||
// negative values increase it.
|
||||
tolerance: 0 |
||||
}, // end group defaults
|
||||
containerGroups = {}, |
||||
groupCounter = 0, |
||||
emptyBox = { |
||||
left: 0, |
||||
top: 0, |
||||
bottom: 0, |
||||
right:0 |
||||
}, |
||||
eventNames = { |
||||
start: "touchstart.sortable mousedown.sortable", |
||||
drop: "touchend.sortable touchcancel.sortable mouseup.sortable", |
||||
drag: "touchmove.sortable mousemove.sortable", |
||||
scroll: "scroll.sortable" |
||||
}, |
||||
subContainerKey = "subContainers" |
||||
|
||||
/* |
||||
* a is Array [left, right, top, bottom] |
||||
* b is array [left, top] |
||||
*/ |
||||
function d(a,b) { |
||||
var x = Math.max(0, a[0] - b[0], b[0] - a[1]), |
||||
y = Math.max(0, a[2] - b[1], b[1] - a[3]) |
||||
return x+y; |
||||
} |
||||
|
||||
function setDimensions(array, dimensions, tolerance, useOffset) { |
||||
var i = array.length, |
||||
offsetMethod = useOffset ? "offset" : "position" |
||||
tolerance = tolerance || 0 |
||||
|
||||
while(i--){ |
||||
var el = array[i].el ? array[i].el : $(array[i]), |
||||
// use fitting method
|
||||
pos = el[offsetMethod]() |
||||
pos.left += parseInt(el.css('margin-left'), 10) |
||||
pos.top += parseInt(el.css('margin-top'),10) |
||||
dimensions[i] = [ |
||||
pos.left - tolerance, |
||||
pos.left + el.outerWidth() + tolerance, |
||||
pos.top - tolerance, |
||||
pos.top + el.outerHeight() + tolerance |
||||
] |
||||
} |
||||
} |
||||
|
||||
function getRelativePosition(pointer, element) { |
||||
var offset = element.offset() |
||||
return { |
||||
left: pointer.left - offset.left, |
||||
top: pointer.top - offset.top |
||||
} |
||||
} |
||||
|
||||
function sortByDistanceDesc(dimensions, pointer, lastPointer) { |
||||
pointer = [pointer.left, pointer.top] |
||||
lastPointer = lastPointer && [lastPointer.left, lastPointer.top] |
||||
|
||||
var dim, |
||||
i = dimensions.length, |
||||
distances = [] |
||||
|
||||
while(i--){ |
||||
dim = dimensions[i] |
||||
distances[i] = [i,d(dim,pointer), lastPointer && d(dim, lastPointer)] |
||||
} |
||||
distances = distances.sort(function (a,b) { |
||||
return b[1] - a[1] || b[2] - a[2] || b[0] - a[0] |
||||
}) |
||||
|
||||
// last entry is the closest
|
||||
return distances |
||||
} |
||||
|
||||
function ContainerGroup(options) { |
||||
this.options = $.extend({}, groupDefaults, options) |
||||
this.containers = [] |
||||
|
||||
if(!this.options.rootGroup){ |
||||
this.scrollProxy = $.proxy(this.scroll, this) |
||||
this.dragProxy = $.proxy(this.drag, this) |
||||
this.dropProxy = $.proxy(this.drop, this) |
||||
this.placeholder = $(this.options.placeholder) |
||||
|
||||
if(!options.isValidTarget) |
||||
this.options.isValidTarget = undefined |
||||
} |
||||
} |
||||
|
||||
ContainerGroup.get = function (options) { |
||||
if(!containerGroups[options.group]) { |
||||
if(options.group === undefined) |
||||
options.group = groupCounter ++ |
||||
|
||||
containerGroups[options.group] = new ContainerGroup(options) |
||||
} |
||||
|
||||
return containerGroups[options.group] |
||||
} |
||||
|
||||
ContainerGroup.prototype = { |
||||
dragInit: function (e, itemContainer) { |
||||
this.$document = $(itemContainer.el[0].ownerDocument) |
||||
|
||||
// get item to drag
|
||||
var closestItem = $(e.target).closest(this.options.itemSelector); |
||||
// using the length of this item, prevents the plugin from being started if there is no handle being clicked on.
|
||||
// this may also be helpful in instantiating multidrag.
|
||||
if (closestItem.length) { |
||||
this.item = closestItem; |
||||
this.itemContainer = itemContainer; |
||||
if (this.item.is(this.options.exclude) || !this.options.onMousedown(this.item, groupDefaults.onMousedown, e)) { |
||||
return; |
||||
} |
||||
this.setPointer(e); |
||||
this.toggleListeners('on'); |
||||
this.setupDelayTimer(); |
||||
this.dragInitDone = true; |
||||
} |
||||
}, |
||||
drag: function (e) { |
||||
if(!this.dragging){ |
||||
if(!this.distanceMet(e) || !this.delayMet) |
||||
return |
||||
|
||||
this.options.onDragStart(this.item, this.itemContainer, groupDefaults.onDragStart, e) |
||||
this.item.before(this.placeholder) |
||||
this.dragging = true |
||||
} |
||||
|
||||
this.setPointer(e) |
||||
// place item under the cursor
|
||||
this.options.onDrag(this.item, |
||||
getRelativePosition(this.pointer, this.item.offsetParent()), |
||||
groupDefaults.onDrag, |
||||
e) |
||||
|
||||
var p = this.getPointer(e), |
||||
box = this.sameResultBox, |
||||
t = this.options.tolerance |
||||
|
||||
if(!box || box.top - t > p.top || box.bottom + t < p.top || box.left - t > p.left || box.right + t < p.left) |
||||
if(!this.searchValidTarget()){ |
||||
this.placeholder.detach() |
||||
this.lastAppendedItem = undefined |
||||
} |
||||
}, |
||||
drop: function (e) { |
||||
this.toggleListeners('off') |
||||
|
||||
this.dragInitDone = false |
||||
|
||||
if(this.dragging){ |
||||
// processing Drop, check if placeholder is detached
|
||||
if(this.placeholder.closest("html")[0]){ |
||||
this.placeholder.before(this.item).detach() |
||||
} else { |
||||
this.options.onCancel(this.item, this.itemContainer, groupDefaults.onCancel, e) |
||||
} |
||||
this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e) |
||||
|
||||
// cleanup
|
||||
this.clearDimensions() |
||||
this.clearOffsetParent() |
||||
this.lastAppendedItem = this.sameResultBox = undefined |
||||
this.dragging = false |
||||
} |
||||
}, |
||||
searchValidTarget: function (pointer, lastPointer) { |
||||
if(!pointer){ |
||||
pointer = this.relativePointer || this.pointer |
||||
lastPointer = this.lastRelativePointer || this.lastPointer |
||||
} |
||||
|
||||
var distances = sortByDistanceDesc(this.getContainerDimensions(), |
||||
pointer, |
||||
lastPointer), |
||||
i = distances.length |
||||
|
||||
while(i--){ |
||||
var index = distances[i][0], |
||||
distance = distances[i][1] |
||||
|
||||
if(!distance || this.options.pullPlaceholder){ |
||||
var container = this.containers[index] |
||||
if(!container.disabled){ |
||||
if(!this.$getOffsetParent()){ |
||||
var offsetParent = container.getItemOffsetParent() |
||||
pointer = getRelativePosition(pointer, offsetParent) |
||||
lastPointer = getRelativePosition(lastPointer, offsetParent) |
||||
} |
||||
if(container.searchValidTarget(pointer, lastPointer)) |
||||
return true |
||||
} |
||||
} |
||||
} |
||||
if(this.sameResultBox) |
||||
this.sameResultBox = undefined |
||||
}, |
||||
movePlaceholder: function (container, item, method, sameResultBox) { |
||||
var lastAppendedItem = this.lastAppendedItem |
||||
if(!sameResultBox && lastAppendedItem && lastAppendedItem[0] === item[0]) |
||||
return; |
||||
|
||||
item[method](this.placeholder) |
||||
this.lastAppendedItem = item |
||||
this.sameResultBox = sameResultBox |
||||
this.options.afterMove(this.placeholder, container, item) |
||||
}, |
||||
getContainerDimensions: function () { |
||||
if(!this.containerDimensions) |
||||
setDimensions(this.containers, this.containerDimensions = [], this.options.tolerance, !this.$getOffsetParent()) |
||||
return this.containerDimensions |
||||
}, |
||||
getContainer: function (element) { |
||||
return element.closest(this.options.containerSelector).data(pluginName) |
||||
}, |
||||
$getOffsetParent: function () { |
||||
if(this.offsetParent === undefined){ |
||||
var i = this.containers.length - 1, |
||||
offsetParent = this.containers[i].getItemOffsetParent() |
||||
|
||||
if(!this.options.rootGroup){ |
||||
while(i--){ |
||||
if(offsetParent[0] != this.containers[i].getItemOffsetParent()[0]){ |
||||
// If every container has the same offset parent,
|
||||
// use position() which is relative to this parent,
|
||||
// otherwise use offset()
|
||||
// compare #setDimensions
|
||||
offsetParent = false |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
this.offsetParent = offsetParent |
||||
} |
||||
return this.offsetParent |
||||
}, |
||||
setPointer: function (e) { |
||||
var pointer = this.getPointer(e) |
||||
|
||||
if(this.$getOffsetParent()){ |
||||
var relativePointer = getRelativePosition(pointer, this.$getOffsetParent()) |
||||
this.lastRelativePointer = this.relativePointer |
||||
this.relativePointer = relativePointer |
||||
} |
||||
|
||||
this.lastPointer = this.pointer |
||||
this.pointer = pointer |
||||
}, |
||||
distanceMet: function (e) { |
||||
var currentPointer = this.getPointer(e) |
||||
return (Math.max( |
||||
Math.abs(this.pointer.left - currentPointer.left), |
||||
Math.abs(this.pointer.top - currentPointer.top) |
||||
) >= this.options.distance) |
||||
}, |
||||
getPointer: function(e) { |
||||
var o = e.originalEvent || e.originalEvent.touches && e.originalEvent.touches[0] |
||||
return { |
||||
left: e.pageX || o.pageX, |
||||
top: e.pageY || o.pageY |
||||
} |
||||
}, |
||||
setupDelayTimer: function () { |
||||
var that = this |
||||
this.delayMet = !this.options.delay |
||||
|
||||
// init delay timer if needed
|
||||
if (!this.delayMet) { |
||||
clearTimeout(this._mouseDelayTimer); |
||||
this._mouseDelayTimer = setTimeout(function() { |
||||
that.delayMet = true |
||||
}, this.options.delay) |
||||
} |
||||
}, |
||||
scroll: function (e) { |
||||
this.clearDimensions() |
||||
this.clearOffsetParent() // TODO is this needed?
|
||||
}, |
||||
toggleListeners: function (method) { |
||||
var that = this, |
||||
events = ['drag','drop','scroll'] |
||||
|
||||
$.each(events,function (i,event) { |
||||
that.$document[method](eventNames[event], that[event + 'Proxy']) |
||||
}) |
||||
}, |
||||
clearOffsetParent: function () { |
||||
this.offsetParent = undefined |
||||
}, |
||||
// Recursively clear container and item dimensions
|
||||
clearDimensions: function () { |
||||
this.traverse(function(object){ |
||||
object._clearDimensions() |
||||
}) |
||||
}, |
||||
traverse: function(callback) { |
||||
callback(this) |
||||
var i = this.containers.length |
||||
while(i--){ |
||||
this.containers[i].traverse(callback) |
||||
} |
||||
}, |
||||
_clearDimensions: function(){ |
||||
this.containerDimensions = undefined |
||||
}, |
||||
_destroy: function () { |
||||
containerGroups[this.options.group] = undefined |
||||
} |
||||
} |
||||
|
||||
function Container(element, options) { |
||||
this.el = element |
||||
this.options = $.extend( {}, containerDefaults, options) |
||||
|
||||
this.group = ContainerGroup.get(this.options) |
||||
this.rootGroup = this.options.rootGroup || this.group |
||||
this.handle = this.rootGroup.options.handle || this.rootGroup.options.itemSelector |
||||
|
||||
var itemPath = this.rootGroup.options.itemPath |
||||
this.target = itemPath ? this.el.find(itemPath) : this.el |
||||
|
||||
this.target.on(eventNames.start, this.handle, $.proxy(this.dragInit, this)) |
||||
|
||||
if(this.options.drop) |
||||
this.group.containers.push(this) |
||||
} |
||||
|
||||
Container.prototype = { |
||||
dragInit: function (e) { |
||||
var rootGroup = this.rootGroup |
||||
|
||||
if( !this.disabled && |
||||
!rootGroup.dragInitDone && |
||||
this.options.drag && |
||||
this.isValidDrag(e)) { |
||||
rootGroup.dragInit(e, this) |
||||
} |
||||
}, |
||||
isValidDrag: function(e) { |
||||
return e.which == 1 || |
||||
e.type == "touchstart" && e.originalEvent.touches.length == 1 |
||||
}, |
||||
searchValidTarget: function (pointer, lastPointer) { |
||||
var distances = sortByDistanceDesc(this.getItemDimensions(), |
||||
pointer, |
||||
lastPointer), |
||||
i = distances.length, |
||||
rootGroup = this.rootGroup, |
||||
validTarget = !rootGroup.options.isValidTarget || |
||||
rootGroup.options.isValidTarget(rootGroup.item, this) |
||||
|
||||
if(!i && validTarget){ |
||||
rootGroup.movePlaceholder(this, this.target, "append") |
||||
return true |
||||
} else |
||||
while(i--){ |
||||
var index = distances[i][0], |
||||
distance = distances[i][1] |
||||
if(!distance && this.hasChildGroup(index)){ |
||||
var found = this.getContainerGroup(index).searchValidTarget(pointer, lastPointer) |
||||
if(found) |
||||
return true |
||||
} |
||||
else if(validTarget){ |
||||
this.movePlaceholder(index, pointer) |
||||
return true |
||||
} |
||||
} |
||||
}, |
||||
movePlaceholder: function (index, pointer) { |
||||
var item = $(this.items[index]), |
||||
dim = this.itemDimensions[index], |
||||
method = "after", |
||||
width = item.outerWidth(), |
||||
height = item.outerHeight(), |
||||
offset = item.offset(), |
||||
sameResultBox = { |
||||
left: offset.left, |
||||
right: offset.left + width, |
||||
top: offset.top, |
||||
bottom: offset.top + height |
||||
} |
||||
if(this.options.vertical){ |
||||
var yCenter = (dim[2] + dim[3]) / 2, |
||||
inUpperHalf = pointer.top <= yCenter |
||||
if(inUpperHalf){ |
||||
method = "before" |
||||
sameResultBox.bottom -= height / 2 |
||||
} else |
||||
sameResultBox.top += height / 2 |
||||
} else { |
||||
var xCenter = (dim[0] + dim[1]) / 2, |
||||
inLeftHalf = pointer.left <= xCenter |
||||
if(inLeftHalf){ |
||||
method = "before" |
||||
sameResultBox.right -= width / 2 |
||||
} else |
||||
sameResultBox.left += width / 2 |
||||
} |
||||
if(this.hasChildGroup(index)) |
||||
sameResultBox = emptyBox |
||||
this.rootGroup.movePlaceholder(this, item, method, sameResultBox) |
||||
}, |
||||
getItemDimensions: function () { |
||||
if(!this.itemDimensions){ |
||||
this.items = this.$getChildren(this.el, "item").filter( |
||||
":not(." + this.group.options.placeholderClass + ", ." + this.group.options.draggedClass + ")" |
||||
).get() |
||||
setDimensions(this.items, this.itemDimensions = [], this.options.tolerance) |
||||
} |
||||
return this.itemDimensions |
||||
}, |
||||
getItemOffsetParent: function () { |
||||
var offsetParent, |
||||
el = this.el |
||||
// Since el might be empty we have to check el itself and
|
||||
// can not do something like el.children().first().offsetParent()
|
||||
if(el.css("position") === "relative" || el.css("position") === "absolute" || el.css("position") === "fixed") |
||||
offsetParent = el |
||||
else |
||||
offsetParent = el.offsetParent() |
||||
return offsetParent |
||||
}, |
||||
hasChildGroup: function (index) { |
||||
return this.options.nested && this.getContainerGroup(index) |
||||
}, |
||||
getContainerGroup: function (index) { |
||||
var childGroup = $.data(this.items[index], subContainerKey) |
||||
if( childGroup === undefined){ |
||||
var childContainers = this.$getChildren(this.items[index], "container") |
||||
childGroup = false |
||||
|
||||
if(childContainers[0]){ |
||||
var options = $.extend({}, this.options, { |
||||
rootGroup: this.rootGroup, |
||||
group: groupCounter ++ |
||||
}) |
||||
childGroup = childContainers[pluginName](options).data(pluginName).group |
||||
} |
||||
$.data(this.items[index], subContainerKey, childGroup) |
||||
} |
||||
return childGroup |
||||
}, |
||||
$getChildren: function (parent, type) { |
||||
var options = this.rootGroup.options, |
||||
path = options[type + "Path"], |
||||
selector = options[type + "Selector"] |
||||
|
||||
parent = $(parent) |
||||
if(path) |
||||
parent = parent.find(path) |
||||
|
||||
return parent.children(selector) |
||||
}, |
||||
_serialize: function (parent, isContainer) { |
||||
var that = this, |
||||
childType = isContainer ? "item" : "container", |
||||
|
||||
children = this.$getChildren(parent, childType).not(this.options.exclude).map(function () { |
||||
return that._serialize($(this), !isContainer) |
||||
}).get() |
||||
|
||||
return this.rootGroup.options.serialize(parent, children, isContainer) |
||||
}, |
||||
traverse: function(callback) { |
||||
$.each(this.items || [], function(item){ |
||||
var group = $.data(this, subContainerKey) |
||||
if(group) |
||||
group.traverse(callback) |
||||
}); |
||||
|
||||
callback(this) |
||||
}, |
||||
_clearDimensions: function () { |
||||
this.itemDimensions = undefined |
||||
}, |
||||
_destroy: function() { |
||||
var that = this; |
||||
|
||||
this.target.off(eventNames.start, this.handle); |
||||
this.el.removeData(pluginName) |
||||
|
||||
if(this.options.drop) |
||||
this.group.containers = $.grep(this.group.containers, function(val){ |
||||
return val != that |
||||
}) |
||||
|
||||
$.each(this.items || [], function(){ |
||||
$.removeData(this, subContainerKey) |
||||
}) |
||||
} |
||||
} |
||||
|
||||
var API = { |
||||
enable: function() { |
||||
this.traverse(function(object){ |
||||
object.disabled = false |
||||
}) |
||||
}, |
||||
disable: function (){ |
||||
this.traverse(function(object){ |
||||
object.disabled = true |
||||
}) |
||||
}, |
||||
serialize: function () { |
||||
return this._serialize(this.el, true) |
||||
}, |
||||
refresh: function() { |
||||
this.traverse(function(object){ |
||||
object._clearDimensions() |
||||
}) |
||||
}, |
||||
destroy: function () { |
||||
this.traverse(function(object){ |
||||
object._destroy(); |
||||
}) |
||||
} |
||||
} |
||||
|
||||
$.extend(Container.prototype, API) |
||||
|
||||
/** |
||||
* jQuery API |
||||
* |
||||
* Parameters are |
||||
* either options on init |
||||
* or a method name followed by arguments to pass to the method |
||||
*/ |
||||
$.fn[pluginName] = function(methodOrOptions) { |
||||
var args = Array.prototype.slice.call(arguments, 1) |
||||
|
||||
return this.map(function(){ |
||||
var $t = $(this), |
||||
object = $t.data(pluginName) |
||||
|
||||
if(object && API[methodOrOptions]) |
||||
return API[methodOrOptions].apply(object, args) || this |
||||
else if(!object && (methodOrOptions === undefined || |
||||
typeof methodOrOptions === "object")) |
||||
$t.data(pluginName, new Container($t, methodOrOptions)) |
||||
|
||||
return this |
||||
}); |
||||
}; |
||||
|
||||
}(jQuery, window, 'sortable'); |
||||
@ -0,0 +1,15 @@ |
||||
// jQuery Mask Plugin v1.14.0
|
||||
// github.com/igorescobar/jQuery-Mask-Plugin
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?module.exports=b(require("jquery")):b(jQuery||Zepto)})(function(b){var y=function(a,e,d){var c={invalid:[],getCaret:function(){try{var r,b=0,e=a.get(0),d=document.selection,f=e.selectionStart;if(d&&-1===navigator.appVersion.indexOf("MSIE 10"))r=d.createRange(),r.moveStart("character",-c.val().length),b=r.text.length;else if(f||"0"===f)b=f;return b}catch(g){}},setCaret:function(r){try{if(a.is(":focus")){var c, |
||||
b=a.get(0);b.setSelectionRange?(b.focus(),b.setSelectionRange(r,r)):(c=b.createTextRange(),c.collapse(!0),c.moveEnd("character",r),c.moveStart("character",r),c.select())}}catch(e){}},events:function(){a.on("keydown.mask",function(c){a.data("mask-keycode",c.keyCode||c.which)}).on(b.jMaskGlobals.useInput?"input.mask":"keyup.mask",c.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){a.keydown().keyup()},100)}).on("change.mask",function(){a.data("changed",!0)}).on("blur.mask",function(){n=== |
||||
c.val()||a.data("changed")||a.trigger("change");a.data("changed",!1)}).on("blur.mask",function(){n=c.val()}).on("focus.mask",function(a){!0===d.selectOnFocus&&b(a.target).select()}).on("focusout.mask",function(){d.clearIfNotMatch&&!p.test(c.val())&&c.val("")})},getRegexMask:function(){for(var a=[],c,b,d,f,l=0;l<e.length;l++)(c=g.translation[e.charAt(l)])?(b=c.pattern.toString().replace(/.{1}$|^.{1}/g,""),d=c.optional,(c=c.recursive)?(a.push(e.charAt(l)),f={digit:e.charAt(l),pattern:b}):a.push(d|| |
||||
c?b+"?":b)):a.push(e.charAt(l).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));a=a.join("");f&&(a=a.replace(new RegExp("("+f.digit+"(.*"+f.digit+")?)"),"($1)?").replace(new RegExp(f.digit,"g"),f.pattern));return new RegExp(a)},destroyEvents:function(){a.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(c){var b=a.is("input")?"val":"text";if(0<arguments.length){if(a[b]()!==c)a[b](c);b=a}else b=a[b]();return b},getMCharsBeforeCount:function(a,c){for(var b=0,d=0, |
||||
f=e.length;d<f&&d<a;d++)g.translation[e.charAt(d)]||(a=c?a+1:a,b++);return b},caretPos:function(a,b,d,h){return g.translation[e.charAt(Math.min(a-1,e.length-1))]?Math.min(a+d-b-h,d):c.caretPos(a+1,b,d,h)},behaviour:function(d){d=d||window.event;c.invalid=[];var e=a.data("mask-keycode");if(-1===b.inArray(e,g.byPassKeys)){var m=c.getCaret(),h=c.val().length,f=c.getMasked(),l=f.length,k=c.getMCharsBeforeCount(l-1)-c.getMCharsBeforeCount(h-1),n=m<h;c.val(f);n&&(8!==e&&46!==e&&(m=c.caretPos(m,h,l,k)), |
||||
c.setCaret(m));return c.callbacks(d)}},getMasked:function(a,b){var m=[],h=void 0===b?c.val():b+"",f=0,l=e.length,k=0,n=h.length,q=1,p="push",u=-1,t,w;d.reverse?(p="unshift",q=-1,t=0,f=l-1,k=n-1,w=function(){return-1<f&&-1<k}):(t=l-1,w=function(){return f<l&&k<n});for(;w();){var x=e.charAt(f),v=h.charAt(k),s=g.translation[x];if(s)v.match(s.pattern)?(m[p](v),s.recursive&&(-1===u?u=f:f===t&&(f=u-q),t===u&&(f-=q)),f+=q):s.optional?(f+=q,k-=q):s.fallback?(m[p](s.fallback),f+=q,k-=q):c.invalid.push({p:k, |
||||
v:v,e:s.pattern}),k+=q;else{if(!a)m[p](x);v===x&&(k+=q);f+=q}}h=e.charAt(t);l!==n+1||g.translation[h]||m.push(h);return m.join("")},callbacks:function(b){var g=c.val(),m=g!==n,h=[g,b,a,d],f=function(a,b,c){"function"===typeof d[a]&&b&&d[a].apply(this,c)};f("onChange",!0===m,h);f("onKeyPress",!0===m,h);f("onComplete",g.length===e.length,h);f("onInvalid",0<c.invalid.length,[g,b,a,c.invalid,d])}};a=b(a);var g=this,n=c.val(),p;e="function"===typeof e?e(c.val(),void 0,a,d):e;g.mask=e;g.options=d;g.remove= |
||||
function(){var b=c.getCaret();c.destroyEvents();c.val(g.getCleanVal());c.setCaret(b-c.getMCharsBeforeCount(b));return a};g.getCleanVal=function(){return c.getMasked(!0)};g.getMaskedVal=function(a){return c.getMasked(!1,a)};g.init=function(e){e=e||!1;d=d||{};g.clearIfNotMatch=b.jMaskGlobals.clearIfNotMatch;g.byPassKeys=b.jMaskGlobals.byPassKeys;g.translation=b.extend({},b.jMaskGlobals.translation,d.translation);g=b.extend(!0,{},g,d);p=c.getRegexMask();!1===e?(d.placeholder&&a.attr("placeholder",d.placeholder), |
||||
a.data("mask")&&a.attr("autocomplete","off"),c.destroyEvents(),c.events(),e=c.getCaret(),c.val(c.getMasked()),c.setCaret(e+c.getMCharsBeforeCount(e,!0))):(c.events(),c.val(c.getMasked()))};g.init(!a.is("input"))};b.maskWatchers={};var A=function(){var a=b(this),e={},d=a.attr("data-mask");a.attr("data-mask-reverse")&&(e.reverse=!0);a.attr("data-mask-clearifnotmatch")&&(e.clearIfNotMatch=!0);"true"===a.attr("data-mask-selectonfocus")&&(e.selectOnFocus=!0);if(z(a,d,e))return a.data("mask",new y(this, |
||||
d,e))},z=function(a,e,d){d=d||{};var c=b(a).data("mask"),g=JSON.stringify;a=b(a).val()||b(a).text();try{return"function"===typeof e&&(e=e(a)),"object"!==typeof c||g(c.options)!==g(d)||c.mask!==e}catch(n){}};b.fn.mask=function(a,e){e=e||{};var d=this.selector,c=b.jMaskGlobals,g=c.watchInterval,c=e.watchInputs||c.watchInputs,n=function(){if(z(this,a,e))return b(this).data("mask",new y(this,a,e))};b(this).each(n);d&&""!==d&&c&&(clearInterval(b.maskWatchers[d]),b.maskWatchers[d]=setInterval(function(){b(document).find(d).each(n)}, |
||||
g));return this};b.fn.masked=function(a){return this.data("mask").getMaskedVal(a)};b.fn.unmask=function(){clearInterval(b.maskWatchers[this.selector]);delete b.maskWatchers[this.selector];return this.each(function(){var a=b(this).data("mask");a&&a.remove().removeData("mask")})};b.fn.cleanVal=function(){return this.data("mask").getCleanVal()};b.applyDataMask=function(a){a=a||b.jMaskGlobals.maskElements;(a instanceof b?a:b(a)).filter(b.jMaskGlobals.dataMaskAttr).each(A)};var p={maskElements:"input,td,span,div", |
||||
dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,useInput:function(a){var b=document.createElement("div"),d;a="on"+a;d=a in b;d||(b.setAttribute(a,"return;"),d="function"===typeof b[a]);return d}("input"),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};b.jMaskGlobals=b.jMaskGlobals||{};p=b.jMaskGlobals=b.extend(!0,{},p,b.jMaskGlobals); |
||||
p.dataMask&&b.applyDataMask();setInterval(function(){b.jMaskGlobals.watchDataMask&&b.applyDataMask()},p.watchInterval)}); |
||||
@ -0,0 +1 @@ |
||||
;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}})(function($){'use strict';var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1;}$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0;}if(typeof settings==='function'){settings={onAfter:settings};}if(target==='max'){target=9e9;}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2;}settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null)return;var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;}targ=win?$(targ):$(targ,elem);case'object':if(targ.length===0)return;if(targ.is||targ.style){toff=(targ=$(targ)).offset();}}var offset=$.isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0;}attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos];}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val;}if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max);}if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={};}else if(queue){animate(settings.onAfterFirst);attr={};}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings);}});$elem.animate(attr,opts);}});};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem))return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size]);};function both(val){return $.isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val};}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]();},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop();}var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t);}}};return $scrollTo;}); |
||||
@ -0,0 +1,7 @@ |
||||
/** |
||||
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT |
||||
* @author Ariel Flesler |
||||
* @version 2.1.2 |
||||
*/ |
||||
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p}); |
||||
@ -0,0 +1,2 @@ |
||||
/*! jQuery Searchable v1.1.0 by Stidges (http://twitter.com/stidges) | MIT */ |
||||
!function(a){function b(a){return"function"==typeof a}function c(b,c){this.$element=a(b),this.settings=a.extend({},e,c),this.init()}var d="searchable",e={selector:"tbody tr",childSelector:"td",searchField:"#search",striped:!1,oddRow:{},evenRow:{},hide:function(a){a.hide()},show:function(a){a.show()},searchType:"default",onSearchActive:!1,onSearchEmpty:!1,onSearchFocus:!1,onSearchBlur:!1,clearOnLoad:!1},f=!1,g=!1,h=!1,i=!1;"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){"use strict";if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof a)throw new TypeError(a+" is not a function");var c,d,e=this.length>>>0,f=!1;for(1<arguments.length&&(d=b,f=!0),c=0;e>c;++c)this.hasOwnProperty(c)&&(f?d=a(d,this[c],c,this):(d=this[c],f=!0));if(!f)throw new TypeError("Reduce of empty array with no initial value");return d}),c.prototype={init:function(){this.$searchElems=a(this.settings.selector,this.$element),this.$search=a(this.settings.searchField),this.matcherFunc=this.getMatcherFunction(this.settings.searchType),this.determineCallbacks(),this.bindEvents(),this.updateStriping()},determineCallbacks:function(){f=b(this.settings.onSearchActive),g=b(this.settings.onSearchEmpty),h=b(this.settings.onSearchFocus),i=b(this.settings.onSearchBlur)},bindEvents:function(){var b=this;this.$search.on("change keyup",function(){b.search(a(this).val()),b.updateStriping()}),h&&this.$search.on("focus",this.settings.onSearchFocus),i&&this.$search.on("blur",this.settings.onSearchBlur),this.settings.clearOnLoad===!0&&(this.$search.val(""),this.$search.trigger("change")),""!==this.$search.val()&&this.$search.trigger("change")},updateStriping:function(){var b=this,c=["oddRow","evenRow"],d=this.settings.selector+":visible";this.settings.striped&&a(d,this.$element).each(function(d,e){a(e).css(b.settings[c[d%2]])})},search:function(b){var c,d,e,h,i,j,k,l;if(0===a.trim(b).length)return this.$searchElems.css("display",""),this.updateStriping(),void(g&&this.settings.onSearchEmpty(this.$element));for(f&&this.settings.onSearchActive(this.$element,b),d=this.$searchElems.length,c=this.matcherFunc(b),k=0;d>k;k++){for(j=a(this.$searchElems[k]),e=j.find(this.settings.childSelector),h=e.length,i=!0,l=0;h>l;l++)if(c(a(e[l]).text())){i=!1;break}i===!0?this.settings.hide(j):this.settings.show(j)}},getMatcherFunction:function(a){return"fuzzy"===a?this.getFuzzyMatcher:"strict"===a?this.getStrictMatcher:this.getDefaultMatcher},getFuzzyMatcher:function(a){var b,c=a.split("").reduce(function(a,b){return a+"[^"+b+"]*"+b});return b=new RegExp(c,"gi"),function(a){return b.test(a)}},getStrictMatcher:function(b){return b=a.trim(b),function(a){return-1!==a.indexOf(b)}},getDefaultMatcher:function(b){return b=a.trim(b).toLowerCase(),function(a){return-1!==a.toLowerCase().indexOf(b)}}},a.fn[d]=function(b){return this.each(function(){a.data(this,"plugin_"+d)||a.data(this,"plugin_"+d,new c(this,b))})}}(jQuery,window,document); |
||||
@ -0,0 +1,232 @@ |
||||
/*! |
||||
* jQuery Searchable Plugin v1.0.0 |
||||
* https://github.com/stidges/jquery-searchable
|
||||
* |
||||
* Copyright 2014 Stidges |
||||
* Released under the MIT license |
||||
*/ |
||||
;(function( $, window, document, undefined ) { |
||||
|
||||
var pluginName = 'searchable', |
||||
defaults = { |
||||
selector: 'tbody tr', |
||||
childSelector: 'td', |
||||
searchField: '#search', |
||||
striped: false, |
||||
oddRow: { }, |
||||
evenRow: { }, |
||||
hide: function( elem ) { elem.hide(); }, |
||||
show: function( elem ) { elem.show(); }, |
||||
searchType: 'default', |
||||
onSearchActive: false, |
||||
onSearchEmpty: false, |
||||
onSearchFocus: false, |
||||
onSearchBlur: false, |
||||
clearOnLoad: false |
||||
}, |
||||
searchActiveCallback = false, |
||||
searchEmptyCallback = false, |
||||
searchFocusCallback = false, |
||||
searchBlurCallback = false; |
||||
|
||||
function isFunction(value) { |
||||
return typeof value === 'function'; |
||||
} |
||||
|
||||
if ( 'function' !== typeof Array.prototype.reduce ) { |
||||
Array.prototype.reduce = function( callback, opt_initialValue ) { |
||||
|
||||
'use strict'; |
||||
|
||||
if ( null === this || 'undefined' === typeof this ) { |
||||
throw new TypeError( |
||||
'Array.prototype.reduce called on null or undefined' ); |
||||
} |
||||
|
||||
if ( 'function' !== typeof callback ) { |
||||
throw new TypeError( callback + ' is not a function' ); |
||||
} |
||||
|
||||
var index, value, |
||||
length = this.length >>> 0, |
||||
isValueSet = false; |
||||
|
||||
if ( 1 < arguments.length ) { |
||||
value = opt_initialValue; |
||||
isValueSet = true; |
||||
} |
||||
|
||||
for ( index = 0; length > index; ++index ) { |
||||
if ( this.hasOwnProperty( index ) ) { |
||||
if ( isValueSet ) { |
||||
value = callback( value, this[ index ], index, this ); |
||||
} else { |
||||
value = this[ index ]; |
||||
isValueSet = true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if ( !isValueSet ) { |
||||
throw new TypeError('Reduce of empty array with no initial value'); |
||||
} |
||||
|
||||
return value; |
||||
}; |
||||
} |
||||
|
||||
function Plugin( element, options ) { |
||||
this.$element = $( element ); |
||||
this.settings = $.extend( {}, defaults, options ); |
||||
|
||||
this.init(); |
||||
} |
||||
|
||||
Plugin.prototype = { |
||||
init: function() { |
||||
this.$searchElems = $( this.settings.selector, this.$element ); |
||||
this.$search = $( this.settings.searchField ); |
||||
this.matcherFunc = this.getMatcherFunction( this.settings.searchType ); |
||||
|
||||
this.determineCallbacks(); |
||||
this.bindEvents(); |
||||
this.updateStriping(); |
||||
}, |
||||
|
||||
determineCallbacks: function() { |
||||
searchActiveCallback = isFunction( this.settings.onSearchActive ); |
||||
searchEmptyCallback = isFunction( this.settings.onSearchEmpty ); |
||||
searchFocusCallback = isFunction( this.settings.onSearchFocus ); |
||||
searchBlurCallback = isFunction( this.settings.onSearchBlur ); |
||||
}, |
||||
|
||||
bindEvents: function() { |
||||
var that = this; |
||||
|
||||
this.$search.on( 'change keyup', function() { |
||||
that.search( $( this ).val() ); |
||||
|
||||
that.updateStriping(); |
||||
}); |
||||
|
||||
if ( searchFocusCallback ) { |
||||
this.$search.on( 'focus', this.settings.onSearchFocus ); |
||||
} |
||||
|
||||
if ( searchBlurCallback ) { |
||||
this.$search.on( 'blur', this.settings.onSearchBlur ); |
||||
} |
||||
|
||||
if ( this.settings.clearOnLoad === true ) { |
||||
this.$search.val( '' ); |
||||
this.$search.trigger( 'change' ); |
||||
} |
||||
|
||||
if ( this.$search.val() !== '' ) { |
||||
this.$search.trigger( 'change' ); |
||||
} |
||||
}, |
||||
|
||||
updateStriping: function() { |
||||
var that = this, |
||||
styles = [ 'oddRow', 'evenRow' ], |
||||
selector = this.settings.selector + ':visible'; |
||||
|
||||
if ( !this.settings.striped ) { |
||||
return; |
||||
} |
||||
|
||||
$( selector, this.$element ).each( function( i, row ) { |
||||
$( row ).css( that.settings[ styles[ i % 2 ] ] ); |
||||
}); |
||||
}, |
||||
|
||||
search: function( term ) { |
||||
var matcher, elemCount, children, childCount, hide, $elem, i, x; |
||||
|
||||
if ( $.trim( term ).length === 0 ) { |
||||
this.$searchElems.css( 'display', '' ); |
||||
this.updateStriping(); |
||||
|
||||
if ( searchEmptyCallback ) { |
||||
this.settings.onSearchEmpty( this.$element ); |
||||
} |
||||
|
||||
return; |
||||
} else if ( searchActiveCallback ) { |
||||
this.settings.onSearchActive( this.$element, term ); |
||||
} |
||||
|
||||
elemCount = this.$searchElems.length; |
||||
matcher = this.matcherFunc( term ); |
||||
|
||||
for ( i = 0; i < elemCount; i++ ) { |
||||
$elem = $( this.$searchElems[ i ] ); |
||||
children = $elem.find( this.settings.childSelector ); |
||||
childCount = children.length; |
||||
hide = true; |
||||
|
||||
for ( x = 0; x < childCount; x++ ) { |
||||
if ( matcher( $( children[ x ] ).text() ) ) { |
||||
hide = false; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
if ( hide === true ) { |
||||
this.settings.hide( $elem ); |
||||
} else { |
||||
this.settings.show( $elem ); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
getMatcherFunction: function( type ) { |
||||
if ( type === 'fuzzy' ) { |
||||
return this.getFuzzyMatcher; |
||||
} else if ( type === 'strict' ) { |
||||
return this.getStrictMatcher; |
||||
} |
||||
|
||||
return this.getDefaultMatcher; |
||||
}, |
||||
|
||||
getFuzzyMatcher: function( term ) { |
||||
var regexMatcher, |
||||
pattern = term.split( '' ).reduce( function( a, b ) { |
||||
return a + '[^' + b + ']*' + b; |
||||
}); |
||||
|
||||
regexMatcher = new RegExp( pattern, 'gi' ); |
||||
|
||||
return function( s ) { |
||||
return regexMatcher.test( s ); |
||||
}; |
||||
}, |
||||
|
||||
getStrictMatcher: function( term ) { |
||||
term = $.trim( term ); |
||||
|
||||
return function( s ) { |
||||
return ( s.indexOf( term ) !== -1 ); |
||||
}; |
||||
}, |
||||
|
||||
getDefaultMatcher: function( term ) { |
||||
term = $.trim( term ).toLowerCase(); |
||||
|
||||
return function( s ) { |
||||
return ( s.toLowerCase().indexOf( term ) !== -1 ); |
||||
}; |
||||
} |
||||
}; |
||||
|
||||
$.fn[ pluginName ] = function( options ) { |
||||
return this.each( function() { |
||||
if ( !$.data( this, 'plugin_' + pluginName ) ) { |
||||
$.data( this, 'plugin_' + pluginName, new Plugin(this, options) ); |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
})( jQuery, window, document ); |
||||
@ -0,0 +1 @@ |
||||
;(function($,window,document,undefined){var pluginName='searchable',defaults={selector:'tbody tr',childSelector:'td',searchField:'#search',striped:false,oddRow:{},evenRow:{},hide:function(elem){elem.hide();},show:function(elem){elem.show();},searchType:'default',onSearchActive:false,onSearchEmpty:false,onSearchFocus:false,onSearchBlur:false,clearOnLoad:false},searchActiveCallback=false,searchEmptyCallback=false,searchFocusCallback=false,searchBlurCallback=false;function isFunction(value){return typeof value==='function';}function Plugin(element,options){this.$element=$(element);this.settings=$.extend({},defaults,options);this.init();}Plugin.prototype={init:function(){this.$searchElems=$(this.settings.selector,this.$element);this.$search=$(this.settings.searchField);this.matcherFunc=this.getMatcherFunction(this.settings.searchType);this.determineCallbacks();this.bindEvents();this.updateStriping();},determineCallbacks:function(){searchActiveCallback=isFunction(this.settings.onSearchActive);searchEmptyCallback=isFunction(this.settings.onSearchEmpty);searchFocusCallback=isFunction(this.settings.onSearchFocus);searchBlurCallback=isFunction(this.settings.onSearchBlur);},bindEvents:function(){var that=this;this.$search.on('change keyup',function(){that.search($(this).val());that.updateStriping();});if(searchFocusCallback){this.$search.on('focus',this.settings.onSearchFocus);}if(searchBlurCallback){this.$search.on('blur',this.settings.onSearchBlur);}if(this.settings.clearOnLoad===true){this.$search.val('');this.$search.trigger('change');}if(this.$search.val()!==''){this.$search.trigger('change');}},updateStriping:function(){var that=this,styles=['oddRow','evenRow'],selector=this.settings.selector+':visible';if(!this.settings.striped){return;}$(selector,this.$element).each(function(i,row){$(row).css(that.settings[styles[i%2]]);});},search:function(term){var matcher,elemCount,children,childCount,hide,$elem,i,x;if($.trim(term).length===0){this.$searchElems.css('display','');this.updateStriping();if(searchEmptyCallback){this.settings.onSearchEmpty(this.$element);}return;}else if(searchActiveCallback){this.settings.onSearchActive(this.$element,term);}elemCount=this.$searchElems.length;matcher=this.matcherFunc(term);for(i=0;i<elemCount;i++){$elem=$(this.$searchElems[i]);children=$elem.find(this.settings.childSelector);childCount=children.length;hide=true;for(x=0;x<childCount;x++){if(matcher($(children[x]).text())){hide=false;break;}}if(hide===true){this.settings.hide($elem);}else{this.settings.show($elem);}}},getMatcherFunction:function(type){if(type==='fuzzy'){return this.getFuzzyMatcher;}else if(type==='strict'){return this.getStrictMatcher;}return this.getDefaultMatcher;},getFuzzyMatcher:function(term){var regexMatcher,pattern=term.split('').reduce(function(a,b){return a+'[^'+b+']*'+b;});regexMatcher=new RegExp(pattern,'gi');return function(s){return regexMatcher.test(s);};},getStrictMatcher:function(term){term=$.trim(term);return function(s){return(s.indexOf(term)!==-1);};},getDefaultMatcher:function(term){term=$.trim(term).toLowerCase();return function(s){return(s.toLowerCase().indexOf(term)!==-1);};}};$.fn[pluginName]=function(options){return this.each(function(){if(!$.data(this,'plugin_'+pluginName)){$.data(this,'plugin_'+pluginName,new Plugin(this,options));}});};})(jQuery,window,document); |
||||
@ -0,0 +1,2 @@ |
||||
(function($){$.tablesort=function($table,settings){var self=this;this.$table=$table;this.$thead=this.$table.find('thead');this.settings=$.extend({},$.tablesort.defaults,settings);this.$sortCells=this.$thead.length>0?this.$thead.find('th:not(.no-sort)'):this.$table.find('th:not(.no-sort)');this.$sortCells.on('click.tablesort',function(){self.sort($(this));});this.index=null;this.$th=null;this.direction=null;};$.tablesort.prototype={sort:function(th,direction){var start=new Date(),self=this,table=this.$table,rows=this.$thead.length>0?table.find('tbody tr'):table.find('tr').has('td'),cells=table.find('tr td:nth-of-type('+(th.index()+1)+')'),sortBy=th.data().sortBy,sortedMap=[];var unsortedValues=cells.map(function(idx,cell){if(sortBy)return(typeof sortBy==='function')?sortBy($(th),$(cell),self):sortBy;return($(this).data().sortValue!=null?$(this).data().sortValue:$(this).text());});if(unsortedValues.length===0)return;if(this.index!==th.index()){this.direction='asc';this.index=th.index();}else if(direction!=='asc'&&direction!=='desc')this.direction=this.direction==='asc'?'desc':'asc';else |
||||
this.direction=direction;direction=this.direction=='asc'?1:-1;self.$table.trigger('tablesort:start',[self]);self.log("Sorting by "+this.index+' '+this.direction);self.$table.css("display");setTimeout(function(){self.$sortCells.removeClass(self.settings.asc+' '+self.settings.desc);for(var i=0,length=unsortedValues.length;i<length;i++){sortedMap.push({index:i,cell:cells[i],row:rows[i],value:unsortedValues[i]});}sortedMap.sort(function(a,b){if(a.value>b.value){return 1*direction;}else if(a.value<b.value){return-1*direction;}else{return 0;}});$.each(sortedMap,function(i,entry){table.append(entry.row);});th.addClass(self.settings[self.direction]);self.log('Sort finished in '+((new Date()).getTime()-start.getTime())+'ms');self.$table.trigger('tablesort:complete',[self]);self.$table.css("display");},unsortedValues.length>2000?200:10);},log:function(msg){if(($.tablesort.DEBUG||this.settings.debug)&&console&&console.log){console.log('[tablesort] '+msg);}},destroy:function(){this.$sortCells.off('click.tablesort');this.$table.data('tablesort',null);return null;}};$.tablesort.DEBUG=false;$.tablesort.defaults={debug:$.tablesort.DEBUG,asc:'sorted ascending',desc:'sorted descending'};$.fn.tablesort=function(settings){var table,sortable,previous;return this.each(function(){table=$(this);previous=table.data('tablesort');if(previous){previous.destroy();}table.data('tablesort',new $.tablesort(table,settings));});};})(window.Zepto||window.jQuery); |
||||
@ -0,0 +1,6 @@ |
||||
/* |
||||
A simple, lightweight jQuery plugin for creating sortable tables. |
||||
https://github.com/kylefox/jquery-tablesort
|
||||
Version 0.0.9 |
||||
*/ |
||||
!function(t){t.tablesort=function(e,s){var i=this;this.$table=e,this.$thead=this.$table.find("thead"),this.settings=t.extend({},t.tablesort.defaults,s),this.$sortCells=this.$thead.length>0?this.$thead.find("th:not(.no-sort)"):this.$table.find("th:not(.no-sort)"),this.$sortCells.on("click.tablesort",function(){i.sort(t(this))}),this.index=null,this.$th=null,this.direction=null},t.tablesort.prototype={sort:function(e,s){var i=new Date,n=this,o=this.$table,a=this.$thead.length>0?o.find("tbody tr"):o.find("tr").has("td"),l=o.find("tr td:nth-of-type("+(e.index()+1)+")"),r=e.data().sortBy,d=[],h=l.map(function(s,i){return r?"function"==typeof r?r(t(e),t(i),n):r:null!=t(this).data().sortValue?t(this).data().sortValue:t(this).text()});0!==h.length&&(this.index!==e.index()?(this.direction="asc",this.index=e.index()):"asc"!==s&&"desc"!==s?this.direction="asc"===this.direction?"desc":"asc":this.direction=s,s="asc"==this.direction?1:-1,n.$table.trigger("tablesort:start",[n]),n.log("Sorting by "+this.index+" "+this.direction),n.$table.css("display"),setTimeout(function(){n.$sortCells.removeClass(n.settings.asc+" "+n.settings.desc);for(var r=0,c=h.length;r<c;r++)d.push({index:r,cell:l[r],row:a[r],value:h[r]});d.sort(function(t,e){return t.value>e.value?1*s:t.value<e.value?-1*s:0}),t.each(d,function(t,e){o.append(e.row)}),e.addClass(n.settings[n.direction]),n.log("Sort finished in "+((new Date).getTime()-i.getTime())+"ms"),n.$table.trigger("tablesort:complete",[n]),n.$table.css("display")},h.length>2e3?200:10))},log:function(e){(t.tablesort.DEBUG||this.settings.debug)&&console&&console.log&&console.log("[tablesort] "+e)},destroy:function(){return this.$sortCells.off("click.tablesort"),this.$table.data("tablesort",null),null}},t.tablesort.DEBUG=!1,t.tablesort.defaults={debug:t.tablesort.DEBUG,asc:"sorted ascending",desc:"sorted descending"},t.fn.tablesort=function(e){var s,i;return this.each(function(){s=t(this),i=s.data("tablesort"),i&&i.destroy(),s.data("tablesort",new t.tablesort(s,e))})}}(window.Zepto||window.jQuery); |
||||
@ -0,0 +1 @@ |
||||
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&typeof module.exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){$.timeago=function(timestamp){if(timestamp instanceof Date){return inWords(timestamp);}else if(typeof timestamp==="string"){return inWords($.timeago.parse(timestamp));}else if(typeof timestamp==="number"){return inWords(new Date(timestamp));}else{return inWords($.timeago.datetime(timestamp));}};var $t=$.timeago;$.extend($.timeago,{settings:{refreshMillis:60000,allowPast:true,allowFuture:false,localeTitle:false,cutoff:0,autoDispose:true,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:'any moment now',seconds:"just now",minute:"one minute",minutes:"%d minutes",hour:"one hour",hours:"%d hours",day:"a day",days:"%d days",month:"one month",months:"%d months",year:"1 year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(distanceMillis){if(!this.settings.allowPast&&!this.settings.allowFuture){throw'timeago allowPast and allowFuture settings can not both be set to false.';}var $l=this.settings.strings;var prefix=$l.prefixAgo;var suffix=$l.suffixAgo;if(this.settings.allowFuture){if(distanceMillis<0){prefix=$l.prefixFromNow;suffix=$l.suffixFromNow;}}if(!this.settings.allowPast&&distanceMillis>=0){return this.settings.strings.inPast;}var seconds=Math.abs(distanceMillis)/1000;var minutes=seconds/60;var hours=minutes/60;var days=hours/24;var years=days/365;function substitute(stringOrFunction,number){var string=$.isFunction(stringOrFunction)?stringOrFunction(number,distanceMillis):stringOrFunction;var value=($l.numbers&&$l.numbers[number])||number;return string.replace(/%d/i,value);}var words=seconds<45&&substitute($l.seconds,Math.round(seconds))||seconds<90&&substitute($l.minute,1)||minutes<45&&substitute($l.minutes,Math.round(minutes))||minutes<90&&substitute($l.hour,1)||hours<24&&substitute($l.hours,Math.round(hours))||hours<42&&substitute($l.day,1)||days<30&&substitute($l.days,Math.round(days))||days<45&&substitute($l.month,1)||days<365&&substitute($l.months,Math.round(days/30))||years<1.5&&substitute($l.year,1)||substitute($l.years,Math.round(years));var separator=$l.wordSeparator||"";if($l.wordSeparator===undefined){separator=" ";}return $.trim([prefix,words,suffix].join(separator));},parse:function(iso8601){var s=$.trim(iso8601);s=s.replace(/\.\d+/,"");s=s.replace(/-/,"/").replace(/-/,"/");s=s.replace(/T/," ").replace(/Z/," UTC");s=s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");s=s.replace(/([\+\-]\d\d)$/," $100");return new Date(s);},datetime:function(elem){var iso8601=$t.isTime(elem)?$(elem).attr("datetime"):$(elem).attr("title");return $t.parse(iso8601);},isTime:function(elem){return $(elem).get(0).tagName.toLowerCase()==="time";}});var functions={init:function(){var refresh_el=$.proxy(refresh,this);refresh_el();var $s=$t.settings;if($s.refreshMillis>0){this._timeagoInterval=setInterval(refresh_el,$s.refreshMillis);}},update:function(timestamp){var date=(timestamp instanceof Date)?timestamp:$t.parse(timestamp);$(this).data('timeago',{datetime:date});if($t.settings.localeTitle){$(this).attr("title",date.toLocaleString());}refresh.apply(this);},updateFromDOM:function(){$(this).data('timeago',{datetime:$t.parse($t.isTime(this)?$(this).attr("datetime"):$(this).attr("title"))});refresh.apply(this);},dispose:function(){if(this._timeagoInterval){window.clearInterval(this._timeagoInterval);this._timeagoInterval=null;}}};$.fn.timeago=function(action,options){var fn=action?functions[action]:functions.init;if(!fn){throw new Error("Unknown function name '"+action+"' for timeago");}this.each(function(){fn.call(this,options);});return this;};function refresh(){var $s=$t.settings;if($s.autoDispose&&!$.contains(document.documentElement,this)){$(this).timeago("dispose");return this;}var data=prepareData(this);if(!isNaN(data.datetime)){if($s.cutoff===0||Math.abs(distance(data.datetime))<$s.cutoff){$(this).text(inWords(data.datetime));}else{if($(this).attr('title').length>0){$(this).text($(this).attr('title'));}}}return this;}function prepareData(element){element=$(element);if(!element.data("timeago")){element.data("timeago",{datetime:$t.datetime(element)});var text=$.trim(element.text());if($t.settings.localeTitle){element.attr("title",element.data('timeago').datetime.toLocaleString());}else if(text.length>0&&!($t.isTime(element)&&element.attr("title"))){element.attr("title",text);}}return element.data("timeago");}function inWords(date){return $t.inWords(distance(date));}function distance(date){return(new Date().getTime()-date.getTime());}document.createElement("abbr");document.createElement("time");})); |
||||
@ -0,0 +1,374 @@ |
||||
// jQuery toast plugin created by Kamran Ahmed copyright MIT license 2015
|
||||
if ( typeof Object.create !== 'function' ) { |
||||
Object.create = function( obj ) { |
||||
function F() {} |
||||
F.prototype = obj; |
||||
return new F(); |
||||
}; |
||||
} |
||||
|
||||
(function( $, window, document, undefined ) { |
||||
|
||||
"use strict"; |
||||
|
||||
var Toast = { |
||||
|
||||
_positionClasses : ['bottom-left', 'bottom-right', 'top-right', 'top-left', 'bottom-center', 'top-center', 'mid-center'], |
||||
_defaultIcons : ['success', 'error', 'info', 'warning'], |
||||
|
||||
init: function (options, elem) { |
||||
this.prepareOptions(options, $.toast.options); |
||||
this.process(); |
||||
}, |
||||
|
||||
prepareOptions: function(options, options_to_extend) { |
||||
var _options = {}; |
||||
if ( ( typeof options === 'string' ) || ( options instanceof Array ) ) { |
||||
_options.text = options; |
||||
} else { |
||||
_options = options; |
||||
} |
||||
this.options = $.extend( {}, options_to_extend, _options ); |
||||
}, |
||||
|
||||
process: function () { |
||||
this.setup(); |
||||
this.addToDom(); |
||||
this.position(); |
||||
this.bindToast(); |
||||
this.animate(); |
||||
}, |
||||
|
||||
setup: function () { |
||||
|
||||
var _toastContent = ''; |
||||
|
||||
this._toastEl = this._toastEl || $('<div></div>', { |
||||
class : 'jq-toast-single' |
||||
}); |
||||
|
||||
// For the loader on top
|
||||
_toastContent += '<span class="jq-toast-loader"></span>';
|
||||
|
||||
if ( this.options.allowToastClose ) { |
||||
_toastContent += '<span class="close-jq-toast-single">×</span>'; |
||||
}; |
||||
|
||||
if ( this.options.text instanceof Array ) { |
||||
|
||||
if ( this.options.heading ) { |
||||
_toastContent +='<h2 class="jq-toast-heading">' + this.options.heading + '</h2>'; |
||||
}; |
||||
|
||||
_toastContent += '<ul class="jq-toast-ul">'; |
||||
for (var i = 0; i < this.options.text.length; i++) { |
||||
_toastContent += '<li class="jq-toast-li" id="jq-toast-item-' + i + '">' + this.options.text[i] + '</li>'; |
||||
} |
||||
_toastContent += '</ul>'; |
||||
|
||||
} else { |
||||
if ( this.options.heading ) { |
||||
_toastContent +='<h2 class="jq-toast-heading">' + this.options.heading + '</h2>'; |
||||
}; |
||||
_toastContent += this.options.text; |
||||
} |
||||
|
||||
this._toastEl.html( _toastContent ); |
||||
|
||||
if ( this.options.bgColor !== false ) { |
||||
this._toastEl.css("background-color", this.options.bgColor); |
||||
}; |
||||
|
||||
if ( this.options.textColor !== false ) { |
||||
this._toastEl.css("color", this.options.textColor); |
||||
}; |
||||
|
||||
if ( this.options.textAlign ) { |
||||
this._toastEl.css('text-align', this.options.textAlign); |
||||
} |
||||
|
||||
if ( this.options.icon !== false ) { |
||||
this._toastEl.addClass('jq-has-icon'); |
||||
|
||||
if ( $.inArray(this.options.icon, this._defaultIcons) !== -1 ) { |
||||
this._toastEl.addClass('jq-icon-' + this.options.icon); |
||||
}; |
||||
}; |
||||
|
||||
if ( this.options.class !== false ){ |
||||
this._toastEl.addClass(this.options.class) |
||||
} |
||||
}, |
||||
|
||||
position: function () { |
||||
if ( ( typeof this.options.position === 'string' ) && ( $.inArray( this.options.position, this._positionClasses) !== -1 ) ) { |
||||
|
||||
if ( this.options.position === 'bottom-center' ) { |
||||
this._container.css({ |
||||
left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2, |
||||
bottom: 20 |
||||
}); |
||||
} else if ( this.options.position === 'top-center' ) { |
||||
this._container.css({ |
||||
left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2, |
||||
top: 20 |
||||
}); |
||||
} else if ( this.options.position === 'mid-center' ) { |
||||
this._container.css({ |
||||
left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2, |
||||
top: ( $(window).outerHeight() / 2 ) - this._container.outerHeight()/2 |
||||
}); |
||||
} else { |
||||
this._container.addClass( this.options.position ); |
||||
} |
||||
|
||||
} else if ( typeof this.options.position === 'object' ) { |
||||
this._container.css({ |
||||
top : this.options.position.top ? this.options.position.top : 'auto', |
||||
bottom : this.options.position.bottom ? this.options.position.bottom : 'auto', |
||||
left : this.options.position.left ? this.options.position.left : 'auto', |
||||
right : this.options.position.right ? this.options.position.right : 'auto' |
||||
}); |
||||
} else { |
||||
this._container.addClass( 'bottom-left' ); |
||||
} |
||||
}, |
||||
|
||||
bindToast: function () { |
||||
|
||||
var that = this; |
||||
|
||||
this._toastEl.on('afterShown', function () { |
||||
that.processLoader(); |
||||
}); |
||||
|
||||
this._toastEl.find('.close-jq-toast-single').on('click', function ( e ) { |
||||
|
||||
e.preventDefault(); |
||||
|
||||
if( that.options.showHideTransition === 'fade') { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.fadeOut(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} else if ( that.options.showHideTransition === 'slide' ) { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.slideUp(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} else { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.hide(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
if ( typeof this.options.beforeShow == 'function' ) { |
||||
this._toastEl.on('beforeShow', function () { |
||||
that.options.beforeShow(that._toastEl); |
||||
}); |
||||
}; |
||||
|
||||
if ( typeof this.options.afterShown == 'function' ) { |
||||
this._toastEl.on('afterShown', function () { |
||||
that.options.afterShown(that._toastEl); |
||||
}); |
||||
}; |
||||
|
||||
if ( typeof this.options.beforeHide == 'function' ) { |
||||
this._toastEl.on('beforeHide', function () { |
||||
that.options.beforeHide(that._toastEl); |
||||
}); |
||||
}; |
||||
|
||||
if ( typeof this.options.afterHidden == 'function' ) { |
||||
this._toastEl.on('afterHidden', function () { |
||||
that.options.afterHidden(that._toastEl); |
||||
}); |
||||
}; |
||||
|
||||
if ( typeof this.options.onClick == 'function' ) { |
||||
this._toastEl.on('click', function () { |
||||
that.options.onClick(that._toastEl); |
||||
}); |
||||
};
|
||||
}, |
||||
|
||||
addToDom: function () { |
||||
|
||||
var _container = $('.jq-toast-wrap'); |
||||
|
||||
if ( _container.length === 0 ) { |
||||
|
||||
_container = $('<div></div>',{ |
||||
class: "jq-toast-wrap", |
||||
role: "alert", |
||||
"aria-live": "polite" |
||||
}); |
||||
|
||||
$('body').append( _container ); |
||||
|
||||
} else if ( !this.options.stack || isNaN( parseInt(this.options.stack, 10) ) ) { |
||||
_container.empty(); |
||||
} |
||||
|
||||
_container.find('.jq-toast-single:hidden').remove(); |
||||
|
||||
_container.append( this._toastEl ); |
||||
|
||||
if ( this.options.stack && !isNaN( parseInt( this.options.stack ), 10 ) ) { |
||||
|
||||
var _prevToastCount = _container.find('.jq-toast-single').length, |
||||
_extToastCount = _prevToastCount - this.options.stack; |
||||
|
||||
if ( _extToastCount > 0 ) { |
||||
$('.jq-toast-wrap').find('.jq-toast-single').slice(0, _extToastCount).remove(); |
||||
}; |
||||
|
||||
} |
||||
|
||||
this._container = _container; |
||||
}, |
||||
|
||||
canAutoHide: function () { |
||||
return ( this.options.hideAfter !== false ) && !isNaN( parseInt( this.options.hideAfter, 10 ) ); |
||||
}, |
||||
|
||||
processLoader: function () { |
||||
// Show the loader only, if auto-hide is on and loader is demanded
|
||||
if (!this.canAutoHide() || this.options.loader === false) { |
||||
return false; |
||||
} |
||||
|
||||
var loader = this._toastEl.find('.jq-toast-loader'); |
||||
|
||||
// 400 is the default time that jquery uses for fade/slide
|
||||
// Divide by 1000 for milliseconds to seconds conversion
|
||||
var transitionTime = (this.options.hideAfter - 400) / 1000 + 's'; |
||||
var loaderBg = this.options.loaderBg; |
||||
|
||||
var style = loader.attr('style') || ''; |
||||
style = style.substring(0, style.indexOf('-webkit-transition')); // Remove the last transition definition
|
||||
|
||||
style += '-webkit-transition: width ' + transitionTime + ' ease-in; \ |
||||
-o-transition: width ' + transitionTime + ' ease-in; \ |
||||
transition: width ' + transitionTime + ' ease-in; \ |
||||
background-color: ' + loaderBg + ';'; |
||||
|
||||
|
||||
loader.attr('style', style).addClass('jq-toast-loaded'); |
||||
}, |
||||
|
||||
animate: function () { |
||||
|
||||
var that = this; |
||||
|
||||
this._toastEl.hide(); |
||||
|
||||
this._toastEl.trigger('beforeShow'); |
||||
|
||||
if ( this.options.showHideTransition.toLowerCase() === 'fade' ) { |
||||
this._toastEl.fadeIn(function ( ){ |
||||
that._toastEl.trigger('afterShown'); |
||||
}); |
||||
} else if ( this.options.showHideTransition.toLowerCase() === 'slide' ) { |
||||
this._toastEl.slideDown(function ( ){ |
||||
that._toastEl.trigger('afterShown'); |
||||
}); |
||||
} else { |
||||
this._toastEl.show(function ( ){ |
||||
that._toastEl.trigger('afterShown'); |
||||
}); |
||||
} |
||||
|
||||
if (this.canAutoHide()) { |
||||
|
||||
var that = this; |
||||
|
||||
window.setTimeout(function(){ |
||||
|
||||
if ( that.options.showHideTransition.toLowerCase() === 'fade' ) { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.fadeOut(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} else if ( that.options.showHideTransition.toLowerCase() === 'slide' ) { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.slideUp(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} else { |
||||
that._toastEl.trigger('beforeHide'); |
||||
that._toastEl.hide(function () { |
||||
that._toastEl.trigger('afterHidden'); |
||||
}); |
||||
} |
||||
|
||||
}, this.options.hideAfter); |
||||
}; |
||||
}, |
||||
|
||||
reset: function ( resetWhat ) { |
||||
|
||||
if ( resetWhat === 'all' ) { |
||||
$('.jq-toast-wrap').remove(); |
||||
} else { |
||||
this._toastEl.remove(); |
||||
} |
||||
|
||||
}, |
||||
|
||||
update: function(options) { |
||||
this.prepareOptions(options, this.options); |
||||
this.setup(); |
||||
this.bindToast(); |
||||
}, |
||||
|
||||
close: function() { |
||||
this._toastEl.find('.close-jq-toast-single').click(); |
||||
} |
||||
}; |
||||
|
||||
$.toast = function(options) { |
||||
var toast = Object.create(Toast); |
||||
toast.init(options, this); |
||||
|
||||
return { |
||||
|
||||
reset: function ( what ) { |
||||
toast.reset( what ); |
||||
}, |
||||
|
||||
update: function( options ) { |
||||
toast.update( options ); |
||||
}, |
||||
|
||||
close: function( ) { |
||||
toast.close( ); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
$.toast.options = { |
||||
text: '', |
||||
heading: '', |
||||
showHideTransition: 'fade', |
||||
allowToastClose: true, |
||||
hideAfter: 3000, |
||||
loader: true, |
||||
loaderBg: '#9EC600', |
||||
stack: 5, |
||||
position: 'bottom-left', |
||||
bgColor: false, |
||||
textColor: false, |
||||
textAlign: 'left', |
||||
icon: false, |
||||
beforeShow: function () {}, |
||||
afterShown: function () {}, |
||||
beforeHide: function () {}, |
||||
afterHidden: function () {}, |
||||
onClick: function () {} |
||||
}; |
||||
|
||||
})( jQuery, window, document ); |
||||
@ -0,0 +1,93 @@ |
||||
get_height(), load_height(); |
||||
$(window).bind('resize', set_height_window); |
||||
|
||||
function set_height_window() { |
||||
setTimeout(function(){ auto_right_menus(); }, 100); |
||||
set_height(); |
||||
} |
||||
|
||||
function get_height() { |
||||
const corrected_Height = 115; |
||||
var uiHeight = $(window).height() - corrected_Height; |
||||
window.uiHeight = uiHeight; |
||||
} |
||||
|
||||
function load_height() { |
||||
get_height(), left_scroll(), right_scroll(), $('#main-container-left-body').perfectScrollbar({ |
||||
stopPropagationOnClick: 'false', |
||||
suppressScrollX: 'true' |
||||
}), $('#main-container-right-body').perfectScrollbar({ |
||||
stopPropagationOnClick: 'false', |
||||
suppressScrollX: 'true' |
||||
}); |
||||
} |
||||
|
||||
function set_height() { |
||||
get_height(), left_scroll(), right_scroll(), $('#main-container-left-body').perfectScrollbar('update'), $('#main-container-right-body').perfectScrollbar('update'); |
||||
} |
||||
|
||||
function left_scroll() { |
||||
var fixed_th_height = $("#left-fixed-th-container").height() + 1; |
||||
$("#main-container-left-body").css('height', window.uiHeight - fixed_th_height); |
||||
} |
||||
|
||||
function right_scroll() { |
||||
var h = 0; |
||||
h = window.uiHeight; |
||||
$("#main-container-right-body").css('height', h); |
||||
} |
||||
|
||||
function auto_right_menus() { |
||||
var autoDIVs; |
||||
|
||||
if (routeTab == 'Transactions') { |
||||
var Width = $('#rightData').width(); |
||||
if (Width < 700) { |
||||
/* Small Vertical Monitor */ |
||||
$('.trns-th').width('14ch'); /* Transaction Type */ |
||||
$('.tth').width('auto'); /* Balences */ |
||||
$('.date-th').width('auto'); /* Date */ |
||||
} else { |
||||
/* Normal Monitor */ |
||||
$('.trns-th').width('auto'); /* Transaction Type */ |
||||
$('.tth').width('16ch'); /* Balences */ |
||||
$('.date-th').width('9ch'); /* Date */ |
||||
} |
||||
|
||||
autoDIVs = ['right-secondary-menu-container', 'right-secondary-content', 'right-fixed-th']; |
||||
} else if (routeTab == 'ViewTransaction') { |
||||
autoDIVs = ['right-secondary-menu-container', 'right-secondary-content']; |
||||
} else if (routeTab == 'NewMaintenance') { |
||||
autoDIVs = ['right-secondary-menu-container'];
|
||||
} else { |
||||
$('#main-container-right-body').css('margin-top', ''); |
||||
} |
||||
|
||||
if (autoDIVs != null) { |
||||
var array_menu_calc = calc_menus(autoDIVs); |
||||
var the_height = array_menu_calc[0]; |
||||
const fix_seperation = 2; |
||||
$('#main-container-right-body').css('margin-top', the_height - fix_seperation); |
||||
set_menu(array_menu_calc); |
||||
var uih = window.uiHeight; |
||||
$("#main-container-right-body").css('height', uih - the_height); |
||||
} |
||||
} |
||||
|
||||
function calc_menus(a) { |
||||
var Height = 0, Width = 0; |
||||
for (index = 0; index < a.length; index++) {
|
||||
Height += $('#' + a[index]).height(); |
||||
Width = $('#rightData').width(); |
||||
} |
||||
return [Height, Width]; |
||||
} |
||||
|
||||
function set_menu(a) { |
||||
var h = window.uiHeight; |
||||
var Height = a[0]; |
||||
var Width = a[1]; |
||||
$('#right-menu-container').css('height', Height ); |
||||
$('#right-menu-container').css('width', Width); |
||||
} |
||||
|
||||
@ -0,0 +1,183 @@ |
||||
const session_url = "app/home/session.html"; |
||||
|
||||
$.ajaxSetup({ |
||||
cache: false, |
||||
//headers: { "cache-control": "no-cache" }
|
||||
}); |
||||
|
||||
/* Remove Cookie */ |
||||
function delete_cookie(cname) { |
||||
var expires = "expires=Thu, 01 Jan 1970 00:00:00 UTC;"; |
||||
document.cookie = cname + "=;" + expires + ";path=/"; |
||||
} |
||||
|
||||
/* Set Cookie */ |
||||
function set_cookie(cname, cvalue, exdays) { |
||||
var d = new Date(); |
||||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); |
||||
var expires = "expires=" + d.toUTCString(); |
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; |
||||
} |
||||
|
||||
/* Get Cookie */ |
||||
function get_cookie(cname) { |
||||
var name = cname + "="; |
||||
var decoded_cookie = decodeURIComponent(document.cookie); |
||||
var ca = decoded_cookie.split(';'); |
||||
for (var i = 0; i < ca.length; i++) { |
||||
var c = ca[i]; |
||||
while (c.charAt(0) == ' ') { |
||||
c = c.substring(1); |
||||
} |
||||
if (c.indexOf(name) == 0) { |
||||
return c.substring(name.length, c.length); |
||||
} |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
function is_empty(str) { |
||||
return (!str || 0 === str.length); |
||||
} |
||||
|
||||
function is_valid_user(response) { |
||||
try { |
||||
var user_data = response; /* JSON.parse( ) */ |
||||
var user_valid = user_data.valid_user; |
||||
var users_id = parseInt(user_data.users_id); |
||||
var user_rights = user_data.rights; |
||||
if (users_id > 0 && user_valid === true) { |
||||
return [users_id, true, user_rights]; |
||||
} |
||||
return [0, false, user_rights]; |
||||
} catch (err) { |
||||
console.error(err.message); |
||||
return [0, false, false]; |
||||
} |
||||
} |
||||
|
||||
var user = function (req, event, next) { |
||||
if ($('#users-id').length) { |
||||
/* This is the normal path for users logged in with top-bar session */ |
||||
debug_print("User is logged in as: " + $('#users-id').val()); |
||||
req.user = $('#users-id').val(); |
||||
next(); /* Call the next thing on the router */
|
||||
} else { |
||||
/* This is an abnormal path. It's called when top-bar fails to work */ |
||||
var is_user_dfd = check_user({username: 'default', password: 'default'}); |
||||
$.when(is_user_dfd).done(function () { |
||||
next(); /* Call the next thing on the router */
|
||||
}).fail(function() { |
||||
|
||||
}); |
||||
} // end if user length
|
||||
|
||||
$("#password").off('keypress'); |
||||
$("#password").on('keypress', function (event) { |
||||
if (event.which === 13 || event.keyCode === 13 || event.key === "Enter") { |
||||
var is_user_dfd = do_check_login(); // DO login when Enter Key press on Password field
|
||||
$.when(is_user_dfd).done(function () { |
||||
next(); /* Call the next thing on the router */
|
||||
}).fail(function() { |
||||
|
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$("#loginSubmit").off('click'); |
||||
// Row click function for Tenant Profile
|
||||
$("#loginSubmit").on("click", function () { |
||||
var is_user_dfd = do_check_login(); // DO login when Enter Key press on Password field
|
||||
$.when(is_user_dfd).done(function () { |
||||
next(); /* Call the next thing on the router */
|
||||
}).fail(function() { |
||||
|
||||
}); |
||||
}); |
||||
|
||||
function do_check_login() { |
||||
$("#loginError").css('display', 'none'); |
||||
var user = $("#username").val(); |
||||
var pass = $("#password").val(); |
||||
|
||||
if (!is_empty(user) && !is_empty(pass)) { |
||||
delete_cookie('scrollPos'); |
||||
var auth_obj = {username: user, password: pass}; |
||||
return check_user(auth_obj); |
||||
} |
||||
|
||||
setTimeout(function () { |
||||
$("#loginError").css('display', 'inline-block'); |
||||
}, 500); |
||||
} |
||||
|
||||
function check_user(auth_obj) { |
||||
var dfd = jQuery.Deferred(); |
||||
// var result = get_json_data(auth_obj, session_url);
|
||||
// result.then(function (response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: session_url,
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
contentType: 'application/json', |
||||
data: JSON.stringify(auth_obj), |
||||
success: function(response) { |
||||
|
||||
var ret = is_valid_user(response); |
||||
var users_id = ret[0]; |
||||
var valid = ret[1]; |
||||
var rights = ret[2]; |
||||
if (rights === false) { |
||||
var is_attack = -1; |
||||
} else { |
||||
var is_attack = rights.indexOf("attack"); |
||||
} |
||||
if (valid === false) { |
||||
if (is_attack === -1) { |
||||
$('#login-prompt-box') |
||||
.modal('setting', 'closable', false) |
||||
.modal('show'); |
||||
if (auth_obj.username !== 'default') { |
||||
$('#loginError').text('Invalid Username or Password.'); |
||||
} |
||||
} else { |
||||
$('#login-prompt-box') |
||||
.modal('setting', 'closable', false) |
||||
.modal('show'); |
||||
$('#loginError').text('Account Locked - bad attempts. Please wait 20 seconds, before logging in!'); |
||||
} |
||||
} else if (valid === true) { |
||||
req.user = users_id; |
||||
|
||||
$("#loginError").css('display', 'none'); |
||||
$('#login-prompt-box').modal('hide'); |
||||
// $.get( "app/home/get_full_name.html", function( data ) {
|
||||
// $( "#fullName" ).html( data ); /* Show users name in profile display */
|
||||
// });
|
||||
/* This is needed by varrious forms, Do NOT remove, please */ |
||||
$('<input>').attr({type: 'hidden', id: 'users-id', name: 'users_id', value: req.user}).appendTo('body'); |
||||
dfd.resolve(true); // Logged in
|
||||
} else { |
||||
console.log('System session was odd.'); |
||||
dfd.reject(false); |
||||
} |
||||
// }).catch(function (error) {
|
||||
// throw "Session Error";
|
||||
// });
|
||||
} |
||||
}); |
||||
return dfd.promise(); |
||||
}; // End of check_user
|
||||
|
||||
}; // End of user
|
||||
|
||||
function show_loader(req, event, next) { |
||||
// Hide Clock / Show Loader
|
||||
$('#clock').css('display', 'none'), |
||||
$('#topLoad').css('display', 'inline-block'); |
||||
// Show left loading spinner
|
||||
$("#main-container-left-body").addClass("loading"); |
||||
$("#main-container-right-body").addClass("loading"); |
||||
next(); |
||||
} |
||||
@ -0,0 +1,309 @@ |
||||
/* Rules for Money */ |
||||
$.fn.form.settings.rules.decimal_money = function(value) { |
||||
var regex = /^\d+(?:\.\d{0,2})$/; |
||||
return regex.test(value); |
||||
}; |
||||
|
||||
if (typeof Handlebars.registerHelper === 'function') { |
||||
Handlebars.registerHelper('ifeq', function (a, b, options) { |
||||
if (a == b) { return options.fn(this); } |
||||
return options.inverse(this); |
||||
}); |
||||
|
||||
Handlebars.registerHelper('ifnoteq', function (a, b, options) { |
||||
if (a != b) { return options.fn(this); } |
||||
return options.inverse(this); |
||||
});
|
||||
} |
||||
|
||||
function empty(str) { |
||||
return (typeof str == 'undefined' || !str || str.length === 0 || str === "" || !/[^\s]/.test(str) || /^\s*$/.test(str) || str.replace(/\s/g,"") === "") ? true : false; |
||||
} |
||||
|
||||
/* Helper for has_error */ |
||||
function get_json_from_html(str) { |
||||
var curly_brace_start = false; |
||||
var ret = ''; |
||||
for (var x = 0; x < str.length; x++) { |
||||
var c = str.charAt(x); |
||||
if (c === '{' && str.charAt(x + 1) === '"') { |
||||
curly_brace_start = true; |
||||
} |
||||
if (curly_brace_start === true) { |
||||
ret += c; |
||||
} |
||||
if (c === '"' && str.charAt(x + 1) === '}') { |
||||
return ret + '}'; // Return JSON Data
|
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
function has_saved(response, xhr, info) { |
||||
try { |
||||
var ct = xhr.getResponseHeader("content-type") || ""; |
||||
if (ct.indexOf('json') > -1) { |
||||
var t = (response.time) ? response.time : ''; |
||||
if (response.saved === true) { |
||||
saved_toast(info + ' at ' + t); |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} catch(err) { } |
||||
} |
||||
|
||||
function has_error(response, xhr, header) { |
||||
var heading = (typeof header === "undefined") ? 'Saving' : header; |
||||
var ct = xhr.getResponseHeader("content-type") || ""; |
||||
if (ct.indexOf('html') > -1) { |
||||
if (response.indexOf('hadError') === -1) { |
||||
return false; |
||||
} |
||||
var jsonData = get_json_from_html(response); |
||||
if (jsonData === false) { |
||||
return false; |
||||
} |
||||
try { |
||||
response = JSON.parse(jsonData); // Convert HTML to JSON
|
||||
} catch(err) { |
||||
// debug_print(err);
|
||||
} |
||||
} |
||||
if (response.user_message) { |
||||
reset_save_toast(); |
||||
if (response.fatal === true) { |
||||
$.toast({ |
||||
heading: 'Error ' + heading, |
||||
showHideTransition: 'slide', |
||||
text: response.user_message, |
||||
icon: 'error', |
||||
position: { |
||||
right: 35, |
||||
bottom: 65 |
||||
}, |
||||
hideAfter: 5000 // in milli seconds
|
||||
}); |
||||
} else { |
||||
$.toast({ |
||||
heading: 'Notice ' + heading, |
||||
showHideTransition: 'slide', |
||||
text: response.user_message, |
||||
icon: 'info', |
||||
position: { |
||||
right: 35, |
||||
bottom: 65 |
||||
}, |
||||
hideAfter: 5000 // in milli seconds
|
||||
}); |
||||
}
|
||||
|
||||
if (response.user_message !== 'Check the Error Console...') { |
||||
debug_print(response.user_message); |
||||
} |
||||
} |
||||
if (response.message) { |
||||
debug_print(response.message); |
||||
} |
||||
if (response.fatal === true) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
var saving = ''; |
||||
function saving_toast() { |
||||
saving = $.toast({ |
||||
text: '<i class="spinner loading icon"></i><b>Saving!</b> Please wait..', |
||||
textAlign: 'left', |
||||
loader: false, |
||||
showHideTransition: 'slide', |
||||
allowToastClose: false, |
||||
position: { |
||||
right: 35, |
||||
bottom: 65 |
||||
}, |
||||
}); |
||||
} |
||||
|
||||
function reset_save_toast() { |
||||
if (typeof saving === 'object') { |
||||
saving.reset(); |
||||
} |
||||
} |
||||
|
||||
function saved_toast(field) { |
||||
window.setTimeout(function() { |
||||
$.toast({ |
||||
heading: 'Success', |
||||
showHideTransition: 'slide', |
||||
text: 'Saved '+field+'.', |
||||
icon: 'success', |
||||
loader: true,
|
||||
hideAfter: 3000 |
||||
}); |
||||
reset_save_toast(); |
||||
}, 2000); |
||||
} |
||||
|
||||
function show_loading() { |
||||
/* Show the Loader / Hide the Clock */ |
||||
$('#topLoad').css('display', 'inline-block'); |
||||
$('#clock').css('display', 'none'); |
||||
} |
||||
|
||||
function done_loading() { |
||||
$("time.timeago").timeago(); |
||||
// Hide the Loader / Show the Clock
|
||||
$('#topLoad').css('display', 'none'); |
||||
$('#clock').css('display', 'inline-block'); |
||||
} |
||||
|
||||
/* Show a modal and load its data */ |
||||
function show_modal(url, id, modalname) { |
||||
$.ajax({ |
||||
url: url, |
||||
type: 'GET', |
||||
global: false, |
||||
async: true, |
||||
success: function (response, status, xhr) { |
||||
if (!has_error(response, xhr)) { |
||||
$("#" + id).html(response); |
||||
$("#" + modalname).modal('show'); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
function logout() { |
||||
$.ajax({ |
||||
url: "app/page/session.php", |
||||
type: 'GET', |
||||
data: {logout: 'true'}, |
||||
dataType: "html", |
||||
global: false, |
||||
async: true, |
||||
success: function (response) { |
||||
location.reload(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
var array_of_frames = []; /* Needed to track open iFrames */ |
||||
var print_frame_id = 0; |
||||
/* id is the id of the iframe */ |
||||
function print_frame(id, src) { |
||||
try { |
||||
for (var i = 0; i < array_of_frames.length; i++) { |
||||
document.body.removeChild(array_of_frames[i]); // Delete old page when done, for new data
|
||||
array_of_frames.pop(); |
||||
} |
||||
|
||||
var newIframe = document.createElement('iframe'); |
||||
newIframe.width = '0'; |
||||
newIframe.height = '0'; |
||||
newIframe.name = id; |
||||
newIframe.id = id; |
||||
newIframe.src = src; |
||||
print_frame_id = id; |
||||
|
||||
document.body.appendChild(newIframe); |
||||
array_of_frames.push(newIframe); /* Add frame to list to be removed next time */ |
||||
|
||||
newIframe.onload=done_print_frame; |
||||
|
||||
} catch (err) { |
||||
debug_print(err.message); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
function done_print_frame() { |
||||
var frm = document.getElementById(print_frame_id).contentWindow; |
||||
frm.focus(); // set focus on contentWindow is needed on some ie versions
|
||||
frm.print(); |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Form Messages: |
||||
*/ |
||||
function check_for_error(id, response, xhr, header) { |
||||
var heading = (typeof header === "undefined") ? 'Saving' : header; |
||||
var ct = xhr.getResponseHeader("content-type") || ""; |
||||
if (ct.indexOf('html') > -1) { |
||||
if (response.indexOf('hadError') === -1) { |
||||
return false; |
||||
} |
||||
var jsonData = get_json_from_html(response); |
||||
if (jsonData === false) { |
||||
return false; |
||||
} |
||||
try { |
||||
response = JSON.parse(jsonData); // Convert HTML to JSON
|
||||
} catch(err) { |
||||
// debug_print(err);
|
||||
} |
||||
} |
||||
if (response.user_message) { |
||||
if (response.fatal === true) { |
||||
do_message(id, 'error', 'Error:', heading); |
||||
} else { |
||||
do_message(id, 'info', 'Notice:', heading) |
||||
} |
||||
|
||||
if (response.user_message !== 'Check the Error Console...') { |
||||
debug_print(response.user_message); |
||||
} |
||||
|
||||
} |
||||
if (response.message) { |
||||
debug_print(response.message); |
||||
} |
||||
if (response.fatal === true) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
function did_save(id, response, xhr, info) { |
||||
try { |
||||
var ct = xhr.getResponseHeader("content-type") || ""; |
||||
if (ct.indexOf('json') > -1) { |
||||
var t = (response.time) ? response.time : ''; |
||||
if (response.saved === true) { |
||||
do_message(id, 'success', 'Saved:', info + ' at ' + t); |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} catch(err) { } |
||||
} |
||||
|
||||
|
||||
function do_message(id, kind, bold, normal) { |
||||
switch(kind) { |
||||
case 'success': |
||||
$('#'+id).removeClass('info'); |
||||
$('#'+id).removeClass('error'); |
||||
$('#'+id).addClass('success'); |
||||
$('#'+id).html('<p><i class="check circle icon"></i><b>'+bold+'</b> '+normal+'</p>'); |
||||
break; |
||||
case 'info': |
||||
$('#'+id).removeClass('error'); |
||||
$('#'+id).removeClass('success'); |
||||
$('#'+id).addClass('info'); |
||||
$('#'+id).html('<p><i class="info circle icon"></i><b>'+bold+'</b> '+normal+'</p>'); |
||||
break; |
||||
case 'error': |
||||
$('#'+id).removeClass('info'); |
||||
$('#'+id).removeClass('success'); |
||||
$('#'+id).addClass('error'); |
||||
$('#'+id).html('<p><i class="exclamation triangle icon"></i><b>'+bold+'</b> '+normal+'</p>'); |
||||
break; |
||||
} |
||||
$('#'+id).show(); |
||||
} |
||||