2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

!!! NEW ADMIN PANEL layout + required js and css libraries

modified functions/functions.xhtml.php file prepared for upcoming admin pages changes
This commit is contained in:
Alex
2015-02-12 00:00:05 +03:00
parent bdda1af5f3
commit dadad5ed63
28 changed files with 9338 additions and 101 deletions

164
admin/exten_tab.php Normal file
View File

@@ -0,0 +1,164 @@
<?php /**
/**
* Configuration file
*/
include_once(dirname(__FILE__).'/../config.inc.php');
/**
* Database file
*/
include ("../db.inc.php");
/**
* XHTML functions
*/
include ("../functions/functions.xhtml.php");
$msg = "";
if (isset($_GET))
{
foreach($_GET as $key=>$val)
{
if (substr($key,0,12) == "operator_id_")
{
if (isset($_GET['extension_id']))
{
$ex = intval($_GET['extension_id']);
$op = intval($val);
$sql = "UPDATE `extension`
SET current_operator_id = $op
WHERE extension_id = $ex
AND current_operator_id IS NULL";
$db->Execute($sql);
}
}
}
}
if (isset($_POST['extension']))
{
$extension = $db->qstr($_POST['extension']);
$password = $db->qstr($_POST['password']);
$extension_id = "NULL";
if (isset($_POST['extensionid']))
$extension_id = intval($_POST['extensionid']);
if (isset($_POST['delete']))
{
$sql = "DELETE FROM `extension`
WHERE current_operator_id IS NULL
AND extension_id = $extension_id";
$rs = $db->Execute($sql);
if (!$rs)
$msg = ("Failed to delete extension. There may be an operator currently assigned to it");
}
else
{
if (!empty($_POST['extension']))
{
$sql = "INSERT INTO `extension` (extension_id,extension,password)
VALUES ($extension_id,$extension,$password)
ON DUPLICATE KEY UPDATE extension=$extension,password=$password";
$rs = $db->Execute($sql);
if (!$rs)
$msg = T_("Failed to add extension. There already may be an extension of this name");
}
}
}
if (isset($_GET['unassign']))
{
$e = intval($_GET['unassign']);
$db->StartTrans();
$sql = "SELECT e.current_operator_id
FROM `extension` as e
LEFT JOIN `case` as c ON (c.current_operator_id = e.current_operator_id)
WHERE e.extension_id = $e
AND c.case_id IS NULL";
$cid = $db->GetOne($sql);
if (!empty($cid))
{
$sql = "UPDATE `extension` as e
SET current_operator_id = NULL
WHERE extension_id = $e
AND current_operator_id = $cid";
$db->Execute($sql);
}
$db->CompleteTrans();
}
xhtml_head(T_("Display extension status"),true,array("../css/table.css"),array("../js/window.js"));
if (isset($_GET['edit']))
{
$sql = "SELECT extension,password,current_operator_id
FROM extension
WHERE extension_id = " . intval($_GET['edit']);
$rs = $db->GetRow($sql);
}
else
{
$sql= "SELECT CONCAT('<a href=\'operatorlist.php?edit=',o.operator_id,'\'>',o.firstName,' ', o.lastname,'</a>') as firstName,
CONCAT('<a href=\'?edit=',e.extension_id,'\'>',e.extension,'</a>') as extension,
IF(c.case_id IS NULL,IF(e.current_operator_id IS NULL,'list'
,CONCAT('<a href=\'?unassign=',e.extension_id,'\'>". TQ_("Unassign") ."</a>')),'". TQ_("End case to change assignment")."') as assignment,
CASE e.status WHEN 0 THEN '" . TQ_("VoIP Offline") . "' ELSE '" . TQ_("VoIP Online") . "' END as status,
CASE ca.state WHEN 0 THEN '" . TQ_("Not called") . "' WHEN 1 THEN '" . TQ_("Requesting call") . "' WHEN 2 THEN '" . TQ_("Ringing") . "' WHEN 3 THEN '" . TQ_("Answered") . "' WHEN 4 THEN '" . TQ_("Requires coding") . "' ELSE '" . TQ_("Done") . "' END as state,
CONCAT('<a href=\'supervisor.php?case_id=', c.case_id , '\'>' , c.case_id, '</a>') as case_id, SEC_TO_TIME(TIMESTAMPDIFF(SECOND,cal.start,CONVERT_TZ(NOW(),'SYSTEM','UTC'))) as calltime,
e.status as vs,
e.extension_id
FROM extension as e
LEFT JOIN `operator` as o ON (o.operator_id = e.current_operator_id)
LEFT JOIN `case` as c ON (c.current_operator_id = o.operator_id)
LEFT JOIN `call_attempt` as cal ON (cal.operator_id = o.operator_id AND cal.end IS NULL and cal.case_id = c.case_id)
LEFT JOIN `call` as ca ON (ca.case_id = c.case_id AND ca.operator_id = o.operator_id AND ca.outcome_id= 0 AND ca.call_attempt_id = cal.call_attempt_id)
ORDER BY e.extension_id ASC";
$rs = $db->GetAll($sql);
if ($msg != "")
print "<p>$msg</p>";
if (!empty($rs))
{
$sql = "SELECT o.operator_id as value, CONCAT(o.firstName,' ', o.lastname) as description
FROM `operator` as o
LEFT JOIN `extension` as e ON (e.current_operator_id = o.operator_id)
WHERE e.extension_id IS NULL";
$ers = $db->GetAll($sql);
for ($i = 0; $i < count($rs); $i++)
{
if ($rs[$i]['assignment'] == "list")
$rs[$i]['assignment'] = display_chooser($ers,"operator_id_" . $rs[$i]["extension_id"],"operator_id_" . $rs[$i]["extension_id"],true,"extension_id=".$rs[$i]["extension_id"],true,false,false,false);
}
xhtml_table($rs,array("extension","firstName","assignment","status","case_id","state","calltime"),array(T_("Extension"),T_("Operator"),T_("Assignment"),T_("VoIP Status"),T_("Case ID"),T_("Call state"),T_("Time on call")),"tclass",array("vs" => "1"));
}
else
print "<p>" . T_("No extensions") . "</p>";
}
xhtml_foot();
?>

View File

