v.2.22
Редактор карты зала Электронные заказы Отчет по удалениям
This commit is contained in:
187
forUpdate/toDirectives/angular-drag-resize.js
vendored
Normal file
187
forUpdate/toDirectives/angular-drag-resize.js
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
angular.module('angular.drag.resize', [])
|
||||
.provider('adrConfig', function adrConfigProvider() {
|
||||
//defaults
|
||||
var defaultConfig = {
|
||||
iconPosition: [0, 0],
|
||||
mode: 'all',
|
||||
modes: ['all', 'horizontal', 'vertical']
|
||||
};
|
||||
var config = angular.extend({}, defaultConfig);
|
||||
this.$get = [function () {
|
||||
return {
|
||||
iconPosition: config.iconPosition,
|
||||
mode: config.mode,
|
||||
modes: config.modes
|
||||
};
|
||||
}];
|
||||
})
|
||||
.directive('resize', ['adrConfig', '$document', function (adrConfig, $document) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attr) {
|
||||
var dimension = {};
|
||||
var iconPosition = adrConfig.iconPosition;
|
||||
var mode = attr.resize && adrConfig.modes.indexOf(attr.resize) > -1 ? attr.resize : adrConfig.mode;
|
||||
var position = {};
|
||||
var doc = {};
|
||||
var el = {};
|
||||
//create button for resizing
|
||||
var btn = document.createElement("span");
|
||||
btn.style.width = '15px';
|
||||
btn.style.height = '15px';
|
||||
btn.innerHTML =
|
||||
"<i class='fa fa-expand fa-rotate-90'></i>"
|
||||
;
|
||||
btn.style.bottom = iconPosition[0] + 6 + 'px';
|
||||
btn.style.right = iconPosition[1] + 5 + 'px';
|
||||
btn.style.position = 'absolute';
|
||||
btn.style.visibility = 'hidden';
|
||||
if (mode == 'horizontal') {
|
||||
btn.style.cursor = 'ew-resize';
|
||||
} else if (mode == 'vertical') {
|
||||
btn.style.cursor = 'ns-resize';
|
||||
} else {
|
||||
btn.style.cursor = 'nwse-resize';
|
||||
}
|
||||
//bind resize function to button;
|
||||
btn.onmousedown = function ($event) {
|
||||
switch ($event.which) {
|
||||
case 1:
|
||||
$event.stopImmediatePropagation();
|
||||
doc.left = element[0].parentNode.parentNode.getBoundingClientRect().left;
|
||||
doc.top = element[0].parentNode.parentNode.getBoundingClientRect().top;
|
||||
doc.bottom = element[0].parentNode.parentNode.getBoundingClientRect().bottom;
|
||||
doc.right = element[0].parentNode.parentNode.getBoundingClientRect().right;
|
||||
el.width = element[0].getBoundingClientRect().width;
|
||||
el.height = element[0].getBoundingClientRect().height;
|
||||
console.log('doc.left: ' + doc.left);
|
||||
console.log('doc.top: ' + doc.top);
|
||||
console.log('doc.bottom: ' + doc.bottom);
|
||||
console.log('doc.right: ' + doc.right);
|
||||
position.x = $event.clientX;
|
||||
position.y = $event.clientY;
|
||||
dimension.width = element.prop('offsetWidth');
|
||||
dimension.height = element.prop('offsetHeight');
|
||||
console.log('dimension.width: ' + dimension.width);
|
||||
console.log('dimension.height: ' + dimension.height);
|
||||
$document.bind('mousemove', mousemove);
|
||||
$document.bind('mouseup', mouseup);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function mousemove($event) {
|
||||
switch ($event.which) {
|
||||
case 1:
|
||||
|
||||
|
||||
if ($event.clientX < doc.right && $event.clientY < doc.bottom) {
|
||||
var deltaWidth = dimension.width - (position.x - $event.clientX);
|
||||
var deltaHeight = dimension.height - (position.y - $event.clientY);
|
||||
} else {
|
||||
var deltaWidth = el.width;
|
||||
var deltaHeight = el.height;
|
||||
}
|
||||
/* console.log('deltaWidth: ' + deltaWidth);
|
||||
console.log('deltaHeight: ' + deltaHeight);
|
||||
console.log('position.x: ' + position.x);
|
||||
console.log('position.y: ' + position.y);*/
|
||||
var newDimensions = {};
|
||||
if (mode == 'horizontal') {
|
||||
newDimensions = {
|
||||
width: deltaWidth + 'px'
|
||||
};
|
||||
} else if (mode == 'vertical') {
|
||||
newDimensions = {
|
||||
height: deltaHeight + 'px'
|
||||
};
|
||||
} else {
|
||||
newDimensions = {
|
||||
width: deltaWidth + 'px',
|
||||
height: deltaHeight + 'px'
|
||||
};
|
||||
}
|
||||
element.css(newDimensions);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function mouseup() {
|
||||
$document.unbind('mousemove', mousemove);
|
||||
$document.unbind('mouseup', mouseup);
|
||||
}
|
||||
|
||||
element.append(btn);
|
||||
//show button on hover
|
||||
element.bind('mouseover', function () {
|
||||
btn.style.visibility = 'visible';
|
||||
});
|
||||
element.bind('mouseout', function () {
|
||||
btn.style.visibility = 'hidden';
|
||||
});
|
||||
}
|
||||
};
|
||||
}])
|
||||
.directive('draggable', ['$document', function ($document) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element) {
|
||||
var position = {};
|
||||
var doc = {};
|
||||
|
||||
element.bind('mousedown', function ($event) {
|
||||
switch ($event.which) {
|
||||
case 1:
|
||||
element.css({position: 'fixed'});
|
||||
doc.left = element[0].parentNode.parentNode.getBoundingClientRect().left;
|
||||
doc.top = element[0].parentNode.parentNode.getBoundingClientRect().top;
|
||||
doc.bottom = element[0].parentNode.parentNode.getBoundingClientRect().bottom;
|
||||
doc.right = element[0].parentNode.parentNode.getBoundingClientRect().right;
|
||||
position.x = element[0].getBoundingClientRect().left;
|
||||
position.y = element[0].getBoundingClientRect().top;
|
||||
position.initialMouseX = $event.clientX;
|
||||
position.initialMouseY = $event.clientY;
|
||||
$document.bind('mousemove', mousemove);
|
||||
$document.bind('mouseup', mouseup);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
function mousemove($event) {
|
||||
switch ($event.which) {
|
||||
case 1:
|
||||
var dx = $event.clientX - position.initialMouseX;
|
||||
var dy = $event.clientY - position.initialMouseY;
|
||||
var posdy = position.y + dy;
|
||||
var posdx = position.x + dx;
|
||||
|
||||
if (posdy > doc.top && posdx > doc.left && (posdx + element[0].getBoundingClientRect().width) < doc.right && (posdy + element[0].getBoundingClientRect().height) < doc.bottom) {
|
||||
element.css({
|
||||
top: posdy + 'px',
|
||||
left: posdx + 'px'
|
||||
});
|
||||
} else {
|
||||
element.css({
|
||||
top: position.y + 'px',
|
||||
left: position.x + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function mouseup() {
|
||||
$document.unbind('mousemove', mousemove);
|
||||
$document.unbind('mouseup', mouseup);
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
})();
|
||||
144
forUpdate/toDirectives/context-menu.js
Normal file
144
forUpdate/toDirectives/context-menu.js
Normal file
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* ng-context-menu - v1.1.0 - An AngularJS directive to display a context menu
|
||||
* when a right-click event is triggered
|
||||
*
|
||||
* @author Ian Kennington Walter (http://ianvonwalter.com)
|
||||
*/
|
||||
(function(angular) {
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('ng-context-menu', [])
|
||||
.factory('ContextMenuService', function() {
|
||||
return {
|
||||
element: null,
|
||||
menuElement: null
|
||||
};
|
||||
})
|
||||
.directive('contextMenu', [
|
||||
'$document',
|
||||
'ContextMenuService',
|
||||
function($document, ContextMenuService) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
'callback': '&contextMenu',
|
||||
'disabled': '&contextMenuDisabled',
|
||||
'closeCallback': '&contextMenuClose',
|
||||
'marginBottom': '@contextMenuMarginBottom',
|
||||
'marginLeft': '@contextMenuMarginLeft'
|
||||
},
|
||||
link: function($scope, $element, $attrs) {
|
||||
var opened = false;
|
||||
|
||||
function open(event, menuElement) {
|
||||
menuElement.addClass('open');
|
||||
|
||||
var doc = $document[0].documentElement;
|
||||
var docLeft = (window.pageXOffset || doc.scrollLeft) -
|
||||
(doc.clientLeft || 0),
|
||||
docTop = (window.pageYOffset || doc.scrollTop) -
|
||||
(doc.clientTop || 0),
|
||||
elementWidth = menuElement[0].scrollWidth,
|
||||
elementHeight = menuElement[0].scrollHeight;
|
||||
var pageX;
|
||||
var pageY;
|
||||
// browser compatibility fix for the click location
|
||||
if (event.pageX || event.pageY) {
|
||||
// use pageX and pageY when available (modern browsers)
|
||||
pageX = event.pageX;
|
||||
pageY = event.pageY;
|
||||
} else {
|
||||
// calculate pageX and pageY when they do not exist
|
||||
// (IE8 and generated events in later versions of IE)
|
||||
var docBody = $document[0].body;
|
||||
pageX = event.clientX + docBody.scrollLeft + doc.scrollLeft;
|
||||
pageY = event.clientY + docBody.scrollTop + doc.scrollTop;
|
||||
}
|
||||
var docWidth = doc.clientWidth + docLeft,
|
||||
docHeight = doc.clientHeight + docTop,
|
||||
totalWidth = elementWidth + pageX,
|
||||
totalHeight = elementHeight + pageY,
|
||||
left = Math.max(pageX - docLeft, 0),
|
||||
top = Math.max(pageY - docTop, 0);
|
||||
|
||||
if (totalWidth > docWidth) {
|
||||
var marginLeft = $scope.marginLeft || 0;
|
||||
left = left - (totalWidth - docWidth) - marginLeft;
|
||||
}
|
||||
|
||||
if (totalHeight > docHeight) {
|
||||
var marginBottom = $scope.marginBottom || 0;
|
||||
top = top - (totalHeight - docHeight) - marginBottom;
|
||||
}
|
||||
|
||||
menuElement.css('top', top + 'px');
|
||||
menuElement.css('left', left + 'px');
|
||||
opened = true;
|
||||
}
|
||||
|
||||
function close(menuElement) {
|
||||
menuElement.removeClass('open');
|
||||
|
||||
if (opened) {
|
||||
$scope.closeCallback();
|
||||
}
|
||||
|
||||
opened = false;
|
||||
}
|
||||
|
||||
$element.bind('contextmenu', function(event) {
|
||||
if (!$scope.disabled()) {
|
||||
if (ContextMenuService.menuElement !== null) {
|
||||
close(ContextMenuService.menuElement);
|
||||
}
|
||||
ContextMenuService.menuElement = angular.element(
|
||||
document.getElementById($attrs.target)
|
||||
);
|
||||
ContextMenuService.element = event.target;
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$scope.$apply(function() {
|
||||
$scope.callback({ $event: event });
|
||||
});
|
||||
$scope.$apply(function() {
|
||||
open(event, ContextMenuService.menuElement);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function handleKeyUpEvent(event) {
|
||||
if (opened && event.keyCode === 27) {
|
||||
$scope.$apply(function() {
|
||||
close(ContextMenuService.menuElement);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleClickEvent(event) {
|
||||
if (opened &&
|
||||
(event.button !== 2 ||
|
||||
event.target !== ContextMenuService.element)) {
|
||||
$scope.$apply(function() {
|
||||
close(ContextMenuService.menuElement);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$document.bind('keyup', handleKeyUpEvent);
|
||||
// Firefox treats a right-click as a click and a contextmenu event
|
||||
// while other browsers just treat it as a contextmenu event
|
||||
$document.bind('click', handleClickEvent);
|
||||
$document.bind('contextmenu', handleClickEvent);
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
$document.unbind('keyup', handleKeyUpEvent);
|
||||
$document.unbind('click', handleClickEvent);
|
||||
$document.unbind('contextmenu', handleClickEvent);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
})(angular);
|
||||
121
forUpdate/toWebApp/index.html
Normal file
121
forUpdate/toWebApp/index.html
Normal file
@@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Административная панель | HRC</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-barstyle" content="black-translucent">
|
||||
<link rel="apple-touch-icon" href="../assets/images/logo.png">
|
||||
<meta name="apple-mobile-web-app-title" content="HRC Панель">
|
||||
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<link rel="shortcut icon" sizes="196x196" href="../assets/images/logo.png">
|
||||
|
||||
<link rel="stylesheet" href="../assets/animate.css/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../assets/glyphicons/glyphicons.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../assets/font-awesome/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../assets/material-design-icons/material-design-icons.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../libs/angular/angular-ui-notification/dist/angular-ui-notification.min.css" />
|
||||
|
||||
<link rel="stylesheet" href="../assets/bootstrap/dist/css/bootstrap.min.css" type="text/css" />
|
||||
|
||||
<!-- build:css ../assets/styles/app.min.css -->
|
||||
<link rel="stylesheet" href="../assets/styles/app.css" type="text/css" />
|
||||
<!-- endbuild -->
|
||||
|
||||
<link rel="stylesheet" href="../assets/styles/font.css" type="text/css" />
|
||||
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//analytics.hrc.by/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Matomo Code -->
|
||||
|
||||
</head>
|
||||
|
||||
<body ng-app="app" ng-controller="AppCtrl" class="{{app.setting.bg}}" ng-class="{'container': app.setting.boxed, 'ie': isIE,'smart': isSmart}">
|
||||
<div class="app" ui-view></div>
|
||||
<!-- build:js scripts/app.angular.js -->
|
||||
<!-- jQuery -->
|
||||
<script src="../libs/jquery/jquery/dist/jquery.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<script src="scripts/config.js"></script>
|
||||
|
||||
<script type="text/javascript" src="routes.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
|
||||
<script src="../libs/jquery/tether/dist/js/tether.min.js"></script>
|
||||
<script src="../libs/jquery/bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script src="../libs/jquery/PACE/pace.min.js"></script>
|
||||
<script src="../libs/jquery/jquery.nicescroll/jquery.nicescroll.min.js"></script>
|
||||
|
||||
<!-- Angular -->
|
||||
<script src="../libs/angular/angular/angular.js"></script>
|
||||
<script src="../libs/angular/angular-animate/angular-animate.js"></script>
|
||||
<script src="../libs/angular/angular-resource/angular-resource.js"></script>
|
||||
<script src="../libs/angular/angular-sanitize/angular-sanitize.js"></script>
|
||||
<script src="../libs/angular/angular-touch/angular-touch.js"></script>
|
||||
<script src="../libs/angular/angular-cookies/angular-cookies.js"></script>
|
||||
<script src="../libs/angular/angular-nicescroll/angular-nicescroll.js"></script>
|
||||
<script src="scripts/moments.js"></script>
|
||||
<script src="../libs/angular/chart.js/dist/Chart.js"></script>
|
||||
<script src="../libs/angular/angular-ui-notification/dist/angular-ui-notification.min.js"></script>
|
||||
|
||||
<!-- router -->
|
||||
<script src="../libs/angular/angular-ui-router/release/angular-ui-router.js"></script>
|
||||
<script src="../libs/angular/ui-router-extras/release/ct-ui-router-extras.min.js"></script>
|
||||
<!-- storage -->
|
||||
<script src="../libs/angular/ngstorage/ngStorage.js"></script>
|
||||
<!-- utils -->
|
||||
<script src="../libs/angular/angular-ui-utils/ui-utils.js"></script>
|
||||
<!-- lazyload -->
|
||||
<script src="../libs/angular/oclazyload/dist/ocLazyLoad.js"></script>
|
||||
|
||||
<!-- App -->
|
||||
<script src="scripts/app.js"></script>
|
||||
<script src="scripts/config.lazyload.js"></script>
|
||||
<script src="scripts/config.router.js"></script>
|
||||
<script src="scripts/app.ctrl.js"></script>
|
||||
<script src="scripts/onload.js"></script>
|
||||
|
||||
<script src="scripts/directives/ui-jp.js"></script>
|
||||
<script src="scripts/directives/ui-nav.js"></script>
|
||||
<script src="scripts/directives/ui-fullscreen.js"></script>
|
||||
<script src="scripts/directives/ui-scroll-to.js"></script>
|
||||
<script src="scripts/directives/ui-toggle-class.js"></script>
|
||||
<script src="scripts/directives/ui-include.js"></script>
|
||||
<script src="scripts/directives/ui-single-clicks.js"></script>
|
||||
<script src="scripts/directives/ios-dblclick.js"></script>
|
||||
<script src="scripts/directives/angular-drag-resize.js"></script>
|
||||
<script src="scripts/directives/context-menu.js"></script>
|
||||
|
||||
<script src="scripts/filters/fromnow.js"></script>
|
||||
|
||||
<script src="scripts/services/ngstore.js"></script>
|
||||
<script src="scripts/services/ui-load.js"></script>
|
||||
<script src="scripts/services/palette.js"></script>
|
||||
<script src="scripts/services/smart-request.js"></script>
|
||||
<script src="scripts/services/acl.js"></script>
|
||||
|
||||
<script src="scripts/ui/ui-nav.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- custom -->
|
||||
<script src="scripts/ui/number-polyfill.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user