More stats!
This commit is contained in:
1 parent
6560d3e89b
commit
17545b5261
13 files changed
+169
-134
No files matched your search
@@ -1,8 +1,8 @@
|
|||||||
from django.db.models import Sum
|
from django.db.models import Sum, Count
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.serializers import ModelSerializer
|
from rest_framework.serializers import ModelSerializer
|
||||||
|
|
||||||
from main.models import Product, OrderLine
|
from main.models import Product, OrderLine, Order
|
||||||
|
|
||||||
|
|
||||||
class ProductSerializer(ModelSerializer):
|
class ProductSerializer(ModelSerializer):
|
||||||
@@ -10,7 +10,6 @@ class ProductSerializer(ModelSerializer):
|
|||||||
model = Product
|
model = Product
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ProductStatSerializer(ModelSerializer):
|
class ProductStatSerializer(ModelSerializer):
|
||||||
EXTERNAL_USER = 'Ekstern'
|
EXTERNAL_USER = 'Ekstern'
|
||||||
counts = serializers.SerializerMethodField()
|
counts = serializers.SerializerMethodField()
|
||||||
|
|||||||
@@ -19,3 +19,4 @@ class ProductViewSet(mixins.ListModelMixin,
|
|||||||
serializer = ProductStatSerializer(products, many=True)
|
serializer = ProductStatSerializer(products, many=True)
|
||||||
|
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
+12
-7
@@ -1,6 +1,7 @@
|
|||||||
from django.conf.urls import url, patterns
|
from django.conf.urls import url, patterns
|
||||||
from main.api.views import ProductViewSet
|
from main.api.views import ProductViewSet
|
||||||
from main.views.stats import stats_list, stats_orders, stats_orders_hourly, stats_products_realtime, stats_products_per_user
|
from main.views.stats import stats_list, stats_products_realtime, stats_products_per_user, \
|
||||||
|
OrdersHourlyView, OrdersDailyView, OrdersMonthlyView, OrdersYearlyView
|
||||||
from main.views.general import register, deposit, log
|
from main.views.general import register, deposit, log
|
||||||
from main.views.reports import inventory, inventory_add, report
|
from main.views.reports import inventory, inventory_add, report
|
||||||
from main.views.users import create_user, profile
|
from main.views.users import create_user, profile
|
||||||
@@ -12,12 +13,6 @@ urlpatterns = [
|
|||||||
url(r'^deposit/$', deposit, name='deposit'),
|
url(r'^deposit/$', deposit, name='deposit'),
|
||||||
url(r'^log/$', log, name='log'),
|
url(r'^log/$', log, name='log'),
|
||||||
url(r'^log/all$', log, kwargs={'limit': None}, name='log-all'),
|
url(r'^log/all$', log, kwargs={'limit': None}, name='log-all'),
|
||||||
# Stats
|
|
||||||
url(r'^stats/$', stats_list, name='stats'),
|
|
||||||
url(r'^stats/orders/$', stats_orders, name='stats-orders'),
|
|
||||||
url(r'^stats/orders/hourly$', stats_orders_hourly, name='stats-orders-hourly'),
|
|
||||||
url(r'^stats/orders/products_realtime$', stats_products_realtime, name='stats-products-realtime'),
|
|
||||||
url(r'^stats/products/by_user/(?P<user_id>[0-9]+)/$', stats_products_per_user, name='stats-products-per-user'),
|
|
||||||
# Users
|
# Users
|
||||||
url(r'^user/create/$', create_user, name='create-user'),
|
url(r'^user/create/$', create_user, name='create-user'),
|
||||||
url(r'^profile/$', profile, name='profile'),
|
url(r'^profile/$', profile, name='profile'),
|
||||||
@@ -27,6 +22,16 @@ urlpatterns = [
|
|||||||
url(r'^report$', report, name='report'),
|
url(r'^report$', report, name='report'),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
# Stats
|
||||||
|
urlpatterns += [
|
||||||
|
url(r'^stats/$', stats_list, name='stats'),
|
||||||
|
url(r'^stats/orders/hourly/$', OrdersHourlyView.as_view(), name='stats-orders-hourly'),
|
||||||
|
url(r'^stats/orders/daily/', OrdersDailyView.as_view(), name='stats-orders-daily'),
|
||||||
|
url(r'^stats/orders/monthly/', OrdersMonthlyView.as_view(), name='stats-orders-monthly'),
|
||||||
|
url(r'^stats/orders/yearly/', OrdersYearlyView.as_view(), name='stats-orders-yearly'),
|
||||||
|
url(r'^stats/orders/products_realtime$', stats_products_realtime, name='stats-products-realtime'),
|
||||||
|
url(r'^stats/products/by_user/(?P<user_id>[0-9]+)/$', stats_products_per_user, name='stats-products-per-user'),
|
||||||
|
]
|
||||||
# Root level service-worker.js
|
# Root level service-worker.js
|
||||||
urlpatterns += patterns(
|
urlpatterns += patterns(
|
||||||
'django.contrib.staticfiles.views',
|
'django.contrib.staticfiles.views',
|
||||||
|
|||||||
+71
-31
@@ -1,57 +1,97 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from django.db.models import Sum, Count
|
|
||||||
from django.http import JsonResponse
|
from django.http import JsonResponse
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render
|
||||||
|
from django.utils import timezone
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
|
|
||||||
from django.utils import six
|
from django.views.generic import View
|
||||||
from main.models import Product, OrderLine, Order
|
from main.models import Product, OrderLine, Order
|
||||||
|
|
||||||
|
|
||||||
def stats_list(request):
|
def stats_list(request):
|
||||||
products = Product.objects.filter(active=True)
|
products = Product.objects.filter(active=True)
|
||||||
|
order_groups = ['hourly', 'daily', 'monthly', 'yearly']
|
||||||
|
|
||||||
return render(request, 'stats.html', {'products': products})
|
return render(request, 'stats.html', {'products': products, 'order_groups': order_groups})
|
||||||
|
|
||||||
|
|
||||||
def stats_orders(request):
|
class OrdersView(View):
|
||||||
num_external_orders = Order.objects.filter(customer=None).count()
|
grouping = 'orders'
|
||||||
per_user = Order.objects\
|
|
||||||
.values('customer__first_name', 'customer__last_name')\
|
|
||||||
.annotate(num=Count('customer'))\
|
|
||||||
.order_by('num').reverse()
|
|
||||||
f_per_user = []
|
|
||||||
for row in per_user:
|
|
||||||
if row['customer__first_name'] is not None:
|
|
||||||
who = row['customer__first_name'] + " " + row['customer__last_name']
|
|
||||||
num = row['num']
|
|
||||||
else:
|
|
||||||
who = "Ekstern"
|
|
||||||
num = num_external_orders
|
|
||||||
f_per_user.append([who, num])
|
|
||||||
|
|
||||||
return JsonResponse(f_per_user, safe=False)
|
def get_range(self):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_key(self, order):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def stats_orders_hourly(request):
|
def group_by(self, orders):
|
||||||
orders = Order.objects.all()
|
orders_grouped = dict([(key, 0) for key in self.get_range()]) # init
|
||||||
f_hourly = dict([(key, 0) for key in range(0, 24)]) # init
|
for key, values in groupby(orders, key=self.get_key):
|
||||||
# group by hour
|
|
||||||
for key, values in groupby(orders, key=lambda row: row.created.hour):
|
|
||||||
count = len(list(values))
|
count = len(list(values))
|
||||||
f_hourly[key] += count
|
orders_grouped[key] += count
|
||||||
|
|
||||||
if len(orders) == 0:
|
return orders_grouped
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
orders = Order.objects.all()
|
||||||
|
if not orders.exists():
|
||||||
return JsonResponse({})
|
return JsonResponse({})
|
||||||
|
|
||||||
response = {
|
orders_grouped = self.group_by(orders)
|
||||||
|
data = {
|
||||||
'start': str(orders[0].created),
|
'start': str(orders[0].created),
|
||||||
'hourly': [[k, v] for k, v in f_hourly.items()],
|
'orders': [[k, v] for k, v in orders_grouped.items()],
|
||||||
'total': sum(f_hourly.values()),
|
'total': sum(orders_grouped.values()),
|
||||||
|
'grouping': self.grouping
|
||||||
}
|
}
|
||||||
return JsonResponse(response)
|
return JsonResponse(data)
|
||||||
|
|
||||||
|
|
||||||
|
class OrdersHourlyView(OrdersView):
|
||||||
|
grouping = 'hourly'
|
||||||
|
|
||||||
|
def get_range(self):
|
||||||
|
return range(0, 24)
|
||||||
|
|
||||||
|
def get_key(self, order):
|
||||||
|
return order.created.hour
|
||||||
|
|
||||||
|
|
||||||
|
class OrdersDailyView(OrdersView):
|
||||||
|
grouping = 'daily'
|
||||||
|
|
||||||
|
def get_range(self):
|
||||||
|
return range(0, 7)
|
||||||
|
|
||||||
|
def get_key(self, order):
|
||||||
|
return order.created.weekday()
|
||||||
|
|
||||||
|
|
||||||
|
class OrdersMonthlyView(OrdersView):
|
||||||
|
grouping = 'monthly'
|
||||||
|
|
||||||
|
def get_range(self):
|
||||||
|
return range(1, 13)
|
||||||
|
|
||||||
|
def get_key(self, order):
|
||||||
|
return order.created.month
|
||||||
|
|
||||||
|
|
||||||
|
class OrdersYearlyView(OrdersView):
|
||||||
|
grouping = 'yearly'
|
||||||
|
|
||||||
|
def get_range(self):
|
||||||
|
first = Order.objects.order_by('created').first()
|
||||||
|
last = timezone.now().year
|
||||||
|
first = first.created.year if first else last
|
||||||
|
|
||||||
|
return range(first, last+1)
|
||||||
|
|
||||||
|
def get_key(self, order):
|
||||||
|
return order.created.year
|
||||||
|
|
||||||
|
|
||||||
def stats_products_realtime(request):
|
def stats_products_realtime(request):
|
||||||
|
|||||||
+30
-49
@@ -6,8 +6,7 @@ var products_realtime_chart = null;
|
|||||||
var products_url = '/api/products/';
|
var products_url = '/api/products/';
|
||||||
var products_stat_url = '/api/products/group_by_user';
|
var products_stat_url = '/api/products/group_by_user';
|
||||||
|
|
||||||
var order_url = '/stats/orders/';
|
var order_base_url = '/stats/orders/{group}/';
|
||||||
var order_hourly_url = '/stats/orders/hourly';
|
|
||||||
var products_realtime_url = '/stats/orders/products_realtime';
|
var products_realtime_url = '/stats/orders/products_realtime';
|
||||||
|
|
||||||
function productFormatter() {
|
function productFormatter() {
|
||||||
@@ -93,47 +92,29 @@ function renderProductCharts(products) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function renderOrdersChart(data) {
|
|
||||||
var render_to = 'order_chart';
|
|
||||||
|
|
||||||
new Highcharts.Chart({
|
var orderFormatters = {
|
||||||
chart: {
|
hourly: function() {
|
||||||
renderTo: render_to,
|
return this.value + ":00";
|
||||||
plotBackgroundColor: null,
|
|
||||||
plotBorderWidth: null,
|
|
||||||
plotShadow: false
|
|
||||||
},
|
},
|
||||||
title: {
|
daily: function() {
|
||||||
text: 'Fordeling av ordre på person'
|
var days = {0: 'Mandag', 1: 'Tirsdag', 2: 'Onsdag', 3: 'Torsdag', 4: 'Fredag', 5: 'Lørdag', 6: 'Søndag'};
|
||||||
|
return days[this.value];
|
||||||
},
|
},
|
||||||
tooltip: {
|
monthly: function() {
|
||||||
formatter: function () {
|
var months = {
|
||||||
return '<b>' + this.point.name + '</b>: ' + Highcharts.numberFormat(this.percentage, 1) + ' %';
|
1: 'Januar', 2: 'Februar', 3: 'Mars', 4: 'April', 5: 'Mai', 6: 'Juni', 7: 'Juli',
|
||||||
}
|
8: 'August', 9: 'September', 10: 'Oktober', 11: 'November', 12: 'Desember'};
|
||||||
|
return months[this.value];
|
||||||
},
|
},
|
||||||
plotOptions: {
|
yearly: function() {
|
||||||
pie: {
|
return this.value;
|
||||||
allowPointSelect: true,
|
|
||||||
cursor: 'pointer',
|
|
||||||
dataLabels: {
|
|
||||||
enabled: true,
|
|
||||||
color: '#000000',
|
|
||||||
connectorColor: '#000000',
|
|
||||||
formatter: function () {
|
|
||||||
return '<b>' + this.point.name + '</b>: ' + this.y;
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
|
||||||
},
|
function renderOrdersGroupedChart(data) {
|
||||||
series: [{
|
var grouping = data.grouping;
|
||||||
type: 'pie',
|
var render_to = 'order_chart_' + grouping;
|
||||||
name: 'Orders',
|
|
||||||
data: data
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function renderOrdersHourlyChart(data) {
|
|
||||||
var render_to = 'order_hourly_chart';
|
|
||||||
|
|
||||||
new Highcharts.Chart({
|
new Highcharts.Chart({
|
||||||
chart: {
|
chart: {
|
||||||
@@ -141,7 +122,7 @@ function renderOrdersHourlyChart(data) {
|
|||||||
type: 'column'
|
type: 'column'
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
text: 'Ordre - time for time'
|
text: 'Ordre - ' + grouping
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
formatter: function() {
|
formatter: function() {
|
||||||
@@ -155,17 +136,16 @@ function renderOrdersHourlyChart(data) {
|
|||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
title: {
|
title: {
|
||||||
text: 'Tid (h)'
|
text: 'Tid'
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
formatter: function() {
|
formatter: orderFormatters[grouping]
|
||||||
return this.value + ":00";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plotOptions: {
|
plotOptions: {
|
||||||
column: {
|
column: {
|
||||||
minPointLength: 3
|
minPointLength: 3,
|
||||||
|
colorByPoint: true
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
groupPadding: 0,
|
groupPadding: 0,
|
||||||
@@ -174,7 +154,7 @@ function renderOrdersHourlyChart(data) {
|
|||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Ordre',
|
name: 'Ordre',
|
||||||
data: data.hourly
|
data: data.orders
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -188,11 +168,12 @@ $(document).ready(function() {
|
|||||||
products = data;
|
products = data;
|
||||||
renderProductCharts(data);
|
renderProductCharts(data);
|
||||||
});
|
});
|
||||||
/* Orders */
|
|
||||||
$.getJSON(order_url, renderOrdersChart);
|
|
||||||
|
|
||||||
/* Orders, hourly */
|
/* Orders, grouped */
|
||||||
$.getJSON(order_hourly_url, renderOrdersHourlyChart);
|
$('[data-group]').each(function () {
|
||||||
|
var url = order_base_url.replace('{group}', $(this).data('group'));
|
||||||
|
$.getJSON(url, renderOrdersGroupedChart);
|
||||||
|
});
|
||||||
|
|
||||||
/* Realtime purchases */
|
/* Realtime purchases */
|
||||||
products_realtime_chart = new Highcharts.Chart({
|
products_realtime_chart = new Highcharts.Chart({
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ body {
|
|||||||
img.profile {
|
img.profile {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ body {
|
|||||||
width: 64px;
|
width: 64px;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,6 +170,13 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#transactions {
|
||||||
|
img.customer {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
#user-profile {
|
#user-profile {
|
||||||
.profile-name {
|
.profile-name {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
Vendored
+10
-10
@@ -1,10 +1,10 @@
|
|||||||
function enable_all_customers(){$("li.customer").each(function(t){$(this).removeClass("marked"),$(this).show()})}function filter_customers(t){setTimeout(function(){$("li.customer").each(function(e){var i=new RegExp(t,"i"),n=$(this).children("span.name").text();if(i.test(n)){$(this).show();var r=n.toLowerCase()==t.toLowerCase(),o=1==$("li.customer:visible").length;console.log(r,o),r?$(this).addClass("marked"):$(this).removeClass("marked")}else $(this).hide(),$(this).removeClass("marked")})},50)}function enable_all_products(){$("li.product").each(function(t){$(this).removeClass("marked"),$(this).show()})}function reset_qtys(){$(".qty").each(function(t){$(this).html("0")}),$("input[name$=amount]").each(function(t){$(this).val("0")})}function update_total(){var t=0;$("li.product").each(function(){var e=Number($(this).find("[name$=amount]").val()),i=".sale_price_int";"Ekstern"===$("#id_customer_typeahead").val()&&(i=".sale_price_ext");var n=Number($(this).find(i).text());t+=e*n}),0===t&&(t=""),$("span.total_text").html(t)}function productFormatter(){return"<b>"+this.point.name+"</b>: "+Highcharts.numberFormat(this.percentage,1)+" %"}function parse_products_realtime_data(t,e){for(var i in t.products){null===e.get(i)&&e.addSeries({data:[],id:i,name:i});var n=e.get(i);_.each(t.products[i],function(t){null===e.get(t[0])&&n.addPoint({id:t[0],x:t[0],y:t[1]})})}}function get_products_realtime_data(){$.ajax({url:products_realtime_url,dataType:"json",success:function(t){parse_products_realtime_data(t,products_realtime_chart),setTimeout(function(){get_products_realtime_data()},15e3)},cache:!1})}function renderProductCharts(t){for(var e in t){var i="product_chart"+t[e].id,n=t[e].counts;n=_.map(n,function(t){return[t.full_name,t.amount_total]}),new Highcharts.Chart({chart:{renderTo:i,plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:t[e].name},tooltip:{formatter:productFormatter},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+this.y}}}},series:[{type:"pie",name:"Orders",data:n}]})}}function renderOrdersChart(t){var e="order_chart";new Highcharts.Chart({chart:{renderTo:e,plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:"Fordeling av ordre på person"},tooltip:{formatter:function(){return"<b>"+this.point.name+"</b>: "+Highcharts.numberFormat(this.percentage,1)+" %"}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+this.y}}}},series:[{type:"pie",name:"Orders",data:t}]})}function renderOrdersHourlyChart(t){var e="order_hourly_chart";new Highcharts.Chart({chart:{renderTo:e,type:"column"},title:{text:"Ordre - time for time"},tooltip:{formatter:function(){return this.y+" stk"}},yAxis:{title:{text:"Ordre"}},xAxis:{title:{text:"Tid (h)"},labels:{formatter:function(){return this.value+":00"}}},plotOptions:{column:{minPointLength:3},series:{groupPadding:0,pointPadding:.05}},series:[{name:"Ordre",data:t.hourly}]})}!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function i(t){var e="length"in t&&t.length,i=rt.type(t);return"function"===i||rt.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t}function n(t,e,i){if(rt.isFunction(e))return rt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return rt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(dt.test(e))return rt.filter(e,t,i);e=rt.filter(e,t)}return rt.grep(t,function(t){return rt.inArray(t,e)>=0!==i})}function r(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function o(t){var e=bt[t]={};return rt.each(t.match(xt)||[],function(t,i){e[i]=!0}),e}function s(){ft.addEventListener?(ft.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1)):(ft.detachEvent("onreadystatechange",a),t.detachEvent("onload",a))}function a(){(ft.addEventListener||"load"===event.type||"complete"===ft.readyState)&&(s(),rt.ready())}function l(t,e,i){if(void 0===i&&1===t.nodeType){var n="data-"+e.replace(St,"-$1").toLowerCase();if(i=t.getAttribute(n),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:Ct.test(i)?rt.parseJSON(i):i}catch(r){}rt.data(t,e,i)}else i=void 0}return i}function h(t){var e;for(e in t)if(("data"!==e||!rt.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function c(t,e,i,n){if(rt.acceptData(t)){var r,o,s=rt.expando,a=t.nodeType,l=a?rt.cache:t,h=a?t[s]:t[s]&&s;if(h&&l[h]&&(n||l[h].data)||void 0!==i||"string"!=typeof e)return h||(h=a?t[s]=q.pop()||rt.guid++:s),l[h]||(l[h]=a?{}:{toJSON:rt.noop}),("object"==typeof e||"function"==typeof e)&&(n?l[h]=rt.extendLine truncated
|
function enable_all_customers(){$("li.customer").each(function(t){$(this).removeClass("marked"),$(this).show()})}function filter_customers(t){setTimeout(function(){$("li.customer").each(function(e){var i=new RegExp(t,"i"),n=$(this).children("span.name").text();if(i.test(n)){$(this).show();var r=n.toLowerCase()==t.toLowerCase(),o=1==$("li.customer:visible").length;console.log(r,o),r?$(this).addClass("marked"):$(this).removeClass("marked")}else $(this).hide(),$(this).removeClass("marked")})},50)}function enable_all_products(){$("li.product").each(function(t){$(this).removeClass("marked"),$(this).show()})}function reset_qtys(){$(".qty").each(function(t){$(this).html("0")}),$("input[name$=amount]").each(function(t){$(this).val("0")})}function update_total(){var t=0;$("li.product").each(function(){var e=Number($(this).find("[name$=amount]").val()),i=".sale_price_int";"Ekstern"===$("#id_customer_typeahead").val()&&(i=".sale_price_ext");var n=Number($(this).find(i).text());t+=e*n}),0===t&&(t=""),$("span.total_text").html(t)}function productFormatter(){return"<b>"+this.point.name+"</b>: "+Highcharts.numberFormat(this.percentage,1)+" %"}function parse_products_realtime_data(t,e){for(var i in t.products){null===e.get(i)&&e.addSeries({data:[],id:i,name:i});var n=e.get(i);_.each(t.products[i],function(t){null===e.get(t[0])&&n.addPoint({id:t[0],x:t[0],y:t[1]})})}}function get_products_realtime_data(){$.ajax({url:products_realtime_url,dataType:"json",success:function(t){parse_products_realtime_data(t,products_realtime_chart),setTimeout(function(){get_products_realtime_data()},15e3)},cache:!1})}function renderProductCharts(t){for(var e in t){var i="product_chart"+t[e].id,n=t[e].counts;n=_.map(n,function(t){return[t.full_name,t.amount_total]}),new Highcharts.Chart({chart:{renderTo:i,plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:t[e].name},tooltip:{formatter:productFormatter},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+this.y}}}},series:[{type:"pie",name:"Orders",data:n}]})}}function renderOrdersGroupedChart(t){var e=t.grouping,i="order_chart_"+e;new Highcharts.Chart({chart:{renderTo:i,type:"column"},title:{text:"Ordre - "+e},tooltip:{formatter:function(){return this.y+" stk"}},yAxis:{title:{text:"Ordre"}},xAxis:{title:{text:"Tid"},labels:{formatter:orderFormatters[e]}},plotOptions:{column:{minPointLength:3,colorByPoint:!0},series:{groupPadding:0,pointPadding:.05}},series:[{name:"Ordre",data:t.orders}]})}!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function i(t){var e="length"in t&&t.length,i=rt.type(t);return"function"===i||rt.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t}function n(t,e,i){if(rt.isFunction(e))return rt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return rt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(dt.test(e))return rt.filter(e,t,i);e=rt.filter(e,t)}return rt.grep(t,function(t){return rt.inArray(t,e)>=0!==i})}function r(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function o(t){var e=bt[t]={};return rt.each(t.match(xt)||[],function(t,i){e[i]=!0}),e}function s(){ft.addEventListener?(ft.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1)):(ft.detachEvent("onreadystatechange",a),t.detachEvent("onload",a))}function a(){(ft.addEventListener||"load"===event.type||"complete"===ft.readyState)&&(s(),rt.ready())}function l(t,e,i){if(void 0===i&&1===t.nodeType){var n="data-"+e.replace(St,"-$1").toLowerCase();if(i=t.getAttribute(n),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:Ct.test(i)?rt.parseJSON(i):i}catch(r){}rt.data(t,e,i)}else i=void 0}return i}function h(t){var e;for(e in t)if(("data"!==e||!rt.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function c(t,e,i,n){if(rt.acceptData(t)){var r,o,s=rt.expando,a=t.nodeType,l=a?rt.cache:t,h=a?t[s]:t[s]&&s;if(h&&l[h]&&(n||l[h].data)||void 0!==i||"string"!=typeof e)return h||(h=a?t[s]=q.pop()||rt.guid++:s),l[h]||(l[h]=a?{}:{toJSON:rt.noop}),("object"==typeof e||"function"==typeof e)&&(n?l[h]=rt.extend(l[h],e):l[h].data=rt.extend(l[h].data,e)),o=l[h],n||(o.data||(o.data={}),o=o.data),void 0!==i&&(o[rt.camelCase(e)]=i),"string"==typeof e?(r=o[e],null==r&&(r=o[rt.camelCase(e)])):r=o,r}}function u(t,e,i){if(rt.acceptData(t)){var n,r,o=t.nodeType,s=o?rt.cache:t,a=o?t[rt.expando]:rt.expando;if(s[a]){if(e&&(n=i?s[a]:s[a].data)){rt.isArray(e)?e=e.concat(rt.map(e,rt.camelCase)):e in n?e=[e]:(e=rt.camelCase(e),e=e in n?[e]:e.split(" ")),r=e.length;for(;r--;)delete n[e[r]];if(i?!h(n):!rt.isEmptyObject(n))return}(i||(delete s[a].data,h(s[a])))&&(o?rt.cleLine truncated
|
||||||
}else if(y&&(h=(e[R]||(e[R]={}))[t])&&h[0]===j)d=h[1];else for(;(u=++p&&u&&u[g]||(d=p=0)||f.pop())&&((a?u.nodeName.toLowerCase()!==v:1!==u.nodeType)||!++d||(y&&((u[R]||(u[R]={}))[t]=[j,d]),u!==e)););return d-=r,d===n||d%n===0&&d/n>=0}}},PSEUDO:function(t,i){var r,o=k.pseudos[t]||k.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[R]?o(i):o.length>1?(r=[t,t,"",i],k.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,r=o(t,i),s=r.length;s--;)n=tt(t,r[s]),t[n]=!(e[n]=r[s])}):function(t){return o(t,0,r)}):o}},pseudos:{not:n(function(t){var e=[],i=[],r=D(t.replace(lt,"$1"));return r[R]?n(function(t,e,i,n){for(var o,s=r(t,null,n,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,n,o){return e[0]=t,r(e,null,o,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(wt,kt),function(e){return(e.textContent||e.innerText||T(e)).indexOf(t)>-1}}),lang:n(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(wt,kt).toLowerCase(),function(e){var i;do if(i=O?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return i=i.toLowerCase(),i===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===N},focus:function(t){return t===_.activeElement&&(!_.hasFocus||_.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!k.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return gt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:h(function(){return[0]}),last:h(function(t,e){return[e-1]}),eq:h(function(t,e,i){return[0>i?i+e:i]}),even:h(function(t,e){for(var i=0;e>i;i+=2)t.push(i);return t}),odd:h(function(t,e){for(var i=1;e>i;i+=2)t.push(i);return t}),lt:h(function(t,e,i){for(var n=0>i?i+e:i;--n>=0;)t.push(n);return t}),gt:h(function(t,e,i){for(var n=0>i?i+e:i;++n<e;)t.push(n);return t})}},k.pseudos.nth=k.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})k.pseudos[b]=a(b);for(b in{submit:!0,reset:!0})k.pseudos[b]=l(b);return u.prototype=k.filters=k.pseudos,k.setFilters=new u,S=e.tokenize=function(t,i){var n,r,o,s,a,l,h,c=Y[t+" "];if(c)return i?0:c.slice(0);for(a=t,l=[],h=k.preFilter;a;){(!n||(r=ht.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=ct.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(lt," ")}),a=a.slice(n.length));for(s in k.filter)!(r=ft[s].exec(a))||h[s]&&!(r=h[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?e.error(t):Y(t,l).slice(0)},D=e.compile=function(t,e){var i,n=[],r=[],o=X[t+" "];if(!o){for(e||(e=S(t)),i=e.length;i--;)o=y(e[i]),o[R]?n.push(o):r.push(o);o=X(t,x(r,n)),o.selector=t}return o},A=e.select=function(t,e,i,n){var r,o,s,a,l,h="function"==typeof t&&t,u=!n&&S(t=h.selector||t);if(i=i||[],1===u.length){if(o=u[0]=u[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&w.getById&&9===e.nodeType&&O&&k.relative[o[1].type]){if(e=(k.find.ID(s.matches[0].replace(wt,kt),e)||[])[0],!e)return i;h&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=ft.needsContext.test(t)?0:o.length;r--&&(s=o[r],!k.relative[a=s.type]);)if((l=k.find[a])&&(n=l(s.matches[0].replace(wt,kt),xt.test(o[0].type)&&c(e.parentNode)||e))){if(o.splice(r,1),t=n.length&&d(o),!t)return Z.apply(i,n),i;break}}return(h||D(t,u))(n,e,!O,i,xt.test(t)&&c(e.parentNode)||e),i},w.sortStable=R.split("").sort(U).join("")===R,w.detectDuplicates=!!P,E(),w.sortDetached=r(function(t){return 1&t.compareDocumentPosition(_.createElement("div"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,i){return i?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,i){return i||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,i){var n;return i?void 0:t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(t);rt.find=ht,rt.expr=ht.selectors,rt.expr[":"]=rt.expr.pseudos,rt.unique=ht.uniqueSort,rt.text=ht.getTeLine truncated
|
not:n(function(t){var e=[],i=[],r=D(t.replace(lt,"$1"));return r[R]?n(function(t,e,i,n){for(var o,s=r(t,null,n,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,n,o){return e[0]=t,r(e,null,o,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(wt,kt),function(e){return(e.textContent||e.innerText||T(e)).indexOf(t)>-1}}),lang:n(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(wt,kt).toLowerCase(),function(e){var i;do if(i=O?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return i=i.toLowerCase(),i===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===N},focus:function(t){return t===_.activeElement&&(!_.hasFocus||_.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!k.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return gt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:h(function(){return[0]}),last:h(function(t,e){return[e-1]}),eq:h(function(t,e,i){return[0>i?i+e:i]}),even:h(function(t,e){for(var i=0;e>i;i+=2)t.push(i);return t}),odd:h(function(t,e){for(var i=1;e>i;i+=2)t.push(i);return t}),lt:h(function(t,e,i){for(var n=0>i?i+e:i;--n>=0;)t.push(n);return t}),gt:h(function(t,e,i){for(var n=0>i?i+e:i;++n<e;)t.push(n);return t})}},k.pseudos.nth=k.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})k.pseudos[b]=a(b);for(b in{submit:!0,reset:!0})k.pseudos[b]=l(b);return u.prototype=k.filters=k.pseudos,k.setFilters=new u,S=e.tokenize=function(t,i){var n,r,o,s,a,l,h,c=Y[t+" "];if(c)return i?0:c.slice(0);for(a=t,l=[],h=k.preFilter;a;){(!n||(r=ht.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=ct.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(lt," ")}),a=a.slice(n.length));for(s in k.filter)!(r=ft[s].exec(a))||h[s]&&!(r=h[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?e.error(t):Y(t,l).slice(0)},D=e.compile=function(t,e){var i,n=[],r=[],o=X[t+" "];if(!o){for(e||(e=S(t)),i=e.length;i--;)o=y(e[i]),o[R]?n.push(o):r.push(o);o=X(t,x(r,n)),o.selector=t}return o},A=e.select=function(t,e,i,n){var r,o,s,a,l,h="function"==typeof t&&t,u=!n&&S(t=h.selector||t);if(i=i||[],1===u.length){if(o=u[0]=u[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&w.getById&&9===e.nodeType&&O&&k.relative[o[1].type]){if(e=(k.find.ID(s.matches[0].replace(wt,kt),e)||[])[0],!e)return i;h&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=ft.needsContext.test(t)?0:o.length;r--&&(s=o[r],!k.relative[a=s.type]);)if((l=k.find[a])&&(n=l(s.matches[0].replace(wt,kt),xt.test(o[0].type)&&c(e.parentNode)||e))){if(o.splice(r,1),t=n.length&&d(o),!t)return Z.apply(i,n),i;break}}return(h||D(t,u))(n,e,!O,i,xt.test(t)&&c(e.parentNode)||e),i},w.sortStable=R.split("").sort(U).join("")===R,w.detectDuplicates=!!P,E(),w.sortDetached=r(function(t){return 1&t.compareDocumentPosition(_.createElement("div"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,i){return i?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,i){return i||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,i){var n;return i?void 0:t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(t);rt.find=ht,rt.expr=ht.selectors,rt.expr[":"]=rt.expr.pseudos,rt.unique=ht.uniqueSort,rt.text=ht.getText,rt.isXMLDoc=ht.isXML,rt.contains=ht.contains;var ct=rt.expr.match.needsContext,ut=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^.[^:#\[\.,]*$/;rt.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?rt.find.matchesSelector(n,t)?[n]:[]:rt.find.matches(t,rt.grep(e,function(t){return 1===t.nodeType}))},rt.fn.extend({find:function(t){var e,i=[],n=this,r=n.length;if("string"!=typeof t)return this.pushStack(rt(t).filter(function(){for(e=0;r>e;e++)if(rt.contains(n[e],this))return!0}));for(e=0;r>e;e++)rt.find(t,n[e],i);return i=thisLine truncated
|
||||||
},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&rt.cleanData(m(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&rt.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return rt.clone(this,t,e)})},html:function(t){return Lt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Bt,""):void 0;if(!("string"!=typeof t||Yt.test(t)||!it.htmlSerialize&&Ft.test(t)||!it.leadingWhitespace&&Rt.test(t)||Vt[(jt.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(zt,"<$1></$2>");try{for(;n>i;i++)e=this[i]||{},1===e.nodeType&&(rt.cleanData(m(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,rt.cleanData(m(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=J.apply([],t);var i,n,r,o,s,a,l=0,h=this.length,c=this,u=h-1,d=t[0],p=rt.isFunction(d);if(p||h>1&&"string"==typeof d&&!it.checkClone&&Xt.test(d))return this.each(function(i){var n=c.eq(i);p&&(t[0]=d.call(this,i,n.html())),n.domManip(t,e)});if(h&&(a=rt.buildFragment(t,this[0].ownerDocument,!1,this),i=a.firstChild,1===a.childNodes.length&&(a=i),i)){for(o=rt.map(m(a,"script"),x),r=o.length;h>l;l++)n=a,l!==u&&(n=rt.clone(n,!0,!0),r&&rt.merge(o,m(n,"script"))),e.call(this[l],n,l);if(r)for(s=o[o.length-1].ownerDocument,rt.map(o,b),l=0;r>l;l++)n=o[l],Ut.test(n.type||"")&&!rt._data(n,"globalEval")&&rt.contains(s,n)&&(n.src?rt._evalUrl&&rt._evalUrl(n.src):rt.globalEval((n.text||n.textContent||n.innerHTML||"").replace(qt,"")));a=i=null}return this}}),rt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){rt.fn[t]=function(t){for(var i,n=0,r=[],o=rt(t),s=o.length-1;s>=n;n++)i=n===s?this:this.clone(!0),rt(o[n])[e](i),K.apply(r,i.get());return this.pushStack(r)}});var Zt,Qt={};!function(){var t;it.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,i,n;return i=ft.getElementsByTagName("body")[0],i&&i.style?(e=ft.createElement("div"),n=ft.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),typeof e.style.zoom!==Tt&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(ft.createElement("div")).style.width="5px",t=3!==e.offsetWidth),i.removeChild(n),t):void 0}}();var te,ee,ie=/^margin/,ne=new RegExp("^("+Dt+")(?!px)[a-z%]+$","i"),re=/^(top|right|bottom|left)$/;t.getComputedStyle?(te=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)},ee=function(t,e,i){var n,r,o,s,a=t.style;return i=i||te(t),s=i?i.getPropertyValue(e)||i[e]:void 0,i&&(""!==s||rt.contains(t.ownerDocument,t)||(s=rt.style(t,e)),ne.test(s)&&ie.test(e)&&(n=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=i.width,a.width=n,a.minWidth=r,a.maxWidth=o)),void 0===s?s:s+""}):ft.documentElement.currentStyle&&(te=function(t){return t.currentStyle},ee=function(t,e,i){var n,r,o,s,a=t.style;return i=i||te(t),s=i?i[e]:void 0,null==s&&a&&a[e]&&(s=a[e]),ne.test(s)&&!re.test(e)&&(n=a.left,r=t.runtimeStyle,o=r&&r.left,o&&(r.left=t.currentStyle.left),a.left="fontSize"===e?"1em":s,s=a.pixelLeft+"px",a.left=n,o&&(r.left=o)),void 0===s?s:s+""||"auto"}),!function(){function e(){var e,i,n,r;i=ft.getElementsByTagName("body")[0],i&&i.style&&(e=ft.createElement("div"),n=ft.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,l=!0,t.getComputedStyle&&(o="1%"!==(t.getComputedStyle(e,null)||{}).top,s="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width,r=e.appendChild(ft.createElement("div")),r.style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",r.style.marginRight=r.style.width="0",e.style.width="1px",l=!parseFloat((t.getComputedStyle(r,null)||{}).marginRight),e.removeChild(r)),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",r=e.getElementsByTagName("td"),r[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===r[0].offsetHeight,a&&(r[0].style.display="",r[1].style.display="none",a=0===r[0].offsetHeight),i.removeChild(n))}var i,n,r,o,s,a,l;i=ft.createElement("div"),i.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=i.getElementsByTagName("a"Line truncated
|
t=t.replace(zt,"<$1></$2>");try{for(;n>i;i++)e=this[i]||{},1===e.nodeType&&(rt.cleanData(m(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,rt.cleanData(m(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=J.apply([],t);var i,n,r,o,s,a,l=0,h=this.length,c=this,u=h-1,d=t[0],p=rt.isFunction(d);if(p||h>1&&"string"==typeof d&&!it.checkClone&&Xt.test(d))return this.each(function(i){var n=c.eq(i);p&&(t[0]=d.call(this,i,n.html())),n.domManip(t,e)});if(h&&(a=rt.buildFragment(t,this[0].ownerDocument,!1,this),i=a.firstChild,1===a.childNodes.length&&(a=i),i)){for(o=rt.map(m(a,"script"),x),r=o.length;h>l;l++)n=a,l!==u&&(n=rt.clone(n,!0,!0),r&&rt.merge(o,m(n,"script"))),e.call(this[l],n,l);if(r)for(s=o[o.length-1].ownerDocument,rt.map(o,b),l=0;r>l;l++)n=o[l],Ut.test(n.type||"")&&!rt._data(n,"globalEval")&&rt.contains(s,n)&&(n.src?rt._evalUrl&&rt._evalUrl(n.src):rt.globalEval((n.text||n.textContent||n.innerHTML||"").replace(qt,"")));a=i=null}return this}}),rt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){rt.fn[t]=function(t){for(var i,n=0,r=[],o=rt(t),s=o.length-1;s>=n;n++)i=n===s?this:this.clone(!0),rt(o[n])[e](i),K.apply(r,i.get());return this.pushStack(r)}});var Zt,Qt={};!function(){var t;it.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,i,n;return i=ft.getElementsByTagName("body")[0],i&&i.style?(e=ft.createElement("div"),n=ft.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),typeof e.style.zoom!==Tt&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(ft.createElement("div")).style.width="5px",t=3!==e.offsetWidth),i.removeChild(n),t):void 0}}();var te,ee,ie=/^margin/,ne=new RegExp("^("+Dt+")(?!px)[a-z%]+$","i"),re=/^(top|right|bottom|left)$/;t.getComputedStyle?(te=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)},ee=function(t,e,i){var n,r,o,s,a=t.style;return i=i||te(t),s=i?i.getPropertyValue(e)||i[e]:void 0,i&&(""!==s||rt.contains(t.ownerDocument,t)||(s=rt.style(t,e)),ne.test(s)&&ie.test(e)&&(n=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=i.width,a.width=n,a.minWidth=r,a.maxWidth=o)),void 0===s?s:s+""}):ft.documentElement.currentStyle&&(te=function(t){return t.currentStyle},ee=function(t,e,i){var n,r,o,s,a=t.style;return i=i||te(t),s=i?i[e]:void 0,null==s&&a&&a[e]&&(s=a[e]),ne.test(s)&&!re.test(e)&&(n=a.left,r=t.runtimeStyle,o=r&&r.left,o&&(r.left=t.currentStyle.left),a.left="fontSize"===e?"1em":s,s=a.pixelLeft+"px",a.left=n,o&&(r.left=o)),void 0===s?s:s+""||"auto"}),!function(){function e(){var e,i,n,r;i=ft.getElementsByTagName("body")[0],i&&i.style&&(e=ft.createElement("div"),n=ft.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(e),e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,l=!0,t.getComputedStyle&&(o="1%"!==(t.getComputedStyle(e,null)||{}).top,s="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width,r=e.appendChild(ft.createElement("div")),r.style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",r.style.marginRight=r.style.width="0",e.style.width="1px",l=!parseFloat((t.getComputedStyle(r,null)||{}).marginRight),e.removeChild(r)),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",r=e.getElementsByTagName("td"),r[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===r[0].offsetHeight,a&&(r[0].style.display="",r[1].style.display="none",a=0===r[0].offsetHeight),i.removeChild(n))}var i,n,r,o,s,a,l;i=ft.createElement("div"),i.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=i.getElementsByTagName("a")[0],(n=r&&r.style)&&(n.cssText="float:left;opacity:.5",it.opacity="0.5"===n.opacity,it.cssFloat=!!n.cssFloat,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",it.clearCloneStyle="content-box"===i.style.backgroundClip,it.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,rt.extend(it,{reliableHiddenOffsets:function(){return null==a&&e(),a},boxSizingReliable:function(){return null==s&&e(),s},pixelPosition:function(){return null==o&&e(),o},reliableMarginRight:function(){return null==l&&e(),l}}))}(),rt.swap=function(t,e,i,n){var r,o,s={};for(o in e)s[o]=t.style[Line truncated
|
||||||
if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||ft;var n=ut.exec(t),r=!i&&[];return n?[e.createElement(n[1])]:(n=rt.buildFragment([t],e,r),r&&r.length&&rt(r).remove(),rt.merge([],n.childNodes))};var ii=rt.fn.load;rt.fn.load=function(t,e,i){if("string"!=typeof t&&ii)return ii.apply(this,arguments);var n,r,o,s=this,a=t.indexOf(" ");return a>=0&&(n=rt.trim(t.slice(a,t.length)),t=t.slice(0,a)),rt.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&rt.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){r=arguments,s.html(n?rt("<div>").append(rt.parseHTML(t)).find(n):t)}).complete(i&&function(t,e){s.each(i,r||[t.responseText,e,t])}),this},rt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){rt.fn[e]=function(t){return this.on(e,t)}}),rt.expr.filters.animated=function(t){return rt.grep(rt.timers,function(e){return t===e.elem}).length};var ni=t.document.documentElement;rt.offset={setOffset:function(t,e,i){var n,r,o,s,a,l,h,c=rt.css(t,"position"),u=rt(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),o=rt.css(t,"top"),l=rt.css(t,"left"),h=("absolute"===c||"fixed"===c)&&rt.inArray("auto",[o,l])>-1,h?(n=u.position(),s=n.top,r=n.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),rt.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(d.top=e.top-a.top+s),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):u.css(d)}},rt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){rt.offset.setOffset(this,t,e)});var e,i,n={top:0,left:0},r=this[0],o=r&&r.ownerDocument;return o?(e=o.documentElement,rt.contains(e,r)?(typeof r.getBoundingClientRect!==Tt&&(n=r.getBoundingClientRect()),i=G(o),{top:n.top+(i.pageYOffset||e.scrollTop)-(e.clientTop||0),left:n.left+(i.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):n):void 0},position:function(){if(this[0]){var t,e,i={top:0,left:0},n=this[0];return"fixed"===rt.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),rt.nodeName(t[0],"html")||(i=t.offset()),i.top+=rt.css(t[0],"borderTopWidth",!0),i.left+=rt.css(t[0],"borderLeftWidth",!0)),{top:e.top-i.top-rt.css(n,"marginTop",!0),left:e.left-i.left-rt.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||ni;t&&!rt.nodeName(t,"html")&&"static"===rt.css(t,"position");)t=t.offsetParent;return t||ni})}}),rt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i=/Y/.test(e);rt.fn[t]=function(n){return Lt(this,function(t,n,r){var o=G(t);return void 0===r?o?e in o?o[e]:o.document.documentElement[n]:t[n]:void(o?o.scrollTo(i?rt(o).scrollLeft():r,i?r:rt(o).scrollTop()):t[n]=r)},t,n,arguments.length,null)}}),rt.each(["top","left"],function(t,e){rt.cssHooks[e]=D(it.pixelPosition,function(t,i){return i?(i=ee(t,e),ne.test(i)?rt(t).position()[e]+"px":i):void 0})}),rt.each({Height:"height",Width:"width"},function(t,e){rt.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){rt.fn[n]=function(n,r){var o=arguments.length&&(i||"boolean"!=typeof n),s=i||(n===!0||r===!0?"margin":"border");return Lt(this,function(e,i,n){var r;return rt.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?rt.css(e,i,s):rt.style(e,i,n,s)},e,o?n:void 0,o,null)}})}),rt.fn.size=function(){return this.length},rt.fn.andSelf=rt.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return rt});var ri=t.jQuery,oi=t.$;return rt.noConflict=function(e){return t.$===rt&&(t.$=oi),e&&t.jQuery===rt&&(t.jQuery=ri),rt},typeof e===Tt&&(t.jQuery=t.$=rt),rt}),+function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e=t.Event("show.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.$parent&&this.$parent.find("> .panel > .in");if(i&&i.length){var n=i.data("bs.collapse");if(n&&n.transitioning)return;i.collapse("hide"),n||i.data("bs.collapse",null)}var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1;var o=function(e){return e&&e.target!=this.$element[0]?void this.$element.one(t.support.transition.end,t.proxy(o,this)):(this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,void this.$element.trigger("shown.bs.collapse"))};if(!t.support.transition)return o.call(this);var s=t.camelCase(["scroll",r].join("-"));this.$element.one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(Line truncated
|
}).complete(i&&function(t,e){s.each(i,r||[t.responseText,e,t])}),this},rt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){rt.fn[e]=function(t){return this.on(e,t)}}),rt.expr.filters.animated=function(t){return rt.grep(rt.timers,function(e){return t===e.elem}).length};var ni=t.document.documentElement;rt.offset={setOffset:function(t,e,i){var n,r,o,s,a,l,h,c=rt.css(t,"position"),u=rt(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),o=rt.css(t,"top"),l=rt.css(t,"left"),h=("absolute"===c||"fixed"===c)&&rt.inArray("auto",[o,l])>-1,h?(n=u.position(),s=n.top,r=n.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),rt.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(d.top=e.top-a.top+s),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):u.css(d)}},rt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){rt.offset.setOffset(this,t,e)});var e,i,n={top:0,left:0},r=this[0],o=r&&r.ownerDocument;return o?(e=o.documentElement,rt.contains(e,r)?(typeof r.getBoundingClientRect!==Tt&&(n=r.getBoundingClientRect()),i=G(o),{top:n.top+(i.pageYOffset||e.scrollTop)-(e.clientTop||0),left:n.left+(i.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):n):void 0},position:function(){if(this[0]){var t,e,i={top:0,left:0},n=this[0];return"fixed"===rt.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),rt.nodeName(t[0],"html")||(i=t.offset()),i.top+=rt.css(t[0],"borderTopWidth",!0),i.left+=rt.css(t[0],"borderLeftWidth",!0)),{top:e.top-i.top-rt.css(n,"marginTop",!0),left:e.left-i.left-rt.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||ni;t&&!rt.nodeName(t,"html")&&"static"===rt.css(t,"position");)t=t.offsetParent;return t||ni})}}),rt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i=/Y/.test(e);rt.fn[t]=function(n){return Lt(this,function(t,n,r){var o=G(t);return void 0===r?o?e in o?o[e]:o.document.documentElement[n]:t[n]:void(o?o.scrollTo(i?rt(o).scrollLeft():r,i?r:rt(o).scrollTop()):t[n]=r)},t,n,arguments.length,null)}}),rt.each(["top","left"],function(t,e){rt.cssHooks[e]=D(it.pixelPosition,function(t,i){return i?(i=ee(t,e),ne.test(i)?rt(t).position()[e]+"px":i):void 0})}),rt.each({Height:"height",Width:"width"},function(t,e){rt.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){rt.fn[n]=function(n,r){var o=arguments.length&&(i||"boolean"!=typeof n),s=i||(n===!0||r===!0?"margin":"border");return Lt(this,function(e,i,n){var r;return rt.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?rt.css(e,i,s):rt.style(e,i,n,s)},e,o?n:void 0,o,null)}})}),rt.fn.size=function(){return this.length},rt.fn.andSelf=rt.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return rt});var ri=t.jQuery,oi=t.$;return rt.noConflict=function(e){return t.$===rt&&(t.$=oi),e&&t.jQuery===rt&&(t.jQuery=ri),rt},typeof e===Tt&&(t.jQuery=t.$=rt),rt}),+function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e=t.Event("show.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.$parent&&this.$parent.find("> .panel > .in");if(i&&i.length){var n=i.data("bs.collapse");if(n&&n.transitioning)return;i.collapse("hide"),n||i.data("bs.collapse",null)}var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1;var o=function(e){return e&&e.target!=this.$element[0]?void this.$element.one(t.support.transition.end,t.proxy(o,this)):(this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,void this.$element.trigger("shown.bs.collapse"))};if(!t.support.transition)return o.call(this);var s=t.camelCase(["scroll",r].join("-"));this.$element.one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(350)[r](this.$element[0][s])}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var n=function(e){return e&&e.target!=this.$element[0]?void this.$element.one(t.support.transition.end,t.proxy(n,this)):(this.transitioning=0,void this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse"))};return t.supLine truncated
|
||||||
}this.fill();break;case"today":var l=new Date;l=i(l.getFullYear(),l.getMonth(),l.getDate(),0,0,0),this.showMode(-2);var h="linked"===this.o.todayBtn?null:"view";this._setDate(l,h);break;case"clear":var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&c.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":s.is(".disabled")||(this.viewDate.setUTCDate(1),s.is(".month")?(o=1,r=s.parent().find("span").index(s),n=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(r),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(i(n,r,o))):(o=1,r=0,n=parseInt(s.text(),10)||0,this.viewDate.setUTCFullYear(n),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(i(n,r,o))),this.showMode(-1),this.fill());break;case"td":s.is(".day")&&!s.is(".disabled")&&(o=parseInt(s.text(),10)||1,n=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),s.is(".old")?0===r?(r=11,n-=1):r-=1:s.is(".new")&&(11===r?(r=0,n+=1):r+=1),this._setDate(i(n,r,o)))}this.picker.is(":visible")&&this._focused_from&&t(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),1===this.o.multidate&&0===e||(-1!==e?this.dates.remove(e):this.dates.push(t)),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),e&&"view"!==e||(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),!this.o.autoclose||e&&"date"!==e||this.hide()},moveMonth:function(t,i){if(!t)return e;if(!i)return t;var n,r,o=new Date(t.valueOf()),s=o.getUTCDate(),a=o.getUTCMonth(),l=Math.abs(i);if(i=i>0?1:-1,1===l)r=-1===i?function(){return o.getUTCMonth()===a}:function(){return o.getUTCMonth()!==n},n=a+i,o.setUTCMonth(n),(0>n||n>11)&&(n=(n+12)%12);else{for(var h=0;l>h;h++)o=this.moveMonth(o,i);n=o.getUTCMonth(),o.setUTCDate(s),r=function(){return n!==o.getUTCMonth()}}for(;r();)o.setUTCDate(--s),o.setUTCMonth(n);return o},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27===t.keyCode&&this.show());var e,i,r,o=!1,s=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||n(),e),r=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||n(),e),r=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||n()),i.setUTCDate(i.getUTCDate()+e),r=new Date(s),r.setUTCDate(s.getUTCDate()+e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=r,this.setValue(),this.fill(),t.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||n(),e),r=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||n(),e),r=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||n()),i.setUTCDate(i.getUTCDate()+7*e),r=new Date(s),r.setUTCDate(s.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=r,this.setValue(),this.fill(),t.preventDefault());break;case 32:break;case 13:s=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(s),o=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(o){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var a;this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+g.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var c=function(e,i){this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,t(this.inputs).datepicker(i).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};c.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:funLine truncated
|
r=0,n=parseInt(s.text(),10)||0,this.viewDate.setUTCFullYear(n),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(i(n,r,o))),this.showMode(-1),this.fill());break;case"td":s.is(".day")&&!s.is(".disabled")&&(o=parseInt(s.text(),10)||1,n=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),s.is(".old")?0===r?(r=11,n-=1):r-=1:s.is(".new")&&(11===r?(r=0,n+=1):r+=1),this._setDate(i(n,r,o)))}this.picker.is(":visible")&&this._focused_from&&t(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),1===this.o.multidate&&0===e||(-1!==e?this.dates.remove(e):this.dates.push(t)),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),e&&"view"!==e||(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),!this.o.autoclose||e&&"date"!==e||this.hide()},moveMonth:function(t,i){if(!t)return e;if(!i)return t;var n,r,o=new Date(t.valueOf()),s=o.getUTCDate(),a=o.getUTCMonth(),l=Math.abs(i);if(i=i>0?1:-1,1===l)r=-1===i?function(){return o.getUTCMonth()===a}:function(){return o.getUTCMonth()!==n},n=a+i,o.setUTCMonth(n),(0>n||n>11)&&(n=(n+12)%12);else{for(var h=0;l>h;h++)o=this.moveMonth(o,i);n=o.getUTCMonth(),o.setUTCDate(s),r=function(){return n!==o.getUTCMonth()}}for(;r();)o.setUTCDate(--s),o.setUTCMonth(n);return o},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27===t.keyCode&&this.show());var e,i,r,o=!1,s=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||n(),e),r=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||n(),e),r=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||n()),i.setUTCDate(i.getUTCDate()+e),r=new Date(s),r.setUTCDate(s.getUTCDate()+e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=r,this.setValue(),this.fill(),t.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||n(),e),r=this.moveYear(s,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||n(),e),r=this.moveMonth(s,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||n()),i.setUTCDate(i.getUTCDate()+7*e),r=new Date(s),r.setUTCDate(s.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=r,this.setValue(),this.fill(),t.preventDefault());break;case 32:break;case 13:s=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(s),o=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(o){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var a;this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+g.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var c=function(e,i){this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,t(this.inputs).datepicker(i).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};c.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},dateUpdated:function(e){if(!this.updating){this.updating=!0;var i=t(e.target).data("datepicker"),n=i.getUTCDate(),r=t.inArray(e.target,this.inputs),o=this.inputs.length;if(-1!==r){if(t.each(this.pickers,function(t,e){e.getUTCDate()||e.setUTCDate(n)}),n<this.dates[r])for(;r>=0&&n<this.dates[r];)this.pickers[r--].setUTCDate(n);else if(n>this.dates[r])for(;o>r&&n>this.dates[r];)this.pickers[r++].setUTCDate(n);this.updateDates(),delete this.updating}}},remove:function(){t.map(this.pickers,function(t){t.remove()}),delete this.element.daLine truncated
|
||||||
r.cutHeight=o),e?e.element.appendChild(r):c.parentNode.insertBefore(r,c),h.push(r);this.shadows=h}return this},xGetter:function(t){return"circle"===this.element.nodeName&&(t={x:"cx",y:"cy"}[t]||t),this._defaultGetter(t)},_defaultGetter:function(t){return t=p(this[t],this.element?this.element.getAttribute(t):null,0),/^[\-0-9\.]+$/.test(t)&&(t=parseFloat(t)),t},dSetter:function(t,e,i){t&&t.join&&(t=t.join(" ")),/(NaN| {2}|^$)/.test(t)&&(t="M 0 0"),i.setAttribute(e,t),this[e]=t},dashstyleSetter:function(t){var e;if(t=t&&t.toLowerCase()){for(t=t.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(","),e=t.length;e--;)t[e]=i(t[e])*this["stroke-width"];t=t.join(",").replace("NaN","none"),this.element.setAttribute("stroke-dasharray",t)}},alignSetter:function(t){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[t])},opacitySetter:function(t,e,i){this[e]=t,i.setAttribute(e,t)},titleSetter:function(t){var e=this.element.getElementsByTagName("title")[0];e||(e=at.createElementNS(At,"title"),this.element.appendChild(e)),e.textContent=p(t,"").replace(/<[^>]*>/g,"")},textSetter:function(t){t!==this.textStr&&(delete this.bBox,this.textStr=t,this.added&&this.renderer.buildText(this))},fillSetter:function(t,e,i){"string"==typeof t?i.setAttribute(e,t):t&&this.colorGradient(t,e,i)},zIndexSetter:function(t,e,i){i.setAttribute(e,t),this[e]=t},_defaultSetter:function(t,e,i){i.setAttribute(e,t)}},E.prototype.yGetter=E.prototype.xGetter,E.prototype.translateXSetter=E.prototype.translateYSetter=E.prototype.rotationSetter=E.prototype.verticalAlignSetter=E.prototype.scaleXSetter=E.prototype.scaleYSetter=function(t,e){this[e]=t,this.doTransform=!0},E.prototype["stroke-widthSetter"]=E.prototype.strokeSetter=function(t,e,i){this[e]=t,this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],E.prototype.fillSetter.call(this,this.stroke,"stroke",i),i.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===e&&0===t&&this.hasStroke&&(i.removeAttribute("stroke"),this.hasStroke=!1)};var ae=function(){this.init.apply(this,arguments)};ae.prototype={Element:E,init:function(t,e,i,n,r){var o,s=location,n=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(n));o=n.element,t.appendChild(o),-1===t.innerHTML.indexOf("xmlns")&&u(o,"xmlns",At),this.isSVG=!0,this.box=o,this.boxWrapper=n,this.alignedObjects=[],this.url=(St||Ct)&&at.getElementsByTagName("base").length?s.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(at.createTextNode("Created with Highcharts 4.0.4")),this.defs=this.createElement("defs").add(),this.forExport=r,this.gradients={},this.cache={},this.setSize(e,i,!1);var a;St&&t.getBoundingClientRect&&(this.subPixelFix=e=function(){f(t,{left:0,top:0}),a=t.getBoundingClientRect(),f(t,{left:dt(a.left)-a.left+"px",top:dt(a.top)-a.top+"px"})},e(),Jt(lt,"resize",e))},getStyle:function(e){return this.style=t({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},e)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),D(this.gradients||{}),this.gradients=null,t&&(this.defs=t.destroy()),this.subPixelFix&&Kt(lt,"resize",this.subPixelFix),this.alignedObjects=null},createElement:function(t){var e=new this.Element;return e.init(this,t),e},draw:function(){},buildText:function(t){for(var e,n,r=t.element,o=this,s=o.forExport,a=p(t.textStr,"").toString(),l=-1!==a.indexOf("<"),h=r.childNodes,c=u(r,"x"),d=t.styles,g=t.textWidth,m=d&&d.lineHeight,v=d&&d.HcTextStroke,y=h.length,x=function(t){return m?i(m):o.fontMetrics(/(px|em)$/.test(t&&t.style.fontSize)?t.style.fontSize:d&&d.fontSize||o.style.fontSize||12,t).h};y--;)r.removeChild(h[y]);l||v||-1!==a.indexOf(" ")?(e=/<.*style="([^"]+)".*>/,n=/<.*href="(http[^"]+)".*>/,g&&!t.added&&this.box.appendChild(r),a=l?a.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[a],""===a[a.length-1]&&a.pop(),Ut(a,function(i,a){var l,h=0,i=i.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");l=i.split("|||"),Ut(l,function(i){if(""!==i||1===l.length){var p,m={},v=at.createElementNS(At,"tspan");if(e.test(i)&&(p=i.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),u(v,"style",p)),n.test(i)&&!s&&(u(v,"onclick",'location.href="'+i.match(n)[1]+'"'),f(v,{cursor:"pointer"})),i=(i.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">")," "!==i){if(v.appendChild(at.createTextNode(i)),h?m.dx=0:a&&null!==c&&(m.x=c),u(v,m),r.appendChild(v),!h&&a&&(!Mt&&s&&f(v,{display:"block"}Line truncated
|
e=t.length;e--;)t[e]=i(t[e])*this["stroke-width"];t=t.join(",").replace("NaN","none"),this.element.setAttribute("stroke-dasharray",t)}},alignSetter:function(t){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[t])},opacitySetter:function(t,e,i){this[e]=t,i.setAttribute(e,t)},titleSetter:function(t){var e=this.element.getElementsByTagName("title")[0];e||(e=at.createElementNS(At,"title"),this.element.appendChild(e)),e.textContent=p(t,"").replace(/<[^>]*>/g,"")},textSetter:function(t){t!==this.textStr&&(delete this.bBox,this.textStr=t,this.added&&this.renderer.buildText(this))},fillSetter:function(t,e,i){"string"==typeof t?i.setAttribute(e,t):t&&this.colorGradient(t,e,i)},zIndexSetter:function(t,e,i){i.setAttribute(e,t),this[e]=t},_defaultSetter:function(t,e,i){i.setAttribute(e,t)}},E.prototype.yGetter=E.prototype.xGetter,E.prototype.translateXSetter=E.prototype.translateYSetter=E.prototype.rotationSetter=E.prototype.verticalAlignSetter=E.prototype.scaleXSetter=E.prototype.scaleYSetter=function(t,e){this[e]=t,this.doTransform=!0},E.prototype["stroke-widthSetter"]=E.prototype.strokeSetter=function(t,e,i){this[e]=t,this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],E.prototype.fillSetter.call(this,this.stroke,"stroke",i),i.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===e&&0===t&&this.hasStroke&&(i.removeAttribute("stroke"),this.hasStroke=!1)};var ae=function(){this.init.apply(this,arguments)};ae.prototype={Element:E,init:function(t,e,i,n,r){var o,s=location,n=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(n));o=n.element,t.appendChild(o),-1===t.innerHTML.indexOf("xmlns")&&u(o,"xmlns",At),this.isSVG=!0,this.box=o,this.boxWrapper=n,this.alignedObjects=[],this.url=(St||Ct)&&at.getElementsByTagName("base").length?s.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(at.createTextNode("Created with Highcharts 4.0.4")),this.defs=this.createElement("defs").add(),this.forExport=r,this.gradients={},this.cache={},this.setSize(e,i,!1);var a;St&&t.getBoundingClientRect&&(this.subPixelFix=e=function(){f(t,{left:0,top:0}),a=t.getBoundingClientRect(),f(t,{left:dt(a.left)-a.left+"px",top:dt(a.top)-a.top+"px"})},e(),Jt(lt,"resize",e))},getStyle:function(e){return this.style=t({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},e)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),D(this.gradients||{}),this.gradients=null,t&&(this.defs=t.destroy()),this.subPixelFix&&Kt(lt,"resize",this.subPixelFix),this.alignedObjects=null},createElement:function(t){var e=new this.Element;return e.init(this,t),e},draw:function(){},buildText:function(t){for(var e,n,r=t.element,o=this,s=o.forExport,a=p(t.textStr,"").toString(),l=-1!==a.indexOf("<"),h=r.childNodes,c=u(r,"x"),d=t.styles,g=t.textWidth,m=d&&d.lineHeight,v=d&&d.HcTextStroke,y=h.length,x=function(t){return m?i(m):o.fontMetrics(/(px|em)$/.test(t&&t.style.fontSize)?t.style.fontSize:d&&d.fontSize||o.style.fontSize||12,t).h};y--;)r.removeChild(h[y]);l||v||-1!==a.indexOf(" ")?(e=/<.*style="([^"]+)".*>/,n=/<.*href="(http[^"]+)".*>/,g&&!t.added&&this.box.appendChild(r),a=l?a.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[a],""===a[a.length-1]&&a.pop(),Ut(a,function(i,a){var l,h=0,i=i.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");l=i.split("|||"),Ut(l,function(i){if(""!==i||1===l.length){var p,m={},v=at.createElementNS(At,"tspan");if(e.test(i)&&(p=i.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),u(v,"style",p)),n.test(i)&&!s&&(u(v,"onclick",'location.href="'+i.match(n)[1]+'"'),f(v,{cursor:"pointer"})),i=(i.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">")," "!==i){if(v.appendChild(at.createTextNode(i)),h?m.dx=0:a&&null!==c&&(m.x=c),u(v,m),r.appendChild(v),!h&&a&&(!Mt&&s&&f(v,{display:"block"}),u(v,"dy",x(v))),g)for(var y,b,i=i.replace(/([^\^])-/g,"$1- ").split(" "),m=l.length>1||i.length>1&&"nowrap"!==d.whiteSpace,w=d.HcHeight,k=[],T=x(v),C=1;m&&(i.length||k.length);)delete t.bBox,y=t.getBBox(),b=y.width,!Mt&&o.forExport&&(b=o.measureSpanWidth(v.firstChild.data,t.styles)),y=b>g,y&&1!==i.length?(v.removeChild(v.firstChild),k.unshift(i.pop())):(i=k,k=[],i.length&&(C++,w&&C*T>w?(i=["..."],t.attr("title",t.textStr)):(v=at.createElementNS(At,"tspan"),u(v,{dy:T,x:c}),p&&u(v,"style",p),r.appendChild(v))),b>g&&(g=b)),i.length&&v.appendChild(at.createTextNode(i.join(" ").replace(/- /g,"-")));h++}}})})):r.appendChild(at.createTextNode(a))},button:function(i,n,r,o,s,a,l,h,c){var u,d,p,f,g,m,v=this.label(i,n,r,c,null,null,null,null,"button"),y=0,i={x1:0,y1:0,x2:0,y2:1}Line truncated
|
||||||
this.isLog&&(this.val2lin=a,this.lin2val=l)},setOptions:function(t){this.options=e(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],e(z[this.coll],t))},defaultLabelFormatter:function(){var t,e=this.axis,i=this.value,n=e.categories,r=this.dateTimeLabelFormat,o=z.lang.numericSymbols,s=o&&o.length,a=e.options.labels.format,e=e.isLog?i:e.tickInterval;if(a)t=b(a,this);else if(n)t=i;else if(r)t=j(r,i);else if(s&&e>=1e3)for(;s--&&t===H;)n=Math.pow(1e3,s+1),e>=n&&null!==o[s]&&(t=v(i/n,-1)+o[s]);return t===H&&(t=gt(i)>=1e4?v(i,0):v(i,-1,H,"")),t},getSeriesExtremes:function(){var t=this,e=t.chart;t.hasVisibleSeries=!1,t.dataMin=t.dataMax=t.ignoreMinPadding=t.ignoreMaxPadding=null,t.buildStacks&&t.buildStacks(),Ut(t.series,function(i){if(i.visible||!e.options.chart.ignoreHiddenSeries){var n;n=i.options.threshold;var r;t.hasVisibleSeries=!0,t.isLog&&0>=n&&(n=null),t.isXAxis?(n=i.xData,n.length&&(t.dataMin=ft(p(t.dataMin,n[0]),C(n)),t.dataMax=pt(p(t.dataMax,n[0]),S(n)))):(i.getExtremes(),r=i.dataMax,i=i.dataMin,c(i)&&c(r)&&(t.dataMin=ft(p(t.dataMin,i),i),t.dataMax=pt(p(t.dataMax,r),r)),c(n)&&(t.dataMin>=n?(t.dataMin=n,t.ignoreMinPadding=!0):t.dataMax<n&&(t.dataMax=n,t.ignoreMaxPadding=!0)))}})},translate:function(t,e,i,n,r,o){var a=1,l=0,h=n?this.oldTransA:this.transA,n=n?this.oldMin:this.min,c=this.minPixelPadding,r=(this.options.ordinal||this.isLog&&r)&&this.lin2val;return h||(h=this.transA),i&&(a*=-1,l=this.len),this.reversed&&(a*=-1,l-=a*(this.sector||this.len)),e?(t=t*a+l,t-=c,t=t/h+n,r&&(t=this.lin2val(t))):(r&&(t=this.val2lin(t)),"between"===o&&(o=.5),t=a*(t-n)*h+l+a*c+(s(o)?h*o*this.pointRange:0)),t},toPixels:function(t,e){return this.translate(t,!1,!this.horiz,null,!0)+(e?0:this.pos)},toValue:function(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(t,e,i,n,r){var o,s,a,l=this.chart,h=this.left,c=this.top,u=i&&l.oldChartHeight||l.chartHeight,d=i&&l.oldChartWidth||l.chartWidth;return o=this.transB,r=p(r,this.translate(t,null,null,i)),t=i=ct(r+o),o=s=ct(u-r-o),isNaN(r)?a=!0:this.horiz?(o=c,s=u-this.bottom,(h>t||t>h+this.width)&&(a=!0)):(t=h,i=d-this.right,(c>o||o>c+this.height)&&(a=!0)),a&&!n?null:l.renderer.crispLine(["M",t,o,"L",i,s],e||1)},getLinearTickPositions:function(t,e,i){var n,r=M(ut(e/t)*t),o=M(dt(i/t)*t),a=[];if(e===i&&s(e))return[e];for(e=r;o>=e&&(a.push(e),e=M(e+t),e!==n);)n=e;return a},getMinorTickPositions:function(){var t,e=this.options,i=this.tickPositions,n=this.minorTickInterval,r=[];if(this.isLog)for(t=i.length,e=1;t>e;e++)r=r.concat(this.getLogTickPositions(n,i[e-1],i[e],!0));else if(this.isDatetimeAxis&&"auto"===e.minorTickInterval)r=r.concat(this.getTimeTicks(this.normalizeTimeTickInterval(n),this.min,this.max,e.startOfWeek)),r[0]<this.min&&r.shift();else for(i=this.min+(i[0]-this.min)%n;i<=this.max;i+=n)r.push(i);return r},adjustForMinRange:function(){var t,e,i,n,r,o,s=this.options,a=this.min,l=this.max,h=this.dataMax-this.dataMin>=this.minRange;if(this.isXAxis&&this.minRange===H&&!this.isLog&&(c(s.min)||c(s.max)?this.minRange=null:(Ut(this.series,function(t){for(r=t.xData,i=o=t.xIncrement?1:r.length-1;i>0;i--)n=r[i]-r[i-1],(e===H||e>n)&&(e=n)}),this.minRange=ft(5*e,this.dataMax-this.dataMin))),l-a<this.minRange){var u=this.minRange;t=(u-l+a)/2,t=[a-t,p(s.min,a-t)],h&&(t[2]=this.dataMin),a=S(t),l=[a+u,p(s.max,a+u)],h&&(l[2]=this.dataMax),l=C(l),u>l-a&&(t[0]=l-u,t[1]=p(s.min,l-u),a=S(t))}this.min=a,this.max=l},setAxisTranslation:function(t){var e,i=this,r=i.max-i.min,o=i.axisPointRange||0,s=0,a=0,l=i.linkedParent,h=!!i.categories,u=i.transA;(i.isXAxis||h||o)&&(l?(s=l.minPointOffset,a=l.pointRangePadding):Ut(i.series,function(t){var l=h?1:i.isXAxis?t.pointRange:i.axisPointRange||0,u=t.options.pointPlacement,d=t.closestPointRange;l>r&&(l=0),o=pt(o,l),s=pt(s,n(u)?0:l/2),a=pt(a,"on"===u?0:l),!t.noSharedTooltip&&c(d)&&(e=c(e)?ft(e,d):d)}),l=i.ordinalSlope&&e?i.ordinalSlope/e:1,i.minPointOffset=s*=l,i.pointRangePadding=a*=l,i.pointRange=ft(o,r),i.closestPointRange=e),t&&(i.oldTransA=u),i.translationSlope=i.transA=u=i.len/(r+a||1),i.transB=i.horiz?i.left:i.bottom,i.minPixelPadding=u*s},setTickPositions:function(t){var e,i=this,n=i.chart,r=i.options,o=r.startOnTick,l=r.endOnTick,h=i.isLog,u=i.isDatetimeAxis,d=i.isXAxis,f=i.isLinked,g=i.options.tickPositioner,m=r.maxPadding,v=r.minPadding,y=r.tickInterval,x=r.minTickInterval,b=r.tickPixelInterval,T=i.categories;f?(i.linkedParent=n[i.coll][r.linkedTo],n=i.linkedParent.getExtremes(),i.min=p(n.min,n.dataMin),i.max=p(n.max,n.dataMax),r.type!==i.linkedParent.options.type&&X(11,1)):(i.min=p(i.userMin,r.min,i.dataMin),i.max=p(i.userMax,r.max,i.dataMax)),h&&(!t&&ft(i.min,p(i.dataMin,i.min))<=0&&X(10,1),i.min=M(a(i.min)),i.max=M(a(i.max))),i.range&&c(i.max)&&(i.userMin=i.min=pt(i.min,i.max-i.range),i.userMax=i.max,i.range=null),i.beforePadding&&i.beforePadding(),i.adjustForMiLine truncated
|
t.buildStacks&&t.buildStacks(),Ut(t.series,function(i){if(i.visible||!e.options.chart.ignoreHiddenSeries){var n;n=i.options.threshold;var r;t.hasVisibleSeries=!0,t.isLog&&0>=n&&(n=null),t.isXAxis?(n=i.xData,n.length&&(t.dataMin=ft(p(t.dataMin,n[0]),C(n)),t.dataMax=pt(p(t.dataMax,n[0]),S(n)))):(i.getExtremes(),r=i.dataMax,i=i.dataMin,c(i)&&c(r)&&(t.dataMin=ft(p(t.dataMin,i),i),t.dataMax=pt(p(t.dataMax,r),r)),c(n)&&(t.dataMin>=n?(t.dataMin=n,t.ignoreMinPadding=!0):t.dataMax<n&&(t.dataMax=n,t.ignoreMaxPadding=!0)))}})},translate:function(t,e,i,n,r,o){var a=1,l=0,h=n?this.oldTransA:this.transA,n=n?this.oldMin:this.min,c=this.minPixelPadding,r=(this.options.ordinal||this.isLog&&r)&&this.lin2val;return h||(h=this.transA),i&&(a*=-1,l=this.len),this.reversed&&(a*=-1,l-=a*(this.sector||this.len)),e?(t=t*a+l,t-=c,t=t/h+n,r&&(t=this.lin2val(t))):(r&&(t=this.val2lin(t)),"between"===o&&(o=.5),t=a*(t-n)*h+l+a*c+(s(o)?h*o*this.pointRange:0)),t},toPixels:function(t,e){return this.translate(t,!1,!this.horiz,null,!0)+(e?0:this.pos)},toValue:function(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(t,e,i,n,r){var o,s,a,l=this.chart,h=this.left,c=this.top,u=i&&l.oldChartHeight||l.chartHeight,d=i&&l.oldChartWidth||l.chartWidth;return o=this.transB,r=p(r,this.translate(t,null,null,i)),t=i=ct(r+o),o=s=ct(u-r-o),isNaN(r)?a=!0:this.horiz?(o=c,s=u-this.bottom,(h>t||t>h+this.width)&&(a=!0)):(t=h,i=d-this.right,(c>o||o>c+this.height)&&(a=!0)),a&&!n?null:l.renderer.crispLine(["M",t,o,"L",i,s],e||1)},getLinearTickPositions:function(t,e,i){var n,r=M(ut(e/t)*t),o=M(dt(i/t)*t),a=[];if(e===i&&s(e))return[e];for(e=r;o>=e&&(a.push(e),e=M(e+t),e!==n);)n=e;return a},getMinorTickPositions:function(){var t,e=this.options,i=this.tickPositions,n=this.minorTickInterval,r=[];if(this.isLog)for(t=i.length,e=1;t>e;e++)r=r.concat(this.getLogTickPositions(n,i[e-1],i[e],!0));else if(this.isDatetimeAxis&&"auto"===e.minorTickInterval)r=r.concat(this.getTimeTicks(this.normalizeTimeTickInterval(n),this.min,this.max,e.startOfWeek)),r[0]<this.min&&r.shift();else for(i=this.min+(i[0]-this.min)%n;i<=this.max;i+=n)r.push(i);return r},adjustForMinRange:function(){var t,e,i,n,r,o,s=this.options,a=this.min,l=this.max,h=this.dataMax-this.dataMin>=this.minRange;if(this.isXAxis&&this.minRange===H&&!this.isLog&&(c(s.min)||c(s.max)?this.minRange=null:(Ut(this.series,function(t){for(r=t.xData,i=o=t.xIncrement?1:r.length-1;i>0;i--)n=r[i]-r[i-1],(e===H||e>n)&&(e=n)}),this.minRange=ft(5*e,this.dataMax-this.dataMin))),l-a<this.minRange){var u=this.minRange;t=(u-l+a)/2,t=[a-t,p(s.min,a-t)],h&&(t[2]=this.dataMin),a=S(t),l=[a+u,p(s.max,a+u)],h&&(l[2]=this.dataMax),l=C(l),u>l-a&&(t[0]=l-u,t[1]=p(s.min,l-u),a=S(t))}this.min=a,this.max=l},setAxisTranslation:function(t){var e,i=this,r=i.max-i.min,o=i.axisPointRange||0,s=0,a=0,l=i.linkedParent,h=!!i.categories,u=i.transA;(i.isXAxis||h||o)&&(l?(s=l.minPointOffset,a=l.pointRangePadding):Ut(i.series,function(t){var l=h?1:i.isXAxis?t.pointRange:i.axisPointRange||0,u=t.options.pointPlacement,d=t.closestPointRange;l>r&&(l=0),o=pt(o,l),s=pt(s,n(u)?0:l/2),a=pt(a,"on"===u?0:l),!t.noSharedTooltip&&c(d)&&(e=c(e)?ft(e,d):d)}),l=i.ordinalSlope&&e?i.ordinalSlope/e:1,i.minPointOffset=s*=l,i.pointRangePadding=a*=l,i.pointRange=ft(o,r),i.closestPointRange=e),t&&(i.oldTransA=u),i.translationSlope=i.transA=u=i.len/(r+a||1),i.transB=i.horiz?i.left:i.bottom,i.minPixelPadding=u*s},setTickPositions:function(t){var e,i=this,n=i.chart,r=i.options,o=r.startOnTick,l=r.endOnTick,h=i.isLog,u=i.isDatetimeAxis,d=i.isXAxis,f=i.isLinked,g=i.options.tickPositioner,m=r.maxPadding,v=r.minPadding,y=r.tickInterval,x=r.minTickInterval,b=r.tickPixelInterval,T=i.categories;f?(i.linkedParent=n[i.coll][r.linkedTo],n=i.linkedParent.getExtremes(),i.min=p(n.min,n.dataMin),i.max=p(n.max,n.dataMax),r.type!==i.linkedParent.options.type&&X(11,1)):(i.min=p(i.userMin,r.min,i.dataMin),i.max=p(i.userMax,r.max,i.dataMax)),h&&(!t&&ft(i.min,p(i.dataMin,i.min))<=0&&X(10,1),i.min=M(a(i.min)),i.max=M(a(i.max))),i.range&&c(i.max)&&(i.userMin=i.min=pt(i.min,i.max-i.range),i.userMax=i.max,i.range=null),i.beforePadding&&i.beforePadding(),i.adjustForMinRange(),T||i.axisPointRange||i.usePercentage||f||!c(i.min)||!c(i.max)||!(n=i.max-i.min)||(c(r.min)||c(i.userMin)||!v||!(i.dataMin<0)&&i.ignoreMinPadding||(i.min-=n*v),c(r.max)||c(i.userMax)||!m||!(i.dataMax>0)&&i.ignoreMaxPadding||(i.max+=n*m)),s(r.floor)&&(i.min=pt(i.min,r.floor)),s(r.ceiling)&&(i.max=ft(i.max,r.ceiling)),i.min===i.max||void 0===i.min||void 0===i.max?i.tickInterval=1:f&&!y&&b===i.linkedParent.options.tickPixelInterval?i.tickInterval=i.linkedParent.tickInterval:(i.tickInterval=p(y,T?1:(i.max-i.min)*b/pt(i.len,b)),!c(y)&&i.len<b&&!this.isRadial&&!this.isLog&&!T&&o&&l&&(e=!0,i.tickInterval/=4)),d&&!t&&Ut(i.series,function(t){t.processData(i.min!==i.oldMin||i.max!==i.oldMax)}),i.setAxisTranslation(!0),i.beforeSetTickPositions&&i.beforeSetTickPositions(),i.postProcessTickInterval&&(i.tickInterLine truncated
|
||||||
fe[t.pointerId]={pageX:t.pageX,pageY:t.pageY},fe[t.pointerId].target||(fe[t.pointerId].target=t.currentTarget)})},onDocumentPointerUp:function(t){ve(t,"onContainerTouchEnd","touchend",function(t){delete fe[t.pointerId]})},batchMSEvents:function(t){t(this.chart.container,ge?"pointerdown":"MSPointerDown",this.onContainerPointerDown),t(this.chart.container,ge?"pointermove":"MSPointerMove",this.onContainerPointerMove),t(at,ge?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),x(pe.prototype,"init",function(t,e,i){t.call(this,e,i),(this.hasZoom||this.followTouchMove)&&f(e.container,{"-ms-touch-action":Bt,"touch-action":Bt})}),x(pe.prototype,"setDOMEvents",function(t){t.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(Jt)}),x(pe.prototype,"destroy",function(t){this.batchMSEvents(Kt),t.call(this)})}var ye=st.Legend=function(t,e){this.init(t,e)};ye.prototype={init:function(t,i){var n=this,r=i.itemStyle,o=p(i.padding,8),s=i.itemMarginTop||0;this.options=i,i.enabled&&(n.itemStyle=r,n.itemHiddenStyle=e(r,i.itemHiddenStyle),n.itemMarginTop=s,n.padding=o,n.initialItemX=o,n.initialItemY=o-5,n.maxItemWidth=0,n.chart=t,n.itemHeight=0,n.lastLineHeight=0,n.symbolWidth=p(i.symbolWidth,16),n.pages=[],n.render(),Jt(n.chart,"endResize",function(){n.positionCheckboxes()}))},colorizeItem:function(t,e){var i,n=this.options,r=t.legendItem,o=t.legendLine,s=t.legendSymbol,a=this.itemHiddenStyle.color,n=e?n.itemStyle.color:a,l=e?t.legendColor||t.color||"#CCC":a,a=t.options&&t.options.marker,h={fill:l};if(r&&r.css({fill:n,color:n}),o&&o.attr({stroke:l}),s){if(a&&s.isMarker)for(i in h.stroke=l,a=t.convertAttribs(a))r=a[i],r!==H&&(h[i]=r);s.attr(h)}},positionItem:function(t){var e=this.options,i=e.symbolPadding,e=!e.rtl,n=t._legendItemPos,r=n[0],n=n[1],o=t.checkbox;t.legendGroup&&t.legendGroup.translate(e?r:this.legendWidth-r-2*i-4,n),o&&(o.x=r,o.y=n)},destroyItem:function(t){var e=t.checkbox;Ut(["legendItem","legendLine","legendSymbol","legendGroup"],function(e){t[e]&&(t[e]=t[e].destroy())}),e&&A(t.checkbox)},destroy:function(){var t=this.group,e=this.box;e&&(this.box=e.destroy()),t&&(this.group=t.destroy())},positionCheckboxes:function(t){var e,i=this.group.alignAttr,n=this.clipHeight||this.legendHeight;i&&(e=i.translateY,Ut(this.allItems,function(r){var o,s=r.checkbox;s&&(o=e+s.y+(t||0)+3,f(s,{left:i.translateX+r.checkboxOffset+s.x-20+"px",top:o+"px",display:o>e-6&&e+n-6>o?"":Bt}))}))},renderTitle:function(){var t=this.padding,e=this.options.title,i=0;e.text&&(this.title||(this.title=this.chart.renderer.label(e.text,t-3,t-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(e.style).add(this.group)),t=this.title.getBBox(),i=t.height,this.offsetWidth=t.width,this.contentGroup.attr({translateY:i})),this.titleHeight=i},renderItem:function(t){var i=this.chart,n=i.renderer,r=this.options,o="horizontal"===r.layout,s=this.symbolWidth,a=r.symbolPadding,l=this.itemStyle,h=this.itemHiddenStyle,c=this.padding,u=o?p(r.itemDistance,20):0,d=!r.rtl,f=r.width,g=r.itemMarginBottom||0,m=this.itemMarginTop,v=this.initialItemX,y=t.legendItem,x=t.series&&t.series.drawLegendSymbol?t.series:t,w=x.options,w=this.createCheckboxForItem&&w&&w.showCheckbox,k=r.useHTML;y||(t.legendGroup=n.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),t.legendItem=y=n.text(r.labelFormat?b(r.labelFormat,t):r.labelFormatter.call(t),d?s+a:-a,this.baseline||0,k).css(e(t.visible?l:h)).attr({align:d?"left":"right",zIndex:2}).add(t.legendGroup),this.baseline||(this.baseline=n.fontMetrics(l.fontSize,y).f+3+m,y.attr("y",this.baseline)),x.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,y,k,l,h),this.colorizeItem(t,t.visible),w&&this.createCheckboxForItem(t)),n=y.getBBox(),s=t.checkboxOffset=r.itemWidth||t.legendItemWidth||s+a+n.width+u+(w?20:0),this.itemHeight=a=ct(t.legendItemHeight||n.height),o&&this.itemX-v+s>(f||i.chartWidth-2*c-v-r.x)&&(this.itemX=v,this.itemY+=m+this.lastLineHeight+g,this.lastLineHeight=0),this.maxItemWidth=pt(this.maxItemWidth,s),this.lastItemY=m+this.itemY+g,this.lastLineHeight=pt(a,this.lastLineHeight),t._legendItemPos=[this.itemX,this.itemY],o?this.itemX+=s:(this.itemY+=m+a+g,this.lastLineHeight=a),this.offsetWidth=f||pt((o?this.itemX-v-u:s)+c,this.offsetWidth)},getAllItems:function(){var t=[];return Ut(this.chart.series,function(e){var i=e.options;p(i.showInLegend,c(i.linkedTo)?!1:H,!0)&&(t=t.concat(e.legendItems||("point"===i.legendType?e.data:e)))}),t},render:function(){var e,i,n,r,o=this,s=o.chart,a=s.renderer,l=o.group,h=o.box,c=o.options,u=o.padding,d=c.borderWidth,p=c.backgroundColor;o.itemX=o.initialItemX,o.itemY=o.initialItemY,o.offsetWidth=0,o.lastItemY=0,l||(o.group=l=a.g("legend").attr({zIndex:7}).add(),o.contentGroup=a.g().attr({zIndex:1}).add(l),o.scrollGroup=a.g().add(o.contentGroup)),o.renderTitle(),e=o.getAllItems(),T(e,function(t,e){return(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)}),c.reversed&&e.reverse(),o.allItems=e,o.display=i=!!e.length,Ut(e,functLine truncated
|
t.call(this)})}var ye=st.Legend=function(t,e){this.init(t,e)};ye.prototype={init:function(t,i){var n=this,r=i.itemStyle,o=p(i.padding,8),s=i.itemMarginTop||0;this.options=i,i.enabled&&(n.itemStyle=r,n.itemHiddenStyle=e(r,i.itemHiddenStyle),n.itemMarginTop=s,n.padding=o,n.initialItemX=o,n.initialItemY=o-5,n.maxItemWidth=0,n.chart=t,n.itemHeight=0,n.lastLineHeight=0,n.symbolWidth=p(i.symbolWidth,16),n.pages=[],n.render(),Jt(n.chart,"endResize",function(){n.positionCheckboxes()}))},colorizeItem:function(t,e){var i,n=this.options,r=t.legendItem,o=t.legendLine,s=t.legendSymbol,a=this.itemHiddenStyle.color,n=e?n.itemStyle.color:a,l=e?t.legendColor||t.color||"#CCC":a,a=t.options&&t.options.marker,h={fill:l};if(r&&r.css({fill:n,color:n}),o&&o.attr({stroke:l}),s){if(a&&s.isMarker)for(i in h.stroke=l,a=t.convertAttribs(a))r=a[i],r!==H&&(h[i]=r);s.attr(h)}},positionItem:function(t){var e=this.options,i=e.symbolPadding,e=!e.rtl,n=t._legendItemPos,r=n[0],n=n[1],o=t.checkbox;t.legendGroup&&t.legendGroup.translate(e?r:this.legendWidth-r-2*i-4,n),o&&(o.x=r,o.y=n)},destroyItem:function(t){var e=t.checkbox;Ut(["legendItem","legendLine","legendSymbol","legendGroup"],function(e){t[e]&&(t[e]=t[e].destroy())}),e&&A(t.checkbox)},destroy:function(){var t=this.group,e=this.box;e&&(this.box=e.destroy()),t&&(this.group=t.destroy())},positionCheckboxes:function(t){var e,i=this.group.alignAttr,n=this.clipHeight||this.legendHeight;i&&(e=i.translateY,Ut(this.allItems,function(r){var o,s=r.checkbox;s&&(o=e+s.y+(t||0)+3,f(s,{left:i.translateX+r.checkboxOffset+s.x-20+"px",top:o+"px",display:o>e-6&&e+n-6>o?"":Bt}))}))},renderTitle:function(){var t=this.padding,e=this.options.title,i=0;e.text&&(this.title||(this.title=this.chart.renderer.label(e.text,t-3,t-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(e.style).add(this.group)),t=this.title.getBBox(),i=t.height,this.offsetWidth=t.width,this.contentGroup.attr({translateY:i})),this.titleHeight=i},renderItem:function(t){var i=this.chart,n=i.renderer,r=this.options,o="horizontal"===r.layout,s=this.symbolWidth,a=r.symbolPadding,l=this.itemStyle,h=this.itemHiddenStyle,c=this.padding,u=o?p(r.itemDistance,20):0,d=!r.rtl,f=r.width,g=r.itemMarginBottom||0,m=this.itemMarginTop,v=this.initialItemX,y=t.legendItem,x=t.series&&t.series.drawLegendSymbol?t.series:t,w=x.options,w=this.createCheckboxForItem&&w&&w.showCheckbox,k=r.useHTML;y||(t.legendGroup=n.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),t.legendItem=y=n.text(r.labelFormat?b(r.labelFormat,t):r.labelFormatter.call(t),d?s+a:-a,this.baseline||0,k).css(e(t.visible?l:h)).attr({align:d?"left":"right",zIndex:2}).add(t.legendGroup),this.baseline||(this.baseline=n.fontMetrics(l.fontSize,y).f+3+m,y.attr("y",this.baseline)),x.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,y,k,l,h),this.colorizeItem(t,t.visible),w&&this.createCheckboxForItem(t)),n=y.getBBox(),s=t.checkboxOffset=r.itemWidth||t.legendItemWidth||s+a+n.width+u+(w?20:0),this.itemHeight=a=ct(t.legendItemHeight||n.height),o&&this.itemX-v+s>(f||i.chartWidth-2*c-v-r.x)&&(this.itemX=v,this.itemY+=m+this.lastLineHeight+g,this.lastLineHeight=0),this.maxItemWidth=pt(this.maxItemWidth,s),this.lastItemY=m+this.itemY+g,this.lastLineHeight=pt(a,this.lastLineHeight),t._legendItemPos=[this.itemX,this.itemY],o?this.itemX+=s:(this.itemY+=m+a+g,this.lastLineHeight=a),this.offsetWidth=f||pt((o?this.itemX-v-u:s)+c,this.offsetWidth)},getAllItems:function(){var t=[];return Ut(this.chart.series,function(e){var i=e.options;p(i.showInLegend,c(i.linkedTo)?!1:H,!0)&&(t=t.concat(e.legendItems||("point"===i.legendType?e.data:e)))}),t},render:function(){var e,i,n,r,o=this,s=o.chart,a=s.renderer,l=o.group,h=o.box,c=o.options,u=o.padding,d=c.borderWidth,p=c.backgroundColor;o.itemX=o.initialItemX,o.itemY=o.initialItemY,o.offsetWidth=0,o.lastItemY=0,l||(o.group=l=a.g("legend").attr({zIndex:7}).add(),o.contentGroup=a.g().attr({zIndex:1}).add(l),o.scrollGroup=a.g().add(o.contentGroup)),o.renderTitle(),e=o.getAllItems(),T(e,function(t,e){return(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)}),c.reversed&&e.reverse(),o.allItems=e,o.display=i=!!e.length,Ut(e,function(t){o.renderItem(t)}),n=c.width||o.offsetWidth,r=o.lastItemY+o.lastLineHeight+o.titleHeight,r=o.handleOverflow(r),(d||p)&&(n+=u,r+=u,h?n>0&&r>0&&(h[h.isNew?"attr":"animate"](h.crisp({width:n,height:r})),h.isNew=!1):(o.box=h=a.rect(0,0,n,r,c.borderRadius,d||0).attr({stroke:c.borderColor,"stroke-width":d||0,fill:p||Bt}).add(l).shadow(c.shadow),h.isNew=!0),h[i?"show":"hide"]()),o.legendWidth=n,o.legendHeight=r,Ut(e,function(t){o.positionItem(t)}),i&&l.align(t({width:n,height:r},c),!0,"spacingBox"),s.isResizing||this.positionCheckboxes()},handleOverflow:function(t){var e,i,n=this,r=this.chart,o=r.renderer,s=this.options,a=s.y,a=r.spacingBox.height+("top"===s.verticalAlign?-a:a)-this.padding,l=s.maxHeight,h=this.clipRect,c=s.navigation,u=p(c.animation,!0),d=c.arrowSize||12,f=this.nav,g=this.pages,m=thisLine truncated
|
||||||
},convertAttribs:function(t,e,i,n){var r,o,s=this.pointAttrToOptions,a={},t=t||{},e=e||{},i=i||{},n=n||{};for(r in s)o=s[r],a[r]=p(t[o],e[r],i[r],n[r]);return a},getAttribs:function(){var e,i=this,n=i.options,r=ie[i.type].marker?n.marker:n,o=r.states,s=o.hover,a=i.color;e={stroke:a,fill:a};var l,h,u=i.points||[],d=[],p=i.pointAttrToOptions;h=i.hasPointSpecificOptions;var f=n.negativeColor,g=r.lineColor,m=r.fillColor;l=n.turboThreshold;var v;if(n.marker?(s.radius=s.radius||r.radius+s.radiusPlus,s.lineWidth=s.lineWidth||r.lineWidth+s.lineWidthPlus):s.color=s.color||se(s.color||a).brighten(s.brightness).get(),d[""]=i.convertAttribs(r,e),Ut(["hover","select"],function(t){d[t]=i.convertAttribs(o[t],d[""])}),i.pointAttr=d,a=u.length,!l||l>a||h)for(;a--;){if(l=u[a],(r=l.options&&l.options.marker||l.options)&&r.enabled===!1&&(r.radius=0),l.negative&&f&&(l.color=l.fillColor=f),h=n.colorByPoint||l.color,l.options)for(v in p)c(r[p[v]])&&(h=!0);h?(r=r||{},h=[],o=r.states||{},e=o.hover=o.hover||{},n.marker||(e.color=e.color||!l.options.color&&s.color||se(l.color).brighten(e.brightness||s.brightness).get()),e={color:l.color},m||(e.fillColor=l.color),g||(e.lineColor=l.color),h[""]=i.convertAttribs(t(e,r),d[""]),h.hover=i.convertAttribs(o.hover,d.hover,h[""]),h.select=i.convertAttribs(o.select,d.select,h[""])):h=d,l.pointAttr=h}},destroy:function(){var t,e,i,n,r,o=this,s=o.chart,a=/AppleWebKit\/533/.test(bt),l=o.data||[];for(Zt(o,"destroy"),Kt(o),Ut(o.axisTypes||[],function(t){(r=o[t])&&(h(r.series,o),r.isDirty=r.forceRedraw=!0)}),o.legendItem&&o.chart.legend.destroyItem(o),e=l.length;e--;)(i=l[e])&&i.destroy&&i.destroy();o.points=null,clearTimeout(o.animationTimeout),Ut("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(e){o[e]&&(t=a&&"group"===e?"hide":"destroy",o[e][t]())}),s.hoverSeries===o&&(s.hoverSeries=null),h(s.series,o);for(n in o)delete o[n]},getSegmentPath:function(t){var e=this,i=[],n=e.options.step;return Ut(t,function(r,o){var s,a=r.plotX,l=r.plotY;e.getPointSpline?i.push.apply(i,e.getPointSpline(t,r,o)):(i.push(o?"L":"M"),n&&o&&(s=t[o-1],"right"===n?i.push(s.plotX,l):"center"===n?i.push((s.plotX+a)/2,s.plotY,(s.plotX+a)/2,l):i.push(a,s.plotY)),i.push(r.plotX,r.plotY))}),i},getGraphPath:function(){var t,e=this,i=[],n=[];return Ut(e.segments,function(r){t=e.getSegmentPath(r),r.length>1?i=i.concat(t):n.push(r[0])}),e.singlePoints=n,e.graphPath=i},drawGraph:function(){var t=this,e=this.options,i=[["graph",e.lineColor||this.color]],n=e.lineWidth,r=e.dashStyle,o="square"!==e.linecap,s=this.getGraphPath(),a=e.negativeColor;a&&i.push(["graphNeg",a]),Ut(i,function(i,a){var l=i[0],h=t[l];h?(ee(h),h.animate({d:s})):n&&s.length&&(h={stroke:i[1],"stroke-width":n,fill:Bt,zIndex:1},r?h.dashstyle=r:o&&(h["stroke-linecap"]=h["stroke-linejoin"]="round"),t[l]=t.chart.renderer.path(s).attr(h).add(t.group).shadow(!a&&e.shadow))})},clipNeg:function(){var t,e=this.options,i=this.chart,n=i.renderer,r=e.negativeColor||e.negativeFillColor,o=this.graph,s=this.area,a=this.posClip,l=this.negClip;t=i.chartWidth;var h=i.chartHeight,c=pt(t,h),u=this.yAxis;r&&(o||s)&&(r=ct(u.toPixels(e.threshold||0,!0)),0>r&&(c-=r),e={x:0,y:0,width:c,height:r},c={x:0,y:r,width:c,height:c},i.inverted&&(e.height=c.y=i.plotWidth-r,n.isVML&&(e={x:i.plotWidth-r-i.plotLeft,y:0,width:t,height:h},c={x:r+i.plotLeft-t,y:0,width:i.plotLeft+r,height:t})),u.reversed?(i=c,t=e):(i=e,t=c),a?(a.animate(i),l.animate(t)):(this.posClip=a=n.clipRect(i),this.negClip=l=n.clipRect(t),o&&this.graphNeg&&(o.clip(a),this.graphNeg.clip(l)),s&&(s.clip(a),this.areaNeg.clip(l))))},invertGroups:function(){function t(){var t={width:e.yAxis.len,height:e.xAxis.len};Ut(["group","markerGroup"],function(i){e[i]&&e[i].attr(t).invert()})}var e=this,i=e.chart;e.xAxis&&(Jt(i,"resize",t),Jt(e,"destroy",function(){Kt(i,"resize",t)}),t(),e.invertGroups=t)},plotGroup:function(t,e,i,n,r){var o=this[t],s=!o;return s&&(this[t]=o=this.chart.renderer.g(e).attr({visibility:i,zIndex:n||.1}).add(r)),o[s?"attr":"animate"](this.getPlotBox()),o},getPlotBox:function(){var t=this.chart,e=this.xAxis,i=this.yAxis;return t.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:t.plotLeft,translateY:i?i.top:t.plotTop,scaleX:1,scaleY:1}},render:function(){var t,e=this,i=e.chart,n=e.options,r=(t=n.animation)&&!!e.animate&&i.renderer.isSVG&&p(t.duration,500)||0,o=e.visible?"visible":"hidden",s=n.zIndex,a=e.hasRendered,l=i.seriesGroup;t=e.plotGroup("group","series",o,s,l),e.markerGroup=e.plotGroup("markerGroup","markers",o,s,l),r&&e.animate(!0),e.getAttribs(),t.inverted=e.isCartesian?i.inverted:!1,e.drawGraph&&(e.drawGraph(),e.clipNeg()),Ut(e.points,function(t){t.redraw&&t.redraw()}),e.drawDataLabels&&e.drawDataLabels(),e.visible&&e.drawPoints(),e.drawTracker&&e.options.enableMouseTracking!==!1&&e.drawTracker(),i.inverted&&e.invertGroups(),n.clip!==!1&&!e.sharedClipKey&&!a&&t.clip(i.clipRect),r&&e.animate(),a||(r?e.animationTimeout=setTimeout(function(){e.afterAnimate()}Line truncated
|
a=u.length,!l||l>a||h)for(;a--;){if(l=u[a],(r=l.options&&l.options.marker||l.options)&&r.enabled===!1&&(r.radius=0),l.negative&&f&&(l.color=l.fillColor=f),h=n.colorByPoint||l.color,l.options)for(v in p)c(r[p[v]])&&(h=!0);h?(r=r||{},h=[],o=r.states||{},e=o.hover=o.hover||{},n.marker||(e.color=e.color||!l.options.color&&s.color||se(l.color).brighten(e.brightness||s.brightness).get()),e={color:l.color},m||(e.fillColor=l.color),g||(e.lineColor=l.color),h[""]=i.convertAttribs(t(e,r),d[""]),h.hover=i.convertAttribs(o.hover,d.hover,h[""]),h.select=i.convertAttribs(o.select,d.select,h[""])):h=d,l.pointAttr=h}},destroy:function(){var t,e,i,n,r,o=this,s=o.chart,a=/AppleWebKit\/533/.test(bt),l=o.data||[];for(Zt(o,"destroy"),Kt(o),Ut(o.axisTypes||[],function(t){(r=o[t])&&(h(r.series,o),r.isDirty=r.forceRedraw=!0)}),o.legendItem&&o.chart.legend.destroyItem(o),e=l.length;e--;)(i=l[e])&&i.destroy&&i.destroy();o.points=null,clearTimeout(o.animationTimeout),Ut("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(e){o[e]&&(t=a&&"group"===e?"hide":"destroy",o[e][t]())}),s.hoverSeries===o&&(s.hoverSeries=null),h(s.series,o);for(n in o)delete o[n]},getSegmentPath:function(t){var e=this,i=[],n=e.options.step;return Ut(t,function(r,o){var s,a=r.plotX,l=r.plotY;e.getPointSpline?i.push.apply(i,e.getPointSpline(t,r,o)):(i.push(o?"L":"M"),n&&o&&(s=t[o-1],"right"===n?i.push(s.plotX,l):"center"===n?i.push((s.plotX+a)/2,s.plotY,(s.plotX+a)/2,l):i.push(a,s.plotY)),i.push(r.plotX,r.plotY))}),i},getGraphPath:function(){var t,e=this,i=[],n=[];return Ut(e.segments,function(r){t=e.getSegmentPath(r),r.length>1?i=i.concat(t):n.push(r[0])}),e.singlePoints=n,e.graphPath=i},drawGraph:function(){var t=this,e=this.options,i=[["graph",e.lineColor||this.color]],n=e.lineWidth,r=e.dashStyle,o="square"!==e.linecap,s=this.getGraphPath(),a=e.negativeColor;a&&i.push(["graphNeg",a]),Ut(i,function(i,a){var l=i[0],h=t[l];h?(ee(h),h.animate({d:s})):n&&s.length&&(h={stroke:i[1],"stroke-width":n,fill:Bt,zIndex:1},r?h.dashstyle=r:o&&(h["stroke-linecap"]=h["stroke-linejoin"]="round"),t[l]=t.chart.renderer.path(s).attr(h).add(t.group).shadow(!a&&e.shadow))})},clipNeg:function(){var t,e=this.options,i=this.chart,n=i.renderer,r=e.negativeColor||e.negativeFillColor,o=this.graph,s=this.area,a=this.posClip,l=this.negClip;t=i.chartWidth;var h=i.chartHeight,c=pt(t,h),u=this.yAxis;r&&(o||s)&&(r=ct(u.toPixels(e.threshold||0,!0)),0>r&&(c-=r),e={x:0,y:0,width:c,height:r},c={x:0,y:r,width:c,height:c},i.inverted&&(e.height=c.y=i.plotWidth-r,n.isVML&&(e={x:i.plotWidth-r-i.plotLeft,y:0,width:t,height:h},c={x:r+i.plotLeft-t,y:0,width:i.plotLeft+r,height:t})),u.reversed?(i=c,t=e):(i=e,t=c),a?(a.animate(i),l.animate(t)):(this.posClip=a=n.clipRect(i),this.negClip=l=n.clipRect(t),o&&this.graphNeg&&(o.clip(a),this.graphNeg.clip(l)),s&&(s.clip(a),this.areaNeg.clip(l))))},invertGroups:function(){function t(){var t={width:e.yAxis.len,height:e.xAxis.len};Ut(["group","markerGroup"],function(i){e[i]&&e[i].attr(t).invert()})}var e=this,i=e.chart;e.xAxis&&(Jt(i,"resize",t),Jt(e,"destroy",function(){Kt(i,"resize",t)}),t(),e.invertGroups=t)},plotGroup:function(t,e,i,n,r){var o=this[t],s=!o;return s&&(this[t]=o=this.chart.renderer.g(e).attr({visibility:i,zIndex:n||.1}).add(r)),o[s?"attr":"animate"](this.getPlotBox()),o},getPlotBox:function(){var t=this.chart,e=this.xAxis,i=this.yAxis;return t.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:t.plotLeft,translateY:i?i.top:t.plotTop,scaleX:1,scaleY:1}},render:function(){var t,e=this,i=e.chart,n=e.options,r=(t=n.animation)&&!!e.animate&&i.renderer.isSVG&&p(t.duration,500)||0,o=e.visible?"visible":"hidden",s=n.zIndex,a=e.hasRendered,l=i.seriesGroup;t=e.plotGroup("group","series",o,s,l),e.markerGroup=e.plotGroup("markerGroup","markers",o,s,l),r&&e.animate(!0),e.getAttribs(),t.inverted=e.isCartesian?i.inverted:!1,e.drawGraph&&(e.drawGraph(),e.clipNeg()),Ut(e.points,function(t){t.redraw&&t.redraw()}),e.drawDataLabels&&e.drawDataLabels(),e.visible&&e.drawPoints(),e.drawTracker&&e.options.enableMouseTracking!==!1&&e.drawTracker(),i.inverted&&e.invertGroups(),n.clip!==!1&&!e.sharedClipKey&&!a&&t.clip(i.clipRect),r&&e.animate(),a||(r?e.animationTimeout=setTimeout(function(){e.afterAnimate()},r):e.afterAnimate()),e.isDirty=e.isDirtyData=!1,e.hasRendered=!0},redraw:function(){var t=this.chart,e=this.isDirtyData,i=this.group,n=this.xAxis,r=this.yAxis;i&&(t.inverted&&i.attr({width:t.plotWidth,height:t.plotHeight}),i.animate({translateX:p(n&&n.left,t.plotLeft),translateY:p(r&&r.top,t.plotTop)})),this.translate(),this.setTooltipPoints&&this.setTooltipPoints(!0),this.render(),e&&Zt(this,"updatedData")}},I.prototype={destroy:function(){D(this,this.axis)},render:function(t){var e=this.options,i=e.format,i=i?b(i,this):e.formatter.call(this);this.label?this.label.attr({text:i,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(i,null,null,e.useHTML).css(e.style).attr({align:this.textAlign,rotation:e.rotLine truncated
|
||||||
n.options.data[Xt(t,n.data)]=t.options,t.setState(""),t.firePointEvent("unselect"))})})},onMouseOver:function(t){var e=this.series,i=e.chart,n=i.tooltip,r=i.hoverPoint;r&&r!==this&&r.onMouseOut(),this.firePointEvent("mouseOver"),n&&(!n.shared||e.noSharedTooltip)&&n.refresh(this,t),this.setState("hover"),i.hoverPoint=this},onMouseOut:function(){var t=this.series.chart,e=t.hoverPoints;this.firePointEvent("mouseOut"),e&&-1!==Xt(this,e)||(this.setState(),t.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var t,i=e(this.series.options.point,this.options).events;this.events=i;for(t in i)Jt(this,t,i[t]);this.hasImportedEvents=!0}},setState:function(i,n){var r,o=this.plotX,s=this.plotY,a=this.series,l=a.options.states,h=ie[a.type].marker&&a.options.marker,c=h&&!h.enabled,u=h&&h.states[i],d=u&&u.enabled===!1,p=a.stateMarkerGraphic,f=this.marker||{},g=a.chart,m=a.halo,i=i||"";r=this.pointAttr[i]||a.pointAttr[i],i===this.state&&!n||this.selected&&"select"!==i||l[i]&&l[i].enabled===!1||i&&(d||c&&u.enabled===!1)||i&&f.states&&f.states[i]&&f.states[i].enabled===!1||(this.graphic?(h=h&&this.graphic.symbolName&&r.r,this.graphic.attr(e(r,h?{x:o-h,y:s-h,width:2*h,height:2*h}:{})),p&&p.hide()):(i&&u&&(h=u.radius,f=f.symbol||a.symbol,p&&p.currentSymbol!==f&&(p=p.destroy()),p?p[n?"animate":"attr"]({x:o-h,y:s-h}):f&&(a.stateMarkerGraphic=p=g.renderer.symbol(f,o-h,s-h,2*h,2*h).attr(r).add(a.markerGroup),p.currentSymbol=f)),p&&p[i&&g.isInsidePlot(o,s,g.inverted)?"show":"hide"]()),(o=l[i]&&l[i].halo)&&o.size?(m||(a.halo=m=g.renderer.path().add(a.seriesGroup)),m.attr(t({fill:se(this.color||a.color).setOpacity(o.opacity).get()},o.attributes))[n?"animate":"attr"]({d:this.haloPath(o.size)})):m&&m.attr({d:[]}),this.state=i)},haloPath:function(t){var e=this.series,i=e.chart,n=e.getPlotBox(),r=i.inverted;return i.renderer.symbols.circle(n.translateX+(r?e.yAxis.len-this.plotY:this.plotX)-t,n.translateY+(r?e.xAxis.len-this.plotX:this.plotY)-t,2*t,2*t)}}),t(be.prototype,{onMouseOver:function(){var t=this.chart,e=t.hoverSeries;e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&Zt(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this},onMouseOut:function(){var t=this.options,e=this.chart,i=e.tooltip,n=e.hoverPoint;n&&n.onMouseOut(),this&&t.events.mouseOut&&Zt(this,"mouseOut"),i&&!t.stickyTracking&&(!i.shared||this.noSharedTooltip)&&i.hide(),this.setState(),e.hoverSeries=null},setState:function(t){var e=this.options,i=this.graph,n=this.graphNeg,r=e.states,e=e.lineWidth,t=t||"";this.state!==t&&(this.state=t,r[t]&&r[t].enabled===!1||(t&&(e=r[t].lineWidth||e+(r[t].lineWidthPlus||0)),i&&!i.dashstyle&&(t={"stroke-width":e},i.attr(t),n&&n.attr(t))))},setVisible:function(t,e){var i,n=this,r=n.chart,o=n.legendItem,s=r.options.chart.ignoreHiddenSeries,a=n.visible;i=(n.visible=t=n.userOptions.visible=t===H?!a:t)?"show":"hide",Ut(["group","dataLabelsGroup","markerGroup","tracker"],function(t){n[t]&&n[t][i]()}),r.hoverSeries===n&&n.onMouseOut(),o&&r.legend.colorizeItem(n,t),n.isDirty=!0,n.options.stacking&&Ut(r.series,function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)}),Ut(n.linkedSeries,function(e){e.setVisible(t,!1)}),s&&(r.isDirtyBox=!0),e!==!1&&r.redraw(),Zt(n,i)},setTooltipPoints:function(t){var e,i,n,r,o=[],s=this.xAxis,a=s&&s.getExtremes(),l=s?s.tooltipLen||s.len:this.chart.plotSizeX,h=[];if(this.options.enableMouseTracking!==!1&&!this.singularTooltips){for(t&&(this.tooltipPoints=null),Ut(this.segments||this.points,function(t){o=o.concat(t)}),s&&s.reversed&&(o=o.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(o),t=o.length,r=0;t>r;r++)if(s=o[r],e=s.x,e>=a.min&&e<=a.max)for(n=o[r+1],e=i===H?0:i+1,i=o[r+1]?ft(pt(0,ut((s.clientX+(n?n.wrappedClientX||n.clientX:l))/2)),l):l;e>=0&&i>=e;)h[e++]=s;this.tooltipPoints=h}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(t){this.selected=t=t===H?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),Zt(this,t?"select":"unselect")},drawTracker:jt.drawTrackerGraph}),t(st,{Axis:N,Chart:O,Color:se,Point:xe,Tick:_,Renderer:B,Series:be,SVGElement:E,SVGRenderer:ae,arrayMin:C,arrayMax:S,charts:Ot,dateFormat:j,format:b,pathAnim:$,getOptions:function(){return z},hasBidiBug:Lt,isTouchDevice:Dt,numberFormat:v,seriesTypes:zt,setOptions:function(t){return z=e(!0,z,t),P(),z},addEvent:Jt,removeEvent:Kt,createElement:g,discardElement:A,css:f,each:Ut,extend:t,map:Vt,merge:e,pick:p,splat:d,extendClass:m,pInt:i,wrap:x,svg:Mt,canvas:Pt,vml:!Mt&&!Pt,product:"Highcharts",version:"4.0.4"})}(),function(){var t=this,e=t._,i=Array.prototype,n=Object.prototype,r=Function.prototype,o=i.push,s=i.slice,a=i.concat,l=n.toString,h=n.hasOwnProperty,c=Array.isArray,u=Object.keys,d=r.bind,p=function(t){return t instanceof p?t:this instanceof p?void(this._wrapped=t):new p(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=p),exports._=p):t._=p,p.VERSION="1.7.0";var f=function(t,e,i){if(void 0===e)retuLine truncated
|
r=this.pointAttr[i]||a.pointAttr[i],i===this.state&&!n||this.selected&&"select"!==i||l[i]&&l[i].enabled===!1||i&&(d||c&&u.enabled===!1)||i&&f.states&&f.states[i]&&f.states[i].enabled===!1||(this.graphic?(h=h&&this.graphic.symbolName&&r.r,this.graphic.attr(e(r,h?{x:o-h,y:s-h,width:2*h,height:2*h}:{})),p&&p.hide()):(i&&u&&(h=u.radius,f=f.symbol||a.symbol,p&&p.currentSymbol!==f&&(p=p.destroy()),p?p[n?"animate":"attr"]({x:o-h,y:s-h}):f&&(a.stateMarkerGraphic=p=g.renderer.symbol(f,o-h,s-h,2*h,2*h).attr(r).add(a.markerGroup),p.currentSymbol=f)),p&&p[i&&g.isInsidePlot(o,s,g.inverted)?"show":"hide"]()),(o=l[i]&&l[i].halo)&&o.size?(m||(a.halo=m=g.renderer.path().add(a.seriesGroup)),m.attr(t({fill:se(this.color||a.color).setOpacity(o.opacity).get()},o.attributes))[n?"animate":"attr"]({d:this.haloPath(o.size)})):m&&m.attr({d:[]}),this.state=i)},haloPath:function(t){var e=this.series,i=e.chart,n=e.getPlotBox(),r=i.inverted;return i.renderer.symbols.circle(n.translateX+(r?e.yAxis.len-this.plotY:this.plotX)-t,n.translateY+(r?e.xAxis.len-this.plotX:this.plotY)-t,2*t,2*t)}}),t(be.prototype,{onMouseOver:function(){var t=this.chart,e=t.hoverSeries;e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&Zt(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this},onMouseOut:function(){var t=this.options,e=this.chart,i=e.tooltip,n=e.hoverPoint;n&&n.onMouseOut(),this&&t.events.mouseOut&&Zt(this,"mouseOut"),i&&!t.stickyTracking&&(!i.shared||this.noSharedTooltip)&&i.hide(),this.setState(),e.hoverSeries=null},setState:function(t){var e=this.options,i=this.graph,n=this.graphNeg,r=e.states,e=e.lineWidth,t=t||"";this.state!==t&&(this.state=t,r[t]&&r[t].enabled===!1||(t&&(e=r[t].lineWidth||e+(r[t].lineWidthPlus||0)),i&&!i.dashstyle&&(t={"stroke-width":e},i.attr(t),n&&n.attr(t))))},setVisible:function(t,e){var i,n=this,r=n.chart,o=n.legendItem,s=r.options.chart.ignoreHiddenSeries,a=n.visible;i=(n.visible=t=n.userOptions.visible=t===H?!a:t)?"show":"hide",Ut(["group","dataLabelsGroup","markerGroup","tracker"],function(t){n[t]&&n[t][i]()}),r.hoverSeries===n&&n.onMouseOut(),o&&r.legend.colorizeItem(n,t),n.isDirty=!0,n.options.stacking&&Ut(r.series,function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)}),Ut(n.linkedSeries,function(e){e.setVisible(t,!1)}),s&&(r.isDirtyBox=!0),e!==!1&&r.redraw(),Zt(n,i)},setTooltipPoints:function(t){var e,i,n,r,o=[],s=this.xAxis,a=s&&s.getExtremes(),l=s?s.tooltipLen||s.len:this.chart.plotSizeX,h=[];if(this.options.enableMouseTracking!==!1&&!this.singularTooltips){for(t&&(this.tooltipPoints=null),Ut(this.segments||this.points,function(t){o=o.concat(t)}),s&&s.reversed&&(o=o.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(o),t=o.length,r=0;t>r;r++)if(s=o[r],e=s.x,e>=a.min&&e<=a.max)for(n=o[r+1],e=i===H?0:i+1,i=o[r+1]?ft(pt(0,ut((s.clientX+(n?n.wrappedClientX||n.clientX:l))/2)),l):l;e>=0&&i>=e;)h[e++]=s;this.tooltipPoints=h}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(t){this.selected=t=t===H?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),Zt(this,t?"select":"unselect")},drawTracker:jt.drawTrackerGraph}),t(st,{Axis:N,Chart:O,Color:se,Point:xe,Tick:_,Renderer:B,Series:be,SVGElement:E,SVGRenderer:ae,arrayMin:C,arrayMax:S,charts:Ot,dateFormat:j,format:b,pathAnim:$,getOptions:function(){return z},hasBidiBug:Lt,isTouchDevice:Dt,numberFormat:v,seriesTypes:zt,setOptions:function(t){return z=e(!0,z,t),P(),z},addEvent:Jt,removeEvent:Kt,createElement:g,discardElement:A,css:f,each:Ut,extend:t,map:Vt,merge:e,pick:p,splat:d,extendClass:m,pInt:i,wrap:x,svg:Mt,canvas:Pt,vml:!Mt&&!Pt,product:"Highcharts",version:"4.0.4"})}(),function(){var t=this,e=t._,i=Array.prototype,n=Object.prototype,r=Function.prototype,o=i.push,s=i.slice,a=i.concat,l=n.toString,h=n.hasOwnProperty,c=Array.isArray,u=Object.keys,d=r.bind,p=function(t){return t instanceof p?t:this instanceof p?void(this._wrapped=t):new p(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=p),exports._=p):t._=p,p.VERSION="1.7.0";var f=function(t,e,i){if(void 0===e)return t;switch(null==i?3:i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)};case 4:return function(i,n,r,o){return t.call(e,i,n,r,o)}}return function(){return t.apply(e,arguments)}};p.iteratee=function(t,e,i){return null==t?p.identity:p.isFunction(t)?f(t,e,i):p.isObject(t)?p.matches(t):p.property(t)},p.each=p.forEach=function(t,e,i){if(null==t)return t;e=f(e,i);var n,r=t.length;if(r===+r)for(n=0;r>n;n++)e(t[n],n,t);else{var o=p.keys(t);for(n=0,r=o.length;r>n;n++)e(t[o[n]],o[n],t)}return t},p.map=p.collect=function(t,e,i){if(null==t)return[];e=p.iteratee(e,i);for(var n,r=t.length!==+t.length&&p.keys(t),o=(r||t).length,s=Array(o),a=0;o>a;a++)n=r?r[a]:a,s[a]=e(t[n],n,t);return s};var g="Reduce of empty array with no initial value";p.reduce=p.foldl=p.inject=function(t,e,i,n){null==t&&(t=[]),e=fLine truncated
|
||||||
Vendored
+1
-1
@@ -29,7 +29,7 @@ importScripts("/static/dist/sw/sw-toolbox.js","/static/dist/sw/sw-toolbox-config
|
|||||||
|
|
||||||
|
|
||||||
/* eslint-disable quotes, comma-spacing */
|
/* eslint-disable quotes, comma-spacing */
|
||||||
var PrecacheConfig = [["/static/dist/images/edb_brick.png","a749f9537bf3e20403474fcadbf5a0ab"],["/static/dist/images/glyphicons-halflings-white.png","9bbc6e9602998a385c2ea13df56470fd"],["/static/dist/images/glyphicons-halflings.png","180b8ed9ed811c62d74be57249bcb023"],["/static/dist/images/grid.png","f0fc02ae7a6a36a27a25070ea6e1be99"],["/static/dist/images/product.png","5f928b37e652601f70b8218c1203c24d"],["/static/dist/images/unknown_person.png","d8fdf8972e28cbdc12bbdb0faa9c6180"],["/static/dist/js/app.min.js","acc5db4310842091756ce6c37be38c65"],["/static/dist/styles/screen.css","b1cc772ad82605c90a52bb0bfe7b53b2"]];
|
var PrecacheConfig = [["/static/dist/images/edb_brick.png","a749f9537bf3e20403474fcadbf5a0ab"],["/static/dist/images/glyphicons-halflings-white.png","9bbc6e9602998a385c2ea13df56470fd"],["/static/dist/images/glyphicons-halflings.png","180b8ed9ed811c62d74be57249bcb023"],["/static/dist/images/grid.png","f0fc02ae7a6a36a27a25070ea6e1be99"],["/static/dist/images/product.png","5f928b37e652601f70b8218c1203c24d"],["/static/dist/images/unknown_person.png","d8fdf8972e28cbdc12bbdb0faa9c6180"],["/static/dist/js/app.min.js","c2413f712d1c916ff9df7f3eba30ceb6"],["/static/dist/styles/screen.css","7109e9dfa53c059aef435cdc223a7b57"]];
|
||||||
/* eslint-enable quotes, comma-spacing */
|
/* eslint-enable quotes, comma-spacing */
|
||||||
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';
|
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
@charset "UTF-8";html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}samp{font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href)")"}abbr[title]:after{content:" (" attr(title)")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url("/static/dist/fonts/glyphicons-halflings-regular.eot");src:url("/static/dist/fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"),url("/static/dist/fonts/glyphicons-halflings-regular.woff") format("woff"),url("/static/dist/fonts/glyphicons-halflings-regular.ttf") format("truetype"),url("/static/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{contLine truncated
|
@charset "UTF-8";html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}samp{font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href)")"}abbr[title]:after{content:" (" attr(title)")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url("/static/dist/fonts/glyphicons-halflings-regular.eot");src:url("/static/dist/fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"),url("/static/dist/fonts/glyphicons-halflings-regular.woff") format("woff"),url("/static/dist/fonts/glyphicons-halflings-regular.ttf") format("truetype"),url("/static/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{contLine truncated
|
||||||
+17
-12
@@ -8,6 +8,17 @@ var runSequence = require('run-sequence').use(gulp);
|
|||||||
var browserSync = require('browser-sync').create();
|
var browserSync = require('browser-sync').create();
|
||||||
var reload = browserSync.reload;
|
var reload = browserSync.reload;
|
||||||
|
|
||||||
|
var vendorSources = [
|
||||||
|
'bower_components/jquery/dist/jquery.min.js',
|
||||||
|
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/collapse.js',
|
||||||
|
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/dropdown.js',
|
||||||
|
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tooltip.js',
|
||||||
|
'bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js',
|
||||||
|
'bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.nb.js',
|
||||||
|
'bower_components/highcharts/highcharts.js',
|
||||||
|
'bower_components/underscore/underscore-min.js'
|
||||||
|
];
|
||||||
|
|
||||||
gulp.task('styles', function () {
|
gulp.task('styles', function () {
|
||||||
return gulp.src('app/styles/*.scss')
|
return gulp.src('app/styles/*.scss')
|
||||||
.pipe($.sass({
|
.pipe($.sass({
|
||||||
@@ -18,10 +29,14 @@ gulp.task('styles', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('scripts', function () {
|
gulp.task('scripts', function () {
|
||||||
return gulp.src('app/js/**/*.js')
|
var myAppScripts = ['app/js/**/*.js'];
|
||||||
|
var myFilter = $.filter(myAppScripts, {restore: true});
|
||||||
|
return gulp.src(vendorSources.concat(myAppScripts))
|
||||||
|
.pipe(myFilter)
|
||||||
.pipe($.jshint())
|
.pipe($.jshint())
|
||||||
.pipe($.jshint.reporter(require('jshint-stylish')))
|
.pipe($.jshint.reporter(require('jshint-stylish')))
|
||||||
.pipe($.concat('app.js'))
|
.pipe(myFilter.restore)
|
||||||
|
.pipe($.concat('app.min.js'))
|
||||||
.pipe(gulp.dest('dist/js'))
|
.pipe(gulp.dest('dist/js'))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -40,16 +55,6 @@ gulp.task('diststyles', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('distscripts', function () {
|
gulp.task('distscripts', function () {
|
||||||
var vendorSources = [
|
|
||||||
'bower_components/jquery/dist/jquery.min.js',
|
|
||||||
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/collapse.js',
|
|
||||||
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/dropdown.js',
|
|
||||||
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tooltip.js',
|
|
||||||
'bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js',
|
|
||||||
'bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.nb.js',
|
|
||||||
'bower_components/highcharts/highcharts.js',
|
|
||||||
'bower_components/underscore/underscore-min.js'
|
|
||||||
];
|
|
||||||
return gulp.src(vendorSources.concat(['app/js/**/*.js']))
|
return gulp.src(vendorSources.concat(['app/js/**/*.js']))
|
||||||
.pipe($.concat('app.min.js'))
|
.pipe($.concat('app.min.js'))
|
||||||
.pipe($.uglify())
|
.pipe($.uglify())
|
||||||
|
|||||||
+6
-6
@@ -38,11 +38,11 @@
|
|||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="{{ user.profile.profile_image_url }}" /><span class="name">{{ user.first_name }}</span> <b class="caret"></b></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="{{ user.profile.profile_image_url }}" /><span class="name">{{ user.first_name }}</span> <b class="caret"></b></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
{% if request.user.is_authenticated %}<li class="{% block active_profile %}{% endblock %}"><a href="{% url 'profile' %}"><i class="glyphicon glyphicon-user"></i> Profil</a></li>{% endif %}
|
{% if user.is_authenticated %}<li class="{% block active_profile %}{% endblock %}"><a href="{% url 'profile' %}"><i class="glyphicon glyphicon-user"></i> Profil</a></li>{% endif %}
|
||||||
<li class="{% block active_create_user %}{% endblock %}"><a href="{% url 'create-user' %}"><i class="glyphicon glyphicon-plus"></i> Ny bruker</a></li>
|
<li class="{% block active_create_user %}{% endblock %}"><a href="{% url 'create-user' %}"><i class="glyphicon glyphicon-plus"></i> Ny bruker</a></li>
|
||||||
{% if request.user.is_superuser %}<li><a href="/admin"><i class="glyphicon glyphicon-cog"></i> Administrasjon</a></li>{% endif %}
|
{% if user.is_superuser %}<li><a href="/admin"><i class="glyphicon glyphicon-cog"></i> Administrasjon</a></li>{% endif %}
|
||||||
{% if request.user.is_superuser %}<li class="{% block active_inventory %}{% endblock %}"><a href="{% url 'inventory' %}"><i class="glyphicon glyphicon-briefcase"></i> Varebeholdning</a></li>{% endif %}
|
{% if user.is_superuser %}<li class="{% block active_inventory %}{% endblock %}"><a href="{% url 'inventory' %}"><i class="glyphicon glyphicon-briefcase"></i> Varebeholdning</a></li>{% endif %}
|
||||||
{% if request.user.is_superuser %}<li class="{% block active_report %}{% endblock %}"><a href="{% url 'report' %}"><i class="glyphicon glyphicon-briefcase"></i> Rapport</a></li>{% endif %}
|
{% if user.is_superuser %}<li class="{% block active_report %}{% endblock %}"><a href="{% url 'report' %}"><i class="glyphicon glyphicon-briefcase"></i> Rapport</a></li>{% endif %}
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li><a href="{% url 'logout' %}"><i class="glyphicon glyphicon-log-out"></i> Logg ut</a></li>
|
<li><a href="{% url 'logout' %}"><i class="glyphicon glyphicon-log-out"></i> Logg ut</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="{% static "dist/js/app.min.js" %}"></script>
|
<script type="text/javascript" src="{% static "dist/js/app.min.js" %}"></script>
|
||||||
<script>
|
<!--<script>
|
||||||
if('serviceWorker' in navigator) {
|
if('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.register('/service-worker.js', { scope: '/' })
|
navigator.serviceWorker.register('/service-worker.js', { scope: '/' })
|
||||||
.then(function(registration) {
|
.then(function(registration) {
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
console.log("Service Worker Ready");
|
console.log("Service Worker Ready");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>-->
|
||||||
{% block tailinc %}{% endblock %}
|
{% block tailinc %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
{% block active_profile %}active{% endblock %}
|
{% block active_profile %}active{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section id="user-profile" data-user-id="{{request.user.pk}}">
|
<section id="user-profile" data-user-id="{{user.pk}}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h1 class="profile-name"><img src="{{ request.user.profile.profile_image_url }}" class="profile-image" /> {{user.first_name}}</h1>
|
<h1 class="profile-name"><img src="{{ user.profile.profile_image_url }}" class="profile-image" /> {{user.first_name}}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Saldo</div>
|
<div class="panel-heading">Saldo</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<h2>{{request.user.profile.balance }} kr</h2>
|
<h2>{{user.profile.balance }} kr</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
|||||||
+6
-11
@@ -20,22 +20,17 @@
|
|||||||
</section>
|
</section>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</section>
|
</section>
|
||||||
<section id="order_hourly" class="row">
|
<section id="order">
|
||||||
<h2>Time for time</h2>
|
{% for group in order_groups %}
|
||||||
|
<section id="order_{{ group }}" class="row" data-group="{{ group }}">
|
||||||
|
<h2>{{ group|capfirst }}</h2>
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div id="order_hourly_chart"></div>
|
<div id="order_chart_{{ group }}"></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
{% endfor %}
|
||||||
<section id="order" class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<h2>Ordre</h2>
|
|
||||||
<div id="order_chart"></div>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
Reference in new issue
Block a user