@@ -1,4 +1,6 @@
<?php /**
<?php
/*
* Display an index of Admin tools
*
*
@@ -25,7 +27,6 @@
* @subpackage admin
* @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
*
*/
/**
@@ -37,95 +38,186 @@ include ("../lang.inc.php");
* Config file
*/
include ("../config.inc.php");
include ("../functions/functions.xhtml.php");
$username = $_SERVER['PHP_AUTH_USER'];
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" style="" class=" " >
<head>
<meta charset="utf-8" >
<title><?php echo T_("Administrative Tools") ;?> </title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
/**
* XHTML functions
*/
include ("../functions/functions.xhtml.php");
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" >
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" >
<link rel="stylesheet" href="../css/style.css" >
<!--
<script type="text/javascript" src="../js/modernizr.js"></script>
-->
</head>
<body>
xhtml_head(T_("Administrative Tools"),true,array("../css/table.css","../css/admin.css","../css/timepicker.css"));
<div class="page-header-fixed navbar navbar-fixed-top " role="banner">
<div class="container" style=" width: auto; padding-left: 1px;">
<div class="navbar-header">
<a class="pull-left menubutton " href="#" style="width: 50px; padding-left: 10px;" data-toggle="tooltip" data-placement="right" title="<?php echo T_("Click to Collapse / Expand Sidebar MENU ");?>">
<i class="fa fa-globe fa-2x fa-spin"></i></a>
<a class="navbar-brand" href="index.php"><?php echo COMPANY_NAME ;?> <span class="bold"><?php echo ADMIN_PANEL_NAME ;?></span></a>
</div >
<!--- User menu // not connected and not working yet // could be hidden -->
<ul class="nav navbar-nav pull-right">
<li class="dropdown pull-right user-data">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" >
<i class="fa fa-user fa fa-fw "></i><b><?php print T_("User") . "&ensp;" . $username ;?></b>&ensp;<b class="caret lg"></b>
</a>
<ul class="dropdown-menu" >
<li><a href="?page=profile.php"><i class="fa fa-list fa-fw "></i>&ensp;<?php print T_("Profile"); ?></a></li>
<li><a href="?page=settings.php"><i class="fa fa-cogs fa-fw "></i>&ensp;<?php print T_("Settings"); ?></a></li>
<li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i>&ensp;<?php print T_("Lock Screen"); ?></a></li>
<li><a href="../logout.php"><i class="fa fa-sign-out fa-fw "></i>&ensp;<?php print T_("Logout"); ?> </a></li>
</ul>
</li>
</ul>
</div>
</div>
print "<div id='menu'><ul class='navmenu'>";
<div class="content ">
print "<li><h3>" . T_("Questionnaire creation and management") . "</h3>";
print "<ul><li><a href='?page=" . LIME_URL ."admin/admin.php?action=newsurvey'>" . T_("Create an instrument in Limesurvey") . "</a></li>";
print "<li><a href=\"?page=new.php\">" . T_("Create a new questionnaire") . "</a></li>";
print "<li><a href=\"?page=questionnairelist.php\">" . T_("Questionnaire management") . "</a></li>";
print "<li><a href=\"?page=" . LIME_URL . "admin/admin.php\">" . T_("Administer instruments with Limesurvey") . "</a></li></ul></li>";
<!-- Sidebar menu -->
<div class="sidebar" >
<ul class="panel-group nav" id="nav">
<li><a class="" href="?page=dashboard.php"><i class="fa fa-tachometer fa-lg"></i><span><?php print T_("Dashboard") ;?></span></a></li>
<li class="has_sub"><a href="" class=""><i class="fa fa-list-alt fa-lg"></i><span class="arrow"><?php print T_("Questionnairies") ;?></span></a>
<ul style="">
<li><a href="?page=<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-file-text-o lime fa-fw"></i><?php print T_("Create an instrument in Limesurvey") ;?></a></li>
<li><a href="?page=new.php"><i class="fa fa-plus-circle fa-fw"></i><?php print T_("Create a new questionnaire") ;?></a></li>
<li><a href="?page=questionnairelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Questionnaire management") ;?></a></li>
<li><a href="?page=<?php echo LIME_URL ;?>admin/admin.php"><i class="fa fa-lemon-o lime fa-fw"></i><?php print T_("Administer instruments with Limesurvey") ;?></a></li>
<li><a href="?page=questionnaireprefill.php"><i class="fa fa-thumb-tack fa-fw"></i><?php print T_("Pre-fill questionnaire") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-book fa-lg"></i><span><?php print T_("Samples") ;?></span></a>
<ul style="">
<li><a href="?page=import.php"><i class="fa fa-upload fa-fw"></i><?php print T_("Import a sample file") ;?></a></li>
<li><a href="?page=samplelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Sample management") ;?></a></li>
<li><a href="?page=samplesearch.php"><i class="fa fa-search fa-fw"></i><?php print T_("Search the sample") ;?></a></li>
<li><a href="?page=assignsample.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign samples to questionnaires") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-calendar fa-lg"></i><span><?php print T_("Time slots and shifts") ;?></span></a>
<ul class="" style="">
<li><a href="?page=availabilitygroup.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Manage Time slots") ;?></a></li>
<li><a href="?page=questionnaireavailability.php"><i class="fa fa-thumb-tack fa-fw"></i><?php print T_("Assign Time slots to questionnaires") ;?></a></li>
<li><a href="?page=questionnairecatimeslots.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign call attempt time slots to questionnaire") ; ?></a></li>
<li><a href="?page=questionnairecatimeslotssample.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign call attempt time slots to questionnaire sample") ; ?></a></li>
<li><a href="?page=addshift.php"><i class="fa fa-calendar-o fa-fw"></i><?php print T_("Shift management") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-filter fa-lg"></i><span><?php print T_("Quotas") ;?></span></a>
<ul style="">
<li><a href="?page=quota.php"><i class="fa fa-list-ol fa-fw"></i><?php print T_("Quota management") ;?></a></li>
<li><a href="?page=quotarow.php"><i class="fa fa-list-ul fa-fw "></i><?php print T_("Quota row management") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-users"></i><span><?php print T_("Operators") ;?></span></a>
<ul class="" style="">
<li><a href="?page=operators.php"><i class="fa fa-user-plus fa-fw"></i><?php print T_("Add operators to the system") ;?></a></li>
<li><a href="?page=operatorlist.php"><i class="fa fa-user fa-fw"></i><?php print T_("Operator management") ;?></a></li>
<li><a href="?page=exten_tab.php "><i class="fa fa-phone-square fa-fw"></i><?php print T_("Extension status") ;?></a></li>
<li><a href="?page=operatorquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign operators to questionnaires") ;?></a></li>
<li><a href="?page=operatorskill.php"><i class="fa fa-user-md fa-fw"></i><?php print T_("Modify operator skills") ;?></a></li>
<li><a href="?page=operatorperformance.php"><i class="fa fa-signal fa-fw"></i><?php print T_("Operator performance") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-line-chart"></i><span><?php print T_("Results") ;?></span></a>
<ul class="" style="">
<li><a href="?page=displayappointments.php"><i class="fa fa-list-ul fa-fw"></i><span><?php print T_("Display all future appointments") ;?></span></a></li>
<li><a href="?page=samplecallattempts.php"><i class="fa fa-table fa-fw"></i><?php print T_("Sample call attempts report") ;?></a></li>
<li><a href="?page=callhistory.php" class=""><i class="fa fa-history fa-fw"></i><?php print T_("Call history") ;?></a></li>
<li><a href="?page=shiftreport.php"><i class="fa fa-th-large fa-fw"></i><?php print T_("Shift reports") ;?></a></li>
<li><a href="?page=quotareport.php" ><i class="fa fa-filter fa-fw"></i><?php print T_("Quota report") ;?></a></li>
<li><a href="?page=outcomes.php"><i class="fa fa-bar-chart fa-fw"></i><?php print T_("Questionnaire outcomes") ;?></a></li>
<li><a href="?page=dataoutput.php"><i class="fa fa-download fa-fw"></i><?php print T_("Data output") ;?></a></li>
</ul>
</li>
<!-- <li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-signal"></i><span><?php //print T_("Performance") ;?></span></a>
<ul class="" style="">
<li><a href="?page=operatorperformance.php"><i class="fa fa-coffee"></i><?php //print T_("Operator performance") ;?></a></li>
</ul>
</li> -->
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-user-secret fa-fw"></i><span><?php print T_("Clients") ;?></span></a>
<ul class="" style="">
<li><a href="?page=clients.php"><i class="fa fa-lg fa-user-plus fa-fw"></i><?php print T_("Add clients to the system") ;?></a></li>
<li><a href="?page=clientquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign clients to questionnaires") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-briefcase"></i><span><?php print T_("Supervisor functions") ;?></span></a>
<ul class="" style="">
<li><a href="?page=supervisor.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign outcomes to cases") ;?></a></li>
<li><a href="?page=casestatus.php"><i class="fa fa-question-circle fa-fw"></i><?php print T_("Case status and assignment") ;?></a></li>
<li><a href="?page=bulkappointment.php"><i class="fa fa-th-list fa-fw"></i><?php print T_("Bulk appointment generator") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-gear"></i><span><?php print T_("System settings") ;?></span></a>
<ul class="" style="">
<li><a href="?page=timezonetemplate.php"><i class="fa fa-globe fa-fw"></i><?php print T_("Set default timezone list") ;?></a></li>
<li><a href="?page=shifttemplate.php"><i class="fa fa-calendar fa-fw"></i><?php print T_("Set default shift times") ;?></a></li>
<li><a href="?page=callrestrict.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Set call restriction times") ;?></a></li>
<li><a href="?page=centreinfo.php"><i class="fa fa-university fa-fw"></i><?php print T_("Set centre information") ;?></a></li>
<li><a href="?page=supervisorchat.php"><i class="fa fa-comments-o fa-fw"></i><?php print T_("Supervisor chat") ;?></a></li>
<li><a href="?page=systemsort.php"><i class="fa fa-sort fa-fw"></i><?php print T_("System wide case sorting") ;?></a></li>
</ul>
</li>
print "<li><h3>" . T_("Sample/List management") . "</h3><ul>";
print "<li><a href=\"?page=import.php\">" . T_("Import a sample file (in CSV form)") . "</a></li>";
print "<li><a href=\"?page=samplelist.php\">" . T_("Sample management") . "</a></li>";
print "<li><a href=\"?page=assignsample.php\">" . T_("Assign samples to questionnaires") . "</a></li>";
print "<li><a href=\"?page=questionnaireprefill.php\">" . T_("Set values in questionnaire to pre fill") . "</a></li></ul></li>";
<?php
if (VOIP_ENABLED == true )
{ ; ?>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-tty"></i><span><?php print T_("VoIP");?><i class="fa fa-toggle-on pull-right" style="font-size:1.5em !important; margin-right:20px;"></i></span></a>
<ul class="" style="">
<li><a href="?page=voipmonitor.php"><i class="fa fa-power-off v"></i><?php print T_("Start and monitor VoIP") ;?></a></li>
<li><a href="?page=extensionstatus.php"><i class="fa fa-asterisk fa-fw"></i><?php print T_("Extension status") ;?></a></li>
</ul>
</li>
<?php } else {; ?>
<li class=""><a href="" class=""><i class="fa fa-lg fa-tty"></i><span><?php print T_("VoIP") . "&ensp;" . T_("Disabled") ;?><i class="fa fa-toggle-off pull-right" style="font-size:1.5em !important; margin-right:20px;"></i></span></a></li>
<?php }; ?>
</ul>
</div>
print "<li><h3>" . T_("Quota management") . "</h3><ul>";
print "<li><a href=\"?page=quota.php\">" . T_("Quota management") . "</a></li>";
print "<li><a href=\"?page=quotarow.php\">" . T_("Quota row management") . "</a></li></ul></li>";
<!-- Main page container -->
<?php $page = "callhistory.php"; if (isset($_GET['page'])) $page = $_GET['page']; ?>
<div class="mainbar" id=" "><?php xhtml_object($page,' '); ?></div>
print "<li><h3>" . T_("Operator management") . "</h3><ul>";
print "<li><a href=\"?page=operators.php\">" . T_("Add operators to the system") . "</a></li>";
print "<li><a href=\"?page=operatorlist.php\">" . T_("Operator management") . "</a></li>";
print "<li><a href=\"?page=operatorquestionnaire.php\">" . T_("Assign operators to questionnaires") . "</a></li>";
print "<li><a href=\"?page=operatorskill.php\">" . T_("Modify operator skills") . "</a></li></ul></li>";
<div class="clearfix"></div>
</div>
print "<li><h3>" . T_("Availability and shift management") . "</h3><ul>";
print "<li><a href=\"?page=availabilitygroup.php\">" . T_("Manage time slots") . "</a></li>";
print "<li><a href=\"?page=questionnaireavailability.php\">" . T_("Assign availabilities to questionnaires") . "</a></li>";
print "<li><a href=\"?page=questionnairecatimeslots.php\">" . T_("Assign call attempt time slots to questionnaire") . "</a></li>";
print "<li><a href=\"?page=questionnairecatimeslotssample.php\">" . T_("Assign call attempt time slots to questionnaire sample") . "</a></li>";
print "<li><a href=\"?page=addshift.php\">" . T_("Shift management (add/remove)") . "</a></li></ul></li>";
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/admin.js"></script>
print "<li><h3>" . T_("Questionnaire progress") . "</h3>";
print "<ul><li><a href=\"?page=displayappointments.php\">" . T_("Display all future appointments") . "</a></li>";
print "<li><a href=\"?page=samplecallattempts.php\">" . T_("Sample call attempts report") . "</a></li>";
print "<li><a href=\"?page=quotareport.php\">" . T_("Quota report") . "</a></li>";
print "<li><a href=\"?page=outcomes.php\">" . T_("Questionnaire outcomes") . "</a></li>";
print "<li><a href=\"?page=dataoutput.php\">" . T_("Data output") . "</a></li></ul></li>";
print "<li><h3>" . T_("Performance") . "</h3>";
print "<ul><li><a href=\"?page=operatorperformance.php\">" . T_("Operator performance") . "</a></li></ul></li>";
print "<li><h3>" . T_("Client management") . "</h3>";
print "<ul><li><a href=\"?page=clients.php\">" . T_("Add clients to the system") . "</a></li>";
print "<li><a href=\"?page=clientquestionnaire.php\">" . T_("Assign clients to questionnaires") . "</a></li></ul></li>";
print "<li><h3>" . T_("Supervisor functions") . "</h3>";
print "<ul><li><a href=\"?page=supervisor.php\">" . T_("Assign outcomes to cases") . "</a></li>";
print "<li><a href=\"?page=samplesearch.php\">" . T_("Search the sample") . "</a></li>";
print "<li><a href=\"?page=callhistory.php\">" . T_("Call history") . "</a></li>";
print "<li><a href=\"?page=shiftreport.php\">" . T_("Shift reports") . "</a></li>";
print "<li><a href=\"?page=casestatus.php\">" . T_("Case status and assignment") . "</a></li>";
print "<li><a href=\"?page=bulkappointment.php\">" . T_("Bulk appointment generator") . "</a></li></ul></li>";
print "<li><h3>" . T_("System settings") . "</h3>";
print "<ul><li><a href=\"?page=timezonetemplate.php\">" . T_("Set default timezone list") . "</a></li>";
print "<li><a href=\"?page=shifttemplate.php\">" . T_("Set default shift times") . "</a></li>";
print "<li><a href=\"?page=callrestrict.php\">" . T_("Set call restriction times") . "</a></li>";
print "<li><a href=\"?page=centreinfo.php\">" . T_("Set centre information") . "</a></li>";
print "<li><a href=\"?page=supervisorchat.php\">" . T_("Supervisor chat") . "</a></li>";
print "<li><a href=\"?page=systemsort.php\">" . T_("Start and monitor system wide case sorting") . "</a></li></ul></li>";
if (VOIP_ENABLED)
{
print "<li><h3>" . T_("VoIP") . "</h3>";
print "<ul><li><a href=\"?page=voipmonitor.php\">" . T_("Start and monitor VoIP") . "</a></li>";
print "<li><a href=\"?page=operatorlist.php\">" . T_("Operator management") . "</a></li>";
print "<li><a href=\"?page=extensionstatus.php\">" . T_("Extension status") . "</a></li></ul></li>";
}
print "</ul></div>";
$page = "new.php";
if (isset($_GET['page']))
$page = $_GET['page'];
print "<div id='main'>";
xhtml_object($page,"mainobj");
print "</div>";
xhtml_foot();
?>
<!-- implemented basket.js -->
<script type="text/javascript" src="../include/rsvp-latest.min.js"></script>
<script type="text/javascript" src="../include/basket.js/dist/basket.min.js"></script>
<script type="text/javascript">
basket.require({ url: '//code.jquery.com/jquery-2.1.3.min.js' })
.then(function () {
basket.require(
{ url: '//code.jquery.com/jquery-migrate-1.2.1.min.js' },
{ url: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js' }
)
});
basket.require(
{ url: '../include/bs-data-table/js/vendor/jquery.sortelements.js' },
{ url: '../include/bs-data-table/js/jquery.bdt.js' },
{ url: '../js/bootstrap-switch.min.js' }
);
</script>
</body>
</html>

6566
css/bootstrap-default.css vendored Normal file

File diff suppressed because it is too large Load Diff

22
css/bootstrap-switch.min.css vendored Normal file

File diff suppressed because one or more lines are too long

63
css/custom.css Normal file
View File

@@ -0,0 +1,63 @@
body {
/*
font-size: 1.5em;
line-height: 1.3em;*/
/* color: #515a63; or #666 */
/*padding-top: 0px;*/
background:#EEEFF2;
padding:0.8em;
}
/*.panel {
background-color: transparent; }
.panel-default {
border-color: transparent; }
.panel-heading {
padding-bottom: 15px; }
*/
a:focus, a:active, a:hover {
outline: 0 none !important;
}
.lime {
color:#C0CA55!important;
font-weight: bold !important;
}
/* Back to top */
.totop {
background: none;
bottom: 50px;
position: fixed;
right: 10px;
z-index: 104400;
}
.totop a, .totop a:visited {
color: gray;
display: block;
#height: 50px;
#line-height: 50px;
text-align: center;
min-width: 30px;
}
.totop a:hover {
color: #337ab7;
text-decoration: blink;
}
/*
.table-hover>tbody>tr:hover{
background-color:#ddd !important;
}
*/
.highlight {
background-color: #cccccc;
}
.btn-lime{
background-color:#C0CA55;
border-color: gray;
}
.btn-lime:hover,.btn-lime:focus{
background-color:#CED95B;
border-color: blue;
}

357
css/style.css Normal file
View File

@@ -0,0 +1,357 @@
/*@import url(http://fonts.googleapis.com/css?family=Roboto:400,600,700&subset=latin,latin-ext);*/
body, content {
/**/font-size: 15px;
line-height: 22px;
color: #666;
/*border-top: 0px solid #eee;*/
background:#474F57;
padding-top: 52px;
/*font-family: Roboto, Open Sans, sans-serif;*/
-webkit-font-smoothing: antialiased;
height:99.8%;
}
main
.content {
/* margin-top:51px;*/
}
.mainbar{
position: relative;
margin-left: 18%;
margin-right: 0px;
/*padding: 5px;*/
width: auto;
overflow:hidden;
background:#eee;
z-index: 25;
border:5px solid #ababab;
/*min-height: 600px;*/
}
.embeddedobject{
width: 100%;
height: 99%;
overflow:hidden;
}
.mainbar .container{
max-width:100% !important;
width: 100% !important;
padding-left: 10px;
padding-right: 5px;
}
.menubutton,.menubutton:focus,.menubutton:active{
font-size:18px;
border-right:1px solid #333;
;padding-right:11px;
;padding-left:3px;
padding:3px;
margin-top: 3px;
color:#ddd;
line-height:40px;
text-decoration:none;
outline:none;
}
.menubutton:hover{
color: red;
}
a:focus{
outline: 0 none !important;
}
.lime {
color:#C0CA55!important;
font-weight: bold !important;
}
/* Navbar */
.navbar *{
font-weight: normal !important;
text-shadow:none !important;
}
/*
.navbar{
background-color: #404952;
min-height:20px;
border-bottom: 0px solid #436B91;
-webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
}
*/
.navbar .caret{
border-top-color: #888;
border-bottom-color: #888;
}
.navbar li:hover .caret{
border-top-color: #eee;
border-bottom-color: #eee;
}
.navbar-brand{
color:#f1f1f1 !important;
font-size:22px;
margin:0px !important;
font-weight:normal;
padding:15px 20px 10px 15px;
text-shadow:1px 1px 1px rgba(150, 150, 150, 0.2) !important;
}
a.navbar-brand span.bold{
font-weight: bold !important;
text-shadow:1px 1px 1px rgba(150, 150, 150, 0.2) !important;
}
.navbar-nav > li.user-data > a{
color:#f3f3f3;
}
.navbar-nav > li > .dropdown-menu{
}
.navbar-nav > li > a {
padding-bottom: 10px;
padding-top: 15px;
}
.navbar-nav.pull-right .dropdown > a > i{
font-size:20px;
line-height:25px;
}
.navbar-toggle{
background:#f2f2f2;
border:1px solid #ccc;
border-radius:4px;
padding: 5px 5px;
font-size:13px;
}
.navbar-toggle:hover{
background:#ddd;
}
.navbar li a{
/*font-size: 13px !important;*/
color:#777;
}
.navbar .nav > li > a{
color: #aaa
}
.navbar li a:hover,.navbar li a:active,.navbar li a:focus,.nav .open > a, .nav .open > a:hover, .nav .open > a:focus{
background:#59646E;
color:#C5CED6;
}
.navbar i{
margin-right: 4px;
}
.navbar .btn{
color: #666 !important;
}
.navbar .label{
padding:5px 7px !important;
font-size:11px;
border-radius:10px;
}
.nav > li > a .label{
padding:3px 5px !important;
font-size:10px;
border-radius:10px;
position:absolute;
left:3px;
top:5px;
}
.navbar .label i{
margin-right: 0px;
}
.navbar .progress{
margin-bottom: 0px;
padding: 0px !important;
margin: 0px !important;
}
/* Sidebar */
.sidebar{
width: 18%;
float: left;
display: block;
color: #777;
;position: relative;
}
.sidebar .sidebar-dropdown{
;display: none;
}
.sidebar .sidebar-dropdown a{
color: #fff !important;
box-shadow: inset 0px 0px 1px #000;
background-color: #3D3D3D;
padding:6px;
text-transform: uppercase;
text-align: center;
font-size: 11px;
display: block;
border-top: 2px solid #666;
border-bottom: 1px solid #333;
}
.sidebar ul{
padding: 0px;
margin: 0px;
}
.sidebar ul li{
list-style-type: none;
}
.sidebar #nav {
display: block;
width:100%;
margin:0 auto;
position: relative;
z-index: 51;
}
.sidebar #nav li i{
display:inline-block;
margin-right: 10px;
margin-left: 5px;
/*;font-size:17px;*/
color:#d4d4d4;
width:20px;
line-height: 22px;
text-align: center;
}
.sidebar #nav li span i{
margin: 0px;
color: #999;
font-size:12px !important;
text-shadow: 0px -1px 1px rgba(0, 0, 0, 0.5);
background: transparent !important;
border: 0px;
}
.sidebar #nav > li > a {
display: block;
padding: 10px 10px;
font-size: 16px;
color: #C5CED6;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.6);
text-decoration: none;
border-top: 1px solid #515A63;
border-bottom: 1px solid #424A52;
background-color: #474F57;
}
.sidebar #nav > li:hover > a, .sidebar #nav > li > a.open, .sidebar #nav > li > a.subdrop {
color: #e9e9e9;
border-top: 1px solid #4F5861;
border-bottom: 1px solid #3C434A;
background-color: #3C434A;
box-shadow: none;
color: #fff;
}
.sidebar #nav > li > a:hover i, .sidebar #nav > li > a.open i, .sidebar #nav > li > a.subdrop i{
color: #fff;
}
.sidebar #nav > li > a:hover span i, .sidebar #nav > li > a.open span i, .sidebar #nav > li > a.subdrop span i{
color: #fff;
background: transparent !important;
border: 0px;
}
.sidebar #nav li ul { display: none; background: #efefef; }
.sidebar #nav li ul li a {
display: block;
background: #2E3338;
padding: 5px 10px;
padding-left: 20px;
text-decoration: none;
color: #bbb;
border-bottom: 1px solid #2E3338;
box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1);
}
.sidebar #nav li ul li a:hover,.sidebar #nav li ul li a.active {
background: #59646E;
color:#ccc;
border-bottom: 1px solid #59646E;
}
.sidebar #nav .has_sub ul i{
/*;font-size: 14px;*/
width:16px;
margin-left:0px;
/*margin-right:6px;*/
}
.sidebar #nav .has_sub .has_sub a.subdrop, .sidebar #nav .has_sub .has_sub a.subdrop i{
background: #59646E;
color:#fff;
}
.sidebar #nav .has_sub .has_sub ul a{
padding-left: 40px;
}
.sidebar #nav .has_sub .has_sub .has_sub ul a{
padding-left: 60px;
}
.sidebar-widget{
padding:10px 4px;
}
.content.enlarged .sidebar{
width:50px;
}
.content.enlarged .mainbar{
margin-left:50px;
}
.content.enlarged .sidebar .navbar-form:hover{
width:300px;
position:relative;
z-index:100;
}
.content.enlarged .sidebar #nav > li{
white-space: wrap; /* changed from nowrap */
}
.content.enlarged .sidebar #nav > li > ul{
display:none;
}
.content.enlarged .sidebar #nav > li:hover > ul{
position:absolute;
left:50px;
width:280px;
display:block;
}
.content.enlarged .sidebar #nav ul li:hover > a{
background: #59646E !important;
color:#fff;
}
.content.enlarged .sidebar #nav ul li:hover > a i{
background: #59646E !important;
color:#fff;
}
.content.enlarged .sidebar #nav ul li:hover > ul{
position:absolute;
left:280px;
margin-top:-32px;
width:280px;
display:block;
}
.content.enlarged .sidebar #nav > li:hover > ul a{
background:#2E3338;
padding-left:10px;
border:none;
box-shadow:none;
position:relative;
}
.content.enlarged .sidebar #nav ul li> a span.pull-right{
position: absolute;
right:5px;
top:5px;
}
.content.enlarged .sidebar #nav > li > a span{
display:none;
padding-left:20px;
}
.content.enlarged .sidebar #nav > li:hover > a span.pull-right{
position: absolute;
right:10px;
top:7px;
}
.content.enlarged .sidebar #nav > li:hover > a{
width:330px;
position:relative;
}
.content.enlarged .sidebar #nav > li{
position:relative;
}
.content.enlarged .sidebar #nav > li:hover > a span{
display:inline;
}
.content.enlarged .sidebar .navbar-form{
padding: 10px 7px;
}

