diversen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* Customer: Theo Weijmer
|
||||
@@ -12,7 +13,7 @@ class customersController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE )
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* External: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class externalsController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class RolesController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class usersController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 05/01/2018
|
||||
* Time: 15:03
|
||||
*/
|
||||
class OffersController extends MY_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getAllOffers( $archive = 'F' )
|
||||
{
|
||||
$users = Offer::getAllOffers( $archive );
|
||||
|
||||
$this->json( $users );
|
||||
}
|
||||
|
||||
public function saveOffer()
|
||||
{
|
||||
$userValidation = new OfferValidation();
|
||||
|
||||
if ( ! $userValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $userValidation->getErrorMessages()] );
|
||||
|
||||
$user = $this->input->post();
|
||||
|
||||
$userID = $user['id'];
|
||||
unset( $user['id'] );
|
||||
|
||||
$userID = Offer::saveOffer( $userID, $user );
|
||||
|
||||
$this->json( ['success' => TRUE, 'userID' => $userID] );
|
||||
}
|
||||
|
||||
public function archiveOffer( $userID, $status )
|
||||
{
|
||||
Offer::whereId( $userID )->update( ['archive' => $status] );
|
||||
}
|
||||
|
||||
public function removeOffer( $userID )
|
||||
{
|
||||
$removeOffer = new RemoveOffer( $userID );
|
||||
|
||||
if ( $removeOffer->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Offer::removeOffer( $userID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Page extends Eloquent {
|
||||
|
||||
protected $table = "offers";
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo( 'Project' );
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,10 @@ class Page extends Eloquent {
|
||||
->with( [
|
||||
'subpages' => function ( $q ) use ( $user ) {
|
||||
$q->whereRaw(
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" );
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" )
|
||||
->orderBy( 'pageorder' );
|
||||
}] )
|
||||
->orderBy( 'pageorder' )
|
||||
->get();
|
||||
|
||||
return $pages;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Project extends Eloquent {
|
||||
|
||||
protected $table = "projects";
|
||||
|
||||
public function offers()
|
||||
{
|
||||
return $this->hasMany( 'Offer' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 15/12/2017
|
||||
* Time: 19:37
|
||||
*/
|
||||
|
||||
class Offer_model extends MY_Model {
|
||||
|
||||
protected $tablename = "offers";
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<div class="modal modal-fade-in-scale-up modal-primary" tabindex="-1" id="offer-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">toevoegen / wijzigen offerte</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div role="form" class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
klant
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<select class="form-control"
|
||||
data-bind="options:customers
|
||||
optionsValue:id,
|
||||
optionsText:name,
|
||||
value:selectedCustomerID,
|
||||
optionsCaption:selecteer klant"></select>
|
||||
</div>
|
||||
<small class="invalid-feedback"
|
||||
data-bind="style:{display: ! selectedCustomer() ? 'block' : 'none'}">
|
||||
selecteer een klant
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
project
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<select class="form-control"
|
||||
data-bind="options:projects,
|
||||
optionsValue: id,
|
||||
optionsText:projectnumber,
|
||||
value:selectedProjectID"
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
datum offerte
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="datum offerte"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:startdate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
kans
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-question"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="kans"
|
||||
class="form-control"
|
||||
data-bind="textInput:acceptance_chance">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
acceptatie datum
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="acceptatie datum"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:accepteddate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
afwijsdatum
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="email"
|
||||
placeholder="afwijsdatum"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:rejectdate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-success"
|
||||
data-bind="visible:formValid(), click:saveOffer">opslaan
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning" data-dismiss="modal">annuleren</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@
|
||||
</thead>
|
||||
<tbody data-bind="foreach:externals">
|
||||
<tr>
|
||||
<td><span data-bind="text:contactperson"</td>
|
||||
<td><span data-bind="text:contactperson"></span></td>
|
||||
<td><span data-bind="text:name"></span></td>
|
||||
<td><span data-bind="text:address"></span></td>
|
||||
<td><span data-bind="text:postcode + ' ' + place"></span></td>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xl-8">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-tealish-header">klant</th>
|
||||
<th class="table-tealish-header">project</th>
|
||||
<th class="table-tealish-header">datum</th>
|
||||
<th class="table-tealish-header">kans</th>
|
||||
<th class="table-tealish-header">geaccepteerd</th>
|
||||
<th class="table-tealish-header">afgewezen</th>
|
||||
<th class="table-tealish-header"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-bind="foreach:externals">
|
||||
<tr>
|
||||
<td><span data-bind="text:customerName"></span></td>
|
||||
<td><span data-bind="text:pojectNumber"></span></td>
|
||||
<td><span data-bind="text:startdate"></span></td>
|
||||
<td><span data-bind="text:acceptance_chance"></span></td>
|
||||
<td><span data-bind="text:accepted"></span></td>
|
||||
<td><span data-bind="text:rejected"></span></td>
|
||||
<td>
|
||||
<i class="icon fa-edit pointer" title="wijzig" data-bind="click:$root.editExternal"></i>
|
||||
<!-- ko if:archive == 'F' -->
|
||||
<i class="icon fa-archive pointer" title="archiveer"
|
||||
data-bind="click:$root.archiveOffer"></i>
|
||||
<!-- /ko -->
|
||||
<!-- ko if:archive != 'F' -->
|
||||
<i class="icon fa-minus-circle redish pointer" title="archiveer"
|
||||
data-bind="click:$root.archiveOffer"></i>
|
||||
<!-- /ko -->
|
||||
<i class="icon fa-trash redish pointer" title="verwijder"
|
||||
data-bind="click:$root.removeOffer"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="">
|
||||
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newOffer">
|
||||
nieuwe offerte
|
||||
</button>
|
||||
</td>
|
||||
<td colspan="2" class="">
|
||||
<div class="row form-horizontal">
|
||||
<label class="col-md-4 form-control-label">archief</label>
|
||||
<div class="col-md-8">
|
||||
<div class="onoffswitch" data-bind="click:toggleArchive">
|
||||
<input type="checkbox"
|
||||
name="onoffswitch"
|
||||
class="onoffswitch-checkbox"
|
||||
data-bind="checked:archive"
|
||||
id="myonoffswitch">
|
||||
<label class="onoffswitch-label" for="myonoffswitch">
|
||||
<span class="onoffswitch-inner"></span>
|
||||
<span class="onoffswitch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,7 @@
|
||||
<!-- Stylesheets VENDOR -->
|
||||
<link rel="stylesheet" href="css/vendor/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/vendor/bootstrap-extend.css">
|
||||
<link rel="stylesheet" href="js/vendor/jquery-ui/jquery-ui.css">
|
||||
<link rel="stylesheet" href="fonts/font-awesome/font-awesome.min.css">
|
||||
|
||||
<link rel="stylesheet" href="css/vendor/site.min.css">
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<!-- Core -->
|
||||
<!--<script src="js/vendor/babel-external-helpers/babel-external-helpers.js"></script>-->
|
||||
<script src="js/vendor/jquery/jquery.js"></script>
|
||||
<script src="js/vendor/Knockout.min.js"></script>
|
||||
<script src="js/vendor/jquery-ui/jquery-ui.js"></script>
|
||||
<script src="js/vendor/jquery-ui/knockout-jqueryui.min.js"></script>
|
||||
<script src="js/vendor/popper-js/umd/popper.min.js"></script>
|
||||
<script src="js/vendor/bootstrap/bootstrap.js"></script>
|
||||
<script src="js/vendor/animsition/animsition.js"></script>
|
||||
@@ -47,7 +50,6 @@
|
||||
|
||||
<!-- DBOIS -->
|
||||
|
||||
<script src="js/vendor/Knockout.min.js"></script>
|
||||
|
||||
<script src="js/lib/main.js"></script>
|
||||
<script src="js/lib/modules/specials/tellmeModule.js"></script>
|
||||
@@ -58,11 +60,13 @@
|
||||
<script src="js/lib/modules/modals/userModal.js"></script>
|
||||
<script src="js/lib/modules/modals/customerModal.js"></script>
|
||||
<script src="js/lib/modules/modals/externalModal.js"></script>
|
||||
<script src="js/lib/modules/modals/offerModal.js"></script>
|
||||
|
||||
|
||||
<!---->
|
||||
<script src="js/lib/dataservices/pageDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/userDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/customerDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/externalDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/rolesDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/offerDataservice.js"></script>
|
||||
<script src="js/lib/helpers.js"></script>
|
||||
@@ -3,9 +3,9 @@
|
||||
$this->load->view('modals/user_modal');
|
||||
$this->load->view('modals/customer_modal');
|
||||
$this->load->view('modals/external_modal');
|
||||
$this->load->view('modals/offer_modal');
|
||||
|
||||
$this->load->view('specials/tellme_modal');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* Offer: Theo Weijmer
|
||||
* Date: 25/12/2017
|
||||
* Time: 09:50
|
||||
*/
|
||||
|
||||
dbo.offerDataService = {
|
||||
|
||||
getAllOffers: function ( archive = 'F', callback ) {
|
||||
$.getJSON( 'index.php/beheer/offersController/getAllOffers/' + archive )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} );
|
||||
},
|
||||
|
||||
getOffer: function ( userID, callback ) {
|
||||
$.getJSON( 'index.php/beheer/offersController/getOffer/' + userID )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} );
|
||||
},
|
||||
|
||||
checkOffername: function ( username, callback ) {
|
||||
$.post( 'index.php/beheer/userController/checkOffername', 'json' )
|
||||
.done( function ( data ) {
|
||||
console.log( data );
|
||||
callback( data );
|
||||
} );
|
||||
},
|
||||
|
||||
saveOffer: function ( submitDATA, callback ) {
|
||||
$.post( 'index.php/beheer/offersController/saveOffer', submitDATA, function () {
|
||||
}, 'json' )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} );
|
||||
},
|
||||
|
||||
archiveOffer: function ( userID, status, callback ) {
|
||||
$.get( 'index.php/beheer/offersController/archiveOffer/' + userID + '/' + status )
|
||||
.done( function () {
|
||||
callback();
|
||||
} );
|
||||
},
|
||||
|
||||
removeOffer: function ( userID, callback ) {
|
||||
$.getJSON( 'index.php/beheer/offersController/removeOffer/' + userID )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* Offerte: Theo Weijmer
|
||||
* Date: 25/12/2017
|
||||
* Time: 17:32
|
||||
*/
|
||||
|
||||
$( function () {
|
||||
dbo.editOfferteModal = {
|
||||
|
||||
id : null,
|
||||
offertes : ko.observableArray( [] ),
|
||||
projects : ko.observableArray( [] ),
|
||||
offerte_id : ko.observable(),
|
||||
project_id : ko.observable(),
|
||||
startdate : ko.observable(),
|
||||
acceptance_chance: ko.observable(),
|
||||
accepteddate : ko.observable(),
|
||||
rejectdate : ko.observable(),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.editOfferteModal;
|
||||
dbo.customerDataService.getAllCustomers( 'F', function ( data ) {
|
||||
vm.customers( data );
|
||||
} );
|
||||
},
|
||||
|
||||
newEditOfferte: function ( offerte, callback ) {
|
||||
var vm = dbo.editOfferteModal;
|
||||
vm.callback = typeof(callback) == 'function' ? callback : null;
|
||||
|
||||
vm.showOfferteModal();
|
||||
|
||||
vm.setOfferte( offerte );
|
||||
},
|
||||
|
||||
saveOfferte: function () {
|
||||
var vm = dbo.editOfferteModal;
|
||||
|
||||
if ( vm.formValid == false ) return;
|
||||
|
||||
var submitDATA = {
|
||||
id : vm.id,
|
||||
offertes : vm.offertes(),
|
||||
projects : vm.projects(),
|
||||
offerte_id : vm.offerte_id(),
|
||||
project_id : vm.project_id(),
|
||||
startdate : vm.startdate(),
|
||||
acceptance_chance: vm.acceptance_chance(),
|
||||
accepteddate : vm.accepteddate(),
|
||||
rejectdate : vm.rejectdate()
|
||||
}
|
||||
|
||||
dbo.offerteDataService.saveOfferte( submitDATA, function ( data ) {
|
||||
if ( data.success ) {
|
||||
tellMe( {
|
||||
title : 'offerte aangemaakt',
|
||||
message : 'de offerte is succesvol opgeslagen',
|
||||
modalClass: 'modal-success'
|
||||
}, function () {
|
||||
vm.hideOfferteModal();
|
||||
|
||||
if ( typeof(vm.callback) == 'function' ) vm.callback();
|
||||
} );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var errorMessage = '<ul>';
|
||||
$.each( data.messages, function ( i, p ) {
|
||||
if ( p[0] ) {
|
||||
errorMessage += '<li>' + i + ': ' + p[0] + '</li>';
|
||||
}
|
||||
} );
|
||||
errorMessage += '</ul>';
|
||||
tellMe( {
|
||||
title : 'fout aanmaken offerte',
|
||||
message : errorMessage,
|
||||
modalClass: 'modal-danger'
|
||||
} );
|
||||
} );
|
||||
},
|
||||
|
||||
setOfferte: function ( offerte ) {
|
||||
var vm = dbo.editOfferteModal;
|
||||
|
||||
vm.id = offerte.id;
|
||||
vm.name( offerte.name || '' );
|
||||
vm.address( offerte.address || '' );
|
||||
vm.postcode( offerte.postcode || '' );
|
||||
vm.place( offerte.place || '' );
|
||||
vm.contactperson( offerte.contactperson || '' );
|
||||
vm.email( offerte.email || '' );
|
||||
vm.website( offerte.website || '' );
|
||||
vm.remarks( offerte.remarks || '' );
|
||||
},
|
||||
|
||||
showOfferteModal: function () {
|
||||
$( "#offerte-modal" ).modal( 'show' );
|
||||
},
|
||||
|
||||
hideOfferteModal: function () {
|
||||
$( "#offerte-modal" ).modal( 'hide' );
|
||||
}
|
||||
};
|
||||
|
||||
dbo.editOfferteModal.init();
|
||||
|
||||
ko.applyBindings( dbo.editOfferteModal, document.getElementById( 'offer-modal' ) );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 05/01/2018
|
||||
* Time: 15:54
|
||||
*/
|
||||
|
||||
|
||||
dbo.offersInit = function () {
|
||||
|
||||
if ( dbo.offersModel !== undefined ) {
|
||||
|
||||
} else {
|
||||
dbo.offersModel = {
|
||||
|
||||
offers : ko.observableArray( [] ),
|
||||
offer : ko.observable(),
|
||||
archive: ko.observable( false ),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
// vm.refreshOffers();
|
||||
},
|
||||
|
||||
newOffer: function () {
|
||||
var vm = dbo.offersModel;
|
||||
dbo.editOfferModal.newEditOffer( false, function () {
|
||||
vm.refreshOffers();
|
||||
} );
|
||||
},
|
||||
|
||||
toggleArchive: function () {
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
vm.archive( !vm.archive() );
|
||||
|
||||
vm.refreshOffers();
|
||||
},
|
||||
|
||||
editOffer: function () {
|
||||
var offer = this;
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
dbo.editOfferModal.newEditOffer( offer, function () {
|
||||
vm.refreshOffers();
|
||||
} );
|
||||
},
|
||||
|
||||
archiveOffer: function () {
|
||||
var vm = dbo.offersModel;
|
||||
var self = this;
|
||||
|
||||
var status = self.archive == 'F' ? 'T' : 'F';
|
||||
|
||||
dbo.offerDataService.archiveOffer( self.id, status, function () {
|
||||
vm.refreshOffers();
|
||||
} );
|
||||
},
|
||||
|
||||
removeOffer: function () {
|
||||
var vm = dbo.offersModel;
|
||||
var self = this;
|
||||
|
||||
tellMe( {
|
||||
title : 'verwijderen offerte',
|
||||
message : 'weet u zeker dat u de offerte wilt verwijderen, dit kan niet ongedaan worden gemaakt',
|
||||
notify : true,
|
||||
noText : 'nee verwijder de offerte niet',
|
||||
yesText : 'ja verwijder de offerte',
|
||||
modalClass: 'modal-warning'
|
||||
}, function ( response ) {
|
||||
console.log( response );
|
||||
if ( response ) {
|
||||
dbo.offerDataService.removeOffer( self.id, function ( data ) {
|
||||
if ( data.result ) {
|
||||
tellMe( {
|
||||
title : 'offerte verwijderd',
|
||||
message : 'de offerte is succesvol verwijderd',
|
||||
modalClass: 'modal-success'
|
||||
}, function () {
|
||||
vm.refreshOffers();
|
||||
} );
|
||||
} else {
|
||||
tellMe( {
|
||||
title : 'fout bij verwijderen offerte',
|
||||
message : 'de offerte kan niet worden verwijderd',
|
||||
modalClass: 'modal-danger'
|
||||
} );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
refreshOffers: function () {
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
dbo.offerDataService.getAllOffers( vm.archive() ? 'T' : 'F', function ( data ) {
|
||||
vm.offers( data );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
dbo.offersModel.init();
|
||||
|
||||
ko.applyBindings( dbo.offersModel, document.getElementById( 'OFFERS' ) );
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
/*global define*/
|
||||
define(
|
||||
|
||||
[
|
||||
'jquery',
|
||||
'knockout',
|
||||
'./bindingHandler',
|
||||
'./utils',
|
||||
'jquery-ui/datepicker'
|
||||
],
|
||||
|
||||
function ($, ko, BindingHandler, utils) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var Datepicker = function () {
|
||||
/// <summary>Constructor.</summary>
|
||||
|
||||
BindingHandler.call(this, 'datepicker');
|
||||
|
||||
this.options = ['altField', 'altFormat', 'appendText', 'autoSize',
|
||||
'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',
|
||||
'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText',
|
||||
'dateFormat', 'dayNames', 'dayNamesMin', 'dayNamesShort', 'defaultDate',
|
||||
'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL',
|
||||
'maxDate', 'minDate', 'monthNames', 'monthNamesShort',
|
||||
'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',
|
||||
'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel',
|
||||
'showCurrentAtPos', 'showMonthAfterYear', 'showOn', 'showOptions',
|
||||
'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange',
|
||||
'yearSuffix', 'beforeShow', 'beforeShowDay', 'onChangeMonthYear',
|
||||
'onClose', 'onSelect'];
|
||||
this.hasRefresh = true;
|
||||
};
|
||||
|
||||
Datepicker.prototype = utils.createObject(BindingHandler.prototype);
|
||||
Datepicker.prototype.constructor = Datepicker;
|
||||
|
||||
Datepicker.prototype.init = function (element, valueAccessor) {
|
||||
/// <summary>Keeps the value binding property in sync with the widget's state.
|
||||
/// </summary>
|
||||
/// <param name='element' type='DOMNode'></param>
|
||||
/// <param name='valueAccessor' type='Function'></param>
|
||||
/// <returns type='Object'></returns>
|
||||
|
||||
var result, widgetName, options, value, subscription, origOnSelect;
|
||||
|
||||
result = BindingHandler.prototype.init.apply(this, arguments);
|
||||
|
||||
widgetName = this.widgetName;
|
||||
options = valueAccessor();
|
||||
value = ko.utils.unwrapObservable(options.value);
|
||||
|
||||
if (value) {
|
||||
$(element)[widgetName]('setDate', value);
|
||||
}
|
||||
|
||||
if (ko.isObservable(options.value)) {
|
||||
subscription = options.value.subscribe(function (newValue) {
|
||||
$(element)[widgetName]('setDate', newValue);
|
||||
});
|
||||
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
|
||||
subscription.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
if (ko.isWriteableObservable(options.value)) {
|
||||
origOnSelect = $(element)[widgetName]('option', 'onSelect');
|
||||
$(element)[widgetName]('option', 'onSelect', function (selectedText) {
|
||||
var format, date;
|
||||
|
||||
format = $(element)[widgetName]('option', 'dateFormat');
|
||||
date = $.datepicker.parseDate(format, selectedText);
|
||||
options.value(date);
|
||||
|
||||
if (typeof origOnSelect === 'function') {
|
||||
origOnSelect.apply(this, Array.prototype.slice.call(arguments));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
utils.register(Datepicker);
|
||||
|
||||
return Datepicker;
|
||||
}
|
||||
);
|
||||
+519
@@ -0,0 +1,519 @@
|
||||
window.kojqui = {
|
||||
version: "2.2.2"
|
||||
},
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.utils = b( a.jQuery, a.ko, a.jQuery.ui.core )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c, d, e, f, g;
|
||||
return c = (a.ui.version || "").match( /^(\d)\.(\d+)/ ),
|
||||
d = c ? {
|
||||
major: parseInt( c[1], 10 ),
|
||||
minor: parseInt( c[2], 10 )
|
||||
} : null,
|
||||
e = ["foreach", "if", "ifnot", "with", "html", "text", "options"],
|
||||
f = Object.create || function ( a ) {
|
||||
function b() {
|
||||
}
|
||||
|
||||
return b.prototype = a,
|
||||
new b
|
||||
}
|
||||
,
|
||||
g = function ( a ) {
|
||||
var c = new a;
|
||||
b.bindingHandlers[c.widgetName] = {
|
||||
after : b.utils.arrayGetDistinctValues( e.concat( c.after || [] ) ),
|
||||
init : c.init.bind( c ),
|
||||
update: c.update.bind( c )
|
||||
}
|
||||
}
|
||||
,
|
||||
{
|
||||
uiVersion : d,
|
||||
descendantControllingBindings: e,
|
||||
createObject : f,
|
||||
register : g
|
||||
}
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.BindingHandler = b( a.jQuery, a.ko, a.kojqui.utils, a.jQuery.ui.widget )
|
||||
}( this, function ( a, b, c ) {
|
||||
"use strict";
|
||||
var d, e, f, g;
|
||||
return d = "__kojqui_options",
|
||||
e = function ( a, c ) {
|
||||
var d = {};
|
||||
return b.utils.arrayForEach( c, function ( c ) {
|
||||
void 0 !== a[c] && (d[c] = b.utils.unwrapObservable( a[c] ))
|
||||
} ),
|
||||
d
|
||||
}
|
||||
,
|
||||
f = function ( c, d, e ) {
|
||||
b.isObservable( e.refreshOn ) && b.computed( {
|
||||
read : function () {
|
||||
e.refreshOn(),
|
||||
a( d )[c]( "refresh" )
|
||||
},
|
||||
disposeWhenNodeIsRemoved: d
|
||||
} )
|
||||
}
|
||||
,
|
||||
g = function ( a ) {
|
||||
this.widgetName = a,
|
||||
this.widgetEventPrefix = a,
|
||||
this.options = [],
|
||||
this.events = [],
|
||||
this.after = [],
|
||||
this.hasRefresh = !1
|
||||
}
|
||||
,
|
||||
g.prototype.init = function ( g, h, i, j, k ) {
|
||||
var l, m, n, o, p;
|
||||
return l = this.widgetName,
|
||||
m = h(),
|
||||
n = e( m, this.options ),
|
||||
o = e( m, this.events ),
|
||||
p = !b.utils.arrayFirst( c.descendantControllingBindings, function ( a ) {
|
||||
return this.hasOwnProperty( a )
|
||||
}, i() ),
|
||||
p && b.applyBindingsToDescendants( k, g ),
|
||||
b.utils.domData.set( g, d, n ),
|
||||
a.each( o, function ( a, b ) {
|
||||
o[a] = b.bind( j )
|
||||
} ),
|
||||
a( g )[l]( b.utils.extend( n, o ) ),
|
||||
this.hasRefresh && f( l, g, m ),
|
||||
b.isWriteableObservable( m.widget ) && m.widget( a( g ) ),
|
||||
b.utils.domNodeDisposal.addDisposeCallback( g, function () {
|
||||
a( g )[l]( "destroy" )
|
||||
} ),
|
||||
{
|
||||
controlsDescendantBindings: p
|
||||
}
|
||||
}
|
||||
,
|
||||
g.prototype.update = function ( c, f ) {
|
||||
var g, h, i, j;
|
||||
g = this.widgetName,
|
||||
h = f(),
|
||||
i = b.utils.domData.get( c, d ),
|
||||
j = e( h, this.options ),
|
||||
a.each( j, function ( b, d ) {
|
||||
d !== i[b] && a( c )[g]( "option", b, j[b] )
|
||||
} ),
|
||||
b.utils.domData.set( c, d, j )
|
||||
}
|
||||
,
|
||||
g.prototype.on = function ( c, d, e ) {
|
||||
var f;
|
||||
f = d === this.widgetEventPrefix ? d : this.widgetEventPrefix + d,
|
||||
f = [f.toLowerCase(), ".", this.widgetName].join( "" ),
|
||||
a( c ).on( f, e ),
|
||||
b.utils.domNodeDisposal.addDisposeCallback( c, function () {
|
||||
a( c ).off( f )
|
||||
} )
|
||||
}
|
||||
,
|
||||
g
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Accordion = b( a.jQuery, a.ko, a.kojqui.utils, a.kojqui.BindingHandler, a.jQuery.ui.accordion )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e = function () {
|
||||
d.call( this, "accordion" ),
|
||||
1 === c.uiVersion.major && 8 === c.uiVersion.minor ? (this.options = ["active", "animated", "autoHeight", "clearStyle", "collapsible", "disabled", "event", "fillSpace", "header", "icons", "navigation", "navigationFilter"],
|
||||
this.events = ["change", "changestart", "create"],
|
||||
this.hasRefresh = !1,
|
||||
this.eventToWatch = "change") : (this.options = ["active", "animate", "collapsible", "disabled", "event", "header", "heightStyle", "icons"],
|
||||
this.events = ["activate", "beforeActivate", "create"],
|
||||
this.hasRefresh = !0,
|
||||
this.eventToWatch = "activate")
|
||||
};
|
||||
return e.prototype = c.createObject( d.prototype ),
|
||||
e.prototype.constructor = e,
|
||||
e.prototype.init = function ( c, e ) {
|
||||
var f, g, h;
|
||||
return f = this.widgetName,
|
||||
g = e(),
|
||||
h = d.prototype.init.apply( this, arguments ),
|
||||
b.isWriteableObservable( g.active ) && this.on( c, this.eventToWatch, function () {
|
||||
g.active( a( c )[f]( "option", "active" ) )
|
||||
} ),
|
||||
h
|
||||
}
|
||||
,
|
||||
c.register( e ),
|
||||
e
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Autocomplete = b( a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.autocomplete )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c = function () {
|
||||
a.call( this, "autocomplete" ),
|
||||
this.options = ["appendTo", "autoFocus", "delay", "disabled", "minLength", "position", "source"],
|
||||
1 === b.uiVersion.major && 8 === b.uiVersion.minor ? this.events = ["change", "close", "create", "focus", "open", "search", "select"] : (this.options.push( "messages" ),
|
||||
this.events = ["change", "close", "create", "focus", "open", "response", "search", "select"])
|
||||
};
|
||||
return c.prototype = b.createObject( a.prototype ),
|
||||
c.prototype.constructor = c,
|
||||
b.register( c ),
|
||||
c
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Button = b( a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.button )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c = function () {
|
||||
a.call( this, "button" ),
|
||||
this.options = ["disabled", "icons", "label", "text"],
|
||||
this.events = ["create"],
|
||||
this.hasRefresh = !0
|
||||
};
|
||||
return c.prototype = b.createObject( a.prototype ),
|
||||
c.prototype.constructor = c,
|
||||
b.register( c ),
|
||||
c
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Buttonset = b( a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.button )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c = function () {
|
||||
a.call( this, "buttonset" ),
|
||||
this.options = ["items", "disabled"],
|
||||
this.events = ["create"],
|
||||
this.hasRefresh = !0
|
||||
};
|
||||
return c.prototype = b.createObject( a.prototype ),
|
||||
c.prototype.constructor = c,
|
||||
b.register( c ),
|
||||
c
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Datepicker = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.datepicker )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e = function () {
|
||||
c.call( this, "datepicker" ),
|
||||
this.options = ["altField", "altFormat", "appendText", "autoSize", "buttonImage", "buttonImageOnly", "buttonText", "calculateWeek", "changeMonth", "changeYear", "closeText", "constrainInput", "currentText", "dateFormat", "dayNames", "dayNamesMin", "dayNamesShort", "defaultDate", "duration", "firstDay", "gotoCurrent", "hideIfNoPrevNext", "isRTL", "maxDate", "minDate", "monthNames", "monthNamesShort", "navigationAsDateFormat", "nextText", "numberOfMonths", "prevText", "selectOtherMonths", "shortYearCutoff", "showAnim", "showButtonPanel", "showCurrentAtPos", "showMonthAfterYear", "showOn", "showOptions", "showOtherMonths", "showWeek", "stepMonths", "weekHeader", "yearRange", "yearSuffix", "beforeShow", "beforeShowDay", "onChangeMonthYear", "onClose", "onSelect"],
|
||||
this.hasRefresh = !0
|
||||
};
|
||||
return e.prototype = d.createObject( c.prototype ),
|
||||
e.prototype.constructor = e,
|
||||
e.prototype.init = function ( d, e ) {
|
||||
var f, g, h, i, j, k;
|
||||
return f = c.prototype.init.apply( this, arguments ),
|
||||
g = this.widgetName,
|
||||
h = e(),
|
||||
i = b.utils.unwrapObservable( h.value ),
|
||||
i && a( d )[g]( "setDate", i ),
|
||||
b.isObservable( h.value ) && (j = h.value.subscribe( function ( b ) {
|
||||
a( d )[g]( "setDate", b )
|
||||
} ),
|
||||
b.utils.domNodeDisposal.addDisposeCallback( d, function () {
|
||||
j.dispose()
|
||||
} )),
|
||||
b.isWriteableObservable( h.value ) && (k = a( d )[g]( "option", "onSelect" ),
|
||||
a( d )[g]( "option", "onSelect", function ( b ) {
|
||||
var c, e;
|
||||
c = a( d )[g]( "option", "dateFormat" ),
|
||||
e = a.datepicker.parseDate( c, b ),
|
||||
h.value( e ),
|
||||
"function" == typeof k && k.apply( this, Array.prototype.slice.call( arguments ) )
|
||||
} )),
|
||||
f
|
||||
}
|
||||
,
|
||||
d.register( e ),
|
||||
e
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Dialog = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.dialog )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e = function () {
|
||||
c.call( this, "dialog" ),
|
||||
1 === d.uiVersion.major && 8 === d.uiVersion.minor ? (this.options = ["autoOpen", "buttons", "closeOnEscape", "closeText", "dialogClass", "disabled", "draggable", "height", "maxHeight", "maxWidth", "minHeight", "minWidth", "modal", "position", "resizable", "show", "stack", "title", "width", "zIndex"],
|
||||
this.events = ["beforeClose", "create", "open", "focus", "dragStart", "drag", "dragStop", "resizeStart", "resize", "resizeStop", "close"]) : 1 === d.uiVersion.major && 9 === d.uiVersion.minor ? (this.options = ["autoOpen", "buttons", "closeOnEscape", "closeText", "dialogClass", "draggable", "height", "hide", "maxHeight", "maxWidth", "minHeight", "minWidth", "modal", "position", "resizable", "show", "stack", "title", "width", "zIndex"],
|
||||
this.events = ["beforeClose", "create", "open", "focus", "dragStart", "drag", "dragStop", "resizeStart", "resize", "resizeStop", "close"]) : (this.options = ["appendTo", "autoOpen", "buttons", "closeOnEscape", "closeText", "dialogClass", "draggable", "height", "hide", "maxHeight", "maxWidth", "minHeight", "minWidth", "modal", "position", "resizable", "show", "title", "width"],
|
||||
this.events = ["beforeClose", "create", "open", "focus", "dragStart", "drag", "dragStop", "resizeStart", "resize", "resizeStop", "close"])
|
||||
};
|
||||
return e.prototype = d.createObject( c.prototype ),
|
||||
e.prototype.constructor = e,
|
||||
e.prototype.init = function ( d, e ) {
|
||||
var f, g, h;
|
||||
return f = document.createElement( "DIV" ),
|
||||
f.style.display = "none",
|
||||
d.parentNode.insertBefore( f, d ),
|
||||
b.utils.domNodeDisposal.addDisposeCallback( f, function () {
|
||||
b.removeNode( d )
|
||||
} ),
|
||||
g = c.prototype.init.apply( this, arguments ),
|
||||
h = e(),
|
||||
h.isOpen && b.computed( {
|
||||
read : function () {
|
||||
a( d )[this.widgetName]( b.utils.unwrapObservable( h.isOpen ) ? "open" : "close" )
|
||||
},
|
||||
disposeWhenNodeIsRemoved: d,
|
||||
owner : this
|
||||
} ),
|
||||
b.isWriteableObservable( h.isOpen ) && (this.on( d, "open", function () {
|
||||
h.isOpen( !0 )
|
||||
} ),
|
||||
this.on( d, "close", function () {
|
||||
h.isOpen( !1 )
|
||||
} )),
|
||||
b.isWriteableObservable( h.width ) && this.on( d, "resizestop", function ( a, b ) {
|
||||
h.width( Math.round( b.size.width ) )
|
||||
} ),
|
||||
b.isWriteableObservable( h.height ) && this.on( d, "resizestop", function ( a, b ) {
|
||||
h.height( Math.round( b.size.height ) )
|
||||
} ),
|
||||
g
|
||||
}
|
||||
,
|
||||
d.register( e ),
|
||||
e
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Menu = b( a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.menu )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c = function () {
|
||||
a.call( this, "menu" ),
|
||||
this.options = 1 === b.uiVersion.major && b.uiVersion.minor < 11 ? ["disabled", "icons", "menus", "position", "role"] : ["disabled", "icons", "items", "menus", "position", "role"],
|
||||
this.events = ["blur", "create", "focus", "select"],
|
||||
this.hasRefresh = !0
|
||||
};
|
||||
return c.prototype = b.createObject( a.prototype ),
|
||||
c.prototype.constructor = c,
|
||||
b.register( c ),
|
||||
c
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Progressbar = b( a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.progressbar )
|
||||
}( this, function ( a, b ) {
|
||||
"use strict";
|
||||
var c = function () {
|
||||
a.call( this, "progressbar" ),
|
||||
this.events = ["change", "create", "complete"],
|
||||
this.hasRefresh = !0,
|
||||
this.options = 1 === b.uiVersion.major && 8 === b.uiVersion.minor ? ["disabled", "value"] : ["disabled", "max", "value"]
|
||||
};
|
||||
return c.prototype = b.createObject( a.prototype ),
|
||||
c.prototype.constructor = c,
|
||||
b.register( c ),
|
||||
c
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Selectmenu = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.selectmenu )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e, f;
|
||||
return e = "__kojqui_selectmenu_value",
|
||||
f = function () {
|
||||
c.call( this, "selectmenu" ),
|
||||
this.after = ["value"],
|
||||
this.options = ["appendTo", "disabled", "icons", "position", "width"],
|
||||
this.events = ["change", "close", "create", "focus", "open", "select"],
|
||||
this.hasRefresh = !0
|
||||
}
|
||||
,
|
||||
f.prototype = d.createObject( c.prototype ),
|
||||
f.prototype.constructor = f,
|
||||
f.prototype.init = function ( d, e ) {
|
||||
var f, g;
|
||||
return f = e(),
|
||||
g = c.prototype.init.apply( this, arguments ),
|
||||
f.hasOwnProperty( "isOpen" ) && b.computed( {
|
||||
read : function () {
|
||||
a( d )[this.widgetName]( b.utils.unwrapObservable( f.isOpen ) ? "open" : "close" )
|
||||
},
|
||||
disposeWhenNodeIsRemoved: d,
|
||||
owner : this
|
||||
} ),
|
||||
b.isWriteableObservable( f.isOpen ) && (this.on( d, "open", function () {
|
||||
f.isOpen( !0 )
|
||||
} ),
|
||||
this.on( d, "close", function () {
|
||||
f.isOpen( !1 )
|
||||
} )),
|
||||
this.on( d, "change", function () {
|
||||
a( d ).trigger( "change" )
|
||||
} ),
|
||||
g
|
||||
}
|
||||
,
|
||||
f.prototype.update = function ( d, f, g ) {
|
||||
var h, i;
|
||||
c.prototype.update.apply( this, arguments ),
|
||||
g().hasOwnProperty( "value" ) && (h = b.utils.domData.get( d, e ),
|
||||
i = b.utils.unwrapObservable( g().value ),
|
||||
h !== i && a( d ).selectmenu( "refresh" ))
|
||||
}
|
||||
,
|
||||
d.register( f ),
|
||||
f
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Slider = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.slider )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e, f;
|
||||
return e = "__kojqui_options",
|
||||
f = function () {
|
||||
c.call( this, "slider" ),
|
||||
this.widgetEventPrefix = "slide",
|
||||
this.options = ["animate", "disabled", "max", "min", "orientation", "range", "step", "value", "values"],
|
||||
this.events = ["create", "start", "slide", "change", "stop"]
|
||||
}
|
||||
,
|
||||
f.prototype = d.createObject( c.prototype ),
|
||||
f.prototype.constructor = f,
|
||||
f.prototype.init = function ( d, f ) {
|
||||
var g, h, i;
|
||||
return g = c.prototype.init.apply( this, arguments ),
|
||||
h = f(),
|
||||
i = h.realtime ? "slide" : "change",
|
||||
b.isWriteableObservable( h.value ) && this.on( d, i, function ( c, f ) {
|
||||
var g = a( d ).find( ".ui-slider-handle" ).index( f.handle );
|
||||
0 === g && (b.utils.domData.get( d, e ).value = f.value,
|
||||
h.value( f.value ))
|
||||
} ),
|
||||
b.isWriteableObservable( h.values ) && this.on( d, i, function ( a, c ) {
|
||||
b.utils.domData.get( d, e ).value = c.values,
|
||||
h.values( c.values )
|
||||
} ),
|
||||
g
|
||||
}
|
||||
,
|
||||
d.register( f ),
|
||||
f
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Spinner = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.spinner )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e = function () {
|
||||
c.call( this, "spinner" ),
|
||||
this.widgetEventPrefix = "spin",
|
||||
this.options = ["culture", "disabled", "icons", "incremental", "max", "min", "numberFormat", "page", "step"],
|
||||
this.events = ["create", "start", "spin", "stop", "change"]
|
||||
};
|
||||
return e.prototype = d.createObject( c.prototype ),
|
||||
e.prototype.constructor = e,
|
||||
e.prototype.init = function ( d, e, f ) {
|
||||
var g, h, i;
|
||||
return g = c.prototype.init.apply( this, arguments ),
|
||||
h = this.widgetName,
|
||||
i = e(),
|
||||
i.value && b.computed( {
|
||||
read : function () {
|
||||
a( d )[h]( "value", b.utils.unwrapObservable( i.value ) )
|
||||
},
|
||||
disposeWhenNodeIsRemoved: d
|
||||
} ),
|
||||
b.isWriteableObservable( i.value ) && (f().valueUpdate ? this.on( d, "spin", function ( a, b ) {
|
||||
i.value( b.value )
|
||||
} ) : this.on( d, "change", function () {
|
||||
i.value( a( d )[h]( "value" ) )
|
||||
} )),
|
||||
g
|
||||
}
|
||||
,
|
||||
d.register( e ),
|
||||
e
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Tabs = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.tabs )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e, f, g;
|
||||
return e = function ( c, d ) {
|
||||
var e = d();
|
||||
b.isWriteableObservable( e.selected ) && this.on( c, "show", function ( b, d ) {
|
||||
a( c )[0] === b.target && e.selected( d.index )
|
||||
} )
|
||||
}
|
||||
,
|
||||
f = function ( c, d ) {
|
||||
var e = d();
|
||||
b.isWriteableObservable( e.active ) && this.on( c, "activate", function ( b, d ) {
|
||||
a( c )[0] === b.target && e.active( d.newTab.index() )
|
||||
} )
|
||||
}
|
||||
,
|
||||
g = function () {
|
||||
c.call( this, "tabs" ),
|
||||
this.version = d.uiVersion,
|
||||
1 === this.version.major && 8 === this.version.minor ? (this.options = ["ajaxOptions", "cache", "collapsible", "cookie", "disabled", "event", "fx", "idPrefix", "panelTemplate", "selected", "spinner", "tabTemplate"],
|
||||
this.events = ["add", "create", "disable", "enable", "load", "remove", "select", "show"],
|
||||
this.hasRefresh = !1) : (this.options = ["active", "collapsible", "disabled", "event", "heightStyle", "hide", "show"],
|
||||
this.events = ["activate", "beforeActivate", "beforeLoad", "create", "load"],
|
||||
this.hasRefresh = !0)
|
||||
}
|
||||
,
|
||||
g.prototype = d.createObject( c.prototype ),
|
||||
g.prototype.constructor = g,
|
||||
g.prototype.init = function ( a, b ) {
|
||||
var d = c.prototype.init.apply( this, arguments );
|
||||
return 1 === this.version.major && 8 === this.version.minor ? e.call( this, a, b ) : f.call( this, a, b ),
|
||||
d
|
||||
}
|
||||
,
|
||||
d.register( g ),
|
||||
g
|
||||
} ),
|
||||
function ( a, b ) {
|
||||
"use strict";
|
||||
a.kojqui.Tooltip = b( a.jQuery, a.ko, a.kojqui.BindingHandler, a.kojqui.utils, a.jQuery.ui.tooltip )
|
||||
}( this, function ( a, b, c, d ) {
|
||||
"use strict";
|
||||
var e = function () {
|
||||
c.call( this, "tooltip" ),
|
||||
this.options = ["content", "disabled", "hide", "items", "position", "show", "tooltipClass", "track"],
|
||||
this.events = ["create", "open", "close"]
|
||||
};
|
||||
return e.prototype = d.createObject( c.prototype ),
|
||||
e.prototype.constructor = e,
|
||||
e.prototype.init = function ( d, e ) {
|
||||
var f, g;
|
||||
return f = e(),
|
||||
g = c.prototype.init.apply( this, arguments ),
|
||||
f.isOpen && b.computed( {
|
||||
read : function () {
|
||||
a( d )[this.widgetName]( b.utils.unwrapObservable( f.isOpen ) ? "open" : "close" )
|
||||
},
|
||||
disposeWhenNodeIsRemoved: d,
|
||||
owner : this
|
||||
} ),
|
||||
b.isWriteableObservable( f.isOpen ) && (this.on( d, "open", function () {
|
||||
f.isOpen( !0 )
|
||||
} ),
|
||||
this.on( d, "close", function () {
|
||||
f.isOpen( !1 )
|
||||
} )),
|
||||
g
|
||||
}
|
||||
,
|
||||
d.register( e ),
|
||||
e
|
||||
} );
|
||||
Reference in New Issue
Block a user