Initial commit
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
// Put your application scripts here
|
||||
(function($){
|
||||
$(function(){
|
||||
$('#aloha').multiSelect({
|
||||
keepOrder: true
|
||||
});
|
||||
$('.multiselect').multiSelect({});
|
||||
|
||||
$('.searchable').multiSelect({
|
||||
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='try \"12\"'>",
|
||||
selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='try \"4\"'>",
|
||||
afterInit: function(ms){
|
||||
var that = this,
|
||||
$selectableSearch = that.$selectableUl.prev(),
|
||||
$selectionSearch = that.$selectionUl.prev(),
|
||||
selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)',
|
||||
selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';
|
||||
|
||||
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
|
||||
.on('keydown', function(e){
|
||||
if (e.which === 40){
|
||||
that.$selectableUl.focus();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
|
||||
.on('keydown', function(e){
|
||||
if (e.which == 40){
|
||||
that.$selectionUl.focus();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
afterSelect: function(){
|
||||
this.qs1.cache();
|
||||
this.qs2.cache();
|
||||
},
|
||||
afterDeselect: function(){
|
||||
this.qs1.cache();
|
||||
this.qs2.cache();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#keep-order').multiSelect({
|
||||
keepOrder: true
|
||||
});
|
||||
|
||||
$('#optgroup').multiSelect({
|
||||
selectableOptgroup: true
|
||||
});
|
||||
|
||||
|
||||
$('#custom-headers').multiSelect({
|
||||
selectableHeader: "<div class='custom-header'>Selectable item</div>",
|
||||
selectionHeader: "<div class='custom-header'>Selection items</div>",
|
||||
selectableFooter: "<div class='custom-header'>Selectable Footer</div>",
|
||||
selectionFooter: "<div class='custom-header'>Selection Footer</div>"
|
||||
});
|
||||
|
||||
$('#callbacks').multiSelect({
|
||||
afterSelect: function(values){
|
||||
alert("Select value: "+values);
|
||||
},
|
||||
afterDeselect: function(values){
|
||||
alert("Deselect value: "+values);
|
||||
}
|
||||
});
|
||||
|
||||
$('#refresh').on('click', function(){
|
||||
$('#public-methods').multiSelect('refresh');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#public-methods').multiSelect({});
|
||||
|
||||
$('#select-all').click(function(){
|
||||
$('#public-methods').multiSelect('select_all');
|
||||
return false;
|
||||
});
|
||||
$('#deselect-all').click(function(){
|
||||
$('#public-methods').multiSelect('deselect_all');
|
||||
return false;
|
||||
});
|
||||
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0; i < 100; i++){
|
||||
arr[i] = 'elem_'+(i+1);
|
||||
}
|
||||
|
||||
$('#select-100').click(function(){
|
||||
$('#public-methods').multiSelect('select', arr);
|
||||
return false;
|
||||
});
|
||||
$('#deselect-100').click(function(){
|
||||
$('#public-methods').multiSelect('deselect', arr);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#add-option').on('click', function(){
|
||||
$('#public-methods').multiSelect('addOption', { value: 42, text: 'test 42', index: 0 });
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/**
|
||||
* Created by Przemek on 2015-10-22.
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
//ładowanie dynamicznych pól dla zleceń (pierwsza strona)
|
||||
// ===================================================================
|
||||
$('#selectObj').change(function(){
|
||||
$('#selectScp').empty();
|
||||
|
||||
if ($('#selectObj').val()==12)
|
||||
{
|
||||
$('#selectScp').append( '<option value="801">Wymiana agregatu pompowego</option>' );
|
||||
$('#selectScp').append( '<option value="802">Wybudowa agregatu pompowego</option>' );
|
||||
$('#selectScp').append( '<option value="803">Zabudowa agregatu pompowego</option>' );
|
||||
$('#selectScp').append( '<option value="804">Uaktywnianie studni</option>' );
|
||||
$('#selectScp').append( '<option value="805">Czyszczenie studni</option>' );
|
||||
$('#selectScp').append( '<option value="806">Rekonstrukcja studni</option>' );
|
||||
$('#selectScp').append( '<option value="807">Instrumentacja studni</option>' );
|
||||
$('#selectScp').append( '<option value="808">Likwidacja studni</option>' );
|
||||
$('#selectScp').append( '<option value="809">Inne prace</option>' );
|
||||
|
||||
|
||||
}
|
||||
else if ($('#selectObj').val()==601)
|
||||
{
|
||||
$('#selectScp').append( '<option value="831">Uaktywnianie piezometru</option>' );
|
||||
$('#selectScp').append( '<option value="832">Czyszczenie piezometru</option>' );
|
||||
$('#selectScp').append( '<option value="833">Rekonstrukcja piezometru</option>' );
|
||||
$('#selectScp').append( '<option value="834">Instrumentacja piezometru</option>' );
|
||||
$('#selectScp').append( '<option value="835">Likwidacja piezometru</option>' );
|
||||
}
|
||||
});
|
||||
// ===================================================================
|
||||
|
||||
// uzupełnianie formularza dla studni (zlecenie 2 karta)
|
||||
// ===================================================================
|
||||
$('#site810A_2_inOrderWell').change(function(){
|
||||
//alert($('#site810A_2_inOrderWell').val());
|
||||
$.post(
|
||||
'./pop_selects.php',
|
||||
{site_810A_2_well_array_id:$('#site810A_2_inOrderWell').val()},
|
||||
function(res){
|
||||
$('#site810A_2').html(res);
|
||||
}
|
||||
);
|
||||
});
|
||||
// ===================================================================
|
||||
|
||||
// uzupełnianie formularza dla piezometru (zlecenie 2 karta)
|
||||
// ===================================================================
|
||||
$('#site810A_2_inOrderPiezo').change(function(){
|
||||
//alert($('#site810A_2_inOrderWell').val());
|
||||
$.post(
|
||||
'./pop_selects.php',
|
||||
{site_810A_2_piezo_array_id:$('#site810A_2_inOrderPiezo').val()},
|
||||
function(res){
|
||||
$('#site810A_2').html(res);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// ===================================================================
|
||||
|
||||
//czyszczenie formularzy
|
||||
// ===================================================================
|
||||
//edycja zleceń
|
||||
$('#cleanRegDate').click(function(){
|
||||
$('#data_01').val('');
|
||||
});
|
||||
$('#cleanStartDate').click(function(){
|
||||
$('#data_02').val('');
|
||||
});
|
||||
$('#cleanFinishDate').click(function(){
|
||||
$('#data_03').val('');
|
||||
});
|
||||
|
||||
// ===================================================================
|
||||
// dynamiczne liczenie "Ilośc metrów do wyczyszczenia": Ls-Lz
|
||||
// ===================================================================
|
||||
$('#inLS').keyup(function(){
|
||||
//alert($('#inLS').val());
|
||||
$('#inLS').val($('#inLS').val().replace(',','.'));
|
||||
|
||||
var newCln;
|
||||
newCln = (($('#inLS').val()) - ($('#inLZ').val()));
|
||||
$('#inIlCln').val(newCln.toFixed(2));
|
||||
});
|
||||
$('#inLZ').keyup(function(){
|
||||
//alert($('#inLS').val());
|
||||
$('#inLZ').val($('#inLZ').val().replace(',','.'));
|
||||
|
||||
var newCln;
|
||||
newCln = (($('#inLS').val()) - ($('#inLZ').val()));
|
||||
$('#inIlCln').val(newCln.toFixed(2));
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// ===================================================================
|
||||
// ===================================================================
|
||||
|
||||
// ===================================================================
|
||||
// odejmowanie głębokości zasypu dla karty otworu #inRzNew
|
||||
// ===================================================================
|
||||
|
||||
|
||||
// ===================================================================
|
||||
// ===================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
// ===================================================================
|
||||
// liczenie ilości equipment na
|
||||
// ===================================================================
|
||||
$('#inRuValue').focus();
|
||||
$('#inRuValue').blur(function(){
|
||||
var avVal = parseInt($('#inAvValue').val(),10);
|
||||
var inVal = parseInt($('#inRuValue').val(),10);
|
||||
|
||||
if (inVal>avVal) {
|
||||
$('#subRuSave').attr("disabled", true);
|
||||
sweetAlert("Operacja niepoprawna!", "Wprowadzona wartość jest większa od dostępnej ilości.\n Spróbuj ponownie.", "warning");
|
||||
$('#inRuValue').focus();
|
||||
$('#inRuValue').val('');
|
||||
}
|
||||
else
|
||||
$('#subRuSave').attr("disabled", false);
|
||||
|
||||
});
|
||||
// ===================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Zamienia "w locie" przecinek na kropkę
|
||||
// ===================================================================
|
||||
|
||||
$('#inNumberValidate').keyup(function(){
|
||||
var inVal;
|
||||
inVal = $('#inNumberValidate').val().replace(',','.');
|
||||
$('#inNumberValidate').val(inVal);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -0,0 +1,143 @@
|
||||
/*!
|
||||
* jquery.confirm
|
||||
*
|
||||
* @version 2.3.1
|
||||
*
|
||||
* @author My C-Labs
|
||||
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
||||
* @author Russel Vela
|
||||
* @author Marcus Schwarz <msspamfang@gmx.de>
|
||||
*
|
||||
* @license MIT
|
||||
* @url http://myclabs.github.io/jquery.confirm/
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
* Confirm a link or a button
|
||||
* @param [options] {{title, text, confirm, cancel, confirmButton, cancelButton, post, confirmButtonClass}}
|
||||
*/
|
||||
$.fn.confirm = function (options) {
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
this.click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var newOptions = $.extend({
|
||||
button: $(this)
|
||||
}, options);
|
||||
|
||||
$.confirm(newOptions, e);
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Show a confirmation dialog
|
||||
* @param [options] {{title, text, confirm, cancel, confirmButton, cancelButton, post, confirmButtonClass}}
|
||||
* @param [e] {Event}
|
||||
*/
|
||||
$.confirm = function (options, e) {
|
||||
// Do nothing when active confirm modal.
|
||||
if ($('.confirmation-modal').length > 0)
|
||||
return;
|
||||
|
||||
// Parse options defined with "data-" attributes
|
||||
var dataOptions = {};
|
||||
if (options.button) {
|
||||
var dataOptionsMapping = {
|
||||
'title': 'title',
|
||||
'text': 'text',
|
||||
'confirm-button': 'confirmButton',
|
||||
'cancel-button': 'cancelButton',
|
||||
'confirm-button-class': 'confirmButtonClass'
|
||||
};
|
||||
$.each(dataOptionsMapping, function(attributeName, optionName) {
|
||||
var value = options.button.data(attributeName);
|
||||
if (value) {
|
||||
dataOptions[optionName] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Default options
|
||||
var settings = $.extend({}, $.confirm.options, {
|
||||
confirm: function () {
|
||||
var url = e && (('string' === typeof e && e) || (e.currentTarget && e.currentTarget.attributes['href'].value));
|
||||
if (url) {
|
||||
if (options.post) {
|
||||
var form = $('<form method="post" class="hide" action="' + url + '"></form>');
|
||||
$("body").append(form);
|
||||
form.submit();
|
||||
} else {
|
||||
window.location = url;
|
||||
}
|
||||
}
|
||||
},
|
||||
cancel: function (o) {
|
||||
},
|
||||
button: null
|
||||
}, dataOptions, options);
|
||||
|
||||
// Modal
|
||||
var modalHeader = '';
|
||||
if (settings.title !== '') {
|
||||
modalHeader =
|
||||
'<div class=modal-header>' +
|
||||
'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
|
||||
'<h4 class="modal-title">' + settings.title+'</h4>' +
|
||||
'</div>';
|
||||
}
|
||||
var modalHTML =
|
||||
'<div class="confirmation-modal modal fade" tabindex="-1" role="dialog">' +
|
||||
'<div class="modal-dialog">' +
|
||||
'<div class="modal-content">' +
|
||||
modalHeader +
|
||||
'<div class="modal-body">' + settings.text + '</div>' +
|
||||
'<div class="modal-footer">' +
|
||||
'<button class="confirm btn ' + settings.confirmButtonClass + '" type="button" data-dismiss="modal">' +
|
||||
settings.confirmButton +
|
||||
'</button>' +
|
||||
'<button class="cancel btn btn-default" type="button" data-dismiss="modal">' +
|
||||
settings.cancelButton +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
var modal = $(modalHTML);
|
||||
|
||||
modal.on('shown.bs.modal', function () {
|
||||
modal.find(".btn-primary:first").focus();
|
||||
});
|
||||
modal.on('hidden.bs.modal', function () {
|
||||
modal.remove();
|
||||
});
|
||||
modal.find(".confirm").click(function () {
|
||||
settings.confirm(settings.button);
|
||||
});
|
||||
modal.find(".cancel").click(function () {
|
||||
settings.cancel(settings.button);
|
||||
});
|
||||
|
||||
// Show the modal
|
||||
$("body").append(modal);
|
||||
modal.modal('show');
|
||||
};
|
||||
|
||||
/**
|
||||
* Globally definable rules
|
||||
*/
|
||||
$.confirm.options = {
|
||||
text: "Are you sure?",
|
||||
title: "",
|
||||
confirmButton: "Yes",
|
||||
cancelButton: "Cancel",
|
||||
post: false,
|
||||
confirmButtonClass: "btn-primary"
|
||||
}
|
||||
})(jQuery);
|
||||
Vendored
+5
File diff suppressed because one or more lines are too long
@@ -0,0 +1,529 @@
|
||||
/*
|
||||
* MultiSelect v0.9.11
|
||||
* Copyright (c) 2012 Louis Cuny
|
||||
*
|
||||
* This program is free software. It comes without any warranty, to
|
||||
* the extent permitted by applicable law. You can redistribute it
|
||||
* and/or modify it under the terms of the Do What The Fuck You Want
|
||||
* To Public License, Version 2, as published by Sam Hocevar. See
|
||||
* http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/* MULTISELECT CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var MultiSelect = function (element, options) {
|
||||
this.options = options;
|
||||
this.$element = $(element);
|
||||
this.$container = $('<div/>', { 'class': "ms-container" });
|
||||
this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
|
||||
this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });
|
||||
this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.$selectionUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.scrollTo = 0;
|
||||
this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';
|
||||
};
|
||||
|
||||
MultiSelect.prototype = {
|
||||
constructor: MultiSelect,
|
||||
|
||||
init: function(){
|
||||
var that = this,
|
||||
ms = this.$element;
|
||||
|
||||
if (ms.next('.ms-container').length === 0){
|
||||
ms.css({ position: 'absolute', left: '-9999px' });
|
||||
ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');
|
||||
this.$container.attr('id', 'ms-'+ms.attr('id'));
|
||||
this.$container.addClass(that.options.cssClass);
|
||||
ms.find('option').each(function(){
|
||||
that.generateLisFromOption(this);
|
||||
});
|
||||
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
|
||||
if (that.options.selectableHeader){
|
||||
that.$selectableContainer.append(that.options.selectableHeader);
|
||||
}
|
||||
that.$selectableContainer.append(that.$selectableUl);
|
||||
if (that.options.selectableFooter){
|
||||
that.$selectableContainer.append(that.options.selectableFooter);
|
||||
}
|
||||
|
||||
if (that.options.selectionHeader){
|
||||
that.$selectionContainer.append(that.options.selectionHeader);
|
||||
}
|
||||
that.$selectionContainer.append(that.$selectionUl);
|
||||
if (that.options.selectionFooter){
|
||||
that.$selectionContainer.append(that.options.selectionFooter);
|
||||
}
|
||||
|
||||
that.$container.append(that.$selectableContainer);
|
||||
that.$container.append(that.$selectionContainer);
|
||||
ms.after(that.$container);
|
||||
|
||||
that.activeMouse(that.$selectableUl);
|
||||
that.activeKeyboard(that.$selectableUl);
|
||||
|
||||
var action = that.options.dblClick ? 'dblclick' : 'click';
|
||||
|
||||
that.$selectableUl.on(action, '.ms-elem-selectable', function(){
|
||||
that.select($(this).data('ms-value'));
|
||||
});
|
||||
that.$selectionUl.on(action, '.ms-elem-selection', function(){
|
||||
that.deselect($(this).data('ms-value'));
|
||||
});
|
||||
|
||||
that.activeMouse(that.$selectionUl);
|
||||
that.activeKeyboard(that.$selectionUl);
|
||||
|
||||
ms.on('focus', function(){
|
||||
that.$selectableUl.focus();
|
||||
})
|
||||
}
|
||||
|
||||
var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
|
||||
that.select(selectedValues, 'init');
|
||||
|
||||
if (typeof that.options.afterInit === 'function') {
|
||||
that.options.afterInit.call(this, this.$container);
|
||||
}
|
||||
},
|
||||
|
||||
'generateLisFromOption' : function(option, index, $container){
|
||||
var that = this,
|
||||
ms = that.$element,
|
||||
attributes = "",
|
||||
$option = $(option);
|
||||
|
||||
for (var cpt = 0; cpt < option.attributes.length; cpt++){
|
||||
var attr = option.attributes[cpt];
|
||||
|
||||
if(attr.name !== 'value' && attr.name !== 'disabled'){
|
||||
attributes += attr.name+'="'+attr.value+'" ';
|
||||
}
|
||||
}
|
||||
var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),
|
||||
selectedLi = selectableLi.clone(),
|
||||
value = $option.val(),
|
||||
elementId = that.sanitize(value);
|
||||
|
||||
selectableLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selectable')
|
||||
.attr('id', elementId+'-selectable');
|
||||
|
||||
selectedLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selection')
|
||||
.attr('id', elementId+'-selection')
|
||||
.hide();
|
||||
|
||||
if ($option.prop('disabled') || ms.prop('disabled')){
|
||||
selectedLi.addClass(that.options.disabledClass);
|
||||
selectableLi.addClass(that.options.disabledClass);
|
||||
}
|
||||
|
||||
var $optgroup = $option.parent('optgroup');
|
||||
|
||||
if ($optgroup.length > 0){
|
||||
var optgroupLabel = $optgroup.attr('label'),
|
||||
optgroupId = that.sanitize(optgroupLabel),
|
||||
$selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),
|
||||
$selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);
|
||||
|
||||
if ($selectableOptgroup.length === 0){
|
||||
var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
|
||||
optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
|
||||
|
||||
$selectableOptgroup = $(optgroupContainerTpl);
|
||||
$selectionOptgroup = $(optgroupContainerTpl);
|
||||
$selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
|
||||
$selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);
|
||||
$selectableOptgroup.append($(optgroupTpl));
|
||||
$selectionOptgroup.append($(optgroupTpl));
|
||||
if (that.options.selectableOptgroup){
|
||||
$selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':not(:selected)').map(function(){ return $(this).val() }).get();
|
||||
that.select(values);
|
||||
});
|
||||
$selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':selected').map(function(){ return $(this).val() }).get();
|
||||
that.deselect(values);
|
||||
});
|
||||
}
|
||||
that.$selectableUl.append($selectableOptgroup);
|
||||
that.$selectionUl.append($selectionOptgroup);
|
||||
}
|
||||
index = index == undefined ? $selectableOptgroup.children().length : index + 1;
|
||||
selectableLi.insertAt(index, $selectableOptgroup.children());
|
||||
selectedLi.insertAt(index, $selectionOptgroup.children());
|
||||
} else {
|
||||
index = index == undefined ? that.$selectableUl.children().length : index;
|
||||
|
||||
selectableLi.insertAt(index, that.$selectableUl);
|
||||
selectedLi.insertAt(index, that.$selectionUl);
|
||||
}
|
||||
},
|
||||
|
||||
'addOption' : function(options){
|
||||
var that = this;
|
||||
|
||||
if (options.value) options = [options];
|
||||
$.each(options, function(index, option){
|
||||
if (option.value && that.$element.find("option[value='"+option.value+"']").length === 0){
|
||||
var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
|
||||
index = parseInt((typeof option.index === 'undefined' ? that.$element.children().length : option.index)),
|
||||
$container = option.nested == undefined ? that.$element : $("optgroup[label='"+option.nested+"']")
|
||||
|
||||
$option.insertAt(index, $container);
|
||||
that.generateLisFromOption($option.get(0), index, option.nested);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
'escapeHTML' : function(text){
|
||||
return $("<div>").text(text).html();
|
||||
},
|
||||
|
||||
'activeKeyboard' : function($list){
|
||||
var that = this;
|
||||
|
||||
$list.on('focus', function(){
|
||||
$(this).addClass('ms-focus');
|
||||
})
|
||||
.on('blur', function(){
|
||||
$(this).removeClass('ms-focus');
|
||||
})
|
||||
.on('keydown', function(e){
|
||||
switch (e.which) {
|
||||
case 40:
|
||||
case 38:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
|
||||
return;
|
||||
case 37:
|
||||
case 39:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.switchList($list);
|
||||
return;
|
||||
case 9:
|
||||
if(that.$element.is('[tabindex]')){
|
||||
e.preventDefault();
|
||||
var tabindex = parseInt(that.$element.attr('tabindex'), 10);
|
||||
tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
|
||||
$('[tabindex="'+(tabindex)+'"]').focus();
|
||||
return;
|
||||
}else{
|
||||
if(e.shiftKey){
|
||||
that.$element.trigger('focus');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($.inArray(e.which, that.options.keySelect) > -1){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.selectHighlighted($list);
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'moveHighlight': function($list, direction){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$currElem = $elems.filter('.ms-hover'),
|
||||
$nextElem = null,
|
||||
elemHeight = $elems.first().outerHeight(),
|
||||
containerHeight = $list.height(),
|
||||
containerSelector = '#'+this.$container.prop('id');
|
||||
|
||||
// Deactive mouseenter event when move is active
|
||||
// It fixes a bug when mouse is over the list
|
||||
$elems.off('mouseenter');
|
||||
|
||||
$elems.removeClass('ms-hover');
|
||||
if (direction === 1){ // DOWN
|
||||
|
||||
$nextElem = $currElem.nextAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$nextOptgroupLi = $optgroupLi.next(':visible');
|
||||
|
||||
if ($nextOptgroupLi.length > 0){
|
||||
$nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
}
|
||||
} else if (direction === -1){ // UP
|
||||
|
||||
$nextElem = $currElem.prevAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$prevOptgroupLi = $optgroupLi.prev(':visible');
|
||||
|
||||
if ($prevOptgroupLi.length > 0){
|
||||
$nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nextElem.length > 0){
|
||||
$nextElem.addClass('ms-hover');
|
||||
var scrollTo = $list.scrollTop() + $nextElem.position().top -
|
||||
containerHeight / 2 + elemHeight / 2;
|
||||
|
||||
$list.scrollTop(scrollTo);
|
||||
}
|
||||
},
|
||||
|
||||
'selectHighlighted' : function($list){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$highlightedElem = $elems.filter('.ms-hover').first();
|
||||
|
||||
if ($highlightedElem.length > 0){
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.select($highlightedElem.data('ms-value'));
|
||||
} else {
|
||||
this.deselect($highlightedElem.data('ms-value'));
|
||||
}
|
||||
$elems.removeClass('ms-hover');
|
||||
}
|
||||
},
|
||||
|
||||
'switchList' : function($list){
|
||||
$list.blur();
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.$selectionUl.focus();
|
||||
} else {
|
||||
this.$selectableUl.focus();
|
||||
}
|
||||
},
|
||||
|
||||
'activeMouse' : function($list){
|
||||
var that = this;
|
||||
|
||||
$list.on('mousemove', function(){
|
||||
var elems = $list.find(that.elemsSelector);
|
||||
|
||||
elems.on('mouseenter', function(){
|
||||
elems.removeClass('ms-hover');
|
||||
$(this).addClass('ms-hover');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
'refresh' : function() {
|
||||
this.destroy();
|
||||
this.$element.multiSelect(this.options);
|
||||
},
|
||||
|
||||
'destroy' : function(){
|
||||
$("#ms-"+this.$element.attr("id")).remove();
|
||||
this.$element.removeData('multiselect');
|
||||
},
|
||||
|
||||
'select' : function(value, method){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (method === 'init'){
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
|
||||
}
|
||||
|
||||
if (selectables.length > 0){
|
||||
selectables.addClass('ms-selected').hide();
|
||||
selections.addClass('ms-selected').show();
|
||||
options.prop('selected', true);
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (that.options.keepOrder && method !== 'init'){
|
||||
var selectionLiLast = that.$selectionUl.find('.ms-selected');
|
||||
if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
|
||||
selections.insertAfter(selectionLiLast.last());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method !== 'init'){
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterSelect === 'function') {
|
||||
that.options.afterSelect.call(this, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'deselect' : function(value){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (selections.length > 0){
|
||||
selectables.removeClass('ms-selected').show();
|
||||
selections.removeClass('ms-selected').hide();
|
||||
options.prop('selected', false);
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.filter(':not(.ms-selected)').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length === 0){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterDeselect === 'function') {
|
||||
that.options.afterDeselect.call(this, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'select_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option:not(":disabled")').prop('selected', true);
|
||||
this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
|
||||
this.$selectionUl.find('.ms-optgroup-label').show();
|
||||
this.$selectableUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
|
||||
this.$selectionUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterSelect === 'function') {
|
||||
var selectedValues = $.grep(ms.val(), function(item){
|
||||
return $.inArray(item, values) < 0;
|
||||
});
|
||||
this.options.afterSelect.call(this, selectedValues);
|
||||
}
|
||||
},
|
||||
|
||||
'deselect_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option').prop('selected', false);
|
||||
this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectableUl.find('.ms-optgroup-label').show();
|
||||
this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
|
||||
this.$selectableUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterDeselect === 'function') {
|
||||
this.options.afterDeselect.call(this, values);
|
||||
}
|
||||
},
|
||||
|
||||
sanitize: function(value){
|
||||
var hash = 0, i, char;
|
||||
if (value.length == 0) return hash;
|
||||
var ls = 0;
|
||||
for (i = 0, ls = value.length; i < ls; i++) {
|
||||
char = value.charCodeAt(i);
|
||||
hash = ((hash<<5)-hash)+char;
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
/* MULTISELECT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.multiSelect = function () {
|
||||
var option = arguments[0],
|
||||
args = arguments;
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('multiselect'),
|
||||
options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
|
||||
|
||||
if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
|
||||
|
||||
if (typeof option === 'string'){
|
||||
data[option](args[1]);
|
||||
} else {
|
||||
data.init();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.multiSelect.defaults = {
|
||||
keySelect: [32],
|
||||
selectableOptgroup: false,
|
||||
disabledClass : 'disabled',
|
||||
dblClick : false,
|
||||
keepOrder: false,
|
||||
cssClass: ''
|
||||
};
|
||||
|
||||
$.fn.multiSelect.Constructor = MultiSelect;
|
||||
|
||||
$.fn.insertAt = function(index, $parent) {
|
||||
return this.each(function() {
|
||||
if (index === 0) {
|
||||
$parent.prepend(this);
|
||||
} else {
|
||||
$parent.children().eq(index - 1).after(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
Vendored
+1231
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,311 @@
|
||||
/* ============================================================================
|
||||
* SoftSPM — animowane tlo "flowing wave mesh" (Canvas 2D, bez bibliotek)
|
||||
* ----------------------------------------------------------------------------
|
||||
* Tryby:
|
||||
* 'text' - wezly ukladaja sie w podany napis (drgaja z mala amplituda),
|
||||
* 'wave' - pasmo falujacych linii (suma sinusow, ruch organiczny).
|
||||
*
|
||||
* Sterowanie z HTML przez atrybuty canvasu:
|
||||
* data-mode="text|wave" data-text="SoftSPM"
|
||||
*
|
||||
* Wszystkie parametry w jednym obiekcie CONFIG ponizej.
|
||||
* Zgodne z PHP 5.4 / starymi przegladarkami (czysty ES5, requestAnimationFrame).
|
||||
* ========================================================================== */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var CONFIG = {
|
||||
mode: 'text', // 'text' | 'wave'
|
||||
text: 'SoftSPM',
|
||||
|
||||
// --- siatka / probkowanie ---
|
||||
grid: 7, // odleglosc miedzy wezlami [px] (mniej = gesciej)
|
||||
alphaThreshold: 120, // min. alfa piksela litery, by postawic wezel
|
||||
|
||||
// --- tekst ---
|
||||
fontWeight: '700',
|
||||
fontFamily: '"Segoe UI", Roboto, Arial, sans-serif',
|
||||
textHeightRatio: 0.17, // wysokosc fontu wzgledem wysokosci canvasu
|
||||
textAnchor: { x: 0.07, y: 0.90 }, // kotwica napisu (ulamek szer./wys.) -> dol-lewo
|
||||
|
||||
// --- ruch ---
|
||||
amplitude: 1.7, // amplituda drgania wezlow [px] (maly = czytelny napis)
|
||||
speed: 0.0016, // mnoznik czasu
|
||||
|
||||
// --- kolor / poswiata ---
|
||||
color: { r: 41, g: 171, b: 226 }, // turkus marki SoftSPM (rgb 41,171,226)
|
||||
opacity: 0.85,
|
||||
glow: 8, // shadowBlur (poswiata neonowa)
|
||||
lineWidth: 1,
|
||||
nodeRadius: 1.15,
|
||||
drawNodes: true,
|
||||
|
||||
// --- reflektor (jasnosc wygasa przy krawedziach) ---
|
||||
edgeFalloff: 0.55, // 0 = brak, 1 = pelne wygaszenie na krawedziach
|
||||
spotlightCenter: null, // null = auto (srodek napisu / 0.5 dla fali)
|
||||
|
||||
// --- tryb 'wave' ---
|
||||
waveCols: 90,
|
||||
waveRows: 13,
|
||||
bandCenter: 0.72, // srodek pasma (ulamek wysokosci)
|
||||
bandWidth: 0.40, // szerokosc pasma (ulamek wysokosci)
|
||||
connectorEvery: 3, // co ile kolumn pionowy lacznik (efekt siatki)
|
||||
// skladowe fal: [amplituda(px), czestotliwosc, predkosc, faza]
|
||||
waves: [
|
||||
[22, 0.018, 0.9, 0.0],
|
||||
[14, 0.035, -1.4, 1.7],
|
||||
[9, 0.061, 2.1, 3.1],
|
||||
[6, 0.090, -2.8, 0.6]
|
||||
]
|
||||
};
|
||||
|
||||
function MeshAnim(canvas, cfg) {
|
||||
this.canvas = canvas;
|
||||
this.cfg = cfg;
|
||||
this.ctx = canvas.getContext('2d');
|
||||
this.dpr = window.devicePixelRatio || 1;
|
||||
this.w = 0;
|
||||
this.h = 0;
|
||||
this.nodes = [];
|
||||
this.edges = [];
|
||||
this.spotX = 0.5;
|
||||
this.raf = 0;
|
||||
this._resizeTimer = 0;
|
||||
|
||||
var self = this;
|
||||
this._onResize = function () {
|
||||
clearTimeout(self._resizeTimer);
|
||||
self._resizeTimer = setTimeout(function () { self.resize(); }, 120);
|
||||
};
|
||||
window.addEventListener('resize', this._onResize);
|
||||
}
|
||||
|
||||
MeshAnim.prototype.resize = function () {
|
||||
var rect = this.canvas.getBoundingClientRect();
|
||||
this.dpr = window.devicePixelRatio || 1;
|
||||
this.w = Math.max(1, Math.round(rect.width));
|
||||
this.h = Math.max(1, Math.round(rect.height));
|
||||
this.canvas.width = Math.round(this.w * this.dpr);
|
||||
this.canvas.height = Math.round(this.h * this.dpr);
|
||||
this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
|
||||
this.build();
|
||||
};
|
||||
|
||||
MeshAnim.prototype.build = function () {
|
||||
if (this.cfg.mode === 'wave') this.buildWave();
|
||||
else this.buildText();
|
||||
|
||||
// srodek reflektora
|
||||
if (this.cfg.spotlightCenter != null) {
|
||||
this.spotX = this.cfg.spotlightCenter;
|
||||
} else if (this.cfg.mode === 'text' && this.nodes.length) {
|
||||
var minX = Infinity, maxX = -Infinity, i;
|
||||
for (i = 0; i < this.nodes.length; i++) {
|
||||
if (this.nodes[i].bx < minX) minX = this.nodes[i].bx;
|
||||
if (this.nodes[i].bx > maxX) maxX = this.nodes[i].bx;
|
||||
}
|
||||
this.spotX = ((minX + maxX) / 2) / this.w;
|
||||
} else {
|
||||
this.spotX = 0.5;
|
||||
}
|
||||
};
|
||||
|
||||
// --- model TEKST: render na ukrytym canvasie -> probkowanie pikseli ---
|
||||
MeshAnim.prototype.buildText = function () {
|
||||
var cfg = this.cfg, w = this.w, h = this.h;
|
||||
this.nodes = [];
|
||||
this.edges = [];
|
||||
if (!w || !h) return;
|
||||
|
||||
var off = document.createElement('canvas');
|
||||
off.width = w; off.height = h;
|
||||
var octx = off.getContext('2d');
|
||||
var size = Math.round(h * cfg.textHeightRatio);
|
||||
octx.font = cfg.fontWeight + ' ' + size + 'px ' + cfg.fontFamily;
|
||||
octx.textBaseline = 'alphabetic';
|
||||
octx.textAlign = 'left';
|
||||
octx.fillStyle = '#fff';
|
||||
octx.fillText(cfg.text, Math.round(w * cfg.textAnchor.x), Math.round(h * cfg.textAnchor.y));
|
||||
|
||||
var img = octx.getImageData(0, 0, w, h).data;
|
||||
var step = cfg.grid;
|
||||
var cols = Math.floor(w / step);
|
||||
var rows = Math.floor(h / step);
|
||||
var indexMap = {}; // "c_r" -> node index
|
||||
var c, r, px, py, a, idx;
|
||||
|
||||
for (r = 0; r < rows; r++) {
|
||||
for (c = 0; c < cols; c++) {
|
||||
px = c * step + (step >> 1);
|
||||
py = r * step + (step >> 1);
|
||||
a = img[(py * w + px) * 4 + 3];
|
||||
if (a >= cfg.alphaThreshold) {
|
||||
indexMap[c + '_' + r] = this.nodes.length;
|
||||
this.nodes.push({
|
||||
bx: px, by: py,
|
||||
ph: (c * 0.7 + r * 1.3), // faza drgania
|
||||
fx: 0.9 + (c % 5) * 0.06, // lekko rozne czestotliwosci
|
||||
fy: 1.1 + (r % 4) * 0.05
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// krawedzie: prawo, dol, skos prawy-dol (siatka trojkatna)
|
||||
var neigh = [[1, 0], [0, 1], [1, 1]];
|
||||
for (r = 0; r < rows; r++) {
|
||||
for (c = 0; c < cols; c++) {
|
||||
idx = indexMap[c + '_' + r];
|
||||
if (idx == null) continue;
|
||||
for (var n = 0; n < neigh.length; n++) {
|
||||
var j = indexMap[(c + neigh[n][0]) + '_' + (r + neigh[n][1])];
|
||||
if (j != null) this.edges.push([idx, j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// --- model FALA: pasmo wezlow, ruch = suma sinusow ---
|
||||
MeshAnim.prototype.buildWave = function () {
|
||||
var cfg = this.cfg, w = this.w, h = this.h;
|
||||
this.nodes = [];
|
||||
this.edges = [];
|
||||
if (!w || !h) return;
|
||||
|
||||
var cols = cfg.waveCols, rows = cfg.waveRows;
|
||||
var band = cfg.bandWidth * h;
|
||||
var top = cfg.bandCenter * h - band / 2;
|
||||
var grid = [];
|
||||
var c, r;
|
||||
for (r = 0; r < rows; r++) {
|
||||
grid[r] = [];
|
||||
for (c = 0; c < cols; c++) {
|
||||
var bx = (cols === 1 ? 0 : c / (cols - 1)) * w;
|
||||
var by = top + (rows === 1 ? 0.5 : r / (rows - 1)) * band;
|
||||
grid[r][c] = this.nodes.length;
|
||||
this.nodes.push({ bx: bx, by: by, col: c, row: r });
|
||||
}
|
||||
}
|
||||
for (r = 0; r < rows; r++) {
|
||||
for (c = 0; c < cols; c++) {
|
||||
if (c < cols - 1) this.edges.push([grid[r][c], grid[r][c + 1]]); // poziome
|
||||
if (r < rows - 1 && c % cfg.connectorEvery === 0) {
|
||||
this.edges.push([grid[r][c], grid[r + 1][c]]); // pionowe laczniki
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MeshAnim.prototype.nodePos = function (nd, t) {
|
||||
var cfg = this.cfg;
|
||||
if (cfg.mode === 'wave') {
|
||||
var y = nd.by, wv = cfg.waves, k;
|
||||
for (k = 0; k < wv.length; k++) {
|
||||
y += wv[k][0] * Math.sin(nd.bx * wv[k][1] + t * wv[k][2] + wv[k][3] + nd.row * 0.4);
|
||||
}
|
||||
return [nd.bx, y];
|
||||
}
|
||||
// tryb tekstu: drobne drganie (napis czytelny)
|
||||
var a = cfg.amplitude;
|
||||
return [
|
||||
nd.bx + a * Math.sin(t * nd.fx + nd.ph),
|
||||
nd.by + a * Math.cos(t * nd.fy + nd.ph * 1.3)
|
||||
];
|
||||
};
|
||||
|
||||
MeshAnim.prototype.frame = function (now) {
|
||||
var self = this;
|
||||
var cfg = this.cfg, ctx = this.ctx, w = this.w, h = this.h;
|
||||
var t = now * cfg.speed;
|
||||
ctx.clearRect(0, 0, w, h);
|
||||
|
||||
if (this.nodes.length) {
|
||||
// policz pozycje raz na klatke
|
||||
var pos = new Array(this.nodes.length), i;
|
||||
for (i = 0; i < this.nodes.length; i++) pos[i] = this.nodePos(this.nodes[i], t);
|
||||
|
||||
var col = cfg.color;
|
||||
var stroke = 'rgb(' + col.r + ',' + col.g + ',' + col.b + ')';
|
||||
ctx.lineWidth = cfg.lineWidth;
|
||||
ctx.lineCap = 'round';
|
||||
ctx.shadowColor = stroke;
|
||||
ctx.shadowBlur = cfg.glow;
|
||||
ctx.strokeStyle = stroke;
|
||||
|
||||
// kubelki jasnosci (reflektor) -> 1 stroke na kubelek = wydajnie z glow
|
||||
var BUCKETS = 6, b, paths = [];
|
||||
for (b = 0; b < BUCKETS; b++) paths[b] = [];
|
||||
var e, a, bxC, fac, bk;
|
||||
for (i = 0; i < this.edges.length; i++) {
|
||||
e = this.edges[i];
|
||||
a = pos[e[0]]; var b2 = pos[e[1]];
|
||||
bxC = ((a[0] + b2[0]) / 2) / w; // srodek krawedzi (ulamek szer.)
|
||||
fac = 1 - cfg.edgeFalloff * Math.pow(Math.abs(bxC - this.spotX) * 2, 2);
|
||||
if (fac <= 0.02) continue;
|
||||
bk = Math.min(BUCKETS - 1, Math.max(0, Math.floor(fac * BUCKETS)));
|
||||
paths[bk].push(a, b2);
|
||||
}
|
||||
for (b = 0; b < BUCKETS; b++) {
|
||||
if (!paths[b].length) continue;
|
||||
ctx.globalAlpha = cfg.opacity * ((b + 0.5) / BUCKETS);
|
||||
ctx.beginPath();
|
||||
for (i = 0; i < paths[b].length; i += 2) {
|
||||
ctx.moveTo(paths[b][i][0], paths[b][i][1]);
|
||||
ctx.lineTo(paths[b][i + 1][0], paths[b][i + 1][1]);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// wezly jako drobne punkty (jeden fill)
|
||||
if (cfg.drawNodes) {
|
||||
ctx.globalAlpha = cfg.opacity;
|
||||
ctx.fillStyle = stroke;
|
||||
ctx.beginPath();
|
||||
for (i = 0; i < pos.length; i++) {
|
||||
ctx.moveTo(pos[i][0] + cfg.nodeRadius, pos[i][1]);
|
||||
ctx.arc(pos[i][0], pos[i][1], cfg.nodeRadius, 0, Math.PI * 2);
|
||||
}
|
||||
ctx.fill();
|
||||
}
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.shadowBlur = 0;
|
||||
}
|
||||
|
||||
this.raf = window.requestAnimationFrame(function (ts) { self.frame(ts); });
|
||||
};
|
||||
|
||||
MeshAnim.prototype.start = function () {
|
||||
var self = this;
|
||||
this.resize();
|
||||
this.raf = window.requestAnimationFrame(function (ts) { self.frame(ts); });
|
||||
};
|
||||
|
||||
MeshAnim.prototype.destroy = function () {
|
||||
window.cancelAnimationFrame(this.raf);
|
||||
window.removeEventListener('resize', this._onResize);
|
||||
};
|
||||
|
||||
function boot() {
|
||||
var canvas = document.getElementById('spm-mesh');
|
||||
if (!canvas) return;
|
||||
var cfg = {};
|
||||
for (var k in CONFIG) if (CONFIG.hasOwnProperty(k)) cfg[k] = CONFIG[k];
|
||||
if (canvas.getAttribute('data-mode')) cfg.mode = canvas.getAttribute('data-mode');
|
||||
if (canvas.getAttribute('data-text')) cfg.text = canvas.getAttribute('data-text');
|
||||
|
||||
var anim = new MeshAnim(canvas, cfg);
|
||||
window.spmMesh = anim;
|
||||
|
||||
// przy wlasnej czcionce poczekaj na gotowosc fontow (czytelny napis)
|
||||
if (cfg.mode === 'text' && document.fonts && document.fonts.ready) {
|
||||
document.fonts.ready.then(function () { anim.start(); });
|
||||
} else {
|
||||
anim.start();
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', boot);
|
||||
} else {
|
||||
boot();
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Created by Przemek on 30.03.15.
|
||||
*/
|
||||
function ukryj(id) {
|
||||
document.getElementById(id).style.display="none";
|
||||
document.getElementById(id).style.position="absolute";
|
||||
}
|
||||
|
||||
function show(id) {
|
||||
document.getElementById(id).style.display="block";
|
||||
document.getElementById(id).style.position="relative";
|
||||
}
|
||||
|
||||
function pokaz(id)
|
||||
{
|
||||
if(document.getElementById(id).style.display=="block")
|
||||
{
|
||||
ukryj(id);
|
||||
}
|
||||
else {
|
||||
show(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,768 @@
|
||||
$().ready(function()
|
||||
{
|
||||
|
||||
// validate PumpCatalogueForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#PumpCatalogueForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inPumpName: "required",
|
||||
inPumpQn: "required",
|
||||
inPumpHp: "required",
|
||||
inPumpEta: "required"
|
||||
},
|
||||
messages: {
|
||||
inPumpName: "Please enter a pump type or name",
|
||||
inPumpQn: "Pole wymagane.",
|
||||
inPumpHp: "Pole wymagane.",
|
||||
inPumpEta: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate AddUserForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddUserForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inUserFName: "required",
|
||||
inUserLName: "required",
|
||||
inUserLogin: {
|
||||
required: true,
|
||||
minlength: 3
|
||||
},
|
||||
inUserMail: {
|
||||
required: true,
|
||||
email: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
inUserFName: "Please enter your firstname",
|
||||
inUserLName: "Please enter your lastname",
|
||||
inUserLogin: {
|
||||
required: "Please enter a login",
|
||||
minlength: "Your login must consist of at least 3 characters"
|
||||
},
|
||||
inUserMail: "Please enter a valid email address"
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate EditProfileForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#EditProfileForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inProfileName: "required"
|
||||
},
|
||||
messages: {
|
||||
inProfileName: "Please enter a profilename"
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate ManufacturesForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#ManufacturesForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inManufName: "required"
|
||||
},
|
||||
messages: {
|
||||
inManufName: "Please enter a manufacture name"
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate ChangeUserPasswordForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#ChangeUserPasswordForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inOldPass: "required",
|
||||
inNewPass: {
|
||||
required: true,
|
||||
minlength: 5
|
||||
},
|
||||
inReNewPass: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
equalTo: "#inNewPass"
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
inOldPass: "Pole wymagane.",
|
||||
inNewPass: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long"
|
||||
},
|
||||
inReNewPass: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long",
|
||||
equalTo: "Please enter the same password as above"
|
||||
}
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate AddNewWellParameter form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddNewWellParameter").validate(
|
||||
{
|
||||
rules: {
|
||||
inWellParamDate: "required",
|
||||
inWellParamValue: "required"
|
||||
},
|
||||
messages: {
|
||||
inWellParamDate: "Please click on the field and select the date from the calendar",
|
||||
inWellParamValue: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate AddNewWell form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddNewWell").validate(
|
||||
{
|
||||
rules: {
|
||||
inWellName: "required",
|
||||
inWellDiame: {
|
||||
required: true
|
||||
},
|
||||
inWellZas: {
|
||||
required: true
|
||||
},
|
||||
inWellDepth: {
|
||||
required: true
|
||||
},
|
||||
inWellLat: {
|
||||
required: true
|
||||
},
|
||||
inWellLong: {
|
||||
required: true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
inWellName: "Pole wymagane.",
|
||||
inWellDiame: {
|
||||
required: "Pole wymagane."
|
||||
},
|
||||
inWellZas: {
|
||||
required: "Pole wymagane."
|
||||
},
|
||||
inWellDepth: {
|
||||
required: "Pole wymagane."
|
||||
},
|
||||
inWellLat: {
|
||||
required: "Pole wymagane."
|
||||
},
|
||||
inWellLong: {
|
||||
required: "Pole wymagane."
|
||||
}
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate AddKnowledgeFile form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddKnowledgeFile").validate(
|
||||
{
|
||||
rules: {
|
||||
inKnowledgeFile: "required",
|
||||
inKnowledgeNAme: "required"
|
||||
},
|
||||
messages: {
|
||||
inKnowledgeFile: "Please choose the file",
|
||||
inKnowledgeNAme: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate AddParamInDictionary form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddParamInDictionary").validate(
|
||||
{
|
||||
rules: {
|
||||
inDictionaryPolish: "required"
|
||||
},
|
||||
messages: {
|
||||
inDictionaryPolish: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate CableCatalogueForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#CableCatalogueForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inCableName: "required",
|
||||
inCableManufID: {
|
||||
required: true,
|
||||
min: 1
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
inCableName: "Pole wymagane.",
|
||||
inCableManufID: "Please select the manufacturer."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate PipingCatalogueForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#PipingCatalogueForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inCableName: "required",
|
||||
inCableManufID: {
|
||||
required: true,
|
||||
min: 1
|
||||
},
|
||||
inPipingDiameter: "required"
|
||||
},
|
||||
messages: {
|
||||
inCableName: "Pole wymagane.",
|
||||
inCableManufID: "Please select the manufacturer.",
|
||||
inPipingDiameter: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate AddNewRePie form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddNewRePie").validate(
|
||||
{
|
||||
rules: {
|
||||
inRePieName: "required",
|
||||
inRePieNManufID: {
|
||||
required: true,
|
||||
min: 1
|
||||
},
|
||||
inRePieHeight: "required",
|
||||
inRePieMaxAcc: "required",
|
||||
inRePieMaxWar: "required",
|
||||
inRePieMinWar: "required",
|
||||
inRePieMinAcc: "required",
|
||||
inRePieLat: "required",
|
||||
inRePieLong: "required"
|
||||
|
||||
},
|
||||
messages: {
|
||||
inRePieName: "Pole wymagane.",
|
||||
inRePieNManufID: "Please select the manufacturer.",
|
||||
inRePieHeight: "Pole wymagane.",
|
||||
inRePieMaxAcc: "Pole wymagane.",
|
||||
inRePieMaxWar: "Pole wymagane.",
|
||||
inRePieMinWar: "Pole wymagane.",
|
||||
inRePieMinAcc: "Pole wymagane.",
|
||||
inRePieLat: "Pole wymagane.",
|
||||
inRePieLong: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate AddNewRePiezom form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddNewRePiezom").validate(
|
||||
{
|
||||
rules: {
|
||||
inRePieName: "required",
|
||||
inRePieDepth: "required",
|
||||
inRePieDiameter: "required",
|
||||
inRePieLat: "required",
|
||||
inRePieLong: "required"
|
||||
|
||||
},
|
||||
messages: {
|
||||
inRePieName: "Pole wymagane.",
|
||||
inRePieDepth: "Pole wymagane.",
|
||||
inRePieDiameter: "Pole wymagane.",
|
||||
inRePieLat: "Pole wymagane.",
|
||||
inRePieLong: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate ConfigMailForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#ConfigMailForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inMailName: "required",
|
||||
inMailSMTP: "required",
|
||||
inMailSMTPort: "required",
|
||||
inMailSMTPuser: "required",
|
||||
inMailSMTPass: "required"
|
||||
},
|
||||
messages: {
|
||||
inMailName: "Pole wymagane.",
|
||||
inMailSMTP: "Pole wymagane.",
|
||||
inMailSMTPort: "Pole wymagane.",
|
||||
inMailSMTPuser: "Pole wymagane.",
|
||||
inMailSMTPass: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate ConfigGSMForm form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#ConfigGSMForm").validate(
|
||||
{
|
||||
rules: {
|
||||
inGSMno: "required",
|
||||
inGSMparamFrom: "required",
|
||||
inGSMparamTo: "required",
|
||||
inGSMdrs: {
|
||||
required: true,
|
||||
min: 1
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
inGSMno: "Pole wymagane.",
|
||||
inGSMparamFrom: "Pole wymagane.",
|
||||
inGSMparamTo: "Pole wymagane.",
|
||||
inGSMdrs: "Please select the object."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate AddNewCable form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddNewCable").validate(
|
||||
{
|
||||
rules: {
|
||||
inCablePis: "required",
|
||||
inCableBuyDate: "required"
|
||||
},
|
||||
messages: {
|
||||
inCablePis: "Pole wymagane.",
|
||||
inCableBuyDate: "Pole wymagane.",
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate Orders step ONE form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddOrders_1").validate(
|
||||
{
|
||||
rules: {
|
||||
inOrderObjectType: {
|
||||
required: true,
|
||||
min: 1
|
||||
},
|
||||
inOrderOwner: "required"
|
||||
},
|
||||
messages: {
|
||||
inOrderObjectType: "Proszę wybrać obiekt z listy.",
|
||||
inOrderOwner: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
// validate Orders step ONE form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddOrders_2w").validate(
|
||||
{
|
||||
rules: {
|
||||
inOrderWell: {
|
||||
required: true,
|
||||
min: 0
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
inOrderWell: "Proszę wybrać studnię z listy.",
|
||||
}
|
||||
});
|
||||
|
||||
$("#AddOrders_2p").validate(
|
||||
{
|
||||
rules: {
|
||||
inOrderPiezo: {
|
||||
required: true,
|
||||
min: 0
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
inOrderPiezo: "Proszę wybrać piezometr z listy.",
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// validate Orders step ONE form on keyup and submit
|
||||
// ====================================================================== //
|
||||
$("#AddOrders_3").validate(
|
||||
{
|
||||
rules: {
|
||||
inNewPump: "required",
|
||||
inNewEng: "required"
|
||||
},
|
||||
messages: {
|
||||
inNewPump: "Pole wymagane.",
|
||||
inNewEng: "Pole wymagane."
|
||||
}
|
||||
});
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// zapis dynamicznych danych dla studni
|
||||
// ====================================================================== //
|
||||
$('#imgEditAction').show();
|
||||
$('#imgCleanAction').hide();
|
||||
$('#imgCancelAction').hide();
|
||||
$('#imgSaveAction').hide();
|
||||
$('#in401_date').hide();
|
||||
|
||||
$('#imgEditAction').click(function(){
|
||||
|
||||
$('#imgEditAction').hide();
|
||||
$('#imgCleanAction').show();
|
||||
$('#imgCancelAction').show();
|
||||
$('#imgSaveAction').show();
|
||||
$('#in401_date').show();
|
||||
|
||||
//data pomiaru
|
||||
$("#data_01").prop('disabled', false);
|
||||
$("#data_01").addClass("readonly_show");
|
||||
|
||||
//$("#data_01").focus();
|
||||
|
||||
//parametry pracy
|
||||
$("#in401_200").prop('disabled', false);
|
||||
$("#in401_205").prop('disabled', false);
|
||||
$("#in401_210").prop('disabled', false);
|
||||
$("#in401_212").prop('disabled', false);
|
||||
$("#in401_215").prop('disabled', false);
|
||||
$("#in401_220").prop('disabled', false);
|
||||
$("#in401_225").prop('disabled', false);
|
||||
$("#in401_230").prop('disabled', false);
|
||||
$("#in401_245").prop('disabled', false);
|
||||
$("#in401_401").prop('disabled', false);
|
||||
$("#in401_402").prop('disabled', false);
|
||||
$("#in401_730").prop('disabled', false);
|
||||
|
||||
|
||||
$("#in401_200").addClass("readonly_show");
|
||||
$("#in401_205").addClass("readonly_show");
|
||||
$("#in401_210").addClass("readonly_show");
|
||||
$("#in401_212").addClass("readonly_show");
|
||||
$("#in401_215").addClass("readonly_show");
|
||||
$("#in401_220").addClass("readonly_show");
|
||||
$("#in401_225").addClass("readonly_show");
|
||||
$("#in401_230").addClass("readonly_show");
|
||||
$("#in401_245").addClass("readonly_show");
|
||||
$("#in401_401").addClass("readonly_show");
|
||||
$("#in401_402").addClass("readonly_show");
|
||||
$("#in401_730").addClass("readonly_show");
|
||||
|
||||
|
||||
//parametry elektryczne
|
||||
$("#in401_260").prop('disabled', false);
|
||||
$("#in401_265").prop('disabled', false);
|
||||
$("#in401_270").prop('disabled', false);
|
||||
$("#in401_275").prop('disabled', false);
|
||||
$("#in401_280").prop('disabled', false);
|
||||
$("#in401_290").prop('disabled', false);
|
||||
$("#in401_721").prop('disabled', false);
|
||||
|
||||
$("#in401_260").addClass("readonly_show");
|
||||
$("#in401_265").addClass("readonly_show");
|
||||
$("#in401_270").addClass("readonly_show");
|
||||
$("#in401_275").addClass("readonly_show");
|
||||
$("#in401_280").addClass("readonly_show");
|
||||
$("#in401_290").addClass("readonly_show");
|
||||
$("#in401_721").addClass("readonly_show");
|
||||
|
||||
|
||||
});
|
||||
|
||||
// ====================================================================== //
|
||||
$('#imgSaveAction').click(function(){
|
||||
|
||||
$('#imgEditAction').show();
|
||||
$('#imgSaveAction').hide();
|
||||
$('#imgCleanAction').hide();
|
||||
$('#imgCancelAction').hide();
|
||||
$('#in401_date').hide();
|
||||
|
||||
|
||||
//data pomiaru
|
||||
$("#data_01").prop('disabled', true);
|
||||
$("#data_01").removeClass("readonly_show");
|
||||
|
||||
var dateVal = $("#data_01").val();
|
||||
var timehVal = $("#inTimeH").val();
|
||||
var timemVal = $("#inTimeM").val();
|
||||
|
||||
var devVal = $("#inDevID").val();
|
||||
var qVal = $("#in401_200").val();
|
||||
var hdVal = $("#in401_205").val();
|
||||
var hsVal = $("#in401_210").val();
|
||||
var hs0Val = $("#in401_212").val();
|
||||
var p1Val = $("#in401_215").val();
|
||||
var p2Val = $("#in401_220").val();
|
||||
var pbVal = $("#in401_225").val();
|
||||
var vVal = $("#in401_230").val();
|
||||
var twVal = $("#in401_245").val();
|
||||
var ppVal = $("#in401_401").val();
|
||||
var hhVal = $("#in401_402").val();
|
||||
var zasVal = $("#in401_730").val();
|
||||
|
||||
var peVal = $("#in401_260").val();
|
||||
var kwcVal = $("#in401_265").val();
|
||||
var iVal = $("#in401_270").val();
|
||||
var uVal = $("#in401_275").val();
|
||||
var fiVal = $("#in401_280").val();
|
||||
var timeVal = $("#in401_290").val();
|
||||
var engVal = $("#in401_721").val();
|
||||
|
||||
$.post('./ajax_func.php',{
|
||||
post_site: 'site401inf',
|
||||
post_action: 'edit_param',
|
||||
post_date: dateVal+' '+timehVal+':'+timemVal+':00',
|
||||
post_dev: devVal,
|
||||
post_q: qVal,
|
||||
post_hd: hdVal,
|
||||
post_hs: hsVal,
|
||||
post_h0: hs0Val,
|
||||
post_p1: p1Val,
|
||||
post_p2: p2Val,
|
||||
post_pb: pbVal,
|
||||
post_v: vVal,
|
||||
post_tw: twVal,
|
||||
post_pp: ppVal,
|
||||
post_hh: hhVal,
|
||||
post_zas: zasVal,
|
||||
|
||||
post_i: iVal,
|
||||
post_u: uVal,
|
||||
post_fi: fiVal,
|
||||
post_time: timeVal,
|
||||
post_pe: peVal,
|
||||
post_en: engVal,
|
||||
post_kwc: kwcVal
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
//parametry pracy
|
||||
$("#in401_200").prop('disabled', true);
|
||||
$("#in401_205").prop('disabled', true);
|
||||
$("#in401_210").prop('disabled', true);
|
||||
$("#in401_212").prop('disabled', true);
|
||||
$("#in401_215").prop('disabled', true);
|
||||
$("#in401_220").prop('disabled', true);
|
||||
$("#in401_225").prop('disabled', true);
|
||||
$("#in401_230").prop('disabled', true);
|
||||
$("#in401_245").prop('disabled', true);
|
||||
$("#in401_401").prop('disabled', true);
|
||||
$("#in401_402").prop('disabled', true);
|
||||
$("#in401_730").prop('disabled', true);
|
||||
|
||||
$("#in401_200").removeClass("readonly_show");
|
||||
$("#in401_205").removeClass("readonly_show");
|
||||
$("#in401_210").removeClass("readonly_show");
|
||||
$("#in401_212").removeClass("readonly_show");
|
||||
$("#in401_215").removeClass("readonly_show");
|
||||
$("#in401_220").removeClass("readonly_show");
|
||||
$("#in401_225").removeClass("readonly_show");
|
||||
$("#in401_230").removeClass("readonly_show");
|
||||
$("#in401_245").removeClass("readonly_show");
|
||||
$("#in401_401").removeClass("readonly_show");
|
||||
$("#in401_402").removeClass("readonly_show");
|
||||
$("#in401_730").removeClass("readonly_show");
|
||||
|
||||
|
||||
//parametry elektryczne
|
||||
$("#in401_260").prop('disabled', true);
|
||||
$("#in401_265").prop('disabled', true);
|
||||
$("#in401_270").prop('disabled', true);
|
||||
$("#in401_275").prop('disabled', true);
|
||||
$("#in401_280").prop('disabled', true);
|
||||
$("#in401_290").prop('disabled', true);
|
||||
$("#in401_721").prop('disabled', true);
|
||||
|
||||
$("#in401_260").removeClass("readonly_show");
|
||||
$("#in401_265").removeClass("readonly_show");
|
||||
$("#in401_270").removeClass("readonly_show");
|
||||
$("#in401_275").removeClass("readonly_show");
|
||||
$("#in401_280").removeClass("readonly_show");
|
||||
$("#in401_290").removeClass("readonly_show");
|
||||
$("#in401_721").removeClass("readonly_show");
|
||||
|
||||
swal("Sukces!", "Dane zostały zapisane!", "success");
|
||||
|
||||
|
||||
});
|
||||
|
||||
// ====================================================================== //
|
||||
$('#imgCancelAction').click(function(){
|
||||
$('#imgEditAction').show();
|
||||
$('#imgCleanAction').hide();
|
||||
$('#imgCancelAction').hide();
|
||||
$('#imgSaveAction').hide();
|
||||
$('#in401_date').hide();
|
||||
|
||||
|
||||
//parametry pracy
|
||||
$("#in401_200").prop('disabled', true);
|
||||
$("#in401_205").prop('disabled', true);
|
||||
$("#in401_210").prop('disabled', true);
|
||||
$("#in401_212").prop('disabled', true);
|
||||
$("#in401_215").prop('disabled', true);
|
||||
$("#in401_220").prop('disabled', true);
|
||||
$("#in401_225").prop('disabled', true);
|
||||
$("#in401_230").prop('disabled', true);
|
||||
$("#in401_245").prop('disabled', true);
|
||||
$("#in401_401").prop('disabled', true);
|
||||
$("#in401_402").prop('disabled', true);
|
||||
$("#in401_730").prop('disabled', true);
|
||||
|
||||
$("#in401_200").removeClass("readonly_show");
|
||||
$("#in401_205").removeClass("readonly_show");
|
||||
$("#in401_210").removeClass("readonly_show");
|
||||
$("#in401_212").removeClass("readonly_show");
|
||||
$("#in401_215").removeClass("readonly_show");
|
||||
$("#in401_220").removeClass("readonly_show");
|
||||
$("#in401_225").removeClass("readonly_show");
|
||||
$("#in401_230").removeClass("readonly_show");
|
||||
$("#in401_245").removeClass("readonly_show");
|
||||
$("#in401_401").removeClass("readonly_show");
|
||||
$("#in401_402").removeClass("readonly_show");
|
||||
$("#in401_730").removeClass("readonly_show");
|
||||
|
||||
|
||||
//parametry elektryczne
|
||||
$("#in401_260").prop('disabled', true);
|
||||
$("#in401_265").prop('disabled', true);
|
||||
$("#in401_270").prop('disabled', true);
|
||||
$("#in401_275").prop('disabled', true);
|
||||
$("#in401_280").prop('disabled', true);
|
||||
$("#in401_290").prop('disabled', true);
|
||||
$("#in401_721").prop('disabled', true);
|
||||
|
||||
$("#in401_260").removeClass("readonly_show");
|
||||
$("#in401_265").removeClass("readonly_show");
|
||||
$("#in401_270").removeClass("readonly_show");
|
||||
$("#in401_275").removeClass("readonly_show");
|
||||
$("#in401_280").removeClass("readonly_show");
|
||||
$("#in401_290").removeClass("readonly_show");
|
||||
$("#in401_721").removeClass("readonly_show");
|
||||
|
||||
|
||||
});
|
||||
|
||||
// ====================================================================== //
|
||||
$('#imgCleanAction').click(function(){
|
||||
|
||||
$("#data_01").val('');
|
||||
$("#in401_200").val('');
|
||||
$("#in401_205").val('');
|
||||
$("#in401_210").val('');
|
||||
$("#in401_212").val('');
|
||||
$("#in401_215").val('');
|
||||
$("#in401_220").val('');
|
||||
$("#in401_225").val('');
|
||||
$("#in401_230").val('');
|
||||
$("#in401_245").val('');
|
||||
$("#in401_401").val('');
|
||||
$("#in401_402").val('');
|
||||
$("#in401_730").val('');
|
||||
$("#in401_260").val('');
|
||||
$("#in401_265").val('');
|
||||
$("#in401_270").val('');
|
||||
$("#in401_275").val('');
|
||||
$("#in401_280").val('');
|
||||
$("#in401_290").val('');
|
||||
$("#in401_721").val('');
|
||||
|
||||
});
|
||||
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
// ====================================================================== //
|
||||
// potwierdzenie, o usunięciu - sweetalert
|
||||
// ====================================================================== //
|
||||
$('.confirmation').click(function(e) {
|
||||
e.preventDefault(); // Prevent the href from redirecting directly
|
||||
var linkURL = $(this).attr("href");
|
||||
warnBeforeDelete(linkURL);
|
||||
});
|
||||
|
||||
function warnBeforeDelete(linkURL) {
|
||||
swal({
|
||||
title: "Usuwanie danych",
|
||||
text: "Potwierdzenie spowoduje nieodwracalny proces usunięcia danych z systemu! Czy jesteś pewien, że chcesz usunąć?",
|
||||
type: "warning",
|
||||
confirmButtonText: "Tak",
|
||||
confirmButtonColor: '#DD6B55',
|
||||
cancelButtonText: "Nie",
|
||||
cancelButtonColor: '#d33',
|
||||
showCancelButton: true
|
||||
}, function() {
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
}
|
||||
// ====================================================================== //
|
||||
|
||||
// ====================================================================== //
|
||||
// potwierdzenie, o usunięciu - powiązania (urządzeń, kabli, armatury)
|
||||
// ====================================================================== //
|
||||
$('.confirm_tools').click(function(e) {
|
||||
e.preventDefault(); // Prevent the href from redirecting directly
|
||||
var linkURL = $(this).attr("href");
|
||||
warnBeforeDelTool(linkURL);
|
||||
});
|
||||
|
||||
function warnBeforeDelTool(linkURL) {
|
||||
swal({
|
||||
title: "Usuwanie powiązania",
|
||||
text: "Potwierdzenie spowoduje proces usunięcia powiązanych obiektów! Czy jesteś pewien, że chcesz usunąć?",
|
||||
type: "warning",
|
||||
confirmButtonText: "Tak",
|
||||
confirmButtonColor: '#DD6B55',
|
||||
cancelButtonText: "Nie",
|
||||
cancelButtonColor: '#d33',
|
||||
showCancelButton: true
|
||||
}, function() {
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
}
|
||||
// ====================================================================== //
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function makeRequest(url){
|
||||
$('#preloader').show();
|
||||
$('#loader-wrapper').show();
|
||||
}
|
||||
|
||||
// onclick=".chr(34)."makeRequest('?pg=site401inf')".chr(34)."
|
||||
|
||||
$(window).load(function() {
|
||||
// Animate loader off screen
|
||||
$('#loader-wrapper').hide();
|
||||
});
|
||||
Vendored
+3
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user