View File

@@ -43,7 +43,7 @@
*
* @see xhtml_foot()
*/
function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false)
function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false,$subtitle=false)
{
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
?>
@@ -70,6 +70,8 @@ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
</head>
<?php
if ($bodytext) print "<body $bodytext>"; else print "<body>";
print "<h1 class='header text-primary'>" . "$title" . "&emsp;&emsp;<small>" . "$subtitle" . "</small></h1>";
/* Let's print header that equals to menu item and page title !!!, move previous headers to "subtitles"*/
}
/**
@@ -78,9 +80,13 @@ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
* @see xhtml_head()
*/
function xhtml_foot()
{
function xhtml_foot($javascript = false){ //added javascript files array to the footer
if ($javascript)
foreach ($javascript as $j) print "<script type='text/javascript' src='$j'></script>";
?>
<!--- Scroll to Top of the page -->
<span class="totop" style="display:none;"><a href=" "><i class="fa fa-3x fa-arrow-circle-o-up"></i></br><?php echo T_("UP");?></a></span>
</body>
</html>
@@ -97,18 +103,23 @@ function xhtml_foot()
* @param bool|array $highlight False if nothing to highlight else an array containing the field to highlight
* @param bool|array $total False if nothing to total else an array containing the fields to total
*
* AD:> for @value $class = "tclass" added "Bootstrap" table classes
* AD:> added @param string $id - > to transfer table ID if required
* AD:> added @param string $name - > to transfer table name if required
*/
function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight=false,$total=false)
function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight=false,$total=false,$id,$name)
{
$tot = array();
print "<table class='$class'>";
if ($class == "tclass") $class = "table-hover table-bordered table-condensed tclass";
print "<table class='$class' id='$id' name='$name'>";
if ($head)
{
print "<tr>";
print "<thead class='highlight'><tr>"; // ! added <thead> to table formatting
foreach ($head as $e)
print"<th>$e</th>";
print "</tr>";
print "</tr></thead>";
}
print "<tbody>";
foreach($content as $row)
{
if ($highlight && isset($row[key($highlight)]) && $row[key($highlight)] == current($highlight))
@@ -142,7 +153,7 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
}
print "</tr>";
}
print "</table>";
print "</tbody></table>";
}
@@ -165,11 +176,11 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
* @param bool $print Default is true, print the chooser otherwise return as a string
*
*/
function display_chooser($elements, $selectid, $var, $useblank = true, $pass = false, $js = true, $indiv = true, $selected = false, $print = true)
function display_chooser($elements, $selectid, $var, $useblank = true, $pass = false, $js = true, $indiv = true, $selected = false, $print = true, $class=false)
{
$out = "";
if ($indiv) $out .= "<div>";
$out .= "<select id='$selectid' name='$selectid' ";
if ($indiv) $out .= "<div class='$class'>";
$out .= "<select id='$selectid' name='$selectid' class='form-control'" ;
if ($js) $out .= "onchange=\"LinkUp('$selectid')\"";
$out .= ">";
if ($useblank)
@@ -215,9 +226,9 @@ function display_chooser($elements, $selectid, $var, $useblank = true, $pass = f
function xhtml_object($data, $id, $class="embeddedobject")
{
if (browser_ie())
print '<iframe class="'.$class.'" id="'.$id.'" src="'.$data.'" frameBorder="0"><p>Error, try with Firefox</p></iframe>';
print '<iframe class="'.$class.'" id="'.$id.'" src="'.$data.'" frameBorder="0"><p>Error while loading data from ' . "$data" . ', try with Frefox </p></iframe>';
else
print '<object class="'.$class.'" id="'.$id.'" data="'.$data.'" standby="Loading panel..." type="application/xhtml+xml"><p>Error, try with Firefox</p></object>';
print '<object class="'.$class.'" id="'.$id.'" data="'.$data.'" standby="Loading panel..." type="application/xhtml+xml"><p>Error while loading data from ' . "$data" . ', try with Frefox </p></object>';
}
/**
@@ -232,6 +243,4 @@ function browser_ie()
else
return false;
}
?>
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

265
include/basket.js/dist/basket.js vendored Normal file
View File

@@ -0,0 +1,265 @@
/*!
* basket.js
* v0.5.1 - 2014-08-16
* http://addyosmani.github.com/basket.js
* (c) Addy Osmani; License
* Created by: Addy Osmani, Sindre Sorhus, Andrée Hansson, Mat Scales
* Contributors: Ironsjp, Mathias Bynens, Rick Waldron, Felipe Morais
* Uses rsvp.js, https://github.com/tildeio/rsvp.js
*/(function( window, document ) {
'use strict';
var head = document.head || document.getElementsByTagName('head')[0];
var storagePrefix = 'basket-';
var defaultExpiration = 5000;
var addLocalStorage = function( key, storeObj ) {
try {
localStorage.setItem( storagePrefix + key, JSON.stringify( storeObj ) );
return true;
} catch( e ) {
if ( e.name.toUpperCase().indexOf('QUOTA') >= 0 ) {
var item;
var tempScripts = [];
for ( item in localStorage ) {
if ( item.indexOf( storagePrefix ) === 0 ) {
tempScripts.push( JSON.parse( localStorage[ item ] ) );
}
}
if ( tempScripts.length ) {
tempScripts.sort(function( a, b ) {
return a.stamp - b.stamp;
});
basket.remove( tempScripts[ 0 ].key );
return addLocalStorage( key, storeObj );
} else {
// no files to remove. Larger than available quota
return;
}
} else {
// some other error
return;
}
}
};
var getUrl = function( url ) {
var promise = new RSVP.Promise( function( resolve, reject ){
var xhr = new XMLHttpRequest();
xhr.open( 'GET', url );
xhr.onreadystatechange = function() {
if ( xhr.readyState === 4 ) {
if( xhr.status === 200 ) {
resolve( {
content: xhr.responseText,
type: xhr.getResponseHeader('content-type')
} );
} else {
reject( new Error( xhr.statusText ) );
}
}
};
// By default XHRs never timeout, and even Chrome doesn't implement the
// spec for xhr.timeout. So we do it ourselves.
setTimeout( function () {
if( xhr.readyState < 4 ) {
xhr.abort();
}
}, basket.timeout );
xhr.send();
});
return promise;
};
var saveUrl = function( obj ) {
return getUrl( obj.url ).then( function( result ) {
var storeObj = wrapStoreData( obj, result );
if (!obj.skipCache) {
addLocalStorage( obj.key , storeObj );
}
return storeObj;
});
};
var wrapStoreData = function( obj, data ) {
var now = +new Date();
obj.data = data.content;
obj.originalType = data.type;
obj.type = obj.type || data.type;
obj.skipCache = obj.skipCache || false;
obj.stamp = now;
obj.expire = now + ( ( obj.expire || defaultExpiration ) * 60 * 60 * 1000 );
return obj;
};
var isCacheValid = function(source, obj) {
return !source ||
source.expire - +new Date() < 0 ||
obj.unique !== source.unique ||
(basket.isValidItem && !basket.isValidItem(source, obj));
};
var handleStackObject = function( obj ) {
var source, promise, shouldFetch;
if ( !obj.url ) {
return;
}
obj.key = ( obj.key || obj.url );
source = basket.get( obj.key );
obj.execute = obj.execute !== false;
shouldFetch = isCacheValid(source, obj);
if( obj.live || shouldFetch ) {
if ( obj.unique ) {
// set parameter to prevent browser cache
obj.url += ( ( obj.url.indexOf('?') > 0 ) ? '&' : '?' ) + 'basket-unique=' + obj.unique;
}
promise = saveUrl( obj );
if( obj.live && !shouldFetch ) {
promise = promise
.then( function( result ) {
// If we succeed, just return the value
// RSVP doesn't have a .fail convenience method
return result;
}, function() {
return source;
});
}
} else {
source.type = obj.type || source.originalType;
promise = new RSVP.Promise( function( resolve ){
resolve( source );
});
}
return promise;
};
var injectScript = function( obj ) {
var script = document.createElement('script');
script.defer = true;
// Have to use .text, since we support IE8,
// which won't allow appending to a script
script.text = obj.data;
head.appendChild( script );
};
var handlers = {
'default': injectScript
};
var execute = function( obj ) {
if( obj.type && handlers[ obj.type ] ) {
return handlers[ obj.type ]( obj );
}
return handlers['default']( obj ); // 'default' is a reserved word
};
var performActions = function( resources ) {
resources.map( function( obj ) {
if( obj.execute ) {
execute( obj );
}
return obj;
} );
};
var fetch = function() {
var i, l, promises = [];
for ( i = 0, l = arguments.length; i < l; i++ ) {
promises.push( handleStackObject( arguments[ i ] ) );
}
return RSVP.all( promises );
};
var thenRequire = function() {
var resources = fetch.apply( null, arguments );
var promise = this.then( function() {
return resources;
}).then( performActions );
promise.thenRequire = thenRequire;
return promise;
};
window.basket = {
require: function() {
var promise = fetch.apply( null, arguments ).then( performActions );
promise.thenRequire = thenRequire;
return promise;
},
remove: function( key ) {
localStorage.removeItem( storagePrefix + key );
return this;
},
get: function( key ) {
var item = localStorage.getItem( storagePrefix + key );
try {
return JSON.parse( item || 'false' );
} catch( e ) {
return false;
}
},
clear: function( expired ) {
var item, key;
var now = +new Date();
for ( item in localStorage ) {
key = item.split( storagePrefix )[ 1 ];
if ( key && ( !expired || this.get( key ).expire <= now ) ) {
this.remove( key );
}
}
return this;
},
isValidItem: null,
timeout: 5000,
addHandler: function( types, handler ) {
if( !Array.isArray( types ) ) {
types = [ types ];
}
types.forEach( function( type ) {
handlers[ type ] = handler;
});
},
removeHandler: function( types ) {
basket.addHandler( types, undefined );
}
};
// delete expired keys
basket.clear( true );
})( this, document );

11
include/basket.js/dist/basket.min.js vendored Normal file
View File

@@ -0,0 +1,11 @@
/*!
* basket.js
* v0.5.1 - 2014-08-16
* http://addyosmani.github.com/basket.js
* (c) Addy Osmani; License
* Created by: Addy Osmani, Sindre Sorhus, Andrée Hansson, Mat Scales
* Contributors: Ironsjp, Mathias Bynens, Rick Waldron, Felipe Morais
* Uses rsvp.js, https://github.com/tildeio/rsvp.js
*/
!function(a,b){"use strict";var c=b.head||b.getElementsByTagName("head")[0],d="basket-",e=5e3,f=function(a,b){try{return localStorage.setItem(d+a,JSON.stringify(b)),!0}catch(c){if(c.name.toUpperCase().indexOf("QUOTA")>=0){var e,g=[];for(e in localStorage)0===e.indexOf(d)&&g.push(JSON.parse(localStorage[e]));return g.length?(g.sort(function(a,b){return a.stamp-b.stamp}),basket.remove(g[0].key),f(a,b)):void 0}return}},g=function(a){var b=new RSVP.Promise(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.onreadystatechange=function(){4===d.readyState&&(200===d.status?b({content:d.responseText,type:d.getResponseHeader("content-type")}):c(new Error(d.statusText)))},setTimeout(function(){d.readyState<4&&d.abort()},basket.timeout),d.send()});return b},h=function(a){return g(a.url).then(function(b){var c=i(a,b);return a.skipCache||f(a.key,c),c})},i=function(a,b){var c=+new Date;return a.data=b.content,a.originalType=b.type,a.type=a.type||b.type,a.skipCache=a.skipCache||!1,a.stamp=c,a.expire=c+60*(a.expire||e)*60*1e3,a},j=function(a,b){return!a||a.expire-+new Date<0||b.unique!==a.unique||basket.isValidItem&&!basket.isValidItem(a,b)},k=function(a){var b,c,d;if(a.url)return a.key=a.key||a.url,b=basket.get(a.key),a.execute=a.execute!==!1,d=j(b,a),a.live||d?(a.unique&&(a.url+=(a.url.indexOf("?")>0?"&":"?")+"basket-unique="+a.unique),c=h(a),a.live&&!d&&(c=c.then(function(a){return a},function(){return b}))):(b.type=a.type||b.originalType,c=new RSVP.Promise(function(a){a(b)})),c},l=function(a){var d=b.createElement("script");d.defer=!0,d.text=a.data,c.appendChild(d)},m={"default":l},n=function(a){return a.type&&m[a.type]?m[a.type](a):m["default"](a)},o=function(a){a.map(function(a){return a.execute&&n(a),a})},p=function(){var a,b,c=[];for(a=0,b=arguments.length;b>a;a++)c.push(k(arguments[a]));return RSVP.all(c)},q=function(){var a=p.apply(null,arguments),b=this.then(function(){return a}).then(o);return b.thenRequire=q,b};a.basket={require:function(){var a=p.apply(null,arguments).then(o);return a.thenRequire=q,a},remove:function(a){return localStorage.removeItem(d+a),this},get:function(a){var b=localStorage.getItem(d+a);try{return JSON.parse(b||"false")}catch(c){return!1}},clear:function(a){var b,c,e=+new Date;for(b in localStorage)c=b.split(d)[1],c&&(!a||this.get(c).expire<=e)&&this.remove(c);return this},isValidItem:null,timeout:5e3,addHandler:function(a,b){Array.isArray(a)||(a=[a]),a.forEach(function(a){m[a]=b})},removeHandler:function(a){basket.addHandler(a,void 0)}},basket.clear(!0)}(this,document);
//# sourceMappingURL=basket.min.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"basket.min.js","sources":["basket.js"],"names":["window","document","head","getElementsByTagName","storagePrefix","defaultExpiration","addLocalStorage","key","storeObj","localStorage","setItem","JSON","stringify","e","name","toUpperCase","indexOf","item","tempScripts","push","parse","length","sort","a","b","stamp","basket","remove","getUrl","url","promise","RSVP","Promise","resolve","reject","xhr","XMLHttpRequest","open","onreadystatechange","readyState","status","content","responseText","type","getResponseHeader","Error","statusText","setTimeout","abort","timeout","send","saveUrl","obj","then","result","wrapStoreData","skipCache","data","now","Date","originalType","expire","isCacheValid","source","unique","isValidItem","handleStackObject","shouldFetch","get","execute","live","injectScript","script","createElement","defer","text","appendChild","handlers","default","performActions","resources","map","fetch","i","l","promises","arguments","all","thenRequire","apply","this","require","removeItem","getItem","clear","expired","split","addHandler","types","handler","Array","isArray","forEach","removeHandler","undefined"],"mappings":"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"}

1
include/basket.js/dist/basket.min.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"dist/basket.min.js","sources":["dist/basket.js"],"names":["window","document","head","getElementsByTagName","storagePrefix","defaultExpiration","addLocalStorage","key","storeObj","localStorage","setItem","JSON","stringify","e","name","toUpperCase","indexOf","item","tempScripts","push","parse","length","sort","a","b","stamp","basket","remove","getUrl","url","promise","RSVP","Promise","resolve","reject","xhr","XMLHttpRequest","open","onreadystatechange","readyState","status","content","responseText","type","getResponseHeader","Error","statusText","send","saveUrl","obj","then","result","wrapStoreData","data","now","Date","originalType","expire","isCacheValid","source","unique","isValidItem","handleStackObject","shouldFetch","get","execute","live","injectScript","script","createElement","defer","text","appendChild","handlers","default","performActions","resources","map","fetch","i","l","promises","arguments","all","thenRequire","apply","this","require","removeItem","getItem","clear","expired","split","timeout","addHandler","types","handler","Array","isArray","forEach","removeHandler","undefined"],"mappings":"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"}

21
include/basket.js/license Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Basket.js team
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.

View File

@@ -0,0 +1,36 @@
/**
* Custom styles for BDT - Bootstrap Data Tables
**/
.bdt thead th {
cursor: pointer;
}
/*
.bdt .sort-icon {
width: 10px;
display: inline-block;
padding-left: 5px;
} */
#table-footer {
margin-bottom: 15px;
margin-top: 10px;
min-height:35px;
}
#table-footer a, #table-footer button {
outline: none;
}
#table-footer .form-horizontal .control-label {
text-align: left;
margin: 0 15px;
}
#table-footer .pagination {
margin: 0 15px;
}
#table-footer .pagination li:not(.active) {
cursor: pointer;
}

View File

@@ -0,0 +1 @@
.bdt thead th{cursor:pointer}.bdt .sort-icon{width:10px;display:inline-block;padding-left:5px}#table-footer{margin-bottom:15px}#table-footer a,#table-footer button{outline:0}#table-footer .form-horizontal .control-label{text-align:left;margin:0 15px}#table-footer .pagination{margin:0 15px}#table-footer .pagination li:not(.active){cursor:pointer}

View File

@@ -0,0 +1,447 @@
/**
* @license MIT
* @license http://opensource.org/licenses/MIT Massachusetts Institute of Technology
* @copyright 2014 Patric Gutersohn
* @author Patric Gutersohn
* @example index.html BDT in action.
* @link http://bdt.gutersohn.biz Documentation
* @version 1.0.0
*
* @summary BDT - Bootstrap Data Tables
* @description sorting, paginating and search for bootstrap tables
*/
(function ($) {
"use strict";
/**
* @type {number}
*/
var actualPage = 1;
/**
* @type {number}
*/
var pageCount = 0;
/**
* @type {number}
*/
var pageRowCount = 0;
/**
* @type {string}
*/
var pages = 'Тоtal pages';
/**
* @type {object}
*/
var obj = null;
/**
* @type {boolean}
*/
var activeSearch = false;
/**
* @type {string}
*/
var arrowUp = ' ';
/**
* @type {string}
*/
var arrowDown = ' ';
$.fn.bdt = function (options, callback) {
var settings = $.extend({
pageRowCount: 50,
arrowDown: 'fa-arrow-down text-primary fa-lg',
arrowUp: 'fa-arrow-up text-primary fa-lg'
}, options);
/**
* @type {object}
*/
var tableBody = null;
return this.each(function () {
obj = $(this).addClass('bdt');
tableBody = obj.find("tbody");
pageRowCount = settings.pageRowCount;
arrowDown = settings.arrowDown;
arrowUp = settings.arrowUp;
/**
* search input field
*/
obj.before(
$('<form/>')
.addClass('float-left')
.attr('role', 'form')
.attr('style', 'width:30%;')
.append(
$('<div/>')
.addClass('form-group')
.append(
$('<input/>')
.addClass('form-control')
.attr('id', 'search')
.attr('placeholder', 'Type to Search here ...' )
)
)
);
/**
* select field for changing row per page
*/
obj.after(
$('<div/>')
.attr('id', 'table-footer')
.append(
$('<div/>')
.addClass('pull-left')
.append(
$('<form/>')
.addClass('form-horizontal')
.attr('id', 'page-rows-form')
.append($('<label/>')
.addClass('pull-left control-label')
.text('Rows per Page:')
)
.append(
$('<div/>')
.addClass('pull-left')
.append(
$('<select/>')
.addClass('form-control')
.append(
$('<option>', {
value: 25,
text: 25
})
)
.append(
$('<option>', {
value: 50,
text: 50,
selected: 'selected'
})
)
.append(
$('<option>', {
value: 100,
text: 100
})
)
.append(
$('<option>', {
value: 200,
text: 200
})
)
.append(
$('<option>', {
value: 500,
text: 500
})
)
)
)
)
)
);
if (tableBody.children('tr').length > pageRowCount) {
setPageCount(tableBody);
addPages();
paginate(tableBody, actualPage);
}
searchTable(tableBody);
sortColumn(obj, tableBody);
$('body').on('click', '.pagination li', function (event) {
var listItem;
if ($(event.target).is("a")) {
listItem = $(event.target).parent();
} else {
listItem = $(event.target).parent().parent();
}
var page = listItem.data('page');
if (!listItem.hasClass("disabled") && !listItem.hasClass("active")) {
paginate(tableBody, page);
}
});
$('#page-rows-form').on('change', function () {
var options = $(this).find('select');
pageRowCount = options.val();
setPageCount(tableBody);
addPages();
paginate(tableBody, 1);
});
});
/**
* the main part of this function is out of this thread http://stackoverflow.com/questions/3160277/jquery-table-sort
* @author James Padolsey http://james.padolsey.com
* @link http://jsfiddle.net/spetnik/gFzCk/1953/
* @param obj
*/
function sortColumn(obj) {
var table = obj;
var oldIndex = 0;
obj
.find('thead th')
.append(
$('<span class="pull-right"/>')
// .addClass('')
.append(
$('<i class=" "/>')
.addClass('fa sort-icon')
)
)
//.wrapInner('<p class="sort-element "/>')
.wrapInner('<div class=" "/>')
.each(function () {
var th = $(this);
var thIndex = th.index();
var inverse = false;
var addOrRemove = true;
th.click(function () {
if($(this).find('.sort-icon').hasClass(arrowDown)) {
$(this)
.find('.sort-icon')
.removeClass( arrowDown )
.addClass(arrowUp);
} else {
$(this)
.find('.sort-icon')
.removeClass( arrowUp )
.addClass(arrowDown);
}
if(oldIndex != thIndex) {
obj.find('.sort-icon').removeClass(arrowDown);
obj.find('.sort-icon').removeClass(arrowUp);
$(this)
.find('.sort-icon')
.toggleClass( arrowDown, addOrRemove );
}
table.find('td').filter(function () {
return $(this).index() === thIndex;
}).sortElements(function (a, b) {
return $.text([a]) > $.text([b]) ?
inverse ? -1 : 1
: inverse ? 1 : -1;
}, function () {
// parentNode is the element we want to move
return this.parentNode;
});
inverse = !inverse;
oldIndex = thIndex;
});
});
}
/**
* create li elements for pages
*/
function addPages() {
$('#table-nav').remove();
pages = $('<ul/>');
$.each(new Array(pageCount), function (index) {
var additonalClass = '';
var page = $();
if ((index + 1) == 1) {
additonalClass = 'active';
}
pages
.append($('<li/>')
.addClass(additonalClass)
.data('page', (index + 1))
.append(
$('<a/>')
.text(index + 1)
)
);
});
/**
* pagination, with pages and previous and next link
*/
$('#table-footer')
.addClass('form-group')
.append(
$('<nav/>')
.addClass('pull-right')
.attr('id', 'table-nav')
.append(
pages
.addClass('pagination pull-right')
.prepend(
$('<li/>')
.addClass('disabled')
.data('page', 'previous')
.append(
$('<a href="#" />')
.append(
$('<span/>')
.attr('aria-hidden', 'true')
.html('&laquo;')
)
.append(
$('<span/>')
.addClass('sr-only')
.text('Previous')
)
)
)
.append(
$('<li/>')
.addClass('disabled')
.data('page', 'next')
.append(
$('<a href="#" />')
.append(
$('<span/>')
.attr('aria-hidden', 'true')
.html('&raquo;')
)
.append(
$('<span/>')
.addClass('sr-only')
.text('Next')
)
)
)
)
);
}
/**
*
* @param tableBody
*/
function searchTable(tableBody) {
$("#search").on("keyup", function () {
$.each(tableBody.find("tr"), function () {
var text = $(this)
.text()
.replace(/ /g, '')
.replace(/(\r\n|\n|\r)/gm, "");
var searchTerm = $("#search").val();
if (text.toLowerCase().indexOf(searchTerm.toLowerCase()) == -1) {
$(this)
.hide()
.removeClass('search-item');
} else {
$(this)
.show()
.addClass('search-item');
}
if (searchTerm != '') {
activeSearch = true;
} else {
activeSearch = false;
}
});
setPageCount(tableBody);
addPages();
paginate(tableBody, 1);
});
}
/**
*
* @param tableBody
*/
function setPageCount(tableBody) {
if (activeSearch) {
pageCount = Math.round(tableBody.children('.search-item').length / pageRowCount);
} else {
pageCount = Math.round(tableBody.children('tr').length / pageRowCount);
}
if (pageCount == 0) {
pageCount = 1;
}
}
/**
*
* @param tableBody
* @param page
*/
function paginate(tableBody, page) {
if (page == 'next') {
page = actualPage + 1;
} else if (page == 'previous') {
page = actualPage - 1;
}
actualPage = page;
var rows = (activeSearch ? tableBody.find(".search-item") : tableBody.find("tr"));
var endRow = (pageRowCount * page);
var startRow = (endRow - pageRowCount);
var pagination = $('.pagination');
rows
.hide();
rows
.slice(startRow, endRow)
.show();
pagination
.find('li')
.removeClass('active disabled');
pagination
.find('li:eq(' + page + ')')
.addClass('active');
if (page == 1) {
pagination
.find('li:first')
.addClass('disabled');
} else if (page == pageCount) {
pagination
.find('li:last')
.addClass('disabled');
}
}
}
}(jQuery));

View File

@@ -0,0 +1,13 @@
/**
* @license MIT
* @license http://opensource.org/licenses/MIT Massachusetts Institute of Technology
* @copyright 2014 Patric Gutersohn
* @author Patric Gutersohn
* @example index.html BDT in action.
* @link http://bdt.gutersohn.biz Documentation
* @version 1.0.0
*
* @summary BDT - Bootstrap Data Tables
* @description sorting, paginating and search for bootstrap tables
*/
(function(e){"use strict";var t=1;var n=0;var r=0;var i="";var s=null;var o=false;var u="";var a="";e.fn.bdt=function(f,l){function p(t){var n=t;var r=0;t.find("thead th").wrapInner('<span class="sort-element"/>').append(e("<span/>").addClass("sort-icon fa")).each(function(){var i=e(this);var s=i.index();var o=false;var f=true;i.click(function(){if(e(this).find(".sort-icon").hasClass(a)){e(this).find(".sort-icon").removeClass(a).addClass(u)}else{e(this).find(".sort-icon").removeClass(u).addClass(a)}if(r!=s){t.find(".sort-icon").removeClass(a);t.find(".sort-icon").removeClass(u);e(this).find(".sort-icon").toggleClass(a,f)}n.find("td").filter(function(){return e(this).index()===s}).sortElements(function(t,n){return e.text([t])>e.text([n])?o?-1:1:o?1:-1},function(){return this.parentNode});o=!o;r=s})})}function d(){e("#table-nav").remove();i=e("<ul/>");e.each(new Array(n),function(t){var n="";var r=e();if(t+1==1){n="active"}i.append(e("<li/>").addClass(n).data("page",t+1).append(e("<a/>").text(t+1)))});e("#table-footer").addClass("row").append(e("<nav/>").addClass("pull-right").attr("id","table-nav").append(i.addClass("pagination pull-right").prepend(e("<li/>").addClass("disabled").data("page","previous").append(e('<a href="#" />').append(e("<span/>").attr("aria-hidden","true").html("&laquo;")).append(e("<span/>").addClass("sr-only").text("Previous")))).append(e("<li/>").addClass("disabled").data("page","next").append(e('<a href="#" />').append(e("<span/>").attr("aria-hidden","true").html("&raquo;")).append(e("<span/>").addClass("sr-only").text("Next"))))))}function v(t){e("#search").on("keyup",function(){e.each(t.find("tr"),function(){var t=e(this).text().replace(/ /g,"").replace(/(\r\n|\n|\r)/gm,"");var n=e("#search").val();if(t.toLowerCase().indexOf(n.toLowerCase())==-1){e(this).hide().removeClass("search-item")}else{e(this).show().addClass("search-item")}if(n!=""){o=true}else{o=false}});m(t);d();g(t,1)})}function m(e){if(o){n=Math.round(e.children(".search-item").length/r)}else{n=Math.round(e.children("tr").length/r)}if(n==0){n=1}}function g(i,s){if(s=="next"){s=t+1}else if(s=="previous"){s=t-1}t=s;var u=o?i.find(".search-item"):i.find("tr");var a=r*s;var f=a-r;var l=e(".pagination");u.hide();u.slice(f,a).show();l.find("li").removeClass("active disabled");l.find("li:eq("+s+")").addClass("active");if(s==1){l.find("li:first").addClass("disabled")}else if(s==n){l.find("li:last").addClass("disabled")}}var c=e.extend({pageRowCount:10,arrowDown:"fa-angle-down",arrowUp:"fa-angle-up"},f);var h=null;return this.each(function(){s=e(this).addClass("bdt");h=s.find("tbody");r=c.pageRowCount;a=c.arrowDown;u=c.arrowUp;s.before(e("<form/>").addClass("pull-right").attr("role","form").append(e("<div/>").addClass("form-group").append(e("<input/>").addClass("form-control").attr("id","search").attr("placeholder","Search..."))));s.after(e("<div/>").attr("id","table-footer").append(e("<div/>").addClass("pull-left").append(e("<form/>").addClass("form-horizontal").attr("id","page-rows-form").append(e("<label/>").addClass("pull-left control-label").text("Entries per Page:")).append(e("<div/>").addClass("pull-left").append(e("<select/>").addClass("form-control").append(e("<option>",{value:5,text:5})).append(e("<option>",{value:10,text:10,selected:"selected"})).append(e("<option>",{value:15,text:15})).append(e("<option>",{value:20,text:20})).append(e("<option>",{value:25,text:25})))))));if(h.children("tr").length>r){m(h);d();g(h,t)}v(h);p(s,h);e("body").on("click",".pagination li",function(t){var n;if(e(t.target).is("a")){n=e(t.target).parent()}else{n=e(t.target).parent().parent()}var r=n.data("page");if(!n.hasClass("disabled")&&!n.hasClass("active")){g(h,r)}});e("#page-rows-form").on("change",function(){var t=e(this).find("select");r=t.val();m(h);d();g(h,1)})})}})(jQuery)

View File

@@ -0,0 +1,69 @@
/**
* jQuery.fn.sortElements
* --------------
* @author James Padolsey (http://james.padolsey.com)
* @version 0.11
* @updated 18-MAR-2010
* --------------
* @param Function comparator:
* Exactly the same behaviour as [1,2,3].sort(comparator)
*
* @param Function getSortable
* A function that should return the element that is
* to be sorted. The comparator will run on the
* current collection, but you may want the actual
* resulting sort to occur on a parent or another
* associated element.
*
* E.g. $('td').sortElements(comparator, function(){
* return this.parentNode;
* })
*
* The <td>'s parent (<tr>) will be sorted instead
* of the <td> itself.
*/
jQuery.fn.sortElements = (function(){
var sort = [].sort;
return function(comparator, getSortable) {
getSortable = getSortable || function(){return this;};
var placements = this.map(function(){
var sortElement = getSortable.call(this),
parentNode = sortElement.parentNode,
// Since the element itself will change position, we have
// to have some way of storing it's original position in
// the DOM. The easiest way is to have a 'flag' node:
nextSibling = parentNode.insertBefore(
document.createTextNode(''),
sortElement.nextSibling
);
return function() {
if (parentNode === this) {
throw new Error(
"You can't sort elements if any one is a descendant of another."
);
}
// Insert before flag:
parentNode.insertBefore(this, nextSibling);
// Remove flag:
parentNode.removeChild(nextSibling);
};
});
return sort.call(this, comparator).each(function(i){
placements[i].call(getSortable.call(this));
});
};
})();

View File

@@ -0,0 +1,195 @@
/* ========================================================================
* bootstrap-switch - v3.3.0
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
.bootstrap-switch {
display: inline-block;
direction: ltr;
cursor: pointer;
border-radius: 4px;
border: 1px solid;
border-color: #cccccc;
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
vertical-align: middle;
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.bootstrap-switch .bootstrap-switch-container {
display: inline-block;
top: 0;
border-radius: 4px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
display: inline-block !important;
height: 100%;
padding: 6px 12px;
font-size: 14px;
line-height: 20px;
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off {
text-align: center;
z-index: 1;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
color: #fff;
background: #428bca;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
color: #fff;
background: #5bc0de;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
color: #fff;
background: #5cb85c;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
background: #f0ad4e;
color: #fff;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
color: #fff;
background: #d9534f;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
color: #000;
background: #eeeeee;
}
.bootstrap-switch .bootstrap-switch-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
color: #333333;
background: #ffffff;
}
.bootstrap-switch .bootstrap-switch-handle-on {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch .bootstrap-switch-handle-off {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch input[type='radio'],
.bootstrap-switch input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
z-index: -1;
}
.bootstrap-switch input[type='radio'].form-control,
.bootstrap-switch input[type='checkbox'].form-control {
height: auto;
}
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
padding: 6px 16px;
font-size: 18px;
line-height: 1.33;
}
.bootstrap-switch.bootstrap-switch-disabled,
.bootstrap-switch.bootstrap-switch-readonly,
.bootstrap-switch.bootstrap-switch-indeterminate {
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
-webkit-transition: margin-left 0.5s;
transition: margin-left 0.5s;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-focused {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,698 @@
/* ========================================================================
* bootstrap-switch - v3.3.0
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
(function() {
var __slice = [].slice;
(function($, window) {
"use strict";
var BootstrapSwitch;
BootstrapSwitch = (function() {
function BootstrapSwitch(element, options) {
var initInterval;
if (options == null) {
options = {};
}
this.$element = $(element);
this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
state: this.$element.is(":checked"),
size: this.$element.data("size"),
animate: this.$element.data("animate"),
disabled: this.$element.is(":disabled"),
readonly: this.$element.is("[readonly]"),
indeterminate: this.$element.data("indeterminate"),
inverse: this.$element.data("inverse"),
radioAllOff: this.$element.data("radio-all-off"),
onColor: this.$element.data("on-color"),
offColor: this.$element.data("off-color"),
onText: this.$element.data("on-text"),
offText: this.$element.data("off-text"),
labelText: this.$element.data("label-text"),
handleWidth: this.$element.data("handle-width"),
labelWidth: this.$element.data("label-width"),
baseClass: this.$element.data("base-class"),
wrapperClass: this.$element.data("wrapper-class")
}, options);
this.$wrapper = $("<div>", {
"class": (function(_this) {
return function() {
var classes;
classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
classes.push(_this.options.state ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
if (_this.options.size != null) {
classes.push("" + _this.options.baseClass + "-" + _this.options.size);
}
if (_this.options.disabled) {
classes.push("" + _this.options.baseClass + "-disabled");
}
if (_this.options.readonly) {
classes.push("" + _this.options.baseClass + "-readonly");
}
if (_this.options.indeterminate) {
classes.push("" + _this.options.baseClass + "-indeterminate");
}
if (_this.options.inverse) {
classes.push("" + _this.options.baseClass + "-inverse");
}
if (_this.$element.attr("id")) {
classes.push("" + _this.options.baseClass + "-id-" + (_this.$element.attr("id")));
}
return classes.join(" ");
};
})(this)()
});
this.$container = $("<div>", {
"class": "" + this.options.baseClass + "-container"
});
this.$on = $("<span>", {
html: this.options.onText,
"class": "" + this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
});
this.$off = $("<span>", {
html: this.options.offText,
"class": "" + this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
});
this.$label = $("<span>", {
html: this.options.labelText,
"class": "" + this.options.baseClass + "-label"
});
this.$element.on("init.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onInit.apply(element, arguments);
};
})(this));
this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onSwitchChange.apply(element, arguments);
};
})(this));
this.$container = this.$element.wrap(this.$container).parent();
this.$wrapper = this.$container.wrap(this.$wrapper).parent();
this.$element.before(this.options.inverse ? this.$off : this.$on).before(this.$label).before(this.options.inverse ? this.$on : this.$off);
if (this.options.indeterminate) {
this.$element.prop("indeterminate", true);
}
initInterval = window.setInterval((function(_this) {
return function() {
if (_this.$wrapper.is(":visible")) {
_this._width();
_this._containerPosition(null, function() {
if (_this.options.animate) {
return _this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
});
return window.clearInterval(initInterval);
}
};
})(this), 50);
this._elementHandlers();
this._handleHandlers();
this._labelHandlers();
this._formHandler();
this._externalLabelHandler();
this.$element.trigger("init.bootstrapSwitch");
}
BootstrapSwitch.prototype._constructor = BootstrapSwitch;
BootstrapSwitch.prototype.state = function(value, skip) {
if (typeof value === "undefined") {
return this.options.state;
}
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.state && !this.options.radioAllOff && this.$element.is(":radio")) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
}
value = !!value;
this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
return this.$element;
};
BootstrapSwitch.prototype.toggleState = function(skip) {
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
return this.state(true);
} else {
return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
}
};
BootstrapSwitch.prototype.size = function(value) {
if (typeof value === "undefined") {
return this.options.size;
}
if (this.options.size != null) {
this.$wrapper.removeClass("" + this.options.baseClass + "-" + this.options.size);
}
if (value) {
this.$wrapper.addClass("" + this.options.baseClass + "-" + value);
}
this._width();
this._containerPosition();
this.options.size = value;
return this.$element;
};
BootstrapSwitch.prototype.animate = function(value) {
if (typeof value === "undefined") {
return this.options.animate;
}
value = !!value;
if (value === this.options.animate) {
return this.$element;
}
return this.toggleAnimate();
};
BootstrapSwitch.prototype.toggleAnimate = function() {
this.options.animate = !this.options.animate;
this.$wrapper.toggleClass("" + this.options.baseClass + "-animate");
return this.$element;
};
BootstrapSwitch.prototype.disabled = function(value) {
if (typeof value === "undefined") {
return this.options.disabled;
}
value = !!value;
if (value === this.options.disabled) {
return this.$element;
}
return this.toggleDisabled();
};
BootstrapSwitch.prototype.toggleDisabled = function() {
this.options.disabled = !this.options.disabled;
this.$element.prop("disabled", this.options.disabled);
this.$wrapper.toggleClass("" + this.options.baseClass + "-disabled");
return this.$element;
};
BootstrapSwitch.prototype.readonly = function(value) {
if (typeof value === "undefined") {
return this.options.readonly;
}
value = !!value;
if (value === this.options.readonly) {
return this.$element;
}
return this.toggleReadonly();
};
BootstrapSwitch.prototype.toggleReadonly = function() {
this.options.readonly = !this.options.readonly;
this.$element.prop("readonly", this.options.readonly);
this.$wrapper.toggleClass("" + this.options.baseClass + "-readonly");
return this.$element;
};
BootstrapSwitch.prototype.indeterminate = function(value) {
if (typeof value === "undefined") {
return this.options.indeterminate;
}
value = !!value;
if (value === this.options.indeterminate) {
return this.$element;
}
return this.toggleIndeterminate();
};
BootstrapSwitch.prototype.toggleIndeterminate = function() {
this.options.indeterminate = !this.options.indeterminate;
this.$element.prop("indeterminate", this.options.indeterminate);
this.$wrapper.toggleClass("" + this.options.baseClass + "-indeterminate");
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.inverse = function(value) {
if (typeof value === "undefined") {
return this.options.inverse;
}
value = !!value;
if (value === this.options.inverse) {
return this.$element;
}
return this.toggleInverse();
};
BootstrapSwitch.prototype.toggleInverse = function() {
var $off, $on;
this.$wrapper.toggleClass("" + this.options.baseClass + "-inverse");
$on = this.$on.clone(true);
$off = this.$off.clone(true);
this.$on.replaceWith($off);
this.$off.replaceWith($on);
this.$on = $off;
this.$off = $on;
this.options.inverse = !this.options.inverse;
return this.$element;
};
BootstrapSwitch.prototype.onColor = function(value) {
var color;
color = this.options.onColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$on.removeClass("" + this.options.baseClass + "-" + color);
}
this.$on.addClass("" + this.options.baseClass + "-" + value);
this.options.onColor = value;
return this.$element;
};
BootstrapSwitch.prototype.offColor = function(value) {
var color;
color = this.options.offColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$off.removeClass("" + this.options.baseClass + "-" + color);
}
this.$off.addClass("" + this.options.baseClass + "-" + value);
this.options.offColor = value;
return this.$element;
};
BootstrapSwitch.prototype.onText = function(value) {
if (typeof value === "undefined") {
return this.options.onText;
}
this.$on.html(value);
this._width();
this._containerPosition();
this.options.onText = value;
return this.$element;
};
BootstrapSwitch.prototype.offText = function(value) {
if (typeof value === "undefined") {
return this.options.offText;
}
this.$off.html(value);
this._width();
this._containerPosition();
this.options.offText = value;
return this.$element;
};
BootstrapSwitch.prototype.labelText = function(value) {
if (typeof value === "undefined") {
return this.options.labelText;
}
this.$label.html(value);
this._width();
this.options.labelText = value;
return this.$element;
};
BootstrapSwitch.prototype.handleWidth = function(value) {
if (typeof value === "undefined") {
return this.options.handleWidth;
}
this.options.handleWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.labelWidth = function(value) {
if (typeof value === "undefined") {
return this.options.labelWidth;
}
this.options.labelWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.baseClass = function(value) {
return this.options.baseClass;
};
BootstrapSwitch.prototype.wrapperClass = function(value) {
if (typeof value === "undefined") {
return this.options.wrapperClass;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.wrapperClass;
}
this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
this.$wrapper.addClass(this._getClasses(value).join(" "));
this.options.wrapperClass = value;
return this.$element;
};
BootstrapSwitch.prototype.radioAllOff = function(value) {
if (typeof value === "undefined") {
return this.options.radioAllOff;
}
value = !!value;
if (value === this.options.radioAllOff) {
return this.$element;
}
this.options.radioAllOff = value;
return this.$element;
};
BootstrapSwitch.prototype.onInit = function(value) {
if (typeof value === "undefined") {
return this.options.onInit;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onInit;
}
this.options.onInit = value;
return this.$element;
};
BootstrapSwitch.prototype.onSwitchChange = function(value) {
if (typeof value === "undefined") {
return this.options.onSwitchChange;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
}
this.options.onSwitchChange = value;
return this.$element;
};
BootstrapSwitch.prototype.destroy = function() {
var $form;
$form = this.$element.closest("form");
if ($form.length) {
$form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
}
this.$container.children().not(this.$element).remove();
this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
return this.$element;
};
BootstrapSwitch.prototype._width = function() {
var $handles, handleWidth;
$handles = this.$on.add(this.$off);
$handles.add(this.$label).css("width", "");
handleWidth = this.options.handleWidth === "auto" ? Math.max(this.$on.width(), this.$off.width()) : this.options.handleWidth;
$handles.width(handleWidth);
this.$label.width((function(_this) {
return function(index, width) {
if (_this.options.labelWidth !== "auto") {
return _this.options.labelWidth;
}
if (width < handleWidth) {
return handleWidth;
} else {
return width;
}
};
})(this));
this._handleWidth = this.$on.outerWidth();
this._labelWidth = this.$label.outerWidth();
this.$container.width((this._handleWidth * 2) + this._labelWidth);
return this.$wrapper.width(this._handleWidth + this._labelWidth);
};
BootstrapSwitch.prototype._containerPosition = function(state, callback) {
if (state == null) {
state = this.options.state;
}
this.$container.css("margin-left", (function(_this) {
return function() {
var values;
values = [0, "-" + _this._handleWidth + "px"];
if (_this.options.indeterminate) {
return "-" + (_this._handleWidth / 2) + "px";
}
if (state) {
if (_this.options.inverse) {
return values[1];
} else {
return values[0];
}
} else {
if (_this.options.inverse) {
return values[0];
} else {
return values[1];
}
}
};
})(this));
if (!callback) {
return;
}
return setTimeout(function() {
return callback();
}, 50);
};
BootstrapSwitch.prototype._elementHandlers = function() {
return this.$element.on({
"change.bootstrapSwitch": (function(_this) {
return function(e, skip) {
var state;
e.preventDefault();
e.stopImmediatePropagation();
state = _this.$element.is(":checked");
_this._containerPosition(state);
if (state === _this.options.state) {
return;
}
_this.options.state = state;
_this.$wrapper.toggleClass("" + _this.options.baseClass + "-off").toggleClass("" + _this.options.baseClass + "-on");
if (!skip) {
if (_this.$element.is(":radio")) {
$("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
}
}
return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
};
})(this),
"focus.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.addClass("" + _this.options.baseClass + "-focused");
};
})(this),
"blur.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.removeClass("" + _this.options.baseClass + "-focused");
};
})(this),
"keydown.bootstrapSwitch": (function(_this) {
return function(e) {
if (!e.which || _this.options.disabled || _this.options.readonly) {
return;
}
switch (e.which) {
case 37:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(false);
case 39:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(true);
}
};
})(this)
});
};
BootstrapSwitch.prototype._handleHandlers = function() {
this.$on.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(false);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
return this.$off.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(true);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
};
BootstrapSwitch.prototype._labelHandlers = function() {
return this.$label.on({
"mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
return function(e) {
if (_this._dragStart || _this.options.disabled || _this.options.readonly) {
return;
}
e.preventDefault();
e.stopPropagation();
_this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
if (_this.options.animate) {
_this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
}
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this),
"mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
return function(e) {
var difference;
if (_this._dragStart == null) {
return;
}
e.preventDefault();
difference = (e.pageX || e.originalEvent.touches[0].pageX) - _this._dragStart;
if (difference < -_this._handleWidth || difference > 0) {
return;
}
_this._dragEnd = difference;
return _this.$container.css("margin-left", "" + _this._dragEnd + "px");
};
})(this),
"mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
return function(e) {
var state;
if (!_this._dragStart) {
return;
}
e.preventDefault();
if (_this.options.animate) {
_this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
if (_this._dragEnd) {
state = _this._dragEnd > -(_this._handleWidth / 2);
_this._dragEnd = false;
_this.state(_this.options.inverse ? !state : state);
} else {
_this.state(!_this.options.state);
}
return _this._dragStart = false;
};
})(this),
"mouseleave.bootstrapSwitch": (function(_this) {
return function(e) {
return _this.$label.trigger("mouseup.bootstrapSwitch");
};
})(this)
});
};
BootstrapSwitch.prototype._externalLabelHandler = function() {
var $externalLabel;
$externalLabel = this.$element.closest("label");
return $externalLabel.on("click", (function(_this) {
return function(event) {
event.preventDefault();
event.stopImmediatePropagation();
if (event.target === $externalLabel[0]) {
return _this.toggleState();
}
};
})(this));
};
BootstrapSwitch.prototype._formHandler = function() {
var $form;
$form = this.$element.closest("form");
if ($form.data("bootstrap-switch")) {
return;
}
return $form.on("reset.bootstrapSwitch", function() {
return window.setTimeout(function() {
return $form.find("input").filter(function() {
return $(this).data("bootstrap-switch");
}).each(function() {
return $(this).bootstrapSwitch("state", this.checked);
});
}, 1);
}).data("bootstrap-switch", true);
};
BootstrapSwitch.prototype._getClasses = function(classes) {
var c, cls, _i, _len;
if (!$.isArray(classes)) {
return ["" + this.options.baseClass + "-" + classes];
}
cls = [];
for (_i = 0, _len = classes.length; _i < _len; _i++) {
c = classes[_i];
cls.push("" + this.options.baseClass + "-" + c);
}
return cls;
};
return BootstrapSwitch;
})();
$.fn.bootstrapSwitch = function() {
var args, option, ret;
option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
ret = this;
this.each(function() {
var $this, data;
$this = $(this);
data = $this.data("bootstrap-switch");
if (!data) {
$this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
}
if (typeof option === "string") {
return ret = data[option].apply(data, args);
}
});
return ret;
};
$.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
return $.fn.bootstrapSwitch.defaults = {
state: true,
size: null,
animate: true,
disabled: false,
readonly: false,
indeterminate: false,
inverse: false,
radioAllOff: false,
onColor: "primary",
offColor: "default",
onText: "ON",
offText: "OFF",
labelText: "&nbsp;",
handleWidth: "auto",
labelWidth: "auto",
baseClass: "bootstrap-switch",
wrapperClass: "wrapper",
onInit: function() {},
onSwitchChange: function() {}
};
})(window.jQuery, window);
}).call(this);

File diff suppressed because one or more lines are too long

9
include/rsvp-latest.min.js vendored Normal file

File diff suppressed because one or more lines are too long

53
js/admin.js Normal file
View File

@@ -0,0 +1,53 @@
/* Navigation */
var TO = false;
$(document).ready(function(){
$(".content #nav a").on('click',function(e){
if(!$(this).parents(".content:first").hasClass("enlarged")){
if($(this).parent().hasClass("has_sub")) { e.preventDefault(); }
if(!$(this).hasClass("subdrop")) {
// hide any open menus and remove all other classes
$("ul",$(this).parents("ul:first")).slideUp(350);
$("a",$(this).parents("ul:first")).removeClass("subdrop");
// open our new menu and add the open class
$(this).next("ul").slideDown(350);
$(this).addClass("subdrop");
}
else
if($(this).hasClass("subdrop")) {
$(this).removeClass("subdrop");
$(this).next("ul").slideUp(350);
}
}
});
$("#nav > li.has_sub > a.open").addClass("subdrop").next("ul").show();
$(".menubutton").click(function(){
if(!$(".content").hasClass("enlarged")){
$(".content").addClass("enlarged");
}else{
$(".content").removeClass("enlarged");
}
});
/**/
$(".sidebar-dropdown a").on('click',function(e){
e.preventDefault();
if(!$(this).hasClass("open")) {
// hide any open menus and remove all other classes
$(".sidebar #nav").slideUp(350);
$(".sidebar-dropdown a").removeClass("open");
// open our new menu and add the open class
$(".sidebar #nav").slideDown(350);
$(this).addClass("open");
}
else if($(this).hasClass("open")) {
$(this).removeClass("open");
$(".sidebar #nav").slideUp(350);
}
});
});
$('[data-toggle="tooltip"]').tooltip();

22
js/bootstrap-switch.min.js vendored Normal file

File diff suppressed because one or more lines are too long

65
js/custom.js Normal file
View File

@@ -0,0 +1,65 @@
/* Widget minimize */
$('.wminimize').click(function(e){
e.preventDefault();
var $wcontent = $(this).parent().parent().next('.content');
if($wcontent.is(':visible'))
{
$(this).removeClass('fa-chevron-circle-up text-primary').addClass('fa-chevron-circle-down text-danger');
}
else
{
$(this).removeClass('fa-chevron-circle-down text-danger').addClass('fa-chevron-circle-up text-primary');
}
$wcontent.slideToggle(300);
});
/* Scroll to Top */
$(".totop").hide();
$(function(){
$(window).scroll(function(){
if($(this).scrollTop()>300)
{
$('.totop').slideDown();
}
else
{
$('.totop').slideUp();
}
});
$('.totop a').click(function (e) {
e.preventDefault();
$('body,html').animate({scrollTop: 0}, 500);
});
});
/* panel close
$('.pclose').click(function(e){
e.preventDefault();
var $pbox = $(this).parent().parent().parent();
$pbox.hide(100);
});*/
/* Date picker
$(function() {
$('#datetimepicker1').datetimepicker({
pickTime: false
});
});
$(function() {
$('#datetimepicker2').datetimepicker({
pickDate: false
});
});*/
/* Modal fix
$('.modal').appendTo($('body'));*/
/*Bootstrap Data table, tooltip and bs switch init */
$('[data-toggle="tooltip"]').tooltip();
/*
$('[switch="yes"]').bootstrapSwitch();
$('#bs-table').bdt();*/
//alert ("custom js OK"); //test js