repo_name
stringlengths 4
116
| path
stringlengths 4
379
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
voidJeff/empty-app | tutorial1.py | 591 | from ggame import App, Color, LineStyle, Sprite
from ggame import RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
red = Color(0xff0000, 1.0)
redT = Color(0xff0000, 0.5)
green = Color(0x00ff00, 1.0)
greenT = Color(0x00ff00, 0.4)
blue = Color(0x0000ff, 1.0)
blueT = Color(0x0000ff, 0.3)
black = Color(0x000000, 1.0)
thinline = LineStyle(0, black)
shape1 = CircleAsset(100, thinline, redT)
shape2 = CircleAsset(100, thinline, greenT)
shape3 = CircleAsset(100, thinline, blueT)
Sprite(shape1, (650,300))
Sprite(shape2, (575,430))
Sprite(shape3, (725,430))
myapp = App()
myapp.run() | mit |
bnorton/inbook | app/assets/javascripts/inbook/views/charts/line_view.js | 2800 | inbook.views.LineChartView = (function() {
return Backbone.View.extend({
initialize: function(options) {
_.bindAll(this, "render");
options.interval || (this.options.interval = "week");
options.color || (this.options.color = "whiteSmoke");
inbook.bus.on("data:series:" + options.type + ":ready", this.render);
if(inbook.data.series[options.type][options.interval]) {
this.render();
}
},
render: function() {
summarize(this.options.type);
var data = this.getData(),
options = this.getOptions(data, this.options.color);
new Highcharts.Chart(options);
},
getData: function() {
var type = this.options.type,
interval = this.options.interval,
data = _(inbook.data.series[type][interval]).clone(),
dates = [],
series = _(_(_(data).
keys()).
sortBy(function(key) {
return key;
})).
map(function(key) {
dates.push(I18n.l("date.formats.human", key));
return data[key];
});
return {
categories: dates,
series: series
};
},
getOptions: function(data, color) {
return {
chart: {
renderTo: this.options.type,
type: 'line',
backgroundColor: color
},
title: { text: '' },
credits: { enabled: false },
xAxis: {
categories: data.categories,
labels: { enabled: false },
tickColor: color
},
yAxis: {
title: { text: '' },
endOnTick: false,
min: 0,
max: (_(data.series).max() + 2),
tickPixelInterval: 40
},
tooltip: {
formatter: this.tooltipFormatter()
},
series: [
{ name: this.options.type, data: data.series }
],
legend: { enabled: false }
};
},
tooltipFormatter: function() {
var that = this;
return function() {
return '4 weeks ending:' +
'<br />' +
this.x +
'<br />' +
'# of ' + that.options.type + ': ' + this.y;
};
}
});
function summarize(type) {
var data = inbook.data.series[type].week,
month = {},
sum = 0,
count = 0,
currentKey = "";
_(_(_(data).
keys()).
sortBy(function(key) {
return key;
})).each(function(key) {
currentKey = key;
sum += data[currentKey];
count += 1;
if(count === 3) {
month[currentKey] = sum;
sum = count = 0;
}
});
if(currentKey && count !== 0) month[currentKey] = sum;
inbook.data.series[type].month = month;
}
}());
| mit |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/chatroom/ChatRoomMemberList.java | 1638 | package cn.jmessage.api.chatroom;
import cn.jiguang.common.resp.BaseResult;
import cn.jiguang.common.resp.ResponseWrapper;
import com.google.gson.annotations.Expose;
public class ChatRoomMemberList extends BaseResult {
@Expose private ChatRoomMember[] users;
@Expose private Integer total;
@Expose private Integer start;
@Expose private Integer count;
public static ChatRoomMemberList fromResponse(ResponseWrapper responseWrapper) {
ChatRoomMemberList result = new ChatRoomMemberList();
if (responseWrapper.isServerResponse()) {
result.users = _gson.fromJson(responseWrapper.responseContent, ChatRoomMember[].class);
} else {
// nothing
}
result.setResponseWrapper(responseWrapper);
return result;
}
public class ChatRoomMember {
@Expose String username;
@Expose Integer flag;
@Expose String room_ctime;
@Expose String mtime;
@Expose String ctime;
public String getUsername() {
return username;
}
public Integer getFlag() {
return flag;
}
public String getRoom_ctime() {
return room_ctime;
}
public String getMtime() {
return mtime;
}
public String getCtime() {
return ctime;
}
}
public ChatRoomMember[] getMembers() {
return this.users;
}
public Integer getTotal() {
return total;
}
public Integer getStart() {
return start;
}
public Integer getCount() {
return count;
}
}
| mit |
upptalk/uppsell | uppsell/migrations/0035_auto__add_field_product_validity_unit__add_field_product_validity.py | 23217 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.validity_unit'
db.add_column('products', 'validity_unit',
self.gf('django.db.models.fields.CharField')(default='forever', max_length=10),
keep_default=False)
# Adding field 'Product.validity'
db.add_column('products', 'validity',
self.gf('django.db.models.fields.IntegerField')(default=0),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Product.validity_unit'
db.delete_column('products', 'validity_unit')
# Deleting field 'Product.validity'
db.delete_column('products', 'validity')
models = {
u'uppsell.address': {
'Meta': {'object_name': 'Address', 'db_table': "'addresses'"},
'city': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'country': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'country_code': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_used': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'other': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'province': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'province_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'zip': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
},
u'uppsell.card': {
'Meta': {'object_name': 'Card'},
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
'expiry': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'holder': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last4': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}),
'network': ('django.db.models.fields.CharField', [], {'default': "'UNKNOWN'", 'max_length': '12'}),
'pan': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
'reference': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'})
},
u'uppsell.cart': {
'Meta': {'object_name': 'Cart', 'db_table': "'carts'"},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']", 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
'store': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Store']"}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
u'uppsell.cartitem': {
'Meta': {'unique_together': "(('cart', 'product'),)", 'object_name': 'CartItem', 'db_table': "'cart_items'"},
'cart': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Cart']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'product': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Listing']"}),
'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'})
},
u'uppsell.coupon': {
'Meta': {'object_name': 'Coupon', 'db_table': "'coupons'"},
'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']", 'null': 'True', 'blank': 'True'}),
'discount_amount': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '2', 'blank': 'True'}),
'discount_shipping': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'max_uses': ('django.db.models.fields.PositiveIntegerField', [], {}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'product': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Product']", 'null': 'True', 'blank': 'True'}),
'product_group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.ProductGroup']", 'null': 'True', 'blank': 'True'}),
'remaining': ('django.db.models.fields.PositiveIntegerField', [], {}),
'store': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Store']", 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'valid_from': ('django.db.models.fields.DateTimeField', [], {}),
'valid_until': ('django.db.models.fields.DateTimeField', [], {})
},
u'uppsell.couponspend': {
'Meta': {'unique_together': "(('customer', 'coupon'),)", 'object_name': 'CouponSpend', 'db_table': "'coupon_spends'"},
'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Coupon']"}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'uppsell.customer': {
'Meta': {'object_name': 'Customer', 'db_table': "'customers'"},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'db_index': 'True', 'max_length': '75', 'blank': 'True'}),
'full_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_logged_in_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '30', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'uppsell.invoice': {
'Meta': {'object_name': 'Invoice', 'db_table': "'invoices'"},
'billing_address_city': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'billing_address_country': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'billing_address_line1': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'billing_address_line2': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'billing_address_line3': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'billing_address_province': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'billing_address_zipcode': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'coupon': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'customer_id': ('django.db.models.fields.IntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'order_discount_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'order_gross_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'order_id': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
'order_shipping_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'order_state': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
'order_sub_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'order_tax_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'order_total': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
'payment_made_ts': ('django.db.models.fields.DateTimeField', [], {}),
'payment_state': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
'products': ('django.db.models.fields.CharField', [], {'max_length': '2000'}),
'shipping_address_city': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_address_country': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_address_line1': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'shipping_address_line2': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'shipping_address_line3': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
'shipping_address_province': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_address_zipcode': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'skus': ('django.db.models.fields.CharField', [], {'max_length': '2000'}),
'store_id': ('django.db.models.fields.IntegerField', [], {}),
'user_dob': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'user_document': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'user_document_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'user_email': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'user_fullname': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'user_mobile_msisdn': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'username': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'uppsell.linkedaccount': {
'Meta': {'object_name': 'LinkedAccount', 'db_table': "'linked_accounts'"},
'account_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '2000'}),
'linked_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.LinkedAccountType']"}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
u'uppsell.linkedaccounttype': {
'Meta': {'object_name': 'LinkedAccountType', 'db_table': "'linked_account_types'"},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '32'})
},
u'uppsell.listing': {
'Meta': {'object_name': 'Listing', 'db_table': "'listings'"},
'description': ('django.db.models.fields.CharField', [], {'max_length': '10000', 'null': 'True', 'blank': 'True'}),
'features': ('django.db.models.fields.CharField', [], {'max_length': '10000', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '24', 'decimal_places': '12'}),
'product': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Product']"}),
'shipping': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '24', 'decimal_places': '12'}),
'state': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'store': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Store']"}),
'subtitle': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'tax_rate': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.SalesTaxRate']"}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
},
u'uppsell.order': {
'Meta': {'object_name': 'Order', 'db_table': "'orders'"},
'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'billing_address'", 'null': 'True', 'to': u"orm['uppsell.Address']"}),
'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Coupon']", 'null': 'True', 'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
'fraud_state': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'order_state': ('django.db.models.fields.CharField', [], {'default': "'init'", 'max_length': '30'}),
'payment_made_ts': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'payment_state': ('django.db.models.fields.CharField', [], {'default': "'init'", 'max_length': '30'}),
'reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'shipping_address': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'shipping_address'", 'null': 'True', 'to': u"orm['uppsell.Address']"}),
'store': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Store']"}),
'transaction_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
u'uppsell.orderevent': {
'Meta': {'object_name': 'OrderEvent', 'db_table': "'order_events'"},
'action_type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'comment': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'event': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'order': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Order']"}),
'state_after': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'state_before': ('django.db.models.fields.CharField', [], {'max_length': '30'})
},
u'uppsell.orderitem': {
'Meta': {'object_name': 'OrderItem', 'db_table': "'order_items'"},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': u"orm['uppsell.Order']"}),
'product': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Listing']"}),
'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
},
u'uppsell.product': {
'Meta': {'object_name': 'Product', 'db_table': "'products'"},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.CharField', [], {'max_length': '10000'}),
'features': ('django.db.models.fields.CharField', [], {'max_length': '10000', 'null': 'True', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.ProductGroup']"}),
'has_stock': ('django.db.models.fields.BooleanField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'provisioning_codes': ('uppsell.models.SeparatedValuesField', [], {'max_length': '5000', 'null': 'True', 'blank': 'True'}),
'shipping': ('django.db.models.fields.BooleanField', [], {}),
'sku': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'stock_units': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
'subtitle': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'validity': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'validity_unit': ('django.db.models.fields.CharField', [], {'default': "'forever'", 'max_length': '10'})
},
u'uppsell.productgroup': {
'Meta': {'object_name': 'ProductGroup', 'db_table': "'product_groups'"},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'uppsell.profile': {
'Meta': {'object_name': 'Profile', 'db_table': "'profiles'"},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Customer']"}),
'dob': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'document': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'document_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'full_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
u'uppsell.salestaxrate': {
'Meta': {'object_name': 'SalesTaxRate'},
'abbreviation': ('django.db.models.fields.CharField', [], {'max_length': "'10'"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': "'20'"}),
'rate': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '6', 'decimal_places': '5'}),
'store': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['uppsell.Store']"})
},
u'uppsell.store': {
'Meta': {'object_name': 'Store', 'db_table': "'stores'"},
'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'default_currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'default_lang': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
}
}
complete_apps = ['uppsell'] | mit |
Akagi201/learning-openresty | lua-resty-logger-socket/src/main.lua | 528 |
local logger = require "resty.logger.socket"
if not logger.initted() then
local ok, err = logger.init {
host = 'xxx',
port = 1234,
flush_limit = 1234,
drop_limit = 5678,
}
if not ok then
ngx.log(ngx.ERR, "failed to initialize the logger: ",
err)
return
end
end
-- construct the custom access log message in
-- the Lua variable "msg"
local bytes, err = logger.log(msg)
if err then
ngx.log(ngx.ERR, "failed to log message: ", err)
return
end
| mit |
zikalino/TypeScript-IoT | services/services.js | 352725 | /// <reference path="..\compiler\program.ts"/>
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path='breakpoints.ts' />
/// <reference path='outliningElementsCollector.ts' />
/// <reference path='navigateTo.ts' />
/// <reference path='navigationBar.ts' />
/// <reference path='patternMatcher.ts' />
/// <reference path='signatureHelp.ts' />
/// <reference path='utilities.ts' />
/// <reference path='formatting\formatting.ts' />
/// <reference path='formatting\smartIndenter.ts' />
var ts;
(function (ts) {
/** The version of the language service API */
ts.servicesVersion = "0.4";
var ScriptSnapshot;
(function (ScriptSnapshot) {
var StringScriptSnapshot = (function () {
function StringScriptSnapshot(text) {
this.text = text;
}
StringScriptSnapshot.prototype.getText = function (start, end) {
return this.text.substring(start, end);
};
StringScriptSnapshot.prototype.getLength = function () {
return this.text.length;
};
StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) {
// Text-based snapshots do not support incremental parsing. Return undefined
// to signal that to the caller.
return undefined;
};
return StringScriptSnapshot;
}());
function fromString(text) {
return new StringScriptSnapshot(text);
}
ScriptSnapshot.fromString = fromString;
})(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {}));
var scanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ true);
var emptyArray = [];
var jsDocTagNames = [
"augments",
"author",
"argument",
"borrows",
"class",
"constant",
"constructor",
"constructs",
"default",
"deprecated",
"description",
"event",
"example",
"extends",
"field",
"fileOverview",
"function",
"ignore",
"inner",
"lends",
"link",
"memberOf",
"name",
"namespace",
"param",
"private",
"property",
"public",
"requires",
"returns",
"see",
"since",
"static",
"throws",
"type",
"version"
];
var jsDocCompletionEntries;
function createNode(kind, pos, end, flags, parent) {
var node = new NodeObject(kind, pos, end);
node.flags = flags;
node.parent = parent;
return node;
}
var NodeObject = (function () {
function NodeObject(kind, pos, end) {
this.kind = kind;
this.pos = pos;
this.end = end;
this.flags = 0 /* None */;
this.parent = undefined;
}
NodeObject.prototype.getSourceFile = function () {
return ts.getSourceFileOfNode(this);
};
NodeObject.prototype.getStart = function (sourceFile) {
return ts.getTokenPosOfNode(this, sourceFile);
};
NodeObject.prototype.getFullStart = function () {
return this.pos;
};
NodeObject.prototype.getEnd = function () {
return this.end;
};
NodeObject.prototype.getWidth = function (sourceFile) {
return this.getEnd() - this.getStart(sourceFile);
};
NodeObject.prototype.getFullWidth = function () {
return this.end - this.pos;
};
NodeObject.prototype.getLeadingTriviaWidth = function (sourceFile) {
return this.getStart(sourceFile) - this.pos;
};
NodeObject.prototype.getFullText = function (sourceFile) {
return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end);
};
NodeObject.prototype.getText = function (sourceFile) {
return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd());
};
NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) {
scanner.setTextPos(pos);
while (pos < end) {
var token = scanner.scan();
var textPos = scanner.getTextPos();
nodes.push(createNode(token, pos, textPos, 2048 /* Synthetic */, this));
pos = textPos;
}
return pos;
};
NodeObject.prototype.createSyntaxList = function (nodes) {
var list = createNode(274 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this);
list._children = [];
var pos = nodes.pos;
for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
var node = nodes_1[_i];
if (pos < node.pos) {
pos = this.addSyntheticNodes(list._children, pos, node.pos);
}
list._children.push(node);
pos = node.end;
}
if (pos < nodes.end) {
this.addSyntheticNodes(list._children, pos, nodes.end);
}
return list;
};
NodeObject.prototype.createChildren = function (sourceFile) {
var _this = this;
var children;
if (this.kind >= 136 /* FirstNode */) {
scanner.setText((sourceFile || this.getSourceFile()).text);
children = [];
var pos = this.pos;
var processNode = function (node) {
if (pos < node.pos) {
pos = _this.addSyntheticNodes(children, pos, node.pos);
}
children.push(node);
pos = node.end;
};
var processNodes = function (nodes) {
if (pos < nodes.pos) {
pos = _this.addSyntheticNodes(children, pos, nodes.pos);
}
children.push(_this.createSyntaxList(nodes));
pos = nodes.end;
};
ts.forEachChild(this, processNode, processNodes);
if (pos < this.end) {
this.addSyntheticNodes(children, pos, this.end);
}
scanner.setText(undefined);
}
this._children = children || emptyArray;
};
NodeObject.prototype.getChildCount = function (sourceFile) {
if (!this._children)
this.createChildren(sourceFile);
return this._children.length;
};
NodeObject.prototype.getChildAt = function (index, sourceFile) {
if (!this._children)
this.createChildren(sourceFile);
return this._children[index];
};
NodeObject.prototype.getChildren = function (sourceFile) {
if (!this._children)
this.createChildren(sourceFile);
return this._children;
};
NodeObject.prototype.getFirstToken = function (sourceFile) {
var children = this.getChildren(sourceFile);
if (!children.length) {
return undefined;
}
var child = children[0];
return child.kind < 136 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
};
NodeObject.prototype.getLastToken = function (sourceFile) {
var children = this.getChildren(sourceFile);
var child = ts.lastOrUndefined(children);
if (!child) {
return undefined;
}
return child.kind < 136 /* FirstNode */ ? child : child.getLastToken(sourceFile);
};
return NodeObject;
}());
var SymbolObject = (function () {
function SymbolObject(flags, name) {
this.flags = flags;
this.name = name;
}
SymbolObject.prototype.getFlags = function () {
return this.flags;
};
SymbolObject.prototype.getName = function () {
return this.name;
};
SymbolObject.prototype.getDeclarations = function () {
return this.declarations;
};
SymbolObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */));
}
return this.documentationComment;
};
return SymbolObject;
}());
function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) {
var documentationComment = [];
var docComments = getJsDocCommentsSeparatedByNewLines();
ts.forEach(docComments, function (docComment) {
if (documentationComment.length) {
documentationComment.push(ts.lineBreakPart());
}
documentationComment.push(docComment);
});
return documentationComment;
function getJsDocCommentsSeparatedByNewLines() {
var paramTag = "@param";
var jsDocCommentParts = [];
ts.forEach(declarations, function (declaration, indexOfDeclaration) {
// Make sure we are collecting doc comment from declaration once,
// In case of union property there might be same declaration multiple times
// which only varies in type parameter
// Eg. const a: Array<string> | Array<number>; a.length
// The property length will have two declarations of property length coming
// from Array<T> - Array<string> and Array<number>
if (ts.indexOf(declarations, declaration) === indexOfDeclaration) {
var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration);
// If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments
if (canUseParsedParamTagComments && declaration.kind === 139 /* Parameter */) {
ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) {
var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration);
if (cleanedParamJsDocComment) {
ts.addRange(jsDocCommentParts, cleanedParamJsDocComment);
}
});
}
// If this is left side of dotted module declaration, there is no doc comments associated with this node
if (declaration.kind === 221 /* ModuleDeclaration */ && declaration.body.kind === 221 /* ModuleDeclaration */) {
return;
}
// If this is dotted module name, get the doc comments from the parent
while (declaration.kind === 221 /* ModuleDeclaration */ && declaration.parent.kind === 221 /* ModuleDeclaration */) {
declaration = declaration.parent;
}
// Get the cleaned js doc comment text from the declaration
ts.forEach(getJsDocCommentTextRange(declaration.kind === 214 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) {
var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration);
if (cleanedJsDocComment) {
ts.addRange(jsDocCommentParts, cleanedJsDocComment);
}
});
}
});
return jsDocCommentParts;
function getJsDocCommentTextRange(node, sourceFile) {
return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) {
return {
pos: jsDocComment.pos + "/*".length,
end: jsDocComment.end - "*/".length // Trim off comment end indicator
};
});
}
function consumeWhiteSpacesOnTheLine(pos, end, sourceFile, maxSpacesToRemove) {
if (maxSpacesToRemove !== undefined) {
end = Math.min(end, pos + maxSpacesToRemove);
}
for (; pos < end; pos++) {
var ch = sourceFile.text.charCodeAt(pos);
if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) {
// Either found lineBreak or non whiteSpace
return pos;
}
}
return end;
}
function consumeLineBreaks(pos, end, sourceFile) {
while (pos < end && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) {
pos++;
}
return pos;
}
function isName(pos, end, sourceFile, name) {
return pos + name.length < end &&
sourceFile.text.substr(pos, name.length) === name &&
(ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) ||
ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length)));
}
function isParamTag(pos, end, sourceFile) {
// If it is @param tag
return isName(pos, end, sourceFile, paramTag);
}
function pushDocCommentLineText(docComments, text, blankLineCount) {
// Add the empty lines in between texts
while (blankLineCount) {
blankLineCount--;
docComments.push(ts.textPart(""));
}
docComments.push(ts.textPart(text));
}
function getCleanedJsDocComment(pos, end, sourceFile) {
var spacesToRemoveAfterAsterisk;
var docComments = [];
var blankLineCount = 0;
var isInParamTag = false;
while (pos < end) {
var docCommentTextOfLine = "";
// First consume leading white space
pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile);
// If the comment starts with '*' consume the spaces on this line
if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) {
var lineStartPos = pos + 1;
pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk);
// Set the spaces to remove after asterisk as margin if not already set
if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) {
spacesToRemoveAfterAsterisk = pos - lineStartPos;
}
}
else if (spacesToRemoveAfterAsterisk === undefined) {
spacesToRemoveAfterAsterisk = 0;
}
// Analyse text on this line
while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) {
var ch = sourceFile.text.charAt(pos);
if (ch === "@") {
// If it is @param tag
if (isParamTag(pos, end, sourceFile)) {
isInParamTag = true;
pos += paramTag.length;
continue;
}
else {
isInParamTag = false;
}
}
// Add the ch to doc text if we arent in param tag
if (!isInParamTag) {
docCommentTextOfLine += ch;
}
// Scan next character
pos++;
}
// Continue with next line
pos = consumeLineBreaks(pos, end, sourceFile);
if (docCommentTextOfLine) {
pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount);
blankLineCount = 0;
}
else if (!isInParamTag && docComments.length) {
// This is blank line when there is text already parsed
blankLineCount++;
}
}
return docComments;
}
function getCleanedParamJsDocComment(pos, end, sourceFile) {
var paramHelpStringMargin;
var paramDocComments = [];
while (pos < end) {
if (isParamTag(pos, end, sourceFile)) {
var blankLineCount = 0;
var recordedParamTag = false;
// Consume leading spaces
pos = consumeWhiteSpaces(pos + paramTag.length);
if (pos >= end) {
break;
}
// Ignore type expression
if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) {
pos++;
for (var curlies = 1; pos < end; pos++) {
var charCode = sourceFile.text.charCodeAt(pos);
// { character means we need to find another } to match the found one
if (charCode === 123 /* openBrace */) {
curlies++;
continue;
}
// } char
if (charCode === 125 /* closeBrace */) {
curlies--;
if (curlies === 0) {
// We do not have any more } to match the type expression is ignored completely
pos++;
break;
}
else {
// there are more { to be matched with }
continue;
}
}
// Found start of another tag
if (charCode === 64 /* at */) {
break;
}
}
// Consume white spaces
pos = consumeWhiteSpaces(pos);
if (pos >= end) {
break;
}
}
// Parameter name
if (isName(pos, end, sourceFile, name)) {
// Found the parameter we are looking for consume white spaces
pos = consumeWhiteSpaces(pos + name.length);
if (pos >= end) {
break;
}
var paramHelpString = "";
var firstLineParamHelpStringPos = pos;
while (pos < end) {
var ch = sourceFile.text.charCodeAt(pos);
// at line break, set this comment line text and go to next line
if (ts.isLineBreak(ch)) {
if (paramHelpString) {
pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount);
paramHelpString = "";
blankLineCount = 0;
recordedParamTag = true;
}
else if (recordedParamTag) {
blankLineCount++;
}
// Get the pos after cleaning start of the line
setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos);
continue;
}
// Done scanning param help string - next tag found
if (ch === 64 /* at */) {
break;
}
paramHelpString += sourceFile.text.charAt(pos);
// Go to next character
pos++;
}
// If there is param help text, add it top the doc comments
if (paramHelpString) {
pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount);
}
paramHelpStringMargin = undefined;
}
// If this is the start of another tag, continue with the loop in seach of param tag with symbol name
if (sourceFile.text.charCodeAt(pos) === 64 /* at */) {
continue;
}
}
// Next character
pos++;
}
return paramDocComments;
function consumeWhiteSpaces(pos) {
while (pos < end && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) {
pos++;
}
return pos;
}
function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) {
// Get the pos after consuming line breaks
pos = consumeLineBreaks(pos, end, sourceFile);
if (pos >= end) {
return;
}
if (paramHelpStringMargin === undefined) {
paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character;
}
// Now consume white spaces max
var startOfLinePos = pos;
pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin);
if (pos >= end) {
return;
}
var consumedSpaces = pos - startOfLinePos;
if (consumedSpaces < paramHelpStringMargin) {
var ch = sourceFile.text.charCodeAt(pos);
if (ch === 42 /* asterisk */) {
// Consume more spaces after asterisk
pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1);
}
}
}
}
}
}
var TypeObject = (function () {
function TypeObject(checker, flags) {
this.checker = checker;
this.flags = flags;
}
TypeObject.prototype.getFlags = function () {
return this.flags;
};
TypeObject.prototype.getSymbol = function () {
return this.symbol;
};
TypeObject.prototype.getProperties = function () {
return this.checker.getPropertiesOfType(this);
};
TypeObject.prototype.getProperty = function (propertyName) {
return this.checker.getPropertyOfType(this, propertyName);
};
TypeObject.prototype.getApparentProperties = function () {
return this.checker.getAugmentedPropertiesOfType(this);
};
TypeObject.prototype.getCallSignatures = function () {
return this.checker.getSignaturesOfType(this, 0 /* Call */);
};
TypeObject.prototype.getConstructSignatures = function () {
return this.checker.getSignaturesOfType(this, 1 /* Construct */);
};
TypeObject.prototype.getStringIndexType = function () {
return this.checker.getIndexTypeOfType(this, 0 /* String */);
};
TypeObject.prototype.getNumberIndexType = function () {
return this.checker.getIndexTypeOfType(this, 1 /* Number */);
};
TypeObject.prototype.getBaseTypes = function () {
return this.flags & (1024 /* Class */ | 2048 /* Interface */)
? this.checker.getBaseTypes(this)
: undefined;
};
return TypeObject;
}());
var SignatureObject = (function () {
function SignatureObject(checker) {
this.checker = checker;
}
SignatureObject.prototype.getDeclaration = function () {
return this.declaration;
};
SignatureObject.prototype.getTypeParameters = function () {
return this.typeParameters;
};
SignatureObject.prototype.getParameters = function () {
return this.parameters;
};
SignatureObject.prototype.getReturnType = function () {
return this.checker.getReturnTypeOfSignature(this);
};
SignatureObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration],
/*name*/ undefined,
/*canUseParsedParamTagComments*/ false) : [];
}
return this.documentationComment;
};
return SignatureObject;
}());
var SourceFileObject = (function (_super) {
__extends(SourceFileObject, _super);
function SourceFileObject(kind, pos, end) {
_super.call(this, kind, pos, end);
}
SourceFileObject.prototype.update = function (newText, textChangeRange) {
return ts.updateSourceFile(this, newText, textChangeRange);
};
SourceFileObject.prototype.getLineAndCharacterOfPosition = function (position) {
return ts.getLineAndCharacterOfPosition(this, position);
};
SourceFileObject.prototype.getLineStarts = function () {
return ts.getLineStarts(this);
};
SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character) {
return ts.getPositionOfLineAndCharacter(this, line, character);
};
SourceFileObject.prototype.getNamedDeclarations = function () {
if (!this.namedDeclarations) {
this.namedDeclarations = this.computeNamedDeclarations();
}
return this.namedDeclarations;
};
SourceFileObject.prototype.computeNamedDeclarations = function () {
var result = {};
ts.forEachChild(this, visit);
return result;
function addDeclaration(declaration) {
var name = getDeclarationName(declaration);
if (name) {
var declarations = getDeclarations(name);
declarations.push(declaration);
}
}
function getDeclarations(name) {
return ts.getProperty(result, name) || (result[name] = []);
}
function getDeclarationName(declaration) {
if (declaration.name) {
var result_1 = getTextOfIdentifierOrLiteral(declaration.name);
if (result_1 !== undefined) {
return result_1;
}
if (declaration.name.kind === 137 /* ComputedPropertyName */) {
var expr = declaration.name.expression;
if (expr.kind === 169 /* PropertyAccessExpression */) {
return expr.name.text;
}
return getTextOfIdentifierOrLiteral(expr);
}
}
return undefined;
}
function getTextOfIdentifierOrLiteral(node) {
if (node) {
if (node.kind === 69 /* Identifier */ ||
node.kind === 9 /* StringLiteral */ ||
node.kind === 8 /* NumericLiteral */) {
return node.text;
}
}
return undefined;
}
function visit(node) {
switch (node.kind) {
case 216 /* FunctionDeclaration */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
var functionDeclaration = node;
var declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
var declarations = getDeclarations(declarationName);
var lastDeclaration = ts.lastOrUndefined(declarations);
// Check whether this declaration belongs to an "overload group".
if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
// Overwrite the last declaration if it was an overload
// and this one is an implementation.
if (functionDeclaration.body && !lastDeclaration.body) {
declarations[declarations.length - 1] = functionDeclaration;
}
}
else {
declarations.push(functionDeclaration);
}
ts.forEachChild(node, visit);
}
break;
case 217 /* ClassDeclaration */:
case 218 /* InterfaceDeclaration */:
case 219 /* TypeAliasDeclaration */:
case 220 /* EnumDeclaration */:
case 221 /* ModuleDeclaration */:
case 224 /* ImportEqualsDeclaration */:
case 233 /* ExportSpecifier */:
case 229 /* ImportSpecifier */:
case 224 /* ImportEqualsDeclaration */:
case 226 /* ImportClause */:
case 227 /* NamespaceImport */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
case 156 /* TypeLiteral */:
addDeclaration(node);
// fall through
case 145 /* Constructor */:
case 196 /* VariableStatement */:
case 215 /* VariableDeclarationList */:
case 164 /* ObjectBindingPattern */:
case 165 /* ArrayBindingPattern */:
case 222 /* ModuleBlock */:
ts.forEachChild(node, visit);
break;
case 195 /* Block */:
if (ts.isFunctionBlock(node)) {
ts.forEachChild(node, visit);
}
break;
case 139 /* Parameter */:
// Only consider properties defined as constructor parameters
if (!(node.flags & 56 /* AccessibilityModifier */)) {
break;
}
// fall through
case 214 /* VariableDeclaration */:
case 166 /* BindingElement */:
if (ts.isBindingPattern(node.name)) {
ts.forEachChild(node.name, visit);
break;
}
case 250 /* EnumMember */:
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
addDeclaration(node);
break;
case 231 /* ExportDeclaration */:
// Handle named exports case e.g.:
// export {a, b as B} from "mod";
if (node.exportClause) {
ts.forEach(node.exportClause.elements, visit);
}
break;
case 225 /* ImportDeclaration */:
var importClause = node.importClause;
if (importClause) {
// Handle default import case e.g.:
// import d from "mod";
if (importClause.name) {
addDeclaration(importClause);
}
// Handle named bindings in imports e.g.:
// import * as NS from "mod";
// import {a, b as B} from "mod";
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === 227 /* NamespaceImport */) {
addDeclaration(importClause.namedBindings);
}
else {
ts.forEach(importClause.namedBindings.elements, visit);
}
}
}
break;
}
}
};
return SourceFileObject;
}(NodeObject));
var TextChange = (function () {
function TextChange() {
}
return TextChange;
}());
ts.TextChange = TextChange;
var HighlightSpanKind;
(function (HighlightSpanKind) {
HighlightSpanKind.none = "none";
HighlightSpanKind.definition = "definition";
HighlightSpanKind.reference = "reference";
HighlightSpanKind.writtenReference = "writtenReference";
})(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {}));
(function (IndentStyle) {
IndentStyle[IndentStyle["None"] = 0] = "None";
IndentStyle[IndentStyle["Block"] = 1] = "Block";
IndentStyle[IndentStyle["Smart"] = 2] = "Smart";
})(ts.IndentStyle || (ts.IndentStyle = {}));
var IndentStyle = ts.IndentStyle;
(function (SymbolDisplayPartKind) {
SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName";
SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className";
SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName";
SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName";
SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName";
SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword";
SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak";
SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral";
SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral";
SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName";
SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName";
SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName";
SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator";
SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName";
SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName";
SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation";
SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space";
SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text";
SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName";
SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName";
SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName";
SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral";
})(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {}));
var SymbolDisplayPartKind = ts.SymbolDisplayPartKind;
(function (TokenClass) {
TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation";
TokenClass[TokenClass["Keyword"] = 1] = "Keyword";
TokenClass[TokenClass["Operator"] = 2] = "Operator";
TokenClass[TokenClass["Comment"] = 3] = "Comment";
TokenClass[TokenClass["Whitespace"] = 4] = "Whitespace";
TokenClass[TokenClass["Identifier"] = 5] = "Identifier";
TokenClass[TokenClass["NumberLiteral"] = 6] = "NumberLiteral";
TokenClass[TokenClass["StringLiteral"] = 7] = "StringLiteral";
TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral";
})(ts.TokenClass || (ts.TokenClass = {}));
var TokenClass = ts.TokenClass;
// TODO: move these to enums
var ScriptElementKind;
(function (ScriptElementKind) {
ScriptElementKind.unknown = "";
ScriptElementKind.warning = "warning";
// predefined type (void) or keyword (class)
ScriptElementKind.keyword = "keyword";
// top level script node
ScriptElementKind.scriptElement = "script";
// module foo {}
ScriptElementKind.moduleElement = "module";
// class X {}
ScriptElementKind.classElement = "class";
// var x = class X {}
ScriptElementKind.localClassElement = "local class";
// interface Y {}
ScriptElementKind.interfaceElement = "interface";
// type T = ...
ScriptElementKind.typeElement = "type";
// enum E
ScriptElementKind.enumElement = "enum";
// Inside module and script only
// const v = ..
ScriptElementKind.variableElement = "var";
// Inside function
ScriptElementKind.localVariableElement = "local var";
// Inside module and script only
// function f() { }
ScriptElementKind.functionElement = "function";
// Inside function
ScriptElementKind.localFunctionElement = "local function";
// class X { [public|private]* foo() {} }
ScriptElementKind.memberFunctionElement = "method";
// class X { [public|private]* [get|set] foo:number; }
ScriptElementKind.memberGetAccessorElement = "getter";
ScriptElementKind.memberSetAccessorElement = "setter";
// class X { [public|private]* foo:number; }
// interface Y { foo:number; }
ScriptElementKind.memberVariableElement = "property";
// class X { constructor() { } }
ScriptElementKind.constructorImplementationElement = "constructor";
// interface Y { ():number; }
ScriptElementKind.callSignatureElement = "call";
// interface Y { []:number; }
ScriptElementKind.indexSignatureElement = "index";
// interface Y { new():Y; }
ScriptElementKind.constructSignatureElement = "construct";
// function foo(*Y*: string)
ScriptElementKind.parameterElement = "parameter";
ScriptElementKind.typeParameterElement = "type parameter";
ScriptElementKind.primitiveType = "primitive type";
ScriptElementKind.label = "label";
ScriptElementKind.alias = "alias";
ScriptElementKind.constElement = "const";
ScriptElementKind.letElement = "let";
})(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {}));
var ScriptElementKindModifier;
(function (ScriptElementKindModifier) {
ScriptElementKindModifier.none = "";
ScriptElementKindModifier.publicMemberModifier = "public";
ScriptElementKindModifier.privateMemberModifier = "private";
ScriptElementKindModifier.protectedMemberModifier = "protected";
ScriptElementKindModifier.exportedModifier = "export";
ScriptElementKindModifier.ambientModifier = "declare";
ScriptElementKindModifier.staticModifier = "static";
ScriptElementKindModifier.abstractModifier = "abstract";
})(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {}));
var ClassificationTypeNames = (function () {
function ClassificationTypeNames() {
}
ClassificationTypeNames.comment = "comment";
ClassificationTypeNames.identifier = "identifier";
ClassificationTypeNames.keyword = "keyword";
ClassificationTypeNames.numericLiteral = "number";
ClassificationTypeNames.operator = "operator";
ClassificationTypeNames.stringLiteral = "string";
ClassificationTypeNames.whiteSpace = "whitespace";
ClassificationTypeNames.text = "text";
ClassificationTypeNames.punctuation = "punctuation";
ClassificationTypeNames.className = "class name";
ClassificationTypeNames.enumName = "enum name";
ClassificationTypeNames.interfaceName = "interface name";
ClassificationTypeNames.moduleName = "module name";
ClassificationTypeNames.typeParameterName = "type parameter name";
ClassificationTypeNames.typeAliasName = "type alias name";
ClassificationTypeNames.parameterName = "parameter name";
ClassificationTypeNames.docCommentTagName = "doc comment tag name";
ClassificationTypeNames.jsxOpenTagName = "jsx open tag name";
ClassificationTypeNames.jsxCloseTagName = "jsx close tag name";
ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name";
ClassificationTypeNames.jsxAttribute = "jsx attribute";
ClassificationTypeNames.jsxText = "jsx text";
ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value";
return ClassificationTypeNames;
}());
ts.ClassificationTypeNames = ClassificationTypeNames;
function displayPartsToString(displayParts) {
if (displayParts) {
return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join("");
}
return "";
}
ts.displayPartsToString = displayPartsToString;
function isLocalVariableOrFunction(symbol) {
if (symbol.parent) {
return false; // This is exported symbol
}
return ts.forEach(symbol.declarations, function (declaration) {
// Function expressions are local
if (declaration.kind === 176 /* FunctionExpression */) {
return true;
}
if (declaration.kind !== 214 /* VariableDeclaration */ && declaration.kind !== 216 /* FunctionDeclaration */) {
return false;
}
// If the parent is not sourceFile or module block it is local variable
for (var parent_1 = declaration.parent; !ts.isFunctionBlock(parent_1); parent_1 = parent_1.parent) {
// Reached source file or module block
if (parent_1.kind === 251 /* SourceFile */ || parent_1.kind === 222 /* ModuleBlock */) {
return false;
}
}
// parent is in function block
return true;
});
}
function getDefaultCompilerOptions() {
// Always default to "ScriptTarget.ES5" for the language service
return {
target: 1 /* ES5 */,
module: 0 /* None */,
jsx: 1 /* Preserve */
};
}
ts.getDefaultCompilerOptions = getDefaultCompilerOptions;
// Cache host information about scrip Should be refreshed
// at each language service public entry point, since we don't know when
// set of scripts handled by the host changes.
var HostCache = (function () {
function HostCache(host, getCanonicalFileName) {
this.host = host;
this.getCanonicalFileName = getCanonicalFileName;
// script id => script index
this.currentDirectory = host.getCurrentDirectory();
this.fileNameToEntry = ts.createFileMap();
// Initialize the list with the root file names
var rootFileNames = host.getScriptFileNames();
for (var _i = 0, rootFileNames_1 = rootFileNames; _i < rootFileNames_1.length; _i++) {
var fileName = rootFileNames_1[_i];
this.createEntry(fileName, ts.toPath(fileName, this.currentDirectory, getCanonicalFileName));
}
// store the compilation settings
this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
}
HostCache.prototype.compilationSettings = function () {
return this._compilationSettings;
};
HostCache.prototype.createEntry = function (fileName, path) {
var entry;
var scriptSnapshot = this.host.getScriptSnapshot(fileName);
if (scriptSnapshot) {
entry = {
hostFileName: fileName,
version: this.host.getScriptVersion(fileName),
scriptSnapshot: scriptSnapshot
};
}
this.fileNameToEntry.set(path, entry);
return entry;
};
HostCache.prototype.getEntry = function (path) {
return this.fileNameToEntry.get(path);
};
HostCache.prototype.contains = function (path) {
return this.fileNameToEntry.contains(path);
};
HostCache.prototype.getOrCreateEntry = function (fileName) {
var path = ts.toPath(fileName, this.currentDirectory, this.getCanonicalFileName);
if (this.contains(path)) {
return this.getEntry(path);
}
return this.createEntry(fileName, path);
};
HostCache.prototype.getRootFileNames = function () {
var fileNames = [];
this.fileNameToEntry.forEachValue(function (path, value) {
if (value) {
fileNames.push(value.hostFileName);
}
});
return fileNames;
};
HostCache.prototype.getVersion = function (path) {
var file = this.getEntry(path);
return file && file.version;
};
HostCache.prototype.getScriptSnapshot = function (path) {
var file = this.getEntry(path);
return file && file.scriptSnapshot;
};
return HostCache;
}());
var SyntaxTreeCache = (function () {
function SyntaxTreeCache(host) {
this.host = host;
}
SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) {
var scriptSnapshot = this.host.getScriptSnapshot(fileName);
if (!scriptSnapshot) {
// The host does not know about this file.
throw new Error("Could not find file: '" + fileName + "'.");
}
var version = this.host.getScriptVersion(fileName);
var sourceFile;
if (this.currentFileName !== fileName) {
// This is a new file, just parse it
sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, /*setNodeParents*/ true);
}
else if (this.currentFileVersion !== version) {
// This is the same file, just a newer version. Incrementally parse the file.
var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange);
}
if (sourceFile) {
// All done, ensure state is up to date
this.currentFileVersion = version;
this.currentFileName = fileName;
this.currentFileScriptSnapshot = scriptSnapshot;
this.currentSourceFile = sourceFile;
}
return this.currentSourceFile;
};
return SyntaxTreeCache;
}());
function setSourceFileFields(sourceFile, scriptSnapshot, version) {
sourceFile.version = version;
sourceFile.scriptSnapshot = scriptSnapshot;
}
/*
* This function will compile source text from 'input' argument using specified compiler options.
* If not options are provided - it will use a set of default compiler options.
* Extra compiler options that will unconditionally be used by this function are:
* - isolatedModules = true
* - allowNonTsExtensions = true
* - noLib = true
* - noResolve = true
*/
function transpileModule(input, transpileOptions) {
var options = transpileOptions.compilerOptions ? ts.clone(transpileOptions.compilerOptions) : getDefaultCompilerOptions();
options.isolatedModules = true;
// Filename can be non-ts file.
options.allowNonTsExtensions = true;
// We are not returning a sourceFile for lib file when asked by the program,
// so pass --noLib to avoid reporting a file not found error.
options.noLib = true;
// We are not doing a full typecheck, we are not resolving the whole context,
// so pass --noResolve to avoid reporting missing file errors.
options.noResolve = true;
// if jsx is specified then treat file as .tsx
var inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts");
var sourceFile = ts.createSourceFile(inputFileName, input, options.target);
if (transpileOptions.moduleName) {
sourceFile.moduleName = transpileOptions.moduleName;
}
sourceFile.renamedDependencies = transpileOptions.renamedDependencies;
var newLine = ts.getNewLineCharacter(options);
// Output
var outputText;
var sourceMapText;
// Create a compilerHost object to allow the compiler to read and write files
var compilerHost = {
getSourceFile: function (fileName, target) { return fileName === ts.normalizeSlashes(inputFileName) ? sourceFile : undefined; },
writeFile: function (name, text, writeByteOrderMark) {
if (ts.fileExtensionIs(name, ".map")) {
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
sourceMapText = text;
}
else {
ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'");
outputText = text;
}
},
getDefaultLibFileName: function () { return "lib.d.ts"; },
useCaseSensitiveFileNames: function () { return false; },
getCanonicalFileName: function (fileName) { return fileName; },
getCurrentDirectory: function () { return ""; },
getNewLine: function () { return newLine; },
fileExists: function (fileName) { return fileName === inputFileName; },
readFile: function (fileName) { return ""; },
directoryExists: function (directoryExists) { return true; }
};
var program = ts.createProgram([inputFileName], options, compilerHost);
var diagnostics;
if (transpileOptions.reportDiagnostics) {
diagnostics = [];
ts.addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile));
ts.addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics());
}
// Emit
program.emit();
ts.Debug.assert(outputText !== undefined, "Output generation failed");
return { outputText: outputText, diagnostics: diagnostics, sourceMapText: sourceMapText };
}
ts.transpileModule = transpileModule;
/*
* This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result.
*/
function transpile(input, compilerOptions, fileName, diagnostics, moduleName) {
var output = transpileModule(input, { compilerOptions: compilerOptions, fileName: fileName, reportDiagnostics: !!diagnostics, moduleName: moduleName });
// addRange correctly handles cases when wither 'from' or 'to' argument is missing
ts.addRange(diagnostics, output.diagnostics);
return output.outputText;
}
ts.transpile = transpile;
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) {
var text = scriptSnapshot.getText(0, scriptSnapshot.getLength());
var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents);
setSourceFileFields(sourceFile, scriptSnapshot, version);
// after full parsing we can use table with interned strings as name table
sourceFile.nameTable = sourceFile.identifiers;
return sourceFile;
}
ts.createLanguageServiceSourceFile = createLanguageServiceSourceFile;
ts.disableIncrementalParsing = false;
function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version, textChangeRange, aggressiveChecks) {
// If we were given a text change range, and our version or open-ness changed, then
// incrementally parse this file.
if (textChangeRange) {
if (version !== sourceFile.version) {
// Once incremental parsing is ready, then just call into this function.
if (!ts.disableIncrementalParsing) {
var newText;
// grab the fragment from the beginning of the original text to the beginning of the span
var prefix = textChangeRange.span.start !== 0
? sourceFile.text.substr(0, textChangeRange.span.start)
: "";
// grab the fragment from the end of the span till the end of the original text
var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length
? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span))
: "";
if (textChangeRange.newLength === 0) {
// edit was a deletion - just combine prefix and suffix
newText = prefix && suffix ? prefix + suffix : prefix || suffix;
}
else {
// it was actual edit, fetch the fragment of new text that correspond to new span
var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);
// combine prefix, changed text and suffix
newText = prefix && suffix
? prefix + changedText + suffix
: prefix
? (prefix + changedText)
: (changedText + suffix);
}
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
setSourceFileFields(newSourceFile, scriptSnapshot, version);
// after incremental parsing nameTable might not be up-to-date
// drop it so it can be lazily recreated later
newSourceFile.nameTable = undefined;
// dispose all resources held by old script snapshot
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
if (sourceFile.scriptSnapshot.dispose) {
sourceFile.scriptSnapshot.dispose();
}
sourceFile.scriptSnapshot = undefined;
}
return newSourceFile;
}
}
}
// Otherwise, just create a new source file.
return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true);
}
ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile;
function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) {
if (currentDirectory === void 0) { currentDirectory = ""; }
// Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have
// for those settings.
var buckets = {};
var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames);
function getKeyFromCompilationSettings(settings) {
return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs;
}
function getBucketForCompilationSettings(settings, createIfMissing) {
var key = getKeyFromCompilationSettings(settings);
var bucket = ts.lookUp(buckets, key);
if (!bucket && createIfMissing) {
buckets[key] = bucket = ts.createFileMap();
}
return bucket;
}
function reportStats() {
var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) {
var entries = ts.lookUp(buckets, name);
var sourceFiles = [];
entries.forEachValue(function (key, entry) {
sourceFiles.push({
name: key,
refCount: entry.languageServiceRefCount,
references: entry.owners.slice(0)
});
});
sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; });
return {
bucket: name,
sourceFiles: sourceFiles
};
});
return JSON.stringify(bucketInfoArray, undefined, 2);
}
function acquireDocument(fileName, compilationSettings, scriptSnapshot, version) {
return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ true);
}
function updateDocument(fileName, compilationSettings, scriptSnapshot, version) {
return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ false);
}
function acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, acquiring) {
var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ true);
var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
var entry = bucket.get(path);
if (!entry) {
ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
// Have never seen this file with these settings. Create a new source file for it.
var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false);
entry = {
sourceFile: sourceFile,
languageServiceRefCount: 0,
owners: []
};
bucket.set(path, entry);
}
else {
// We have an entry for this file. However, it may be for a different version of
// the script snapshot. If so, update it appropriately. Otherwise, we can just
// return it as is.
if (entry.sourceFile.version !== version) {
entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
}
}
// If we're acquiring, then this is the first time this LS is asking for this document.
// Increase our ref count so we know there's another LS using the document. If we're
// not acquiring, then that means the LS is 'updating' the file instead, and that means
// it has already acquired the document previously. As such, we do not need to increase
// the ref count.
if (acquiring) {
entry.languageServiceRefCount++;
}
return entry.sourceFile;
}
function releaseDocument(fileName, compilationSettings) {
var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false);
ts.Debug.assert(bucket !== undefined);
var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
var entry = bucket.get(path);
entry.languageServiceRefCount--;
ts.Debug.assert(entry.languageServiceRefCount >= 0);
if (entry.languageServiceRefCount === 0) {
bucket.remove(path);
}
}
return {
acquireDocument: acquireDocument,
updateDocument: updateDocument,
releaseDocument: releaseDocument,
reportStats: reportStats
};
}
ts.createDocumentRegistry = createDocumentRegistry;
function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) {
if (readImportFiles === void 0) { readImportFiles = true; }
if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; }
var referencedFiles = [];
var importedFiles = [];
var ambientExternalModules;
var isNoDefaultLib = false;
function processTripleSlashDirectives() {
var commentRanges = ts.getLeadingCommentRanges(sourceText, 0);
ts.forEach(commentRanges, function (commentRange) {
var comment = sourceText.substring(commentRange.pos, commentRange.end);
var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange);
if (referencePathMatchResult) {
isNoDefaultLib = referencePathMatchResult.isNoDefaultLib;
var fileReference = referencePathMatchResult.fileReference;
if (fileReference) {
referencedFiles.push(fileReference);
}
}
});
}
function recordAmbientExternalModule() {
if (!ambientExternalModules) {
ambientExternalModules = [];
}
ambientExternalModules.push(scanner.getTokenValue());
}
function recordModuleName() {
var importPath = scanner.getTokenValue();
var pos = scanner.getTokenPos();
importedFiles.push({
fileName: importPath,
pos: pos,
end: pos + importPath.length
});
}
/**
* Returns true if at least one token was consumed from the stream
*/
function tryConsumeDeclare() {
var token = scanner.getToken();
if (token === 122 /* DeclareKeyword */) {
// declare module "mod"
token = scanner.scan();
if (token === 125 /* ModuleKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
recordAmbientExternalModule();
}
}
return true;
}
return false;
}
/**
* Returns true if at least one token was consumed from the stream
*/
function tryConsumeImport() {
var token = scanner.getToken();
if (token === 89 /* ImportKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// import "mod";
recordModuleName();
return true;
}
else {
if (token === 69 /* Identifier */ || ts.isKeyword(token)) {
token = scanner.scan();
if (token === 133 /* FromKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// import d from "mod";
recordModuleName();
return true;
}
}
else if (token === 56 /* EqualsToken */) {
if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) {
return true;
}
}
else if (token === 24 /* CommaToken */) {
// consume comma and keep going
token = scanner.scan();
}
else {
// unknown syntax
return true;
}
}
if (token === 15 /* OpenBraceToken */) {
token = scanner.scan();
// consume "{ a as B, c, d as D}" clauses
// make sure that it stops on EOF
while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) {
token = scanner.scan();
}
if (token === 16 /* CloseBraceToken */) {
token = scanner.scan();
if (token === 133 /* FromKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// import {a as A} from "mod";
// import d, {a, b as B} from "mod"
recordModuleName();
}
}
}
}
else if (token === 37 /* AsteriskToken */) {
token = scanner.scan();
if (token === 116 /* AsKeyword */) {
token = scanner.scan();
if (token === 69 /* Identifier */ || ts.isKeyword(token)) {
token = scanner.scan();
if (token === 133 /* FromKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// import * as NS from "mod"
// import d, * as NS from "mod"
recordModuleName();
}
}
}
}
}
}
return true;
}
return false;
}
function tryConsumeExport() {
var token = scanner.getToken();
if (token === 82 /* ExportKeyword */) {
token = scanner.scan();
if (token === 15 /* OpenBraceToken */) {
token = scanner.scan();
// consume "{ a as B, c, d as D}" clauses
// make sure it stops on EOF
while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) {
token = scanner.scan();
}
if (token === 16 /* CloseBraceToken */) {
token = scanner.scan();
if (token === 133 /* FromKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// export {a as A} from "mod";
// export {a, b as B} from "mod"
recordModuleName();
}
}
}
}
else if (token === 37 /* AsteriskToken */) {
token = scanner.scan();
if (token === 133 /* FromKeyword */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// export * from "mod"
recordModuleName();
}
}
}
else if (token === 89 /* ImportKeyword */) {
token = scanner.scan();
if (token === 69 /* Identifier */ || ts.isKeyword(token)) {
token = scanner.scan();
if (token === 56 /* EqualsToken */) {
if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) {
return true;
}
}
}
}
return true;
}
return false;
}
function tryConsumeRequireCall(skipCurrentToken) {
var token = skipCurrentToken ? scanner.scan() : scanner.getToken();
if (token === 127 /* RequireKeyword */) {
token = scanner.scan();
if (token === 17 /* OpenParenToken */) {
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// require("mod");
recordModuleName();
}
}
return true;
}
return false;
}
function tryConsumeDefine() {
var token = scanner.getToken();
if (token === 69 /* Identifier */ && scanner.getTokenValue() === "define") {
token = scanner.scan();
if (token !== 17 /* OpenParenToken */) {
return true;
}
token = scanner.scan();
if (token === 9 /* StringLiteral */) {
// looks like define ("modname", ... - skip string literal and comma
token = scanner.scan();
if (token === 24 /* CommaToken */) {
token = scanner.scan();
}
else {
// unexpected token
return true;
}
}
// should be start of dependency list
if (token !== 19 /* OpenBracketToken */) {
return true;
}
// skip open bracket
token = scanner.scan();
var i = 0;
// scan until ']' or EOF
while (token !== 20 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) {
// record string literals as module names
if (token === 9 /* StringLiteral */) {
recordModuleName();
i++;
}
token = scanner.scan();
}
return true;
}
return false;
}
function processImports() {
scanner.setText(sourceText);
scanner.scan();
// Look for:
// import "mod";
// import d from "mod"
// import {a as A } from "mod";
// import * as NS from "mod"
// import d, {a, b as B} from "mod"
// import i = require("mod");
//
// export * from "mod"
// export {a as b} from "mod"
// export import i = require("mod")
// (for JavaScript files) require("mod")
while (true) {
if (scanner.getToken() === 1 /* EndOfFileToken */) {
break;
}
// check if at least one of alternative have moved scanner forward
if (tryConsumeDeclare() ||
tryConsumeImport() ||
tryConsumeExport() ||
(detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) {
continue;
}
else {
scanner.scan();
}
}
scanner.setText(undefined);
}
if (readImportFiles) {
processImports();
}
processTripleSlashDirectives();
return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientExternalModules };
}
ts.preProcessFile = preProcessFile;
/// Helpers
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
if (referenceNode.kind === 210 /* LabeledStatement */ && referenceNode.label.text === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
}
return undefined;
}
function isJumpStatementTarget(node) {
return node.kind === 69 /* Identifier */ &&
(node.parent.kind === 206 /* BreakStatement */ || node.parent.kind === 205 /* ContinueStatement */) &&
node.parent.label === node;
}
function isLabelOfLabeledStatement(node) {
return node.kind === 69 /* Identifier */ &&
node.parent.kind === 210 /* LabeledStatement */ &&
node.parent.label === node;
}
/**
* Whether or not a 'node' is preceded by a label of the given string.
* Note: 'node' cannot be a SourceFile.
*/
function isLabeledBy(node, labelName) {
for (var owner = node.parent; owner.kind === 210 /* LabeledStatement */; owner = owner.parent) {
if (owner.label.text === labelName) {
return true;
}
}
return false;
}
function isLabelName(node) {
return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node);
}
function isRightSideOfQualifiedName(node) {
return node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node;
}
function isRightSideOfPropertyAccess(node) {
return node && node.parent && node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node;
}
function isCallExpressionTarget(node) {
if (isRightSideOfPropertyAccess(node)) {
node = node.parent;
}
return node && node.parent && node.parent.kind === 171 /* CallExpression */ && node.parent.expression === node;
}
function isNewExpressionTarget(node) {
if (isRightSideOfPropertyAccess(node)) {
node = node.parent;
}
return node && node.parent && node.parent.kind === 172 /* NewExpression */ && node.parent.expression === node;
}
function isNameOfModuleDeclaration(node) {
return node.parent.kind === 221 /* ModuleDeclaration */ && node.parent.name === node;
}
function isNameOfFunctionDeclaration(node) {
return node.kind === 69 /* Identifier */ &&
ts.isFunctionLike(node.parent) && node.parent.name === node;
}
/** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */
function isNameOfPropertyAssignment(node) {
return (node.kind === 69 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) &&
(node.parent.kind === 248 /* PropertyAssignment */ || node.parent.kind === 249 /* ShorthandPropertyAssignment */) && node.parent.name === node;
}
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) {
switch (node.parent.kind) {
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
case 248 /* PropertyAssignment */:
case 250 /* EnumMember */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
case 221 /* ModuleDeclaration */:
return node.parent.name === node;
case 170 /* ElementAccessExpression */:
return node.parent.argumentExpression === node;
}
}
return false;
}
function isNameOfExternalModuleImportOrDeclaration(node) {
if (node.kind === 9 /* StringLiteral */) {
return isNameOfModuleDeclaration(node) ||
(ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node);
}
return false;
}
/** Returns true if the position is within a comment */
function isInsideComment(sourceFile, token, position) {
// The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment
return position <= token.getStart(sourceFile) &&
(isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) ||
isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart())));
function isInsideCommentRange(comments) {
return ts.forEach(comments, function (comment) {
// either we are 1. completely inside the comment, or 2. at the end of the comment
if (comment.pos < position && position < comment.end) {
return true;
}
else if (position === comment.end) {
var text = sourceFile.text;
var width = comment.end - comment.pos;
// is single line comment or just /*
if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) {
return true;
}
else {
// is unterminated multi-line comment
return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ &&
text.charCodeAt(comment.end - 2) === 42 /* asterisk */);
}
}
return false;
});
}
}
// A cache of completion entries for keywords, these do not change between sessions
var keywordCompletions = [];
for (var i = 70 /* FirstKeyword */; i <= 135 /* LastKeyword */; i++) {
keywordCompletions.push({
name: ts.tokenToString(i),
kind: ScriptElementKind.keyword,
kindModifiers: ScriptElementKindModifier.none,
sortText: "0"
});
}
/* @internal */ function getContainerNode(node) {
while (true) {
node = node.parent;
if (!node) {
return undefined;
}
switch (node.kind) {
case 251 /* SourceFile */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
case 216 /* FunctionDeclaration */:
case 176 /* FunctionExpression */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
case 217 /* ClassDeclaration */:
case 218 /* InterfaceDeclaration */:
case 220 /* EnumDeclaration */:
case 221 /* ModuleDeclaration */:
return node;
}
}
}
ts.getContainerNode = getContainerNode;
/* @internal */ function getNodeKind(node) {
switch (node.kind) {
case 221 /* ModuleDeclaration */: return ScriptElementKind.moduleElement;
case 217 /* ClassDeclaration */: return ScriptElementKind.classElement;
case 218 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement;
case 219 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement;
case 220 /* EnumDeclaration */: return ScriptElementKind.enumElement;
case 214 /* VariableDeclaration */:
return ts.isConst(node)
? ScriptElementKind.constElement
: ts.isLet(node)
? ScriptElementKind.letElement
: ScriptElementKind.variableElement;
case 216 /* FunctionDeclaration */: return ScriptElementKind.functionElement;
case 146 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement;
case 147 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement;
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
return ScriptElementKind.memberFunctionElement;
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
return ScriptElementKind.memberVariableElement;
case 150 /* IndexSignature */: return ScriptElementKind.indexSignatureElement;
case 149 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement;
case 148 /* CallSignature */: return ScriptElementKind.callSignatureElement;
case 145 /* Constructor */: return ScriptElementKind.constructorImplementationElement;
case 138 /* TypeParameter */: return ScriptElementKind.typeParameterElement;
case 250 /* EnumMember */: return ScriptElementKind.variableElement;
case 139 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement;
case 224 /* ImportEqualsDeclaration */:
case 229 /* ImportSpecifier */:
case 226 /* ImportClause */:
case 233 /* ExportSpecifier */:
case 227 /* NamespaceImport */:
return ScriptElementKind.alias;
}
return ScriptElementKind.unknown;
}
ts.getNodeKind = getNodeKind;
var CancellationTokenObject = (function () {
function CancellationTokenObject(cancellationToken) {
this.cancellationToken = cancellationToken;
}
CancellationTokenObject.prototype.isCancellationRequested = function () {
return this.cancellationToken && this.cancellationToken.isCancellationRequested();
};
CancellationTokenObject.prototype.throwIfCancellationRequested = function () {
if (this.isCancellationRequested()) {
throw new ts.OperationCanceledException();
}
};
return CancellationTokenObject;
}());
function createLanguageService(host, documentRegistry) {
if (documentRegistry === void 0) { documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); }
var syntaxTreeCache = new SyntaxTreeCache(host);
var ruleProvider;
var program;
var lastProjectVersion;
var useCaseSensitivefileNames = false;
var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
var currentDirectory = host.getCurrentDirectory();
// Check if the localized messages json is set, otherwise query the host for it
if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) {
ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages();
}
function log(message) {
if (host.log) {
host.log(message);
}
}
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitivefileNames);
function getValidSourceFile(fileName) {
var sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
throw new Error("Could not find file: '" + fileName + "'.");
}
return sourceFile;
}
function getRuleProvider(options) {
// Ensure rules are initialized and up to date wrt to formatting options
if (!ruleProvider) {
ruleProvider = new ts.formatting.RulesProvider();
}
ruleProvider.ensureUpToDate(options);
return ruleProvider;
}
function synchronizeHostData() {
// perform fast check if host supports it
if (host.getProjectVersion) {
var hostProjectVersion = host.getProjectVersion();
if (hostProjectVersion) {
if (lastProjectVersion === hostProjectVersion) {
return;
}
lastProjectVersion = hostProjectVersion;
}
}
// Get a fresh cache of the host information
var hostCache = new HostCache(host, getCanonicalFileName);
// If the program is already up-to-date, we can reuse it
if (programUpToDate()) {
return;
}
// IMPORTANT - It is critical from this moment onward that we do not check
// cancellation tokens. We are about to mutate source files from a previous program
// instance. If we cancel midway through, we may end up in an inconsistent state where
// the program points to old source files that have been invalidated because of
// incremental parsing.
var oldSettings = program && program.getCompilerOptions();
var newSettings = hostCache.compilationSettings();
var changesInCompilationSettingsAffectSyntax = oldSettings &&
(oldSettings.target !== newSettings.target ||
oldSettings.module !== newSettings.module ||
oldSettings.noResolve !== newSettings.noResolve ||
oldSettings.jsx !== newSettings.jsx ||
oldSettings.allowJs !== newSettings.allowJs);
// Now create a new compiler
var compilerHost = {
getSourceFile: getOrCreateSourceFile,
getCancellationToken: function () { return cancellationToken; },
getCanonicalFileName: getCanonicalFileName,
useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; },
getNewLine: function () { return ts.getNewLineOrDefaultFromHost(host); },
getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
writeFile: function (fileName, data, writeByteOrderMark) { },
getCurrentDirectory: function () { return currentDirectory; },
fileExists: function (fileName) {
// stub missing host functionality
ts.Debug.assert(!host.resolveModuleNames);
return hostCache.getOrCreateEntry(fileName) !== undefined;
},
readFile: function (fileName) {
// stub missing host functionality
var entry = hostCache.getOrCreateEntry(fileName);
return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength());
},
directoryExists: function (directoryName) {
ts.Debug.assert(!host.resolveModuleNames);
return ts.directoryProbablyExists(directoryName, host);
}
};
if (host.resolveModuleNames) {
compilerHost.resolveModuleNames = function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); };
}
var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, compilerHost, program);
// Release any files we have acquired in the old program but are
// not part of the new program.
if (program) {
var oldSourceFiles = program.getSourceFiles();
for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) {
var oldSourceFile = oldSourceFiles_1[_i];
if (!newProgram.getSourceFile(oldSourceFile.fileName) || changesInCompilationSettingsAffectSyntax) {
documentRegistry.releaseDocument(oldSourceFile.fileName, oldSettings);
}
}
}
// hostCache is captured in the closure for 'getOrCreateSourceFile' but it should not be used past this point.
// It needs to be cleared to allow all collected snapshots to be released
hostCache = undefined;
program = newProgram;
// Make sure all the nodes in the program are both bound, and have their parent
// pointers set property.
program.getTypeChecker();
return;
function getOrCreateSourceFile(fileName) {
ts.Debug.assert(hostCache !== undefined);
// The program is asking for this file, check first if the host can locate it.
// If the host can not locate the file, then it does not exist. return undefined
// to the program to allow reporting of errors for missing files.
var hostFileInformation = hostCache.getOrCreateEntry(fileName);
if (!hostFileInformation) {
return undefined;
}
// Check if the language version has changed since we last created a program; if they are the same,
// it is safe to reuse the souceFiles; if not, then the shape of the AST can change, and the oldSourceFile
// can not be reused. we have to dump all syntax trees and create new ones.
if (!changesInCompilationSettingsAffectSyntax) {
// Check if the old program had this file already
var oldSourceFile = program && program.getSourceFile(fileName);
if (oldSourceFile) {
// We already had a source file for this file name. Go to the registry to
// ensure that we get the right up to date version of it. We need this to
// address the following 'race'. Specifically, say we have the following:
//
// LS1
// \
// DocumentRegistry
// /
// LS2
//
// Each LS has a reference to file 'foo.ts' at version 1. LS2 then updates
// it's version of 'foo.ts' to version 2. This will cause LS2 and the
// DocumentRegistry to have version 2 of the document. HOwever, LS1 will
// have version 1. And *importantly* this source file will be *corrupt*.
// The act of creating version 2 of the file irrevocably damages the version
// 1 file.
//
// So, later when we call into LS1, we need to make sure that it doesn't use
// it's source file any more, and instead defers to DocumentRegistry to get
// either version 1, version 2 (or some other version) depending on what the
// host says should be used.
return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version);
}
}
// Could not find this file in the old program, create a new SourceFile for it.
return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version);
}
function sourceFileUpToDate(sourceFile) {
if (!sourceFile) {
return false;
}
var path = sourceFile.path || ts.toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName);
return sourceFile.version === hostCache.getVersion(path);
}
function programUpToDate() {
// If we haven't create a program yet, then it is not up-to-date
if (!program) {
return false;
}
// If number of files in the program do not match, it is not up-to-date
var rootFileNames = hostCache.getRootFileNames();
if (program.getSourceFiles().length !== rootFileNames.length) {
return false;
}
// If any file is not up-to-date, then the whole program is not up-to-date
for (var _i = 0, rootFileNames_2 = rootFileNames; _i < rootFileNames_2.length; _i++) {
var fileName = rootFileNames_2[_i];
if (!sourceFileUpToDate(program.getSourceFile(fileName))) {
return false;
}
}
// If the compilation settings do no match, then the program is not up-to-date
return ts.compareDataObjects(program.getCompilerOptions(), hostCache.compilationSettings());
}
}
function getProgram() {
synchronizeHostData();
return program;
}
function cleanupSemanticCache() {
// TODO: Should we jettison the program (or it's type checker) here?
}
function dispose() {
if (program) {
ts.forEach(program.getSourceFiles(), function (f) {
return documentRegistry.releaseDocument(f.fileName, program.getCompilerOptions());
});
}
}
/// Diagnostics
function getSyntacticDiagnostics(fileName) {
synchronizeHostData();
return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken);
}
/**
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
* If '-d' enabled, report both semantic and emitter errors
*/
function getSemanticDiagnostics(fileName) {
synchronizeHostData();
var targetSourceFile = getValidSourceFile(fileName);
// Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file.
// Therefore only get diagnostics for given file.
var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken);
if (!program.getCompilerOptions().declaration) {
return semanticDiagnostics;
}
// If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface
var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
return ts.concatenate(semanticDiagnostics, declarationDiagnostics);
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken));
}
/**
* Get the name to be display in completion from a given symbol.
*
* @return undefined if the name is of external module otherwise a name with striped of any quote
*/
function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, location) {
var displayName = ts.getDeclaredName(program.getTypeChecker(), symbol, location);
if (displayName) {
var firstCharCode = displayName.charCodeAt(0);
// First check of the displayName is not external module; if it is an external module, it is not valid entry
if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) {
// If the symbol is external module, don't show it in the completion list
// (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there)
return undefined;
}
}
return getCompletionEntryDisplayName(displayName, target, performCharacterChecks);
}
/**
* Get a displayName from a given for completion list, performing any necessary quotes stripping
* and checking whether the name is valid identifier name.
*/
function getCompletionEntryDisplayName(name, target, performCharacterChecks) {
if (!name) {
return undefined;
}
name = ts.stripQuotes(name);
if (!name) {
return undefined;
}
// If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an
// invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name.
// e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid.
// We, thus, need to check if whatever was inside the quotes is actually a valid identifier name.
if (performCharacterChecks) {
if (!ts.isIdentifier(name, target)) {
return undefined;
}
}
return name;
}
function getCompletionData(fileName, position) {
var typeChecker = program.getTypeChecker();
var sourceFile = getValidSourceFile(fileName);
var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile);
var isJsDocTagName = false;
var start = new Date().getTime();
var currentToken = ts.getTokenAtPosition(sourceFile, position);
log("getCompletionData: Get current token: " + (new Date().getTime() - start));
start = new Date().getTime();
// Completion not allowed inside comments, bail out if this is the case
var insideComment = isInsideComment(sourceFile, currentToken, position);
log("getCompletionData: Is inside comment: " + (new Date().getTime() - start));
if (insideComment) {
// The current position is next to the '@' sign, when no tag name being provided yet.
// Provide a full list of tag names
if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) {
isJsDocTagName = true;
}
// Completion should work inside certain JsDoc tags. For example:
// /** @type {number | string} */
// Completion should work in the brackets
var insideJsDocTagExpression = false;
var tag = ts.getJsDocTagAtPosition(sourceFile, position);
if (tag) {
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
isJsDocTagName = true;
}
switch (tag.kind) {
case 272 /* JSDocTypeTag */:
case 270 /* JSDocParameterTag */:
case 271 /* JSDocReturnTag */:
var tagWithExpression = tag;
if (tagWithExpression.typeExpression) {
insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end;
}
break;
}
}
if (isJsDocTagName) {
return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName };
}
if (!insideJsDocTagExpression) {
// Proceed if the current position is in jsDoc tag expression; otherwise it is a normal
// comment or the plain text part of a jsDoc comment, so no completion should be available
log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
return undefined;
}
}
start = new Date().getTime();
var previousToken = ts.findPrecedingToken(position, sourceFile);
log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start));
// The decision to provide completion depends on the contextToken, which is determined through the previousToken.
// Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file
var contextToken = previousToken;
// Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|
// Skip this partial identifier and adjust the contextToken to the token that precedes it.
if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) {
var start_1 = new Date().getTime();
contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile);
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1));
}
// Find the node where completion is requested on.
// Also determine whether we are trying to complete with members of that node
// or attributes of a JSX tag.
var node = currentToken;
var isRightOfDot = false;
var isRightOfOpenTag = false;
var isStartingCloseTag = false;
var location = ts.getTouchingPropertyName(sourceFile, position);
if (contextToken) {
// Bail out if this is a known invalid completion location
if (isCompletionListBlocker(contextToken)) {
log("Returning an empty list because completion was requested in an invalid position.");
return undefined;
}
var parent_2 = contextToken.parent, kind = contextToken.kind;
if (kind === 21 /* DotToken */) {
if (parent_2.kind === 169 /* PropertyAccessExpression */) {
node = contextToken.parent.expression;
isRightOfDot = true;
}
else if (parent_2.kind === 136 /* QualifiedName */) {
node = contextToken.parent.left;
isRightOfDot = true;
}
else {
// There is nothing that precedes the dot, so this likely just a stray character
// or leading into a '...' token. Just bail out instead.
return undefined;
}
}
else if (sourceFile.languageVariant === 1 /* JSX */) {
if (kind === 25 /* LessThanToken */) {
isRightOfOpenTag = true;
location = contextToken;
}
else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 240 /* JsxClosingElement */) {
isStartingCloseTag = true;
location = contextToken;
}
}
}
var semanticStart = new Date().getTime();
var isMemberCompletion;
var isNewIdentifierLocation;
var symbols = [];
if (isRightOfDot) {
getTypeScriptMemberSymbols();
}
else if (isRightOfOpenTag) {
var tagSymbols = typeChecker.getJsxIntrinsicTagNames();
if (tryGetGlobalSymbols()) {
symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & 107455 /* Value */); }));
}
else {
symbols = tagSymbols;
}
isMemberCompletion = true;
isNewIdentifierLocation = false;
}
else if (isStartingCloseTag) {
var tagName = contextToken.parent.parent.openingElement.tagName;
var tagSymbol = typeChecker.getSymbolAtLocation(tagName);
if (!typeChecker.isUnknownSymbol(tagSymbol)) {
symbols = [tagSymbol];
}
isMemberCompletion = true;
isNewIdentifierLocation = false;
}
else {
// For JavaScript or TypeScript, if we're not after a dot, then just try to get the
// global symbols in scope. These results should be valid for either language as
// the set of symbols that can be referenced from this location.
if (!tryGetGlobalSymbols()) {
return undefined;
}
}
log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart));
return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName };
function getTypeScriptMemberSymbols() {
// Right of dot member completion list
isMemberCompletion = true;
isNewIdentifierLocation = false;
if (node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */ || node.kind === 169 /* PropertyAccessExpression */) {
var symbol = typeChecker.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & 8388608 /* Alias */) {
symbol = typeChecker.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & 1952 /* HasExports */) {
// Extract module or enum members
var exportedSymbols = typeChecker.getExportsOfModule(symbol);
ts.forEach(exportedSymbols, function (symbol) {
if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
var type = typeChecker.getTypeAtLocation(node);
addTypeProperties(type);
}
function addTypeProperties(type) {
if (type) {
// Filter private properties
for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) {
var symbol = _a[_i];
if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
}
if (isJavaScriptFile && type.flags & 16384 /* Union */) {
// In javascript files, for union types, we don't just get the members that
// the individual types have in common, we also include all the members that
// each individual type has. This is because we're going to add all identifiers
// anyways. So we might as well elevate the members that were at least part
// of the individual types to a higher status since we know what they are.
var unionType = type;
for (var _b = 0, _c = unionType.types; _b < _c.length; _b++) {
var elementType = _c[_b];
addTypeProperties(elementType);
}
}
}
}
function tryGetGlobalSymbols() {
var objectLikeContainer;
var namedImportsOrExports;
var jsxContainer;
if (objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken)) {
return tryGetObjectLikeCompletionSymbols(objectLikeContainer);
}
if (namedImportsOrExports = tryGetNamedImportsOrExportsForCompletion(contextToken)) {
// cursor is in an import clause
// try to show exported member for imported module
return tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports);
}
if (jsxContainer = tryGetContainingJsxElement(contextToken)) {
var attrsType;
if ((jsxContainer.kind === 237 /* JsxSelfClosingElement */) || (jsxContainer.kind === 238 /* JsxOpeningElement */)) {
// Cursor is inside a JSX self-closing element or opening element
attrsType = typeChecker.getJsxElementAttributesType(jsxContainer);
if (attrsType) {
symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes);
isMemberCompletion = true;
isNewIdentifierLocation = false;
return true;
}
}
}
// Get all entities in the current scope.
isMemberCompletion = false;
isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken);
if (previousToken !== contextToken) {
ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'.");
}
// We need to find the node that will give us an appropriate scope to begin
// aggregating completion candidates. This is achieved in 'getScopeNode'
// by finding the first node that encompasses a position, accounting for whether a node
// is "complete" to decide whether a position belongs to the node.
//
// However, at the end of an identifier, we are interested in the scope of the identifier
// itself, but fall outside of the identifier. For instance:
//
// xyz => x$
//
// the cursor is outside of both the 'x' and the arrow function 'xyz => x',
// so 'xyz' is not returned in our results.
//
// We define 'adjustedPosition' so that we may appropriately account for
// being at the end of an identifier. The intention is that if requesting completion
// at the end of an identifier, it should be effectively equivalent to requesting completion
// anywhere inside/at the beginning of the identifier. So in the previous case, the
// 'adjustedPosition' will work as if requesting completion in the following:
//
// xyz => $x
//
// If previousToken !== contextToken, then
// - 'contextToken' was adjusted to the token prior to 'previousToken'
// because we were at the end of an identifier.
// - 'previousToken' is defined.
var adjustedPosition = previousToken !== contextToken ?
previousToken.getStart() :
position;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
/// TODO filter meaning based on the current context
var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */;
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
return true;
}
/**
* Finds the first node that "embraces" the position, so that one may
* accurately aggregate locals from the closest containing scope.
*/
function getScopeNode(initialToken, position, sourceFile) {
var scope = initialToken;
while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) {
scope = scope.parent;
}
return scope;
}
function isCompletionListBlocker(contextToken) {
var start = new Date().getTime();
var result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken) ||
isSolelyIdentifierDefinitionLocation(contextToken) ||
isDotOfNumericLiteral(contextToken) ||
isInJsxText(contextToken);
log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start));
return result;
}
function isInJsxText(contextToken) {
if (contextToken.kind === 239 /* JsxText */) {
return true;
}
if (contextToken.kind === 27 /* GreaterThanToken */ && contextToken.parent) {
if (contextToken.parent.kind === 238 /* JsxOpeningElement */) {
return true;
}
if (contextToken.parent.kind === 240 /* JsxClosingElement */ || contextToken.parent.kind === 237 /* JsxSelfClosingElement */) {
return contextToken.parent.parent && contextToken.parent.parent.kind === 236 /* JsxElement */;
}
}
return false;
}
function isNewIdentifierDefinitionLocation(previousToken) {
if (previousToken) {
var containingNodeKind = previousToken.parent.kind;
switch (previousToken.kind) {
case 24 /* CommaToken */:
return containingNodeKind === 171 /* CallExpression */ // func( a, |
|| containingNodeKind === 145 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */
|| containingNodeKind === 172 /* NewExpression */ // new C(a, |
|| containingNodeKind === 167 /* ArrayLiteralExpression */ // [a, |
|| containingNodeKind === 184 /* BinaryExpression */ // const x = (a, |
|| containingNodeKind === 153 /* FunctionType */; // var x: (s: string, list|
case 17 /* OpenParenToken */:
return containingNodeKind === 171 /* CallExpression */ // func( |
|| containingNodeKind === 145 /* Constructor */ // constructor( |
|| containingNodeKind === 172 /* NewExpression */ // new C(a|
|| containingNodeKind === 175 /* ParenthesizedExpression */ // const x = (a|
|| containingNodeKind === 161 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */
case 19 /* OpenBracketToken */:
return containingNodeKind === 167 /* ArrayLiteralExpression */ // [ |
|| containingNodeKind === 150 /* IndexSignature */ // [ | : string ]
|| containingNodeKind === 137 /* ComputedPropertyName */; // [ | /* this can become an index signature */
case 125 /* ModuleKeyword */: // module |
case 126 /* NamespaceKeyword */:
return true;
case 21 /* DotToken */:
return containingNodeKind === 221 /* ModuleDeclaration */; // module A.|
case 15 /* OpenBraceToken */:
return containingNodeKind === 217 /* ClassDeclaration */; // class A{ |
case 56 /* EqualsToken */:
return containingNodeKind === 214 /* VariableDeclaration */ // const x = a|
|| containingNodeKind === 184 /* BinaryExpression */; // x = a|
case 12 /* TemplateHead */:
return containingNodeKind === 186 /* TemplateExpression */; // `aa ${|
case 13 /* TemplateMiddle */:
return containingNodeKind === 193 /* TemplateSpan */; // `aa ${10} dd ${|
case 112 /* PublicKeyword */:
case 110 /* PrivateKeyword */:
case 111 /* ProtectedKeyword */:
return containingNodeKind === 142 /* PropertyDeclaration */; // class A{ public |
}
// Previous token may have been a keyword that was converted to an identifier.
switch (previousToken.getText()) {
case "public":
case "protected":
case "private":
return true;
}
}
return false;
}
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) {
if (contextToken.kind === 9 /* StringLiteral */
|| contextToken.kind === 163 /* StringLiteralType */
|| contextToken.kind === 10 /* RegularExpressionLiteral */
|| ts.isTemplateLiteralKind(contextToken.kind)) {
var start_2 = contextToken.getStart();
var end = contextToken.getEnd();
// To be "in" one of these literals, the position has to be:
// 1. entirely within the token text.
// 2. at the end position of an unterminated token.
// 3. at the end of a regular expression (due to trailing flags like '/foo/g').
if (start_2 < position && position < end) {
return true;
}
if (position === end) {
return !!contextToken.isUnterminated
|| contextToken.kind === 10 /* RegularExpressionLiteral */;
}
}
return false;
}
/**
* Aggregates relevant symbols for completion in object literals and object binding patterns.
* Relevant symbols are stored in the captured 'symbols' variable.
*
* @returns true if 'symbols' was successfully populated; false otherwise.
*/
function tryGetObjectLikeCompletionSymbols(objectLikeContainer) {
// We're looking up possible property names from contextual/inferred/declared type.
isMemberCompletion = true;
var typeForObject;
var existingMembers;
if (objectLikeContainer.kind === 168 /* ObjectLiteralExpression */) {
// We are completing on contextual types, but may also include properties
// other than those within the declared type.
isNewIdentifierLocation = true;
typeForObject = typeChecker.getContextualType(objectLikeContainer);
existingMembers = objectLikeContainer.properties;
}
else if (objectLikeContainer.kind === 164 /* ObjectBindingPattern */) {
// We are *only* completing on properties from the type being destructured.
isNewIdentifierLocation = false;
var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent);
if (ts.isVariableLike(rootDeclaration)) {
// We don't want to complete using the type acquired by the shape
// of the binding pattern; we are only interested in types acquired
// through type declaration or inference.
if (rootDeclaration.initializer || rootDeclaration.type) {
typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer);
existingMembers = objectLikeContainer.elements;
}
}
else {
ts.Debug.fail("Root declaration is not variable-like.");
}
}
else {
ts.Debug.fail("Expected object literal or binding pattern, got " + objectLikeContainer.kind);
}
if (!typeForObject) {
return false;
}
var typeMembers = typeChecker.getPropertiesOfType(typeForObject);
if (typeMembers && typeMembers.length > 0) {
// Add filtered items to the completion list
symbols = filterObjectMembersList(typeMembers, existingMembers);
}
return true;
}
/**
* Aggregates relevant symbols for completion in import clauses and export clauses
* whose declarations have a module specifier; for instance, symbols will be aggregated for
*
* import { | } from "moduleName";
* export { a as foo, | } from "moduleName";
*
* but not for
*
* export { | };
*
* Relevant symbols are stored in the captured 'symbols' variable.
*
* @returns true if 'symbols' was successfully populated; false otherwise.
*/
function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) {
var declarationKind = namedImportsOrExports.kind === 228 /* NamedImports */ ?
225 /* ImportDeclaration */ :
231 /* ExportDeclaration */;
var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind);
var moduleSpecifier = importOrExportDeclaration.moduleSpecifier;
if (!moduleSpecifier) {
return false;
}
isMemberCompletion = true;
isNewIdentifierLocation = false;
var exports;
var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier);
if (moduleSpecifierSymbol) {
exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
}
symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : emptyArray;
return true;
}
/**
* Returns the immediate owning object literal or binding pattern of a context token,
* on the condition that one exists and that the context implies completion should be given.
*/
function tryGetObjectLikeCompletionContainer(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
case 15 /* OpenBraceToken */: // const x = { |
case 24 /* CommaToken */:
var parent_3 = contextToken.parent;
if (parent_3 && (parent_3.kind === 168 /* ObjectLiteralExpression */ || parent_3.kind === 164 /* ObjectBindingPattern */)) {
return parent_3;
}
break;
}
}
return undefined;
}
/**
* Returns the containing list of named imports or exports of a context token,
* on the condition that one exists and that the context implies completion should be given.
*/
function tryGetNamedImportsOrExportsForCompletion(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
case 15 /* OpenBraceToken */: // import { |
case 24 /* CommaToken */:
switch (contextToken.parent.kind) {
case 228 /* NamedImports */:
case 232 /* NamedExports */:
return contextToken.parent;
}
}
}
return undefined;
}
function tryGetContainingJsxElement(contextToken) {
if (contextToken) {
var parent_4 = contextToken.parent;
switch (contextToken.kind) {
case 26 /* LessThanSlashToken */:
case 39 /* SlashToken */:
case 69 /* Identifier */:
case 241 /* JsxAttribute */:
case 242 /* JsxSpreadAttribute */:
if (parent_4 && (parent_4.kind === 237 /* JsxSelfClosingElement */ || parent_4.kind === 238 /* JsxOpeningElement */)) {
return parent_4;
}
else if (parent_4.kind === 241 /* JsxAttribute */) {
return parent_4.parent;
}
break;
// The context token is the closing } or " of an attribute, which means
// its parent is a JsxExpression, whose parent is a JsxAttribute,
// whose parent is a JsxOpeningLikeElement
case 9 /* StringLiteral */:
if (parent_4 && ((parent_4.kind === 241 /* JsxAttribute */) || (parent_4.kind === 242 /* JsxSpreadAttribute */))) {
return parent_4.parent;
}
break;
case 16 /* CloseBraceToken */:
if (parent_4 &&
parent_4.kind === 243 /* JsxExpression */ &&
parent_4.parent &&
(parent_4.parent.kind === 241 /* JsxAttribute */)) {
return parent_4.parent.parent;
}
if (parent_4 && parent_4.kind === 242 /* JsxSpreadAttribute */) {
return parent_4.parent;
}
break;
}
}
return undefined;
}
function isFunction(kind) {
switch (kind) {
case 176 /* FunctionExpression */:
case 177 /* ArrowFunction */:
case 216 /* FunctionDeclaration */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
case 148 /* CallSignature */:
case 149 /* ConstructSignature */:
case 150 /* IndexSignature */:
return true;
}
return false;
}
/**
* @returns true if we are certain that the currently edited location must define a new location; false otherwise.
*/
function isSolelyIdentifierDefinitionLocation(contextToken) {
var containingNodeKind = contextToken.parent.kind;
switch (contextToken.kind) {
case 24 /* CommaToken */:
return containingNodeKind === 214 /* VariableDeclaration */ ||
containingNodeKind === 215 /* VariableDeclarationList */ ||
containingNodeKind === 196 /* VariableStatement */ ||
containingNodeKind === 220 /* EnumDeclaration */ ||
isFunction(containingNodeKind) ||
containingNodeKind === 217 /* ClassDeclaration */ ||
containingNodeKind === 189 /* ClassExpression */ ||
containingNodeKind === 218 /* InterfaceDeclaration */ ||
containingNodeKind === 165 /* ArrayBindingPattern */ ||
containingNodeKind === 219 /* TypeAliasDeclaration */; // type Map, K, |
case 21 /* DotToken */:
return containingNodeKind === 165 /* ArrayBindingPattern */; // var [.|
case 54 /* ColonToken */:
return containingNodeKind === 166 /* BindingElement */; // var {x :html|
case 19 /* OpenBracketToken */:
return containingNodeKind === 165 /* ArrayBindingPattern */; // var [x|
case 17 /* OpenParenToken */:
return containingNodeKind === 247 /* CatchClause */ ||
isFunction(containingNodeKind);
case 15 /* OpenBraceToken */:
return containingNodeKind === 220 /* EnumDeclaration */ ||
containingNodeKind === 218 /* InterfaceDeclaration */ ||
containingNodeKind === 156 /* TypeLiteral */; // const x : { |
case 23 /* SemicolonToken */:
return containingNodeKind === 141 /* PropertySignature */ &&
contextToken.parent && contextToken.parent.parent &&
(contextToken.parent.parent.kind === 218 /* InterfaceDeclaration */ ||
contextToken.parent.parent.kind === 156 /* TypeLiteral */); // const x : { a; |
case 25 /* LessThanToken */:
return containingNodeKind === 217 /* ClassDeclaration */ ||
containingNodeKind === 189 /* ClassExpression */ ||
containingNodeKind === 218 /* InterfaceDeclaration */ ||
containingNodeKind === 219 /* TypeAliasDeclaration */ ||
isFunction(containingNodeKind);
case 113 /* StaticKeyword */:
return containingNodeKind === 142 /* PropertyDeclaration */;
case 22 /* DotDotDotToken */:
return containingNodeKind === 139 /* Parameter */ ||
(contextToken.parent && contextToken.parent.parent &&
contextToken.parent.parent.kind === 165 /* ArrayBindingPattern */); // var [...z|
case 112 /* PublicKeyword */:
case 110 /* PrivateKeyword */:
case 111 /* ProtectedKeyword */:
return containingNodeKind === 139 /* Parameter */;
case 116 /* AsKeyword */:
return containingNodeKind === 229 /* ImportSpecifier */ ||
containingNodeKind === 233 /* ExportSpecifier */ ||
containingNodeKind === 227 /* NamespaceImport */;
case 73 /* ClassKeyword */:
case 81 /* EnumKeyword */:
case 107 /* InterfaceKeyword */:
case 87 /* FunctionKeyword */:
case 102 /* VarKeyword */:
case 123 /* GetKeyword */:
case 129 /* SetKeyword */:
case 89 /* ImportKeyword */:
case 108 /* LetKeyword */:
case 74 /* ConstKeyword */:
case 114 /* YieldKeyword */:
case 132 /* TypeKeyword */:
return true;
}
// Previous token may have been a keyword that was converted to an identifier.
switch (contextToken.getText()) {
case "abstract":
case "async":
case "class":
case "const":
case "declare":
case "enum":
case "function":
case "interface":
case "let":
case "private":
case "protected":
case "public":
case "static":
case "var":
case "yield":
return true;
}
return false;
}
function isDotOfNumericLiteral(contextToken) {
if (contextToken.kind === 8 /* NumericLiteral */) {
var text = contextToken.getFullText();
return text.charAt(text.length - 1) === ".";
}
return false;
}
/**
* Filters out completion suggestions for named imports or exports.
*
* @param exportsOfModule The list of symbols which a module exposes.
* @param namedImportsOrExports The list of existing import/export specifiers in the import/export clause.
*
* @returns Symbols to be suggested at an import/export clause, barring those whose named imports/exports
* do not occur at the current position and have not otherwise been typed.
*/
function filterNamedImportOrExportCompletionItems(exportsOfModule, namedImportsOrExports) {
var exisingImportsOrExports = {};
for (var _i = 0, namedImportsOrExports_1 = namedImportsOrExports; _i < namedImportsOrExports_1.length; _i++) {
var element = namedImportsOrExports_1[_i];
// If this is the current item we are editing right now, do not filter it out
if (element.getStart() <= position && position <= element.getEnd()) {
continue;
}
var name_1 = element.propertyName || element.name;
exisingImportsOrExports[name_1.text] = true;
}
if (ts.isEmpty(exisingImportsOrExports)) {
return exportsOfModule;
}
return ts.filter(exportsOfModule, function (e) { return !ts.lookUp(exisingImportsOrExports, e.name); });
}
/**
* Filters out completion suggestions for named imports or exports.
*
* @returns Symbols to be suggested in an object binding pattern or object literal expression, barring those whose declarations
* do not occur at the current position and have not otherwise been typed.
*/
function filterObjectMembersList(contextualMemberSymbols, existingMembers) {
if (!existingMembers || existingMembers.length === 0) {
return contextualMemberSymbols;
}
var existingMemberNames = {};
for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) {
var m = existingMembers_1[_i];
// Ignore omitted expressions for missing members
if (m.kind !== 248 /* PropertyAssignment */ &&
m.kind !== 249 /* ShorthandPropertyAssignment */ &&
m.kind !== 166 /* BindingElement */ &&
m.kind !== 144 /* MethodDeclaration */) {
continue;
}
// If this is the current item we are editing right now, do not filter it out
if (m.getStart() <= position && position <= m.getEnd()) {
continue;
}
var existingName = void 0;
if (m.kind === 166 /* BindingElement */ && m.propertyName) {
// include only identifiers in completion list
if (m.propertyName.kind === 69 /* Identifier */) {
existingName = m.propertyName.text;
}
}
else {
// TODO(jfreeman): Account for computed property name
// NOTE: if one only performs this step when m.name is an identifier,
// things like '__proto__' are not filtered out.
existingName = m.name.text;
}
existingMemberNames[existingName] = true;
}
return ts.filter(contextualMemberSymbols, function (m) { return !ts.lookUp(existingMemberNames, m.name); });
}
/**
* Filters out completion suggestions from 'symbols' according to existing JSX attributes.
*
* @returns Symbols to be suggested in a JSX element, barring those whose attributes
* do not occur at the current position and have not otherwise been typed.
*/
function filterJsxAttributes(symbols, attributes) {
var seenNames = {};
for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
var attr = attributes_1[_i];
// If this is the current item we are editing right now, do not filter it out
if (attr.getStart() <= position && position <= attr.getEnd()) {
continue;
}
if (attr.kind === 241 /* JsxAttribute */) {
seenNames[attr.name.text] = true;
}
}
return ts.filter(symbols, function (a) { return !ts.lookUp(seenNames, a.name); });
}
}
function getCompletionsAtPosition(fileName, position) {
synchronizeHostData();
var completionData = getCompletionData(fileName, position);
if (!completionData) {
return undefined;
}
var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot, isJsDocTagName = completionData.isJsDocTagName;
if (isJsDocTagName) {
// If the current position is a jsDoc tag name, only tag names should be provided for completion
return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() };
}
var sourceFile = getValidSourceFile(fileName);
var entries = [];
if (isRightOfDot && ts.isSourceFileJavaScript(sourceFile)) {
var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries);
ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames));
}
else {
if (!symbols || symbols.length === 0) {
if (sourceFile.languageVariant === 1 /* JSX */ &&
location.parent && location.parent.kind === 240 /* JsxClosingElement */) {
// In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag,
// instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element.
// For example:
// var x = <div> </ /*1*/> completion list at "1" will contain "div" with type any
var tagName = location.parent.parent.openingElement.tagName;
entries.push({
name: tagName.text,
kind: undefined,
kindModifiers: undefined,
sortText: "0",
});
}
else {
return undefined;
}
}
getCompletionEntriesFromSymbols(symbols, entries);
}
// Add keywords if this is not a member completion list
if (!isMemberCompletion && !isJsDocTagName) {
ts.addRange(entries, keywordCompletions);
}
return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries };
function getJavaScriptCompletionEntries(sourceFile, uniqueNames) {
var entries = [];
var target = program.getCompilerOptions().target;
var nameTable = getNameTable(sourceFile);
for (var name_2 in nameTable) {
if (!uniqueNames[name_2]) {
uniqueNames[name_2] = name_2;
var displayName = getCompletionEntryDisplayName(name_2, target, /*performCharacterChecks*/ true);
if (displayName) {
var entry = {
name: displayName,
kind: ScriptElementKind.warning,
kindModifiers: "",
sortText: "1"
};
entries.push(entry);
}
}
}
return entries;
}
function getAllJsDocCompletionEntries() {
return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
return {
name: tagName,
kind: ScriptElementKind.keyword,
kindModifiers: "",
sortText: "0",
};
}));
}
function createCompletionEntry(symbol, location) {
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
// We would like to only show things that can be added after a dot, so for instance numeric properties can
// not be accessed with a dot (a.1 <- invalid)
var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks*/ true, location);
if (!displayName) {
return undefined;
}
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
// really we should consider passing the meaning for the node so that we don't report
// that a suggestion for a value is an interface. We COULD also just do what
// 'getSymbolModifiers' does, which is to use the first declaration.
// Use a 'sortText' of 0' so that all symbol completion entries come before any other
// entries (like JavaScript identifier entries).
return {
name: displayName,
kind: getSymbolKind(symbol, location),
kindModifiers: getSymbolModifiers(symbol),
sortText: "0",
};
}
function getCompletionEntriesFromSymbols(symbols, entries) {
var start = new Date().getTime();
var uniqueNames = {};
if (symbols) {
for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
var symbol = symbols_1[_i];
var entry = createCompletionEntry(symbol, location);
if (entry) {
var id = ts.escapeIdentifier(entry.name);
if (!ts.lookUp(uniqueNames, id)) {
entries.push(entry);
uniqueNames[id] = id;
}
}
}
}
log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start));
return uniqueNames;
}
}
function getCompletionEntryDetails(fileName, position, entryName) {
synchronizeHostData();
// Compute all the completion symbols again.
var completionData = getCompletionData(fileName, position);
if (completionData) {
var symbols = completionData.symbols, location_1 = completionData.location;
// Find the symbol with the matching entry name.
var target = program.getCompilerOptions().target;
// We don't need to perform character checks here because we're only comparing the
// name against 'entryName' (which is known to be good), not building a new
// completion entry.
var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks*/ false, location_1) === entryName ? s : undefined; });
if (symbol) {
var _a = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_1, location_1, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind;
return {
name: entryName,
kindModifiers: getSymbolModifiers(symbol),
kind: symbolKind,
displayParts: displayParts,
documentation: documentation
};
}
}
// Didn't find a symbol with this name. See if we can find a keyword instead.
var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; });
if (keywordCompletion) {
return {
name: entryName,
kind: ScriptElementKind.keyword,
kindModifiers: ScriptElementKindModifier.none,
displayParts: [ts.displayPart(entryName, SymbolDisplayPartKind.keyword)],
documentation: undefined
};
}
return undefined;
}
// TODO(drosen): use contextual SemanticMeaning.
function getSymbolKind(symbol, location) {
var flags = symbol.getFlags();
if (flags & 32 /* Class */)
return ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */) ?
ScriptElementKind.localClassElement : ScriptElementKind.classElement;
if (flags & 384 /* Enum */)
return ScriptElementKind.enumElement;
if (flags & 524288 /* TypeAlias */)
return ScriptElementKind.typeElement;
if (flags & 64 /* Interface */)
return ScriptElementKind.interfaceElement;
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
if (result === ScriptElementKind.unknown) {
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
if (flags & 8 /* EnumMember */)
return ScriptElementKind.variableElement;
if (flags & 8388608 /* Alias */)
return ScriptElementKind.alias;
if (flags & 1536 /* Module */)
return ScriptElementKind.moduleElement;
}
return result;
}
function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) {
var typeChecker = program.getTypeChecker();
if (typeChecker.isUndefinedSymbol(symbol)) {
return ScriptElementKind.variableElement;
}
if (typeChecker.isArgumentsSymbol(symbol)) {
return ScriptElementKind.localVariableElement;
}
if (flags & 3 /* Variable */) {
if (ts.isFirstDeclarationOfSymbolParameter(symbol)) {
return ScriptElementKind.parameterElement;
}
else if (symbol.valueDeclaration && ts.isConst(symbol.valueDeclaration)) {
return ScriptElementKind.constElement;
}
else if (ts.forEach(symbol.declarations, ts.isLet)) {
return ScriptElementKind.letElement;
}
return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement;
}
if (flags & 16 /* Function */)
return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement;
if (flags & 32768 /* GetAccessor */)
return ScriptElementKind.memberGetAccessorElement;
if (flags & 65536 /* SetAccessor */)
return ScriptElementKind.memberSetAccessorElement;
if (flags & 8192 /* Method */)
return ScriptElementKind.memberFunctionElement;
if (flags & 16384 /* Constructor */)
return ScriptElementKind.constructorImplementationElement;
if (flags & 4 /* Property */) {
if (flags & 268435456 /* SyntheticProperty */) {
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
var rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
return ScriptElementKind.memberVariableElement;
}
ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */));
});
if (!unionPropertyKind) {
// If this was union of all methods,
// make sure it has call signatures before we can label it as method
var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
return ScriptElementKind.memberFunctionElement;
}
return ScriptElementKind.memberVariableElement;
}
return unionPropertyKind;
}
return ScriptElementKind.memberVariableElement;
}
return ScriptElementKind.unknown;
}
function getSymbolModifiers(symbol) {
return symbol && symbol.declarations && symbol.declarations.length > 0
? ts.getNodeModifiers(symbol.declarations[0])
: ScriptElementKindModifier.none;
}
// TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) {
if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); }
var typeChecker = program.getTypeChecker();
var displayParts = [];
var documentation;
var symbolFlags = symbol.flags;
var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
var hasAddedSymbolInfo;
var type;
// Class at constructor site need to be shown as constructor apart from property,method, vars
if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 8388608 /* Alias */) {
// If it is accessor they are allowed only if location is at name of the accessor
if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) {
symbolKind = ScriptElementKind.memberVariableElement;
}
var signature;
type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
if (location.parent && location.parent.kind === 169 /* PropertyAccessExpression */) {
var right = location.parent.name;
// Either the location is on the right of a property access, or on the left and the right is missing
if (right === location || (right && right.getFullWidth() === 0)) {
location = location.parent;
}
}
// try get the call/construct signature from the type if it matches
var callExpression;
if (location.kind === 171 /* CallExpression */ || location.kind === 172 /* NewExpression */) {
callExpression = location;
}
else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) {
callExpression = location.parent;
}
if (callExpression) {
var candidateSignatures = [];
signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
// Use the first candidate:
signature = candidateSignatures[0];
}
var useConstructSignatures = callExpression.kind === 172 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */;
var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) {
// Get the first signature if there is one -- allSignatures may contain
// either the original signature or its target, so check for either
signature = allSignatures.length ? allSignatures[0] : undefined;
}
if (signature) {
if (useConstructSignatures && (symbolFlags & 32 /* Class */)) {
// Constructor
symbolKind = ScriptElementKind.constructorImplementationElement;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else if (symbolFlags & 8388608 /* Alias */) {
symbolKind = ScriptElementKind.alias;
pushTypePart(symbolKind);
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
displayParts.push(ts.keywordPart(92 /* NewKeyword */));
displayParts.push(ts.spacePart());
}
addFullSymbolName(symbol);
}
else {
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
}
switch (symbolKind) {
case ScriptElementKind.memberVariableElement:
case ScriptElementKind.variableElement:
case ScriptElementKind.constElement:
case ScriptElementKind.letElement:
case ScriptElementKind.parameterElement:
case ScriptElementKind.localVariableElement:
// If it is call or construct signature of lambda's write type name
displayParts.push(ts.punctuationPart(54 /* ColonToken */));
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
displayParts.push(ts.keywordPart(92 /* NewKeyword */));
displayParts.push(ts.spacePart());
}
if (!(type.flags & 65536 /* Anonymous */)) {
ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */));
}
addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */);
break;
default:
// Just signature
addSignatureDisplayParts(signature, allSignatures);
}
hasAddedSymbolInfo = true;
}
}
else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) ||
(location.kind === 121 /* ConstructorKeyword */ && location.parent.kind === 145 /* Constructor */)) {
// get the signature from the declaration and write it
var functionDeclaration = location.parent;
var allSignatures = functionDeclaration.kind === 145 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures();
if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
}
if (functionDeclaration.kind === 145 /* Constructor */) {
// show (constructor) Type(...) signature
symbolKind = ScriptElementKind.constructorImplementationElement;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else {
// (function/method) symbol(..signature)
addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 148 /* CallSignature */ &&
!(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
}
addSignatureDisplayParts(signature, allSignatures);
hasAddedSymbolInfo = true;
}
}
}
if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) {
if (ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */)) {
// Special case for class expressions because we would like to indicate that
// the class name is local to the class body (similar to function expression)
// (local class) class <className>
pushTypePart(ScriptElementKind.localClassElement);
}
else {
// Class declaration has name which is not local.
displayParts.push(ts.keywordPart(73 /* ClassKeyword */));
}
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
}
if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) {
addNewLineIfDisplayPartsExist();
displayParts.push(ts.keywordPart(107 /* InterfaceKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
}
if (symbolFlags & 524288 /* TypeAlias */) {
addNewLineIfDisplayPartsExist();
displayParts.push(ts.keywordPart(132 /* TypeKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(56 /* EqualsToken */));
displayParts.push(ts.spacePart());
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
}
if (symbolFlags & 384 /* Enum */) {
addNewLineIfDisplayPartsExist();
if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) {
displayParts.push(ts.keywordPart(74 /* ConstKeyword */));
displayParts.push(ts.spacePart());
}
displayParts.push(ts.keywordPart(81 /* EnumKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if (symbolFlags & 1536 /* Module */) {
addNewLineIfDisplayPartsExist();
var declaration = ts.getDeclarationOfKind(symbol, 221 /* ModuleDeclaration */);
var isNamespace = declaration && declaration.name && declaration.name.kind === 69 /* Identifier */;
displayParts.push(ts.keywordPart(isNamespace ? 126 /* NamespaceKeyword */ : 125 /* ModuleKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) {
addNewLineIfDisplayPartsExist();
displayParts.push(ts.punctuationPart(17 /* OpenParenToken */));
displayParts.push(ts.textPart("type parameter"));
displayParts.push(ts.punctuationPart(18 /* CloseParenToken */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
displayParts.push(ts.spacePart());
displayParts.push(ts.keywordPart(90 /* InKeyword */));
displayParts.push(ts.spacePart());
if (symbol.parent) {
// Class/Interface type parameter
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
}
else {
// Method/function type parameter
var declaration = ts.getDeclarationOfKind(symbol, 138 /* TypeParameter */);
ts.Debug.assert(declaration !== undefined);
declaration = declaration.parent;
if (declaration) {
if (ts.isFunctionLikeKind(declaration.kind)) {
var signature = typeChecker.getSignatureFromDeclaration(declaration);
if (declaration.kind === 149 /* ConstructSignature */) {
displayParts.push(ts.keywordPart(92 /* NewKeyword */));
displayParts.push(ts.spacePart());
}
else if (declaration.kind !== 148 /* CallSignature */ && declaration.name) {
addFullSymbolName(declaration.symbol);
}
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
}
else {
// Type alias type parameter
// For example
// type list<T> = T[]; // Both T will go through same code path
displayParts.push(ts.keywordPart(132 /* TypeKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(declaration.symbol);
writeTypeParametersOfSymbol(declaration.symbol, sourceFile);
}
}
}
}
if (symbolFlags & 8 /* EnumMember */) {
addPrefixForAnyFunctionOrVar(symbol, "enum member");
var declaration = symbol.declarations[0];
if (declaration.kind === 250 /* EnumMember */) {
var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(56 /* EqualsToken */));
displayParts.push(ts.spacePart());
displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral));
}
}
}
if (symbolFlags & 8388608 /* Alias */) {
addNewLineIfDisplayPartsExist();
displayParts.push(ts.keywordPart(89 /* ImportKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
ts.forEach(symbol.declarations, function (declaration) {
if (declaration.kind === 224 /* ImportEqualsDeclaration */) {
var importEqualsDeclaration = declaration;
if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(56 /* EqualsToken */));
displayParts.push(ts.spacePart());
displayParts.push(ts.keywordPart(127 /* RequireKeyword */));
displayParts.push(ts.punctuationPart(17 /* OpenParenToken */));
displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral));
displayParts.push(ts.punctuationPart(18 /* CloseParenToken */));
}
else {
var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(56 /* EqualsToken */));
displayParts.push(ts.spacePart());
addFullSymbolName(internalAliasSymbol, enclosingDeclaration);
}
}
return true;
}
});
}
if (!hasAddedSymbolInfo) {
if (symbolKind !== ScriptElementKind.unknown) {
if (type) {
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
// For properties, variables and local vars: show the type
if (symbolKind === ScriptElementKind.memberVariableElement ||
symbolFlags & 3 /* Variable */ ||
symbolKind === ScriptElementKind.localVariableElement) {
displayParts.push(ts.punctuationPart(54 /* ColonToken */));
displayParts.push(ts.spacePart());
// If the type is type parameter, format it specially
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
});
ts.addRange(displayParts, typeParameterParts);
}
else {
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration));
}
}
else if (symbolFlags & 16 /* Function */ ||
symbolFlags & 8192 /* Method */ ||
symbolFlags & 16384 /* Constructor */ ||
symbolFlags & 131072 /* Signature */ ||
symbolFlags & 98304 /* Accessor */ ||
symbolKind === ScriptElementKind.memberFunctionElement) {
var allSignatures = type.getCallSignatures();
addSignatureDisplayParts(allSignatures[0], allSignatures);
}
}
}
else {
symbolKind = getSymbolKind(symbol, location);
}
}
if (!documentation) {
documentation = symbol.getDocumentationComment();
}
return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind };
function addNewLineIfDisplayPartsExist() {
if (displayParts.length) {
displayParts.push(ts.lineBreakPart());
}
}
function addFullSymbolName(symbol, enclosingDeclaration) {
var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */);
ts.addRange(displayParts, fullSymbolDisplayParts);
}
function addPrefixForAnyFunctionOrVar(symbol, symbolKind) {
addNewLineIfDisplayPartsExist();
if (symbolKind) {
pushTypePart(symbolKind);
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
}
function pushTypePart(symbolKind) {
switch (symbolKind) {
case ScriptElementKind.variableElement:
case ScriptElementKind.functionElement:
case ScriptElementKind.letElement:
case ScriptElementKind.constElement:
case ScriptElementKind.constructorImplementationElement:
displayParts.push(ts.textOrKeywordPart(symbolKind));
return;
default:
displayParts.push(ts.punctuationPart(17 /* OpenParenToken */));
displayParts.push(ts.textOrKeywordPart(symbolKind));
displayParts.push(ts.punctuationPart(18 /* CloseParenToken */));
return;
}
}
function addSignatureDisplayParts(signature, allSignatures, flags) {
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
displayParts.push(ts.punctuationPart(17 /* OpenParenToken */));
displayParts.push(ts.operatorPart(35 /* PlusToken */));
displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral));
displayParts.push(ts.spacePart());
displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads"));
displayParts.push(ts.punctuationPart(18 /* CloseParenToken */));
}
documentation = signature.getDocumentationComment();
}
function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
});
ts.addRange(displayParts, typeParameterParts);
}
}
function getQuickInfoAtPosition(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, position);
if (!node) {
return undefined;
}
if (isLabelName(node)) {
return undefined;
}
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol || typeChecker.isUnknownSymbol(symbol)) {
// Try getting just type at this position and show
switch (node.kind) {
case 69 /* Identifier */:
case 169 /* PropertyAccessExpression */:
case 136 /* QualifiedName */:
case 97 /* ThisKeyword */:
case 162 /* ThisType */:
case 95 /* SuperKeyword */:
// For the identifiers/this/super etc get the type at position
var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)),
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
};
}
}
return undefined;
}
var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
return {
kind: displayPartsDocumentationsAndKind.symbolKind,
kindModifiers: getSymbolModifiers(symbol),
textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
displayParts: displayPartsDocumentationsAndKind.displayParts,
documentation: displayPartsDocumentationsAndKind.documentation
};
}
function createDefinitionInfo(node, symbolKind, symbolName, containerName) {
return {
fileName: node.getSourceFile().fileName,
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()),
kind: symbolKind,
name: symbolName,
containerKind: undefined,
containerName: containerName
};
}
function getDefinitionFromSymbol(symbol, node) {
var typeChecker = program.getTypeChecker();
var result = [];
var declarations = symbol.getDeclarations();
var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
var symbolKind = getSymbolKind(symbol, node);
var containerSymbol = symbol.parent;
var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
// Just add all the declarations.
ts.forEach(declarations, function (declaration) {
result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName));
});
}
return result;
function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) {
// Applicable only if we are in a new expression, or we are on a constructor declaration
// and in either case the symbol has a construct signature definition, i.e. class
if (isNewExpressionTarget(location) || location.kind === 121 /* ConstructorKeyword */) {
if (symbol.flags & 32 /* Class */) {
// Find the first class-like declaration and try to get the construct signature.
for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) {
var declaration = _a[_i];
if (ts.isClassLike(declaration)) {
return tryAddSignature(declaration.members,
/*selectConstructors*/ true, symbolKind, symbolName, containerName, result);
}
}
ts.Debug.fail("Expected declaration to have at least one class-like declaration");
}
}
return false;
}
function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) {
if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) {
return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result);
}
return false;
}
function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) {
var declarations = [];
var definition;
ts.forEach(signatureDeclarations, function (d) {
if ((selectConstructors && d.kind === 145 /* Constructor */) ||
(!selectConstructors && (d.kind === 216 /* FunctionDeclaration */ || d.kind === 144 /* MethodDeclaration */ || d.kind === 143 /* MethodSignature */))) {
declarations.push(d);
if (d.body)
definition = d;
}
});
if (definition) {
result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName));
return true;
}
else if (declarations.length) {
result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName));
return true;
}
return false;
}
}
/// Goto definition
function getDefinitionAtPosition(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, position);
if (!node) {
return undefined;
}
// Labels
if (isJumpStatementTarget(node)) {
var labelName = node.text;
var label = getTargetLabel(node.parent, node.text);
return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined;
}
/// Triple slash reference comments
var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; });
if (comment) {
var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment);
if (referenceFile) {
return [{
fileName: referenceFile.fileName,
textSpan: ts.createTextSpanFromBounds(0, 0),
kind: ScriptElementKind.scriptElement,
name: comment.fileName,
containerName: undefined,
containerKind: undefined
}];
}
return undefined;
}
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
if (!symbol) {
return undefined;
}
// If this is an alias, and the request came at the declaration location
// get the aliased symbol instead. This allows for goto def on an import e.g.
// import {A, B} from "mod";
// to jump to the implementation directly.
if (symbol.flags & 8388608 /* Alias */) {
var declaration = symbol.declarations[0];
if (node.kind === 69 /* Identifier */ && node.parent === declaration) {
symbol = typeChecker.getAliasedSymbol(symbol);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
// using go-to-definition at such position should go to the variable declaration of the property value rather than
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === 249 /* ShorthandPropertyAssignment */) {
var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
if (!shorthandSymbol) {
return [];
}
var shorthandDeclarations = shorthandSymbol.getDeclarations();
var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); });
}
return getDefinitionFromSymbol(symbol, node);
}
/// Goto type
function getTypeDefinitionAtPosition(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, position);
if (!node) {
return undefined;
}
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
return undefined;
}
var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
if (!type) {
return undefined;
}
if (type.flags & 16384 /* Union */) {
var result = [];
ts.forEach(type.types, function (t) {
if (t.symbol) {
ts.addRange(/*to*/ result, /*from*/ getDefinitionFromSymbol(t.symbol, node));
}
});
return result;
}
if (!type.symbol) {
return undefined;
}
return getDefinitionFromSymbol(type.symbol, node);
}
function getOccurrencesAtPosition(fileName, position) {
var results = getOccurrencesAtPositionCore(fileName, position);
if (results) {
var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName));
// Get occurrences only supports reporting occurrences for the file queried. So
// filter down to that list.
results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; });
}
return results;
}
function getDocumentHighlights(fileName, position, filesToSearch) {
synchronizeHostData();
filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes);
var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); });
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingWord(sourceFile, position);
if (!node) {
return undefined;
}
return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node);
function getHighlightSpanForNode(node) {
var start = node.getStart();
var end = node.getEnd();
return {
fileName: sourceFile.fileName,
textSpan: ts.createTextSpanFromBounds(start, end),
kind: HighlightSpanKind.none
};
}
function getSemanticDocumentHighlights(node) {
if (node.kind === 69 /* Identifier */ ||
node.kind === 97 /* ThisKeyword */ ||
node.kind === 162 /* ThisType */ ||
node.kind === 95 /* SuperKeyword */ ||
isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
isNameOfExternalModuleImportOrDeclaration(node)) {
var referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false);
return convertReferencedSymbols(referencedSymbols);
}
return undefined;
function convertReferencedSymbols(referencedSymbols) {
if (!referencedSymbols) {
return undefined;
}
var fileNameToDocumentHighlights = {};
var result = [];
for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) {
var referencedSymbol = referencedSymbols_1[_i];
for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) {
var referenceEntry = _b[_a];
var fileName_1 = referenceEntry.fileName;
var documentHighlights = ts.getProperty(fileNameToDocumentHighlights, fileName_1);
if (!documentHighlights) {
documentHighlights = { fileName: fileName_1, highlightSpans: [] };
fileNameToDocumentHighlights[fileName_1] = documentHighlights;
result.push(documentHighlights);
}
documentHighlights.highlightSpans.push({
textSpan: referenceEntry.textSpan,
kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference
});
}
}
return result;
}
}
function getSyntacticDocumentHighlights(node) {
var fileName = sourceFile.fileName;
var highlightSpans = getHighlightSpans(node);
if (!highlightSpans || highlightSpans.length === 0) {
return undefined;
}
return [{ fileName: fileName, highlightSpans: highlightSpans }];
// returns true if 'node' is defined and has a matching 'kind'.
function hasKind(node, kind) {
return node !== undefined && node.kind === kind;
}
// Null-propagating 'parent' function.
function parent(node) {
return node && node.parent;
}
function getHighlightSpans(node) {
if (node) {
switch (node.kind) {
case 88 /* IfKeyword */:
case 80 /* ElseKeyword */:
if (hasKind(node.parent, 199 /* IfStatement */)) {
return getIfElseOccurrences(node.parent);
}
break;
case 94 /* ReturnKeyword */:
if (hasKind(node.parent, 207 /* ReturnStatement */)) {
return getReturnOccurrences(node.parent);
}
break;
case 98 /* ThrowKeyword */:
if (hasKind(node.parent, 211 /* ThrowStatement */)) {
return getThrowOccurrences(node.parent);
}
break;
case 72 /* CatchKeyword */:
if (hasKind(parent(parent(node)), 212 /* TryStatement */)) {
return getTryCatchFinallyOccurrences(node.parent.parent);
}
break;
case 100 /* TryKeyword */:
case 85 /* FinallyKeyword */:
if (hasKind(parent(node), 212 /* TryStatement */)) {
return getTryCatchFinallyOccurrences(node.parent);
}
break;
case 96 /* SwitchKeyword */:
if (hasKind(node.parent, 209 /* SwitchStatement */)) {
return getSwitchCaseDefaultOccurrences(node.parent);
}
break;
case 71 /* CaseKeyword */:
case 77 /* DefaultKeyword */:
if (hasKind(parent(parent(parent(node))), 209 /* SwitchStatement */)) {
return getSwitchCaseDefaultOccurrences(node.parent.parent.parent);
}
break;
case 70 /* BreakKeyword */:
case 75 /* ContinueKeyword */:
if (hasKind(node.parent, 206 /* BreakStatement */) || hasKind(node.parent, 205 /* ContinueStatement */)) {
return getBreakOrContinueStatementOccurrences(node.parent);
}
break;
case 86 /* ForKeyword */:
if (hasKind(node.parent, 202 /* ForStatement */) ||
hasKind(node.parent, 203 /* ForInStatement */) ||
hasKind(node.parent, 204 /* ForOfStatement */)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
case 104 /* WhileKeyword */:
case 79 /* DoKeyword */:
if (hasKind(node.parent, 201 /* WhileStatement */) || hasKind(node.parent, 200 /* DoStatement */)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
case 121 /* ConstructorKeyword */:
if (hasKind(node.parent, 145 /* Constructor */)) {
return getConstructorOccurrences(node.parent);
}
break;
case 123 /* GetKeyword */:
case 129 /* SetKeyword */:
if (hasKind(node.parent, 146 /* GetAccessor */) || hasKind(node.parent, 147 /* SetAccessor */)) {
return getGetAndSetOccurrences(node.parent);
}
break;
default:
if (ts.isModifierKind(node.kind) && node.parent &&
(ts.isDeclaration(node.parent) || node.parent.kind === 196 /* VariableStatement */)) {
return getModifierOccurrences(node.kind, node.parent);
}
}
}
return undefined;
}
/**
* Aggregates all throw-statements within this node *without* crossing
* into function boundaries and try-blocks with catch-clauses.
*/
function aggregateOwnedThrowStatements(node) {
var statementAccumulator = [];
aggregate(node);
return statementAccumulator;
function aggregate(node) {
if (node.kind === 211 /* ThrowStatement */) {
statementAccumulator.push(node);
}
else if (node.kind === 212 /* TryStatement */) {
var tryStatement = node;
if (tryStatement.catchClause) {
aggregate(tryStatement.catchClause);
}
else {
// Exceptions thrown within a try block lacking a catch clause
// are "owned" in the current context.
aggregate(tryStatement.tryBlock);
}
if (tryStatement.finallyBlock) {
aggregate(tryStatement.finallyBlock);
}
}
else if (!ts.isFunctionLike(node)) {
ts.forEachChild(node, aggregate);
}
}
}
/**
* For lack of a better name, this function takes a throw statement and returns the
* nearest ancestor that is a try-block (whose try statement has a catch clause),
* function-block, or source file.
*/
function getThrowStatementOwner(throwStatement) {
var child = throwStatement;
while (child.parent) {
var parent_5 = child.parent;
if (ts.isFunctionBlock(parent_5) || parent_5.kind === 251 /* SourceFile */) {
return parent_5;
}
// A throw-statement is only owned by a try-statement if the try-statement has
// a catch clause, and if the throw-statement occurs within the try block.
if (parent_5.kind === 212 /* TryStatement */) {
var tryStatement = parent_5;
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
return child;
}
}
child = parent_5;
}
return undefined;
}
function aggregateAllBreakAndContinueStatements(node) {
var statementAccumulator = [];
aggregate(node);
return statementAccumulator;
function aggregate(node) {
if (node.kind === 206 /* BreakStatement */ || node.kind === 205 /* ContinueStatement */) {
statementAccumulator.push(node);
}
else if (!ts.isFunctionLike(node)) {
ts.forEachChild(node, aggregate);
}
}
}
function ownsBreakOrContinueStatement(owner, statement) {
var actualOwner = getBreakOrContinueOwner(statement);
return actualOwner && actualOwner === owner;
}
function getBreakOrContinueOwner(statement) {
for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) {
switch (node_1.kind) {
case 209 /* SwitchStatement */:
if (statement.kind === 205 /* ContinueStatement */) {
continue;
}
// Fall through.
case 202 /* ForStatement */:
case 203 /* ForInStatement */:
case 204 /* ForOfStatement */:
case 201 /* WhileStatement */:
case 200 /* DoStatement */:
if (!statement.label || isLabeledBy(node_1, statement.label.text)) {
return node_1;
}
break;
default:
// Don't cross function boundaries.
if (ts.isFunctionLike(node_1)) {
return undefined;
}
break;
}
}
return undefined;
}
function getModifierOccurrences(modifier, declaration) {
var container = declaration.parent;
// Make sure we only highlight the keyword when it makes sense to do so.
if (ts.isAccessibilityModifier(modifier)) {
if (!(container.kind === 217 /* ClassDeclaration */ ||
container.kind === 189 /* ClassExpression */ ||
(declaration.kind === 139 /* Parameter */ && hasKind(container, 145 /* Constructor */)))) {
return undefined;
}
}
else if (modifier === 113 /* StaticKeyword */) {
if (!(container.kind === 217 /* ClassDeclaration */ || container.kind === 189 /* ClassExpression */)) {
return undefined;
}
}
else if (modifier === 82 /* ExportKeyword */ || modifier === 122 /* DeclareKeyword */) {
if (!(container.kind === 222 /* ModuleBlock */ || container.kind === 251 /* SourceFile */)) {
return undefined;
}
}
else if (modifier === 115 /* AbstractKeyword */) {
if (!(container.kind === 217 /* ClassDeclaration */ || declaration.kind === 217 /* ClassDeclaration */)) {
return undefined;
}
}
else {
// unsupported modifier
return undefined;
}
var keywords = [];
var modifierFlag = getFlagFromModifier(modifier);
var nodes;
switch (container.kind) {
case 222 /* ModuleBlock */:
case 251 /* SourceFile */:
// Container is either a class declaration or the declaration is a classDeclaration
if (modifierFlag & 128 /* Abstract */) {
nodes = declaration.members.concat(declaration);
}
else {
nodes = container.statements;
}
break;
case 145 /* Constructor */:
nodes = container.parameters.concat(container.parent.members);
break;
case 217 /* ClassDeclaration */:
case 189 /* ClassExpression */:
nodes = container.members;
// If we're an accessibility modifier, we're in an instance member and should search
// the constructor's parameter list for instance members as well.
if (modifierFlag & 56 /* AccessibilityModifier */) {
var constructor = ts.forEach(container.members, function (member) {
return member.kind === 145 /* Constructor */ && member;
});
if (constructor) {
nodes = nodes.concat(constructor.parameters);
}
}
else if (modifierFlag & 128 /* Abstract */) {
nodes = nodes.concat(container);
}
break;
default:
ts.Debug.fail("Invalid container kind.");
}
ts.forEach(nodes, function (node) {
if (node.modifiers && node.flags & modifierFlag) {
ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); });
}
});
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
case 112 /* PublicKeyword */:
return 8 /* Public */;
case 110 /* PrivateKeyword */:
return 16 /* Private */;
case 111 /* ProtectedKeyword */:
return 32 /* Protected */;
case 113 /* StaticKeyword */:
return 64 /* Static */;
case 82 /* ExportKeyword */:
return 2 /* Export */;
case 122 /* DeclareKeyword */:
return 4 /* Ambient */;
case 115 /* AbstractKeyword */:
return 128 /* Abstract */;
default:
ts.Debug.fail();
}
}
}
function pushKeywordIf(keywordList, token) {
var expected = [];
for (var _i = 2; _i < arguments.length; _i++) {
expected[_i - 2] = arguments[_i];
}
if (token && ts.contains(expected, token.kind)) {
keywordList.push(token);
return true;
}
return false;
}
function getGetAndSetOccurrences(accessorDeclaration) {
var keywords = [];
tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* GetAccessor */);
tryPushAccessorKeyword(accessorDeclaration.symbol, 147 /* SetAccessor */);
return ts.map(keywords, getHighlightSpanForNode);
function tryPushAccessorKeyword(accessorSymbol, accessorKind) {
var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind);
if (accessor) {
ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 123 /* GetKeyword */, 129 /* SetKeyword */); });
}
}
}
function getConstructorOccurrences(constructorDeclaration) {
var declarations = constructorDeclaration.symbol.getDeclarations();
var keywords = [];
ts.forEach(declarations, function (declaration) {
ts.forEach(declaration.getChildren(), function (token) {
return pushKeywordIf(keywords, token, 121 /* ConstructorKeyword */);
});
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getLoopBreakContinueOccurrences(loopNode) {
var keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) {
// If we succeeded and got a do-while loop, then start looking for a 'while' keyword.
if (loopNode.kind === 200 /* DoStatement */) {
var loopTokens = loopNode.getChildren();
for (var i = loopTokens.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, loopTokens[i], 104 /* WhileKeyword */)) {
break;
}
}
}
}
var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(loopNode, statement)) {
pushKeywordIf(keywords, statement.getFirstToken(), 70 /* BreakKeyword */, 75 /* ContinueKeyword */);
}
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) {
var owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
case 202 /* ForStatement */:
case 203 /* ForInStatement */:
case 204 /* ForOfStatement */:
case 200 /* DoStatement */:
case 201 /* WhileStatement */:
return getLoopBreakContinueOccurrences(owner);
case 209 /* SwitchStatement */:
return getSwitchCaseDefaultOccurrences(owner);
}
}
return undefined;
}
function getSwitchCaseDefaultOccurrences(switchStatement) {
var keywords = [];
pushKeywordIf(keywords, switchStatement.getFirstToken(), 96 /* SwitchKeyword */);
// Go through each clause in the switch statement, collecting the 'case'/'default' keywords.
ts.forEach(switchStatement.caseBlock.clauses, function (clause) {
pushKeywordIf(keywords, clause.getFirstToken(), 71 /* CaseKeyword */, 77 /* DefaultKeyword */);
var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(switchStatement, statement)) {
pushKeywordIf(keywords, statement.getFirstToken(), 70 /* BreakKeyword */);
}
});
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getTryCatchFinallyOccurrences(tryStatement) {
var keywords = [];
pushKeywordIf(keywords, tryStatement.getFirstToken(), 100 /* TryKeyword */);
if (tryStatement.catchClause) {
pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 72 /* CatchKeyword */);
}
if (tryStatement.finallyBlock) {
var finallyKeyword = ts.findChildOfKind(tryStatement, 85 /* FinallyKeyword */, sourceFile);
pushKeywordIf(keywords, finallyKeyword, 85 /* FinallyKeyword */);
}
return ts.map(keywords, getHighlightSpanForNode);
}
function getThrowOccurrences(throwStatement) {
var owner = getThrowStatementOwner(throwStatement);
if (!owner) {
return undefined;
}
var keywords = [];
ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) {
pushKeywordIf(keywords, throwStatement.getFirstToken(), 98 /* ThrowKeyword */);
});
// If the "owner" is a function, then we equate 'return' and 'throw' statements in their
// ability to "jump out" of the function, and include occurrences for both.
if (ts.isFunctionBlock(owner)) {
ts.forEachReturnStatement(owner, function (returnStatement) {
pushKeywordIf(keywords, returnStatement.getFirstToken(), 94 /* ReturnKeyword */);
});
}
return ts.map(keywords, getHighlightSpanForNode);
}
function getReturnOccurrences(returnStatement) {
var func = ts.getContainingFunction(returnStatement);
// If we didn't find a containing function with a block body, bail out.
if (!(func && hasKind(func.body, 195 /* Block */))) {
return undefined;
}
var keywords = [];
ts.forEachReturnStatement(func.body, function (returnStatement) {
pushKeywordIf(keywords, returnStatement.getFirstToken(), 94 /* ReturnKeyword */);
});
// Include 'throw' statements that do not occur within a try block.
ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) {
pushKeywordIf(keywords, throwStatement.getFirstToken(), 98 /* ThrowKeyword */);
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getIfElseOccurrences(ifStatement) {
var keywords = [];
// Traverse upwards through all parent if-statements linked by their else-branches.
while (hasKind(ifStatement.parent, 199 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) {
ifStatement = ifStatement.parent;
}
// Now traverse back down through the else branches, aggregating if/else keywords of if-statements.
while (ifStatement) {
var children = ifStatement.getChildren();
pushKeywordIf(keywords, children[0], 88 /* IfKeyword */);
// Generally the 'else' keyword is second-to-last, so we traverse backwards.
for (var i = children.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, children[i], 80 /* ElseKeyword */)) {
break;
}
}
if (!hasKind(ifStatement.elseStatement, 199 /* IfStatement */)) {
break;
}
ifStatement = ifStatement.elseStatement;
}
var result = [];
// We'd like to highlight else/ifs together if they are only separated by whitespace
// (i.e. the keywords are separated by no comments, no newlines).
for (var i = 0; i < keywords.length; i++) {
if (keywords[i].kind === 80 /* ElseKeyword */ && i < keywords.length - 1) {
var elseKeyword = keywords[i];
var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword.
var shouldCombindElseAndIf = true;
// Avoid recalculating getStart() by iterating backwards.
for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) {
if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) {
shouldCombindElseAndIf = false;
break;
}
}
if (shouldCombindElseAndIf) {
result.push({
fileName: fileName,
textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end),
kind: HighlightSpanKind.reference
});
i++; // skip the next keyword
continue;
}
}
// Ordinary case: just highlight the keyword.
result.push(getHighlightSpanForNode(keywords[i]));
}
return result;
}
}
}
/// References and Occurrences
function getOccurrencesAtPositionCore(fileName, position) {
synchronizeHostData();
return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName]));
function convertDocumentHighlights(documentHighlights) {
if (!documentHighlights) {
return undefined;
}
var result = [];
for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) {
var entry = documentHighlights_1[_i];
for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) {
var highlightSpan = _b[_a];
result.push({
fileName: entry.fileName,
textSpan: highlightSpan.textSpan,
isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference
});
}
}
return result;
}
}
function convertReferences(referenceSymbols) {
if (!referenceSymbols) {
return undefined;
}
var referenceEntries = [];
for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) {
var referenceSymbol = referenceSymbols_1[_i];
ts.addRange(referenceEntries, referenceSymbol.references);
}
return referenceEntries;
}
function findRenameLocations(fileName, position, findInStrings, findInComments) {
var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments);
return convertReferences(referencedSymbols);
}
function getReferencesAtPosition(fileName, position) {
var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false);
return convertReferences(referencedSymbols);
}
function findReferences(fileName, position) {
var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false);
// Only include referenced symbols that have a valid definition.
return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; });
}
function findReferencedSymbols(fileName, position, findInStrings, findInComments) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, position);
if (!node) {
return undefined;
}
if (node.kind !== 69 /* Identifier */ &&
// TODO (drosen): This should be enabled in a later release - currently breaks rename.
// node.kind !== SyntaxKind.ThisKeyword &&
// node.kind !== SyntaxKind.SuperKeyword &&
!isLiteralNameOfPropertyDeclarationOrIndexAccess(node) &&
!isNameOfExternalModuleImportOrDeclaration(node)) {
return undefined;
}
ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 8 /* NumericLiteral */ || node.kind === 9 /* StringLiteral */);
return getReferencedSymbolsForNode(node, program.getSourceFiles(), findInStrings, findInComments);
}
function getReferencedSymbolsForNode(node, sourceFiles, findInStrings, findInComments) {
var typeChecker = program.getTypeChecker();
// Labels
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
var labelDefinition = getTargetLabel(node.parent, node.text);
// if we have a label definition, look within its statement for references, if not, then
// the label is undefined and we have no results..
return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined;
}
else {
// it is a label definition and not a target, search within the parent labeledStatement
return getLabelReferencesInNode(node.parent, node);
}
}
if (node.kind === 97 /* ThisKeyword */ || node.kind === 162 /* ThisType */) {
return getReferencesForThisKeyword(node, sourceFiles);
}
if (node.kind === 95 /* SuperKeyword */) {
return getReferencesForSuperKeyword(node);
}
var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. unknown identifier
if (!symbol) {
// Can't have references to something that we have no symbol for.
return undefined;
}
var declarations = symbol.declarations;
// The symbol was an internal symbol and does not have a declaration e.g. undefined symbol
if (!declarations || !declarations.length) {
return undefined;
}
var result;
// Compute the meaning from the location and the symbol it references
var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations);
// Get the text to search for.
// Note: if this is an external module symbol, the name doesn't include quotes.
var declaredName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node));
// Try to get the smallest valid scope that we can limit our search to;
// otherwise we'll need to search globally (i.e. include each file).
var scope = getSymbolScope(symbol);
// Maps from a symbol ID to the ReferencedSymbol entry in 'result'.
var symbolToIndex = [];
if (scope) {
result = [];
getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex);
}
else {
var internedName = getInternedName(symbol, node, declarations);
for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) {
var sourceFile = sourceFiles_1[_i];
cancellationToken.throwIfCancellationRequested();
var nameTable = getNameTable(sourceFile);
if (ts.lookUp(nameTable, internedName)) {
result = result || [];
getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex);
}
}
}
return result;
function getDefinition(symbol) {
var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
var name = ts.map(info.displayParts, function (p) { return p.text; }).join("");
var declarations = symbol.declarations;
if (!declarations || declarations.length === 0) {
return undefined;
}
return {
containerKind: "",
containerName: "",
name: name,
kind: info.symbolKind,
fileName: declarations[0].getSourceFile().fileName,
textSpan: ts.createTextSpan(declarations[0].getStart(), 0)
};
}
function isImportSpecifierSymbol(symbol) {
return (symbol.flags & 8388608 /* Alias */) && !!ts.getDeclarationOfKind(symbol, 229 /* ImportSpecifier */);
}
function getInternedName(symbol, location, declarations) {
// If this is an export or import specifier it could have been renamed using the 'as' syntax.
// If so we want to search for whatever under the cursor.
if (ts.isImportOrExportSpecifierName(location)) {
return location.getText();
}
// Try to get the local symbol if we're dealing with an 'export default'
// since that symbol has the "true" name.
var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol);
symbol = localExportDefaultSymbol || symbol;
return ts.stripQuotes(symbol.name);
}
/**
* Determines the smallest scope in which a symbol may have named references.
* Note that not every construct has been accounted for. This function can
* probably be improved.
*
* @returns undefined if the scope cannot be determined, implying that
* a reference to a symbol can occur anywhere.
*/
function getSymbolScope(symbol) {
// If this is the symbol of a named function expression or named class expression,
// then named references are limited to its own scope.
var valueDeclaration = symbol.valueDeclaration;
if (valueDeclaration && (valueDeclaration.kind === 176 /* FunctionExpression */ || valueDeclaration.kind === 189 /* ClassExpression */)) {
return valueDeclaration;
}
// If this is private property or method, the scope is the containing class
if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) {
var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16 /* Private */) ? d : undefined; });
if (privateDeclaration) {
return ts.getAncestor(privateDeclaration, 217 /* ClassDeclaration */);
}
}
// If the symbol is an import we would like to find it if we are looking for what it imports.
// So consider it visibile outside its declaration scope.
if (symbol.flags & 8388608 /* Alias */) {
return undefined;
}
// if this symbol is visible from its parent container, e.g. exported, then bail out
// if symbol correspond to the union property - bail out
if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) {
return undefined;
}
var scope;
var declarations = symbol.getDeclarations();
if (declarations) {
for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {
var declaration = declarations_1[_i];
var container = getContainerNode(declaration);
if (!container) {
return undefined;
}
if (scope && scope !== container) {
// Different declarations have different containers, bail out
return undefined;
}
if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) {
// This is a global variable and not an external module, any declaration defined
// within this scope is visible outside the file
return undefined;
}
// The search scope is the container node
scope = container;
}
}
return scope;
}
function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) {
var positions = [];
/// TODO: Cache symbol existence for files to save text search
// Also, need to make this work for unicode escapes.
// Be resilient in the face of a symbol with no name or zero length name
if (!symbolName || !symbolName.length) {
return positions;
}
var text = sourceFile.text;
var sourceLength = text.length;
var symbolNameLength = symbolName.length;
var position = text.indexOf(symbolName, start);
while (position >= 0) {
cancellationToken.throwIfCancellationRequested();
// If we are past the end, stop looking
if (position > end)
break;
// We found a match. Make sure it's not part of a larger word (i.e. the char
// before and after it have to be a non-identifier char).
var endPosition = position + symbolNameLength;
if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) &&
(endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) {
// Found a real match. Keep searching.
positions.push(position);
}
position = text.indexOf(symbolName, position + symbolNameLength + 1);
}
return positions;
}
function getLabelReferencesInNode(container, targetLabel) {
var references = [];
var sourceFile = container.getSourceFile();
var labelName = targetLabel.text;
var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd());
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
if (!node || node.getWidth() !== labelName.length) {
return;
}
// Only pick labels that are either the target label, or have a target that is the target label
if (node === targetLabel ||
(isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) {
references.push(getReferenceEntryFromNode(node));
}
});
var definition = {
containerKind: "",
containerName: "",
fileName: targetLabel.getSourceFile().fileName,
kind: ScriptElementKind.label,
name: labelName,
textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd())
};
return [{ definition: definition, references: references }];
}
function isValidReferencePosition(node, searchSymbolName) {
if (node) {
// Compare the length so we filter out strict superstrings of the symbol we are looking for
switch (node.kind) {
case 69 /* Identifier */:
return node.getWidth() === searchSymbolName.length;
case 9 /* StringLiteral */:
if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
isNameOfExternalModuleImportOrDeclaration(node)) {
// For string literals we have two additional chars for the quotes
return node.getWidth() === searchSymbolName.length + 2;
}
break;
case 8 /* NumericLiteral */:
if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) {
return node.getWidth() === searchSymbolName.length;
}
break;
}
}
return false;
}
/** Search within node "container" for references for a search value, where the search value is defined as a
* tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
* searchLocation: a node where the search value
*/
function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) {
var sourceFile = container.getSourceFile();
var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*</;
var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, container.getStart(), container.getEnd());
if (possiblePositions.length) {
// Build the set of symbols to search for, initially it has only the current symbol
var searchSymbols = populateSearchSymbolSet(searchSymbol, searchLocation);
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var referenceLocation = ts.getTouchingPropertyName(sourceFile, position);
if (!isValidReferencePosition(referenceLocation, searchText)) {
// This wasn't the start of a token. Check to see if it might be a
// match in a comment or string if that's what the caller is asking
// for.
if ((findInStrings && ts.isInString(sourceFile, position)) ||
(findInComments && isInNonReferenceComment(sourceFile, position))) {
// In the case where we're looking inside comments/strings, we don't have
// an actual definition. So just use 'undefined' here. Features like
// 'Rename' won't care (as they ignore the definitions), and features like
// 'FindReferences' will just filter out these results.
result.push({
definition: undefined,
references: [{
fileName: sourceFile.fileName,
textSpan: ts.createTextSpan(position, searchText.length),
isWriteAccess: false
}]
});
}
return;
}
if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
return;
}
var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
if (relatedSymbol) {
var referencedSymbol = getReferencedSymbol(relatedSymbol);
referencedSymbol.references.push(getReferenceEntryFromNode(referenceLocation));
}
else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) {
var referencedSymbol = getReferencedSymbol(shorthandValueSymbol);
referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name));
}
}
});
}
return;
function getReferencedSymbol(symbol) {
var symbolId = ts.getSymbolId(symbol);
var index = symbolToIndex[symbolId];
if (index === undefined) {
index = result.length;
symbolToIndex[symbolId] = index;
result.push({
definition: getDefinition(symbol),
references: []
});
}
return result[index];
}
function isInNonReferenceComment(sourceFile, position) {
return ts.isInCommentHelper(sourceFile, position, isNonReferenceComment);
function isNonReferenceComment(c) {
var commentText = sourceFile.text.substring(c.pos, c.end);
return !tripleSlashDirectivePrefixRegex.test(commentText);
}
}
}
function getReferencesForSuperKeyword(superKeyword) {
var searchSpaceNode = ts.getSuperContainer(superKeyword, /*stopOnFunctions*/ false);
if (!searchSpaceNode) {
return undefined;
}
// Whether 'super' occurs in a static context within a class.
var staticFlag = 64 /* Static */;
switch (searchSpaceNode.kind) {
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
case 145 /* Constructor */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
staticFlag &= searchSpaceNode.flags;
searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class
break;
default:
return undefined;
}
var references = [];
var sourceFile = searchSpaceNode.getSourceFile();
var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd());
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
if (!node || node.kind !== 95 /* SuperKeyword */) {
return;
}
var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false);
// If we have a 'super' container, we must have an enclosing class.
// Now make sure the owning class is the same as the search-space
// and has the same static qualifier as the original 'super's owner.
if (container && (64 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) {
references.push(getReferenceEntryFromNode(node));
}
});
var definition = getDefinition(searchSpaceNode.symbol);
return [{ definition: definition, references: references }];
}
function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) {
var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false);
// Whether 'this' occurs in a static context within a class.
var staticFlag = 64 /* Static */;
switch (searchSpaceNode.kind) {
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
if (ts.isObjectLiteralMethod(searchSpaceNode)) {
break;
}
// fall through
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
case 145 /* Constructor */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
staticFlag &= searchSpaceNode.flags;
searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class
break;
case 251 /* SourceFile */:
if (ts.isExternalModule(searchSpaceNode)) {
return undefined;
}
// Fall through
case 216 /* FunctionDeclaration */:
case 176 /* FunctionExpression */:
break;
// Computed properties in classes are not handled here because references to this are illegal,
// so there is no point finding references to them.
default:
return undefined;
}
var references = [];
var possiblePositions;
if (searchSpaceNode.kind === 251 /* SourceFile */) {
ts.forEach(sourceFiles, function (sourceFile) {
possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd());
getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references);
});
}
else {
var sourceFile = searchSpaceNode.getSourceFile();
possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd());
getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references);
}
return [{
definition: {
containerKind: "",
containerName: "",
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: "this",
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd())
},
references: references
}];
function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) {
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 162 /* ThisType */)) {
return;
}
var container = ts.getThisContainer(node, /* includeArrowFunctions */ false);
switch (searchSpaceNode.kind) {
case 176 /* FunctionExpression */:
case 216 /* FunctionDeclaration */:
if (searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
case 189 /* ClassExpression */:
case 217 /* ClassDeclaration */:
// Make sure the container belongs to the same class
// and has the appropriate static modifier from the original container.
if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64 /* Static */) === staticFlag) {
result.push(getReferenceEntryFromNode(node));
}
break;
case 251 /* SourceFile */:
if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) {
result.push(getReferenceEntryFromNode(node));
}
break;
}
});
}
}
function populateSearchSymbolSet(symbol, location) {
// The search set contains at least the current symbol
var result = [symbol];
// If the symbol is an alias, add what it alaises to the list
if (isImportSpecifierSymbol(symbol)) {
result.push(typeChecker.getAliasedSymbol(symbol));
}
// For export specifiers, the exported name can be refering to a local symbol, e.g.:
// import {a} from "mod";
// export {a as somethingElse}
// We want the *local* declaration of 'a' as declared in the import,
// *not* as declared within "mod" (or farther)
if (location.parent.kind === 233 /* ExportSpecifier */) {
result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent));
}
// If the location is in a context sensitive location (i.e. in an object literal) try
// to get a contextual type for it, and add the property symbol from the contextual
// type to the search set
if (isNameOfPropertyAssignment(location)) {
ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) {
ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol));
});
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
* When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of
* property name and variable declaration of the identifier.
* Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service
* should show both 'name' in 'obj' and 'name' in variable declaration
* const name = "Foo";
* const obj = { name };
* In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment
* so that when matching with potential reference symbol, both symbols from property declaration and variable declaration
* will be included correctly.
*/
var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
if (shorthandValueSymbol) {
result.push(shorthandValueSymbol);
}
}
// If the symbol.valueDeclaration is a property parameter declaration,
// we should include both parameter declaration symbol and property declaration symbol
// Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals.
// Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members
if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 139 /* Parameter */ &&
ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) {
result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name));
}
// If this is a union property, add all the symbols from all its source symbols in all unioned types.
// If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list
ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
if (rootSymbol !== symbol) {
result.push(rootSymbol);
}
// Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions
if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) {
getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ {});
}
});
return result;
}
/**
* Find symbol of the given property-name and add the symbol to the given result array
* @param symbol a symbol to start searching for the given propertyName
* @param propertyName a name of property to serach for
* @param result an array of symbol of found property symbols
* @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisitng of the same symbol.
* The value of previousIterationSymbol is undefined when the function is first called.
*/
function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) {
if (!symbol) {
return;
}
// If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited
// This is particularly important for the following cases, so that we do not infinitely visit the same symbol.
// For example:
// interface C extends C {
// /*findRef*/propName: string;
// }
// The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName,
// the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined,
// the function will add any found symbol of the property-name, then its sub-routine will call
// getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already
// visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol.
if (ts.hasProperty(previousIterationSymbolsCache, symbol.name)) {
return;
}
if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) {
ts.forEach(symbol.getDeclarations(), function (declaration) {
if (declaration.kind === 217 /* ClassDeclaration */) {
getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration));
ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference);
}
else if (declaration.kind === 218 /* InterfaceDeclaration */) {
ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference);
}
});
}
return;
function getPropertySymbolFromTypeReference(typeReference) {
if (typeReference) {
var type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
var propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
if (propertySymbol) {
result.push(propertySymbol);
}
// Visit the typeReference as well to see if it directly or indirectly use that property
previousIterationSymbolsCache[symbol.name] = symbol;
getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache);
}
}
}
}
function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) {
if (searchSymbols.indexOf(referenceSymbol) >= 0) {
return referenceSymbol;
}
// If the reference symbol is an alias, check if what it is aliasing is one of the search
// symbols.
if (isImportSpecifierSymbol(referenceSymbol)) {
var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
}
// For export specifiers, it can be a local symbol, e.g.
// import {a} from "mod";
// export {a as somethingElse}
// We want the local target of the export (i.e. the import symbol) and not the final target (i.e. "mod".a)
if (referenceLocation.parent.kind === 233 /* ExportSpecifier */) {
var aliasedSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(referenceLocation.parent);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
}
// If the reference location is in an object literal, try to get the contextual type for the
// object literal, lookup the property symbol in the contextual type, and use this symbol to
// compare to our searchSymbol
if (isNameOfPropertyAssignment(referenceLocation)) {
return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) {
return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
});
}
// Unwrap symbols to get to the root (e.g. transient symbols as a result of widening)
// Or a union property, use its underlying unioned symbols
return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) {
// if it is in the list, then we are done
if (searchSymbols.indexOf(rootSymbol) >= 0) {
return rootSymbol;
}
// Finally, try all properties with the same name in any type the containing type extended or implemented, and
// see if any is in the list
if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) {
var result_2 = [];
getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2, /*previousIterationSymbolsCache*/ {});
return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
}
return undefined;
});
}
function getPropertySymbolsFromContextualType(node) {
if (isNameOfPropertyAssignment(node)) {
var objectLiteral = node.parent.parent;
var contextualType = typeChecker.getContextualType(objectLiteral);
var name_3 = node.text;
if (contextualType) {
if (contextualType.flags & 16384 /* Union */) {
// This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types)
// if not, search the constituent types for the property
var unionProperty = contextualType.getProperty(name_3);
if (unionProperty) {
return [unionProperty];
}
else {
var result_3 = [];
ts.forEach(contextualType.types, function (t) {
var symbol = t.getProperty(name_3);
if (symbol) {
result_3.push(symbol);
}
});
return result_3;
}
}
else {
var symbol_1 = contextualType.getProperty(name_3);
if (symbol_1) {
return [symbol_1];
}
}
}
}
return undefined;
}
/** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations
* of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class
* then we need to widen the search to include type positions as well.
* On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated
* module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module)
* do not intersect in any of the three spaces.
*/
function getIntersectingMeaningFromDeclarations(meaning, declarations) {
if (declarations) {
var lastIterationMeaning;
do {
// The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module]
// we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module
// intersects with the class in the value space.
// To achieve that we will keep iterating until the result stabilizes.
// Remember the last meaning
lastIterationMeaning = meaning;
for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {
var declaration = declarations_2[_i];
var declarationMeaning = getMeaningFromDeclaration(declaration);
if (declarationMeaning & meaning) {
meaning |= declarationMeaning;
}
}
} while (meaning !== lastIterationMeaning);
}
return meaning;
}
}
function getReferenceEntryFromNode(node) {
var start = node.getStart();
var end = node.getEnd();
if (node.kind === 9 /* StringLiteral */) {
start += 1;
end -= 1;
}
return {
fileName: node.getSourceFile().fileName,
textSpan: ts.createTextSpanFromBounds(start, end),
isWriteAccess: isWriteAccess(node)
};
}
/** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */
function isWriteAccess(node) {
if (node.kind === 69 /* Identifier */ && ts.isDeclarationName(node)) {
return true;
}
var parent = node.parent;
if (parent) {
if (parent.kind === 183 /* PostfixUnaryExpression */ || parent.kind === 182 /* PrefixUnaryExpression */) {
return true;
}
else if (parent.kind === 184 /* BinaryExpression */ && parent.left === node) {
var operator = parent.operatorToken.kind;
return 56 /* FirstAssignment */ <= operator && operator <= 68 /* LastAssignment */;
}
}
return false;
}
/// NavigateTo
function getNavigateToItems(searchValue, maxResultCount) {
synchronizeHostData();
return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount);
}
function getEmitOutput(fileName) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var outputFiles = [];
function writeFile(fileName, data, writeByteOrderMark) {
outputFiles.push({
name: fileName,
writeByteOrderMark: writeByteOrderMark,
text: data
});
}
var emitOutput = program.emit(sourceFile, writeFile, cancellationToken);
return {
outputFiles: outputFiles,
emitSkipped: emitOutput.emitSkipped
};
}
function getMeaningFromDeclaration(node) {
switch (node.kind) {
case 139 /* Parameter */:
case 214 /* VariableDeclaration */:
case 166 /* BindingElement */:
case 142 /* PropertyDeclaration */:
case 141 /* PropertySignature */:
case 248 /* PropertyAssignment */:
case 249 /* ShorthandPropertyAssignment */:
case 250 /* EnumMember */:
case 144 /* MethodDeclaration */:
case 143 /* MethodSignature */:
case 145 /* Constructor */:
case 146 /* GetAccessor */:
case 147 /* SetAccessor */:
case 216 /* FunctionDeclaration */:
case 176 /* FunctionExpression */:
case 177 /* ArrowFunction */:
case 247 /* CatchClause */:
return 1 /* Value */;
case 138 /* TypeParameter */:
case 218 /* InterfaceDeclaration */:
case 219 /* TypeAliasDeclaration */:
case 156 /* TypeLiteral */:
return 2 /* Type */;
case 217 /* ClassDeclaration */:
case 220 /* EnumDeclaration */:
return 1 /* Value */ | 2 /* Type */;
case 221 /* ModuleDeclaration */:
if (ts.isAmbientModule(node)) {
return 4 /* Namespace */ | 1 /* Value */;
}
else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) {
return 4 /* Namespace */ | 1 /* Value */;
}
else {
return 4 /* Namespace */;
}
case 228 /* NamedImports */:
case 229 /* ImportSpecifier */:
case 224 /* ImportEqualsDeclaration */:
case 225 /* ImportDeclaration */:
case 230 /* ExportAssignment */:
case 231 /* ExportDeclaration */:
return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */;
// An external module can be a Value
case 251 /* SourceFile */:
return 4 /* Namespace */ | 1 /* Value */;
}
return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */;
}
function isTypeReference(node) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {
node = node.parent;
}
return node.parent.kind === 152 /* TypeReference */ ||
(node.parent.kind === 191 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) ||
(node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node)) ||
node.kind === 162 /* ThisType */;
}
function isNamespaceReference(node) {
return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node);
}
function isPropertyAccessNamespaceReference(node) {
var root = node;
var isLastClause = true;
if (root.parent.kind === 169 /* PropertyAccessExpression */) {
while (root.parent && root.parent.kind === 169 /* PropertyAccessExpression */) {
root = root.parent;
}
isLastClause = root.name === node;
}
if (!isLastClause && root.parent.kind === 191 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 246 /* HeritageClause */) {
var decl = root.parent.parent.parent;
return (decl.kind === 217 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) ||
(decl.kind === 218 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */);
}
return false;
}
function isQualifiedNameNamespaceReference(node) {
var root = node;
var isLastClause = true;
if (root.parent.kind === 136 /* QualifiedName */) {
while (root.parent && root.parent.kind === 136 /* QualifiedName */) {
root = root.parent;
}
isLastClause = root.right === node;
}
return root.parent.kind === 152 /* TypeReference */ && !isLastClause;
}
function isInRightSideOfImport(node) {
while (node.parent.kind === 136 /* QualifiedName */) {
node = node.parent;
}
return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
}
function getMeaningFromRightHandSideOfImportEquals(node) {
ts.Debug.assert(node.kind === 69 /* Identifier */);
// import a = |b|; // Namespace
// import a = |b.c|; // Value, type, namespace
// import a = |b.c|.d; // Namespace
if (node.parent.kind === 136 /* QualifiedName */ &&
node.parent.right === node &&
node.parent.parent.kind === 224 /* ImportEqualsDeclaration */) {
return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */;
}
return 4 /* Namespace */;
}
function getMeaningFromLocation(node) {
if (node.parent.kind === 230 /* ExportAssignment */) {
return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */;
}
else if (isInRightSideOfImport(node)) {
return getMeaningFromRightHandSideOfImportEquals(node);
}
else if (ts.isDeclarationName(node)) {
return getMeaningFromDeclaration(node.parent);
}
else if (isTypeReference(node)) {
return 2 /* Type */;
}
else if (isNamespaceReference(node)) {
return 4 /* Namespace */;
}
else {
return 1 /* Value */;
}
}
// Signature help
/**
* This is a semantic operation.
*/
function getSignatureHelpItems(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
}
/// Syntactic features
function getSourceFile(fileName) {
return syntaxTreeCache.getCurrentSourceFile(fileName);
}
function getNameOrDottedNameSpan(fileName, startPos, endPos) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
// Get node at the location
var node = ts.getTouchingPropertyName(sourceFile, startPos);
if (!node) {
return;
}
switch (node.kind) {
case 169 /* PropertyAccessExpression */:
case 136 /* QualifiedName */:
case 9 /* StringLiteral */:
case 163 /* StringLiteralType */:
case 84 /* FalseKeyword */:
case 99 /* TrueKeyword */:
case 93 /* NullKeyword */:
case 95 /* SuperKeyword */:
case 97 /* ThisKeyword */:
case 162 /* ThisType */:
case 69 /* Identifier */:
break;
// Cant create the text span
default:
return;
}
var nodeForStartPos = node;
while (true) {
if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) {
// If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node
nodeForStartPos = nodeForStartPos.parent;
}
else if (isNameOfModuleDeclaration(nodeForStartPos)) {
// If this is name of a module declarations, check if this is right side of dotted module name
// If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of
// Then this name is name from dotted module
if (nodeForStartPos.parent.parent.kind === 221 /* ModuleDeclaration */ &&
nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
// Use parent module declarations name for start pos
nodeForStartPos = nodeForStartPos.parent.parent.name;
}
else {
// We have to use this name for start pos
break;
}
}
else {
// Is not a member expression so we have found the node for start pos
break;
}
}
return ts.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd());
}
function getBreakpointStatementAtPosition(fileName, position) {
// doesn't use compiler - no need to synchronize with host
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position);
}
function getNavigationBarItems(fileName) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings());
}
function getSemanticClassifications(fileName, span) {
return convertClassifications(getEncodedSemanticClassifications(fileName, span));
}
function checkForClassificationCancellation(kind) {
// We don't want to actually call back into our host on every node to find out if we've
// been canceled. That would be an enormous amount of chattyness, along with the all
// the overhead of marshalling the data to/from the host. So instead we pick a few
// reasonable node kinds to bother checking on. These node kinds represent high level
// constructs that we would expect to see commonly, but just at a far less frequent
// interval.
//
// For example, in checker.ts (around 750k) we only have around 600 of these constructs.
// That means we're calling back into the host around every 1.2k of the file we process.
// Lib.d.ts has similar numbers.
switch (kind) {
case 221 /* ModuleDeclaration */:
case 217 /* ClassDeclaration */:
case 218 /* InterfaceDeclaration */:
case 216 /* FunctionDeclaration */:
cancellationToken.throwIfCancellationRequested();
}
}
function getEncodedSemanticClassifications(fileName, span) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var typeChecker = program.getTypeChecker();
var result = [];
var classifiableNames = program.getClassifiableNames();
processNode(sourceFile);
return { spans: result, endOfLineState: 0 /* None */ };
function pushClassification(start, length, type) {
result.push(start);
result.push(length);
result.push(type);
}
function classifySymbol(symbol, meaningAtPosition) {
var flags = symbol.getFlags();
if ((flags & 788448 /* Classifiable */) === 0 /* None */) {
return;
}
if (flags & 32 /* Class */) {
return 11 /* className */;
}
else if (flags & 384 /* Enum */) {
return 12 /* enumName */;
}
else if (flags & 524288 /* TypeAlias */) {
return 16 /* typeAliasName */;
}
else if (meaningAtPosition & 2 /* Type */) {
if (flags & 64 /* Interface */) {
return 13 /* interfaceName */;
}
else if (flags & 262144 /* TypeParameter */) {
return 15 /* typeParameterName */;
}
}
else if (flags & 1536 /* Module */) {
// Only classify a module as such if
// - It appears in a namespace context.
// - There exists a module declaration which actually impacts the value side.
if (meaningAtPosition & 4 /* Namespace */ ||
(meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) {
return 14 /* moduleName */;
}
}
return undefined;
/**
* Returns true if there exists a module that introduces entities on the value side.
*/
function hasValueSideModule(symbol) {
return ts.forEach(symbol.declarations, function (declaration) {
return declaration.kind === 221 /* ModuleDeclaration */ &&
ts.getModuleInstanceState(declaration) === 1 /* Instantiated */;
});
}
}
function processNode(node) {
// Only walk into nodes that intersect the requested span.
if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) {
var kind = node.kind;
checkForClassificationCancellation(kind);
if (kind === 69 /* Identifier */ && !ts.nodeIsMissing(node)) {
var identifier = node;
// Only bother calling into the typechecker if this is an identifier that
// could possibly resolve to a type name. This makes classification run
// in a third of the time it would normally take.
if (classifiableNames[identifier.text]) {
var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
var type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
pushClassification(node.getStart(), node.getWidth(), type);
}
}
}
}
ts.forEachChild(node, processNode);
}
}
}
function getClassificationTypeName(type) {
switch (type) {
case 1 /* comment */: return ClassificationTypeNames.comment;
case 2 /* identifier */: return ClassificationTypeNames.identifier;
case 3 /* keyword */: return ClassificationTypeNames.keyword;
case 4 /* numericLiteral */: return ClassificationTypeNames.numericLiteral;
case 5 /* operator */: return ClassificationTypeNames.operator;
case 6 /* stringLiteral */: return ClassificationTypeNames.stringLiteral;
case 8 /* whiteSpace */: return ClassificationTypeNames.whiteSpace;
case 9 /* text */: return ClassificationTypeNames.text;
case 10 /* punctuation */: return ClassificationTypeNames.punctuation;
case 11 /* className */: return ClassificationTypeNames.className;
case 12 /* enumName */: return ClassificationTypeNames.enumName;
case 13 /* interfaceName */: return ClassificationTypeNames.interfaceName;
case 14 /* moduleName */: return ClassificationTypeNames.moduleName;
case 15 /* typeParameterName */: return ClassificationTypeNames.typeParameterName;
case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName;
case 17 /* parameterName */: return ClassificationTypeNames.parameterName;
case 18 /* docCommentTagName */: return ClassificationTypeNames.docCommentTagName;
case 19 /* jsxOpenTagName */: return ClassificationTypeNames.jsxOpenTagName;
case 20 /* jsxCloseTagName */: return ClassificationTypeNames.jsxCloseTagName;
case 21 /* jsxSelfClosingTagName */: return ClassificationTypeNames.jsxSelfClosingTagName;
case 22 /* jsxAttribute */: return ClassificationTypeNames.jsxAttribute;
case 23 /* jsxText */: return ClassificationTypeNames.jsxText;
case 24 /* jsxAttributeStringLiteralValue */: return ClassificationTypeNames.jsxAttributeStringLiteralValue;
}
}
function convertClassifications(classifications) {
ts.Debug.assert(classifications.spans.length % 3 === 0);
var dense = classifications.spans;
var result = [];
for (var i = 0, n = dense.length; i < n; i += 3) {
result.push({
textSpan: ts.createTextSpan(dense[i], dense[i + 1]),
classificationType: getClassificationTypeName(dense[i + 2])
});
}
return result;
}
function getSyntacticClassifications(fileName, span) {
return convertClassifications(getEncodedSyntacticClassifications(fileName, span));
}
function getEncodedSyntacticClassifications(fileName, span) {
// doesn't use compiler - no need to synchronize with host
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var spanStart = span.start;
var spanLength = span.length;
// Make a scanner we can get trivia from.
var triviaScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text);
var mergeConflictScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text);
var result = [];
processElement(sourceFile);
return { spans: result, endOfLineState: 0 /* None */ };
function pushClassification(start, length, type) {
result.push(start);
result.push(length);
result.push(type);
}
function classifyLeadingTriviaAndGetTokenStart(token) {
triviaScanner.setTextPos(token.pos);
while (true) {
var start = triviaScanner.getTextPos();
// only bother scanning if we have something that could be trivia.
if (!ts.couldStartTrivia(sourceFile.text, start)) {
return start;
}
var kind = triviaScanner.scan();
var end = triviaScanner.getTextPos();
var width = end - start;
// The moment we get something that isn't trivia, then stop processing.
if (!ts.isTrivia(kind)) {
return start;
}
// Don't bother with newlines/whitespace.
if (kind === 4 /* NewLineTrivia */ || kind === 5 /* WhitespaceTrivia */) {
continue;
}
// Only bother with the trivia if it at least intersects the span of interest.
if (ts.isComment(kind)) {
classifyComment(token, kind, start, width);
// Classifying a comment might cause us to reuse the trivia scanner
// (because of jsdoc comments). So after we classify the comment make
// sure we set the scanner position back to where it needs to be.
triviaScanner.setTextPos(end);
continue;
}
if (kind === 7 /* ConflictMarkerTrivia */) {
var text = sourceFile.text;
var ch = text.charCodeAt(start);
// for the <<<<<<< and >>>>>>> markers, we just add them in as comments
// in the classification stream.
if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) {
pushClassification(start, width, 1 /* comment */);
continue;
}
// for the ======== add a comment for the first line, and then lex all
// subsequent lines up until the end of the conflict marker.
ts.Debug.assert(ch === 61 /* equals */);
classifyDisabledMergeCode(text, start, end);
}
}
}
function classifyComment(token, kind, start, width) {
if (kind === 3 /* MultiLineCommentTrivia */) {
// See if this is a doc comment. If so, we'll classify certain portions of it
// specially.
var docCommentAndDiagnostics = ts.parseIsolatedJSDocComment(sourceFile.text, start, width);
if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDocComment) {
docCommentAndDiagnostics.jsDocComment.parent = token;
classifyJSDocComment(docCommentAndDiagnostics.jsDocComment);
return;
}
}
// Simple comment. Just add as is.
pushCommentRange(start, width);
}
function pushCommentRange(start, width) {
pushClassification(start, width, 1 /* comment */);
}
function classifyJSDocComment(docComment) {
var pos = docComment.pos;
for (var _i = 0, _a = docComment.tags; _i < _a.length; _i++) {
var tag = _a[_i];
// As we walk through each tag, classify the portion of text from the end of
// the last tag (or the start of the entire doc comment) as 'comment'.
if (tag.pos !== pos) {
pushCommentRange(pos, tag.pos - pos);
}
pushClassification(tag.atToken.pos, tag.atToken.end - tag.atToken.pos, 10 /* punctuation */);
pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */);
pos = tag.tagName.end;
switch (tag.kind) {
case 270 /* JSDocParameterTag */:
processJSDocParameterTag(tag);
break;
case 273 /* JSDocTemplateTag */:
processJSDocTemplateTag(tag);
break;
case 272 /* JSDocTypeTag */:
processElement(tag.typeExpression);
break;
case 271 /* JSDocReturnTag */:
processElement(tag.typeExpression);
break;
}
pos = tag.end;
}
if (pos !== docComment.end) {
pushCommentRange(pos, docComment.end - pos);
}
return;
function processJSDocParameterTag(tag) {
if (tag.preParameterName) {
pushCommentRange(pos, tag.preParameterName.pos - pos);
pushClassification(tag.preParameterName.pos, tag.preParameterName.end - tag.preParameterName.pos, 17 /* parameterName */);
pos = tag.preParameterName.end;
}
if (tag.typeExpression) {
pushCommentRange(pos, tag.typeExpression.pos - pos);
processElement(tag.typeExpression);
pos = tag.typeExpression.end;
}
if (tag.postParameterName) {
pushCommentRange(pos, tag.postParameterName.pos - pos);
pushClassification(tag.postParameterName.pos, tag.postParameterName.end - tag.postParameterName.pos, 17 /* parameterName */);
pos = tag.postParameterName.end;
}
}
}
function processJSDocTemplateTag(tag) {
for (var _i = 0, _a = tag.getChildren(); _i < _a.length; _i++) {
var child = _a[_i];
processElement(child);
}
}
function classifyDisabledMergeCode(text, start, end) {
// Classify the line that the ======= marker is on as a comment. Then just lex
// all further tokens and add them to the result.
var i;
for (i = start; i < end; i++) {
if (ts.isLineBreak(text.charCodeAt(i))) {
break;
}
}
pushClassification(start, i - start, 1 /* comment */);
mergeConflictScanner.setTextPos(i);
while (mergeConflictScanner.getTextPos() < end) {
classifyDisabledCodeToken();
}
}
function classifyDisabledCodeToken() {
var start = mergeConflictScanner.getTextPos();
var tokenKind = mergeConflictScanner.scan();
var end = mergeConflictScanner.getTextPos();
var type = classifyTokenType(tokenKind);
if (type) {
pushClassification(start, end - start, type);
}
}
function classifyTokenOrJsxText(token) {
if (ts.nodeIsMissing(token)) {
return;
}
var tokenStart = token.kind === 239 /* JsxText */ ? token.pos : classifyLeadingTriviaAndGetTokenStart(token);
var tokenWidth = token.end - tokenStart;
ts.Debug.assert(tokenWidth >= 0);
if (tokenWidth > 0) {
var type = classifyTokenType(token.kind, token);
if (type) {
pushClassification(tokenStart, tokenWidth, type);
}
}
}
// for accurate classification, the actual token should be passed in. however, for
// cases like 'disabled merge code' classification, we just get the token kind and
// classify based on that instead.
function classifyTokenType(tokenKind, token) {
if (ts.isKeyword(tokenKind)) {
return 3 /* keyword */;
}
// Special case < and > If they appear in a generic context they are punctuation,
// not operators.
if (tokenKind === 25 /* LessThanToken */ || tokenKind === 27 /* GreaterThanToken */) {
// If the node owning the token has a type argument list or type parameter list, then
// we can effectively assume that a '<' and '>' belong to those lists.
if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) {
return 10 /* punctuation */;
}
}
if (ts.isPunctuation(tokenKind)) {
if (token) {
if (tokenKind === 56 /* EqualsToken */) {
// the '=' in a variable declaration is special cased here.
if (token.parent.kind === 214 /* VariableDeclaration */ ||
token.parent.kind === 142 /* PropertyDeclaration */ ||
token.parent.kind === 139 /* Parameter */ ||
token.parent.kind === 241 /* JsxAttribute */) {
return 5 /* operator */;
}
}
if (token.parent.kind === 184 /* BinaryExpression */ ||
token.parent.kind === 182 /* PrefixUnaryExpression */ ||
token.parent.kind === 183 /* PostfixUnaryExpression */ ||
token.parent.kind === 185 /* ConditionalExpression */) {
return 5 /* operator */;
}
}
return 10 /* punctuation */;
}
else if (tokenKind === 8 /* NumericLiteral */) {
return 4 /* numericLiteral */;
}
else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 163 /* StringLiteralType */) {
return token.parent.kind === 241 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
}
else if (tokenKind === 10 /* RegularExpressionLiteral */) {
// TODO: we should get another classification type for these literals.
return 6 /* stringLiteral */;
}
else if (ts.isTemplateLiteralKind(tokenKind)) {
// TODO (drosen): we should *also* get another classification type for these literals.
return 6 /* stringLiteral */;
}
else if (tokenKind === 239 /* JsxText */) {
return 23 /* jsxText */;
}
else if (tokenKind === 69 /* Identifier */) {
if (token) {
switch (token.parent.kind) {
case 217 /* ClassDeclaration */:
if (token.parent.name === token) {
return 11 /* className */;
}
return;
case 138 /* TypeParameter */:
if (token.parent.name === token) {
return 15 /* typeParameterName */;
}
return;
case 218 /* InterfaceDeclaration */:
if (token.parent.name === token) {
return 13 /* interfaceName */;
}
return;
case 220 /* EnumDeclaration */:
if (token.parent.name === token) {
return 12 /* enumName */;
}
return;
case 221 /* ModuleDeclaration */:
if (token.parent.name === token) {
return 14 /* moduleName */;
}
return;
case 139 /* Parameter */:
if (token.parent.name === token) {
return 17 /* parameterName */;
}
return;
case 238 /* JsxOpeningElement */:
if (token.parent.tagName === token) {
return 19 /* jsxOpenTagName */;
}
return;
case 240 /* JsxClosingElement */:
if (token.parent.tagName === token) {
return 20 /* jsxCloseTagName */;
}
return;
case 237 /* JsxSelfClosingElement */:
if (token.parent.tagName === token) {
return 21 /* jsxSelfClosingTagName */;
}
return;
case 241 /* JsxAttribute */:
if (token.parent.name === token) {
return 22 /* jsxAttribute */;
}
}
}
return 2 /* identifier */;
}
}
function processElement(element) {
if (!element) {
return;
}
// Ignore nodes that don't intersect the original span to classify.
if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) {
checkForClassificationCancellation(element.kind);
var children = element.getChildren(sourceFile);
for (var i = 0, n = children.length; i < n; i++) {
var child = children[i];
if (ts.isToken(child) || child.kind === 239 /* JsxText */) {
classifyTokenOrJsxText(child);
}
else {
// Recurse into our child nodes.
processElement(child);
}
}
}
}
}
function getOutliningSpans(fileName) {
// doesn't use compiler - no need to synchronize with host
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.OutliningElementsCollector.collectElements(sourceFile);
}
function getBraceMatchingAtPosition(fileName, position) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var result = [];
var token = ts.getTouchingToken(sourceFile, position);
if (token.getStart(sourceFile) === position) {
var matchKind = getMatchingTokenKind(token);
// Ensure that there is a corresponding token to match ours.
if (matchKind) {
var parentElement = token.parent;
var childNodes = parentElement.getChildren(sourceFile);
for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) {
var current = childNodes_1[_i];
if (current.kind === matchKind) {
var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile));
var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile));
// We want to order the braces when we return the result.
if (range1.start < range2.start) {
result.push(range1, range2);
}
else {
result.push(range2, range1);
}
break;
}
}
}
}
return result;
function getMatchingTokenKind(token) {
switch (token.kind) {
case 15 /* OpenBraceToken */: return 16 /* CloseBraceToken */;
case 17 /* OpenParenToken */: return 18 /* CloseParenToken */;
case 19 /* OpenBracketToken */: return 20 /* CloseBracketToken */;
case 25 /* LessThanToken */: return 27 /* GreaterThanToken */;
case 16 /* CloseBraceToken */: return 15 /* OpenBraceToken */;
case 18 /* CloseParenToken */: return 17 /* OpenParenToken */;
case 20 /* CloseBracketToken */: return 19 /* OpenBracketToken */;
case 27 /* GreaterThanToken */: return 25 /* LessThanToken */;
}
return undefined;
}
}
function getIndentationAtPosition(fileName, position, editorOptions) {
var start = new Date().getTime();
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start));
start = new Date().getTime();
var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions);
log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start));
return result;
}
function getFormattingEditsForRange(fileName, start, end, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options);
}
function getFormattingEditsForDocument(fileName, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options);
}
function getFormattingEditsAfterKeystroke(fileName, position, key, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
if (key === "}") {
return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options);
}
else if (key === ";") {
return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options);
}
else if (key === "\n") {
return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options);
}
return [];
}
/**
* Checks if position points to a valid position to add JSDoc comments, and if so,
* returns the appropriate template. Otherwise returns an empty string.
* Valid positions are
* - outside of comments, statements, and expressions, and
* - preceding a:
* - function/constructor/method declaration
* - class declarations
* - variable statements
* - namespace declarations
*
* Hosts should ideally check that:
* - The line is all whitespace up to 'position' before performing the insertion.
* - If the keystroke sequence "/\*\*" induced the call, we also check that the next
* non-whitespace character is '*', which (approximately) indicates whether we added
* the second '*' to complete an existing (JSDoc) comment.
* @param fileName The file in which to perform the check.
* @param position The (character-indexed) position in the file where the check should
* be performed.
*/
function getDocCommentTemplateAtPosition(fileName, position) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
// Check if in a context where we don't want to perform any insertion
if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) {
return undefined;
}
var tokenAtPos = ts.getTokenAtPosition(sourceFile, position);
var tokenStart = tokenAtPos.getStart();
if (!tokenAtPos || tokenStart < position) {
return undefined;
}
// TODO: add support for:
// - enums/enum members
// - interfaces
// - property declarations
// - potentially property assignments
var commentOwner;
findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) {
switch (commentOwner.kind) {
case 216 /* FunctionDeclaration */:
case 144 /* MethodDeclaration */:
case 145 /* Constructor */:
case 217 /* ClassDeclaration */:
case 196 /* VariableStatement */:
break findOwner;
case 251 /* SourceFile */:
return undefined;
case 221 /* ModuleDeclaration */:
// If in walking up the tree, we hit a a nested namespace declaration,
// then we must be somewhere within a dotted namespace name; however we don't
// want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'.
if (commentOwner.parent.kind === 221 /* ModuleDeclaration */) {
return undefined;
}
break findOwner;
}
}
if (!commentOwner || commentOwner.getStart() < position) {
return undefined;
}
var parameters = getParametersForJsDocOwningNode(commentOwner);
var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position);
var lineStart = sourceFile.getLineStarts()[posLineAndChar.line];
var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character);
// TODO: call a helper method instead once PR #4133 gets merged in.
var newLine = host.getNewLine ? host.getNewLine() : "\r\n";
var docParams = "";
for (var i = 0, numParams = parameters.length; i < numParams; i++) {
var currentName = parameters[i].name;
var paramName = currentName.kind === 69 /* Identifier */ ?
currentName.text :
"param" + i;
docParams += indentationStr + " * @param " + paramName + newLine;
}
// A doc comment consists of the following
// * The opening comment line
// * the first line (without a param) for the object's untagged info (this is also where the caret ends up)
// * the '@param'-tagged lines
// * TODO: other tags.
// * the closing comment line
// * if the caret was directly in front of the object, then we add an extra line and indentation.
var preamble = "/**" + newLine +
indentationStr + " * ";
var result = preamble + newLine +
docParams +
indentationStr + " */" +
(tokenStart === position ? newLine + indentationStr : "");
return { newText: result, caretOffset: preamble.length };
}
function getParametersForJsDocOwningNode(commentOwner) {
if (ts.isFunctionLike(commentOwner)) {
return commentOwner.parameters;
}
if (commentOwner.kind === 196 /* VariableStatement */) {
var varStatement = commentOwner;
var varDeclarations = varStatement.declarationList.declarations;
if (varDeclarations.length === 1 && varDeclarations[0].initializer) {
return getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer);
}
}
return emptyArray;
}
/**
* Digs into an an initializer or RHS operand of an assignment operation
* to get the parameters of an apt signature corresponding to a
* function expression or a class expression.
*
* @param rightHandSide the expression which may contain an appropriate set of parameters
* @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'.
*/
function getParametersFromRightHandSideOfAssignment(rightHandSide) {
while (rightHandSide.kind === 175 /* ParenthesizedExpression */) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
case 176 /* FunctionExpression */:
case 177 /* ArrowFunction */:
return rightHandSide.parameters;
case 189 /* ClassExpression */:
for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) {
var member = _a[_i];
if (member.kind === 145 /* Constructor */) {
return member.parameters;
}
}
break;
}
return emptyArray;
}
function getTodoComments(fileName, descriptors) {
// Note: while getting todo comments seems like a syntactic operation, we actually
// treat it as a semantic operation here. This is because we expect our host to call
// this on every single file. If we treat this syntactically, then that will cause
// us to populate and throw away the tree in our syntax tree cache for each file. By
// treating this as a semantic operation, we can access any tree without throwing
// anything away.
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
cancellationToken.throwIfCancellationRequested();
var fileContents = sourceFile.text;
var result = [];
if (descriptors.length > 0) {
var regExp = getTodoCommentsRegExp();
var matchArray;
while (matchArray = regExp.exec(fileContents)) {
cancellationToken.throwIfCancellationRequested();
// If we got a match, here is what the match array will look like. Say the source text is:
//
// " // hack 1"
//
// The result array with the regexp: will be:
//
// ["// hack 1", "// ", "hack 1", undefined, "hack"]
//
// Here are the relevant capture groups:
// 0) The full match for the entire regexp.
// 1) The preamble to the message portion.
// 2) The message portion.
// 3...N) The descriptor that was matched - by index. 'undefined' for each
// descriptor that didn't match. an actual value if it did match.
//
// i.e. 'undefined' in position 3 above means TODO(jason) didn't match.
// "hack" in position 4 means HACK did match.
var firstDescriptorCaptureIndex = 3;
ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex);
var preamble = matchArray[1];
var matchPosition = matchArray.index + preamble.length;
// OK, we have found a match in the file. This is only an acceptable match if
// it is contained within a comment.
var token = ts.getTokenAtPosition(sourceFile, matchPosition);
if (!isInsideComment(sourceFile, token, matchPosition)) {
continue;
}
var descriptor = undefined;
for (var i = 0, n = descriptors.length; i < n; i++) {
if (matchArray[i + firstDescriptorCaptureIndex]) {
descriptor = descriptors[i];
}
}
ts.Debug.assert(descriptor !== undefined);
// We don't want to match something like 'TODOBY', so we make sure a non
// letter/digit follows the match.
if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) {
continue;
}
var message = matchArray[2];
result.push({
descriptor: descriptor,
message: message,
position: matchPosition
});
}
}
return result;
function escapeRegExp(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
function getTodoCommentsRegExp() {
// NOTE: ?: means 'non-capture group'. It allows us to have groups without having to
// filter them out later in the final result array.
// TODO comments can appear in one of the following forms:
//
// 1) // TODO or /////////// TODO
//
// 2) /* TODO or /********** TODO
//
// 3) /*
// * TODO
// */
//
// The following three regexps are used to match the start of the text up to the TODO
// comment portion.
var singleLineCommentStart = /(?:\/\/+\s*)/.source;
var multiLineCommentStart = /(?:\/\*+\s*)/.source;
var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source;
// Match any of the above three TODO comment start regexps.
// Note that the outermost group *is* a capture group. We want to capture the preamble
// so that we can determine the starting position of the TODO comment match.
var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")";
// Takes the descriptors and forms a regexp that matches them as if they were literals.
// For example, if the descriptors are "TODO(jason)" and "HACK", then this will be:
//
// (?:(TODO\(jason\))|(HACK))
//
// Note that the outermost group is *not* a capture group, but the innermost groups
// *are* capture groups. By capturing the inner literals we can determine after
// matching which descriptor we are dealing with.
var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")";
// After matching a descriptor literal, the following regexp matches the rest of the
// text up to the end of the line (or */).
var endOfLineOrEndOfComment = /(?:$|\*\/)/.source;
var messageRemainder = /(?:.*?)/.source;
// This is the portion of the match we'll return as part of the TODO comment result. We
// match the literal portion up to the end of the line or end of comment.
var messagePortion = "(" + literals + messageRemainder + ")";
var regExpString = preamble + messagePortion + endOfLineOrEndOfComment;
// The final regexp will look like this:
// /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim
// The flags of the regexp are important here.
// 'g' is so that we are doing a global search and can find matches several times
// in the input.
//
// 'i' is for case insensitivity (We do this to match C# TODO comment code).
//
// 'm' is so we can find matches in a multi-line input.
return new RegExp(regExpString, "gim");
}
function isLetterOrDigit(char) {
return (char >= 97 /* a */ && char <= 122 /* z */) ||
(char >= 65 /* A */ && char <= 90 /* Z */) ||
(char >= 48 /* _0 */ && char <= 57 /* _9 */);
}
}
function getRenameInfo(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var typeChecker = program.getTypeChecker();
var node = ts.getTouchingWord(sourceFile, position);
// Can only rename an identifier.
if (node && node.kind === 69 /* Identifier */) {
var symbol = typeChecker.getSymbolAtLocation(node);
// Only allow a symbol to be renamed if it actually has at least one declaration.
if (symbol) {
var declarations = symbol.getDeclarations();
if (declarations && declarations.length > 0) {
// Disallow rename for elements that are defined in the standard TypeScript library.
var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings());
var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName));
if (defaultLibFileName) {
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var current = declarations_3[_i];
var sourceFile_1 = current.getSourceFile();
// TODO (drosen): When is there no source file?
if (!sourceFile_1) {
continue;
}
var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName));
if (canonicalName === canonicalDefaultLibName) {
return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library));
}
}
}
var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node));
var kind = getSymbolKind(symbol, node);
if (kind) {
return {
canRename: true,
kind: kind,
displayName: displayName,
localizedErrorMessage: undefined,
fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
kindModifiers: getSymbolModifiers(symbol),
triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth())
};
}
}
}
}
return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element));
function getRenameInfoError(localizedErrorMessage) {
return {
canRename: false,
localizedErrorMessage: localizedErrorMessage,
displayName: undefined,
fullDisplayName: undefined,
kind: undefined,
kindModifiers: undefined,
triggerSpan: undefined
};
}
}
return {
dispose: dispose,
cleanupSemanticCache: cleanupSemanticCache,
getSyntacticDiagnostics: getSyntacticDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics,
getSyntacticClassifications: getSyntacticClassifications,
getSemanticClassifications: getSemanticClassifications,
getEncodedSyntacticClassifications: getEncodedSyntacticClassifications,
getEncodedSemanticClassifications: getEncodedSemanticClassifications,
getCompletionsAtPosition: getCompletionsAtPosition,
getCompletionEntryDetails: getCompletionEntryDetails,
getSignatureHelpItems: getSignatureHelpItems,
getQuickInfoAtPosition: getQuickInfoAtPosition,
getDefinitionAtPosition: getDefinitionAtPosition,
getTypeDefinitionAtPosition: getTypeDefinitionAtPosition,
getReferencesAtPosition: getReferencesAtPosition,
findReferences: findReferences,
getOccurrencesAtPosition: getOccurrencesAtPosition,
getDocumentHighlights: getDocumentHighlights,
getNameOrDottedNameSpan: getNameOrDottedNameSpan,
getBreakpointStatementAtPosition: getBreakpointStatementAtPosition,
getNavigateToItems: getNavigateToItems,
getRenameInfo: getRenameInfo,
findRenameLocations: findRenameLocations,
getNavigationBarItems: getNavigationBarItems,
getOutliningSpans: getOutliningSpans,
getTodoComments: getTodoComments,
getBraceMatchingAtPosition: getBraceMatchingAtPosition,
getIndentationAtPosition: getIndentationAtPosition,
getFormattingEditsForRange: getFormattingEditsForRange,
getFormattingEditsForDocument: getFormattingEditsForDocument,
getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke,
getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition,
getEmitOutput: getEmitOutput,
getSourceFile: getSourceFile,
getProgram: getProgram
};
}
ts.createLanguageService = createLanguageService;
/* @internal */
function getNameTable(sourceFile) {
if (!sourceFile.nameTable) {
initializeNameTable(sourceFile);
}
return sourceFile.nameTable;
}
ts.getNameTable = getNameTable;
function initializeNameTable(sourceFile) {
var nameTable = {};
walk(sourceFile);
sourceFile.nameTable = nameTable;
function walk(node) {
switch (node.kind) {
case 69 /* Identifier */:
nameTable[node.text] = node.text;
break;
case 9 /* StringLiteral */:
case 8 /* NumericLiteral */:
// We want to store any numbers/strings if they were a name that could be
// related to a declaration. So, if we have 'import x = require("something")'
// then we want 'something' to be in the name table. Similarly, if we have
// "a['propname']" then we want to store "propname" in the name table.
if (ts.isDeclarationName(node) ||
node.parent.kind === 235 /* ExternalModuleReference */ ||
isArgumentOfElementAccessExpression(node)) {
nameTable[node.text] = node.text;
}
break;
default:
ts.forEachChild(node, walk);
}
}
}
function isArgumentOfElementAccessExpression(node) {
return node &&
node.parent &&
node.parent.kind === 170 /* ElementAccessExpression */ &&
node.parent.argumentExpression === node;
}
/// Classifier
function createClassifier() {
var scanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false);
/// We do not have a full parser support to know when we should parse a regex or not
/// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where
/// we have a series of divide operator. this list allows us to be more accurate by ruling out
/// locations where a regexp cannot exist.
var noRegexTable = [];
noRegexTable[69 /* Identifier */] = true;
noRegexTable[9 /* StringLiteral */] = true;
noRegexTable[8 /* NumericLiteral */] = true;
noRegexTable[10 /* RegularExpressionLiteral */] = true;
noRegexTable[97 /* ThisKeyword */] = true;
noRegexTable[41 /* PlusPlusToken */] = true;
noRegexTable[42 /* MinusMinusToken */] = true;
noRegexTable[18 /* CloseParenToken */] = true;
noRegexTable[20 /* CloseBracketToken */] = true;
noRegexTable[16 /* CloseBraceToken */] = true;
noRegexTable[99 /* TrueKeyword */] = true;
noRegexTable[84 /* FalseKeyword */] = true;
// Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact)
// classification on template strings. Because of the context free nature of templates,
// the only precise way to classify a template portion would be by propagating the stack across
// lines, just as we do with the end-of-line state. However, this is a burden for implementers,
// and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead
// flatten any nesting when the template stack is non-empty and encode it in the end-of-line state.
// Situations in which this fails are
// 1) When template strings are nested across different lines:
// `hello ${ `world
// ` }`
//
// Where on the second line, you will get the closing of a template,
// a closing curly, and a new template.
//
// 2) When substitution expressions have curly braces and the curly brace falls on the next line:
// `hello ${ () => {
// return "world" } } `
//
// Where on the second line, you will get the 'return' keyword,
// a string literal, and a template end consisting of '} } `'.
var templateStack = [];
/** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */
function canFollow(keyword1, keyword2) {
if (ts.isAccessibilityModifier(keyword1)) {
if (keyword2 === 123 /* GetKeyword */ ||
keyword2 === 129 /* SetKeyword */ ||
keyword2 === 121 /* ConstructorKeyword */ ||
keyword2 === 113 /* StaticKeyword */) {
// Allow things like "public get", "public constructor" and "public static".
// These are all legal.
return true;
}
// Any other keyword following "public" is actually an identifier an not a real
// keyword.
return false;
}
// Assume any other keyword combination is legal. This can be refined in the future
// if there are more cases we want the classifier to be better at.
return true;
}
function convertClassifications(classifications, text) {
var entries = [];
var dense = classifications.spans;
var lastEnd = 0;
for (var i = 0, n = dense.length; i < n; i += 3) {
var start = dense[i];
var length_1 = dense[i + 1];
var type = dense[i + 2];
// Make a whitespace entry between the last item and this one.
if (lastEnd >= 0) {
var whitespaceLength_1 = start - lastEnd;
if (whitespaceLength_1 > 0) {
entries.push({ length: whitespaceLength_1, classification: TokenClass.Whitespace });
}
}
entries.push({ length: length_1, classification: convertClassification(type) });
lastEnd = start + length_1;
}
var whitespaceLength = text.length - lastEnd;
if (whitespaceLength > 0) {
entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace });
}
return { entries: entries, finalLexState: classifications.endOfLineState };
}
function convertClassification(type) {
switch (type) {
case 1 /* comment */: return TokenClass.Comment;
case 3 /* keyword */: return TokenClass.Keyword;
case 4 /* numericLiteral */: return TokenClass.NumberLiteral;
case 5 /* operator */: return TokenClass.Operator;
case 6 /* stringLiteral */: return TokenClass.StringLiteral;
case 8 /* whiteSpace */: return TokenClass.Whitespace;
case 10 /* punctuation */: return TokenClass.Punctuation;
case 2 /* identifier */:
case 11 /* className */:
case 12 /* enumName */:
case 13 /* interfaceName */:
case 14 /* moduleName */:
case 15 /* typeParameterName */:
case 16 /* typeAliasName */:
case 9 /* text */:
case 17 /* parameterName */:
default:
return TokenClass.Identifier;
}
}
function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) {
return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text);
}
// If there is a syntactic classifier ('syntacticClassifierAbsent' is false),
// we will be more conservative in order to avoid conflicting with the syntactic classifier.
function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) {
var offset = 0;
var token = 0 /* Unknown */;
var lastNonTriviaToken = 0 /* Unknown */;
// Empty out the template stack for reuse.
while (templateStack.length > 0) {
templateStack.pop();
}
// If we're in a string literal, then prepend: "\
// (and a newline). That way when we lex we'll think we're still in a string literal.
//
// If we're in a multiline comment, then prepend: /*
// (and a newline). That way when we lex we'll think we're still in a multiline comment.
switch (lexState) {
case 3 /* InDoubleQuoteStringLiteral */:
text = "\"\\\n" + text;
offset = 3;
break;
case 2 /* InSingleQuoteStringLiteral */:
text = "'\\\n" + text;
offset = 3;
break;
case 1 /* InMultiLineCommentTrivia */:
text = "/*\n" + text;
offset = 3;
break;
case 4 /* InTemplateHeadOrNoSubstitutionTemplate */:
text = "`\n" + text;
offset = 2;
break;
case 5 /* InTemplateMiddleOrTail */:
text = "}\n" + text;
offset = 2;
// fallthrough
case 6 /* InTemplateSubstitutionPosition */:
templateStack.push(12 /* TemplateHead */);
break;
}
scanner.setText(text);
var result = {
endOfLineState: 0 /* None */,
spans: []
};
// We can run into an unfortunate interaction between the lexical and syntactic classifier
// when the user is typing something generic. Consider the case where the user types:
//
// Foo<number
//
// From the lexical classifier's perspective, 'number' is a keyword, and so the word will
// be classified as such. However, from the syntactic classifier's tree-based perspective
// this is simply an expression with the identifier 'number' on the RHS of the less than
// token. So the classification will go back to being an identifier. The moment the user
// types again, number will become a keyword, then an identifier, etc. etc.
//
// To try to avoid this problem, we avoid classifying contextual keywords as keywords
// when the user is potentially typing something generic. We just can't do a good enough
// job at the lexical level, and so well leave it up to the syntactic classifier to make
// the determination.
//
// In order to determine if the user is potentially typing something generic, we use a
// weak heuristic where we track < and > tokens. It's a weak heuristic, but should
// work well enough in practice.
var angleBracketStack = 0;
do {
token = scanner.scan();
if (!ts.isTrivia(token)) {
if ((token === 39 /* SlashToken */ || token === 61 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) {
if (scanner.reScanSlashToken() === 10 /* RegularExpressionLiteral */) {
token = 10 /* RegularExpressionLiteral */;
}
}
else if (lastNonTriviaToken === 21 /* DotToken */ && isKeyword(token)) {
token = 69 /* Identifier */;
}
else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) {
// We have two keywords in a row. Only treat the second as a keyword if
// it's a sequence that could legally occur in the language. Otherwise
// treat it as an identifier. This way, if someone writes "private var"
// we recognize that 'var' is actually an identifier here.
token = 69 /* Identifier */;
}
else if (lastNonTriviaToken === 69 /* Identifier */ &&
token === 25 /* LessThanToken */) {
// Could be the start of something generic. Keep track of that by bumping
// up the current count of generic contexts we may be in.
angleBracketStack++;
}
else if (token === 27 /* GreaterThanToken */ && angleBracketStack > 0) {
// If we think we're currently in something generic, then mark that that
// generic entity is complete.
angleBracketStack--;
}
else if (token === 117 /* AnyKeyword */ ||
token === 130 /* StringKeyword */ ||
token === 128 /* NumberKeyword */ ||
token === 120 /* BooleanKeyword */ ||
token === 131 /* SymbolKeyword */) {
if (angleBracketStack > 0 && !syntacticClassifierAbsent) {
// If it looks like we're could be in something generic, don't classify this
// as a keyword. We may just get overwritten by the syntactic classifier,
// causing a noisy experience for the user.
token = 69 /* Identifier */;
}
}
else if (token === 12 /* TemplateHead */) {
templateStack.push(token);
}
else if (token === 15 /* OpenBraceToken */) {
// If we don't have anything on the template stack,
// then we aren't trying to keep track of a previously scanned template head.
if (templateStack.length > 0) {
templateStack.push(token);
}
}
else if (token === 16 /* CloseBraceToken */) {
// If we don't have anything on the template stack,
// then we aren't trying to keep track of a previously scanned template head.
if (templateStack.length > 0) {
var lastTemplateStackToken = ts.lastOrUndefined(templateStack);
if (lastTemplateStackToken === 12 /* TemplateHead */) {
token = scanner.reScanTemplateToken();
// Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us.
if (token === 14 /* TemplateTail */) {
templateStack.pop();
}
else {
ts.Debug.assert(token === 13 /* TemplateMiddle */, "Should have been a template middle. Was " + token);
}
}
else {
ts.Debug.assert(lastTemplateStackToken === 15 /* OpenBraceToken */, "Should have been an open brace. Was: " + token);
templateStack.pop();
}
}
}
lastNonTriviaToken = token;
}
processToken();
} while (token !== 1 /* EndOfFileToken */);
return result;
function processToken() {
var start = scanner.getTokenPos();
var end = scanner.getTextPos();
addResult(start, end, classFromKind(token));
if (end >= text.length) {
if (token === 9 /* StringLiteral */ || token === 163 /* StringLiteralType */) {
// Check to see if we finished up on a multiline string literal.
var tokenText = scanner.getTokenText();
if (scanner.isUnterminated()) {
var lastCharIndex = tokenText.length - 1;
var numBackslashes = 0;
while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) {
numBackslashes++;
}
// If we have an odd number of backslashes, then the multiline string is unclosed
if (numBackslashes & 1) {
var quoteChar = tokenText.charCodeAt(0);
result.endOfLineState = quoteChar === 34 /* doubleQuote */
? 3 /* InDoubleQuoteStringLiteral */
: 2 /* InSingleQuoteStringLiteral */;
}
}
}
else if (token === 3 /* MultiLineCommentTrivia */) {
// Check to see if the multiline comment was unclosed.
if (scanner.isUnterminated()) {
result.endOfLineState = 1 /* InMultiLineCommentTrivia */;
}
}
else if (ts.isTemplateLiteralKind(token)) {
if (scanner.isUnterminated()) {
if (token === 14 /* TemplateTail */) {
result.endOfLineState = 5 /* InTemplateMiddleOrTail */;
}
else if (token === 11 /* NoSubstitutionTemplateLiteral */) {
result.endOfLineState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */;
}
else {
ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token);
}
}
}
else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 12 /* TemplateHead */) {
result.endOfLineState = 6 /* InTemplateSubstitutionPosition */;
}
}
}
function addResult(start, end, classification) {
if (classification === 8 /* whiteSpace */) {
// Don't bother with whitespace classifications. They're not needed.
return;
}
if (start === 0 && offset > 0) {
// We're classifying the first token, and this was a case where we prepended
// text. We should consider the start of this token to be at the start of
// the original text.
start += offset;
}
// All our tokens are in relation to the augmented text. Move them back to be
// relative to the original text.
start -= offset;
end -= offset;
var length = end - start;
if (length > 0) {
result.spans.push(start);
result.spans.push(length);
result.spans.push(classification);
}
}
}
function isBinaryExpressionOperatorToken(token) {
switch (token) {
case 37 /* AsteriskToken */:
case 39 /* SlashToken */:
case 40 /* PercentToken */:
case 35 /* PlusToken */:
case 36 /* MinusToken */:
case 43 /* LessThanLessThanToken */:
case 44 /* GreaterThanGreaterThanToken */:
case 45 /* GreaterThanGreaterThanGreaterThanToken */:
case 25 /* LessThanToken */:
case 27 /* GreaterThanToken */:
case 28 /* LessThanEqualsToken */:
case 29 /* GreaterThanEqualsToken */:
case 91 /* InstanceOfKeyword */:
case 90 /* InKeyword */:
case 116 /* AsKeyword */:
case 30 /* EqualsEqualsToken */:
case 31 /* ExclamationEqualsToken */:
case 32 /* EqualsEqualsEqualsToken */:
case 33 /* ExclamationEqualsEqualsToken */:
case 46 /* AmpersandToken */:
case 48 /* CaretToken */:
case 47 /* BarToken */:
case 51 /* AmpersandAmpersandToken */:
case 52 /* BarBarToken */:
case 67 /* BarEqualsToken */:
case 66 /* AmpersandEqualsToken */:
case 68 /* CaretEqualsToken */:
case 63 /* LessThanLessThanEqualsToken */:
case 64 /* GreaterThanGreaterThanEqualsToken */:
case 65 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
case 57 /* PlusEqualsToken */:
case 58 /* MinusEqualsToken */:
case 59 /* AsteriskEqualsToken */:
case 61 /* SlashEqualsToken */:
case 62 /* PercentEqualsToken */:
case 56 /* EqualsToken */:
case 24 /* CommaToken */:
return true;
default:
return false;
}
}
function isPrefixUnaryExpressionOperatorToken(token) {
switch (token) {
case 35 /* PlusToken */:
case 36 /* MinusToken */:
case 50 /* TildeToken */:
case 49 /* ExclamationToken */:
case 41 /* PlusPlusToken */:
case 42 /* MinusMinusToken */:
return true;
default:
return false;
}
}
function isKeyword(token) {
return token >= 70 /* FirstKeyword */ && token <= 135 /* LastKeyword */;
}
function classFromKind(token) {
if (isKeyword(token)) {
return 3 /* keyword */;
}
else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) {
return 5 /* operator */;
}
else if (token >= 15 /* FirstPunctuation */ && token <= 68 /* LastPunctuation */) {
return 10 /* punctuation */;
}
switch (token) {
case 8 /* NumericLiteral */:
return 4 /* numericLiteral */;
case 9 /* StringLiteral */:
case 163 /* StringLiteralType */:
return 6 /* stringLiteral */;
case 10 /* RegularExpressionLiteral */:
return 7 /* regularExpressionLiteral */;
case 7 /* ConflictMarkerTrivia */:
case 3 /* MultiLineCommentTrivia */:
case 2 /* SingleLineCommentTrivia */:
return 1 /* comment */;
case 5 /* WhitespaceTrivia */:
case 4 /* NewLineTrivia */:
return 8 /* whiteSpace */;
case 69 /* Identifier */:
default:
if (ts.isTemplateLiteralKind(token)) {
return 6 /* stringLiteral */;
}
return 2 /* identifier */;
}
}
return {
getClassificationsForLine: getClassificationsForLine,
getEncodedLexicalClassifications: getEncodedLexicalClassifications
};
}
ts.createClassifier = createClassifier;
/**
* Get the path of the default library files (lib.d.ts) as distributed with the typescript
* node package.
* The functionality is not supported if the ts module is consumed outside of a node module.
*/
function getDefaultLibFilePath(options) {
// Check __dirname is defined and that we are on a node.js system.
if (typeof __dirname !== "undefined") {
return __dirname + ts.directorySeparator + ts.getDefaultLibFileName(options);
}
throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ");
}
ts.getDefaultLibFilePath = getDefaultLibFilePath;
function initializeServices() {
ts.objectAllocator = {
getNodeConstructor: function () { return NodeObject; },
getSourceFileConstructor: function () { return SourceFileObject; },
getSymbolConstructor: function () { return SymbolObject; },
getTypeConstructor: function () { return TypeObject; },
getSignatureConstructor: function () { return SignatureObject; },
};
}
initializeServices();
})(ts || (ts = {}));
//# sourceMappingURL=services.js.map | mit |
cuckata23/wurfl-data | data/nokia_c5_00_ver1_subuadot2u.php | 168 | <?php
return array (
'id' => 'nokia_c5_00_ver1_subuadot2u',
'fallback' => 'nokia_c5_00_ver1',
'capabilities' =>
array (
'model_name' => 'C5-00.2',
),
);
| mit |
jermeyjungbeker/VP11B2 | src/main/java/edu/avans/hartigehap/aop/MyExecutionTimeAspect.java | 1157 | package edu.avans.hartigehap.aop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class MyExecutionTimeAspect {
@Pointcut("@annotation(edu.avans.hartigehap.aop.MyExecutionTime) && execution(* edu.avans.hartigehap..*(..))") // the
// pointcut
// expression
public void myExecutionTimeAnnotation() { // the pointcut signature
}
@Around("myExecutionTimeAnnotation()")
public Object myExecutionTimeAdvice(
ProceedingJoinPoint joinPoint /*
* , MyExecutionTime annotation
*/) throws Throwable {
long startMillis = System.currentTimeMillis();
System.err.println("(AOP-myExecTime) Starting timing method " + joinPoint.getSignature());
Object retVal = joinPoint.proceed();
long duration = System.currentTimeMillis() - startMillis;
System.err.println("(AOP-myExecTime) Call to " + joinPoint.getSignature() + " took " + duration + " ms");
return retVal;
}
}
| mit |
ilievv/Telerik | Homework/JavaScript/JavaScript Fundamentals/05. Conditional Statements/07. Biggest-Of-Five.js | 207 | function solve(args) {
var a = +args[0],
b = +args[1],
c = +args[2],
d = +args[3],
e = +args[4];
console.log(Math.max(Math.max(Math.max(a, b), Math.max(c, d)), e));
} | mit |
korczis/zlown | lib/zlown/daemon/daemon.rb | 403 | # encoding: UTF-8
#
# Copyright (c) 2016 Tomas Korcak <[email protected]>. All rights reserved.
# This source code is licensed under the MIT-style license found in the
# LICENSE file in the root directory of this source tree.
module Zlown
class Daemon
def run(args = [], opts = {})
puts 'Running Zlown loop'
STDOUT.flush
while true
sleep 1
end
end
end
end
| mit |
stoplightio/gitlabhq | lib/gitlab/kubernetes/helm/api.rb | 3863 | # frozen_string_literal: true
module Gitlab
module Kubernetes
module Helm
class Api
def initialize(kubeclient)
@kubeclient = kubeclient
@namespace = Gitlab::Kubernetes::Namespace.new(Gitlab::Kubernetes::Helm::NAMESPACE, kubeclient)
end
def install(command)
namespace.ensure_exists!
create_service_account(command)
create_cluster_role_binding(command)
create_config_map(command)
delete_pod!(command.pod_name)
kubeclient.create_pod(command.pod_resource)
end
alias_method :update, :install
def uninstall(command)
namespace.ensure_exists!
create_config_map(command)
delete_pod!(command.pod_name)
kubeclient.create_pod(command.pod_resource)
end
##
# Returns Pod phase
#
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
#
# values: "Pending", "Running", "Succeeded", "Failed", "Unknown"
#
def status(pod_name)
kubeclient.get_pod(pod_name, namespace.name).status.phase
end
def log(pod_name)
kubeclient.get_pod_log(pod_name, namespace.name).body
end
def delete_pod!(pod_name)
kubeclient.delete_pod(pod_name, namespace.name)
rescue ::Kubeclient::ResourceNotFoundError
# no-op
end
def get_config_map(config_map_name)
namespace.ensure_exists!
kubeclient.get_config_map(config_map_name, namespace.name)
end
private
attr_reader :kubeclient, :namespace
def create_config_map(command)
command.config_map_resource.tap do |config_map_resource|
break unless config_map_resource
if config_map_exists?(config_map_resource)
kubeclient.update_config_map(config_map_resource)
else
kubeclient.create_config_map(config_map_resource)
end
end
end
def update_config_map(command)
command.config_map_resource.tap do |config_map_resource|
kubeclient.update_config_map(config_map_resource)
end
end
def create_service_account(command)
command.service_account_resource.tap do |service_account_resource|
break unless service_account_resource
if service_account_exists?(service_account_resource)
kubeclient.update_service_account(service_account_resource)
else
kubeclient.create_service_account(service_account_resource)
end
end
end
def create_cluster_role_binding(command)
command.cluster_role_binding_resource.tap do |cluster_role_binding_resource|
break unless cluster_role_binding_resource
if cluster_role_binding_exists?(cluster_role_binding_resource)
kubeclient.update_cluster_role_binding(cluster_role_binding_resource)
else
kubeclient.create_cluster_role_binding(cluster_role_binding_resource)
end
end
end
def config_map_exists?(resource)
kubeclient.get_config_map(resource.metadata.name, resource.metadata.namespace)
rescue ::Kubeclient::ResourceNotFoundError
false
end
def service_account_exists?(resource)
kubeclient.get_service_account(resource.metadata.name, resource.metadata.namespace)
rescue ::Kubeclient::ResourceNotFoundError
false
end
def cluster_role_binding_exists?(resource)
kubeclient.get_cluster_role_binding(resource.metadata.name)
rescue ::Kubeclient::ResourceNotFoundError
false
end
end
end
end
end
| mit |
wen96/pl-man2 | masterclient/src/CEntity.cpp | 3426 | #include "CEntity.h"
#include "IComponent.h"
#include <boost/foreach.hpp>
namespace masterclient {
/** Constructor por defecto
* Se le pasan los parámetros necesarios para poder dibujarlo
* ANYADE EL ELEMENTO AL ARBOL, CUIDADO: Esto cambiara cuando termine con los componentes
* @param p posicion en el tablero
* @param tipe entero que representa el tipo de entidad que se desea crear
* @param parent nodo padre del que cogarlo en el arbol del motor
* @param mgr puntero al SceneManager
* @param id entero que lo identifica tanto en el motor grafico como en el juego
*/
CEntity::CEntity(irr::core::vector2d<irr::s32> _p, int _tipe, irr::s32 _id, int _nComponents,
IComponent *c1, IComponent *c2) {
//asignamos el tipo
m_tipe = _tipe;
//Asignamos la posicion en la matriz
m_position = _p;
// Generamos el componente grafico
components.clear();
//components.push_back(new GraphicComponent(p, tipe, parent, mgr, id));
m_id = _id;
m_visible = true;
components.push_back(c1);
components.push_back(c2);
//Recorro la lista de componentes que me hayan pasado
/*va_list vl;
va_start(vl,_nComponents);
for (int i = 0; i < _nComponents; i++){
components.push_back(va_arg(vl,IComponent*));//Y los voy guardando en el vector
}
va_end(vl);*/
}
/**
* Constructor que no engancha al arbol de irrlicht
* @param p
* @param tipe
*/
CEntity::CEntity(irr::core::vector2d<irr::s32> p, int tipe, int id){
m_tipe = tipe;
//Asignamos la posicion en la matriz
m_position = p;
m_id = id;
components.clear();
m_visible = true;
}
/**
* Destructor
*/
CEntity::~CEntity() {
for (unsigned int i = 0; i < components.size(); i++){
IComponent *comp = components[i];
if (comp){
comp->destroy();
comp = NULL;
}
components[i] = NULL;
}
components.clear();
}
/*
* Constructor de copia
*/
CEntity::CEntity(const CEntity& e) {
copiar(e);
}
/**
* Sobrecarga del operador igual
* @param e
* @return
*/
CEntity& CEntity::operator =(const CEntity& e) {
if (this != &e) {
this->~CEntity();
copiar(e);
}
return *this;
}
/**
* No se hace una copia se actualizan los datos que son necesarios:
* m_tipe y m_position
* @param _entity con la entidad con la que actualizar
*/
void CEntity::refresh(CEntity* _entity) {
this->setPosition(_entity->getPosition());
this->setTipe(_entity->getTipe());
this->setVisible(_entity->isVisible());
this->refresh();
}
/**
* Actualiza todos los componentes con la funcion refresh del componente
*/
void CEntity::refresh() {
for (unsigned int i = 0; i < components.size(); i++){
components[i]->refresh(this);
}
}
void CEntity::update() {
}
/**
* Devuelve el tipo de entidad
* @return
*/
int CEntity::getTipe() const {
return m_tipe;
}
/**
* Devuelve el tipo de puntero
* @param tipe
*/
void CEntity::setTipe(int tipe) {
m_tipe = tipe;
}
int CEntity::getId() const {
return m_id;
}
void CEntity::setId(int id) {
m_id = id;
}
irr::core::vector2d<irr::s32> CEntity::getPosition() const {
return m_position;
}
void CEntity::setPosition(irr::core::vector2d<irr::s32> position) {
m_position = position;
}
bool CEntity::isVisible() const {
return m_visible;
}
void CEntity::setVisible(bool visible) {
m_visible = visible;
}
void CEntity::copiar(const CEntity& e) {
//TODO: m_gc = e.getGc();
m_tipe = e.getTipe();
m_id = e.getId();
m_position = e.getPosition();
m_visible = e.isVisible();
}
} /* namespace masterclient */
| mit |
IbraDev/Dashboard_Commercial | src/Suivi/SuiviBundle/Form/CategorieType.php | 937 | <?php
namespace Suivi\SuiviBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class CategorieType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('nom')
->add('description')
->add('dateCreation')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Suivi\SuiviBundle\Entity\Categorie'
));
}
/**
* @return string
*/
public function getName()
{
return 'suivi_suivibundle_categorie';
}
}
| mit |
SevenSpikes/api-plugin-for-nopcommerce | Nop.Plugin.Api.Tests/ServicesTests/Categories/GetCategoriesCount/CategoryApiServiceTests_GetCategoriesCount_CreatedParameters.cs | 4156 | using System;
using System.Collections.Generic;
using System.Linq;
using Nop.Core.Data;
using Nop.Core.Domain.Catalog;
using Nop.Plugin.Api.Services;
using NUnit.Framework;
using Rhino.Mocks;
namespace Nop.Plugin.Api.Tests.ServicesTests.Categories.GetCategoriesCount
{
using Nop.Services.Stores;
[TestFixture]
public class CategoryApiServiceTests_GetCategoriesCount_CreatedParameters
{
private ICategoryApiService _categoryApiService;
private List<Category> _existigCategories;
private DateTime _baseDate;
[SetUp]
public void Setup()
{
_baseDate = new DateTime(2016, 2, 23);
_existigCategories = new List<Category>()
{
new Category() {Id = 2, CreatedOnUtc = _baseDate.AddMonths(2) },
new Category() {Id = 3, CreatedOnUtc = _baseDate.AddMonths(10) },
new Category() {Id = 1, CreatedOnUtc = _baseDate.AddMonths(7) },
new Category() {Id = 4, CreatedOnUtc = _baseDate },
new Category() {Id = 5, CreatedOnUtc = _baseDate.AddMonths(3) },
new Category() {Id = 6, Deleted = true, CreatedOnUtc = _baseDate.AddMonths(10) },
new Category() {Id = 7, Published = false, CreatedOnUtc = _baseDate.AddMonths(4) }
};
var categoryRepo = MockRepository.GenerateStub<IRepository<Category>>();
categoryRepo.Stub(x => x.TableNoTracking).Return(_existigCategories.AsQueryable());
var productCategoryRepo = MockRepository.GenerateStub<IRepository<ProductCategory>>();
var storeMappingService = MockRepository.GenerateStub<IStoreMappingService>();
storeMappingService.Stub(x => x.Authorize(Arg<Category>.Is.Anything)).Return(true);
_categoryApiService = new CategoryApiService(categoryRepo, productCategoryRepo, storeMappingService);
}
[Test]
public void WhenCalledWithCreatedAtMinParameter_GivenSomeCategoriesCreatedAfterThatDate_ShouldReturnTheirCount()
{
// Arange
DateTime createdAtMinDate = _baseDate.AddMonths(5);
var expectedCollection =
_existigCategories.Where(x => x.CreatedOnUtc > createdAtMinDate && !x.Deleted);
var expectedCategoriesCount = expectedCollection.Count();
// Act
var categoriesCount = _categoryApiService.GetCategoriesCount(createdAtMin: createdAtMinDate);
// Assert
Assert.AreEqual(expectedCategoriesCount, categoriesCount);
}
[Test]
public void WhenCalledWithCreatedAtMinParameter_GivenAllCategoriesCreatedBeforeThatDate_ShouldReturnZero()
{
// Arange
DateTime createdAtMinDate = _baseDate.AddMonths(11);
// Act
var categoriesCount = _categoryApiService.GetCategoriesCount(createdAtMin: createdAtMinDate);
// Assert
Assert.AreEqual(0, categoriesCount);
}
[Test]
public void WhenCalledWithCreatedAtMaxParameter_GivenSomeCategoriesCreatedBeforeThatDate_ShouldReturnTheirCount()
{
// Arange
DateTime createdAtMaxDate = _baseDate.AddMonths(5);
var expectedCollection = _existigCategories.Where(x => x.CreatedOnUtc < createdAtMaxDate && !x.Deleted);
var expectedCategoriesCount = expectedCollection.Count();
// Act
var categoriesCount = _categoryApiService.GetCategoriesCount(createdAtMax: createdAtMaxDate);
// Assert
Assert.AreEqual(expectedCategoriesCount, categoriesCount);
}
[Test]
public void WhenCalledWithCreatedAtMaxParameter_GivenAllCategoriesCreatedAfterThatDate_ShouldReturnZero()
{
// Arange
DateTime createdAtMaxDate = _baseDate.Subtract(new TimeSpan(365)); // subtract one year
// Act
var categoriesCount = _categoryApiService.GetCategoriesCount(createdAtMax: createdAtMaxDate);
// Assert
Assert.AreEqual(0, categoriesCount);
}
}
} | mit |
js94766524/HttpLib.Net | HttpLib/Properties/AssemblyInfo.cs | 1267 | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("HttpLib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HttpLib")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c01a02e9-5100-45b2-b5ab-1dec523fc71b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| mit |
Meee32/net2 | src/qt/sendcoinsentry.cpp | 4297 | #include "sendcoinsentry.h"
#include "ui_sendcoinsentry.h"
#include "guiutil.h"
#include "bitcoinunits.h"
#include "addressbookpage.h"
#include "walletmodel.h"
#include "optionsmodel.h"
#include "addresstablemodel.h"
#include <QApplication>
#include <QClipboard>
SendCoinsEntry::SendCoinsEntry(QWidget *parent) :
QFrame(parent),
ui(new Ui::SendCoinsEntry),
model(0)
{
ui->setupUi(this);
#ifdef Q_OS_MAC
ui->payToLayout->setSpacing(4);
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
ui->payTo->setPlaceholderText(tr("Enter a Pandacoin address (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)"));
#endif
setFocusPolicy(Qt::TabFocus);
setFocusProxy(ui->payTo);
GUIUtil::setupAddressWidget(ui->payTo, this);
}
SendCoinsEntry::~SendCoinsEntry()
{
delete ui;
}
void SendCoinsEntry::on_pasteButton_clicked()
{
// Paste text from clipboard into recipient field
ui->payTo->setText(QApplication::clipboard()->text());
}
void SendCoinsEntry::on_addressBookButton_clicked()
{
if(!model)
return;
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
if(dlg.exec())
{
ui->payTo->setText(dlg.getReturnValue());
ui->payAmount->setFocus();
}
}
void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
if(!model)
return;
// Fill in label from address book, if address has an associated label
QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
if(!associatedLabel.isEmpty())
ui->addAsLabel->setText(associatedLabel);
}
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
if(model && model->getOptionsModel())
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
connect(ui->payAmount, SIGNAL(textChanged()), this, SIGNAL(payAmountChanged()));
clear();
}
void SendCoinsEntry::setRemoveEnabled(bool enabled)
{
ui->deleteButton->setEnabled(enabled);
}
void SendCoinsEntry::clear()
{
ui->payTo->clear();
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void SendCoinsEntry::on_deleteButton_clicked()
{
emit removeEntry(this);
}
bool SendCoinsEntry::validate()
{
// Check input validity
bool retval = true;
if(!ui->payAmount->validate())
{
retval = false;
}
else
{
if(ui->payAmount->value() <= 0)
{
// Cannot send 0 coins or less
ui->payAmount->setValid(false);
retval = false;
}
}
if(!ui->payTo->hasAcceptableInput() ||
(model && !model->validateAddress(ui->payTo->text())))
{
ui->payTo->setValid(false);
retval = false;
}
return retval;
}
SendCoinsRecipient SendCoinsEntry::getValue()
{
SendCoinsRecipient rv;
rv.address = ui->payTo->text();
rv.label = ui->addAsLabel->text();
rv.amount = ui->payAmount->value();
return rv;
}
QWidget *SendCoinsEntry::setupTabChain(QWidget *prev)
{
QWidget::setTabOrder(prev, ui->payTo);
QWidget::setTabOrder(ui->payTo, ui->addressBookButton);
QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton);
QWidget::setTabOrder(ui->pasteButton, ui->deleteButton);
QWidget::setTabOrder(ui->deleteButton, ui->addAsLabel);
return ui->payAmount->setupTabChain(ui->addAsLabel);
}
void SendCoinsEntry::setValue(const SendCoinsRecipient &value)
{
ui->payTo->setText(value.address);
ui->addAsLabel->setText(value.label);
ui->payAmount->setValue(value.amount);
}
bool SendCoinsEntry::isClear()
{
return ui->payTo->text().isEmpty();
}
void SendCoinsEntry::setFocus()
{
ui->payTo->setFocus();
}
void SendCoinsEntry::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
// Update payAmount with the current unit
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
}
| mit |
Zchule/Preventa2 | src/pages/presale/order/order-presale/order-presale.ts | 2295 | import { Component } from '@angular/core';
import { IonicPage, ViewController, NavParams, LoadingController, App, AlertController } from 'ionic-angular';
import { FirebaseListObservable } from 'angularfire2/database';
import { OrderService } from '../../../../providers/order.service';
@IonicPage()
@Component({
selector: 'page-order-presale',
templateUrl: 'order-presale.html',
})
export class OrderPresalePage {
products: any[] = [];
total: number = 0;
fireProducts: FirebaseListObservable<any>;
state: string = 'init';
user: any = {};
constructor(
private viewCtrl: ViewController,
private navParams: NavParams,
private orderService: OrderService,
private loadCtrl: LoadingController,
private app: App,
private alertCtrl: AlertController
) {
this.state = this.navParams.get('state');
}
ionViewDidLoad() {
this.getClient();
this.getProducts();
}
close(){
return this.viewCtrl.dismiss();
}
delete( product ){
this.fireProducts.remove( product.$key );
}
checkTotal(){
if(this.total < 50){
let alert = this.alertCtrl.create({
title: 'Recuerda',
message: 'El pedido debe ser de un monto mayor a 50 Bs',
buttons:['Aceptar']
});
alert.present();
}else{
this.done();
}
}
private done(){
let load = this.loadCtrl.create({
content: 'Finalizando pedido'
});
load.present();
this.orderService.updateOrder(this.navParams.get('order'),{
state: 'pending',
total: this.total
})
.then(()=>{
load.dismiss();
load.onDidDismiss(()=>{
this.close();
this.app.getRootNav().setRoot('HomePresalePage');
});
})
.catch(error=>{
load.dismiss();
console.error(error);
});
}
private getClient(){
this.orderService.getOrderClient(this.navParams.get('order'))
.subscribe(user =>{
this.user = user;
});
}
private getProducts(){
this.fireProducts = this.orderService.getOrderProducts(this.navParams.get('order'));
this.fireProducts.subscribe((products)=>{
this.products = products;
let total = 0;
this.products.forEach((item)=>{
total+= item.price * item.count;
});
this.total = total;
});
}
} | mit |
gdgeek/GDGeek | Assets/GDGeek/Plugins/Voxel/Mesh/File/MagicaVoxelFormater.cs | 9140 | using UnityEngine;
//using UnityEditor;
using GDGeek;
using System.IO;
using System.Collections.Generic;
using System.Security.Cryptography;
using System;
namespace GDGeek{
public class MagicaVoxelFormater
{
public static ushort[] palette_ = new ushort[] { 32767, 25599, 19455, 13311, 7167, 1023, 32543, 25375, 19231, 13087, 6943, 799, 32351, 25183,
19039, 12895, 6751, 607, 32159, 24991, 18847, 12703, 6559, 415, 31967, 24799, 18655, 12511, 6367, 223, 31775, 24607, 18463, 12319, 6175, 31,
32760, 25592, 19448, 13304, 7160, 1016, 32536, 25368, 19224, 13080, 6936, 792, 32344, 25176, 19032, 12888, 6744, 600, 32152, 24984, 18840,
12696, 6552, 408, 31960, 24792, 18648, 12504, 6360, 216, 31768, 24600, 18456, 12312, 6168, 24, 32754, 25586, 19442, 13298, 7154, 1010, 32530,
25362, 19218, 13074, 6930, 786, 32338, 25170, 19026, 12882, 6738, 594, 32146, 24978, 18834, 12690, 6546, 402, 31954, 24786, 18642, 12498, 6354,
210, 31762, 24594, 18450, 12306, 6162, 18, 32748, 25580, 19436, 13292, 7148, 1004, 32524, 25356, 19212, 13068, 6924, 780, 32332, 25164, 19020,
12876, 6732, 588, 32140, 24972, 18828, 12684, 6540, 396, 31948, 24780, 18636, 12492, 6348, 204, 31756, 24588, 18444, 12300, 6156, 12, 32742,
25574, 19430, 13286, 7142, 998, 32518, 25350, 19206, 13062, 6918, 774, 32326, 25158, 19014, 12870, 6726, 582, 32134, 24966, 18822, 12678, 6534,
390, 31942, 24774, 18630, 12486, 6342, 198, 31750, 24582, 18438, 12294, 6150, 6, 32736, 25568, 19424, 13280, 7136, 992, 32512, 25344, 19200,
13056, 6912, 768, 32320, 25152, 19008, 12864, 6720, 576, 32128, 24960, 18816, 12672, 6528, 384, 31936, 24768, 18624, 12480, 6336, 192, 31744,
24576, 18432, 12288, 6144, 28, 26, 22, 20, 16, 14, 10, 8, 4, 2, 896, 832, 704, 640, 512, 448, 320, 256, 128, 64, 28672, 26624, 22528, 20480,
16384, 14336, 10240, 8192, 4096, 2048, 29596, 27482, 23254, 21140, 16912, 14798, 10570, 8456, 4228, 2114, 1 };
private struct Point
{
public byte x;
public byte y;
public byte z;
public byte i;
}
public static Color Short2Color(ushort s){
Color c = new Color ();
c.a = 1.0f;
c.r = (float)(s & 0x1f)/31.0f;
c.g = (float)(s >> 5 & 0x1f)/31.0f;
c.b = (float)(s >> 10 & 0x1f)/31.0f;
return c;
}
public static ushort Color2Short(Color c){
ushort s = 0;
s = (ushort)(Mathf.RoundToInt (c.r * 31.0f) | Mathf.RoundToInt (c.g * 31.0f)<<5 | Mathf.RoundToInt (c.b * 31.0f)<<10);
return s;
}
public static Color Bytes2Color(Vector4Int v){
Color c = new Color ();
c.r = ((float)(v.x))/255.0f;
c.g = ((float)(v.y))/255.0f;
c.b = ((float)(v.z))/255.0f;
c.a = ((float)(v.w))/255.0f;
return c;
}
public static Vector4Int Color2Bytes(Color c){
Vector4Int v;
v.x = Mathf.RoundToInt (c.r * 255.0f);
v.y = Mathf.RoundToInt (c.g * 255.0f);
v.z = Mathf.RoundToInt (c.b * 255.0f);
v.w = Mathf.RoundToInt (c.a * 255.0f);
return v;
}
private static Point ReadPoint(BinaryReader br, bool subsample){
Point point = new Point ();
point.x = (byte)(subsample ? br.ReadByte() : br.ReadByte());
point.y = (byte)(subsample ? br.ReadByte() : br.ReadByte());
point.z = (byte)(subsample ? br.ReadByte() : br.ReadByte());
point.i = (br.ReadByte());
return point;
}
private static Point[] WritePoints(VoxelStruct vs, Vector4Int[] palette){
Point[] points = new Point[vs.count];
for (int i = 0; i < vs.count; ++i) {
var data = vs.getData(i);
points[i] = new Point();
points[i].x = (byte)data.position.x;
points[i].y = (byte)data.position.z;
points[i].z = (byte)data.position.y;
Color color = data.color;
if (palette == null) {
ushort s = Color2Short (color);
for (int x = 0; x < palette_.Length; ++x) {
if (palette_ [x] == s) {
points [i].i = (byte)(x + 1);
break;
}
}
} else {
Vector4Int v = Color2Bytes (color);
for (int x = 0; x < palette.Length; ++x) {
if (palette [x] == v) {
points [i].i = (byte)(x + 1);
break;
}
}
}
}
return points;
}
private static List<VoxelData> CreateVoxelDatas(Point[] points, Vector4Int[] palette){
List<VoxelData> datas = new List<VoxelData>();
for(int i=0; i < points.Length; ++i){
VoxelData data = new VoxelData();
data.position.x = points[i].x;
data.position.y = points[i].z;
data.position.z = points[i].y;
if(palette == null){
ushort c = palette_[points[i].i - 1];
data.color = Short2Color (c);
}else{
Vector4Int v = palette[points[i].i - 1];
data.color = Bytes2Color (v);;
}
datas.Add (data);
}
return datas;
}
public static MagicaVoxel ReadFromFile(TextAsset file){
System.IO.BinaryReader br = GDGeek.VoxelReader.ReadFromFile (file);
return MagicaVoxelFormater.ReadFromBinary (br);
}
public static MagicaVoxel ReadFromBinary(System.IO.BinaryReader br){
Vector4Int[] palette = null;
Point[] points = null;
string vox = new string(br.ReadChars(4));
if (vox != "VOX ") {
return new MagicaVoxel (new VoxelStruct ());;
}
int version = br.ReadInt32();
MagicaVoxel.Main main = null;
MagicaVoxel.Rgba rgba = null;
MagicaVoxel.Size size = null;
//magic.version = version;
Vector3Int box = new Vector3Int ();
bool subsample = false;
while (br.BaseStream.Position+12 < br.BaseStream.Length)
{
string name = new string(br.ReadChars(4));
int length = br.ReadInt32();
int chunks = br.ReadInt32();
if (name == "MAIN") {
main = new MagicaVoxel.Main ();
main.size = length;
main.name = name;
main.chunks = chunks;
} else if (name == "SIZE") {
box.x = br.ReadInt32 ();
box.y = br.ReadInt32 ();
box.z = br.ReadInt32 ();
size = new MagicaVoxel.Size ();
size.size = 12;
size.name = name;
size.chunks = chunks;
size.box = box;
if (box.x > 32 || box.y > 32) {
subsample = true;
}
br.ReadBytes (length - 4 * 3);
} else if (name == "XYZI") {
int count = br.ReadInt32 ();
points = new Point[count];
for (int i = 0; i < points.Length; i++) {
points [i] = MagicaVoxelFormater.ReadPoint (br, subsample);//new Data (stream, subsample);
}
} else if (name == "RGBA") {
int n = length / 4;
palette = new Vector4Int[n];
for (int i = 0; i < n; i++) {
byte r = br.ReadByte ();
byte g = br.ReadByte ();
byte b = br.ReadByte ();
byte a = br.ReadByte ();
palette [i].x = r;
palette [i].y = g;
palette [i].z = b;
palette [i].w = a;
}
rgba = new MagicaVoxel.Rgba ();
rgba.size = length;
rgba.name = name;
rgba.chunks = chunks;
rgba.palette = palette;
} else{
if (br.BaseStream.Position + length >= br.BaseStream.Length) {
break;
} else {
br.ReadBytes(length);
}
}
}
return new MagicaVoxel ( new VoxelStruct(CreateVoxelDatas(points, palette)), main, size,rgba, version);
}
public static string GetMd5(VoxelStruct vs){
string fileMD5 = "";
/*
MemoryStream memoryStream = new MemoryStream ();
BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
WriteToBinary (vs, binaryWriter);
byte[] data = memoryStream.GetBuffer();
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
foreach (byte b in result)
{
fileMD5 += Convert.ToString(b, 16);
}*/
return fileMD5;
}
public static void WriteToBinary(VoxelStruct vs, System.IO.BinaryWriter bw){
bw.Write ("VOX ".ToCharArray());
MagicaVoxel magic = new MagicaVoxel (vs);
bw.Write ((int)magic.version);
if (magic.main != null) {
bw.Write (magic.main.name.ToCharArray ());
bw.Write ((int)magic.main.size);
bw.Write ((int)magic.main.chunks);
}
if (magic.size != null) {
bw.Write (magic.size.name.ToCharArray ());
bw.Write ((int)magic.size.size);
bw.Write ((int)magic.size.chunks);
bw.Write ((int)magic.size.box.x);
bw.Write ((int)magic.size.box.y);
bw.Write ((int)magic.size.box.z);
}
if (magic.rgba != null && magic.rgba.palette != null) {
int length = magic.rgba.palette.Length;
bw.Write (magic.rgba.name.ToCharArray ());
bw.Write ((int)(length * 4));
bw.Write ((int)magic.size.chunks);
for (int i = 0; i < length; i++)
{
Vector4Int c = magic.rgba.palette [i];
bw.Write ((byte)(c.x));
bw.Write ((byte)(c.y));
bw.Write ((byte)(c.z));
bw.Write ((byte)(c.w));
}
}
Point[] points = WritePoints (vs, magic.rgba.palette);
bw.Write ("XYZI".ToCharArray ());
bw.Write ((int)(points.Length * 4) + 4);
bw.Write ((int)0);
bw.Write ((int)points.Length);
for (int i = 0; i < points.Length; ++i) {
Point p = points[i];
bw.Write ((byte)(p.x));
bw.Write ((byte)(p.y));
bw.Write ((byte)(p.z));
bw.Write ((byte)(p.i));
}
}
}
}
| mit |
s-ueno/uENLab | uEN/Core/ILogService.cs | 13510 | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace uEN.Core
{
/// <summary>
/// ログ機能を定義します。
/// </summary>
public interface ILogService
{
void TraceInformation(string message);
void TraceInformation(string format, params object[] args);
void TraceWarning(string message);
void TraceWarning(string format, params object[] args);
void TraceError(Exception ex);
}
/// <summary>
/// ログ機能を提供します。
/// </summary>
/// <remarks>
/// フレームワーク層でのログ出力にはTraceを利用し、業務システムではBizUtilsを利用すること
/// </remarks>
[PartCreationPolicy(CreationPolicy.Shared)]
[Export(typeof(ILogService))]
[ExportMetadata(Repository.Priority, int.MaxValue)]
public class TraceLogService : ILogService
{
public virtual void TraceInformation(string message)
{
Trace.TraceInformation(message);
}
public virtual void TraceInformation(string format, params object[] args)
{
Trace.TraceInformation(format, args);
}
public virtual void TraceWarning(string message)
{
Trace.TraceWarning(message);
}
public virtual void TraceWarning(string format, params object[] args)
{
Trace.TraceWarning(format, args);
}
public virtual void TraceError(Exception ex)
{
if (ex == null) return;
Trace.TraceError(ex.ToString());
var tex = ex as TargetInvocationException;
if (tex != null)
{
var innerException = tex.InnerException as Exception;
if (innerException != null)
Trace.TraceError(innerException.ToString());
}
}
}
/// <summary>
/// エンタープライズ アプリケーション用ログリスナーを提供します
/// </summary>
/// <seealso cref="System.Diagnostics.DelimitedListTraceListener"/>
/// <seealso cref="System.Diagnostics.TextWriterTraceListener"/>
public class BizTraceListener : TraceListener
{
public BizTraceListener() : this("BizTrace") { }
public BizTraceListener(string name) : base(name) { }
protected override string[] GetSupportedAttributes()
{
return new[] { "delimiter", "encoding", "maximumSize", "escape", "dateTimeFormat",
"fileNamePrefixDateFormat", "fileName" };
}
public string FileNamePrefixDateFormat
{
get
{
lock (this)
{
if (Attributes.ContainsKey("fileNamePrefixDateFormat"))
{
_fileNamePrefixDateFormat = Attributes["fileNamePrefixDateFormat"];
}
}
return _fileNamePrefixDateFormat;
}
set
{
if (value == null) return;
_fileNamePrefixDateFormat = value;
}
}
private string _fileNamePrefixDateFormat = @"yyyyMMddHHmmssfff";
public string FileName
{
get
{
lock (this)
{
if (Attributes.ContainsKey("fileName"))
{
_fileName = Attributes["fileName"];
}
}
return _fileName;
}
set
{
if (value == null) return;
_fileName = value;
}
}
private string _fileName = @"trace.log";
public string DateTimeFormat
{
get
{
lock (this)
{
if (Attributes.ContainsKey("dateTimeFormat"))
{
_dateTimeFormat = Attributes["dateTimeFormat"];
}
}
return _dateTimeFormat;
}
set
{
if (value == null) return;
_dateTimeFormat = value;
}
}
private string _dateTimeFormat = "yyyy/MM/dd HH:mm:ss.fff";
public string Escape
{
get
{
lock (this)
{
if (Attributes.ContainsKey("escape"))
{
_escape = Attributes["escape"];
}
}
return _escape;
}
set
{
if (value == null) return;
_escape = value;
}
}
private string _escape = "\"";
public string Delimiter
{
get
{
lock (this)
{
if (Attributes.ContainsKey("delimiter"))
{
_delimiter = Attributes["delimiter"];
}
}
return _delimiter;
}
set
{
if (value == null) return;
_delimiter = value;
}
}
private string _delimiter = ",";
public Encoding Encoding
{
get
{
lock (this)
{
if (Attributes.ContainsKey("encoding"))
{
var buff = Attributes["encoding"];
try
{
_encoding = Encoding.GetEncoding(buff);
}
catch
{
}
}
}
return _encoding;
}
set
{
if (value == null) return;
_encoding = value;
}
}
private Encoding _encoding = Encoding.UTF8;
public int MaximumSize
{
get
{
lock (this)
{
if (Attributes.ContainsKey("maximumSize"))
{
var buff = Attributes["maximumSize"];
var i = _maximumSize;
if (int.TryParse(buff, out i))
{
_maximumSize = i;
}
}
}
return _maximumSize;
}
set
{
_maximumSize = value;
}
}
private int _maximumSize = 10 * 1024 * 1024;
protected StreamWriter Writer
{
get
{
EnsureWriter();
return _writer;
}
}
private StreamWriter _writer;
private void EnsureWriter()
{
if (_writer == null)
{
lock (this)
{
if (_writer == null)
{
_writer = GenerateWriter();
}
}
}
if (MaximumSize < _writer.BaseStream.Length)
{
lock (this)
{
if (MaximumSize < _writer.BaseStream.Length)
{
_writer.Flush();
_writer.Close();
_writer.Dispose();
_writer = GenerateWriter();
}
}
}
}
protected virtual StreamWriter GenerateWriter()
{
var uri = new Uri(Assembly.GetExecutingAssembly().CodeBase);
var dir = Path.GetDirectoryName(uri.LocalPath);
var buff = System.IO.Path.Combine(dir, FileName);
dir = System.IO.Path.GetDirectoryName(buff);
var baseName = System.IO.Path.GetFileName(buff);
var fileName = string.Format("{0}_{1}", DateTime.Now.ToString(FileNamePrefixDateFormat), baseName);
var i = 0;
while (System.IO.File.Exists(System.IO.Path.Combine(dir, fileName)))
{
System.Threading.Thread.Sleep(1);
fileName = string.Format("{0}_{1}", DateTime.Now.ToString(FileNamePrefixDateFormat), baseName);
if (3 < ++i)
{
break; //3回トライしてファイルが存在するようであれば、意図的なファイル名付与として上書きする
}
}
var writer = new StreamWriter(System.IO.Path.Combine(dir, fileName), false, Encoding);
writer.AutoFlush = true;
return writer;
}
public override void Write(string message)
{
if (base.NeedIndent)
{
this.WriteIndent();
}
try
{
Writer.Write(message);
}
catch (ObjectDisposedException)
{
}
}
public override void WriteLine(string message)
{
if (base.NeedIndent)
{
this.WriteIndent();
}
try
{
Writer.WriteLine(message);
}
catch (ObjectDisposedException)
{
}
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
{
TraceEvent(eventCache, source, eventType, id, message, null);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
{
if ((this.Filter == null) || this.Filter.ShouldTrace(eventCache, source, eventType, id, format, args, null, null))
{
this.WriteDateTime(eventCache);
this.Write(Delimiter);
this.WriteHeader(source, eventType, id);
this.Write(Delimiter);
if (args != null)
{
this.Write(DoEscape(string.Format(CultureInfo.InvariantCulture, format, args)));
}
else
{
this.Write(DoEscape(format));
}
this.Write(Delimiter);
this.WriteFooter(eventCache);
}
}
protected void WriteDateTime(TraceEventCache eventCache)
{
if (IsEnabled(TraceOptions.DateTime))
{
this.Write(DoEscape(DateTime.Now.ToString(DateTimeFormat)));
}
}
protected void WriteHeader(string source, TraceEventType eventType, int id)
{
var list = new List<string>();
list.Add(DoEscape(source));
list.Add(DoEscape(eventType.ToString()));
list.Add(DoEscape(id.ToString(CultureInfo.InvariantCulture)));
this.Write(string.Join(Delimiter, list));
}
protected string DoEscape(string s)
{
return Escape + (s ?? string.Empty).Replace(Escape, Escape + Escape) + Escape;
}
protected void WriteFooter(TraceEventCache eventCache)
{
if (eventCache != null)
{
var list = new List<string>();
if (IsEnabled(TraceOptions.ProcessId))
{
list.Add(DoEscape(eventCache.ProcessId.ToString()));
}
if (IsEnabled(TraceOptions.ThreadId))
{
list.Add(DoEscape(eventCache.ThreadId.ToString()));
}
if (IsEnabled(TraceOptions.Timestamp))
{
list.Add(DoEscape(eventCache.Timestamp.ToString()));
}
if (IsEnabled(TraceOptions.LogicalOperationStack))
{
var buff = new List<string>();
foreach (var each in eventCache.LogicalOperationStack)
{
buff.Add(" " + each.ToString());
}
list.Add(DoEscape(string.Join("\n", buff)));
}
if (IsEnabled(TraceOptions.Callstack))
{
list.Add(DoEscape(eventCache.Callstack.ToString()));
}
this.Write(string.Join(Delimiter, list));
}
this.WriteLine("");
}
protected bool IsEnabled(TraceOptions opts)
{
return ((opts & this.TraceOutputOptions) != TraceOptions.None);
}
public override void Flush()
{
Writer.Flush();
}
public override void Close()
{
Writer.Close();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
Writer.Dispose();
}
}
}
}
| mit |
chriskearney/stickypunch | stickypunch-service/src/main/java/com/comandante/stickypunch/Main.java | 3673 | package com.comandante.stickypunch;
import com.notnoop.apns.APNS;
import com.notnoop.apns.ApnsService;
import com.comandante.pushpackage.PackageZipBuilder;
import com.comandante.pushpackage.PackageZipConfiguration;
import com.comandante.pushpackage.PackageZipPool;
import com.comandante.pushpackage.PackageZipPoolPopulate;
import com.comandante.pushpackage.PackageZipSigner;
import com.comandante.stickypunch.apnspush.ApnsConfiguration;
import com.comandante.stickypunch.apnspush.ApnsFeedbackService;
import com.comandante.stickypunch.apnspush.ApnsPushManager;
import com.comandante.stickypunch.http.HttpConfiguration;
import com.comandante.stickypunch.http.HttpServiceFactory;
import com.comandante.stickypunch.http.WebPushUserIdAuth;
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.SystemConfiguration;
import org.eclipse.jetty.server.Server;
import java.io.File;
import java.util.concurrent.Executors;
public class Main {
public static void main(String[] args) throws Exception {
Configuration config = buildConfiguration(args);
//
// Database
//
WebPushStoreConfiguration pushStoreConfiguration = new WebPushStoreConfiguration(config);
SQLiteWebPushStore sqLiteWebPushStore = SQLiteWebPushStoreFactory.create(pushStoreConfiguration);
//
// PackageZip
//
PackageZipConfiguration packageZipConfiguration = new PackageZipConfiguration(config);
PackageZipSigner packageSigner = new PackageZipSigner(packageZipConfiguration);
PackageZipBuilder packageZipBuilder = new PackageZipBuilder(packageZipConfiguration, packageSigner);
PackageZipPool packageZipPool = new PackageZipPool(packageZipConfiguration);
PackageZipPoolPopulate packageZipPoolPopulate = new PackageZipPoolPopulate(packageZipPool, packageZipBuilder);
//
// Apns Push Service
//
ApnsConfiguration apnsConfiguration = new ApnsConfiguration(config);
ApnsService apnsService = APNS.newService().withCert(apnsConfiguration.apnsCertLocation, apnsConfiguration.apnsCertPassword).withProductionDestination().build();
ApnsPushManager apnsPushManager = new ApnsPushManager(apnsService, apnsConfiguration, sqLiteWebPushStore);
ApnsFeedbackService apnsFeedbackService = new ApnsFeedbackService(apnsService, apnsConfiguration, sqLiteWebPushStore);
//
// Jetty
//
HttpConfiguration httpConfiguration = new HttpConfiguration(config);
WebPushUserIdAuth webPushUserIdAuth = new WebPushUserIdAuth(sqLiteWebPushStore, httpConfiguration);
Server jettyServer = HttpServiceFactory.create(sqLiteWebPushStore, webPushUserIdAuth, packageZipPool, apnsPushManager, httpConfiguration);
// START
apnsService.start();
apnsFeedbackService.startAndWait();
Executors.newSingleThreadExecutor().submit(packageZipPoolPopulate);
jettyServer.start();
}
private static Configuration buildConfiguration(String[] args) throws ConfigurationException {
CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
File propFile = new File(args[0]);
if (propFile.exists()) {
compositeConfiguration.addConfiguration(new PropertiesConfiguration(propFile));
}
compositeConfiguration.addConfiguration(new SystemConfiguration());
return compositeConfiguration;
}
}
| mit |
googlestadia/pal | src/core/layers/interfaceLogger/interfaceLoggerDevice.cpp | 116374 | /*
***********************************************************************************************************************
*
* Copyright (c) 2016-2021 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************************************************************************/
#if PAL_BUILD_INTERFACE_LOGGER
#include "core/layers/interfaceLogger/interfaceLoggerBorderColorPalette.h"
#include "core/layers/interfaceLogger/interfaceLoggerCmdAllocator.h"
#include "core/layers/interfaceLogger/interfaceLoggerCmdBuffer.h"
#include "core/layers/interfaceLogger/interfaceLoggerColorBlendState.h"
#include "core/layers/interfaceLogger/interfaceLoggerColorTargetView.h"
#include "core/layers/interfaceLogger/interfaceLoggerDepthStencilState.h"
#include "core/layers/interfaceLogger/interfaceLoggerDepthStencilView.h"
#include "core/layers/interfaceLogger/interfaceLoggerDevice.h"
#include "core/layers/interfaceLogger/interfaceLoggerFence.h"
#include "core/layers/interfaceLogger/interfaceLoggerGpuEvent.h"
#include "core/layers/interfaceLogger/interfaceLoggerGpuMemory.h"
#include "core/layers/interfaceLogger/interfaceLoggerImage.h"
#include "core/layers/interfaceLogger/interfaceLoggerIndirectCmdGenerator.h"
#include "core/layers/interfaceLogger/interfaceLoggerMsaaState.h"
#include "core/layers/interfaceLogger/interfaceLoggerPipeline.h"
#include "core/layers/interfaceLogger/interfaceLoggerPlatform.h"
#include "core/layers/interfaceLogger/interfaceLoggerPrivateScreen.h"
#include "core/layers/interfaceLogger/interfaceLoggerQueryPool.h"
#include "core/layers/interfaceLogger/interfaceLoggerQueue.h"
#include "core/layers/interfaceLogger/interfaceLoggerQueueSemaphore.h"
#include "core/layers/interfaceLogger/interfaceLoggerScreen.h"
#include "core/layers/interfaceLogger/interfaceLoggerShaderLibrary.h"
#include "core/layers/interfaceLogger/interfaceLoggerSwapChain.h"
#include "palSysUtil.h"
using namespace Util;
namespace Pal
{
namespace InterfaceLogger
{
// =====================================================================================================================
Device::Device(
PlatformDecorator* pPlatform,
IDevice* pNextDevice,
uint32 objectId)
:
DeviceDecorator(pPlatform, pNextDevice),
m_objectId(objectId)
{
m_pfnTable.pfnCreateTypedBufViewSrds = CreateTypedBufferViewSrds;
m_pfnTable.pfnCreateUntypedBufViewSrds = CreateUntypedBufferViewSrds;
m_pfnTable.pfnCreateImageViewSrds = CreateImageViewSrds;
m_pfnTable.pfnCreateFmaskViewSrds = CreateFmaskViewSrds;
m_pfnTable.pfnCreateSamplerSrds = CreateSamplerSrds;
m_pfnTable.pfnCreateBvhSrds = CreateBvhSrds;
}
// =====================================================================================================================
Result Device::CommitSettingsAndInit()
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCommitSettingsAndInit;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = DeviceDecorator::CommitSettingsAndInit();
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
// We must initialize logging here, now that we finally have our settings.
result = pPlatform->CommitLoggingSettings();
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::Finalize(
const DeviceFinalizeInfo& finalizeInfo)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFinalize;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::Finalize(finalizeInfo);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("finalizeInfo", finalizeInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::Cleanup()
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCleanup;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::Cleanup();
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::SetMaxQueuedFrames(
uint32 maxFrames)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceSetMaxQueuedFrames;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::SetMaxQueuedFrames(maxFrames);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndValue("maxFrames", maxFrames);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::AddGpuMemoryReferences(
uint32 gpuMemRefCount,
const GpuMemoryRef* pGpuMemoryRefs,
IQueue* pQueue,
uint32 flags
)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceAddGpuMemoryReferences;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::AddGpuMemoryReferences(gpuMemRefCount, pGpuMemoryRefs, pQueue, flags);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndGpuMemoryRefFlags("flags", flags);
pLogContext->KeyAndBeginList("gpuMemoryRefs", false);
for (uint32 idx = 0; idx < gpuMemRefCount; ++idx)
{
pLogContext->Struct(pGpuMemoryRefs[idx]);
}
pLogContext->EndList();
pLogContext->KeyAndObject("queue", pQueue);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::RemoveGpuMemoryReferences(
uint32 gpuMemoryCount,
IGpuMemory*const* ppGpuMemory,
IQueue* pQueue
)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceRemoveGpuMemoryReferences;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::RemoveGpuMemoryReferences(gpuMemoryCount, ppGpuMemory, pQueue);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("gpuMemoryList", false);
for (uint32 idx = 0; idx < gpuMemoryCount; ++idx)
{
pLogContext->Object(ppGpuMemory[idx]);
}
pLogContext->EndList();
pLogContext->KeyAndObject("queue", pQueue);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::SetClockMode(
const SetClockModeInput& setClockModeInput,
SetClockModeOutput* pSetClockModeOutput)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceSetClockMode;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->SetClockMode(setClockModeInput, pSetClockModeOutput);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("setClockModeInput", setClockModeInput);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
if (pSetClockModeOutput != nullptr)
{
pLogContext->KeyAndStruct("setClockModeOutput", *pSetClockModeOutput);
}
else
{
pLogContext->KeyAndNullValue("setClockModeOutput");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::SetMgpuMode(
const SetMgpuModeInput& setMgpuModeInput
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceSetMgpuMode;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::SetMgpuMode(setMgpuModeInput);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("setMgpuModeInput", setMgpuModeInput);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::ResetFences(
uint32 fenceCount,
IFence*const* ppFences
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceResetFences;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::ResetFences(fenceCount, ppFences);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("fences", false);
for (uint32 idx = 0; idx < fenceCount; ++idx)
{
pLogContext->Object(ppFences[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::WaitForFences(
uint32 fenceCount,
const IFence*const* ppFences,
bool waitAll,
uint64 timeout
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceWaitForFences;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::WaitForFences(fenceCount, ppFences, waitAll, timeout);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("fences", false);
for (uint32 idx = 0; idx < fenceCount; ++idx)
{
pLogContext->Object(ppFences[idx]);
}
pLogContext->EndList();
pLogContext->KeyAndValue("waitAll", waitAll);
pLogContext->KeyAndValue("timeout", timeout);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
void Device::BindTrapHandler(
PipelineBindPoint pipelineType,
IGpuMemory* pGpuMemory,
gpusize offset)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceBindTrapHandler;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::BindTrapHandler(pipelineType, pGpuMemory, offset);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndEnum("pipelineType", pipelineType);
pLogContext->KeyAndObject("gpuMemory", pGpuMemory);
pLogContext->KeyAndValue("offset", offset);
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void Device::BindTrapBuffer(
PipelineBindPoint pipelineType,
IGpuMemory* pGpuMemory,
gpusize offset)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceBindTrapBuffer;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::BindTrapBuffer(pipelineType, pGpuMemory, offset);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndEnum("pipelineType", pipelineType);
pLogContext->KeyAndObject("gpuMemory", pGpuMemory);
pLogContext->KeyAndValue("offset", offset);
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
size_t Device::GetQueueSize(
const QueueCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetQueueSize(createInfo, pResult) + sizeof(Queue);
}
// =====================================================================================================================
Result Device::CreateQueue(
const QueueCreateInfo& createInfo,
void* pPlacementAddr,
IQueue** ppQueue)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueue* pNextQueue = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateQueue;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateQueue(createInfo, NextObjectAddr<Queue>(pPlacementAddr), &pNextQueue);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextQueue != nullptr);
pNextQueue->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Queue);
(*ppQueue) = PAL_PLACEMENT_NEW(pPlacementAddr) Queue(pNextQueue, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueue);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetMultiQueueSize(
uint32 queueCount,
const QueueCreateInfo* pCreateInfo,
Result* pResult
) const
{
return m_pNextLayer->GetMultiQueueSize(queueCount, pCreateInfo, pResult) + sizeof(Queue);
}
// =====================================================================================================================
Result Device::CreateMultiQueue(
uint32 queueCount,
const QueueCreateInfo* pCreateInfo,
void* pPlacementAddr,
IQueue** ppQueue)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueue* pNextQueue = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateMultiQueue;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateMultiQueue(queueCount,
pCreateInfo,
NextObjectAddr<Queue>(pPlacementAddr),
&pNextQueue);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextQueue != nullptr);
pNextQueue->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Queue);
(*ppQueue) = PAL_PLACEMENT_NEW(pPlacementAddr) Queue(pNextQueue, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("createInfo", false);
for (uint32 i = 0; i < queueCount; i++)
{
pLogContext->Struct(pCreateInfo[i]);
}
pLogContext->EndList();
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueue);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetGpuMemorySize(
const GpuMemoryCreateInfo& createInfo,
Result* pResult
) const
{
GpuMemoryCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pImage = NextImage(nextCreateInfo.pImage);
return m_pNextLayer->GetGpuMemorySize(nextCreateInfo, pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::CreateGpuMemory(
const GpuMemoryCreateInfo& createInfo,
void* pPlacementAddr,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextGpuMemory = nullptr;
GpuMemoryCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pImage = NextImage(nextCreateInfo.pImage);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateGpuMemory(nextCreateInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
&pNextGpuMemory);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextGpuMemory != nullptr);
pNextGpuMemory->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextGpuMemory, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetPinnedGpuMemorySize(
const PinnedGpuMemoryCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetPinnedGpuMemorySize(createInfo, pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::CreatePinnedGpuMemory(
const PinnedGpuMemoryCreateInfo& createInfo,
void* pPlacementAddr,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextMemObj = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreatePinnedGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreatePinnedGpuMemory(createInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
&pNextMemObj);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextMemObj != nullptr);
pNextMemObj->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextMemObj, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetSvmGpuMemorySize(
const SvmGpuMemoryCreateInfo& createInfo,
Result* pResult
) const
{
SvmGpuMemoryCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pReservedGpuVaOwner = NextGpuMemory(createInfo.pReservedGpuVaOwner);
return m_pNextLayer->GetSvmGpuMemorySize(nextCreateInfo, pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::CreateSvmGpuMemory(
const SvmGpuMemoryCreateInfo& createInfo,
void* pPlacementAddr,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextMemObj = nullptr;
SvmGpuMemoryCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pReservedGpuVaOwner = NextGpuMemory(createInfo.pReservedGpuVaOwner);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateSvmGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateSvmGpuMemory(nextCreateInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
&pNextMemObj);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextMemObj != nullptr);
pNextMemObj->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextMemObj, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetSharedGpuMemorySize(
const GpuMemoryOpenInfo& openInfo,
Result* pResult
) const
{
GpuMemoryOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pSharedMem = NextGpuMemory(openInfo.pSharedMem);
return m_pNextLayer->GetSharedGpuMemorySize(nextOpenInfo, pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::OpenSharedGpuMemory(
const GpuMemoryOpenInfo& openInfo,
void* pPlacementAddr,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextMemObj = nullptr;
GpuMemoryOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pSharedMem = NextGpuMemory(openInfo.pSharedMem);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenSharedGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenSharedGpuMemory(nextOpenInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
&pNextMemObj);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextMemObj != nullptr);
pNextMemObj->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextMemObj, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetExternalSharedGpuMemorySize(
Result* pResult
) const
{
return m_pNextLayer->GetExternalSharedGpuMemorySize(pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::OpenExternalSharedGpuMemory(
const ExternalGpuMemoryOpenInfo& openInfo,
void* pPlacementAddr,
GpuMemoryCreateInfo* pMemCreateInfo,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextMemObj = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenExternalSharedGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenExternalSharedGpuMemory(openInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
pMemCreateInfo,
&pNextMemObj);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextMemObj != nullptr);
pNextMemObj->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextMemObj, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->KeyAndStruct("memCreateInfo", *pMemCreateInfo);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetPeerGpuMemorySize(
const PeerGpuMemoryOpenInfo& openInfo,
Result* pResult
) const
{
PeerGpuMemoryOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pOriginalMem = NextGpuMemory(openInfo.pOriginalMem);
return m_pNextLayer->GetPeerGpuMemorySize(nextOpenInfo, pResult) + sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::OpenPeerGpuMemory(
const PeerGpuMemoryOpenInfo& openInfo,
void* pPlacementAddr,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuMemory* pNextMemObj = nullptr;
PeerGpuMemoryOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pOriginalMem = NextGpuMemory(openInfo.pOriginalMem);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenPeerGpuMemory;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenPeerGpuMemory(nextOpenInfo,
NextObjectAddr<GpuMemory>(pPlacementAddr),
&pNextMemObj);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextMemObj != nullptr);
pNextMemObj->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuMemory(pNextMemObj, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetImageSize(
const ImageCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetImageSize(createInfo, pResult) + sizeof(Image);
}
// =====================================================================================================================
Result Device::CreateImage(
const ImageCreateInfo& createInfo,
void* pPlacementAddr,
IImage** ppImage)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IImage* pNextImage = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateImage;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateImage(createInfo,
NextObjectAddr<Image>(pPlacementAddr),
&pNextImage);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextImage != nullptr);
pNextImage->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Image);
(*ppImage) = PAL_PLACEMENT_NEW(pPlacementAddr) Image(pNextImage, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppImage);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
void Device::GetPresentableImageSizes(
const PresentableImageCreateInfo& createInfo,
size_t* pImageSize,
size_t* pGpuMemorySize,
Result* pResult
) const
{
PresentableImageCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pScreen = NextScreen(createInfo.pScreen);
nextCreateInfo.pSwapChain = NextSwapChain(createInfo.pSwapChain);
m_pNextLayer->GetPresentableImageSizes(nextCreateInfo, pImageSize, pGpuMemorySize, pResult);
(*pImageSize) += sizeof(Image);
(*pGpuMemorySize) += sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::CreatePresentableImage(
const PresentableImageCreateInfo& createInfo,
void* pImagePlacementAddr,
void* pGpuMemoryPlacementAddr,
IImage** ppImage,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IImage* pNextImage = nullptr;
IGpuMemory* pNextGpuMemory = nullptr;
PresentableImageCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pScreen = NextScreen(createInfo.pScreen);
nextCreateInfo.pSwapChain = NextSwapChain(createInfo.pSwapChain);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreatePresentableImage;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreatePresentableImage(nextCreateInfo,
NextObjectAddr<Image>(pImagePlacementAddr),
NextObjectAddr<GpuMemory>(pGpuMemoryPlacementAddr),
&pNextImage,
&pNextGpuMemory);
funcInfo.postCallTime = pPlatform->GetTime();
if ((result == Result::Success) || (result == Result::TooManyFlippableAllocations))
{
PAL_ASSERT((pNextImage != nullptr) && (pNextGpuMemory != nullptr));
pNextImage->SetClientData(pImagePlacementAddr);
pNextGpuMemory->SetClientData(pGpuMemoryPlacementAddr);
const uint32 imageId = pPlatform->NewObjectId(InterfaceObject::Image);
const uint32 gpuMemoryId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppImage) = PAL_PLACEMENT_NEW(pImagePlacementAddr) Image(pNextImage, this, imageId);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pGpuMemoryPlacementAddr) GpuMemory(pNextGpuMemory, this, gpuMemoryId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdImageObj", *ppImage);
pLogContext->KeyAndObject("createdGpuMemoryObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
void Device::GetPeerImageSizes(
const PeerImageOpenInfo& openInfo,
size_t* pPeerImageSize,
size_t* pPeerGpuMemorySize,
Result* pResult
) const
{
PeerImageOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pOriginalImage = NextImage(openInfo.pOriginalImage);
m_pNextLayer->GetPeerImageSizes(nextOpenInfo, pPeerImageSize, pPeerGpuMemorySize, pResult);
(*pPeerImageSize) += sizeof(Image);
(*pPeerGpuMemorySize) += sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::OpenPeerImage(
const PeerImageOpenInfo& openInfo,
void* pImagePlacementAddr,
void* pGpuMemoryPlacementAddr,
IImage** ppImage,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IImage* pNextImage = nullptr;
IGpuMemory* pNextGpuMemory = nullptr;
PeerImageOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pOriginalImage = NextImage(openInfo.pOriginalImage);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenPeerImage;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenPeerImage(nextOpenInfo,
NextObjectAddr<Image>(pImagePlacementAddr),
NextObjectAddr<GpuMemory>(pGpuMemoryPlacementAddr),
&pNextImage,
&pNextGpuMemory);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT((pNextImage != nullptr) && (pNextGpuMemory != nullptr));
pNextImage->SetClientData(pImagePlacementAddr);
pNextGpuMemory->SetClientData(pGpuMemoryPlacementAddr);
const uint32 imageId = pPlatform->NewObjectId(InterfaceObject::Image);
const uint32 gpuMemoryId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppImage) = PAL_PLACEMENT_NEW(pImagePlacementAddr) Image(pNextImage, this, imageId);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pGpuMemoryPlacementAddr) GpuMemory(pNextGpuMemory, this, gpuMemoryId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdImageObj", *ppImage);
pLogContext->KeyAndObject("createdGpuMemoryObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::GetExternalSharedImageSizes(
const ExternalImageOpenInfo& openInfo,
size_t* pImageSize,
size_t* pGpuMemorySize,
ImageCreateInfo* pImgCreateInfo
) const
{
Result result = m_pNextLayer->GetExternalSharedImageSizes(openInfo, pImageSize, pGpuMemorySize, pImgCreateInfo);
(*pImageSize) += sizeof(Image);
(*pGpuMemorySize) += sizeof(GpuMemory);
return result;
}
// =====================================================================================================================
Result Device::OpenExternalSharedImage(
const ExternalImageOpenInfo& openInfo,
void* pImagePlacementAddr,
void* pGpuMemoryPlacementAddr,
GpuMemoryCreateInfo* pMemCreateInfo,
IImage** ppImage,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IImage* pNextImage = nullptr;
IGpuMemory* pNextGpuMemory = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenExternalSharedImage;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenExternalSharedImage(openInfo,
NextObjectAddr<Image>(pImagePlacementAddr),
NextObjectAddr<GpuMemory>(pGpuMemoryPlacementAddr),
pMemCreateInfo,
&pNextImage,
&pNextGpuMemory);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT((pNextImage != nullptr) && (pNextGpuMemory != nullptr));
pNextImage->SetClientData(pImagePlacementAddr);
pNextGpuMemory->SetClientData(pGpuMemoryPlacementAddr);
const uint32 imageId = pPlatform->NewObjectId(InterfaceObject::Image);
const uint32 gpuMemoryId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppImage) = PAL_PLACEMENT_NEW(pImagePlacementAddr) Image(pNextImage, this, imageId);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pGpuMemoryPlacementAddr) GpuMemory(pNextGpuMemory, this, gpuMemoryId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdImageObj", *ppImage);
pLogContext->KeyAndObject("createdGpuMemoryObj", *ppGpuMemory);
if (pMemCreateInfo != nullptr)
{
pLogContext->KeyAndStruct("memCreateInfo", *pMemCreateInfo);
}
else
{
pLogContext->KeyAndNullValue("memCreateInfo");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetColorTargetViewSize(
Result* pResult
) const
{
return m_pNextLayer->GetColorTargetViewSize(pResult) + sizeof(ColorTargetView);
}
// =====================================================================================================================
Result Device::CreateColorTargetView(
const ColorTargetViewCreateInfo& createInfo,
void* pPlacementAddr,
IColorTargetView** ppColorTargetView
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IColorTargetView* pNextView = nullptr;
ColorTargetViewCreateInfo nextCreateInfo = createInfo;
if (createInfo.flags.isBufferView)
{
nextCreateInfo.bufferInfo.pGpuMemory = NextGpuMemory(createInfo.bufferInfo.pGpuMemory);
}
else
{
nextCreateInfo.imageInfo.pImage = NextImage(createInfo.imageInfo.pImage);
}
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateColorTargetView;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateColorTargetView(nextCreateInfo,
NextObjectAddr<ColorTargetView>(pPlacementAddr),
&pNextView);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextView != nullptr);
pNextView->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::ColorTargetView);
(*ppColorTargetView) = PAL_PLACEMENT_NEW(pPlacementAddr) ColorTargetView(pNextView, createInfo, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppColorTargetView);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetDepthStencilViewSize(
Result* pResult
) const
{
return m_pNextLayer->GetDepthStencilViewSize(pResult) + sizeof(DepthStencilView);
}
// =====================================================================================================================
Result Device::CreateDepthStencilView(
const DepthStencilViewCreateInfo& createInfo,
void* pPlacementAddr,
IDepthStencilView** ppDepthStencilView
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IDepthStencilView* pNextView = nullptr;
DepthStencilViewCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pImage = NextImage(createInfo.pImage);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateDepthStencilView;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateDepthStencilView(nextCreateInfo,
NextObjectAddr<DepthStencilView>(pPlacementAddr),
&pNextView);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextView != nullptr);
pNextView->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::DepthStencilView);
(*ppDepthStencilView) = PAL_PLACEMENT_NEW(pPlacementAddr) DepthStencilView(pNextView, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppDepthStencilView);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::SetSamplePatternPalette(
const SamplePatternPalette& palette)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceSetSamplePatternPalette;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::SetSamplePatternPalette(palette);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("palette", palette);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetBorderColorPaletteSize(
const BorderColorPaletteCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetBorderColorPaletteSize(createInfo, pResult) + sizeof(BorderColorPalette);
}
// =====================================================================================================================
Result Device::CreateBorderColorPalette(
const BorderColorPaletteCreateInfo& createInfo,
void* pPlacementAddr,
IBorderColorPalette** ppPalette
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IBorderColorPalette* pNextPalette = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateBorderColorPalette;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateBorderColorPalette(createInfo,
NextObjectAddr<BorderColorPalette>(pPlacementAddr),
&pNextPalette);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextPalette != nullptr);
pNextPalette->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::BorderColorPalette);
(*ppPalette) = PAL_PLACEMENT_NEW(pPlacementAddr) BorderColorPalette(pNextPalette, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppPalette);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetComputePipelineSize(
const ComputePipelineCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetComputePipelineSize(createInfo, pResult) + sizeof(Pipeline);
}
// =====================================================================================================================
Result Device::CreateComputePipeline(
const ComputePipelineCreateInfo& createInfo,
void* pPlacementAddr,
IPipeline** ppPipeline)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IPipeline* pNextPipeline = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateComputePipeline;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateComputePipeline(createInfo,
NextObjectAddr<Pipeline>(pPlacementAddr),
&pNextPipeline);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextPipeline != nullptr);
pNextPipeline->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Pipeline);
(*ppPipeline) = PAL_PLACEMENT_NEW(pPlacementAddr) Pipeline(pNextPipeline, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppPipeline);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetGraphicsPipelineSize(
const GraphicsPipelineCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetGraphicsPipelineSize(createInfo, pResult) + sizeof(Pipeline);
}
// =====================================================================================================================
Result Device::CreateGraphicsPipeline(
const GraphicsPipelineCreateInfo& createInfo,
void* pPlacementAddr,
IPipeline** ppPipeline)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IPipeline* pNextPipeline = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateGraphicsPipeline;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateGraphicsPipeline(createInfo,
NextObjectAddr<Pipeline>(pPlacementAddr),
&pNextPipeline);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextPipeline != nullptr);
pNextPipeline->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Pipeline);
(*ppPipeline) = PAL_PLACEMENT_NEW(pPlacementAddr) Pipeline(pNextPipeline, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppPipeline);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetShaderLibrarySize(
const ShaderLibraryCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetShaderLibrarySize(createInfo, pResult) + sizeof(ShaderLibrary);
}
// =====================================================================================================================
Result Device::CreateShaderLibrary(
const ShaderLibraryCreateInfo& createInfo,
void* pPlacementAddr,
IShaderLibrary** ppLibrary)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IShaderLibrary* pLibrary = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateShaderLibrary;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->CreateShaderLibrary(createInfo,
NextObjectAddr<ShaderLibrary>(pPlacementAddr),
&pLibrary);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pLibrary != nullptr);
pLibrary->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::ShaderLibrary);
(*ppLibrary) = PAL_PLACEMENT_NEW(pPlacementAddr) ShaderLibrary(pLibrary, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppLibrary);
if (result == Result::Success)
{
pLogContext->KeyAndBeginList("functions", false);
for (uint32 i = 0; i < createInfo.funcCount; ++i)
{
pLogContext->Struct(createInfo.pFuncList[i]);
}
pLogContext->EndList();
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetMsaaStateSize(
const MsaaStateCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetMsaaStateSize(createInfo, pResult) + sizeof(MsaaState);
}
// =====================================================================================================================
Result Device::CreateMsaaState(
const MsaaStateCreateInfo& createInfo,
void* pPlacementAddr,
IMsaaState** ppMsaaState
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IMsaaState* pNextState = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateMsaaState;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateMsaaState(createInfo,
NextObjectAddr<MsaaState>(pPlacementAddr),
&pNextState);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextState != nullptr);
pNextState->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::MsaaState);
(*ppMsaaState) = PAL_PLACEMENT_NEW(pPlacementAddr) MsaaState(pNextState, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppMsaaState);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetColorBlendStateSize(
const ColorBlendStateCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetColorBlendStateSize(createInfo, pResult) + sizeof(ColorBlendState);
}
// =====================================================================================================================
Result Device::CreateColorBlendState(
const ColorBlendStateCreateInfo& createInfo,
void* pPlacementAddr,
IColorBlendState** ppColorBlendState
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IColorBlendState* pNextState = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateColorBlendState;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateColorBlendState(createInfo,
NextObjectAddr<ColorBlendState>(pPlacementAddr),
&pNextState);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextState != nullptr);
pNextState->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::ColorBlendState);
(*ppColorBlendState) = PAL_PLACEMENT_NEW(pPlacementAddr) ColorBlendState(pNextState, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppColorBlendState);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetDepthStencilStateSize(
const DepthStencilStateCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetDepthStencilStateSize(createInfo, pResult) + sizeof(DepthStencilState);
}
// =====================================================================================================================
Result Device::CreateDepthStencilState(
const DepthStencilStateCreateInfo& createInfo,
void* pPlacementAddr,
IDepthStencilState** ppDepthStencilState
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IDepthStencilState* pNextState = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateDepthStencilState;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateDepthStencilState(createInfo,
NextObjectAddr<DepthStencilState>(pPlacementAddr),
&pNextState);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextState != nullptr);
pNextState->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::DepthStencilState);
(*ppDepthStencilState) = PAL_PLACEMENT_NEW(pPlacementAddr) DepthStencilState(pNextState, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppDepthStencilState);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetQueueSemaphoreSize(
const QueueSemaphoreCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetQueueSemaphoreSize(createInfo, pResult) + sizeof(QueueSemaphore);
}
// =====================================================================================================================
Result Device::CreateQueueSemaphore(
const QueueSemaphoreCreateInfo& createInfo,
void* pPlacementAddr,
IQueueSemaphore** ppQueueSemaphore)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueueSemaphore* pNextSemaphore = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateQueueSemaphore;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateQueueSemaphore(createInfo,
NextObjectAddr<QueueSemaphore>(pPlacementAddr),
&pNextSemaphore);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextSemaphore != nullptr);
pNextSemaphore->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::QueueSemaphore);
(*ppQueueSemaphore) = PAL_PLACEMENT_NEW(pPlacementAddr) QueueSemaphore(pNextSemaphore, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueueSemaphore);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetSharedQueueSemaphoreSize(
const QueueSemaphoreOpenInfo& openInfo,
Result* pResult
) const
{
QueueSemaphoreOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pSharedQueueSemaphore = NextQueueSemaphore(openInfo.pSharedQueueSemaphore);
return m_pNextLayer->GetSharedQueueSemaphoreSize(nextOpenInfo, pResult) + sizeof(QueueSemaphore);
}
// =====================================================================================================================
Result Device::OpenSharedQueueSemaphore(
const QueueSemaphoreOpenInfo& openInfo,
void* pPlacementAddr,
IQueueSemaphore** ppQueueSemaphore)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueueSemaphore* pNextSemaphore = nullptr;
QueueSemaphoreOpenInfo nextOpenInfo = openInfo;
nextOpenInfo.pSharedQueueSemaphore = NextQueueSemaphore(openInfo.pSharedQueueSemaphore);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenSharedQueueSemaphore;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenSharedQueueSemaphore(nextOpenInfo,
NextObjectAddr<QueueSemaphore>(pPlacementAddr),
&pNextSemaphore);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextSemaphore != nullptr);
pNextSemaphore->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::QueueSemaphore);
(*ppQueueSemaphore) = PAL_PLACEMENT_NEW(pPlacementAddr) QueueSemaphore(pNextSemaphore, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueueSemaphore);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetExternalSharedQueueSemaphoreSize(
const ExternalQueueSemaphoreOpenInfo& openInfo,
Result* pResult
) const
{
return m_pNextLayer->GetExternalSharedQueueSemaphoreSize(openInfo, pResult) +
sizeof(QueueSemaphore);
}
// =====================================================================================================================
Result Device::OpenExternalSharedQueueSemaphore(
const ExternalQueueSemaphoreOpenInfo& openInfo,
void* pPlacementAddr,
IQueueSemaphore** ppQueueSemaphore)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueueSemaphore* pNextSemaphore = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenExternalSharedQueueSemaphore;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenExternalSharedQueueSemaphore(openInfo,
NextObjectAddr<QueueSemaphore>(pPlacementAddr),
&pNextSemaphore);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextSemaphore != nullptr);
pNextSemaphore->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::QueueSemaphore);
(*ppQueueSemaphore) = PAL_PLACEMENT_NEW(pPlacementAddr) QueueSemaphore(pNextSemaphore, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueueSemaphore);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetFenceSize(
Result* pResult
) const
{
return m_pNextLayer->GetFenceSize(pResult) + sizeof(Fence);
}
// =====================================================================================================================
Result Device::CreateFence(
const FenceCreateInfo& createInfo,
void* pPlacementAddr,
IFence** ppFence
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IFence* pNextFence = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateFence;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateFence(createInfo,
NextObjectAddr<Fence>(pPlacementAddr),
&pNextFence);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextFence != nullptr);
pNextFence->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Fence);
(*ppFence) = PAL_PLACEMENT_NEW(pPlacementAddr) Fence(pNextFence, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppFence);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::OpenFence(
const FenceOpenInfo& openInfo,
void* pPlacementAddr,
IFence** ppFence
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IFence* pNextFence = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceOpenFence;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->OpenFence(openInfo,
NextObjectAddr<Fence>(pPlacementAddr),
&pNextFence);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextFence != nullptr);
pNextFence->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::Fence);
(*ppFence) = PAL_PLACEMENT_NEW(pPlacementAddr) Fence(pNextFence, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("openInfo", openInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("openedObj", *ppFence);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetGpuEventSize(
const GpuEventCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetGpuEventSize(createInfo, pResult) + sizeof(GpuEvent);
}
// =====================================================================================================================
Result Device::CreateGpuEvent(
const GpuEventCreateInfo& createInfo,
void* pPlacementAddr,
IGpuEvent** ppGpuEvent)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IGpuEvent* pNextGpuEvent = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateGpuEvent;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateGpuEvent(createInfo,
NextObjectAddr<GpuEvent>(pPlacementAddr),
&pNextGpuEvent);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextGpuEvent != nullptr);
pNextGpuEvent->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::GpuEvent);
(*ppGpuEvent) = PAL_PLACEMENT_NEW(pPlacementAddr) GpuEvent(pNextGpuEvent, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGpuEvent);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetQueryPoolSize(
const QueryPoolCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetQueryPoolSize(createInfo, pResult) + sizeof(QueryPool);
}
// =====================================================================================================================
Result Device::CreateQueryPool(
const QueryPoolCreateInfo& createInfo,
void* pPlacementAddr,
IQueryPool** ppQueryPool
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IQueryPool* pNextQueryPool = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateQueryPool;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateQueryPool(createInfo,
NextObjectAddr<QueryPool>(pPlacementAddr),
&pNextQueryPool);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextQueryPool != nullptr);
pNextQueryPool->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::QueryPool);
(*ppQueryPool) = PAL_PLACEMENT_NEW(pPlacementAddr) QueryPool(pNextQueryPool, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppQueryPool);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetCmdAllocatorSize(
const CmdAllocatorCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetCmdAllocatorSize(createInfo, pResult) + sizeof(CmdAllocator);
}
// =====================================================================================================================
Result Device::CreateCmdAllocator(
const CmdAllocatorCreateInfo& createInfo,
void* pPlacementAddr,
ICmdAllocator** ppCmdAllocator)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
ICmdAllocator* pNextCmdAllocator = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateCmdAllocator;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateCmdAllocator(createInfo,
NextObjectAddr<CmdAllocator>(pPlacementAddr),
&pNextCmdAllocator);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextCmdAllocator != nullptr);
pNextCmdAllocator->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::CmdAllocator);
(*ppCmdAllocator) = PAL_PLACEMENT_NEW(pPlacementAddr) CmdAllocator(pNextCmdAllocator, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppCmdAllocator);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetCmdBufferSize(
const CmdBufferCreateInfo& createInfo,
Result* pResult
) const
{
CmdBufferCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pCmdAllocator = NextCmdAllocator(createInfo.pCmdAllocator);
return m_pNextLayer->GetCmdBufferSize(nextCreateInfo, pResult) + sizeof(CmdBuffer);
}
// =====================================================================================================================
Result Device::CreateCmdBuffer(
const CmdBufferCreateInfo& createInfo,
void* pPlacementAddr,
ICmdBuffer** ppCmdBuffer)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
ICmdBuffer* pNextCmdBuffer = nullptr;
CmdBufferCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pCmdAllocator = NextCmdAllocator(createInfo.pCmdAllocator);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateCmdBuffer;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateCmdBuffer(nextCreateInfo,
NextObjectAddr<CmdBuffer>(pPlacementAddr),
&pNextCmdBuffer);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextCmdBuffer != nullptr);
pNextCmdBuffer->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::CmdBuffer);
(*ppCmdBuffer) = PAL_PLACEMENT_NEW(pPlacementAddr) CmdBuffer(pNextCmdBuffer, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppCmdBuffer);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetIndirectCmdGeneratorSize(
const IndirectCmdGeneratorCreateInfo& createInfo,
Result* pResult) const
{
return m_pNextLayer->GetIndirectCmdGeneratorSize(createInfo, pResult) +
sizeof(IndirectCmdGenerator);
}
// =====================================================================================================================
Result Device::CreateIndirectCmdGenerator(
const IndirectCmdGeneratorCreateInfo& createInfo,
void* pPlacementAddr,
IIndirectCmdGenerator** ppGenerator) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IIndirectCmdGenerator* pNextGenerator = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateIndirectCmdGenerator;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result =
m_pNextLayer->CreateIndirectCmdGenerator(createInfo,
NextObjectAddr<IndirectCmdGenerator>(pPlacementAddr),
&pNextGenerator);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextGenerator != nullptr);
pNextGenerator->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::IndirectCmdGenerator);
(*ppGenerator) = PAL_PLACEMENT_NEW(pPlacementAddr) IndirectCmdGenerator(pNextGenerator, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppGenerator);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::GetPrivateScreens(
uint32* pNumScreens,
IPrivateScreen** ppScreens)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceGetPrivateScreens;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::GetPrivateScreens(pNumScreens, ppScreens);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndBeginList("screens", false);
for (uint32 idx = 0; idx < MaxPrivateScreens; ++idx)
{
// ppScreens can be null and can have null pointers so we always write MaxPrivateScreens values.
if ((ppScreens == nullptr) || (ppScreens[idx] == nullptr))
{
pLogContext->NullValue();
}
else
{
pLogContext->Object(static_cast<PrivateScreen*>(ppScreens[idx]));
}
}
pLogContext->EndList();
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::AddEmulatedPrivateScreen(
const PrivateScreenCreateInfo& createInfo,
uint32* pTargetId)
{
PAL_ASSERT(pTargetId != nullptr);
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceAddEmulatedPrivateScreen;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::AddEmulatedPrivateScreen(createInfo, pTargetId);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndValue("targetId", *pTargetId);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::RemoveEmulatedPrivateScreen(
uint32 targetId)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceRemoveEmulatedPrivateScreen;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::RemoveEmulatedPrivateScreen(targetId);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndValue("targetId", targetId);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
void Device::GetPrivateScreenImageSizes(
const PrivateScreenImageCreateInfo& createInfo,
size_t* pImageSize,
size_t* pGpuMemorySize,
Result* pResult
) const
{
PrivateScreenImageCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pScreen = NextPrivateScreen(createInfo.pScreen);
m_pNextLayer->GetPrivateScreenImageSizes(nextCreateInfo, pImageSize, pGpuMemorySize, pResult);
(*pImageSize) += sizeof(Image);
(*pGpuMemorySize) += sizeof(GpuMemory);
}
// =====================================================================================================================
Result Device::CreatePrivateScreenImage(
const PrivateScreenImageCreateInfo& createInfo,
void* pImagePlacementAddr,
void* pGpuMemoryPlacementAddr,
IImage** ppImage,
IGpuMemory** ppGpuMemory)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
IImage* pNextImage = nullptr;
IGpuMemory* pNextGpuMemory = nullptr;
PrivateScreenImageCreateInfo nextCreateInfo = createInfo;
nextCreateInfo.pScreen = NextPrivateScreen(createInfo.pScreen);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreatePrivateScreenImage;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->CreatePrivateScreenImage(nextCreateInfo,
NextObjectAddr<Image>(pImagePlacementAddr),
NextObjectAddr<GpuMemory>(pGpuMemoryPlacementAddr),
&pNextImage,
&pNextGpuMemory);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
pNextImage->SetClientData(pImagePlacementAddr);
pNextGpuMemory->SetClientData(pGpuMemoryPlacementAddr);
const uint32 imageId = pPlatform->NewObjectId(InterfaceObject::Image);
const uint32 gpuMemoryId = pPlatform->NewObjectId(InterfaceObject::GpuMemory);
(*ppImage) = PAL_PLACEMENT_NEW(pImagePlacementAddr) Image(pNextImage, this, imageId);
(*ppGpuMemory) = PAL_PLACEMENT_NEW(pGpuMemoryPlacementAddr) GpuMemory(pNextGpuMemory, this, gpuMemoryId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdImageObj", *ppImage);
pLogContext->KeyAndObject("createdGpuMemoryObj", *ppGpuMemory);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
size_t Device::GetSwapChainSize(
const SwapChainCreateInfo& createInfo,
Result* pResult
) const
{
return m_pNextLayer->GetSwapChainSize(createInfo, pResult) + sizeof(SwapChain);
}
// =====================================================================================================================
Result Device::CreateSwapChain(
const SwapChainCreateInfo& createInfo,
void* pPlacementAddr,
ISwapChain** ppSwapChain)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
ISwapChain* pNextSwapChain = nullptr;
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateSwapChain;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = m_pNextLayer->CreateSwapChain(createInfo,
NextObjectAddr<SwapChain>(pPlacementAddr),
&pNextSwapChain);
funcInfo.postCallTime = pPlatform->GetTime();
if (result == Result::Success)
{
PAL_ASSERT(pNextSwapChain != nullptr);
pNextSwapChain->SetClientData(pPlacementAddr);
const uint32 objectId = pPlatform->NewObjectId(InterfaceObject::SwapChain);
(*ppSwapChain) = PAL_PLACEMENT_NEW(pPlacementAddr) SwapChain(pNextSwapChain, this, objectId);
}
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("createInfo", createInfo);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndObject("createdObj", *ppSwapChain);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::SetPowerProfile(
PowerProfile profile,
CustomPowerProfile* pInfo)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceSetPowerProfile;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
const Result result = DeviceDecorator::SetPowerProfile(profile, pInfo);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndEnum("profile", profile);
if (pInfo != nullptr)
{
pLogContext->KeyAndBeginMap("info", false);
pLogContext->KeyAndObject("screen", pInfo->pScreen);
pLogContext->KeyAndBeginList("switchInfo", false);
for (uint32 idx = 0; idx < pInfo->numSwitchInfo; ++idx)
{
pLogContext->Struct(pInfo->switchInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndMap();
}
else
{
pLogContext->KeyAndNullValue("info");
}
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
if (pInfo != nullptr)
{
pLogContext->KeyAndBeginMap("info", false);
pLogContext->KeyAndBeginList("actualSwitchInfo", false);
for (uint32 idx = 0; idx < pInfo->numSwitchInfo; ++idx)
{
pLogContext->Struct(pInfo->actualSwitchInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndMap();
}
else
{
pLogContext->KeyAndNullValue("info");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::FlglQueryState(
FlglState* pState)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFlglQueryState;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->FlglQueryState(pState);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
if (pState != nullptr)
{
pLogContext->KeyAndStruct("pState", *pState);
}
else
{
pLogContext->KeyAndNullValue("pState");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::FlglSetFrameLock(
bool enable)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFlglSetFrameLock;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->FlglSetFrameLock(enable);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndValue("enable", enable);
pLogContext->EndInput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::FlglResetFrameCounter() const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFlglResetFrameCounter;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->FlglResetFrameCounter();
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::FlglGetFrameCounter(
uint64* pValue
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFlglGetFrameCounter;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->FlglGetFrameCounter(pValue);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
if (pValue != nullptr)
{
pLogContext->KeyAndValue("value", *pValue);
}
else
{
pLogContext->KeyAndNullValue("value");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::FlglGetFrameCounterResetStatus(
bool* pReset
) const
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceFlglGetFrameCounterResetStatus;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->FlglGetFrameCounterResetStatus(pReset);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
if (pReset != nullptr)
{
pLogContext->KeyAndValue("reset", *pReset);
}
else
{
pLogContext->KeyAndNullValue("reset");
}
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
PrivateScreenDecorator* Device::NewPrivateScreenDecorator(
IPrivateScreen* pNextScreen,
uint32 deviceIdx)
{
constexpr size_t Size = sizeof(PrivateScreen);
PrivateScreenDecorator* pDecorator = nullptr;
void* pPlacementAddr = PAL_MALLOC(Size, m_pPlatform, AllocInternal);
if (pPlacementAddr != nullptr)
{
pNextScreen->SetClientData(pPlacementAddr);
const uint32 objectId = static_cast<Platform*>(m_pPlatform)->NewObjectId(InterfaceObject::PrivateScreen);
pDecorator = PAL_PLACEMENT_NEW(pPlacementAddr) PrivateScreen(pNextScreen, this, deviceIdx, objectId);
}
return pDecorator;
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateTypedBufferViewSrds(
const IDevice* pDevice,
uint32 count,
const BufferViewInfo* pBufferViewInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateTypedBufferViewSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateTypedBufViewSrds(pDevice, count, pBufferViewInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("bufferViewInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pBufferViewInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateUntypedBufferViewSrds(
const IDevice* pDevice,
uint32 count,
const BufferViewInfo* pBufferViewInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateUntypedBufferViewSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateUntypedBufViewSrds(pDevice, count, pBufferViewInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("bufferViewInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pBufferViewInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateImageViewSrds(
const IDevice* pDevice,
uint32 count,
const ImageViewInfo* pImgViewInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateImageViewSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateImageViewSrds(pDevice, count, pImgViewInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("imageViewInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pImgViewInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateFmaskViewSrds(
const IDevice* pDevice,
uint32 count,
const FmaskViewInfo* pFmaskViewInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateFmaskViewSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateFmaskViewSrds(pDevice, count, pFmaskViewInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("fmaskViewInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pFmaskViewInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateSamplerSrds(
const IDevice* pDevice,
uint32 count,
const SamplerInfo* pSamplerInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateSamplerSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateSamplerSrds(pDevice, count, pSamplerInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("samplerInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pSamplerInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
void PAL_STDCALL Device::CreateBvhSrds(
const IDevice* pDevice,
uint32 count,
const BvhInfo* pBvhInfo,
void* pOut)
{
const auto* pThis = static_cast<const Device*>(pDevice);
auto*const pPlatform = static_cast<Platform*>(pThis->m_pPlatform);
BeginFuncInfo funcInfo = {};
funcInfo.funcId = InterfaceFunc::DeviceCreateBvhSrds;
funcInfo.objectId = pThis->m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
DeviceDecorator::DecoratorCreateBvhSrds(pDevice, count, pBvhInfo, pOut);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndBeginList("bvhInfo", false);
for (uint32 idx = 0; idx < count; ++idx)
{
pLogContext->Struct(pBvhInfo[idx]);
}
pLogContext->EndList();
pLogContext->EndInput();
pPlatform->LogEndFunc(pLogContext);
}
}
// =====================================================================================================================
Result Device::CreateVirtualDisplay(
const VirtualDisplayInfo& virtualDisplayInfo,
uint32* pScreenTargetId)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceCreateVirtualDisplay;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->CreateVirtualDisplay(virtualDisplayInfo, pScreenTargetId);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndStruct("virtualDisplayInfo", virtualDisplayInfo);
pLogContext->EndOutput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndValue("screenTargetId", *pScreenTargetId);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::DestroyVirtualDisplay(
uint32 screenTargetId)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceDestroyVirtualDisplay;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->DestroyVirtualDisplay(screenTargetId);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndValue("screenTargetId", screenTargetId);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
// =====================================================================================================================
Result Device::GetVirtualDisplayProperties(
uint32 screenTargetId,
VirtualDisplayProperties* pProperties)
{
auto*const pPlatform = static_cast<Platform*>(m_pPlatform);
BeginFuncInfo funcInfo;
funcInfo.funcId = InterfaceFunc::DeviceGetVirtualDisplayProperties;
funcInfo.objectId = m_objectId;
funcInfo.preCallTime = pPlatform->GetTime();
Result result = m_pNextLayer->GetVirtualDisplayProperties(screenTargetId, pProperties);
funcInfo.postCallTime = pPlatform->GetTime();
LogContext* pLogContext = nullptr;
if (pPlatform->LogBeginFunc(funcInfo, &pLogContext))
{
pLogContext->BeginInput();
pLogContext->KeyAndValue("screenTargetId", screenTargetId);
pLogContext->EndOutput();
pLogContext->BeginOutput();
pLogContext->KeyAndEnum("result", result);
pLogContext->KeyAndStruct("VirtualDisplayProperties", *pProperties);
pLogContext->EndOutput();
pPlatform->LogEndFunc(pLogContext);
}
return result;
}
} // InterfaceLogger
} // Pal
#endif
| mit |
cahyaong/cop.theia | Source/Theia.Module.Sdk/ButtonViewModel.cs | 2771 | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="ButtonViewModel.cs" company="nGratis">
// The MIT License (MIT)
//
// Copyright (c) 2014 - 2015 Cahya Ong
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// </copyright>
// <author>Cahya Ong - [email protected]</author>
// <creation_timestamp>Friday, 11 March 2016 8:22:45 PM UTC</creation_timestamp>
// --------------------------------------------------------------------------------------------------------------------
namespace nGratis.Cop.Theia.Module.Sdk
{
using System.ComponentModel.Composition;
using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using ReactiveUI;
[Export]
public class ButtonViewModel : ReactiveObject
{
private int count;
public ButtonViewModel()
{
this.IncrementCountCommand = ReactiveCommand.CreateFromTask(
() => Task.Run(() => this.Count++),
this.WhenAny(it => it.Count, observation => observation.Value < 10)
.ObserveOn(RxApp.MainThreadScheduler));
this.DecrementCountCommand = ReactiveCommand.CreateFromTask(
() => Task.Run(() => this.Count--),
this.WhenAny(it => it.Count, observation => observation.Value > 0)
.ObserveOn(RxApp.MainThreadScheduler));
}
public int Count
{
get => this.count;
set => this.RaiseAndSetIfChanged(ref this.count, value);
}
public ICommand IncrementCountCommand { get; }
public ICommand DecrementCountCommand { get; }
}
} | mit |
morkt/GARbro | ArcFormats/Lambda/ArcCLS.cs | 3471 | //! \file ArcCLS.cs
//! \date 2017 Dec 21
//! \brief Lambda engine resource archive.
//
// Copyright (C) 2017 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
namespace GameRes.Formats.Lambda
{
[Export(typeof(ArchiveFormat))]
public class ClsOpener : ArchiveFormat
{
public override string Tag { get { return "DAT/CLS"; } }
public override string Description { get { return "Lambda engine resource archive"; } }
public override uint Signature { get { return 0x5F534C43; } } // 'CLS_'
public override bool IsHierarchic { get { return false; } }
public override bool CanWrite { get { return false; } }
public override ArcFile TryOpen (ArcView file)
{
if (!file.View.AsciiEqual (4, "FILELINK"))
return null;
int count = file.View.ReadInt32 (0x10);
if (!IsSaneCount (count))
return null;
uint index_offset = file.View.ReadUInt32 (0x18);
var dir = new List<Entry> (count);
for (int i = 0; i < count; ++i)
{
var entry = new Entry {
Name = file.View.ReadString (index_offset, 0x28),
Offset = file.View.ReadUInt32 (index_offset+0x2C),
Size = file.View.ReadUInt32 (index_offset+0x30),
};
if (!entry.CheckPlacement (file.MaxOffset))
return null;
dir.Add (entry);
index_offset += 0x40;
}
DetectFileTypes (file, dir);
return new ArcFile (file, this, dir);
}
void DetectFileTypes (ArcView file, IEnumerable<Entry> dir)
{
foreach (var entry in dir)
{
uint signature = file.View.ReadUInt32 (entry.Offset);
if (0x5F534C43 == signature) // 'CLS_'
{
if (file.View.AsciiEqual (entry.Offset+4, "TEXFILE"))
entry.Type = "image";
}
else
{
var res = AutoEntry.DetectFileType (signature);
if (res != null)
entry.ChangeType (res);
}
}
}
}
}
| mit |
codeprep/boilerplate | app/config/passport.js | 10379 | 'use strict';
var LocalStrategy = require('passport-local').Strategy;
var GitHubStrategy = require('passport-github').Strategy;
var FacebookStrategy = require('passport-facebook').Strategy;
var TwitterStrategy = require('passport-twitter').Strategy;
var User = require('../models/users');
var configAuth = require('./auth');
module.exports = function (passport) {
passport.serializeUser(function (user, done) {
done(null, user.id);
});
passport.deserializeUser(function (id, done) {
User.findById(id, function (err, user) {
done(err, user);
});
});
// ============================================================
// Local ie email authentication
// ============================================================
// Login ====================================================
passport.use('local-login', new LocalStrategy({
// by default, local strategy uses username and password, we will override with email
usernameField : 'email',
passwordField : 'password',
passReqToCallback : true // allows us to pass in the req from our route (lets us check if a user is logged in or not)
},
function(req, email, password, done) {
if (email)
email = email.toLowerCase(); // Use lower-case e-mails to avoid case-sensitive e-mail matching
// asynchronous
process.nextTick(function() {
User.findOne({ 'local.email' : email }, function(err, user) {
// if there are any errors, return the error
if (err)
return done(err);
// if no user is found, return the message
if (!user)
return done(null, false, req.flash('loginMessage', 'No user found.'));
if (!user.validPassword(password))
return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.'));
// all is well, return user
else
return done(null, user);
});
});
}));
// Signup ===================================================
passport.use('local-signup', new LocalStrategy({
// by default, local strategy uses username and password, we will override with email
usernameField : 'email',
passwordField : 'password',
passReqToCallback : true // allows us to pass back the entire request to the callback
},
function(req, email, password, done) {
if (email) {
email = email.toLowerCase(); // Use lower-case e-mails to avoid case-sensitive e-mail matching
}
// asynchronous
process.nextTick(function() {
// if the user is not already logged in:
if (!req.user) {
User.findOne({ 'local.email' : email }, function(err, user) {
// if there are any errors, return the error
if (err)
return done(err);
// check to see if theres already a user with that email
if (user) {
return done(null, false, req.flash('signupMessage', 'That email is already taken.'));
} else {
// create the user
var newUser = new User();
newUser.local.email = email;
newUser.local.password = newUser.generateHash(password);
newUser.save(function(err) {
if (err)
return done(err);
return done(null, newUser);
});
}
});
// if the user is logged in but has no local account...
} else if ( !req.user.local.email ) {
// ...presumably they're trying to connect a local account
// BUT let's check if the email used to connect a local account is being used by another user
User.findOne({ 'local.email' : email }, function(err, user) {
if (err)
return done(err);
if (user) {
return done(null, false, req.flash('loginMessage', 'That email is already taken.'));
// Using 'loginMessage instead of signupMessage because it's used by /connect/local'
} else {
var user = req.user;
user.local.email = email;
user.local.password = user.generateHash(password);
user.save(function (err) {
if (err)
return done(err);
return done(null,user);
});
}
});
} else {
// user is logged in and already has a local account. Ignore signup. (You should log out before trying to create a new account, user!)
return done(null, req.user);
}
});
}));
// ============================================================
// Github authentication
// ============================================================
passport.use(new GitHubStrategy({
clientID: configAuth.githubAuth.clientID,
clientSecret: configAuth.githubAuth.clientSecret,
callbackURL: configAuth.githubAuth.callbackURL
},
function (token, refreshToken, profile, done) {
process.nextTick(function () {
User.findOne({ 'github.id': profile.id }, function (err, user) {
if (err) {
return done(err);
}
if (user) {
return done(null, user);
} else {
var newUser = new User();
newUser.github.id = profile.id;
newUser.github.username = profile.username;
newUser.github.displayName = profile.displayName;
newUser.github.publicRepos = profile._json.public_repos;
newUser.github.email = profile.emails[0].value;
newUser.github.password = newUser.generateHash(password);
newUser.github.photo = profile.photos[0].value;
newUser.github.profileUrl = profile.profileUrl;
newUser.github.company = profile._json.company;
newUser.github.blog = profile._json.blog;
newUser.github.location = profile._json.location;
newUser.save(function (err) {
if (err) {
throw err;
}
return done(null, newUser);
});
}
});
});
}
));
// =========================================================================
// FACEBOOK ================================================================
// =========================================================================
passport.use(new FacebookStrategy({
clientID : configAuth.facebookAuth.clientID,
clientSecret : configAuth.facebookAuth.clientSecret,
callbackURL : configAuth.facebookAuth.callbackURL,
profileFields : ['id', 'name', 'email'],
passReqToCallback : true // allows us to pass in the req from our route (lets us check if a user is logged in or not)
},
function(req, token, refreshToken, profile, done) {
// asynchronous
process.nextTick(function() {
// check if the user is already logged in
if (!req.user) {
User.findOne({ 'facebook.id' : profile.id }, function(err, user) {
if (err)
return done(err);
if (user) {
// if there is a user id already but no token (user was linked at one point and then removed)
if (!user.facebook.token) {
user.facebook.token = token;
user.facebook.name = profile.name.givenName + ' ' + profile.name.familyName;
user.facebook.email = (profile.emails[0].value || '').toLowerCase();
user.save(function(err) {
if (err)
return done(err);
return done(null, user);
});
}
return done(null, user); // user found, return that user
} else {
// if there is no user, create them
var newUser = new User();
newUser.facebook.id = profile.id;
newUser.facebook.token = token;
newUser.facebook.name = profile.name.givenName + ' ' + profile.name.familyName;
newUser.facebook.email = (profile.emails[0].value || '').toLowerCase();
newUser.save(function(err) {
if (err)
return done(err);
return done(null, newUser);
});
}
});
} else {
// user already exists and is logged in, we have to link accounts
var user = req.user; // pull the user out of the session
user.facebook.id = profile.id;
user.facebook.token = token;
user.facebook.name = profile.name.givenName + ' ' + profile.name.familyName;
user.facebook.email = (profile.emails[0].value || '').toLowerCase();
user.save(function(err) {
if (err)
return done(err);
return done(null, user);
});
}
});
}
));
// =========================================================================
// TWITTER =================================================================
// =========================================================================
passport.use(new TwitterStrategy({
consumerKey : configAuth.twitterAuth.consumerKey,
consumerSecret : configAuth.twitterAuth.consumerSecret,
callbackURL : configAuth.twitterAuth.callbackURL,
passReqToCallback : true // allows us to pass in the req from our route (lets us check if a user is logged in or not)
},
function(req, token, tokenSecret, profile, done) {
// asynchronous
process.nextTick(function() {
// check if the user is already logged in
if (!req.user) {
User.findOne({ 'twitter.id' : profile.id }, function(err, user) {
if (err)
return done(err);
if (user) {
// if there is a user id already but no token (user was linked at one point and then removed)
if (!user.twitter.token) {
user.twitter.token = token;
user.twitter.username = profile.username;
user.twitter.displayName = profile.displayName;
user.save(function(err) {
if (err)
return done(err);
return done(null, user);
});
}
return done(null, user); // user found, return that user
} else {
// if there is no user, create them
var newUser = new User();
newUser.twitter.id = profile.id;
newUser.twitter.token = token;
newUser.twitter.username = profile.username;
newUser.twitter.displayName = profile.displayName;
newUser.save(function(err) {
if (err)
return done(err);
return done(null, newUser);
});
}
});
} else {
// user already exists and is logged in, we have to link accounts
var user = req.user; // pull the user out of the session
user.twitter.id = profile.id;
user.twitter.token = token;
user.twitter.username = profile.username;
user.twitter.displayName = profile.displayName;
user.save(function(err) {
if (err)
return done(err);
return done(null, user);
});
}
});
}
));
};
| mit |
NotaTrueRoute/blogsource | _plugins/anchor_tag.rb | 338 | module Jekyll
class AnchoredHeaderTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text.strip
end
def render(context)
"<h4 id='#{@text}'><a name='#{@text}' class='noLink'>#{@text}</a></h4>"
end
end
end
Liquid::Template.register_tag('anchoredHeader', Jekyll::AnchoredHeaderTag) | mit |
Papipo/congo | lib/congo/scoper.rb | 2349 | module Congo
module Scoper #:nodoc:
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_congo_scoper
if !self.included_modules.include?(MongoMapper::Document)
class_eval <<-EOV
include Congo::Scoper::InstanceMethods
def scoper_instance
@proxy_scoper ||= Congo::ProxyScoper.find_by_ext_id_and_ext_type(self.id, self.class.name)
if @proxy_scoper.nil?
@proxy_scoper = Congo::ProxyScoper.create!(:ext_type => self.class.name, :ext_id => self.id)
end
@proxy_scoper
end
def content_types
scoper_instance.content_types
end
EOV
else
class_eval <<-EOV
include Congo::Scoper::InstanceMethods
many :content_types, :class_name => 'Congo::ContentType', :as => :scope
def scoper_instance
nil
end
EOV
end
end
end
module InstanceMethods
def proxy_scoper?
!scoper_instance.nil?
end
def consts
@consts ||= {}
end
def content_type_as_const(name, method_name = nil)
return nil if (Congo::Types.const_defined?(name) rescue nil).nil?
return Congo::Types.const_get(name) if Congo::Types.const_defined?(name)
return name.constantize if Object.const_defined?(name)
unless consts[name]
if (type = content_types.find_by_name(name)).nil?
type = content_types.find_by_slug(method_name) if method_name
end
consts[name] = type.to_const rescue nil # This doesn't work because of different instances being used
end
consts[name]
end
private
def method_missing(method, *args)
if ctype = content_type_as_const(method.to_s.classify, method.to_s)
meta = proxy_scoper? ? scoper_instance.metaclass : metaclass
meta.many method, :class => ctype
(proxy_scoper? ? scoper_instance : self).send(method, *args)
else
super
end
end
end
end
end
Object.class_eval { include Congo::Scoper } | mit |
HopefulLlama/eTutor-Intranet | eTutorSystem/Views/admin_ViewDashes.aspx.cs | 2824 | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using eTutorSystem.Controller_Model;
using eTutorSystem.Model;
namespace eTutorSystem.Views
{
public partial class admin_ViewDashes : System.Web.UI.Page, IdashesInterface
{
adminDashes_controller controller = adminDashes_controller.ControllerInstance;
protected void Page_Load(object sender, EventArgs e)
{
UserDetails _user = (UserDetails)Session["User"];
if (_user != null)
{
if (_user.UserType == 1)
{
HttpContext.Current.Response.Redirect("student_area.aspx");
}
else if (_user.UserType == 2)
{
HttpContext.Current.Response.Redirect("tutor_area.aspx");
}
else if (_user.UserType == 3)
{
controller.DashesView = this;
if (!IsPostBack)
{
controller.loadDahsesView();
}
}
}
else
{
HttpContext.Current.Response.Redirect("login.aspx");
}
}
public string welcome
{
set { this.welcome_lbl.Text = value; }
}
public int option
{
get { return ((studentRdBtn.Checked == true) ? 0 : 1); }
}
public List<ListItem> optionsDropDownBox
{
set
{
this.usersDdb.DataSource = value;
this.usersDdb.DataTextField = "Text";
this.usersDdb.DataValueField = "Value";
this.usersDdb.DataBind();
}
}
public string selectedUserID
{
get { return this.usersDdb.SelectedValue.ToString(); }
}
protected void logout_lkbtn_Click(object sender, EventArgs e)
{
controller.logout("admin");
}
protected void studentRdBtn_CheckedChanged(object sender, EventArgs e)
{
if (studentRdBtn.Checked == true)
{
controller.loadStudentTutorDropDownBox();
}
}
protected void tutorrdBtn_CheckedChanged(object sender, EventArgs e)
{
if (tutorrdBtn.Checked == true)
{
controller.loadStudentTutorDropDownBox();
}
}
protected void submitMessageBtn_Click(object sender, EventArgs e)
{
controller.submitDash();
}
}
} | mit |
fusion-jena/unit-ontology-review | analysis/util/checkPresence.js | 977 | "use strict";
// includes
var buildLookup = require( './buildLookup' );
/**
* check, that for each entry of src there is a corresponding entry in target
*
* @param src
* @param target
* @param srcKey
* @param targetKey
*/
function checkPresence( src, target, srcKey, targetKey ) {
// list of missing
var missing = new Set();
// check, if there is actually something in the target dataset
if( target.length > 0 ) {
// build lookup
var lookup = buildLookup( target, targetKey );
// check for unit existence
for( var entry of src ) {
if( entry[ srcKey ] && !(entry[ srcKey ] in lookup) ) {
missing.add( entry[ srcKey ] );
}
}
} else {
// nothing present in the target dataset, so just list all (unique) entries of the source
for( var entry of src ) {
missing.add( entry[ srcKey ] );
}
}
// return result
return [ ... missing ];
}
module.exports = checkPresence; | mit |
ArtOfCode-/BlankPost | www/res/js/tables.js | 80897 | /*!
DataTables 1.10.9
©2008-2015 SpryMedia Ltd - datatables.net/license
*/
(function(Fa,T,k){var S=function(h){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function I(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),I(a[d],b[d],c)):b[d]=b[e]})}function S(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;
!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&cb(a)}function db(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");
A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&I(m.models.oSearch,a[b])}function eb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function fb(a){if(!m.__browser){var b={};m.__browser=b;var c=
h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,
m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function gb(a,b,c,d,e,f){var g,i=!1;c!==k&&(g=c,i=!0);for(;d!==e;)a.hasOwnProperty(d)&&(g=i?b(g,a[d],d,a):a[d],i=!0,d+=f);return g}function Ga(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:T.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);
la(a,d,h(b).data())}function la(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(eb(c),I(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));
var g=b.mData,i=P(g),j=b.mRender?P(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b.fnGetData=function(a,b,c){var d=i(a,b,k,c);return j&&b?j(d,b,a,c):d};b.fnSetData=function(a,b,c){return Q(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?
(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ha(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&Z(a);w(a,null,"column-sizing",[a])}function $(a,b){var c=
aa(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function ba(a,b){var c=aa(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function ca(a){return aa(a,"bVisible").length}function aa(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ia(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,i,j,h,l,r,q;e=0;for(f=b.length;e<f;e++)if(l=b[e],q=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(i=d.length;g<i;g++){j=0;for(h=c.length;j<
h;j++){q[j]===k&&(q[j]=B(a,j,e,"type"));r=d[g](q[j],a);if(!r&&g!==d.length-1)break;if("html"===r)break}if(r){l.sType=r;break}}l.sType||(l.sType="string")}}function hb(a,b,c,d){var e,f,g,i,j,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var r=n.targets!==k?n.targets:n.aTargets;h.isArray(r)||(r=[r]);f=0;for(g=r.length;f<g;f++)if("number"===typeof r[f]&&0<=r[f]){for(;l.length<=r[f];)Ga(a);d(r[f],n)}else if("number"===typeof r[f]&&0>r[f])d(l.length+r[f],n);else if("string"===typeof r[f]){i=0;
for(j=l.length;i<j;i++)("_all"==r[f]||h(l[i].nTh).hasClass(r[f]))&&d(i,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function L(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,i=0,j=g.length;i<j;i++)g[i].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ja(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=
Ka(a,e);return L(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,i=f.sDefaultContent,c=f.fnGetData(g,d,{settings:a,row:b,col:c});if(c===k)return a.iDrawError!=e&&null===i&&(J(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b,4),a.iDrawError=e),i;if((c===g||null===c)&&null!==i)c=i;else if("function"===typeof c)return c.call(g);return null===c&&"display"==d?"":c}function ib(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,
d,{settings:a,row:b,col:c})}function La(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\./g,".")})}function P(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=P(c))});return function(a,c,f,g){var i=b[c]||b._;return i!==k?i(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,
f){var g,i;if(""!==f){i=La(f);for(var j=0,n=i.length;j<n;j++){f=i[j].match(da);g=i[j].match(U);if(f){i[j]=i[j].replace(da,"");""!==i[j]&&(a=a[i[j]]);g=[];i.splice(0,j+1);i=i.join(".");if(h.isArray(a)){j=0;for(n=a.length;j<n;j++)g.push(c(a[j],b,i))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){i[j]=i[j].replace(U,"");a=a[i[j]]();continue}if(null===a||a[i[j]]===k)return k;a=a[i[j]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function Q(a){if(h.isPlainObject(a))return Q(a._);
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=La(e),f;f=e[e.length-1];for(var g,i,j=0,n=e.length-1;j<n;j++){g=e[j].match(da);i=e[j].match(U);if(g){e[j]=e[j].replace(da,"");a[e[j]]=[];f=e.slice();f.splice(0,j+1);g=f.join(".");if(h.isArray(d)){i=0;for(n=d.length;i<n;i++)f={},b(f,d[i],g),a[e[j]].push(f)}else a[e[j]]=d;return}i&&(e[j]=e[j].replace(U,
""),a=a[e[j]](d));if(null===a[e[j]]||a[e[j]]===k)a[e[j]]={};a=a[e[j]]}if(f.match(U))a[f.replace(U,"")](d);else a[f.replace(da,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ma(a){return D(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ea(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ka(a,e,d,d===k?k:e._aData).data;else{var i=e.anCells;if(i)if(d!==k)g(i[d],d);else{c=0;for(f=i.length;c<f;c++)g(i[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Na(a,e)}}function Ka(a,b,c,d){var e=[],f=b.firstChild,g,i,j=0,n,l=a.aoColumns,r=a._rowReadObject,d=d!==k?d:r?{}:[],q=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
-1!==c&&(c=a.substring(c+1),Q(a)(d,b.getAttribute(c)))}},jb=function(a){if(c===k||c===j)i=l[j],n=h.trim(a.innerHTML),i&&i._bAttrSrc?(Q(i.mData._)(d,n),q(i.mData.sort,a),q(i.mData.type,a),q(i.mData.filter,a)):r?(i._setter||(i._setter=Q(i.mData)),i._setter(d,n)):d[j]=n;j++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)jb(f),e.push(f);f=f.nextSibling}else{e=b.anCells;g=0;for(var o=e.length;g<o;g++)jb(e[g])}if(b=f?b:b.nTr)(b=b.getAttribute("id"))&&Q(a.rowId)(d,b);return{data:d,cells:e}}
function Ja(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],i,j,h,l,r;if(null===e.nTr){i=c||T.createElement("tr");e.nTr=i;e.anCells=g;i._DT_RowIndex=b;Na(a,e);l=0;for(r=a.aoColumns.length;l<r;l++){h=a.aoColumns[l];j=c?d[l]:T.createElement(h.sCellType);g.push(j);if(!c||h.mRender||h.mData!==l)j.innerHTML=B(a,b,l,"display");h.sClass&&(j.className+=" "+h.sClass);h.bVisible&&!c?i.appendChild(j):!h.bVisible&&c&&j.parentNode.removeChild(j);h.fnCreatedCell&&h.fnCreatedCell.call(a.oInstance,j,B(a,b,l),f,b,l)}w(a,
"aoRowCreatedCallback",null,[i,f,b])}e.nTr.setAttribute("role","row")}function Na(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?pa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function kb(a){var b,c,d,e,f,g=a.nTHead,i=a.nTFoot,j=0===h("th, td",g).length,n=a.oClasses,l=a.aoColumns;j&&(e=h("<tr/>").appendTo(g));
b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),j&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Oa(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Pa(a,"header")(a,d,f,n);j&&fa(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(i).find(">tr>th, >tr>td").addClass(n.sFooterTH);if(null!==i){a=a.aoFooter[0];b=0;for(c=a.length;b<
c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ga(a,b,c){var d,e,f,g=[],i=[],j=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=j-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);i.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=j=1,i[d][f]===k){a.appendChild(g[d][f].cell);for(i[d][f]=1;g[d+j]!==k&&g[d][f].cell==g[d+j][f].cell;)i[d+
j][f]=1,j++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<j;c++)i[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",j).attr("colspan",n)}}}}function M(a){var b=w(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,i="ssp"==y(a),j=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=i?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();
if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(i){if(!a.bDestroying&&!lb(a))return}else a.iDraw++;if(0!==j.length){f=i?a.aoData.length:n;for(i=i?0:g;i<f;i++){var l=j[i],r=a.aoData[l];null===r.nTr&&Ja(a,l);l=r.nTr;if(0!==e){var q=d[c%e];r._sRowStripe!=q&&(h(l).removeClass(r._sRowStripe).addClass(q),r._sRowStripe=q)}w(a,"aoRowCallback",null,[l,r._aData,c,i]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),
b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:ca(a),"class":a.oClasses.sRowEmpty}).html(c))[0];w(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ma(a),g,n,j]);w(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ma(a),g,n,j]);d=h(a.nTBody);d.children().detach();d.append(h(b));w(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function R(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&mb(a);d?ha(a,a.oPreviousSearch):a.aiDisplay=
a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;M(a);a._drawHold=!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,i,j,n,l,r,q=0;q<f.length;q++){g=null;i=f[q];if("<"==i){j=h("<div/>")[0];n=f[q+1];if("'"==n||'"'==n){l="";for(r=2;f[q+r]!=n;)l+=
f[q+r],r++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),j.id=n[0].substr(1,n[0].length-1),j.className=n[1]):"#"==l.charAt(0)?j.id=l.substr(1,l.length-1):j.className=l;q+=r}e.append(j);e=h(j)}else if(">"==i)e=e.parent();else if("l"==i&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==i&&d.bFilter)g=pb(a);else if("r"==i&&d.bProcessing)g=qb(a);else if("t"==i)g=rb(a);else if("i"==i&&d.bInfo)g=sb(a);else if("p"==i&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){j=
m.ext.feature;r=0;for(n=j.length;r<n;r++)if(i==j[r].cFeature){g=j[r].fnInit(a);break}}g&&(j=a.aanFeatures,j[i]||(j[i]=[]),j[i].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function fa(a,b){var c=h(b).children("tr"),d,e,f,g,i,j,n,l,r,q;a.splice(0,a.length);f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");r=1*e.getAttribute("rowspan");l=!l||0===l||
1===l?1:l;r=!r||0===r||1===r?1:r;g=0;for(i=a[f];i[g];)g++;n=g;q=1===l?!0:!1;for(i=0;i<l;i++)for(g=0;g<r;g++)a[f+g][n+i]={cell:e,unique:q},a[f+g].nTr=d}e=e.nextSibling}}}function qa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],fa(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ra(a,b,c){w(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=
b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,i=a.oInstance,j=function(b){w(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&J(a,0,c);a.json=b;j(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=w(a,null,"xhr",[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==
c?J(a,0,"Invalid JSON response",1):4===b.readyState&&J(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;w(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(i,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),j,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(i,b,j,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=
a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,i=[],j,n,l,r=V(a);g=a._iDisplayStart;j=!1!==d.bPaginate?a._iDisplayLength:-1;var q=function(a,b){i.push({name:a,value:b})};q("sEcho",a.iDraw);q("iColumns",c);q("sColumns",D(b,"sName").join(","));q("iDisplayStart",g);q("iDisplayLength",j);var k={draw:a.iDraw,columns:[],order:[],start:g,length:j,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],l=f[g],j="function"==typeof n.mData?"function":n.mData,k.columns.push({data:j,
name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),q("mDataProp_"+g,j),d.bFilter&&(q("sSearch_"+g,l.sSearch),q("bRegex_"+g,l.bRegex),q("bSearchable_"+g,n.bSearchable)),d.bSort&&q("bSortable_"+g,n.bSortable);d.bFilter&&(q("sSearch",e.sSearch),q("bRegex",e.bRegex));d.bSort&&(h.each(r,function(a,b){k.order.push({column:b.col,dir:b.dir});q("iSortCol_"+a,b.col);q("sSortDir_"+a,b.dir)}),q("iSortingCols",r.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?
i:k:b?i:k}function vb(a,b){var c=sa(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)L(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;M(a);a._bInitComplete||ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&
a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?P(c)(b):b}function pb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',i=d.sSearch,i=i.match(/_INPUT_/)?i.replace("_INPUT_",g):i+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(i)),f=function(){var b=!this.value?"":this.value;b!=e.sSearch&&(ha(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,
bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,M(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,j=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",g?ua(f,g):f).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{j[0]!==T.activeElement&&j.val(e.sSearch)}catch(d){}});return b[0]}function ha(a,b,c){var d=a.oPreviousSearch,
e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ia(a);if("ssp"!=y(a)){wb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)xb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);yb(a)}else f(b);a.bFiltered=!0;w(a,null,"search",[a])}function yb(a){for(var b=m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<
g;f++){for(var i=[],j=0,n=c.length;j<n;j++)e=c[j],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,j)&&i.push(e);c.length=0;h.merge(c,i)}}function xb(a,b,c,d,e,f){if(""!==b)for(var g=a.aiDisplay,d=Qa(b,d,e,f),e=g.length-1;0<=e;e--)b=a.aoData[g[e]]._aFilterData[c],d.test(b)||g.splice(e,1)}function wb(a,b,c,d,e,f){var d=Qa(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=zb(a);if(0>=b.length)a.aiDisplay=f.slice();else{if(g||c||e.length>b.length||0!==b.indexOf(e)||
a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Qa(a,b,c,d){a=b?a:va(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function va(a){return a.replace(Yb,"\\$1")}function zb(a){var b=a.aoColumns,c,d,e,f,g,i,j,h,l=m.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<
f;d++)if(h=a.aoData[d],!h._aFilterData){i=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(j=B(a,d,e,"filter"),l[c.sType]&&(j=l[c.sType](j)),null===j&&(j=""),"string"!==typeof j&&j.toString&&(j=j.toString())):j="",j.indexOf&&-1!==j.indexOf("&")&&(wa.innerHTML=j,j=Zb?wa.textContent:wa.innerText),j.replace&&(j=j.replace(/[\r\n]/g,"")),i.push(j);h._aFilterData=i;h._sFilterRow=i.join(" ");c=!0}return c}function Ab(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}
function Bb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function sb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Cb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Cb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),
g=a.fnRecordsDisplay(),i=g?c.sInfo:c.sInfoEmpty;g!==f&&(i+=" "+c.sInfoFiltered);i+=c.sInfoPostFix;i=Db(a,i);c=c.fnInfoCallback;null!==c&&(i=c.call(a.oInstance,a,d,e,f,g,i));h(b).html(i)}}function Db(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/
e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ia(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){nb(a);kb(a);ga(a,a.aoHeader);ga(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ha(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=u(f.sWidth));w(a,null,"preInit",[a]);R(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)L(a,f[b]);a.iInitDisplayStart=d;R(a);C(a,!1);ta(a,c)},a):(C(a,!1),
ta(a))}else setTimeout(function(){ia(a)},200)}function ta(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Y(a);w(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);w(a,null,"length",[a,c])}function ob(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,i=f.length;g<i;g++)e[0][g]=new Option(d[g],f[g]);var j=h("<div><label/></div>").addClass(b.sLength);
a.aanFeatures.l||(j[0].id=c+"_length");j.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",j).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());M(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",j).val(d)});return j[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){M(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+
"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,j=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===j,b=l?0:Math.ceil(b/j),j=l?1:Math.ceil(h/j),h=c(b,j),k,l=0;for(k=f.p.length;l<k;l++)Pa(a,"pageButton")(a,f.p[l],l,h,b,j)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==
b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:J(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(w(a,null,"page",[a]),c&&M(a));return b}function qb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");w(a,null,"processing",[a,b])}function rb(a){var b=h(a.nTable);b.attr("role",
"grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),i=g.length?g[0]._captionSide:null,j=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");c.sX&&"100%"===b.attr("width")&&b.removeAttr("width");l.length||(l=null);j=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:u(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",
width:c.sXInner||"100%"}).append(j.removeAttr("id").css("margin-left",0).append("top"===i?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:u(d)}).append(b));l&&j.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:u(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===i?g:null).append(b.children("tfoot")))));
var b=j.children(),k=b[0],f=b[1],q=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(q.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=q;a.aoDrawCallback.push({fn:Z,sName:"scrolling"});return j[0]}function Z(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,i=f.children("div"),j=i[0].style,n=i.children("table"),i=a.nScrollBody,l=h(i),k=i.style,q=h(a.nScrollFoot).children("div"),
m=q.children("table"),o=h(a.nTHead),E=h(a.nTable),p=E[0],t=p.style,N=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,w=Eb.bScrollOversize,s,v,O,x,y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};E.children("thead, tfoot").remove();x=o.clone().prependTo(E);o=o.find("tr");v=x.find("tr");x.find("th, td").removeAttr("tabindex");N&&(O=N.clone().prependTo(E),s=N.find("tr"),O=O.find("tr"));c||(k.width="100%",f[0].style.width="100%");
h.each(qa(a,x),function(b,c){B=$(a,b);c.style.width=a.aoColumns[B].sWidth});N&&H(function(a){a.style.width=""},O);f=E.outerWidth();if(""===c){t.width="100%";if(w&&(E.find("tbody").height()>i.offsetHeight||"scroll"==l.css("overflow-y")))t.width=u(E.outerWidth()-b);f=E.outerWidth()}else""!==d&&(t.width=u(d),f=E.outerWidth());H(C,v);H(function(a){A.push(a.innerHTML);y.push(u(h(a).css("width")))},v);H(function(a,b){a.style.width=y[b]},o);h(v).height(0);N&&(H(C,O),H(function(a){z.push(u(h(a).css("width")))},
O),H(function(a,b){a.style.width=z[b]},s),h(O).height(0));H(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+A[b]+"</div>";a.style.width=y[b]},v);N&&H(function(a,b){a.innerHTML="";a.style.width=z[b]},O);if(E.outerWidth()<f){s=i.scrollHeight>i.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(w&&(i.scrollHeight>i.offsetHeight||"scroll"==l.css("overflow-y")))t.width=u(s-b);(""===c||""!==d)&&J(a,1,"Possible column misalignment",6)}else s="100%";k.width=
u(s);g.width=u(s);N&&(a.nScrollFoot.style.width=u(s));!e&&w&&(k.height=u(p.offsetHeight+b));c=E.outerWidth();n[0].style.width=u(c);j.width=u(c);d=E.height()>i.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":"Right");j[e]=d?b+"px":"0px";N&&(m[0].style.width=u(c),q[0].style.width=u(c),q[0].style[e]=d?b+"px":"0px");l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)i.scrollTop=0}function H(a,b,c){for(var d=0,e=0,f=b.length,g,i;e<f;){g=b[e].firstChild;for(i=c?c[e].firstChild:
null;g;)1===g.nodeType&&(c?a(g,i,d):a(g,d),d++),g=g.nextSibling,i=c?i.nextSibling:null;e++}}function Ha(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,i=c.length,j=aa(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,q=!1,m,o,p;p=a.oBrowser;d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<j.length;m++)o=c[j[m]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),q=!0);if(d||!q&&!f&&!e&&i==ca(a)&&i==n.length)for(m=0;m<i;m++){if(j=
$(a,m))c[j].sWidth=u(n.eq(m).width())}else{i=h(b).clone().css("visibility","hidden").removeAttr("id");i.find("tbody tr").remove();var t=h("<tr/>").appendTo(i.find("tbody"));i.find("thead, tfoot").remove();i.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());i.find("tfoot th, tfoot td").css("width","");n=qa(a,i.find("thead")[0]);for(m=0;m<j.length;m++)o=c[j[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?u(o.sWidthOrig):"";if(a.aoData.length)for(m=0;m<j.length;m++)q=j[m],o=c[q],h(Gb(a,
q)).clone(!1).append(o.sContentPadding).appendTo(t);q=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(i).appendTo(k);f&&g?i.width(g):f?(i.css("width","auto"),i.width()<k.clientWidth&&i.width(k.clientWidth)):e?i.width(k.clientWidth):l&&i.width(l);if(f){for(m=g=0;m<j.length;m++)o=c[j[m]],e=p.bBounding?n[m].getBoundingClientRect().width:h(n[m]).outerWidth(),g+=null===o.sWidthOrig?e:parseInt(o.sWidth,10)+e-h(n[m]).width();i.width(u(g));b.style.width=
u(g)}for(m=0;m<j.length;m++)if(o=c[j[m]],p=h(n[m]).width())o.sWidth=u(p);b.style.width=u(i.css("width"));q.remove()}l&&(b.style.width=u(l));if((l||f)&&!a._reszEvt)b=function(){h(Fa).bind("resize.DT-"+a.sInstance,ua(function(){Y(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function ua(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,i=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,i)},c)):(d=g,a.apply(b,i))}}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",
u(a)).appendTo(b||T.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace($b,""),c.length>d&&(d=c.length,e=f);return e}function u(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,i,j;b=a.aaSortingFixed;
c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){j=n[a][0];f=e[j].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],i=e[g].sType||"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:j,col:g,dir:n[a][1],index:n[a]._idx,type:i,formatter:m.ext.type.order[i+"-pre"]})}return d}function mb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=
0,i,j=a.aiDisplayMaster,h;Ia(a);h=V(a);b=0;for(c=h.length;b<c;b++)i=h[b],i.formatter&&g++,Ib(a,i.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=j.length;b<c;b++)d[j[b]]=b;g===h.length?j.sort(function(a,b){var c,e,g,i,j=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=0;g<j;g++)if(i=h[g],c=k[i.col],e=m[i.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===i.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):j.sort(function(a,b){var c,g,i,j,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(i=0;i<k;i++)if(j=h[i],
c=m[j.col],g=p[j.col],j=e[j.type+"-"+j.dir]||e["string-"+j.dir],c=j(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var i=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var j=c.nTh;j.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(j.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=i[e[0].index+1]||i[0]):c=i[0],b+="asc"===c?a.sSortAscending:
a.sSortDescending);j.setAttribute("aria-label",b)}}function Ua(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],
e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);R(a);"function"==typeof d&&d(a)}function Oa(a,b,c,d){var e=a.aoColumns[c];Va(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Ua(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Ua(a,c,b.shiftKey,d))})}function xa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=V(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;
for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],i=0,h=a.aoData.length;i<h;i++)if(c=a.aoData[i],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[i]:B(a,i,b,"sort"),c._aSortData[b]=g?g(f):f}function ya(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,
length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};w(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&e.time&&(b=w(a,"aoStateLoadParams","stateLoadParams",[a,e]),-1===h.inArray(!1,b)&&(b=
a.iStateDuration,!(0<b&&e.time<+new Date-1E3*b)&&d.length===e.columns.length))){a.oLoadedState=h.extend(!0,{},e);e.start!==k&&(a._iDisplayStart=e.start,a.iInitDisplayStart=e.start);e.length!==k&&(a._iDisplayLength=e.length);e.order!==k&&(a.aaSorting=[],h.each(e.order,function(b,c){a.aaSorting.push(c[0]>=d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b<c;b++){var f=e.columns[b];f.visible!==k&&(d[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],
Bb(f.search))}w(a,"aoStateLoaded","stateLoaded",[a,e])}}}function za(a){var b=m.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function J(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)Fa.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&w(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&
b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Lb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Va(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind("selectstart.DT",
function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function w(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===
typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Aa(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function cb(a){h.each({num:function(b){return Ba(b,a)},"num-fmt":function(b){return Ba(b,a,Wa)},"html-num":function(b){return Ba(b,
a,Ca)},"html-num-fmt":function(b){return Ba(b,a,Ca,Wa)}},function(b,c){v.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(v.type.search[b+a]=v.type.search.html)})}function Nb(a){return function(){var b=[za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m,v,t,p,s,Xa={},Ob=/[\r\n]/g,Ca=/<.*?>/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,Yb=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Wa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,
K=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Xa[b]||(Xa[b]=RegExp(va(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Xa[b],"."):a},Ya=function(a,b,c){var d="string"===typeof a;if(K(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Wa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return K(a)?!0:!(K(a)||"string"===typeof a)?null:Ya(a.replace(Ca,""),b,c)?!0:null},D=function(a,
b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ja=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},W=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Sb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},pa=function(a){var b=[],c,d,e=a.length,f,g=0;
d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b},A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},da=/\[.*?\]$/,U=/\(\)$/,wa=h("<div>")[0],Zb=wa.textContent!==k,$b=/<.*?>/g;m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new t(za(this[v.iApiIndex])):new t(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?
c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&Z(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);
(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);
return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=
function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return za(this[v.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=v.fnVersionCheck;var b=this,c=a===k,d=this.length;
c&&(a={});this.oApi=this.internal=v.internal;for(var e in m.ext.internal)e&&(this[e]=Nb(e));this.each(function(){var e={},e=1<d?Lb(e,a,!0):a,g=0,i,j=this.getAttribute("id"),n=!1,l=m.defaults,r=h(this);if("table"!=this.nodeName.toLowerCase())J(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{db(l);eb(l.column);I(l,l,!0);I(l.column,l.column,!0);I(l,h.extend(e,r.data()));var q=m.settings,g=0;for(i=q.length;g<i;g++){var p=q[g];if(p.nTable==this||p.nTHead.parentNode==this||p.nTFoot&&
p.nTFoot.parentNode==this){g=e.bRetrieve!==k?e.bRetrieve:l.bRetrieve;if(c||g)return p.oInstance;if(e.bDestroy!==k?e.bDestroy:l.bDestroy){p.oInstance.fnDestroy();break}else{J(p,0,"Cannot reinitialise DataTable",3);return}}if(p.sTableId==this.id){q.splice(g,1);break}}if(null===j||""===j)this.id=j="DataTables_Table_"+m.ext._unique++;var o=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:r[0].style.width,sInstance:j,sTableId:j});o.nTable=this;o.oApi=b.internal;o.oInit=e;q.push(o);o.oInstance=1===b.length?
b:r.dataTable();db(e);e.oLanguage&&S(e.oLanguage);e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=h.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]);e=Lb(h.extend(!0,{},l),e);F(o.oFeatures,e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(o,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp",
"iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);F(o.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(o.oLanguage,e,"fnInfoCallback");z(o,"aoDrawCallback",e.fnDrawCallback,"user");z(o,"aoServerParams",
e.fnServerParams,"user");z(o,"aoStateSaveParams",e.fnStateSaveParams,"user");z(o,"aoStateLoadParams",e.fnStateLoadParams,"user");z(o,"aoStateLoaded",e.fnStateLoaded,"user");z(o,"aoRowCallback",e.fnRowCallback,"user");z(o,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(o,"aoHeaderCallback",e.fnHeaderCallback,"user");z(o,"aoFooterCallback",e.fnFooterCallback,"user");z(o,"aoInitComplete",e.fnInitComplete,"user");z(o,"aoPreDrawCallback",e.fnPreDrawCallback,"user");o.rowIdFn=P(e.rowId);fb(o);j=o.oClasses;
e.bJQueryUI?(h.extend(j,m.ext.oJUIClasses,e.oClasses),e.sDom===l.sDom&&"lfrtip"===l.sDom&&(o.sDom='<"H"lfr>t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&!o.renderer.header&&(o.renderer.header="jqueryui"):o.renderer="jqueryui":h.extend(j,m.ext.classes,e.oClasses);r.addClass(j.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=e.iDisplayStart,o._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(o.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),o._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,
o._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var t=o.oLanguage;h.extend(!0,t,e.oLanguage);""!==t.sUrl&&(h.ajax({dataType:"json",url:t.sUrl,success:function(a){S(a);I(l.oLanguage,a);h.extend(true,t,a);ia(o)},error:function(){ia(o)}}),n=!0);null===e.asStripeClasses&&(o.asStripeClasses=[j.sStripeOdd,j.sStripeEven]);var g=o.asStripeClasses,s=r.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return s.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),o.asDestroyStripes=
g.slice());q=[];g=this.getElementsByTagName("thead");0!==g.length&&(fa(o.aoHeader,g[0]),q=qa(o));if(null===e.aoColumns){p=[];g=0;for(i=q.length;g<i;g++)p.push(null)}else p=e.aoColumns;g=0;for(i=p.length;g<i;g++)Ga(o,q?q[g]:null);hb(o,e.aoColumnDefs,p,function(a,b){la(o,a,b)});if(s.length){var u=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(s[0]).children("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=u(b,"sort")||u(b,"order"),e=u(b,"filter")||u(b,"search");
if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};la(o,a)}}})}var v=o.oFeatures;e.bStateSave&&(v.bStateSave=!0,Kb(o,e),z(o,"aoDrawCallback",ya,"state_save"));if(e.aaSorting===k){q=o.aaSorting;g=0;for(i=q.length;g<i;g++)q[g][1]=o.aoColumns[g].asSorting[0]}xa(o);v.bSort&&z(o,"aoDrawCallback",function(){if(o.bSorted){var a=V(o),b={};h.each(a,function(a,c){b[c.src]=c.dir});w(o,null,"order",[o,a,b]);Jb(o)}});z(o,
"aoDrawCallback",function(){(o.bSorted||y(o)==="ssp"||v.bDeferRender)&&xa(o)},"sc");g=r.children("caption").each(function(){this._captionSide=r.css("caption-side")});i=r.children("thead");0===i.length&&(i=h("<thead/>").appendTo(this));o.nTHead=i[0];i=r.children("tbody");0===i.length&&(i=h("<tbody/>").appendTo(this));o.nTBody=i[0];i=r.children("tfoot");if(0===i.length&&0<g.length&&(""!==o.oScroll.sX||""!==o.oScroll.sY))i=h("<tfoot/>").appendTo(this);0===i.length||0===i.children().length?r.addClass(j.sNoFooter):
0<i.length&&(o.nTFoot=i[0],fa(o.aoFooter,o.nTFoot));if(e.aaData)for(g=0;g<e.aaData.length;g++)L(o,e.aaData[g]);else(o.bDeferLoading||"dom"==y(o))&&ma(o,h(o.nTBody).children("tr"));o.aiDisplay=o.aiDisplayMaster.slice();o.bInitialised=!0;!1===n&&ia(o)}});b=null;return this};var Tb=[],x=Array.prototype,cc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:
null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};t=function(a,b){if(!(this instanceof t))return new t(a,b);var c=[],d=function(a){(a=cc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=pa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};t.extend(this,this,Tb)};
m.Api=t;h.extend(t.prototype,{any:function(){return 0!==this.count()},concat:x.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new t(b[a],this[a]):null},filter:function(a){var b=[];if(x.filter)b=x.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new t(this.context,b)},flatten:function(){var a=
[];return new t(this.context,a.concat.apply(a,this.toArray()))},join:x.join,indexOf:x.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,j,n,l=this.context,m,q,p=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var o=new t(l[g]);if("table"===b)f=c.call(o,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(o,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===
b||"row"===b||"cell"===b){q=this[g];"column-rows"===b&&(m=Da(l[g],p.opts));j=0;for(n=q.length;j<n;j++)f=q[j],f="cell"===b?c.call(o,l[g],f.row,f.column,g,j):c.call(o,l[g],f,g,j,m),f!==k&&e.push(f)}}return e.length||d?(a=new t(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=p.rows,b.cols=p.cols,b.opts=p.opts,a):this},lastIndexOf:x.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(x.map)b=x.map.call(this,a,this);else for(var c=
0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new t(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:x.pop,push:x.push,reduce:x.reduce||function(a,b){return gb(this,a,b,0,this.length,1)},reduceRight:x.reduceRight||function(a,b){return gb(this,a,b,this.length-1,-1,-1)},reverse:x.reverse,selector:null,shift:x.shift,sort:x.sort,splice:x.splice,toArray:function(){return x.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},
unique:function(){return new t(this.context,pa(this))},unshift:x.unshift});t.extend=function(a,b,c){if(c.length&&b&&(b instanceof t||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);t.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,t.extend(a,b[f.name],f.propExt)}};t.register=p=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<
d;c++)t.register(a[c],b);else for(var e=a.split("."),f=Tb,g,i,c=0,d=e.length;c<d;c++){g=(i=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var j;a:{j=0;for(var n=f.length;j<n;j++)if(f[j].name===g){j=f[j];break a}j=null}j||(j={name:g,val:{},methodExt:[],propExt:[]},f.push(j));c===d-1?j.val=b:f=i?j.methodExt:j.propExt}};t.registerPlural=s=function(a,b,c){t.register(a,c);t.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof t?a.length?h.isArray(a[0])?new t(a.context,
a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=t;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new t(b[0]):a});s("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});s("tables().body()","table().body()",
function(){return this.iterator("table",function(a){return a.nTBody},1)});s("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});s("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});s("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",function(b){"page"===
a?M(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),R(b,!1===a))})});p("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a._iDisplayLength,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});
p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var d=new t(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))R(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ra(a,[],function(c){na(a);for(var c=sa(a,c),d=0,e=c.length;d<e;d++)L(a,c[d]);R(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});p("ajax.params()",
function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});
var Za=function(a,b,c,d,e){var f=[],g,i,j,n,l,m;j=typeof b;if(!b||"string"===j||"function"===j||b.length===k)b=[b];j=0;for(n=b.length;j<n;j++){i=b[j]&&b[j].split?b[j].split(","):[b[j]];l=0;for(m=i.length;l<m;l++)(g=c("string"===typeof i[l]?h.trim(i[l]):i[l]))&&g.length&&(f=f.concat(g))}a=v.selector[a];if(a.length){j=0;for(n=a.length;j<n;j++)f=a[j](d,e,f)}return pa(f)},$a=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},
ab=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Da=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var i=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===i?[]:W(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==i?c.slice():"applied"==i?g.slice():h.map(c,function(a){return-1===h.inArray(a,
g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==i?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==i||0<=e&&"applied"==i)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=b;return Za("row",a,function(a){var b=Pb(a);if(b!==null&&!e)return[b];var i=Da(c,e);if(b!==null&&h.inArray(b,i)!==-1)return[b];if(!a)return i;if(typeof a==="function")return h.map(i,function(b){var e=
c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Sb(ja(c.aoData,i,"nTr"));if(a.nodeName&&h.inArray(a,b)!==-1)return[a._DT_RowIndex];if(typeof a==="string"&&a.charAt(0)==="#"){i=c.aIds[a.replace(/^#/,"")];if(i!==k)return[i.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0,
"rows",function(a,b){return ja(a.aoData,b,"_aData")},1)});s("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});s("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ea(b,c,a)})});s("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});s("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,
d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new t(c,b)});s("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c];e.splice(c,1);for(var g=0,h=e.length;g<h;g++)null!==e[g].nTr&&(e[g].nTr._DT_RowIndex=g);oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=
0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(L(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);return c});p("row()",function(a,b){return ab(this.rows(a,b))});p("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=
a;ea(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?ma(b,a)[0]:L(b,a)});return this.row(b[0])});var bb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Vb=function(a,
b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new t(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<D(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===
b)for(var c,d=ca(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&bb(f,c)}))}}};p("row().child()",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)bb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||
a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=ca(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});p(["row().child.show()","row().child().show()"],function(){Vb(this,!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()",
"row().child().remove()"],function(){bb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var dc=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,i=D(g,"sName"),j=D(g,"nTh");return Za("column",
e,function(a){var b=Pb(a);if(a==="")return W(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Da(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),j[f])?f:null})}var k=typeof a==="string"?a.match(dc):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[$(c,b)];case "name":return h.map(i,function(a,b){return a===k[1]?b:null})}else return h(j).filter(a).map(function(){return h.inArray(this,
j)}).toArray()},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});s("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",
function(a,b){return a.aoColumns[b].mData},1)});s("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,e,"anCells",b)},1)});s("columns().visible()","column().visible()",function(a,b){return this.iterator("column",function(c,d){if(a===k)return c.aoColumns[d].bVisible;
var e=c.aoColumns,f=e[d],g=c.aoData,i,j,m;if(a!==k&&f.bVisible!==a){if(a){var l=h.inArray(!0,D(e,"bVisible"),d+1);i=0;for(j=g.length;i<j;i++)m=g[i].nTr,e=g[i].anCells,m&&m.insertBefore(e[d],e[l]||null)}else h(D(c.aoData,"anCells",d)).detach();f.bVisible=a;ga(c,c.aoHeader);ga(c,c.aoFooter);if(b===k||b)Y(c),(c.oScroll.sX||c.oScroll.sY)&&Z(c);w(c,null,"column-visibility",[c,d,a]);ya(c)}})});s("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===
a?ba(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){Y(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return $(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});p("column()",function(a,b){return ab(this.columns(a,b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",
function(b){var d=a,e=$a(c),f=b.aoData,g=Da(b,e),i=Sb(ja(f,g,"anCells")),j=h([].concat.apply([],i)),l,m=b.aoColumns.length,n,p,t,s,u,v;return Za("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){n=[];p=0;for(t=g.length;p<t;p++){l=g[p];for(s=0;s<m;s++){u={row:l,column:s};if(c){v=f[l];a(u,B(b,l,s),v.anCells?v.anCells[s]:null)&&n.push(u)}else n.push(u)}}return n}return h.isPlainObject(a)?[a]:j.filter(a).map(function(a,b){if(b.parentNode)l=b.parentNode._DT_RowIndex;else{a=0;for(t=
f.length;a<t;a++)if(h.inArray(b,f[a].anCells)!==-1){l=a;break}}return{row:l,column:h.inArray(b,f[l].anCells)}}).toArray()},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,i,j,m,l=this.iterator("table",function(a,b){f=[];g=0;for(i=e[b].length;g<i;g++){j=0;for(m=d[b].length;j<m;j++)f.push({row:e[b][g],column:d[b][j]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b].anCells)?
a[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});s("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});s("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,
column:c,columnVisible:ba(a,c)}},1)});s("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ea(b,c,a,d)})});p("cell()",function(a,b,c){return ab(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;ib(b[0],c[0].row,c[0].column,a);ea(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===k)return 0!==c.length?c[0].aaSorting:
k;"number"===typeof a?a=[[a,b]]:h.isArray(a[0])||(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Oa(d,a,b,c)})});p(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?
e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&ha(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});s("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ha(e,
e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){ya(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=
a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});
return b?new t(c):c};m.util={throttle:ua,escapeRegex:va};m.camelToHungarian=I;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)||(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){na(a)})});p("settings()",function(){return new t(this.context,
this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,i=b.nTFoot,j=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;w(b,"aoDestroyCallback","destroy",[b]);a||
(new t(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(Fa).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(j.children("thead").detach(),j.append(g));i&&e!=i.parentNode&&(j.children("tfoot").detach(),j.append(i));b.aaSorting=[];b.aaSortingFixed=[];xa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",
g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";j[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),j.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",
function(a){return this.iterator(b,function(d,e,f,g,h){a.call((new t(d))[b](e,"cell"===b?f:k),e,f,g,h)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=P(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.9";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,
idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,
25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,
fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},
fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",
sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};X(m.defaults);m.defaults.column={aDataSort:null,
iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,
iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],
aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,
iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=
this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=v={buttons:{},classes:{},errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,
iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(v,{afnFiltering:v.search,aTypes:v.type.detect,ofnSearch:v.type.search,oSort:v.type.order,afnSortData:v.order,aoFeatures:v.feature,oApi:v.internal,oStdClasses:v.classes,oPagination:v.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",
sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",
sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ea="",Ea="",G=Ea+"ui-state-default",ka=Ea+"css_right ui-icon ui-icon-",Xb=Ea+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,m.ext.classes,{sPageButton:"fg-button ui-button "+G,sPageButtonActive:"ui-state-disabled",
sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:G+" sorting_asc",sSortDesc:G+" sorting_desc",sSortable:G+" sorting",sSortableAsc:G+" sorting_asc_disabled",sSortableDesc:G+" sorting_desc_disabled",sSortableNone:G+" sorting_disabled",sSortJUIAsc:ka+"triangle-1-n",sSortJUIDesc:ka+"triangle-1-s",sSortJUI:ka+"carat-2-n-s",sSortJUIAscAllowed:ka+"carat-1-n",sSortJUIDescAllowed:ka+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",
sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+G,sScrollFoot:"dataTables_scrollFoot "+G,sHeaderTH:G,sFooterTH:G,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[Aa(a,b)]},simple_numbers:function(a,b){return["previous",Aa(a,b),"next"]},full_numbers:function(a,b){return["first",
"previous",Aa(a,b),"next","last"]},_numbers:Aa,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,i=a.oLanguage.oPaginate,j,k,l=0,m=function(b,d){var p,q,t,s,u=function(b){Ta(a,b.data.action,true)};p=0;for(q=d.length;p<q;p++){s=d[p];if(h.isArray(s)){t=h("<"+(s.DT_el||"div")+"/>").appendTo(b);m(t,s)}else{j=null;k="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":j=i.sFirst;k=s+(e>0?"":" "+g.sPageButtonDisabled);
break;case "previous":j=i.sPrevious;k=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":j=i.sNext;k=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":j=i.sLast;k=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:j=s+1;k=e===s?g.sPageButtonActive:""}if(j!==null){t=h("<a>",{"class":g.sPageButton+" "+k,"aria-controls":a.sTableId,"data-dt-idx":l,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(j).appendTo(b);Va(t,{action:s},u);l++}}}},p;try{p=h(b).find(T.activeElement).data("dt-idx")}catch(t){}m(h(b).empty(),
d);p&&h(b).find("[data-dt-idx="+p+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||K(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,
!0)?"html-num-fmt"+c:null},function(a){return K(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return K(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Ca,""):""},string:function(a){return K(a)?a:"string"===typeof a?a.replace(Ob," "):a}});var Ba=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(v.type.order,{"date-pre":function(a){return Date.parse(a)||
0},"html-pre":function(a){return K(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return K(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});cb("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]==
"asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+
d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});m.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",f=Math.abs(parseFloat(f)),h=parseInt(f,10),f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,
_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ga,_fnColumnOptions:la,_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:$,_fnColumnIndexToVisible:ba,_fnVisbleColumns:ca,_fnGetColumns:aa,_fnColumnTypes:Ia,_fnApplyColumnDefs:hb,_fnHungarianMap:X,_fnCamelToHungarian:I,_fnLanguageCompat:S,_fnBrowserDetect:fb,_fnAddData:L,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},
_fnGetCellData:B,_fnSetCellData:ib,_fnSplitObjNotation:La,_fnGetObjectDataFn:P,_fnSetObjectDataFn:Q,_fnGetDataMaster:Ma,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ea,_fnGetRowElements:Ka,_fnCreateTr:Ja,_fnBuildHead:kb,_fnDrawHead:ga,_fnDraw:M,_fnReDraw:R,_fnAddOptionsHtml:nb,_fnDetectHeader:fa,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:ha,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Qa,_fnEscapeRegex:va,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,
_fnInfoMacros:Db,_fnInitialise:ia,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob,_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:Z,_fnApplyToChildren:H,_fnCalculateColumnWidths:Ha,_fnThrottle:ua,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:u,_fnSortFlatten:V,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Ua,_fnSortAttachListener:Oa,_fnSortingClasses:xa,_fnSortData:Ib,_fnSaveState:ya,
_fnLoadState:Kb,_fnSettingsFromNode:za,_fnLog:J,_fnMap:F,_fnBindAction:Va,_fnCallbackReg:z,_fnCallbackFire:w,_fnLengthOverflow:Sa,_fnRenderer:Pa,_fnDataSource:y,_fnRowAttributes:Na,_fnCalculateEnd:function(){}});h.fn.dataTable=m;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable};"function"===typeof define&&define.amd?define("datatables",["jquery"],S):"object"===
typeof exports?module.exports=S(require("jquery")):jQuery&&!jQuery.fn.dataTable&&S(jQuery)})(window,document); | mit |
vitalie/unicorn-soft-timeout | lib/unicorn/soft_timeout.rb | 857 | require 'unicorn/soft_timeout/version'
module Unicorn
module SoftTimeout
def self.new(app, soft_timeout = 12)
ObjectSpace.each_object(Unicorn::HttpServer) do |s|
s.extend(self)
s.instance_variable_set(:@_soft_timeout, soft_timeout)
end
app # pretend to be Rack middleware since it was in the past
end
def process_client(client)
worker_pid = Process.pid
current_thread = Thread.current
watcher = Thread.new do
sleep(@_soft_timeout)
logger.warn "#{self}: worker (pid: #{worker_pid}) exceeds soft timeout (limit: #{@_soft_timeout})"
Process.kill :QUIT, worker_pid # graceful shutdown
current_thread.raise Timeout::Error.new('Soft timeout exceeded')
end
super(client) # Unicorn::HttpServer#process_client
watcher.terminate
end
end
end
| mit |
deepakmega/Documents | public/modules/document/controllers/docNodeCreate.client.controller.js | 3340 | /*global $:false */
'use strict';
// Uploads controller
angular.module('document').controller('docNodeCreateController', ['$scope', '$stateParams', '$location', 'Authentication', 'documentService', 'ngDialog',
function($scope, $stateParams, $location, Authentication, documentService, ngDialog) {
$scope.sizeLimit = 10585760; // 10MB in Bytes
$scope.uploadProgress = 0;
$scope.creds = {access_key:'AKIAI7P42testGQ' , secret_key:'CmN8P/cEJ6hstestBYhPfPcuOQVMqq4w', bucket:'docstore2015'};
$scope.authentication = Authentication;
$scope.upload = function(scopeFile) {
AWS.config.update({ accessKeyId: $scope.creds.access_key, secretAccessKey: $scope.creds.secret_key });
AWS.config.region = 'us-east-1';
var bucket = new AWS.S3({ params: { Bucket: $scope.creds.bucket} });
$scope.uploadedURL = null;
if(scopeFile) {
// Perform File Size Check First
var fileSize = Math.round(parseInt(scopeFile.size));
if (fileSize > $scope.sizeLimit) {
toastr.error('Sorry, your attachment is too big. <br/> Maximum ' + $scope.fileSizeLabel() + ' file attachment allowed','File Too Large');
return false;
}
// Prepend Unique String To Prevent Overwrites
var uniqueFileName = $scope.uniqueString() + '-' + scopeFile.name;
var params = { Key: uniqueFileName, ContentType: scopeFile.type, Body: scopeFile, ServerSideEncryption: 'AES256' };
bucket.putObject(params, function(err, data) {
if(err) {
toastr.error(err.message,err.code);
return false;
}
else {
// Upload Successfully Finished
toastr.success('File Uploaded Successfully', 'Done');
$scope.doc.uploadedURL = 'https://s3.amazonaws.com/docstore2015/' + uniqueFileName;
$scope.uploadedURL = 'https://s3.amazonaws.com/docstore2015/' + uniqueFileName;
// Reset The Progress Bar
setTimeout(function() {
$scope.uploadProgress = 0;
$scope.$digest();
}, 4000);
}
})
.on('httpUploadProgress',function(progress) {
$scope.uploadProgress = Math.round(progress.loaded / progress.total * 100);
$scope.$digest();
});
}
else {
// No File Selected
toastr.error('Please select a file to upload');
}
};
$scope.fileSizeLabel = function() {
// Convert Bytes To MB
return Math.round($scope.sizeLimit / 1024 / 1024) + 'MB';
};
$scope.uniqueString = function() {
var text = '';
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for( var i=0; i < 8; i++ ) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
};
}
]);
| mit |
nublet/WoWCache | WTF/Account/Poesboi/SavedVariables/DataStore_Garrisons.lua | 252435 |
DataStore_GarrisonsDB = {
["profileKeys"] = {
["Talambelen - Neptulon"] = "Poesboi",
["Grimsheepér - Neptulon"] = "Poesboi",
["Bonniè - Darksorrow"] = "Poesboi",
["Hanibull - Neptulon"] = "Poesboi",
["Bonrambo - Darksorrow"] = "Poesboi",
["Sickem - Darksorrow"] = "Poesboi",
["Shreduction - Neptulon"] = "Poesboi",
["Classynem - Genjuros"] = "Poesboi",
["Talambelen - Darksorrow"] = "Poesboi",
["Bowjob - Neptulon"] = "Poesboi",
["Shreduction - Darksorrow"] = "Poesboi",
["Drong - Genjuros"] = "Poesboi",
["Dippendots - Darksorrow"] = "Poesboi",
["Pikachi - Darksorrow"] = "Poesboi",
["Absa - Genjuros"] = "Poesboi",
["Zippy - Neptulon"] = "Poesboi",
["Monawr - Darksorrow"] = "Poesboi",
["Retnuhnomed - Darksorrow"] = "Poesboi",
["Nedbank - Darksorrow"] = "Poesboi",
["Adas - Genjuros"] = "Poesboi",
["Saddw - Genjuros"] = "Poesboi",
["Cagstillo - Neptulon"] = "Poesboi",
["Ohderp - Genjuros"] = "Poesboi",
["Antima - Neptulon"] = "Poesboi",
["Bandagespéc - Darksorrow"] = "Poesboi",
["Mahuge - Neptulon"] = "Poesboi",
["Freeboost - Genjuros"] = "Poesboi",
["Classywr - Genjuros"] = "Poesboi",
["Tulight - Neptulon"] = "Poesboi",
["Bravehèarth - Darksorrow"] = "Poesboi",
["Macked - Neptulon"] = "Poesboi",
["Sada - Genjuros"] = "Poesboi",
["Elson - Neptulon"] = "Poesboi",
},
["global"] = {
["Characters"] = {
["Default.Neptulon.Bowjob"] = {
["lastUpdate"] = 1602836953,
},
["Default.Darksorrow.Bravehèarth"] = {
["BFAFollowers"] = {
[1177] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1177:1:50:800:1085:0:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
},
[1178] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1178:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
},
[1179] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1179:2:50:800:1083:1138:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
},
[1182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1182:5:50:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
},
[1184] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1184:2:50:800:1083:1138:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
},
[1185] = {
["link"] = "|cff0070dd|Hgarrfollower:1185:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1062] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1062:5:50:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1064] = {
["link"] = "|cff0070dd|Hgarrfollower:1064:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1065] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1065:5:50:800:1131:1087:0:0:1100:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
},
[1066] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1066:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
},
[1067] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1067:1:50:1:1084:0:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1068] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1068:5:50:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
},
[1069] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1069:5:50:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
},
[1070] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1070:2:50:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
},
[1071] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1071:2:50:800:1084:1138:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1072] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1072:5:50:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
},
[1073] = {
["link"] = "|cff0070dd|Hgarrfollower:1073:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
},
["numFollowersAtiLevel660"] = 25,
["AvailableMissions"] = {
314, -- [1]
685, -- [2]
429, -- [3]
189, -- [4]
173, -- [5]
162, -- [6]
185, -- [7]
245, -- [8]
333, -- [9]
254, -- [10]
127, -- [11]
300, -- [12]
663, -- [13]
255, -- [14]
360, -- [15]
272, -- [16]
275, -- [17]
282, -- [18]
220, -- [19]
200, -- [20]
672, -- [21]
307, -- [22]
373, -- [23]
159, -- [24]
489, -- [25]
381, -- [26]
379, -- [27]
},
["AvailableOrderHallMissions"] = {
1709, -- [1]
1589, -- [2]
1633, -- [3]
1675, -- [4]
1602, -- [5]
1648, -- [6]
1665, -- [7]
},
["numEpicFollowers"] = 26,
["lastUpdate"] = 1603038807,
["numFollowersAtiLevel645"] = 25,
["numFollowersAtiLevel630"] = 25,
["numFollowersAtiLevel615"] = 25,
["AbilityCounters"] = {
3, -- [1]
3, -- [2]
4, -- [3]
4, -- [4]
nil, -- [5]
12, -- [6]
7, -- [7]
4, -- [8]
9, -- [9]
6, -- [10]
},
["Followers"] = {
[479] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:479:6:45:900:453:568:0:0:685:758:414:0:342|h[Vindicator Boros]|h|r",
},
[480] = {
["levelXP"] = 8000,
["link"] = "|cffffffff|Hgarrfollower:480:1:45:760:455:0:0:0:0:0:0:0:342|h[Lord Maxwell Tyrosus]|h|r",
["xp"] = 4537,
["isInactive"] = true,
},
[293] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:293:4:40:675:172:170:0:0:314:64:65:0:0|h[Skip Burnbright]|h|r",
},
[182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:161:104:0:0:64:65:45:0:0|h[Shelly Hamby]|h|r",
},
[840] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:840:1:35:700:559:0:0:0:0:0:0:0:0|h[Squad of Squires]|h|r",
},
[183] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:183:4:40:675:157:106:0:0:55:65:79:0:0|h[Rulkan]|h|r",
},
[363] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:363:4:40:675:105:160:0:0:314:77:67:0:0|h[Antone Sula]|h|r",
},
[247] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:247:4:40:675:139:182:0:0:79:7:48:0:0|h[Kihra]|h|r",
},
[153] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:160:161:0:0:66:76:256:0:0|h[Bruma Swiftstone]|h|r",
},
[850] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:850:2:35:700:561:562:0:0:0:0:0:0:0|h[Silver Hand Templar]|h|r",
},
[253] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:253:4:40:675:132:182:0:0:256:37:42:0:0|h[Kage Satsuke]|h|r",
},
[159] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:159:4:40:675:167:103:0:0:7:80:67:0:0|h[Rangari Kaalya]|h|r",
},
[1000] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:1000:6:45:900:455:826:0:0:910:758:414:0:341|h[Nerus Moonfang]|h|r",
},
[192] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:160:161:0:0:57:77:314:0:0|h[Kimzee Pinchwhistle]|h|r",
},
[756] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:756:6:45:900:453:586:0:0:908:685:414:0:340|h[Delas Moonfang]|h|r",
},
[225] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:225:4:40:600:120:122:0:0:46:37:42:0:0|h[Aknor Steelbringer]|h|r",
},
[98] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:98:4:40:675:132:134:0:0:80:46:79:0:0|h[Nuria Thornstorm]|h|r",
},
[34] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:134:108:0:0:232:236:69:0:0|h[Qiana Moonshadow]|h|r",
},
[324] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:324:4:40:675:128:125:0:0:53:41:36:0:0|h[Raquel Deyling]|h|r",
},
[327] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:327:4:40:675:128:127:0:0:41:45:79:0:0|h[Haagios]|h|r",
},
[851] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:851:2:35:700:561:562:0:0:0:0:0:0:0|h[Silver Hand Templar]|h|r",
},
[449] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:449:4:40:675:147:143:0:0:256:68:4:0:0|h[Gwynlan Rainglow]|h|r",
},
[463] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:10:0:0:65:44:79:0:0|h[Daleera Moonfang]|h|r",
},
[234] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:234:4:40:675:114:119:0:0:256:63:65:0:0|h[Sever Frostsprocket]|h|r",
},
[478] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:478:6:45:900:454:567:0:0:910:684:414:0:341|h[Lady Liadrin]|h|r",
},
[204] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:675:122:100:0:0:256:232:236:0:0|h[Admiral Taylor]|h|r",
},
[674] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:674:1:35:700:559:0:0:0:0:0:0:0:0|h[Squad of Squires]|h|r",
},
[440] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:440:4:40:675:143:144:0:0:314:77:48:0:0|h[Orrindis Raindrinker]|h|r",
},
[453] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:105:160:0:0:232:38:63:0:0|h[Hulda Shadowblade]|h|r",
},
[390] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:390:4:40:675:106:154:0:0:314:69:64:0:0|h[Belouran]|h|r",
},
[179] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:125:127:0:0:53:221:64:0:0|h[Artificer Romuul]|h|r",
},
[216] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:116:0:0:231:80:36:0:0|h[Delvar Ironfist]|h|r",
},
[103] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:103:4:40:675:179:181:0:0:79:9:7:0:0|h[Lucretia Ainsworth]|h|r",
},
[427] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:427:4:40:675:102:120:0:0:40:8:64:0:0|h[Dessee Crashcrank]|h|r",
},
[208] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:675:102:122:0:0:63:80:256:0:0|h[Ahm]|h|r",
},
[755] = {
["levelXP"] = 1500,
["link"] = "|cffffffff|Hgarrfollower:755:1:40:760:454:0:0:0:0:0:0:0:340|h[Justicar Julia Celeste]|h|r",
["xp"] = 1246,
["isInactive"] = true,
},
[757] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:757:6:45:900:455:566:0:0:684:414:415:0:340|h[Aponi Brightmane]|h|r",
},
[759] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:759:6:45:900:454:565:0:0:683:737:414:0:342|h[Lothraxion]|h|r",
},
[758] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:758:6:45:870:453:569:0:0:907:911:414:0:341|h[Arator the Redeemer]|h|r",
},
},
["Traits"] = {
[38] = 1,
[46] = 2,
[4] = 1,
[76] = 1,
[7] = 3,
[8] = 1,
[77] = 3,
[55] = 1,
[63] = 3,
[79] = 6,
[48] = 2,
[64] = 5,
[80] = 4,
[314] = 5,
[65] = 5,
[41] = 2,
[57] = 1,
[66] = 1,
[67] = 2,
[42] = 2,
[68] = 1,
[69] = 2,
[231] = 1,
[232] = 3,
[36] = 2,
[44] = 1,
[236] = 2,
[37] = 2,
[45] = 2,
[53] = 2,
[9] = 1,
[40] = 1,
[256] = 6,
[221] = 1,
},
["numFollowers"] = 26,
["Abilities"] = {
[106] = 2,
[179] = 1,
[148] = 1,
[181] = 1,
[182] = 2,
[108] = 1,
[10] = 1,
[125] = 2,
[154] = 1,
[157] = 1,
[127] = 2,
[128] = 2,
[160] = 4,
[161] = 3,
[114] = 1,
[132] = 2,
[115] = 1,
[134] = 2,
[100] = 1,
[167] = 1,
[170] = 1,
[102] = 2,
[172] = 1,
[103] = 1,
[119] = 1,
[104] = 1,
[120] = 2,
[144] = 1,
[147] = 1,
[105] = 2,
[122] = 3,
[143] = 2,
[139] = 1,
[116] = 1,
},
["AvailableWarCampaignMissions"] = {
1866, -- [1]
1888, -- [2]
1894, -- [3]
1914, -- [4]
2073, -- [5]
2135, -- [6]
2140, -- [7]
},
["numFollowersAtiLevel675"] = 25,
},
["Default.Neptulon.Antima"] = {
["lastUpdate"] = 1602837801,
},
["Default.Darksorrow.Sickem"] = {
["numRareFollowers"] = 1,
["BFAFollowers"] = {
[1177] = {
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1178] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1178:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
},
[1179] = {
["levelXP"] = 2000,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1179:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
},
[1182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1182:5:120:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
},
[1184] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1184:2:120:800:1083:1138:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
},
[1185] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1185:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
},
[1062] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1062:5:120:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 2000,
},
[1064] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1064:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
},
[1065] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1065:5:120:800:1131:1087:0:0:1100:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
},
[1066] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1066:1:120:1:1083:0:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
},
[1067] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1067:1:120:1:1084:0:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1068] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1068:5:120:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
},
[1069] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1069:5:120:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
},
[1070] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1070:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
},
[1071] = {
["link"] = "|cff0070dd|Hgarrfollower:1071:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1072] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1072:5:120:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
},
[1073] = {
["link"] = "|cff0070dd|Hgarrfollower:1073:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
},
["numFollowersAtiLevel660"] = 20,
["ActiveWarCampaignMissions"] = {
1890, -- [1]
1891, -- [2]
2078, -- [3]
},
["ActiveMissions"] = {
132, -- [1]
175, -- [2]
179, -- [3]
269, -- [4]
362, -- [5]
399, -- [6]
},
["AvailableMissions"] = {
130, -- [1]
159, -- [2]
161, -- [3]
171, -- [4]
188, -- [5]
192, -- [6]
204, -- [7]
245, -- [8]
254, -- [9]
257, -- [10]
263, -- [11]
266, -- [12]
271, -- [13]
273, -- [14]
299, -- [15]
323, -- [16]
331, -- [17]
373, -- [18]
391, -- [19]
445, -- [20]
451, -- [21]
483, -- [22]
485, -- [23]
500, -- [24]
503, -- [25]
678, -- [26]
},
["MissionsInfo"] = {
[269] = {
["successChance"] = 100,
["followers"] = {
413, -- [1]
384, -- [2]
},
},
[179] = {
["successChance"] = 100,
["followers"] = {
474, -- [1]
},
},
[362] = {
["successChance"] = 100,
["followers"] = {
182, -- [1]
},
},
[399] = {
["successChance"] = 89,
["followers"] = {
381, -- [1]
251, -- [2]
},
},
[132] = {
["successChance"] = 100,
["followers"] = {
153, -- [1]
326, -- [2]
},
},
[175] = {
["successChance"] = 100,
["followers"] = {
465, -- [1]
},
},
},
["AvailableOrderHallMissions"] = {
1589, -- [1]
1603, -- [2]
1641, -- [3]
1644, -- [4]
1648, -- [5]
1658, -- [6]
1669, -- [7]
1697, -- [8]
1698, -- [9]
1699, -- [10]
1710, -- [11]
},
["numEpicFollowers"] = 31,
["lastUpdate"] = 1602843802,
["numFollowersAtiLevel645"] = 25,
["numFollowersAtiLevel630"] = 27,
["numFollowersAtiLevel615"] = 28,
["AbilityCounters"] = {
5, -- [1]
7, -- [2]
5, -- [3]
3, -- [4]
nil, -- [5]
13, -- [6]
9, -- [7]
6, -- [8]
6, -- [9]
13, -- [10]
},
["Followers"] = {
[179] = {
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:645:126:125:0:0:76:232:65:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[182] = {
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:160:104:0:0:221:41:66:0:0|h[Shelly Hamby]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[184] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:184:4:40:630:102:122:0:0:57:49:39:0:0|h[Apprentice Artificer Andren]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:630:115:116:0:0:231:8:69:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[154] = {
["link"] = "|cffa335ee|Hgarrfollower:154:4:40:675:172:173:0:0:68:8:76:0:0|h[Magister Serena]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[671] = {
["link"] = "|cffffffff|Hgarrfollower:671:1:35:700:517:0:0:0:0:0:0:0:0|h[Squad of Archers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[251] = {
["link"] = "|cffa335ee|Hgarrfollower:251:4:40:675:132:138:0:0:40:41:45:0:0|h[Seline Keihl]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[801] = {
["link"] = "|cffffffff|Hgarrfollower:801:1:35:700:517:0:0:0:0:0:0:0:0|h[Squad of Archers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[803] = {
["link"] = "|cffffffff|Hgarrfollower:803:1:35:700:517:0:0:0:0:0:0:0:0|h[Squad of Archers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[742] = {
["link"] = "|cffa335ee|Hgarrfollower:742:6:45:900:449:516:0:0:714:758:684:0:365|h[Loren Stormhoof]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[190] = {
["isInactive"] = true,
["link"] = "|cff1eff00|Hgarrfollower:190:2:40:600:171:0:0:0:49:0:0:0:0|h[Image of Archmage Vargoth]|h|r",
["xp"] = 0,
["levelXP"] = 60000,
},
[746] = {
["link"] = "|cffa335ee|Hgarrfollower:746:6:45:900:449:530:0:0:758:716:684:0:366|h[Addie Fizzlebog]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[748] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:748:4:45:900:447:528:0:0:758:756:0:0:365|h[Halduron Brightwing]|h|r",
["xp"] = 128040,
["levelXP"] = 200000,
},
[442] = {
["link"] = "|cffa335ee|Hgarrfollower:442:4:40:675:143:142:0:0:53:64:67:0:0|h[Kitara Mae]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[192] = {
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:160:104:0:0:57:42:40:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[381] = {
["link"] = "|cffa335ee|Hgarrfollower:381:4:40:675:154:155:0:0:65:63:68:0:0|h[Stormsinger Taalos]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[225] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:225:4:40:600:120:100:0:0:60:45:68:0:0|h[Aknor Steelbringer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[384] = {
["link"] = "|cffa335ee|Hgarrfollower:384:4:40:675:106:158:0:0:29:256:76:0:0|h[Fern Greenfoot]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:108:182:0:0:232:314:9:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[324] = {
["link"] = "|cffa335ee|Hgarrfollower:324:4:40:675:126:128:0:0:67:43:40:0:0|h[Raquel Deyling]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[326] = {
["link"] = "|cffa335ee|Hgarrfollower:326:4:40:675:125:128:0:0:67:256:44:0:0|h[Bernhard Hammerdown]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[453] = {
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:160:159:0:0:48:40:79:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:160:105:0:0:49:221:79:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[247] = {
["link"] = "|cffa335ee|Hgarrfollower:247:4:40:675:139:182:0:0:53:79:76:0:0|h[Kihra]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[194] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:194:4:40:615:134:137:0:0:228:9:45:0:0|h[Phylarch the Evergreen]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[177] = {
["link"] = "|cffa335ee|Hgarrfollower:177:4:40:675:131:124:0:0:79:36:9:0:0|h[Croman]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[593] = {
["link"] = "|cffa335ee|Hgarrfollower:593:6:45:900:447:770:0:0:759:910:685:0:364|h[Emmarel Shadewarden]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[744] = {
["isInactive"] = true,
["link"] = "|cffffffff|Hgarrfollower:744:1:45:900:448:0:0:0:0:0:0:0:364|h[Beastmaster Hilaire]|h|r",
["xp"] = 5711,
["levelXP"] = 8000,
},
[271] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:271:4:40:645:103:101:0:0:61:314:37:0:0|h[Catherine Magruder]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:10:148:0:0:314:45:39:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[465] = {
["link"] = "|cffa335ee|Hgarrfollower:465:4:40:675:159:161:0:0:248:256:49:0:0|h[Harrison Jones]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[202] = {
["link"] = "|cffa335ee|Hgarrfollower:202:4:40:645:167:103:0:0:227:80:39:0:0|h[Nat Pagle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[171] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:171:4:40:675:122:6:0:0:61:68:77:0:0|h[Pleasure-Bot 8000]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[203] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:203:4:40:600:122:6:0:0:55:77:76:0:0|h[Meatball]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[466] = {
["link"] = "|cffff8000|Hgarrfollower:466:5:40:675:160:104:0:0:47:63:68:0:0|h[Garona Halforcen]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[468] = {
["link"] = "|cffa335ee|Hgarrfollower:468:4:40:675:178:181:0:0:303:67:65:0:0|h[Oronok Torn-heart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[342] = {
["link"] = "|cffa335ee|Hgarrfollower:342:4:40:600:10:11:0:0:52:48:41:0:0|h[\"Doc\" Schweitzer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[224] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:224:3:40:600:120:0:0:0:80:42:0:0:0|h[Talon Guard Kurekk]|h|r",
["xp"] = 0,
["levelXP"] = 120000,
},
[743] = {
["link"] = "|cffa335ee|Hgarrfollower:743:6:45:900:448:525:0:0:686:905:911:0:366|h[Rexxar]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[745] = {
["link"] = "|cffa335ee|Hgarrfollower:745:6:45:900:448:529:0:0:715:906:685:0:365|h[Hemet Nesingwary]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[747] = {
["link"] = "|cffa335ee|Hgarrfollower:747:6:45:900:449:526:0:0:684:758:685:0:364|h[Huntsman Blake]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[812] = {
["link"] = "|cff1eff00|Hgarrfollower:812:2:35:700:519:520:0:0:0:0:0:0:0|h[Pathfinders]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[474] = {
["link"] = "|cffa335ee|Hgarrfollower:474:4:40:645:121:102:0:0:244:79:232:0:0|h[Ariok]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:600:102:122:0:0:56:9:37:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[413] = {
["link"] = "|cffa335ee|Hgarrfollower:413:4:40:675:120:100:0:0:232:4:256:0:0|h[Daniel Montoy]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[209] = {
["isInactive"] = true,
["link"] = "|cff1eff00|Hgarrfollower:209:2:38:600:114:0:0:0:314:0:0:0:0|h[Abu'gar]|h|r",
["xp"] = 0,
["levelXP"] = 5400,
},
[996] = {
["link"] = "|cffa335ee|Hgarrfollower:996:6:45:900:447:822:0:0:759:684:716:0:366|h[Nighthuntress Syrenne]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[217] = {
["link"] = "|cffa335ee|Hgarrfollower:217:4:40:645:138:108:0:0:221:8:67:0:0|h[Thisalee Crow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
},
["Traits"] = {
[4] = 1,
[76] = 5,
[8] = 3,
[39] = 3,
[47] = 1,
[55] = 1,
[63] = 2,
[79] = 5,
[48] = 2,
[56] = 1,
[64] = 1,
[221] = 3,
[314] = 4,
[65] = 3,
[41] = 3,
[49] = 4,
[57] = 2,
[66] = 1,
[29] = 1,
[67] = 5,
[42] = 2,
[228] = 1,
[68] = 5,
[69] = 1,
[231] = 1,
[232] = 4,
[227] = 1,
[80] = 2,
[244] = 1,
[36] = 1,
[44] = 1,
[52] = 1,
[60] = 1,
[303] = 1,
[248] = 1,
[43] = 1,
[9] = 4,
[37] = 2,
[45] = 4,
[53] = 2,
[61] = 2,
[256] = 4,
[40] = 4,
[77] = 2,
},
["numFollowers"] = 35,
["Abilities"] = {
[106] = 1,
[122] = 4,
[148] = 1,
[181] = 1,
[6] = 2,
[108] = 2,
[124] = 1,
[10] = 2,
[125] = 2,
[154] = 1,
[155] = 1,
[126] = 2,
[158] = 1,
[159] = 2,
[128] = 2,
[160] = 5,
[161] = 1,
[131] = 1,
[114] = 1,
[132] = 1,
[115] = 1,
[134] = 1,
[100] = 2,
[116] = 1,
[11] = 1,
[137] = 1,
[138] = 2,
[102] = 3,
[171] = 1,
[172] = 1,
[103] = 2,
[173] = 1,
[142] = 1,
[167] = 1,
[143] = 1,
[120] = 3,
[101] = 1,
[182] = 2,
[105] = 1,
[121] = 1,
[139] = 1,
[178] = 1,
[104] = 3,
},
["numFollowersAtiLevel675"] = 20,
["AvailableWarCampaignMissions"] = {
1882, -- [1]
1892, -- [2]
1893, -- [3]
1901, -- [4]
1918, -- [5]
2140, -- [6]
},
},
["Default.Neptulon.Shreduction"] = {
["lastUpdate"] = 1602837435,
["AvailableWarCampaignMissions"] = {
2094, -- [1]
1932, -- [2]
1921, -- [3]
1923, -- [4]
2078, -- [5]
1946, -- [6]
},
},
["Default.Darksorrow.Shreduction"] = {
["lastUpdate"] = 1603036276,
["lastResourceCollection"] = 1601737936,
},
["Default.Darksorrow.Bonniè"] = {
["numRareFollowers"] = 6,
["numFollowersAtiLevel675"] = 23,
["numFollowersAtiLevel660"] = 23,
["AvailableMissions"] = {
115, -- [1]
131, -- [2]
132, -- [3]
159, -- [4]
169, -- [5]
173, -- [6]
183, -- [7]
185, -- [8]
204, -- [9]
245, -- [10]
256, -- [11]
261, -- [12]
273, -- [13]
276, -- [14]
278, -- [15]
287, -- [16]
299, -- [17]
373, -- [18]
396, -- [19]
449, -- [20]
471, -- [21]
483, -- [22]
492, -- [23]
503, -- [24]
673, -- [25]
683, -- [26]
},
["MissionsInfo"] = {
[1625] = {
["successChance"] = 200,
["followers"] = {
838, -- [1]
1003, -- [2]
906, -- [3]
},
},
},
["AvailableOrderHallMissions"] = {
1592, -- [1]
1603, -- [2]
1631, -- [3]
1640, -- [4]
1648, -- [5]
1657, -- [6]
1659, -- [7]
1709, -- [8]
},
["ActiveOrderHallMissions"] = {
1625, -- [1]
},
["numEpicFollowers"] = 38,
["hasUpgradedResourceCollection"] = true,
["lastUpdate"] = 1603039357,
["numFollowersAtiLevel645"] = 31,
["numFollowersAtiLevel630"] = 34,
["AvailableWarCampaignMissions"] = {
1858, -- [1]
1887, -- [2]
1889, -- [3]
1903, -- [4]
1914, -- [5]
2135, -- [6]
2152, -- [7]
},
["AbilityCounters"] = {
9, -- [1]
6, -- [2]
5, -- [3]
5, -- [4]
nil, -- [5]
12, -- [6]
13, -- [7]
12, -- [8]
11, -- [9]
12, -- [10]
},
["Followers"] = {
[179] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:179:3:40:615:126:0:0:0:59:45:0:0:0|h[Artificer Romuul]|h|r",
["xp"] = 80656,
["levelXP"] = 120000,
},
[211] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:211:4:40:675:163:101:0:0:63:67:38:0:0|h[Glirin]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[243] = {
["link"] = "|cffa335ee|Hgarrfollower:243:4:40:675:118:114:0:0:65:63:38:0:0|h[Ultan Blackgorge]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[357] = {
["link"] = "|cffa335ee|Hgarrfollower:357:4:40:675:148:150:0:0:79:65:232:0:0|h[Fasani]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[421] = {
["link"] = "|cffa335ee|Hgarrfollower:421:4:40:675:122:120:0:0:66:37:256:0:0|h[Kiruud the Relentless]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[584] = {
["link"] = "|cffa335ee|Hgarrfollower:584:6:45:900:444:764:0:0:758:744:684:0:361|h[Thassarian]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[182] = {
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:161:159:0:0:221:63:41:0:0|h[Shelly Hamby]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[905] = {
["link"] = "|cff1eff00|Hgarrfollower:905:2:35:700:619:0:0:0:0:0:0:0:362|h[Ebon Ravagers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[183] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:183:4:40:654:157:158:0:0:58:79:4:0:0|h[Rulkan]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:653:115:117:0:0:231:46:221:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[184] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:184:4:40:675:102:120:0:0:236:46:256:0:0|h[Apprentice Artificer Andren]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:105:161:0:0:256:69:45:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[366] = {
["link"] = "|cffa335ee|Hgarrfollower:366:4:40:675:104:160:0:0:79:43:66:0:0|h[Peng Stealthpaw]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[897] = {
["link"] = "|cffffffff|Hgarrfollower:897:1:35:700:617:0:0:0:0:0:0:0:0|h[Pack of Ghouls]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[854] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:854:4:45:900:446:626:0:0:742:756:0:0:361|h[Amal'thazad]|h|r",
["xp"] = 0,
["levelXP"] = 200000,
},
[155] = {
["isInactive"] = true,
["link"] = "|cff1eff00|Hgarrfollower:155:2:34:600:6:0:0:0:48:0:0:0:0|h[Miall]|h|r",
["xp"] = 0,
["levelXP"] = 2000,
},
[180] = {
["link"] = "|cffa335ee|Hgarrfollower:180:4:40:600:11:150:0:0:53:45:256:0:0|h[Fiona]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[219] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:219:4:40:645:106:155:0:0:231:36:49:0:0|h[Leorajh]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[942] = {
["link"] = "|cff0070dd|Hgarrfollower:942:3:35:700:778:781:0:0:0:0:0:0:0|h[Abomination]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[157] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:157:4:40:630:102:121:0:0:52:77:9:0:0|h[Lantresor of the Blade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1003] = {
["link"] = "|cffa335ee|Hgarrfollower:1003:6:45:900:446:829:0:0:745:758:684:0:362|h[Minerva Ravensorrow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[375] = {
["link"] = "|cffa335ee|Hgarrfollower:375:4:40:675:105:160:0:0:52:256:68:0:0|h[Lorcan Flintedge]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[376] = {
["link"] = "|cffa335ee|Hgarrfollower:376:4:40:600:159:161:0:0:60:77:43:0:0|h[Kymba Quickwidget]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[159] = {
["link"] = "|cffa335ee|Hgarrfollower:159:4:40:675:165:166:0:0:79:314:43:0:0|h[Rangari Kaalya]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[218] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:218:3:37:600:148:0:0:0:231:80:0:0:0|h[Talonpriest Ishaal]|h|r",
["xp"] = 0,
["levelXP"] = 4000,
},
[195] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:195:3:40:630:160:0:0:0:77:38:0:0:0|h[Weldon Barov]|h|r",
["xp"] = 8340,
["levelXP"] = 120000,
},
[192] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:645:160:104:0:0:57:63:37:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[224] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:224:3:40:600:120:0:0:0:54:63:0:0:0|h[Talon Guard Kurekk]|h|r",
["xp"] = 0,
["levelXP"] = 120000,
},
[99] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:99:4:40:645:182:108:0:0:67:41:45:0:0|h[Renthal Bloodfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[839] = {
["link"] = "|cffa335ee|Hgarrfollower:839:6:45:900:623:624:0:0:742:683:906:0:363|h[High Inquisitor Whitemane]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[194] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:194:3:40:630:134:0:0:0:228:36:0:0:0|h[Phylarch the Evergreen]|h|r",
["xp"] = 81092,
["levelXP"] = 120000,
},
[459] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:459:4:40:653:11:148:0:0:43:80:9:0:0|h[Cleric Maluuf]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:654:108:134:0:0:52:68:45:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[387] = {
["link"] = "|cffa335ee|Hgarrfollower:387:4:40:675:157:106:0:0:79:44:63:0:0|h[Ebba Stormfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[894] = {
["link"] = "|cff1eff00|Hgarrfollower:894:2:35:700:619:0:0:0:0:0:0:0:363|h[Ebon Ravagers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[896] = {
["link"] = "|cffffffff|Hgarrfollower:896:1:35:700:617:0:0:0:0:0:0:0:0|h[Pack of Ghouls]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[453] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:105:162:0:0:62:76:63:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[229] = {
["link"] = "|cffa335ee|Hgarrfollower:229:4:40:675:114:118:0:0:80:79:65:0:0|h[Torin Coalheart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[455] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:455:4:40:618:173:172:0:0:9:48:37:0:0|h[Millhouse Manastorm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[267] = {
["link"] = "|cffa335ee|Hgarrfollower:267:4:40:675:134:136:0:0:77:64:80:0:0|h[Permelia]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[906] = {
["link"] = "|cff1eff00|Hgarrfollower:906:2:35:700:619:0:0:0:0:0:0:0:363|h[Ebon Ravagers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[662] = {
["link"] = "|cffffffff|Hgarrfollower:662:1:35:700:617:0:0:0:0:0:0:0:0|h[Pack of Ghouls]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[270] = {
["link"] = "|cffa335ee|Hgarrfollower:270:4:40:675:163:101:0:0:252:256:45:0:0|h[Gabriel Bybee]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[855] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:855:6:45:900:444:627:0:0:756:682:745:0:363|h[Highlord Darion Mograine]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[599] = {
["link"] = "|cffa335ee|Hgarrfollower:599:6:45:900:445:628:0:0:907:676:905:0:362|h[Koltira Deathweaver]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[853] = {
["link"] = "|cffa335ee|Hgarrfollower:853:6:45:900:444:625:0:0:909:744:745:0:362|h[Rottgut]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:10:0:0:67:232:69:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[402] = {
["link"] = "|cffa335ee|Hgarrfollower:402:4:40:675:174:179:0:0:46:256:36:0:0|h[Humbolt Briarblack]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[465] = {
["link"] = "|cffa335ee|Hgarrfollower:465:4:40:675:105:104:0:0:248:256:232:0:0|h[Harrison Jones]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[466] = {
["link"] = "|cffff8000|Hgarrfollower:466:5:40:675:160:104:0:0:47:68:66:0:0|h[Garona Halforcen]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[204] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:622:122:100:0:0:58:80:38:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[468] = {
["link"] = "|cffa335ee|Hgarrfollower:468:4:40:645:178:181:0:0:303:314:80:0:0|h[Oronok Torn-heart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[205] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:205:4:36:600:11:151:0:0:37:46:39:0:0|h[Soulbinder Tuulani]|h|r",
["xp"] = 0,
["levelXP"] = 3500,
},
[237] = {
["link"] = "|cffa335ee|Hgarrfollower:237:4:40:675:117:118:0:0:36:80:256:0:0|h[Arebia Wintercall]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[586] = {
["link"] = "|cffa335ee|Hgarrfollower:586:6:45:900:446:621:0:0:759:910:744:0:363|h[Nazgrim]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[838] = {
["link"] = "|cffa335ee|Hgarrfollower:838:6:45:900:445:622:0:0:758:684:906:0:361|h[Thoras Trollbane]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[440] = {
["link"] = "|cffa335ee|Hgarrfollower:440:4:40:675:143:140:0:0:221:79:45:0:0|h[Orrindis Raindrinker]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[474] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:474:4:40:600:120:122:0:0:244:46:37:0:0|h[Ariok]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:600:102:120:0:0:56:77:7:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[177] = {
["link"] = "|cffa335ee|Hgarrfollower:177:4:40:675:124:131:0:0:79:37:236:0:0|h[Croman]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[209] = {
["isInactive"] = true,
["link"] = "|cff0070dd|Hgarrfollower:209:3:40:622:114:0:0:0:4:8:0:0:0|h[Abu'gar]|h|r",
["xp"] = 69757,
["levelXP"] = 120000,
},
[178] = {
["link"] = "|cffa335ee|Hgarrfollower:178:4:40:675:126:131:0:0:79:69:7:0:0|h[Leeroy Jenkins]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[895] = {
["link"] = "|cffffffff|Hgarrfollower:895:1:35:700:617:0:0:0:0:0:0:0:0|h[Pack of Ghouls]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
},
["Traits"] = {
[38] = 4,
[46] = 5,
[54] = 1,
[4] = 2,
[76] = 1,
[7] = 2,
[8] = 1,
[77] = 5,
[47] = 1,
[63] = 7,
[79] = 9,
[48] = 2,
[56] = 1,
[64] = 1,
[80] = 7,
[314] = 2,
[65] = 3,
[41] = 2,
[49] = 1,
[57] = 1,
[256] = 9,
[67] = 3,
[228] = 1,
[68] = 3,
[69] = 3,
[231] = 3,
[303] = 1,
[232] = 3,
[244] = 1,
[39] = 1,
[248] = 1,
[66] = 3,
[36] = 4,
[44] = 1,
[52] = 3,
[236] = 2,
[60] = 1,
[62] = 1,
[58] = 2,
[59] = 1,
[37] = 6,
[45] = 7,
[53] = 1,
[252] = 1,
[221] = 3,
[9] = 3,
[43] = 4,
},
["numFollowers"] = 46,
["Abilities"] = {
[106] = 2,
[122] = 3,
[148] = 4,
[181] = 1,
[150] = 2,
[182] = 1,
[108] = 2,
[124] = 1,
[10] = 1,
[155] = 1,
[126] = 2,
[157] = 2,
[158] = 1,
[159] = 2,
[160] = 5,
[161] = 3,
[162] = 1,
[131] = 2,
[163] = 2,
[115] = 1,
[134] = 3,
[166] = 1,
[100] = 1,
[136] = 1,
[11] = 3,
[101] = 2,
[117] = 2,
[102] = 3,
[118] = 3,
[140] = 1,
[172] = 1,
[114] = 3,
[173] = 1,
[151] = 1,
[174] = 1,
[104] = 4,
[120] = 5,
[6] = 1,
[143] = 1,
[105] = 4,
[121] = 1,
[179] = 1,
[178] = 1,
[165] = 1,
},
["BFAFollowers"] = {
[1177] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
},
[1178] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1178:3:50:800:1084:1138:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
},
[1179] = {
["link"] = "|cff0070dd|Hgarrfollower:1179:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1182:5:50:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
},
[1184] = {
["levelXP"] = 2000,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1184:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
},
[1185] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1185:1:50:800:1085:0:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
},
[1062] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1062:5:50:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 2000,
},
[1064] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1064:1:50:1:1085:0:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
},
[1065] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1065:5:50:800:1131:1087:0:0:1157:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
},
[1066] = {
["link"] = "|cff0070dd|Hgarrfollower:1066:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
["xp"] = 0,
["levelXP"] = 2000,
},
[1067] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1067:2:50:1:1084:1138:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1068] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1068:5:50:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
},
[1069] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1069:5:50:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
},
[1070] = {
["link"] = "|cff0070dd|Hgarrfollower:1070:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1071] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1071:1:50:800:1084:0:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1072] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1072:5:50:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
},
[1073] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1073:3:50:800:1084:1138:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
},
},
["numFollowersAtiLevel615"] = 38,
},
["Default.Neptulon.Macked"] = {
["lastUpdate"] = 1602838227,
},
["Default.Neptulon.Zippy"] = {
["lastUpdate"] = 1602837678,
},
["Default.Genjuros.Absa"] = {
["lastUpdate"] = 1603014160,
},
["Default.Neptulon.Grimsheepér"] = {
["lastUpdate"] = 1602837087,
["ActiveMissions"] = {
118, -- [1]
119, -- [2]
130, -- [3]
159, -- [4]
176, -- [5]
179, -- [6]
189, -- [7]
192, -- [8]
242, -- [9]
273, -- [10]
285, -- [11]
663, -- [12]
},
["AvailableMissions"] = {
170, -- [1]
161, -- [2]
156, -- [3]
168, -- [4]
245, -- [5]
364, -- [6]
258, -- [7]
262, -- [8]
300, -- [9]
267, -- [10]
120, -- [11]
358, -- [12]
276, -- [13]
271, -- [14]
277, -- [15]
220, -- [16]
214, -- [17]
298, -- [18]
394, -- [19]
313, -- [20]
373, -- [21]
429, -- [22]
381, -- [23]
503, -- [24]
682, -- [25]
},
["MissionsInfo"] = {
[118] = {
["successChance"] = 100,
["followers"] = {
426, -- [1]
253, -- [2]
374, -- [3]
},
},
[176] = {
["successChance"] = 100,
["followers"] = {
277, -- [1]
},
},
[192] = {
["successChance"] = 100,
["followers"] = {
446, -- [1]
},
},
[119] = {
["successChance"] = 100,
["followers"] = {
463, -- [1]
216, -- [2]
},
},
[663] = {
["successChance"] = 94,
["followers"] = {
452, -- [1]
398, -- [2]
237, -- [3]
},
},
[179] = {
["successChance"] = 100,
["followers"] = {
263, -- [1]
},
},
[159] = {
["successChance"] = 100,
["followers"] = {
270, -- [1]
},
},
[285] = {
["successChance"] = 88,
["followers"] = {
381, -- [1]
89, -- [2]
},
},
[1331] = {
["successChance"] = 114,
["followers"] = {
717, -- [1]
716, -- [2]
814, -- [3]
},
},
[189] = {
["successChance"] = 100,
["followers"] = {
111, -- [1]
},
},
[242] = {
["successChance"] = 94,
["followers"] = {
301, -- [1]
389, -- [2]
},
},
[130] = {
["successChance"] = 100,
["followers"] = {
34, -- [1]
338, -- [2]
},
},
[273] = {
["successChance"] = 100,
["followers"] = {
427, -- [1]
194, -- [2]
238, -- [3]
},
},
},
["ActiveOrderHallMissions"] = {
1331, -- [1]
},
},
["Default.Genjuros.Ohderp"] = {
["lastUpdate"] = 1603014350,
["lastResourceCollection"] = 1598535227,
},
["Default.Genjuros.Freeboost"] = {
["lastUpdate"] = 1602838840,
["Followers"] = {
[880] = {
["link"] = "|cffffffff|Hgarrfollower:880:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[595] = {
["link"] = "|cffffffff|Hgarrfollower:595:1:36:760:462:0:0:0:0:0:0:0:358|h[Kayn Sunfury]|h|r",
["xp"] = 312,
["levelXP"] = 400,
},
[879] = {
["link"] = "|cffffffff|Hgarrfollower:879:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[722] = {
["link"] = "|cffffffff|Hgarrfollower:722:1:36:760:463:0:0:0:0:0:0:0:359|h[Asha Ravensong]|h|r",
["xp"] = 212,
["levelXP"] = 400,
},
[878] = {
["link"] = "|cffffffff|Hgarrfollower:878:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
},
["MissionsInfo"] = {
[1055] = {
["successChance"] = 90,
["followers"] = {
595, -- [1]
722, -- [2]
},
},
},
["AvailableOrderHallMissions"] = {
1156, -- [1]
1331, -- [2]
1698, -- [3]
1699, -- [4]
1697, -- [5]
},
["ActiveOrderHallMissions"] = {
1055, -- [1]
},
["AvailableWarCampaignMissions"] = {
1892, -- [1]
1894, -- [2]
1896, -- [3]
2096, -- [4]
},
},
["Default.Darksorrow.Nedbank"] = {
["numFollowersAtiLevel675"] = 22,
["numFollowersAtiLevel660"] = 22,
["AvailableMissions"] = {
484, -- [1]
683, -- [2]
428, -- [3]
493, -- [4]
315, -- [5]
336, -- [6]
476, -- [7]
156, -- [8]
190, -- [9]
160, -- [10]
163, -- [11]
245, -- [12]
118, -- [13]
663, -- [14]
132, -- [15]
259, -- [16]
264, -- [17]
271, -- [18]
273, -- [19]
287, -- [20]
283, -- [21]
674, -- [22]
673, -- [23]
159, -- [24]
373, -- [25]
391, -- [26]
396, -- [27]
},
["AvailableOrderHallMissions"] = {
1704, -- [1]
1697, -- [2]
1698, -- [3]
1591, -- [4]
1633, -- [5]
1648, -- [6]
1637, -- [7]
1600, -- [8]
1655, -- [9]
1671, -- [10]
},
["numEpicFollowers"] = 26,
["lastUpdate"] = 1603037515,
["numFollowersAtiLevel645"] = 22,
["numFollowersAtiLevel630"] = 22,
["AbilityCounters"] = {
5, -- [1]
8, -- [2]
1, -- [3]
2, -- [4]
nil, -- [5]
11, -- [6]
8, -- [7]
7, -- [8]
5, -- [9]
5, -- [10]
},
["Followers"] = {
[761] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:761:6:45:900:467:550:0:0:758:684:710:0:348|h[Meryl Felstorm]|h|r",
},
[179] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:127:128:0:0:53:63:80:0:0|h[Artificer Romuul]|h|r",
},
[180] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:180:4:40:675:10:150:0:0:29:48:37:0:0|h[Fiona]|h|r",
},
[357] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:357:4:40:675:151:10:0:0:256:80:48:0:0|h[Fasani]|h|r",
},
[423] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:423:4:40:675:6:122:0:0:41:255:76:0:0|h[Tell'machrim Stormvigil]|h|r",
},
[716] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:716:6:45:900:466:769:0:0:685:683:711:0:346|h[Archmage Kalec]|h|r",
},
[247] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:247:4:40:675:139:182:0:0:67:44:69:0:0|h[Kihra]|h|r",
},
[216] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:114:0:0:231:232:4:0:0|h[Delvar Ironfist]|h|r",
},
[185] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:185:4:40:600:101:166:0:0:65:45:40:0:0|h[Rangari Chel]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[726] = {
["levelXP"] = 8000,
["link"] = "|cffffffff|Hgarrfollower:726:1:45:810:466:0:0:0:0:0:0:0:347|h[Esara Verrinde]|h|r",
["xp"] = 1554,
["isInactive"] = true,
},
[155] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:155:4:40:675:102:6:0:0:66:46:69:0:0|h[Miall]|h|r",
},
[994] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:994:6:45:900:819:818:821:0:758:711:908:0:347|h[Aethas Sunreaver]|h|r",
},
[442] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:442:4:40:675:145:143:0:0:60:38:48:0:0|h[Kitara Mae]|h|r",
},
[192] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:160:161:0:0:57:9:221:0:0|h[Kimzee Pinchwhistle]|h|r",
},
[823] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:823:2:35:700:551:552:0:0:0:0:0:0:0|h[Kirin Tor Invokers]|h|r",
},
[762] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:762:6:45:900:467:549:0:0:712:414:415:0:346|h[Archmage Vargoth]|h|r",
},
[34] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:600:108:182:0:0:53:48:256:0:0|h[Qiana Moonshadow]|h|r",
},
[261] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:261:4:40:675:132:108:0:0:66:236:63:0:0|h[Ursila Hudsen]|h|r",
},
[768] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:768:2:35:700:551:552:0:0:0:0:0:0:0|h[Kirin Tor Invokers]|h|r",
},
[453] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:105:104:0:0:62:4:80:0:0|h[Hulda Shadowblade]|h|r",
},
[717] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:717:6:45:900:465:545:0:0:683:758:712:0:348|h[Archmage Modera]|h|r",
},
[227] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:227:4:40:675:115:117:0:0:67:44:43:0:0|h[Adelaide Kane]|h|r",
},
[109] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:109:4:40:675:158:154:0:0:67:64:66:0:0|h[Nudan]|h|r",
},
[117] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:117:4:40:675:117:116:0:0:66:49:221:0:0|h[Mirran Lichbane]|h|r",
},
[725] = {
["levelXP"] = 8000,
["link"] = "|cffffffff|Hgarrfollower:725:1:45:810:465:0:0:0:0:0:0:0:347|h[Ravandwyr]|h|r",
["xp"] = 926,
["isInactive"] = true,
},
[153] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:159:104:0:0:54:46:64:0:0|h[Bruma Swiftstone]|h|r",
},
[463] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:10:0:0:63:36:80:0:0|h[Daleera Moonfang]|h|r",
},
[183] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:183:4:40:675:157:154:0:0:55:76:66:0:0|h[Rulkan]|h|r",
},
[208] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:600:102:120:0:0:56:7:8:0:0|h[Ahm]|h|r",
},
[87] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:87:4:40:675:100:6:0:0:256:64:41:0:0|h[Ashlen Swordbreaker]|h|r",
},
[204] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:675:122:121:0:0:58:66:45:0:0|h[Admiral Taylor]|h|r",
},
[417] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:417:4:40:600:121:120:0:0:61:8:77:0:0|h[Bridgette Hicks]|h|r",
},
[724] = {
["levelXP"] = 20000,
["link"] = "|cff1eff00|Hgarrfollower:724:2:45:810:465:547:0:0:0:0:0:0:346|h[Arcane Destroyer]|h|r",
["xp"] = 19910,
["isInactive"] = true,
},
[995] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:995:6:45:900:466:820:0:0:711:758:414:0:348|h[The Great Akazamzarak]|h|r",
},
[182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:160:105:0:0:60:64:77:0:0|h[Shelly Hamby]|h|r",
},
[723] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:723:6:45:900:467:546:0:0:676:679:911:0:347|h[Millhouse Manastorm]|h|r",
},
[284] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:284:4:40:675:165:164:0:0:256:63:69:0:0|h[Kathrena Winterwisp]|h|r",
},
[814] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:814:1:35:700:553:0:0:0:0:0:0:0:0|h[Water Elemental]|h|r",
},
[816] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:816:1:35:700:553:0:0:0:0:0:0:0:0|h[Water Elemental]|h|r",
},
[815] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:815:1:35:700:553:0:0:0:0:0:0:0:0|h[Water Elemental]|h|r",
},
[414] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:414:4:40:675:100:122:0:0:67:79:45:0:0|h[Karyn Whitmoor]|h|r",
},
[660] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:660:1:35:700:553:0:0:0:0:0:0:0:0|h[Water Elemental]|h|r",
},
[824] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:824:2:35:700:551:552:0:0:0:0:0:0:0|h[Kirin Tor Invokers]|h|r",
},
},
["Traits"] = {
[38] = 1,
[46] = 2,
[54] = 1,
[4] = 2,
[76] = 2,
[7] = 1,
[8] = 2,
[77] = 2,
[55] = 1,
[63] = 4,
[40] = 1,
[48] = 4,
[56] = 1,
[64] = 4,
[221] = 2,
[65] = 1,
[41] = 2,
[49] = 1,
[57] = 1,
[256] = 4,
[29] = 1,
[67] = 4,
[58] = 1,
[69] = 3,
[231] = 1,
[232] = 1,
[36] = 1,
[44] = 2,
[9] = 1,
[236] = 1,
[80] = 4,
[66] = 6,
[43] = 1,
[62] = 1,
[37] = 1,
[45] = 3,
[53] = 2,
[61] = 1,
[255] = 1,
[79] = 1,
[60] = 2,
},
["numFollowers"] = 26,
["numFollowersAtiLevel615"] = 22,
["Abilities"] = {
[122] = 3,
[148] = 1,
[150] = 1,
[6] = 3,
[108] = 2,
[10] = 3,
[154] = 2,
[157] = 1,
[127] = 1,
[158] = 1,
[159] = 1,
[128] = 1,
[160] = 2,
[161] = 1,
[114] = 1,
[132] = 1,
[164] = 1,
[115] = 2,
[166] = 1,
[100] = 2,
[116] = 1,
[101] = 1,
[117] = 2,
[102] = 2,
[104] = 2,
[143] = 1,
[120] = 2,
[165] = 1,
[105] = 2,
[145] = 1,
[121] = 2,
[182] = 2,
[139] = 1,
[151] = 1,
},
},
["Default.Neptulon.Hanibull"] = {
["lastUpdate"] = 1602837189,
},
["Default.Darksorrow.Retnuhnomed"] = {
["numRareFollowers"] = 8,
["numFollowersAtiLevel675"] = 2,
["numFollowersAtiLevel660"] = 2,
["AvailableMissions"] = {
229, -- [1]
313, -- [2]
173, -- [3]
161, -- [4]
171, -- [5]
177, -- [6]
231, -- [7]
329, -- [8]
115, -- [9]
120, -- [10]
132, -- [11]
261, -- [12]
666, -- [13]
361, -- [14]
274, -- [15]
276, -- [16]
200, -- [17]
676, -- [18]
306, -- [19]
374, -- [20]
377, -- [21]
484, -- [22]
677, -- [23]
396, -- [24]
},
["AvailableOrderHallMissions"] = {
1682, -- [1]
1710, -- [2]
},
["numEpicFollowers"] = 1,
["lastUpdate"] = 1602836808,
["numFollowersAtiLevel645"] = 8,
["numFollowersAtiLevel630"] = 8,
["AbilityCounters"] = {
4, -- [1]
1, -- [2]
1, -- [3]
1, -- [4]
nil, -- [5]
3, -- [6]
2, -- [7]
2, -- [8]
1, -- [9]
2, -- [10]
},
["Followers"] = {
[193] = {
["link"] = "|cff0070dd|Hgarrfollower:193:3:40:645:100:0:0:0:231:68:0:0:0|h[Tormmok]|h|r",
["xp"] = 2683,
["levelXP"] = 120000,
},
[880] = {
["link"] = "|cffffffff|Hgarrfollower:880:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[170] = {
["link"] = "|cff0070dd|Hgarrfollower:170:3:40:645:160:0:0:0:62:68:0:0:0|h[Goldmane the Skinner]|h|r",
["xp"] = 21200,
["levelXP"] = 120000,
},
[402] = {
["link"] = "|cff1eff00|Hgarrfollower:402:2:36:600:179:0:0:0:256:0:0:0:0|h[Humbolt Briarblack]|h|r",
["xp"] = 1150,
["levelXP"] = 3500,
},
[209] = {
["link"] = "|cff0070dd|Hgarrfollower:209:3:40:675:114:0:0:0:256:7:0:0:0|h[Abu'gar]|h|r",
["xp"] = 13900,
["levelXP"] = 120000,
},
[665] = {
["link"] = "|cffffffff|Hgarrfollower:665:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[190] = {
["link"] = "|cff0070dd|Hgarrfollower:190:3:40:645:171:0:0:0:43:314:0:0:0|h[Image of Archmage Vargoth]|h|r",
["xp"] = 31350,
["levelXP"] = 120000,
},
[807] = {
["link"] = "|cffa335ee|Hgarrfollower:807:6:45:900:462:613:0:0:704:758:414:0:359|h[Jace Darkweaver]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cff1eff00|Hgarrfollower:34:2:37:600:108:0:0:0:57:0:0:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 2683,
["levelXP"] = 4000,
},
[189] = {
["link"] = "|cff1eff00|Hgarrfollower:189:2:39:600:122:0:0:0:201:0:0:0:0|h[Blook]|h|r",
["xp"] = 299,
["levelXP"] = 6000,
},
[331] = {
["link"] = "|cff1eff00|Hgarrfollower:331:2:31:600:127:0:0:0:256:0:0:0:0|h[Illu'mina]|h|r",
["xp"] = 50,
["levelXP"] = 800,
},
[249] = {
["link"] = "|cff0070dd|Hgarrfollower:249:3:35:600:137:0:0:0:256:79:0:0:0|h[Syverandin Yewshade]|h|r",
["xp"] = 1816,
["levelXP"] = 3000,
},
[207] = {
["link"] = "|cff0070dd|Hgarrfollower:207:3:40:645:123:0:0:0:231:48:0:0:0|h[Defender Illona]|h|r",
["xp"] = 21400,
["levelXP"] = 120000,
},
[595] = {
["link"] = "|cffa335ee|Hgarrfollower:595:6:45:900:462:767:0:0:758:684:705:0:358|h[Kayn Sunfury]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[219] = {
["link"] = "|cff0070dd|Hgarrfollower:219:3:40:675:106:0:0:0:231:256:0:0:0|h[Leorajh]|h|r",
["xp"] = 43867,
["levelXP"] = 120000,
},
[594] = {
["link"] = "|cffa335ee|Hgarrfollower:594:6:45:900:464:610:0:0:704:909:758:0:359|h[Belath Dawnblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[499] = {
["link"] = "|cffa335ee|Hgarrfollower:499:6:45:900:464:612:0:0:685:759:909:0:358|h[Allari the Souleater]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[719] = {
["link"] = "|cffa335ee|Hgarrfollower:719:6:45:900:464:608:0:0:679:676:907:0:360|h[Shade of Akama]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cff1eff00|Hgarrfollower:153:2:38:600:161:0:0:0:54:0:0:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 5283,
["levelXP"] = 5400,
},
[720] = {
["isInactive"] = true,
["link"] = "|cffffffff|Hgarrfollower:720:1:45:900:668:0:0:0:0:0:0:0:360|h[Matron Mother Malevolence]|h|r",
["xp"] = 960,
["levelXP"] = 8000,
},
[192] = {
["link"] = "|cff1eff00|Hgarrfollower:192:2:40:645:160:0:0:0:57:0:0:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 40134,
["levelXP"] = 60000,
},
[721] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:721:4:45:900:463:609:0:0:684:758:0:0:358|h[Kor'vas Bloodthorn]|h|r",
["xp"] = 0,
["levelXP"] = 200000,
},
[990] = {
["link"] = "|cffa335ee|Hgarrfollower:990:6:45:900:463:814:0:0:906:758:414:0:360|h[Lady S'theno]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[722] = {
["link"] = "|cffa335ee|Hgarrfollower:722:6:45:900:463:607:0:0:758:684:705:0:359|h[Asha Ravensong]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:645:102:122:0:0:56:8:63:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[878] = {
["link"] = "|cffffffff|Hgarrfollower:878:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[216] = {
["link"] = "|cff0070dd|Hgarrfollower:216:3:38:600:115:0:0:0:231:39:0:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 1667,
["levelXP"] = 5400,
},
[463] = {
["link"] = "|cff1eff00|Hgarrfollower:463:2:38:600:148:0:0:0:7:0:0:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 3649,
["levelXP"] = 5400,
},
[879] = {
["link"] = "|cffffffff|Hgarrfollower:879:1:35:700:603:0:0:0:0:0:0:0:0|h[Ashtongue Warriors]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
},
["Traits"] = {
[63] = 1,
[48] = 1,
[7] = 2,
[231] = 4,
[39] = 1,
[56] = 1,
[8] = 1,
[79] = 1,
[62] = 1,
[314] = 1,
[68] = 2,
[256] = 5,
[43] = 1,
[57] = 2,
[201] = 1,
[54] = 1,
},
["numFollowers"] = 16,
["numFollowersAtiLevel615"] = 8,
["Abilities"] = {
[161] = 1,
[100] = 1,
[115] = 1,
[160] = 2,
[148] = 1,
[171] = 1,
[179] = 1,
[108] = 1,
[123] = 1,
[122] = 2,
[102] = 1,
[106] = 1,
[137] = 1,
[114] = 1,
[127] = 1,
},
},
["Default.Genjuros.Drong"] = {
["lastUpdate"] = 1602838924,
},
["Default.Genjuros.Adas"] = {
["lastResourceCollection"] = 1598799001,
["lastUpdate"] = 1603015134,
["AbilityCounters"] = {
},
["Traits"] = {
},
["Abilities"] = {
},
},
["Default.Neptulon.Tulight"] = {
["lastUpdate"] = 1602838529,
},
["Default.Neptulon.Talambelen"] = {
["lastUpdate"] = 1602955209,
["Followers"] = {
[608] = {
["levelXP"] = 8000,
["link"] = "|cffffffff|Hgarrfollower:608:1:45:880:443:0:0:0:0:0:0:0:331|h[Stormcaller Mylra]|h|r",
["xp"] = 6296,
["isInactive"] = true,
},
[610] = {
["levelXP"] = 200000,
["xp"] = 77838,
["link"] = "|cffa335ee|Hgarrfollower:610:4:45:880:443:768:0:0:414:415:0:0:332|h[Consular Celestos]|h|r",
},
[612] = {
["levelXP"] = 200000,
["xp"] = 107080,
["link"] = "|cffa335ee|Hgarrfollower:612:4:45:880:441:513:0:0:911:415:0:0:332|h[Rehgar Earthfury]|h|r",
},
[614] = {
["levelXP"] = 8000,
["link"] = "|cffffffff|Hgarrfollower:614:1:45:880:442:0:0:0:0:0:0:0:332|h[Muln Earthfury]|h|r",
["xp"] = 7930,
["isInactive"] = true,
},
[785] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:785:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
},
[609] = {
["levelXP"] = 200000,
["xp"] = 73964,
["link"] = "|cffa335ee|Hgarrfollower:609:4:45:880:441:510:0:0:414:415:0:0:333|h[Duke Hydraxis]|h|r",
},
[611] = {
["levelXP"] = 1750,
["link"] = "|cffffffff|Hgarrfollower:611:1:41:760:442:0:0:0:0:0:0:0:333|h[Farseer Nobundo]|h|r",
["xp"] = 1456,
["isInactive"] = true,
},
[613] = {
["levelXP"] = 200000,
["xp"] = 23900,
["link"] = "|cffa335ee|Hgarrfollower:613:4:45:880:442:515:0:0:414:415:0:0:331|h[Baron Scaldius]|h|r",
},
[615] = {
["levelXP"] = 200000,
["xp"] = 9962,
["link"] = "|cffa335ee|Hgarrfollower:615:4:45:880:441:514:0:0:414:415:0:0:331|h[Avalanchion the Unbroken]|h|r",
},
[784] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:784:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
},
[786] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:786:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
},
[683] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:683:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
},
},
["AvailableOrderHallMissions"] = {
1505, -- [1]
1588, -- [2]
1601, -- [3]
1641, -- [4]
1657, -- [5]
1667, -- [6]
1669, -- [7]
1671, -- [8]
1682, -- [9]
1697, -- [10]
1699, -- [11]
1698, -- [12]
},
["AvailableWarCampaignMissions"] = {
1920, -- [1]
1923, -- [2]
1927, -- [3]
1937, -- [4]
1947, -- [5]
1957, -- [6]
2094, -- [7]
2146, -- [8]
},
["BFAFollowers"] = {
[1062] = {
["link"] = "|cff0070dd|Hgarrfollower:1062:3:120:800:1103:1111:0:0:1100:0:0:0:1043|h[Lilian Voss]|h|r",
["xp"] = 410,
["levelXP"] = 2000,
},
[1066] = {
["link"] = "|cff0070dd|Hgarrfollower:1066:3:120:1:1083:1139:0:0:0:0:0:0:0|h[Darkspear Shaman]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1070] = {
["link"] = "|cffffffff|Hgarrfollower:1070:1:120:1:1083:0:0:0:0:0:0:0:0|h[Silvermoon Sorceress]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1179] = {
["link"] = "|cff1eff00|Hgarrfollower:1179:2:120:800:1085:1139:0:0:0:0:0:0:0|h[Mag'har Outriders]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1067] = {
["link"] = "|cff0070dd|Hgarrfollower:1067:3:120:1:1084:1139:0:0:0:0:0:0:0|h[Shattered Hand Specialist]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1071] = {
["link"] = "|cffffffff|Hgarrfollower:1071:1:120:800:1084:0:0:0:0:0:0:0:0|h[Goblin Sappers]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1182] = {
["link"] = "|cff1eff00|Hgarrfollower:1182:2:120:800:1266:0:0:0:0:0:0:0:1042|h[Dread-Admiral Tattersail]|h|r",
["xp"] = 570,
["levelXP"] = 1500,
},
[1184] = {
["link"] = "|cffffffff|Hgarrfollower:1184:1:120:800:1085:0:0:0:0:0:0:0:0|h[Zandalari Wingriders]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1068] = {
["link"] = "|cffa335ee|Hgarrfollower:1068:4:120:800:1099:0:0:0:1100:1101:0:0:1042|h[Hobart Grapplehammer]|h|r",
["xp"] = 8299,
["levelXP"] = 30000,
},
[1072] = {
["link"] = "|cffa335ee|Hgarrfollower:1072:4:120:800:1088:1089:0:0:1100:0:0:0:1043|h[Shadow Hunter Ty'jin]|h|r",
["xp"] = 6705,
["levelXP"] = 30000,
},
[1177] = {
["link"] = "|cff1eff00|Hgarrfollower:1177:2:120:800:1083:1139:0:0:0:0:0:0:0|h[Nightborne Warpcasters]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1065] = {
["link"] = "|cffa335ee|Hgarrfollower:1065:4:120:800:1114:1094:0:0:1100:0:0:0:1062|h[Arcanist Valtrois]|h|r",
["xp"] = 8149,
["levelXP"] = 30000,
},
[1069] = {
["link"] = "|cffa335ee|Hgarrfollower:1069:4:120:800:1093:1102:0:0:1100:0:0:0:1062|h[Rexxar]|h|r",
["xp"] = 7861,
["levelXP"] = 30000,
},
[1178] = {
["link"] = "|cff0070dd|Hgarrfollower:1178:3:120:800:1084:1139:0:0:0:0:0:0:0|h[Highmountain Warbraves]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1064] = {
["link"] = "|cff0070dd|Hgarrfollower:1064:3:120:1:1085:1139:0:0:0:0:0:0:0|h[Forsaken Dreadguards]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
},
},
["Default.Darksorrow.Monawr"] = {
["BFAFollowers"] = {
[1177] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
},
[1178] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1178:1:120:800:1084:0:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
},
[1179] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1179:1:120:800:1083:0:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
},
[1182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1182:5:120:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
},
[1184] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1184:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
},
[1185] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1185:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
},
[1062] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1062:5:120:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1064] = {
["link"] = "|cff0070dd|Hgarrfollower:1064:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1065] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1065:5:120:800:1131:1087:0:0:1100:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
},
[1066] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1066:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
},
[1067] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1067:3:120:1:1084:1138:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1068] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1068:5:120:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
},
[1069] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1069:5:120:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
},
[1070] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:1070:2:120:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
},
[1071] = {
["levelXP"] = 1000,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:1071:1:120:800:1084:0:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1072] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffff8000|Hgarrfollower:1072:5:120:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
},
[1073] = {
["link"] = "|cff0070dd|Hgarrfollower:1073:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
},
["numFollowersAtiLevel660"] = 21,
["ActiveWarCampaignMissions"] = {
1886, -- [1]
1907, -- [2]
},
["ActiveMissions"] = {
191, -- [1]
254, -- [2]
308, -- [3]
335, -- [4]
385, -- [5]
396, -- [6]
398, -- [7]
669, -- [8]
},
["AvailableMissions"] = {
115, -- [1]
118, -- [2]
159, -- [3]
169, -- [4]
170, -- [5]
175, -- [6]
187, -- [7]
204, -- [8]
256, -- [9]
309, -- [10]
312, -- [11]
315, -- [12]
365, -- [13]
373, -- [14]
381, -- [15]
397, -- [16]
454, -- [17]
484, -- [18]
499, -- [19]
665, -- [20]
666, -- [21]
685, -- [22]
},
["MissionsInfo"] = {
[385] = {
["successChance"] = 100,
["followers"] = {
183, -- [1]
304, -- [2]
},
},
[396] = {
["successChance"] = 100,
["followers"] = {
388, -- [1]
393, -- [2]
},
},
[191] = {
["successChance"] = 100,
["followers"] = {
419, -- [1]
},
},
[669] = {
["successChance"] = 100,
["followers"] = {
34, -- [1]
180, -- [2]
463, -- [3]
},
},
[308] = {
["successChance"] = 100,
["followers"] = {
216, -- [1]
114, -- [2]
328, -- [3]
},
},
[254] = {
["successChance"] = 100,
["followers"] = {
184, -- [1]
396, -- [2]
249, -- [3]
},
},
[398] = {
["successChance"] = 93,
["followers"] = {
429, -- [1]
430, -- [2]
},
},
[335] = {
["successChance"] = 100,
["followers"] = {
369, -- [1]
403, -- [2]
101, -- [3]
},
},
},
["AvailableOrderHallMissions"] = {
1589, -- [1]
1634, -- [2]
1642, -- [3]
1644, -- [4]
1665, -- [5]
1671, -- [6]
1672, -- [7]
1697, -- [8]
1698, -- [9]
1699, -- [10]
1704, -- [11]
},
["numEpicFollowers"] = 26,
["lastUpdate"] = 1602842845,
["numFollowersAtiLevel645"] = 24,
["numFollowersAtiLevel630"] = 24,
["AvailableWarCampaignMissions"] = {
1883, -- [1]
1887, -- [2]
1894, -- [3]
1902, -- [4]
2071, -- [5]
2152, -- [6]
},
["AbilityCounters"] = {
4, -- [1]
6, -- [2]
6, -- [3]
2, -- [4]
nil, -- [5]
11, -- [6]
8, -- [7]
6, -- [8]
4, -- [9]
5, -- [10]
},
["Followers"] = {
[179] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:645:126:127:0:0:59:236:42:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[891] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:891:6:45:900:459:640:0:0:758:701:414:0:351|h[Valeera Sanguinar]|h|r",
},
[180] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:180:4:40:675:11:150:0:0:53:66:64:0:0|h[Fiona]|h|r",
},
[182] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:160:161:0:0:221:253:254:0:0|h[Shelly Hamby]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[779] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:779:6:45:900:460:636:0:0:758:685:759:0:350|h[Lord Jorach Ravenholdt]|h|r",
},
[907] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:907:1:35:700:633:0:0:0:0:0:0:0:0|h[Crew of Pirates]|h|r",
},
[184] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:184:4:40:675:102:121:0:0:49:48:79:0:0|h[Apprentice Artificer Andren]|h|r",
},
[216] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:114:0:0:231:4:221:0:0|h[Delvar Ironfist]|h|r",
},
[429] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:429:4:40:675:102:120:0:0:66:64:76:0:0|h[Audra Stoneshield]|h|r",
},
[430] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:430:4:40:675:6:121:0:0:65:68:9:0:0|h[Halsteth Ravenwood]|h|r",
},
[249] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:249:4:40:675:137:139:0:0:64:255:79:0:0|h[Syverandin Yewshade]|h|r",
},
[369] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:369:4:40:675:160:161:0:0:52:76:256:0:0|h[Zelena Moonbreak]|h|r",
},
[988] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:988:6:45:900:459:811:0:0:759:684:414:0:350|h[Princess Tess Greymane]|h|r",
},
[681] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:681:2:35:700:634:0:0:0:0:0:0:0:0|h[Defias Thieves]|h|r",
},
[192] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:645:160:162:0:0:254:49:37:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[114] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:114:4:40:675:165:163:0:0:66:48:77:0:0|h[Marguun]|h|r",
},
[34] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:108:132:0:0:29:63:232:0:0|h[Qiana Moonshadow]|h|r",
},
[892] = {
["levelXP"] = 200000,
["link"] = "|cffa335ee|Hgarrfollower:892:4:45:900:461:641:0:0:754:757:0:0:350|h[Taoshi]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[388] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:388:4:40:675:158:154:0:0:67:63:236:0:0|h[Fingall Flamehammer]|h|r",
},
[453] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:615:105:159:0:0:62:236:40:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[328] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:328:4:40:675:129:128:0:0:69:67:63:0:0|h[Noah Munck]|h|r",
},
[393] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:393:4:40:675:106:154:0:0:65:79:77:0:0|h[Navea the Purifier]|h|r",
},
[591] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:591:6:45:900:459:766:0:0:905:689:907:0:349|h[Vanessa VanCleef]|h|r",
},
[101] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:101:4:40:675:135:136:0:0:256:314:4:0:0|h[Rin Starsong]|h|r",
},
[912] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:912:2:35:700:634:0:0:0:0:0:0:0:0|h[Defias Thieves]|h|r",
},
[463] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:10:11:0:0:4:314:256:0:0|h[Daleera Moonfang]|h|r",
},
[153] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:615:160:104:0:0:59:7:36:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[304] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:304:4:40:675:5:171:0:0:67:49:46:0:0|h[Reina Morningchill]|h|r",
},
[403] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:403:4:40:675:174:179:0:0:79:48:256:0:0|h[Hester Blackember]|h|r",
},
[204] = {
["levelXP"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:645:122:102:0:0:44:64:49:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[183] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:183:4:40:675:157:106:0:0:55:232:79:0:0|h[Rulkan]|h|r",
},
[396] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:396:4:40:675:180:176:0:0:53:69:256:0:0|h[Iven Page]|h|r",
},
[893] = {
["levelXP"] = 200000,
["link"] = "|cffa335ee|Hgarrfollower:893:4:45:900:460:642:0:0:683:414:0:0:351|h[Master Mathias Shaw]|h|r",
["xp"] = 0,
["isInactive"] = true,
},
[419] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:419:4:40:675:6:102:0:0:64:44:256:0:0|h[Innes Shieldshatter]|h|r",
},
[778] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:778:6:45:900:461:637:0:0:684:910:759:0:351|h[Garona Halforcen]|h|r",
},
[780] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:780:6:45:900:461:638:0:0:758:685:701:0:349|h[Fleet Admiral Tethys]|h|r",
},
[890] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:890:6:45:900:460:639:0:0:759:684:699:0:349|h[Marin Noggenfogger]|h|r",
},
[208] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:675:102:100:0:0:56:42:236:0:0|h[Ahm]|h|r",
},
[911] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:911:2:35:700:634:0:0:0:0:0:0:0:0|h[Defias Thieves]|h|r",
},
[913] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:913:2:35:700:634:0:0:0:0:0:0:0:0|h[Defias Thieves]|h|r",
},
[919] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:919:1:35:700:633:0:0:0:0:0:0:0:0|h[Crew of Pirates]|h|r",
},
[918] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:918:1:35:700:633:0:0:0:0:0:0:0:0|h[Crew of Pirates]|h|r",
},
},
["Traits"] = {
[46] = 1,
[4] = 3,
[76] = 2,
[7] = 1,
[77] = 2,
[55] = 1,
[63] = 3,
[79] = 5,
[48] = 3,
[56] = 1,
[64] = 5,
[221] = 2,
[253] = 1,
[314] = 2,
[254] = 2,
[49] = 4,
[256] = 6,
[29] = 1,
[67] = 3,
[42] = 2,
[68] = 1,
[69] = 2,
[231] = 1,
[232] = 2,
[36] = 1,
[44] = 2,
[52] = 1,
[236] = 4,
[40] = 1,
[66] = 3,
[37] = 1,
[62] = 1,
[53] = 2,
[59] = 2,
[255] = 1,
[65] = 2,
[9] = 1,
},
["numFollowers"] = 26,
["Abilities"] = {
[106] = 2,
[122] = 1,
[180] = 1,
[150] = 1,
[6] = 2,
[108] = 1,
[10] = 1,
[154] = 2,
[126] = 1,
[157] = 1,
[127] = 1,
[158] = 1,
[159] = 1,
[128] = 1,
[160] = 4,
[129] = 1,
[161] = 2,
[162] = 1,
[163] = 1,
[132] = 1,
[115] = 1,
[100] = 1,
[136] = 1,
[11] = 2,
[137] = 1,
[102] = 5,
[171] = 1,
[5] = 1,
[165] = 1,
[174] = 1,
[104] = 1,
[120] = 1,
[139] = 1,
[176] = 1,
[105] = 1,
[121] = 2,
[114] = 1,
[179] = 1,
[135] = 1,
},
["numFollowersAtiLevel675"] = 21,
["numFollowersAtiLevel615"] = 26,
},
["Default.Genjuros.Classywr"] = {
["lastUpdate"] = 1603014283,
},
["Default.Neptulon.Elson"] = {
["lastUpdate"] = 1602838069,
},
["Default.Darksorrow.Dippendots"] = {
["numFollowersAtiLevel675"] = 16,
["numFollowersAtiLevel660"] = 16,
["AvailableMissions"] = {
325, -- [1]
456, -- [2]
680, -- [3]
160, -- [4]
191, -- [5]
182, -- [6]
157, -- [7]
117, -- [8]
260, -- [9]
663, -- [10]
114, -- [11]
670, -- [12]
337, -- [13]
273, -- [14]
272, -- [15]
277, -- [16]
281, -- [17]
212, -- [18]
310, -- [19]
303, -- [20]
159, -- [21]
373, -- [22]
677, -- [23]
503, -- [24]
},
["AvailableOrderHallMissions"] = {
1796, -- [1]
1752, -- [2]
1759, -- [3]
1377, -- [4]
1762, -- [5]
1767, -- [6]
1766, -- [7]
1769, -- [8]
1776, -- [9]
1774, -- [10]
},
["numEpicFollowers"] = 28,
["lastUpdate"] = 1603038248,
["numFollowersAtiLevel645"] = 19,
["numFollowersAtiLevel630"] = 23,
["numFollowersAtiLevel615"] = 25,
["AbilityCounters"] = {
4, -- [1]
7, -- [2]
3, -- [3]
3, -- [4]
nil, -- [5]
3, -- [6]
8, -- [7]
10, -- [8]
8, -- [9]
10, -- [10]
},
["Followers"] = {
[179] = {
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:126:127:0:0:59:46:66:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[765] = {
["link"] = "|cff1eff00|Hgarrfollower:765:2:35:700:487:485:0:0:0:0:0:0:0|h[Black Harvest Invokers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[767] = {
["link"] = "|cff1eff00|Hgarrfollower:767:2:35:700:487:485:0:0:0:0:0:0:0|h[Black Harvest Invokers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[649] = {
["link"] = "|cffffffff|Hgarrfollower:649:1:35:700:486:0:0:0:0:0:0:0:0|h[Pack of Imps]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[590] = {
["link"] = "|cffa335ee|Hgarrfollower:590:6:45:950:439:494:0:0:996:968:965:0:338|h[Lulubelle Fizzlebang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[184] = {
["link"] = "|cffa335ee|Hgarrfollower:184:4:40:675:121:122:0:0:65:40:67:0:0|h[Apprentice Artificer Andren]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:114:0:0:231:9:49:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1058] = {
["link"] = "|cff0070dd|Hgarrfollower:1058:3:35:700:953:978:0:0:0:0:0:0:0|h[Void-Purged Krokul]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[728] = {
["link"] = "|cffffffff|Hgarrfollower:728:1:35:700:486:0:0:0:0:0:0:0:0|h[Pack of Imps]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[155] = {
["link"] = "|cffa335ee|Hgarrfollower:155:4:40:646:6:121:0:0:64:42:79:0:0|h[Miall]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[986] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:986:6:45:950:805:806:807:0:970:968:999:0:0|h[Meatball]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[616] = {
["link"] = "|cffa335ee|Hgarrfollower:616:6:45:950:440:772:0:0:968:995:998:0:338|h[Calydus]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[618] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:618:6:45:950:439:489:0:0:414:415:855:0:337|h[Zinnin Smythe]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[620] = {
["link"] = "|cffa335ee|Hgarrfollower:620:6:45:950:438:491:0:0:999:968:970:0:337|h[Shinfel Blightsworn]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[192] = {
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:615:160:105:0:0:57:42:69:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[381] = {
["link"] = "|cffa335ee|Hgarrfollower:381:4:40:675:157:158:0:0:256:64:221:0:0|h[Stormsinger Taalos]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1055] = {
["link"] = "|cff0070dd|Hgarrfollower:1055:3:35:700:952:978:0:0:0:0:0:0:0|h[Krokul Ridgestalker]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[1059] = {
["link"] = "|cff0070dd|Hgarrfollower:1059:3:35:700:954:978:0:0:0:0:0:0:0|h[Lightforged Bulwark]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[225] = {
["link"] = "|cffa335ee|Hgarrfollower:225:4:40:600:120:120:0:0:76:314:68:0:0|h[Aknor Steelbringer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[112] = {
["link"] = "|cffa335ee|Hgarrfollower:112:4:40:675:101:103:0:0:79:43:36:0:0|h[Kariel Whisperwind]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:630:108:132:0:0:48:46:45:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[439] = {
["link"] = "|cffa335ee|Hgarrfollower:439:4:40:675:140:142:0:0:314:65:38:0:0|h[Mina Kunis]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[386] = {
["link"] = "|cffa335ee|Hgarrfollower:386:4:40:675:106:158:0:0:79:77:63:0:0|h[Kai Earthwhisper]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[389] = {
["link"] = "|cffa335ee|Hgarrfollower:389:4:40:675:154:155:0:0:79:8:39:0:0|h[Zian]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[453] = {
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:162:105:0:0:8:232:41:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[301] = {
["link"] = "|cffa335ee|Hgarrfollower:301:4:40:630:168:172:0:0:256:40:43:0:0|h[Domnall Icecrag]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[589] = {
["link"] = "|cffa335ee|Hgarrfollower:589:6:45:950:438:488:0:0:911:905:907:0:339|h[Ritssyn Flamescowl]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[393] = {
["link"] = "|cffa335ee|Hgarrfollower:393:4:40:675:106:107:0:0:256:49:67:0:0|h[Navea the Purifier]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[171] = {
["link"] = "|cffa335ee|Hgarrfollower:171:4:40:675:121:6:0:0:29:256:68:0:0|h[Pleasure-Bot 8000]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[283] = {
["link"] = "|cffa335ee|Hgarrfollower:283:4:40:645:103:167:0:0:79:44:7:0:0|h[Kendall Covington]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[619] = {
["link"] = "|cffa335ee|Hgarrfollower:619:6:45:950:440:492:0:0:998:968:995:0:339|h[Jubeka Shadowbreaker]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[397] = {
["link"] = "|cffa335ee|Hgarrfollower:397:4:40:630:178:179:0:0:256:49:4:0:0|h[Garvan Bitterstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1056] = {
["link"] = "|cff0070dd|Hgarrfollower:1056:3:35:700:952:978:0:0:0:0:0:0:0|h[Krokul Ridgestalker]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[727] = {
["link"] = "|cffffffff|Hgarrfollower:727:1:35:700:486:0:0:0:0:0:0:0:0|h[Pack of Imps]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:150:0:0:43:8:65:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[118] = {
["link"] = "|cffa335ee|Hgarrfollower:118:4:40:675:141:144:0:0:314:37:43:0:0|h[Len-Shu]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[203] = {
["link"] = "|cffa335ee|Hgarrfollower:203:4:40:600:122:6:0:0:54:79:67:0:0|h[Meatball]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[404] = {
["link"] = "|cffa335ee|Hgarrfollower:404:4:40:645:177:178:0:0:314:48:42:0:0|h[Rykki Lyndgarf]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[204] = {
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:630:122:121:0:0:58:46:43:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[342] = {
["link"] = "|cffa335ee|Hgarrfollower:342:4:40:675:148:151:0:0:314:40:36:0:0|h[\"Doc\" Schweitzer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[734] = {
["link"] = "|cffffffff|Hgarrfollower:734:1:35:700:486:0:0:0:0:0:0:0:0|h[Pack of Imps]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[617] = {
["link"] = "|cffa335ee|Hgarrfollower:617:6:45:950:439:490:0:0:968:996:965:0:339|h[Kira Iresoul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[997] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:997:6:45:950:440:823:0:0:968:995:998:0:337|h[Kanrethad Ebonlocke]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[621] = {
["link"] = "|cffa335ee|Hgarrfollower:621:6:45:950:438:493:0:0:968:999:970:0:338|h[Eredar Twins]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1060] = {
["link"] = "|cff0070dd|Hgarrfollower:1060:3:35:700:954:978:0:0:0:0:0:0:0|h[Lightforged Bulwark]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[474] = {
["link"] = "|cffa335ee|Hgarrfollower:474:4:40:600:122:100:0:0:244:40:80:0:0|h[Ariok]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:615:102:121:0:0:56:46:68:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[764] = {
["link"] = "|cff1eff00|Hgarrfollower:764:2:35:700:487:485:0:0:0:0:0:0:0|h[Black Harvest Invokers]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[1057] = {
["link"] = "|cff0070dd|Hgarrfollower:1057:3:35:700:953:978:0:0:0:0:0:0:0|h[Void-Purged Krokul]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[289] = {
["link"] = "|cffa335ee|Hgarrfollower:289:4:40:675:172:170:0:0:256:65:80:0:0|h[Esmund Brightshield]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:161:104:0:0:54:68:256:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
},
["Traits"] = {
[38] = 1,
[46] = 4,
[54] = 2,
[4] = 1,
[76] = 1,
[7] = 1,
[8] = 3,
[77] = 1,
[63] = 1,
[40] = 4,
[48] = 2,
[56] = 1,
[64] = 2,
[80] = 2,
[314] = 5,
[65] = 4,
[41] = 1,
[49] = 3,
[57] = 1,
[66] = 1,
[29] = 1,
[67] = 3,
[42] = 3,
[58] = 1,
[68] = 4,
[69] = 1,
[231] = 1,
[232] = 1,
[36] = 2,
[44] = 1,
[244] = 1,
[59] = 1,
[39] = 1,
[37] = 1,
[45] = 1,
[9] = 1,
[256] = 7,
[79] = 6,
[221] = 1,
[43] = 5,
},
["numFollowers"] = 28,
["Abilities"] = {
[106] = 2,
[179] = 1,
[148] = 2,
[107] = 1,
[150] = 1,
[6] = 3,
[108] = 1,
[154] = 1,
[155] = 1,
[126] = 1,
[157] = 1,
[127] = 1,
[158] = 2,
[160] = 1,
[161] = 1,
[162] = 1,
[114] = 1,
[132] = 1,
[115] = 1,
[100] = 1,
[167] = 1,
[168] = 1,
[101] = 1,
[170] = 1,
[102] = 1,
[140] = 1,
[172] = 2,
[103] = 2,
[142] = 1,
[151] = 1,
[104] = 1,
[120] = 2,
[144] = 1,
[121] = 5,
[105] = 2,
[177] = 1,
[122] = 4,
[178] = 2,
[141] = 1,
},
["AvailableWarCampaignMissions"] = {
2096, -- [1]
2100, -- [2]
2098, -- [3]
2099, -- [4]
2097, -- [5]
1893, -- [6]
1887, -- [7]
1892, -- [8]
2071, -- [9]
2077, -- [10]
2135, -- [11]
},
["BFAFollowers"] = {
[1066] = {
["link"] = "|cff1eff00|Hgarrfollower:1066:2:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1179] = {
["link"] = "|cffffffff|Hgarrfollower:1179:1:120:800:1083:0:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1067] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1067:3:120:1:1084:1138:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1071] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1071:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1068] = {
["link"] = "|cffa335ee|Hgarrfollower:1068:4:120:800:1098:0:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
["xp"] = 24349,
["levelXP"] = 30000,
},
[1072] = {
["link"] = "|cffa335ee|Hgarrfollower:1072:4:120:800:1096:1097:0:0:1100:0:0:0:1043|h[Magister Umbric]|h|r",
["xp"] = 22707,
["levelXP"] = 30000,
},
[1177] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
},
[1065] = {
["link"] = "|cffa335ee|Hgarrfollower:1065:4:120:800:1131:1087:0:0:1100:0:0:0:1062|h[Falstad Wildhammer]|h|r",
["xp"] = 20966,
["levelXP"] = 30000,
},
[1069] = {
["link"] = "|cffa335ee|Hgarrfollower:1069:4:120:800:1091:1090:0:0:1100:0:0:0:1062|h[John J. Keeshan]|h|r",
["xp"] = 23193,
["levelXP"] = 30000,
},
[1178] = {
["link"] = "|cffffffff|Hgarrfollower:1178:1:120:800:1084:0:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1073] = {
["link"] = "|cffffffff|Hgarrfollower:1073:1:120:800:1084:0:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
},
},
["Default.Darksorrow.Pikachi"] = {
["numFollowersAtiLevel675"] = 25,
["numFollowersAtiLevel660"] = 25,
["AvailableMissions"] = {
157, -- [1]
159, -- [2]
169, -- [3]
177, -- [4]
217, -- [5]
276, -- [6]
279, -- [7]
335, -- [8]
476, -- [9]
492, -- [10]
682, -- [11]
189, -- [12]
245, -- [13]
329, -- [14]
272, -- [15]
316, -- [16]
457, -- [17]
118, -- [18]
263, -- [19]
264, -- [20]
667, -- [21]
128, -- [22]
212, -- [23]
495, -- [24]
297, -- [25]
373, -- [26]
379, -- [27]
397, -- [28]
},
["MissionsInfo"] = {
[192] = {
["successChance"] = 100,
["followers"] = {
103, -- [1]
},
},
[119] = {
["successChance"] = 100,
["followers"] = {
153, -- [1]
463, -- [2]
},
},
},
["AvailableOrderHallMissions"] = {
1591, -- [1]
1683, -- [2]
1697, -- [3]
1698, -- [4]
1709, -- [5]
1644, -- [6]
1670, -- [7]
1646, -- [8]
1654, -- [9]
1639, -- [10]
},
["numEpicFollowers"] = 27,
["lastUpdate"] = 1603036687,
["numFollowersAtiLevel645"] = 26,
["numFollowersAtiLevel630"] = 28,
["AbilityCounters"] = {
5, -- [1]
5, -- [2]
4, -- [3]
2, -- [4]
nil, -- [5]
6, -- [6]
6, -- [7]
10, -- [8]
9, -- [9]
9, -- [10]
},
["Followers"] = {
[179] = {
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:125:128:0:0:80:67:68:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[212] = {
["link"] = "|cffa335ee|Hgarrfollower:212:4:40:675:104:159:0:0:232:68:256:0:0|h[Rangari Erdanii]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[775] = {
["link"] = "|cffffffff|Hgarrfollower:775:1:35:700:575:0:0:0:0:0:0:0:0|h[Tiger Initates]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[588] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:588:6:45:900:412:394:0:0:758:728:685:0:336|h[Li Li Stormstout]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[300] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:300:4:40:630:173:171:0:0:67:49:42:0:0|h[Rebecca Stirling]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[93] = {
["link"] = "|cffa335ee|Hgarrfollower:93:4:40:675:160:161:0:0:61:221:67:0:0|h[Fink Fastneedle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:118:115:0:0:231:79:40:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[602] = {
["link"] = "|cffa335ee|Hgarrfollower:602:6:45:900:416:418:0:0:676:911:907:0:334|h[The Monkey King]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[604] = {
["link"] = "|cffa335ee|Hgarrfollower:604:6:45:900:412:408:0:0:727:758:910:0:334|h[Sylara Steelsong]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[606] = {
["link"] = "|cffa335ee|Hgarrfollower:606:6:45:900:417:423:0:0:758:729:684:0:336|h[Hiro]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[436] = {
["link"] = "|cffa335ee|Hgarrfollower:436:4:40:675:142:140:0:0:314:232:79:0:0|h[Fo Sho Knucklebump]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[998] = {
["link"] = "|cffa335ee|Hgarrfollower:998:6:45:900:416:824:0:0:729:758:684:0:336|h[Brewer Almai]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[192] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:645:160:104:0:0:57:49:77:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:637:134:108:0:0:60:41:4:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[689] = {
["link"] = "|cff1eff00|Hgarrfollower:689:2:35:700:750:0:0:0:0:0:0:0:0|h[Ox Adepts]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[696] = {
["link"] = "|cff0070dd|Hgarrfollower:696:3:35:700:582:573:0:0:0:0:0:0:0|h[Ox Masters]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[453] = {
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:105:104:0:0:62:42:221:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[229] = {
["link"] = "|cffa335ee|Hgarrfollower:229:4:40:675:117:116:0:0:60:314:232:0:0|h[Torin Coalheart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[455] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:455:4:40:675:172:170:0:0:8:80:67:0:0|h[Millhouse Manastorm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[118] = {
["link"] = "|cffa335ee|Hgarrfollower:118:4:40:675:142:143:0:0:63:48:64:0:0|h[Len-Shu]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[692] = {
["link"] = "|cff1eff00|Hgarrfollower:692:2:35:700:575:576:0:0:0:0:0:0:0|h[Tiger Adepts]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[656] = {
["link"] = "|cffffffff|Hgarrfollower:656:1:35:700:575:0:0:0:0:0:0:0:0|h[Tiger Initates]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[204] = {
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:675:122:100:0:0:58:43:66:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[271] = {
["link"] = "|cffa335ee|Hgarrfollower:271:4:40:675:163:167:0:0:63:49:64:0:0|h[Catherine Magruder]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[411] = {
["link"] = "|cffa335ee|Hgarrfollower:411:4:40:675:179:181:0:0:68:76:79:0:0|h[Ranni Flagdabble]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[399] = {
["link"] = "|cffa335ee|Hgarrfollower:399:4:40:675:178:179:0:0:221:40:79:0:0|h[Mia Linn]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:10:148:0:0:29:68:65:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[605] = {
["link"] = "|cffa335ee|Hgarrfollower:605:6:45:900:412:420:0:0:727:759:684:0:335|h[Angus Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[339] = {
["link"] = "|cffa335ee|Hgarrfollower:339:4:40:675:131:127:0:0:314:79:221:0:0|h[Voraatios the Benedictive]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[466] = {
["link"] = "|cffff8000|Hgarrfollower:466:5:40:675:160:105:0:0:47:64:221:0:0|h[Garona Halforcen]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[103] = {
["link"] = "|cffa335ee|Hgarrfollower:103:4:40:675:180:175:0:0:66:256:8:0:0|h[Lucretia Ainsworth]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[279] = {
["link"] = "|cffa335ee|Hgarrfollower:279:4:40:675:166:167:0:0:66:80:67:0:0|h[Bren Swiftshot]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[406] = {
["link"] = "|cffa335ee|Hgarrfollower:406:4:40:675:174:181:0:0:256:9:232:0:0|h[Aerik Matthews]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[407] = {
["link"] = "|cffa335ee|Hgarrfollower:407:4:40:675:181:177:0:0:54:48:256:0:0|h[Kayt Miccoats]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[596] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:596:4:45:900:417:773:0:0:728:726:0:0:335|h[Chen Stormstout]|h|r",
["xp"] = 0,
["levelXP"] = 200000,
},
[603] = {
["link"] = "|cffa335ee|Hgarrfollower:603:6:45:900:417:419:0:0:758:683:414:0:334|h[Taran Zhu]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[428] = {
["link"] = "|cffa335ee|Hgarrfollower:428:4:40:675:121:120:0:0:76:232:314:0:0|h[Selis]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[176] = {
["link"] = "|cffa335ee|Hgarrfollower:176:4:40:675:140:183:0:0:53:8:41:0:0|h[Pitfighter Vaandaam]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[627] = {
["link"] = "|cff1eff00|Hgarrfollower:627:2:35:700:750:0:0:0:0:0:0:0:0|h[Ox Adepts]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[177] = {
["link"] = "|cffa335ee|Hgarrfollower:177:4:40:675:124:130:0:0:57:232:41:0:0|h[Croman]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[607] = {
["link"] = "|cffa335ee|Hgarrfollower:607:6:45:900:416:422:0:0:727:758:685:0:335|h[Aegira]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[178] = {
["link"] = "|cffa335ee|Hgarrfollower:178:4:40:675:124:126:0:0:60:66:314:0:0|h[Leeroy Jenkins]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:161:105:0:0:63:41:39:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
},
["Traits"] = {
[54] = 1,
[62] = 1,
[76] = 2,
[8] = 3,
[77] = 1,
[47] = 1,
[63] = 3,
[79] = 5,
[48] = 2,
[64] = 3,
[221] = 5,
[314] = 5,
[65] = 1,
[41] = 4,
[49] = 3,
[57] = 2,
[256] = 4,
[29] = 1,
[67] = 5,
[42] = 2,
[58] = 1,
[68] = 4,
[9] = 1,
[231] = 1,
[232] = 6,
[60] = 3,
[66] = 4,
[4] = 1,
[39] = 1,
[53] = 1,
[61] = 1,
[40] = 2,
[43] = 1,
[80] = 3,
},
["numFollowers"] = 28,
["numFollowersAtiLevel615"] = 28,
["Abilities"] = {
[122] = 1,
[148] = 1,
[180] = 1,
[181] = 3,
[108] = 1,
[183] = 1,
[10] = 1,
[125] = 1,
[126] = 1,
[127] = 1,
[159] = 1,
[128] = 1,
[160] = 3,
[161] = 2,
[130] = 1,
[131] = 1,
[163] = 1,
[115] = 1,
[134] = 1,
[166] = 1,
[100] = 1,
[167] = 2,
[117] = 1,
[179] = 2,
[170] = 1,
[118] = 1,
[171] = 1,
[140] = 2,
[172] = 1,
[124] = 2,
[173] = 1,
[142] = 2,
[174] = 1,
[104] = 3,
[120] = 1,
[177] = 1,
[143] = 1,
[105] = 3,
[121] = 1,
[175] = 1,
[178] = 1,
[116] = 1,
},
},
["Default.Neptulon.Cagstillo"] = {
["lastUpdate"] = 1602837934,
},
["Default.Genjuros.Sada"] = {
["lastUpdate"] = 1603024786,
["lastResourceCollection"] = 1602604989,
},
["Default.Darksorrow.Bandagespéc"] = {
["numFollowersAtiLevel675"] = 21,
["numFollowersAtiLevel660"] = 23,
["AvailableMissions"] = {
314, -- [1]
428, -- [2]
679, -- [3]
183, -- [4]
177, -- [5]
188, -- [6]
191, -- [7]
245, -- [8]
262, -- [9]
667, -- [10]
255, -- [11]
117, -- [12]
380, -- [13]
402, -- [14]
274, -- [15]
272, -- [16]
285, -- [17]
280, -- [18]
201, -- [19]
308, -- [20]
445, -- [21]
159, -- [22]
373, -- [23]
483, -- [24]
494, -- [25]
503, -- [26]
391, -- [27]
},
["AvailableOrderHallMissions"] = {
1704, -- [1]
1682, -- [2]
},
["numEpicFollowers"] = 28,
["lastUpdate"] = 1602835578,
["numFollowersAtiLevel645"] = 24,
["numFollowersAtiLevel630"] = 25,
["AbilityCounters"] = {
4, -- [1]
6, -- [2]
3, -- [3]
6, -- [4]
nil, -- [5]
5, -- [6]
5, -- [7]
14, -- [8]
8, -- [9]
5, -- [10]
},
["Followers"] = {
[179] = {
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:126:127:0:0:59:45:79:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[358] = {
["link"] = "|cffa335ee|Hgarrfollower:358:4:40:675:148:10:0:0:67:256:63:0:0|h[Rorin Rivershade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[359] = {
["link"] = "|cffa335ee|Hgarrfollower:359:4:40:675:104:162:0:0:79:40:7:0:0|h[Justine DeGroot]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[423] = {
["link"] = "|cffa335ee|Hgarrfollower:423:4:40:675:120:121:0:0:65:221:38:0:0|h[Tell'machrim Stormvigil]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:615:115:117:0:0:231:63:39:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[186] = {
["link"] = "|cffa335ee|Hgarrfollower:186:4:40:675:125:126:0:0:65:66:236:0:0|h[Vindicator Onaala]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[155] = {
["link"] = "|cffa335ee|Hgarrfollower:155:4:40:675:121:6:0:0:38:66:63:0:0|h[Miall]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[372] = {
["link"] = "|cffa335ee|Hgarrfollower:372:4:40:675:161:159:0:0:256:8:36:0:0|h[Margo Steelfinger]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[927] = {
["link"] = "|cffffffff|Hgarrfollower:927:1:35:700:649:0:0:0:0:0:0:0:0|h[Band of Zealots]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[679] = {
["link"] = "|cffffffff|Hgarrfollower:679:1:35:700:649:0:0:0:0:0:0:0:0|h[Band of Zealots]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[190] = {
["link"] = "|cffa335ee|Hgarrfollower:190:4:40:675:173:172:0:0:60:79:39:0:0|h[Image of Archmage Vargoth]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[872] = {
["link"] = "|cffa335ee|Hgarrfollower:872:6:45:900:457:654:0:0:684:414:906:0:352|h[Sol]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[874] = {
["link"] = "|cffa335ee|Hgarrfollower:874:6:45:900:458:656:0:0:759:738:916:0:353|h[Natalie Seline]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1002] = {
["link"] = "|cffa335ee|Hgarrfollower:1002:6:45:900:828:457:0:0:684:741:909:0:353|h[Aelthalyste]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[192] = {
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:104:160:0:0:64:36:76:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:108:132:0:0:60:236:8:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[325] = {
["link"] = "|cffa335ee|Hgarrfollower:325:4:40:675:127:126:0:0:67:38:76:0:0|h[Osgar Smitehammer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[115] = {
["link"] = "|cffa335ee|Hgarrfollower:115:4:40:675:118:117:0:0:221:9:76:0:0|h[Dramnur Doombrow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[453] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:600:105:160:0:0:62:4:42:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[328] = {
["link"] = "|cffa335ee|Hgarrfollower:328:4:40:675:125:126:0:0:65:68:45:0:0|h[Noah Munck]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[266] = {
["link"] = "|cffa335ee|Hgarrfollower:266:4:40:675:135:134:0:0:256:4:45:0:0|h[Thaal'kos Thundersong]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[260] = {
["link"] = "|cffa335ee|Hgarrfollower:260:4:40:652:108:132:0:0:77:256:236:0:0|h[Kirandros Galeheart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:615:161:105:0:0:54:40:77:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[856] = {
["link"] = "|cffa335ee|Hgarrfollower:856:6:45:900:457:777:0:0:759:909:741:0:354|h[Calia Menethil]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[347] = {
["link"] = "|cffa335ee|Hgarrfollower:347:4:40:675:148:11:0:0:80:4:64:0:0|h[Arctic Whitemace]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[105] = {
["link"] = "|cffa335ee|Hgarrfollower:105:4:40:675:125:123:0:0:256:40:4:0:0|h[Joachim Demonsbane]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:150:0:0:55:41:79:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[857] = {
["link"] = "|cffa335ee|Hgarrfollower:857:6:45:900:458:651:0:0:738:684:414:0:352|h[High Priestess Ishanah]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[402] = {
["link"] = "|cffa335ee|Hgarrfollower:402:4:40:675:178:179:0:0:256:48:221:0:0|h[Humbolt Briarblack]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[924] = {
["link"] = "|cff1eff00|Hgarrfollower:924:2:35:700:648:0:0:0:0:0:0:0:0|h[Netherlight Paragons]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[926] = {
["link"] = "|cff1eff00|Hgarrfollower:926:2:35:700:648:0:0:0:0:0:0:0:0|h[Netherlight Paragons]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[928] = {
["link"] = "|cffffffff|Hgarrfollower:928:1:35:700:649:0:0:0:0:0:0:0:0|h[Band of Zealots]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[678] = {
["link"] = "|cff1eff00|Hgarrfollower:678:2:35:700:648:0:0:0:0:0:0:0:0|h[Netherlight Paragons]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[344] = {
["link"] = "|cffa335ee|Hgarrfollower:344:4:40:660:10:151:0:0:256:46:80:0:0|h[Songla]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[871] = {
["isInactive"] = true,
["link"] = "|cffffffff|Hgarrfollower:871:1:45:900:456:0:0:0:0:0:0:0:352|h[Yalia Sagewhisper]|h|r",
["xp"] = 202,
["levelXP"] = 8000,
},
[873] = {
["link"] = "|cffa335ee|Hgarrfollower:873:6:45:900:456:655:0:0:909:739:759:0:354|h[Mariella Ward]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[875] = {
["isInactive"] = true,
["link"] = "|cffffffff|Hgarrfollower:875:1:45:900:458:0:0:0:0:0:0:0:354|h[Alonsus Faol]|h|r",
["xp"] = 0,
["levelXP"] = 8000,
},
[239] = {
["link"] = "|cffa335ee|Hgarrfollower:239:4:40:675:114:117:0:0:221:39:8:0:0|h[Makaaria the Cursed]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:630:102:121:0:0:56:43:76:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[343] = {
["link"] = "|cffa335ee|Hgarrfollower:343:4:40:660:151:11:0:0:79:8:49:0:0|h[Honora Keystone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[204] = {
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:675:122:121:0:0:58:64:66:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[171] = {
["link"] = "|cffa335ee|Hgarrfollower:171:4:40:675:122:6:0:0:61:76:256:0:0|h[Pleasure-Bot 8000]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[870] = {
["link"] = "|cffa335ee|Hgarrfollower:870:6:45:900:456:652:0:0:679:676:907:0:353|h[Zabra Hexx]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
},
["Traits"] = {
[38] = 3,
[46] = 1,
[54] = 1,
[4] = 4,
[76] = 5,
[7] = 1,
[8] = 4,
[77] = 2,
[55] = 1,
[63] = 3,
[79] = 5,
[48] = 1,
[56] = 1,
[64] = 3,
[221] = 4,
[65] = 3,
[41] = 1,
[49] = 1,
[256] = 8,
[67] = 2,
[42] = 1,
[58] = 1,
[68] = 1,
[9] = 1,
[231] = 1,
[59] = 1,
[36] = 2,
[236] = 3,
[43] = 1,
[62] = 1,
[60] = 2,
[45] = 3,
[39] = 3,
[61] = 1,
[66] = 3,
[40] = 3,
[80] = 2,
},
["numFollowers"] = 28,
["numFollowersAtiLevel615"] = 27,
["Abilities"] = {
[162] = 1,
[135] = 1,
[118] = 1,
[120] = 1,
[122] = 2,
[151] = 2,
[126] = 4,
[159] = 1,
[132] = 2,
[114] = 1,
[10] = 2,
[105] = 2,
[148] = 3,
[11] = 2,
[108] = 2,
[160] = 2,
[115] = 1,
[117] = 3,
[6] = 2,
[121] = 4,
[123] = 1,
[125] = 3,
[127] = 2,
[161] = 2,
[134] = 1,
[102] = 1,
[173] = 1,
[172] = 1,
[150] = 1,
[104] = 2,
[179] = 1,
[178] = 1,
},
},
["Default.Genjuros.Saddw"] = {
["lastUpdate"] = 1603035310,
["lastResourceCollection"] = 1601742163,
},
["Default.Genjuros.Classynem"] = {
["lastUpdate"] = 1603024390,
},
["Default.Darksorrow.Talambelen"] = {
["BFAFollowers"] = {
[1177] = {
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1178] = {
["link"] = "|cffffffff|Hgarrfollower:1178:1:120:800:1084:0:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1179] = {
["link"] = "|cff0070dd|Hgarrfollower:1179:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1182] = {
["link"] = "|cffff8000|Hgarrfollower:1182:5:120:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1184] = {
["link"] = "|cffffffff|Hgarrfollower:1184:1:120:800:1083:0:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1185] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1185:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
},
[1062] = {
["link"] = "|cffff8000|Hgarrfollower:1062:5:120:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1063] = {
["link"] = "|cffffffff|Hgarrfollower:1063:1:120:1:1083:0:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1064] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1064:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
},
[1065] = {
["link"] = "|cffff8000|Hgarrfollower:1065:5:120:800:1131:1087:0:0:1100:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1066] = {
["link"] = "|cff1eff00|Hgarrfollower:1066:2:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1067] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1067:3:120:1:1084:1138:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
},
[1068] = {
["link"] = "|cffff8000|Hgarrfollower:1068:5:120:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1069] = {
["link"] = "|cffff8000|Hgarrfollower:1069:5:120:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1070] = {
["link"] = "|cff0070dd|Hgarrfollower:1070:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1071] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1071:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1072] = {
["link"] = "|cffff8000|Hgarrfollower:1072:5:120:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1073] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1073:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
},
[1187] = {
["link"] = "|cff1eff00|Hgarrfollower:1187:2:120:800:1083:1272:0:0:0:0:0:0:0|h[Rajani Sparkcallers]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
},
["numFollowersAtiLevel660"] = 26,
["AvailableMissions"] = {
683, -- [1]
499, -- [2]
324, -- [3]
450, -- [4]
182, -- [5]
173, -- [6]
156, -- [7]
168, -- [8]
245, -- [9]
331, -- [10]
266, -- [11]
255, -- [12]
268, -- [13]
259, -- [14]
116, -- [15]
274, -- [16]
276, -- [17]
284, -- [18]
283, -- [19]
214, -- [20]
298, -- [21]
307, -- [22]
159, -- [23]
373, -- [24]
480, -- [25]
477, -- [26]
488, -- [27]
381, -- [28]
677, -- [29]
},
["AvailableOrderHallMissions"] = {
1697, -- [1]
1698, -- [2]
1708, -- [3]
1590, -- [4]
1635, -- [5]
1630, -- [6]
1649, -- [7]
1665, -- [8]
1647, -- [9]
1658, -- [10]
},
["numEpicFollowers"] = 29,
["lastUpdate"] = 1603040510,
["numFollowersAtiLevel645"] = 26,
["numFollowersAtiLevel630"] = 26,
["AvailableWarCampaignMissions"] = {
1892, -- [1]
1888, -- [2]
1896, -- [3]
2075, -- [4]
1914, -- [5]
2135, -- [6]
2141, -- [7]
},
["AbilityCounters"] = {
5, -- [1]
5, -- [2]
3, -- [3]
3, -- [4]
nil, -- [5]
11, -- [6]
12, -- [7]
7, -- [8]
6, -- [9]
8, -- [10]
},
["Followers"] = {
[353] = {
["link"] = "|cffa335ee|Hgarrfollower:353:4:40:675:151:148:0:0:68:36:79:0:0|h[Truman Weaver]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[179] = {
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:675:126:125:0:0:59:314:256:0:0|h[Artificer Romuul]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[180] = {
["link"] = "|cffa335ee|Hgarrfollower:180:4:40:600:11:150:0:0:53:7:221:0:0|h[Fiona]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[297] = {
["link"] = "|cffa335ee|Hgarrfollower:297:4:40:675:171:170:0:0:256:221:232:0:0|h[Danaeris Amberstar]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[424] = {
["link"] = "|cffa335ee|Hgarrfollower:424:4:40:675:122:102:0:0:59:37:68:0:0|h[Eunna Young]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[93] = {
["link"] = "|cffa335ee|Hgarrfollower:93:4:40:675:104:161:0:0:256:64:9:0:0|h[Fink Fastneedle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[216] = {
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:116:0:0:231:79:43:0:0|h[Delvar Ironfist]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[185] = {
["link"] = "|cffa335ee|Hgarrfollower:185:4:40:675:101:165:0:0:77:67:79:0:0|h[Rangari Chel]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[249] = {
["link"] = "|cffa335ee|Hgarrfollower:249:4:40:675:182:139:0:0:256:68:221:0:0|h[Syverandin Yewshade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[608] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:608:4:45:900:443:511:0:0:756:683:0:0:331|h[Stormcaller Mylra]|h|r",
["xp"] = 0,
["levelXP"] = 200000,
},
[610] = {
["link"] = "|cffa335ee|Hgarrfollower:610:6:45:900:443:768:0:0:709:758:906:0:332|h[Consular Celestos]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[612] = {
["link"] = "|cffa335ee|Hgarrfollower:612:6:45:900:441:513:0:0:911:676:679:0:332|h[Rehgar Earthfury]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[614] = {
["link"] = "|cffa335ee|Hgarrfollower:614:6:45:900:442:509:0:0:758:709:685:0:332|h[Muln Earthfury]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[683] = {
["link"] = "|cffffffff|Hgarrfollower:683:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[378] = {
["link"] = "|cffa335ee|Hgarrfollower:378:4:40:675:154:106:0:0:314:8:65:0:0|h[Orvar]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[192] = {
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:160:105:0:0:57:41:256:0:0|h[Kimzee Pinchwhistle]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[256] = {
["link"] = "|cffa335ee|Hgarrfollower:256:4:40:675:132:138:0:0:66:64:41:0:0|h[Verroak Greenheart]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[446] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:446:4:40:600:142:147:0:0:54:79:43:0:0|h[Thurman Belva]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[114] = {
["link"] = "|cffa335ee|Hgarrfollower:114:4:40:675:165:167:0:0:4:65:79:0:0|h[Marguun]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[34] = {
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:108:182:0:0:64:69:76:0:0|h[Qiana Moonshadow]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[453] = {
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:675:105:159:0:0:62:221:43:0:0|h[Hulda Shadowblade]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[785] = {
["link"] = "|cffffffff|Hgarrfollower:785:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[992] = {
["link"] = "|cffa335ee|Hgarrfollower:992:6:45:900:443:816:0:0:684:758:414:0:333|h[Magatha Grimtotem]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[784] = {
["link"] = "|cffffffff|Hgarrfollower:784:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[786] = {
["link"] = "|cffffffff|Hgarrfollower:786:1:35:700:521:0:0:0:0:0:0:0:0|h[Lesser Elementals]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[615] = {
["link"] = "|cffa335ee|Hgarrfollower:615:6:45:900:441:514:0:0:909:758:709:0:331|h[Avalanchion the Unbroken]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[204] = {
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:675:122:102:0:0:58:256:36:0:0|h[Admiral Taylor]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[463] = {
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:150:0:0:79:63:42:0:0|h[Daleera Moonfang]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[993] = {
["link"] = "|cff1eff00|Hgarrfollower:993:2:35:700:817:0:0:0:0:0:0:0:0|h[Grimtotem Warrior]|h|r",
["xp"] = 0,
["levelXP"] = 200,
},
[203] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:203:4:40:600:122:102:0:0:53:68:36:0:0|h[Meatball]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[466] = {
["link"] = "|cffff8000|Hgarrfollower:466:5:40:675:104:105:0:0:47:221:79:0:0|h[Garona Halforcen]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[611] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:611:4:45:900:442:512:0:0:754:684:0:0:333|h[Farseer Nobundo]|h|r",
["xp"] = 0,
["levelXP"] = 200000,
},
[613] = {
["link"] = "|cffa335ee|Hgarrfollower:613:6:45:900:442:515:0:0:707:758:685:0:331|h[Baron Scaldius]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[280] = {
["link"] = "|cffa335ee|Hgarrfollower:280:4:40:675:166:165:0:0:69:76:314:0:0|h[Bastiana Moran]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[88] = {
["link"] = "|cffa335ee|Hgarrfollower:88:4:40:675:120:120:0:0:80:256:44:0:0|h[Ginnwin Grindspinner]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[239] = {
["link"] = "|cffa335ee|Hgarrfollower:239:4:40:675:114:118:0:0:256:46:79:0:0|h[Makaaria the Cursed]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[609] = {
["link"] = "|cffa335ee|Hgarrfollower:609:6:45:900:441:510:0:0:758:708:685:0:333|h[Duke Hydraxis]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[92] = {
["link"] = "|cffa335ee|Hgarrfollower:92:4:40:675:173:172:0:0:256:40:69:0:0|h[Araspeth]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[474] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:474:4:40:600:120:122:0:0:244:46:4:0:0|h[Ariok]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[208] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:675:102:100:0:0:52:9:44:0:0|h[Ahm]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[172] = {
["link"] = "|cffa335ee|Hgarrfollower:172:4:40:675:123:124:0:0:40:256:68:0:0|h[Soulare of Andorhal]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[225] = {
["isInactive"] = true,
["link"] = "|cffa335ee|Hgarrfollower:225:4:40:675:120:100:0:0:40:68:7:0:0|h[Aknor Steelbringer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[178] = {
["link"] = "|cffa335ee|Hgarrfollower:178:4:40:675:130:124:0:0:68:64:256:0:0|h[Leeroy Jenkins]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[153] = {
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:161:104:0:0:54:63:7:0:0|h[Bruma Swiftstone]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
},
["Traits"] = {
[46] = 2,
[54] = 2,
[62] = 1,
[76] = 2,
[7] = 3,
[8] = 1,
[77] = 1,
[47] = 1,
[63] = 2,
[79] = 8,
[64] = 4,
[80] = 1,
[314] = 3,
[65] = 2,
[41] = 2,
[57] = 1,
[66] = 1,
[67] = 1,
[42] = 1,
[58] = 1,
[68] = 7,
[69] = 3,
[231] = 1,
[59] = 2,
[36] = 3,
[44] = 2,
[52] = 1,
[244] = 1,
[232] = 1,
[40] = 3,
[37] = 1,
[4] = 2,
[53] = 2,
[221] = 5,
[256] = 11,
[43] = 3,
[9] = 2,
},
["numFollowers"] = 30,
["Abilities"] = {
[106] = 1,
[122] = 4,
[148] = 2,
[123] = 1,
[150] = 2,
[182] = 2,
[108] = 1,
[124] = 2,
[125] = 1,
[154] = 1,
[126] = 1,
[159] = 1,
[160] = 1,
[161] = 2,
[130] = 1,
[114] = 1,
[132] = 1,
[165] = 3,
[166] = 1,
[100] = 2,
[167] = 1,
[11] = 1,
[101] = 1,
[138] = 1,
[170] = 1,
[102] = 4,
[118] = 1,
[172] = 1,
[173] = 1,
[142] = 1,
[104] = 3,
[120] = 4,
[171] = 1,
[139] = 1,
[105] = 3,
[116] = 1,
[147] = 1,
[115] = 1,
[151] = 1,
},
["numFollowersAtiLevel615"] = 26,
["numFollowersAtiLevel675"] = 26,
},
["Default.Neptulon.Mahuge"] = {
["lastUpdate"] = 1602838367,
},
["Default.Darksorrow.Bonrambo"] = {
["BFAFollowers"] = {
[1177] = {
["link"] = "|cff0070dd|Hgarrfollower:1177:3:120:800:1085:1138:0:0:0:0:0:0:0|h[Lightforged Dragoons]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1178] = {
["link"] = "|cffffffff|Hgarrfollower:1178:1:120:800:1084:0:0:0:0:0:0:0:0|h[Veiled Riftblades]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1179] = {
["link"] = "|cffffffff|Hgarrfollower:1179:1:120:800:1083:0:0:0:0:0:0:0:0|h[Dark Iron Shadowcasters]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1182] = {
["link"] = "|cffff8000|Hgarrfollower:1182:5:120:800:1267:1268:0:0:1100:1101:0:0:1042|h[Grand Admiral Jes-Tereth]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1184] = {
["link"] = "|cff0070dd|Hgarrfollower:1184:3:120:800:1083:1138:0:0:0:0:0:0:0|h[Kul Tiran Marines]|h|r",
["xp"] = 0,
["levelXP"] = 2000,
},
[1185] = {
["link"] = "|cffffffff|Hgarrfollower:1185:1:120:800:1085:0:0:0:0:0:0:0:0|h[Mechagnome Spidercrawlers]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1062] = {
["link"] = "|cffff8000|Hgarrfollower:1062:5:120:800:1112:1104:0:0:1100:1101:0:0:1043|h[Shandris Feathermoon]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1063] = {
["link"] = "|cff0070dd|Hgarrfollower:1063:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Dwarven Riflemen]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1064] = {
["link"] = "|cff1eff00|Hgarrfollower:1064:2:120:1:1085:1138:0:0:0:0:0:0:0|h[Gnomeregan Mechano-Tanks]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
[1065] = {
["link"] = "|cffff8000|Hgarrfollower:1065:5:120:800:1131:1087:0:0:1100:1101:0:0:1062|h[Falstad Wildhammer]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1066] = {
["link"] = "|cff0070dd|Hgarrfollower:1066:3:120:1:1083:1138:0:0:0:0:0:0:0|h[Darnassian Sentinels]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1067] = {
["link"] = "|cff0070dd|Hgarrfollower:1067:3:120:1:1084:1138:0:0:0:0:0:0:0|h[7th Legion Shocktroopers]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1068] = {
["link"] = "|cffff8000|Hgarrfollower:1068:5:120:800:1098:1259:0:0:1100:1101:0:0:1042|h[Kelsey Steelspark]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1069] = {
["link"] = "|cffff8000|Hgarrfollower:1069:5:120:800:1091:1090:0:0:1100:1101:0:0:1062|h[John J. Keeshan]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1070] = {
["link"] = "|cff0070dd|Hgarrfollower:1070:3:120:1:1085:1138:0:0:0:0:0:0:0|h[Exodar Peacekeeper]|h|r",
["xp"] = 0,
["levelXP"] = 1500,
},
[1071] = {
["levelXP"] = 1500,
["xp"] = 0,
["link"] = "|cff0070dd|Hgarrfollower:1071:3:120:800:1084:1138:0:0:0:0:0:0:0|h[Bloodfang Stalkers]|h|r",
},
[1072] = {
["link"] = "|cffff8000|Hgarrfollower:1072:5:120:800:1096:1097:0:0:1100:1101:0:0:1043|h[Magister Umbric]|h|r",
["xp"] = 0,
["levelXP"] = 0,
},
[1073] = {
["link"] = "|cffffffff|Hgarrfollower:1073:1:120:800:1084:0:0:0:0:0:0:0:0|h[Tushui Monks]|h|r",
["xp"] = 0,
["levelXP"] = 1000,
},
},
["numFollowersAtiLevel660"] = 17,
["ActiveMissions"] = {
200, -- [1]
304, -- [2]
381, -- [3]
666, -- [4]
667, -- [5]
669, -- [6]
673, -- [7]
686, -- [8]
},
["AvailableMissions"] = {
684, -- [1]
358, -- [2]
430, -- [3]
313, -- [4]
192, -- [5]
156, -- [6]
194, -- [7]
171, -- [8]
245, -- [9]
130, -- [10]
257, -- [11]
268, -- [12]
127, -- [13]
128, -- [14]
275, -- [15]
276, -- [16]
282, -- [17]
286, -- [18]
201, -- [19]
305, -- [20]
496, -- [21]
373, -- [22]
159, -- [23]
471, -- [24]
379, -- [25]
396, -- [26]
},
["MissionsInfo"] = {
[381] = {
["successChance"] = 100,
["followers"] = {
216, -- [1]
391, -- [2]
},
},
[200] = {
["successChance"] = 100,
["followers"] = {
259, -- [1]
107, -- [2]
346, -- [3]
},
},
[667] = {
["successChance"] = 100,
["followers"] = {
153, -- [1]
155, -- [2]
453, -- [3]
},
},
[669] = {
["successChance"] = 100,
["followers"] = {
179, -- [1]
441, -- [2]
342, -- [3]
},
},
[686] = {
["successChance"] = 100,
["followers"] = {
463, -- [1]
333, -- [2]
290, -- [3]
},
},
[673] = {
["successChance"] = 100,
["followers"] = {
34, -- [1]
182, -- [2]
384, -- [3]
},
},
[1658] = {
["successChance"] = 200,
["followers"] = {
858, -- [1]
711, -- [2]
712, -- [3]
},
},
[1699] = {
["successChance"] = 100,
["followers"] = {
868, -- [1]
867, -- [2]
715, -- [3]
},
},
[666] = {
["successChance"] = 100,
["followers"] = {
192, -- [1]
208, -- [2]
233, -- [3]
},
},
[304] = {
["successChance"] = 90,
["followers"] = {
348, -- [1]
92, -- [2]
253, -- [3]
},
},
},
["AvailableOrderHallMissions"] = {
1697, -- [1]
1698, -- [2]
1709, -- [3]
1592, -- [4]
1655, -- [5]
1674, -- [6]
1675, -- [7]
1647, -- [8]
1602, -- [9]
1673, -- [10]
},
["ActiveOrderHallMissions"] = {
1658, -- [1]
1699, -- [2]
},
["numEpicFollowers"] = 25,
["lastUpdate"] = 1603039996,
["numFollowersAtiLevel645"] = 19,
["numFollowersAtiLevel630"] = 22,
["numFollowersAtiLevel615"] = 23,
["AbilityCounters"] = {
5, -- [1]
6, -- [2]
6, -- [3]
3, -- [4]
nil, -- [5]
9, -- [6]
4, -- [7]
6, -- [8]
6, -- [9]
5, -- [10]
},
["Followers"] = {
[290] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:290:4:40:675:172:171:0:0:65:37:77:0:0|h[Nordaerin Silverbeam]|h|r",
},
[179] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:179:4:40:630:126:128:0:0:59:44:64:0:0|h[Artificer Romuul]|h|r",
},
[107] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:107:4:40:675:125:126:0:0:256:65:44:0:0|h[Bemora]|h|r",
},
[708] = {
["levelXP"] = 2700,
["link"] = "|cffffffff|Hgarrfollower:708:1:43:760:450:0:0:0:0:0:0:0:344|h[Ragnvald Drakeborn]|h|r",
["xp"] = 2265,
["isInactive"] = true,
},
[710] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:710:6:45:900:450:505:0:0:721:684:414:0:345|h[Svergan Stormcloak]|h|r",
},
[92] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:92:4:40:675:173:172:0:0:256:69:45:0:0|h[Araspeth]|h|r",
},
[714] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:714:6:45:900:452:506:0:0:905:907:414:0:343|h[Dvalen Ironrune]|h|r",
},
[183] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:183:4:40:600:157:106:0:0:55:64:38:0:0|h[Rulkan]|h|r",
},
[216] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:216:4:40:675:115:114:0:0:231:77:232:0:0|h[Delvar Ironfist]|h|r",
},
[852] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:852:2:35:700:600:601:0:0:0:0:0:0:0|h[Valkyra Shieldmaidens]|h|r",
},
[155] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:155:4:40:675:102:6:0:0:60:41:76:0:0|h[Miall]|h|r",
},
[858] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:858:1:35:700:599:0:0:0:0:0:0:0:0|h[Valarjar Aspirants]|h|r",
},
[860] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:860:1:35:700:599:0:0:0:0:0:0:0:0|h[Valarjar Aspirants]|h|r",
},
[868] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:868:2:35:700:600:601:0:0:0:0:0:0:0|h[Valkyra Shieldmaidens]|h|r",
},
[253] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:253:4:40:675:108:138:0:0:256:49:48:0:0|h[Kage Satsuke]|h|r",
},
[441] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:441:4:40:675:146:147:0:0:66:76:7:0:0|h[Edith Shareflagon]|h|r",
},
[192] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:192:4:40:675:160:161:0:0:48:77:79:0:0|h[Kimzee Pinchwhistle]|h|r",
},
[384] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:384:4:40:675:106:156:0:0:65:43:64:0:0|h[Fern Greenfoot]|h|r",
},
[259] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:259:4:40:675:182:132:0:0:256:48:8:0:0|h[Sarah Schnau]|h|r",
},
[34] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:34:4:40:675:108:132:0:0:68:41:221:0:0|h[Qiana Moonshadow]|h|r",
},
[453] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:453:4:40:615:105:104:0:0:62:77:41:0:0|h[Hulda Shadowblade]|h|r",
},
[391] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:391:4:40:675:106:154:0:0:79:76:64:0:0|h[Leena]|h|r",
},
[713] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:713:6:45:900:451:502:0:0:719:684:910:0:344|h[Thorim]|h|r",
},
[715] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:715:6:45:900:450:508:0:0:684:719:758:0:343|h[Hodir]|h|r",
},
[333] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:333:4:40:675:127:124:0:0:53:66:63:0:0|h[Delma Ironsafe]|h|r",
},
[233] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:233:4:40:645:114:118:0:0:79:64:41:0:0|h[Maul Dethwidget]|h|r",
},
[463] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:463:4:40:675:148:150:0:0:61:232:40:0:0|h[Daleera Moonfang]|h|r",
},
[204] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:204:4:40:600:122:100:0:0:58:77:36:0:0|h[Admiral Taylor]|h|r",
},
[342] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:342:4:40:630:10:151:0:0:44:221:4:0:0|h[\"Doc\" Schweitzer]|h|r",
},
[867] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cff1eff00|Hgarrfollower:867:2:35:700:600:601:0:0:0:0:0:0:0|h[Valkyra Shieldmaidens]|h|r",
},
[709] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:709:6:45:900:452:771:0:0:720:685:414:0:345|h[Finna Bjornsdottir]|h|r",
},
[989] = {
["levelXP"] = 100000,
["link"] = "|cff0070dd|Hgarrfollower:989:3:45:900:451:813:0:0:721:0:0:0:343|h[Lord Darius Crowley]|h|r",
["xp"] = 64475,
["isInactive"] = true,
},
[346] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:346:4:40:645:11:148:0:0:256:67:49:0:0|h[Herrathos Starstaff]|h|r",
},
[686] = {
["levelXP"] = 200,
["xp"] = 0,
["link"] = "|cffffffff|Hgarrfollower:686:1:35:700:599:0:0:0:0:0:0:0:0|h[Valarjar Aspirants]|h|r",
},
[348] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:348:4:40:675:11:10:0:0:79:256:38:0:0|h[Kinndy Brightsocket]|h|r",
},
[208] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:208:4:40:630:102:121:0:0:56:9:43:0:0|h[Ahm]|h|r",
},
[712] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:712:6:45:900:452:504:0:0:759:684:414:0:344|h[King Ymiron]|h|r",
},
[182] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:182:4:40:675:160:161:0:0:60:36:66:0:0|h[Shelly Hamby]|h|r",
},
[711] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:711:6:45:900:451:507:0:0:759:414:415:0:343|h[Hymdall]|h|r",
},
[153] = {
["levelXP"] = 0,
["xp"] = 0,
["link"] = "|cffa335ee|Hgarrfollower:153:4:40:675:159:160:0:0:77:44:38:0:0|h[Bruma Swiftstone]|h|r",
},
},
["Traits"] = {
[38] = 3,
[4] = 1,
[76] = 3,
[7] = 1,
[8] = 1,
[77] = 6,
[55] = 1,
[63] = 1,
[79] = 4,
[48] = 3,
[56] = 1,
[64] = 5,
[221] = 2,
[65] = 3,
[41] = 4,
[49] = 2,
[66] = 3,
[67] = 1,
[58] = 1,
[68] = 1,
[69] = 1,
[231] = 1,
[232] = 2,
[36] = 2,
[44] = 4,
[60] = 2,
[9] = 1,
[256] = 6,
[43] = 2,
[37] = 1,
[45] = 1,
[53] = 1,
[61] = 1,
[40] = 1,
[59] = 1,
[62] = 1,
},
["ActiveWarCampaignMissions"] = {
1895, -- [1]
1907, -- [2]
},
["numFollowers"] = 25,
["Abilities"] = {
[106] = 3,
[122] = 1,
[148] = 2,
[150] = 1,
[6] = 1,
[108] = 2,
[124] = 1,
[10] = 2,
[125] = 1,
[154] = 1,
[126] = 2,
[156] = 1,
[157] = 1,
[127] = 1,
[159] = 1,
[128] = 1,
[160] = 3,
[161] = 2,
[114] = 2,
[132] = 2,
[115] = 1,
[100] = 1,
[11] = 2,
[138] = 1,
[102] = 2,
[171] = 1,
[172] = 2,
[173] = 1,
[104] = 1,
[147] = 1,
[151] = 1,
[105] = 1,
[121] = 1,
[146] = 1,
[182] = 1,
[118] = 1,
},
["numFollowersAtiLevel675"] = 17,
["AvailableWarCampaignMissions"] = {
1866, -- [1]
1882, -- [2]
1892, -- [3]
1912, -- [4]
2077, -- [5]
2135, -- [6]
2151, -- [7]
},
},
},
["Reference"] = {
["MissionInfos"] = {
[500] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122584,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[131] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[277] = {
["durationSeconds"] = 3600,
["type"] = "Treasure",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 50,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 32,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[1674] = {
["durationSeconds"] = 23040,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 890,
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[309] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 114131,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 630,
},
[163] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 800,
["tooltip"] = "+800 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+800 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 37,
},
[680] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 128310,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[179] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 0,
["level"] = 36,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 42,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[187] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["level"] = 32,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 34,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
},
[211] = {
["durationSeconds"] = 6750,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1050,
["tooltip"] = "+1,050 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,050 XP",
}, -- [1]
{
["icon"] = 1005027,
["quantity"] = 200,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [2]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 36,
},
[485] = {
["durationSeconds"] = 14400,
["type"] = "Engineering",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122591,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Engineering",
["iLevel"] = 0,
},
[262] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[278] = {
["durationSeconds"] = 3600,
["type"] = "Treasure",
["cost"] = 0,
["level"] = 33,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 50,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[310] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["itemID"] = 114822,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 630,
},
[682] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 128313,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[358] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 838813,
["quantity"] = 1,
["title"] = "Currency Reward",
["currencyID"] = 994,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[374] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 20,
["level"] = 36,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1400,
["tooltip"] = "+1,400 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,400 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[2141] = {
["durationSeconds"] = 64800,
["type"] = "8.0 - Generic Missions",
["cost"] = 40,
["rewards"] = {
{
["itemID"] = 168327,
["quantity"] = 1,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-Normal",
["iLevel"] = 800,
},
[2135] = {
["durationSeconds"] = 129600,
["type"] = "8.2 - Holiday Mission",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 33226,
["quantity"] = 15,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-HUB",
["iLevel"] = 800,
},
[454] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 660,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 122486,
["quantity"] = 1,
}, -- [1]
},
},
[683] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 128314,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[1914] = {
["durationSeconds"] = 28800,
["type"] = "8.0 - Generic Missions",
["cost"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 359,
["icon"] = 2065624,
["currencyID"] = 1553,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-Normal",
["iLevel"] = 800,
},
[2075] = {
["durationSeconds"] = 43200,
["type"] = "8.0 - Quick Strike",
["cost"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 375,
["icon"] = 2032596,
["currencyID"] = 1594,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-QuickStrike",
["iLevel"] = 800,
},
[263] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 15,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 114081,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[279] = {
["durationSeconds"] = 3600,
["type"] = "Treasure",
["cost"] = 10,
["level"] = 34,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 60,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[1682] = {
["durationSeconds"] = 230400,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 500,
["iLevel"] = 900,
["rewards"] = {
{
["itemID"] = 147505,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["level"] = 45,
},
[156] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 600,
["tooltip"] = "+600 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+600 XP",
}, -- [1]
},
["level"] = 35,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1896] = {
["durationSeconds"] = 43200,
["type"] = "8.0 - Generic Missions",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 75,
["icon"] = 2032595,
["currencyID"] = 1593,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-Normal",
["iLevel"] = 800,
},
[684] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 675,
["rewards"] = {
{
["itemID"] = 128315,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1683] = {
["durationSeconds"] = 57600,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 1000,
["level"] = 45,
["rewards"] = {
{
["itemID"] = 147509,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["iLevel"] = 900,
},
[188] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["level"] = 33,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 36,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[391] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 60,
["iLevel"] = 675,
["rewards"] = {
{
["icon"] = 1061300,
["quantity"] = 600,
["title"] = "Currency Reward",
["currencyID"] = 823,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[204] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 20,
["level"] = 39,
["rewards"] = {
{
["itemID"] = 114100,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[212] = {
["durationSeconds"] = 6750,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1200,
["tooltip"] = "+1,200 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,200 XP",
}, -- [1]
{
["title"] = "Currency Reward",
["quantity"] = 225,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [2]
},
["level"] = 37,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[220] = {
["durationSeconds"] = 3600,
["type"] = "Treasure",
["cost"] = 0,
["iLevel"] = 0,
["level"] = 31,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 48,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
},
[1888] = {
["durationSeconds"] = 14400,
["type"] = "8.0 - Generic Missions",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 75,
["icon"] = 2032596,
["currencyID"] = 1594,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-Normal",
["iLevel"] = 800,
},
[685] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 675,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 128316,
["quantity"] = 1,
}, -- [1]
},
},
[1892] = {
["durationSeconds"] = 28800,
["type"] = "8.0 - Generic Missions",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 257,
["icon"] = 2065624,
["currencyID"] = 1553,
}, -- [1]
},
["level"] = 50,
["typeAtlas"] = "BfAMission-Icon-Normal",
["iLevel"] = 800,
},
[503] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 60,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 123858,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[264] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 615,
["rewards"] = {
{
["itemID"] = 114081,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[280] = {
["durationSeconds"] = 3600,
["type"] = "Treasure",
["cost"] = 0,
["level"] = 35,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 65,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[1649] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 600,
["rewards"] = {
{
["itemID"] = 146950,
["quantity"] = 2,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[312] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 630,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 300,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
},
[261] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[686] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 675,
["rewards"] = {
{
["itemID"] = 128319,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[360] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 250,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
{
["itemID"] = 118100,
["quantity"] = 1,
}, -- [2]
},
},
[325] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 118531,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 645,
},
[171] = {
["durationSeconds"] = 1800,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 100,
["tooltip"] = "+100 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+100 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 30,
},
[1675] = {
["durationSeconds"] = 23040,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 890,
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[373] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1200,
["tooltip"] = "+1,200 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,200 XP",
}, -- [1]
},
["level"] = 35,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1752] = {
["durationSeconds"] = 20160,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 800,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 25,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[456] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 122486,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[1625] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 355,
["icon"] = 1397630,
["currencyID"] = 1220,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 880,
},
[488] = {
["durationSeconds"] = 21600,
["type"] = "Jewelcrafting",
["cost"] = 20,
["rewards"] = {
{
["itemID"] = 122592,
["quantity"] = 3,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Jewelcrafting",
["iLevel"] = 0,
},
[1630] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 890,
},
[170] = {
["durationSeconds"] = 7200,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1000,
["tooltip"] = "+1,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,000 XP",
}, -- [1]
},
},
[281] = {
["durationSeconds"] = 5400,
["type"] = "Treasure",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 65,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 37,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[297] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 30,
["level"] = 40,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 15000,
["tooltip"] = "+15,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+15,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[157] = {
["durationSeconds"] = 1800,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 600,
["tooltip"] = "+600 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+600 XP",
}, -- [1]
},
["level"] = 35,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[329] = {
["durationSeconds"] = 1800,
["type"] = "Training",
["cost"] = 5,
["level"] = 30,
["rewards"] = {
{
["itemID"] = 118474,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Training",
["iLevel"] = 0,
},
[173] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 0,
["rewards"] = {
{
["itemID"] = 6662,
["quantity"] = 10,
}, -- [1]
{
["title"] = "Currency Reward",
["quantity"] = 32,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [2]
},
["level"] = 31,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[361] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[377] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 20,
["level"] = 39,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 2000,
["tooltip"] = "+2,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+2,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1590] = {
["durationSeconds"] = 36000,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 1200,
["rewards"] = {
{
["itemID"] = 139795,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 890,
},
[182] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1000,
["tooltip"] = "+1,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,000 XP",
}, -- [1]
},
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1601] = {
["durationSeconds"] = 79200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 885,
["rewards"] = {
{
["icon"] = 803763,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[169] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 10,
["level"] = 39,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1000,
["tooltip"] = "+1,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[229] = {
["durationSeconds"] = 2700,
["type"] = "Patrol",
["cost"] = 10,
["level"] = 31,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 300,
["tooltip"] = "+300 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+300 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[484] = {
["durationSeconds"] = 21600,
["type"] = "Enchanting",
["cost"] = 20,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 122590,
["quantity"] = 3,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Enchanting",
["level"] = 40,
},
[245] = {
["durationSeconds"] = 3600,
["type"] = "Patrol",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1500,
["tooltip"] = "+1,500 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,500 XP",
}, -- [1]
},
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[480] = {
["durationSeconds"] = 21600,
["type"] = "Alchemy",
["cost"] = 20,
["rewards"] = {
{
["itemID"] = 122576,
["quantity"] = 3,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Alchemy",
["iLevel"] = 0,
},
[266] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[282] = {
["durationSeconds"] = 7200,
["type"] = "Treasure",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 70,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["level"] = 38,
},
[298] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 15000,
["tooltip"] = "+15,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+15,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[314] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 645,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 118529,
["quantity"] = 1,
}, -- [1]
},
},
[670] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 40,
["icon"] = 1131085,
["currencyID"] = 1101,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[1631] = {
["durationSeconds"] = 25200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[362] = {
["durationSeconds"] = 5400,
["type"] = "Training",
["cost"] = 0,
["level"] = 30,
["rewards"] = {
{
["itemID"] = 118427,
["quantity"] = 1,
}, -- [1]
{
["itemID"] = 118475,
["quantity"] = 1,
}, -- [2]
},
["typeAtlas"] = "GarrMission_MissionIcon-Training",
["iLevel"] = 0,
},
[1759] = {
["durationSeconds"] = 46080,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 25,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[394] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["iLevel"] = 660,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 120945,
["quantity"] = 20,
}, -- [1]
},
},
[1377] = {
["durationSeconds"] = 23040,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["rewards"] = {
{
["itemID"] = 116415,
["quantity"] = 5,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 830,
},
[114] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1505] = {
["durationSeconds"] = 57600,
["type"] = "7.0 Class Hall - Special Reward Missions",
["cost"] = 200,
["iLevel"] = 850,
["rewards"] = {
{
["itemID"] = 143328,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-BonusIcon-Desaturated",
["level"] = 45,
},
[115] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 10,
["level"] = 40,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1633] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 885,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["itemID"] = 147349,
["quantity"] = 1,
}, -- [1]
},
},
[1697] = {
["durationSeconds"] = 518400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 2000,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 7500,
["icon"] = 132775,
["currencyID"] = 1226,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[127] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[267] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[283] = {
["durationSeconds"] = 7200,
["type"] = "Treasure",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 75,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[1698] = {
["durationSeconds"] = 518400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 2000,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 500,
["icon"] = 803763,
["currencyID"] = 1342,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[315] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 645,
["rewards"] = {
{
["itemID"] = 118529,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[331] = {
["durationSeconds"] = 1800,
["type"] = "Patrol",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 100,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
{
["itemID"] = 27944,
["quantity"] = 1,
}, -- [2]
},
["level"] = 30,
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[1635] = {
["durationSeconds"] = 7200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["rewards"] = {
{
["itemID"] = 139792,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 885,
},
[1699] = {
["durationSeconds"] = 414720,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 1000,
["iLevel"] = 900,
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 250,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[379] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 60,
["iLevel"] = 675,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[118] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[336] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1061300,
["quantity"] = 1000,
["title"] = "Currency Reward",
["currencyID"] = 823,
}, -- [1]
{
["title"] = "Bonus Follower XP",
["followerXP"] = 20000,
["tooltip"] = "+20,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+20,000 XP",
}, -- [2]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[214] = {
["durationSeconds"] = 7200,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1500,
["tooltip"] = "+1,500 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,500 XP",
}, -- [1]
{
["title"] = "Currency Reward",
["quantity"] = 275,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [2]
},
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[493] = {
["durationSeconds"] = 14400,
["type"] = "Tailoring",
["cost"] = 20,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 122594,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Tailoring",
["level"] = 40,
},
[132] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 0,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 175,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1637] = {
["durationSeconds"] = 31680,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 890,
["rewards"] = {
{
["itemID"] = 139802,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[1600] = {
["durationSeconds"] = 5760,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 880,
["rewards"] = {
{
["itemID"] = 147349,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[254] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 615,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 12000,
["tooltip"] = "+12,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+12,000 XP",
}, -- [1]
},
},
[268] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 225,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[284] = {
["durationSeconds"] = 21600,
["type"] = "Treasure",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 100,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[300] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
},
[316] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 118529,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 645,
},
[471] = {
["durationSeconds"] = 14400,
["type"] = "Exploration",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 136086,
["quantity"] = 50,
["title"] = "Currency Reward",
["currencyID"] = 828,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Exploration",
["level"] = 31,
},
[1639] = {
["durationSeconds"] = 25200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 890,
},
[364] = {
["durationSeconds"] = 14400,
["type"] = "Provision",
["cost"] = 10,
["iLevel"] = 0,
["level"] = 30,
["typeAtlas"] = "GarrMission_MissionIcon-Provision",
["rewards"] = {
{
["itemID"] = 118428,
["quantity"] = 1,
}, -- [1]
},
},
[1767] = {
["durationSeconds"] = 34560,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 2400,
["rewards"] = {
{
["itemID"] = 124124,
["quantity"] = 4,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[396] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 60,
["iLevel"] = 675,
["rewards"] = {
{
["itemID"] = 120945,
["quantity"] = 30,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1640] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 890,
},
[1704] = {
["durationSeconds"] = 46080,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 500,
["iLevel"] = 950,
["rewards"] = {
{
["itemID"] = 152313,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["level"] = 45,
},
[189] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["level"] = 34,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 38,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
},
[663] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
},
[1641] = {
["durationSeconds"] = 32400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 895,
["rewards"] = {
{
["itemID"] = 147349,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[492] = {
["durationSeconds"] = 21600,
["type"] = "Leatherworking",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122596,
["quantity"] = 3,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Leatherworking",
["iLevel"] = 0,
},
[1769] = {
["durationSeconds"] = 69120,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 140587,
["quantity"] = 4,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[269] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 0,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 225,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[285] = {
["durationSeconds"] = 21600,
["type"] = "Treasure",
["cost"] = 0,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 100,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
},
[313] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 645,
["rewards"] = {
{
["itemID"] = 118529,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[159] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 700,
["tooltip"] = "+700 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+700 XP",
}, -- [1]
},
["level"] = 36,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[333] = {
["durationSeconds"] = 300,
["type"] = "Logistics",
["cost"] = 0,
["iLevel"] = 0,
["level"] = 30,
["typeAtlas"] = "GarrMission_MissionIcon-Logistics",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 100,
["tooltip"] = "+100 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+100 XP",
}, -- [1]
},
},
[175] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 34,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 32,
},
[183] = {
["durationSeconds"] = 1800,
["type"] = "Combat",
["cost"] = 0,
["level"] = 30,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 30,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[191] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 42,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 36,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[397] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 60,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[1644] = {
["durationSeconds"] = 64800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 895,
},
[429] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 660,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 122484,
["quantity"] = 1,
}, -- [1]
},
},
[445] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 400,
["icon"] = 1061300,
["currencyID"] = 823,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[231] = {
["durationSeconds"] = 2700,
["type"] = "Patrol",
["cost"] = 10,
["level"] = 35,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 900,
["tooltip"] = "+900 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+900 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[477] = {
["durationSeconds"] = 14400,
["type"] = "Exploration",
["cost"] = 15,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 100,
["icon"] = 136086,
["currencyID"] = 828,
}, -- [1]
},
["level"] = 38,
["typeAtlas"] = "GarrMission_MissionIcon-Exploration",
["iLevel"] = 0,
},
[1709] = {
["durationSeconds"] = 46080,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 1000,
["iLevel"] = 950,
["rewards"] = {
{
["itemID"] = 152321,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["level"] = 45,
},
[255] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 12000,
["tooltip"] = "+12,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+12,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[457] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122486,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[286] = {
["durationSeconds"] = 21600,
["type"] = "Treasure",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 100,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["level"] = 40,
},
[1710] = {
["durationSeconds"] = 57600,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 1000,
["level"] = 45,
["rewards"] = {
{
["itemID"] = 152326,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["iLevel"] = 950,
},
[1774] = {
["durationSeconds"] = 40320,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 152437,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[666] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1647] = {
["durationSeconds"] = 39600,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[483] = {
["durationSeconds"] = 14400,
["type"] = "Enchanting",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122590,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Enchanting",
["iLevel"] = 0,
},
[1634] = {
["durationSeconds"] = 21600,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 885,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["itemID"] = 140582,
["quantity"] = 1,
}, -- [1]
},
},
[398] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 400,
["icon"] = 1061300,
["currencyID"] = 823,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[1648] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["level"] = 45,
["rewards"] = {
{
["itemID"] = 146946,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[430] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 660,
["rewards"] = {
{
["itemID"] = 122484,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1776] = {
["durationSeconds"] = 34560,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 200,
["rewards"] = {
{
["itemID"] = 139811,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[116] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[120] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
},
[494] = {
["durationSeconds"] = 21600,
["type"] = "Tailoring",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122594,
["quantity"] = 3,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Tailoring",
["iLevel"] = 0,
},
[128] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 114616,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[271] = {
["durationSeconds"] = 21600,
["type"] = "Patrol",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 10000,
["tooltip"] = "+10,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+10,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["level"] = 40,
},
[1650] = {
["durationSeconds"] = 86400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["iLevel"] = 900,
["rewards"] = {
{
["itemID"] = 146943,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[303] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 630,
},
[160] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 700,
["tooltip"] = "+700 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+700 XP",
}, -- [1]
},
["level"] = 36,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[335] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 117492,
["quantity"] = 1,
}, -- [1]
{
["title"] = "Currency Reward",
["quantity"] = 250,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [2]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[176] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 36,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 33,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1796] = {
["durationSeconds"] = 23040,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["rewards"] = {
{
["itemID"] = 151568,
["quantity"] = 2,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[192] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 44,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 37,
},
[1588] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 600,
["iLevel"] = 870,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["itemID"] = 146950,
["quantity"] = 1,
}, -- [1]
},
},
[1652] = {
["durationSeconds"] = 86400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["iLevel"] = 900,
["rewards"] = {
{
["itemID"] = 146944,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[1055] = {
["durationSeconds"] = 14400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 100,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 5,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 35,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 760,
},
[1762] = {
["durationSeconds"] = 51840,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 200,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 25,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[669] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 615,
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 40,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[489] = {
["durationSeconds"] = 14400,
["type"] = "Inscription",
["cost"] = 20,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Inscription",
["rewards"] = {
{
["itemID"] = 122593,
["quantity"] = 2,
}, -- [1]
},
},
[495] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 400,
["icon"] = 1061300,
["currencyID"] = 823,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[256] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 25,
["level"] = 40,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 12000,
["tooltip"] = "+12,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+12,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[272] = {
["durationSeconds"] = 21600,
["type"] = "Patrol",
["cost"] = 10,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 10000,
["tooltip"] = "+10,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+10,000 XP",
}, -- [1]
},
},
[1654] = {
["durationSeconds"] = 14400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[304] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["iLevel"] = 630,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[168] = {
["durationSeconds"] = 7200,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 1000,
["tooltip"] = "+1,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+1,000 XP",
}, -- [1]
},
["level"] = 39,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1591] = {
["durationSeconds"] = 92160,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 450,
["iLevel"] = 875,
["rewards"] = {
{
["icon"] = 803763,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[1655] = {
["durationSeconds"] = 23040,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 895,
["rewards"] = {
{
["icon"] = 803763,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[178] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 600,
["tooltip"] = "+600 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+600 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 35,
},
[119] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1592] = {
["durationSeconds"] = 17280,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 600,
["iLevel"] = 885,
["rewards"] = {
{
["itemID"] = 147349,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[299] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["level"] = 40,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 15000,
["tooltip"] = "+15,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+15,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[190] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 40,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 35,
},
[323] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 118531,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 645,
},
[1646] = {
["durationSeconds"] = 18000,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[1657] = {
["durationSeconds"] = 14400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["itemID"] = 139814,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 895,
},
[496] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["iLevel"] = 660,
["rewards"] = {
{
["itemID"] = 120945,
["quantity"] = 20,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[257] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 615,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 12000,
["tooltip"] = "+12,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+12,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[273] = {
["durationSeconds"] = 28800,
["type"] = "Patrol",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 10000,
["tooltip"] = "+10,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+10,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[1658] = {
["durationSeconds"] = 86400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 900,
},
[305] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 630,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[161] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 10,
["level"] = 36,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 700,
["tooltip"] = "+700 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+700 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[337] = {
["durationSeconds"] = 57600,
["type"] = "Training",
["cost"] = 25,
["rewards"] = {
{
["itemID"] = 118354,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Training",
["iLevel"] = 0,
},
[1659] = {
["durationSeconds"] = 14400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 15,
["icon"] = 236521,
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 895,
},
[185] = {
["durationSeconds"] = 3600,
["type"] = "Combat",
["cost"] = 0,
["level"] = 31,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 32,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[385] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
},
[201] = {
["durationSeconds"] = 6750,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 114099,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 36,
},
[1602] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["iLevel"] = 890,
["rewards"] = {
{
["icon"] = 803763,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[217] = {
["durationSeconds"] = 1800,
["type"] = "Treasure",
["cost"] = 0,
["level"] = 30,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 45,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[449] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122485,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[673] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 30,
["iLevel"] = 630,
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 50,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[130] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1766] = {
["durationSeconds"] = 69120,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 400,
["rewards"] = {
{
["itemID"] = 152957,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 950,
},
[258] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 114806,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[274] = {
["durationSeconds"] = 28800,
["type"] = "Patrol",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 10000,
["tooltip"] = "+10,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+10,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[380] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[306] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 30,
["iLevel"] = 630,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[428] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["iLevel"] = 660,
["rewards"] = {
{
["itemID"] = 122484,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[674] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 30,
["iLevel"] = 630,
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 50,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[399] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 60,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 600,
["icon"] = 1061300,
["currencyID"] = 823,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[476] = {
["durationSeconds"] = 14400,
["type"] = "Exploration",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 109585,
["quantity"] = 3,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Exploration",
["level"] = 36,
},
[1642] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 895,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
},
[402] = {
["durationSeconds"] = 21600,
["type"] = "Combat",
["cost"] = 10,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 118472,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 645,
},
[365] = {
["durationSeconds"] = 28800,
["type"] = "Training",
["cost"] = 25,
["iLevel"] = 0,
["level"] = 30,
["typeAtlas"] = "GarrMission_MissionIcon-Training",
["rewards"] = {
{
["itemID"] = 118354,
["quantity"] = 1,
}, -- [1]
},
},
[381] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 60,
["rewards"] = {
{
["itemID"] = 120945,
["quantity"] = 30,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[450] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 122486,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[117] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 10,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 8000,
["tooltip"] = "+8,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+8,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[1665] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["rewards"] = {
{
["itemID"] = 146950,
["quantity"] = 2,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 885,
},
[1708] = {
["durationSeconds"] = 57600,
["type"] = "7.0 Class Hall - Treasure Missions - Raid",
["cost"] = 1000,
["rewards"] = {
{
["itemID"] = 152318,
["quantity"] = 1,
}, -- [1]
},
["level"] = 45,
["typeAtlas"] = "ClassHall-TreasureIcon-Desaturated",
["iLevel"] = 950,
},
[259] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120301,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[275] = {
["durationSeconds"] = 28800,
["type"] = "Patrol",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 10000,
["tooltip"] = "+10,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+10,000 XP",
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["level"] = 40,
},
[1156] = {
["durationSeconds"] = 3600,
["type"] = "7.0 Class Hall - Campaign Missions",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 140377,
["quantity"] = 1,
}, -- [1]
},
["level"] = 37,
["typeAtlas"] = "ClassHall-QuestIcon-Desaturated",
["iLevel"] = 760,
},
[307] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 20,
["rewards"] = {
{
["itemID"] = 114622,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 630,
},
[162] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 10,
["iLevel"] = 0,
["level"] = 37,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 800,
["tooltip"] = "+800 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+800 XP",
}, -- [1]
},
},
[1603] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["level"] = 45,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 25,
["icon"] = 803763,
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 895,
},
[1667] = {
["durationSeconds"] = 28800,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 885,
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[665] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 25,
["icon"] = 1131085,
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[194] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 0,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1005027,
["quantity"] = 48,
["title"] = "Currency Reward",
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 39,
},
[1589] = {
["durationSeconds"] = 57600,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 300,
["iLevel"] = 880,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["itemID"] = 147349,
["quantity"] = 1,
}, -- [1]
},
},
[667] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["iLevel"] = 0,
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 25,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 40,
},
[1331] = {
["durationSeconds"] = 7200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 100,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 400,
["tooltip"] = "+400 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+400 XP",
}, -- [1]
},
["level"] = 36,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 760,
},
[451] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 122486,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
[677] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 60,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 150,
["icon"] = 1131085,
["currencyID"] = 1101,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[1669] = {
["durationSeconds"] = 21600,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 500,
["iLevel"] = 885,
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[499] = {
["durationSeconds"] = 36000,
["type"] = "Combat",
["cost"] = 25,
["rewards"] = {
{
["itemID"] = 122583,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[260] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 15,
["rewards"] = {
{
["itemID"] = 120302,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 615,
},
[276] = {
["durationSeconds"] = 36000,
["type"] = "Patrol",
["cost"] = 25,
["rewards"] = {
{
["title"] = "Bonus Follower XP",
["followerXP"] = 15000,
["tooltip"] = "+15,000 XP",
["icon"] = "Interface\\Icons\\XPBonus_Icon",
["name"] = "+15,000 XP",
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Patrol",
["iLevel"] = 0,
},
[1670] = {
["durationSeconds"] = 43200,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 600,
["level"] = 45,
["rewards"] = {
{
["itemID"] = 146946,
["quantity"] = 2,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["iLevel"] = 885,
},
[308] = {
["durationSeconds"] = 14400,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 630,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["itemID"] = 114746,
["quantity"] = 1,
}, -- [1]
},
},
[324] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 100,
["rewards"] = {
{
["itemID"] = 118531,
["quantity"] = 1,
}, -- [1]
},
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 645,
},
[678] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 127748,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[1671] = {
["durationSeconds"] = 34560,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 150,
["iLevel"] = 900,
["rewards"] = {
{
["icon"] = 803763,
["quantity"] = 50,
["title"] = "Currency Reward",
["currencyID"] = 1342,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[287] = {
["durationSeconds"] = 21600,
["type"] = "Treasure",
["cost"] = 0,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 100,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[200] = {
["durationSeconds"] = 5400,
["type"] = "Combat",
["cost"] = 20,
["iLevel"] = 0,
["rewards"] = {
{
["itemID"] = 114094,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["level"] = 35,
},
[672] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 30,
["iLevel"] = 630,
["level"] = 40,
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["rewards"] = {
{
["icon"] = 1131085,
["quantity"] = 50,
["title"] = "Currency Reward",
["currencyID"] = 1101,
}, -- [1]
},
},
[1672] = {
["durationSeconds"] = 50400,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 250,
["iLevel"] = 890,
["level"] = 45,
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["rewards"] = {
{
["icon"] = 236521,
["quantity"] = 15,
["title"] = "Currency Reward",
["currencyID"] = 1533,
}, -- [1]
},
},
[177] = {
["durationSeconds"] = 2700,
["type"] = "Combat",
["cost"] = 0,
["level"] = 34,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 38,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 0,
},
[242] = {
["durationSeconds"] = 5400,
["type"] = "Treasure",
["cost"] = 0,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 70,
["icon"] = 1005027,
["currencyID"] = 824,
}, -- [1]
},
["level"] = 37,
["typeAtlas"] = "GarrMission_MissionIcon-Trading",
["iLevel"] = 0,
},
[679] = {
["durationSeconds"] = 43200,
["type"] = "Combat",
["cost"] = 100,
["level"] = 40,
["rewards"] = {
{
["itemID"] = 128311,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 675,
},
[1673] = {
["durationSeconds"] = 8640,
["type"] = "7.0 Class Hall - Generic Missions",
["cost"] = 200,
["iLevel"] = 900,
["rewards"] = {
{
["itemID"] = 147905,
["quantity"] = 1,
}, -- [1]
},
["typeAtlas"] = "ClassHall-CombatIcon-Desaturated",
["level"] = 45,
},
[676] = {
["durationSeconds"] = 28800,
["type"] = "Combat",
["cost"] = 40,
["level"] = 40,
["rewards"] = {
{
["title"] = "Currency Reward",
["quantity"] = 75,
["icon"] = 1131085,
["currencyID"] = 1101,
}, -- [1]
},
["typeAtlas"] = "GarrMission_MissionIcon-Combat",
["iLevel"] = 660,
},
},
["FollowerNamesToID"] = {
["Beastmaster Hilaire"] = 744,
["Matron Mother Malevolence"] = 720,
["Rorin Rivershade"] = 358,
["Leena"] = 391,
["Margo Steelfinger"] = 372,
["Lesser Elementals"] = 785,
["Exodar Peacekeeper"] = 1070,
["Black Harvest Invokers"] = 767,
["Pitfighter Vaandaam"] = 176,
["Silver Hand Templar"] = 850,
["Kendall Covington"] = 283,
["Vindicator Boros"] = 479,
["Grimtotem Warrior"] = 993,
["Kirin Tor Invokers"] = 768,
["Zinnin Smythe"] = 618,
["Professor Felblast"] = 460,
["Marin Noggenfogger"] = 890,
["Lightforged Bulwark"] = 1059,
["Valeera Sanguinar"] = 891,
["Goldmane the Skinner"] = 170,
["Iven Page"] = 396,
["Syverandin Yewshade"] = 249,
["Emmarel Shadewarden"] = 593,
["Nuria Thornstorm"] = 98,
["Halsteth Ravenwood"] = 430,
["Nighthuntress Syrenne"] = 996,
["Talonpriest Ishaal"] = 218,
["Audra Stoneshield"] = 429,
["Avalanchion the Unbroken"] = 615,
["Permelia"] = 267,
["Stormsinger Taalos"] = 381,
["Ebon Ravagers"] = 905,
["Bren Swiftshot"] = 279,
["Nerus Moonfang"] = 1000,
["Orvar"] = 378,
["Dwarven Riflemen"] = 1063,
["Kimzee Pinchwhistle"] = 192,
["Shandris Feathermoon"] = 1062,
["Kinndy Brightsocket"] = 348,
["Ginnwin Grindspinner"] = 88,
["Rebecca Stirling"] = 300,
["Kayt Miccoats"] = 407,
["Silvermoon Sorceress"] = 1070,
["Chen Stormstout"] = 596,
["Dagg"] = 32,
["Tell'machrim Stormvigil"] = 423,
["Fink Fastneedle"] = 93,
["Hymdall"] = 711,
["Muln Earthfury"] = 614,
["Gnomeregan Mechano-Tanks"] = 1064,
["Illu'mina"] = 331,
["Lady Liadrin"] = 478,
["Haagios"] = 327,
["Shade of Akama"] = 719,
["Belouran"] = 390,
["Taoshi"] = 892,
["Dawnseeker Rukaryx"] = 462,
["Hester Blackember"] = 403,
["Jubeka Shadowbreaker"] = 619,
["Blook"] = 189,
["Loren Stormhoof"] = 742,
["Vindicator Heluun"] = 458,
["Truman Weaver"] = 353,
["Glirin"] = 211,
["Solar Priest Vayx"] = 582,
["King Ymiron"] = 712,
["Ariok"] = 474,
["Delvar Ironfist"] = 216,
["Gabriel Bybee"] = 270,
["Rulkan"] = 183,
["Fern Greenfoot"] = 384,
["Garvan Bitterstone"] = 397,
["Squad of Archers"] = 671,
["Seline Keihl"] = 251,
["Ashlen Swordbreaker"] = 87,
["Calia Menethil"] = 856,
["Void-Purged Krokul"] = 1058,
["Yalia Sagewhisper"] = 871,
["Soulbinder Tuulani"] = 205,
["Rehgar Earthfury"] = 612,
["Alonsus Faol"] = 875,
["John J. Keeshan"] = 1069,
["Pathfinders"] = 812,
["Hemet Nesingwary"] = 745,
["Kariel Whisperwind"] = 112,
["Esara Verrinde"] = 726,
["Ebba Stormfist"] = 387,
["Len-Shu"] = 118,
["Catherine Magruder"] = 271,
["Pallas"] = 580,
["Ashtongue Warriors"] = 879,
["Koltira Deathweaver"] = 599,
["Tiger Initates"] = 656,
["Adelaide Kane"] = 227,
["Lucretia Ainsworth"] = 103,
["Makaaria the Cursed"] = 239,
["Weldon Barov"] = 195,
["Water Elemental"] = 660,
["Sol"] = 872,
["Mina Kunis"] = 439,
["Hobart Grapplehammer"] = 1068,
["Delma Ironsafe"] = 333,
["Lady S'theno"] = 990,
["Fleet Admiral Tethys"] = 780,
["Angus Ironfist"] = 605,
["Rexxar"] = 743,
["Croman"] = 177,
["Bloodfang Stalkers"] = 1071,
["Skip Burnbright"] = 293,
["Valarjar Aspirants"] = 858,
["Meatball"] = 203,
["Vanessa VanCleef"] = 591,
["Aethas Sunreaver"] = 994,
["Apprentice Artificer Andren"] = 184,
["Lord Maxwell Tyrosus"] = 480,
["Darkspear Shaman"] = 1066,
["Kanrethad Ebonlocke"] = 997,
["Peng Stealthpaw"] = 366,
["Svergan Stormcloak"] = 710,
["Dvalen Ironrune"] = 714,
["Admiral Taylor"] = 204,
["Highlord Darion Mograine"] = 855,
["Kirandros Galeheart"] = 260,
["Veiled Riftblades"] = 1178,
["High Inquisitor Whitemane"] = 839,
["The Great Akazamzarak"] = 995,
["Cleric Maluuf"] = 459,
["Mia Linn"] = 399,
["Falstad Wildhammer"] = 1065,
["Tiger Adepts"] = 692,
["Netherlight Paragons"] = 924,
["Allari the Souleater"] = 499,
["Osgar Smitehammer"] = 325,
["Ahm"] = 208,
["Reina Morningchill"] = 304,
["Thisalee Crow"] = 217,
["Ziri'ak"] = 168,
["Torin Coalheart"] = 229,
["Shelly Hamby"] = 182,
["Oronok Torn-heart"] = 468,
["Vindicator Onaala"] = 186,
["The Monkey King"] = 602,
["Natalie Seline"] = 874,
["Abu'gar"] = 209,
["Lord Darius Crowley"] = 989,
["Maul Dethwidget"] = 233,
["Talon Guard Kurekk"] = 224,
["Pack of Imps"] = 734,
["Araspeth"] = 92,
["Delas Moonfang"] = 756,
["Daniel Montoy"] = 413,
["Humbolt Briarblack"] = 402,
["Crew of Pirates"] = 907,
["Verroak Greenheart"] = 256,
["Kiruud the Relentless"] = 421,
["Ox Masters"] = 696,
["Edith Shareflagon"] = 441,
["Lantresor of the Blade"] = 157,
["Arctic Whitemace"] = 347,
["Squad of Squires"] = 674,
["Fasani"] = 357,
["Ursila Hudsen"] = 261,
["Arator the Redeemer"] = 758,
["Consular Celestos"] = 610,
["Kymba Quickwidget"] = 376,
["Magister Serena"] = 154,
["Sever Frostsprocket"] = 234,
["Navea the Purifier"] = 393,
["Kage Satsuke"] = 253,
["Songla"] = 344,
["Kira Iresoul"] = 617,
["Rangari Erdanii"] = 212,
["Rottgut"] = 853,
["Fo Sho Knucklebump"] = 436,
["Leorajh"] = 219,
["Nightborne Warpcasters"] = 1177,
["Dark Iron Shadowcasters"] = 1179,
["Marguun"] = 114,
["Thoras Trollbane"] = 838,
["Highmountain Warbraves"] = 1178,
["Rykki Lyndgarf"] = 404,
["Mirran Lichbane"] = 117,
["Forsaken Dreadguards"] = 1064,
["Arcanist Valtrois"] = 1065,
["Image of Archmage Vargoth"] = 190,
["Rajani Sparkcallers"] = 1187,
["Magister Umbric"] = 1072,
["Magatha Grimtotem"] = 992,
["Mechagnome Spidercrawlers"] = 1185,
["Taran Zhu"] = 603,
["Pack of Ghouls"] = 896,
["Nat Pagle"] = 202,
["Grand Admiral Jes-Tereth"] = 1182,
["Lightforged Dragoons"] = 1177,
["Dread-Admiral Tattersail"] = 1182,
["Darnassian Sentinels"] = 1066,
["Calydus"] = 616,
["Harrison Jones"] = 465,
["Orrindis Raindrinker"] = 440,
["Hiro"] = 606,
["Master Mathias Shaw"] = 893,
["Hodir"] = 715,
["Stormcaller Mylra"] = 608,
["Jace Darkweaver"] = 807,
["Renthal Bloodfang"] = 99,
["Goblin Sappers"] = 1071,
["Farseer Nobundo"] = 611,
["Fiona"] = 180,
["Fen Tao"] = 467,
["Princess Tess Greymane"] = 988,
["Nudan"] = 109,
["Karyn Whitmoor"] = 414,
["Bernhard Hammerdown"] = 326,
["Arebia Wintercall"] = 237,
["Zian"] = 389,
["Daleera Moonfang"] = 463,
["Lorcan Flintedge"] = 375,
["Innes Shieldshatter"] = 419,
["Kitara Mae"] = 442,
["Lord Jorach Ravenholdt"] = 779,
["Abomination"] = 942,
["Esmund Brightshield"] = 289,
["Lulubelle Fizzlebang"] = 590,
["Zabra Hexx"] = 870,
["Aerik Matthews"] = 406,
["Defender Illona"] = 207,
["Fingall Flamehammer"] = 388,
["Millhouse Manastorm"] = 455,
["Kai Earthwhisper"] = 386,
["Aegira"] = 607,
["Dowser Bigspark"] = 581,
["Thassarian"] = 584,
["Raquel Deyling"] = 324,
["Huntsman Blake"] = 747,
["Mariella Ward"] = 873,
["Valkyra Shieldmaidens"] = 852,
["Pleasure-Bot 8000"] = 171,
["High Priestess Ishanah"] = 857,
["Rangari Chel"] = 185,
["Halduron Brightwing"] = 748,
["Lilian Voss"] = 1062,
["Shadow Hunter Ty'jin"] = 1072,
["Voraatios the Benedictive"] = 339,
["Kathrena Winterwisp"] = 284,
["Qiana Moonshadow"] = 34,
["7th Legion Shocktroopers"] = 1067,
["Belath Dawnblade"] = 594,
["Kul Tiran Marines"] = 1184,
["Finna Bjornsdottir"] = 709,
["\"Doc\" Schweitzer"] = 342,
["Eredar Twins"] = 621,
["Justicar Julia Celeste"] = 755,
["Thorim"] = 713,
["Artificer Romuul"] = 179,
["Minerva Ravensorrow"] = 1003,
["Eunna Young"] = 424,
["Band of Zealots"] = 928,
["Kor'vas Bloodthorn"] = 721,
["Krokul Ridgestalker"] = 1055,
["Bridgette Hicks"] = 417,
["Rin Starsong"] = 101,
["Justine DeGroot"] = 359,
["Rangari Kaalya"] = 159,
["Bemora"] = 107,
["Duke Hydraxis"] = 609,
["Ultan Blackgorge"] = 243,
["Danaeris Amberstar"] = 297,
["Soulare of Andorhal"] = 172,
["Archmage Vargoth"] = 762,
["Phylarch the Evergreen"] = 194,
["Brewer Almai"] = 998,
["Ragnvald Drakeborn"] = 708,
["Hulda Shadowblade"] = 453,
["Aelthalyste"] = 1002,
["Baron Scaldius"] = 613,
["Dramnur Doombrow"] = 115,
["Kihra"] = 247,
["Ranni Flagdabble"] = 411,
["Ritssyn Flamescowl"] = 589,
["Kayn Sunfury"] = 595,
["Selis"] = 428,
["Bruma Swiftstone"] = 153,
["Ox Adepts"] = 689,
["Sarah Schnau"] = 259,
["Arcane Destroyer"] = 724,
["Archmage Kalec"] = 716,
["Nazgrim"] = 586,
["Bastiana Moran"] = 280,
["Noah Munck"] = 328,
["Herrathos Starstaff"] = 346,
["Joachim Demonsbane"] = 105,
["Leeroy Jenkins"] = 178,
["Nordaerin Silverbeam"] = 290,
["Kelsey Steelspark"] = 1068,
["Thurman Belva"] = 446,
["Honora Keystone"] = 343,
["Domnall Icecrag"] = 301,
["Miall"] = 155,
["Tormmok"] = 193,
["Thaal'kos Thundersong"] = 266,
["Gwynlan Rainglow"] = 449,
["Lothraxion"] = 759,
["Archmage Modera"] = 717,
["Zelena Moonbreak"] = 369,
["Aknor Steelbringer"] = 225,
["Amal'thazad"] = 854,
["Asha Ravensong"] = 722,
["Antone Sula"] = 363,
["Defias Thieves"] = 912,
["Ravandwyr"] = 725,
["Dessee Crashcrank"] = 427,
["Shinfel Blightsworn"] = 620,
["Addie Fizzlebog"] = 746,
["Aponi Brightmane"] = 757,
["Tushui Monks"] = 1073,
["Shattered Hand Specialist"] = 1067,
["Meryl Felstorm"] = 761,
["Sylara Steelsong"] = 604,
["Li Li Stormstout"] = 588,
["Zandalari Wingriders"] = 1184,
["Mag'har Outriders"] = 1179,
["Garona Halforcen"] = 466,
},
},
},
}
| mit |
nerdkunde/website | templates/plugins/podlove/podlove/podlove-web-player.js | 108881 | /*
* ===========================================
* Podlove Web Player v2.0.13
* Licensed under The BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
* ===========================================
*/
/*jslint browser: true, plusplus: true, unparam: true, vars: true, white: true */
/*global window, jQuery */
/*!
* MediaElement.js
* HTML5 <video> and <audio> shim and player
* http://mediaelementjs.com/
*
* Creates a JavaScript object that mimics HTML5 MediaElement API
* for browsers that don't understand HTML5 or can't play the provided codec
* Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
*
* Copyright 2010-2012, John Dyer (http://j.hn)
* License: MIT
*
*/var mejs=mejs||{};mejs.version="2.11.0";mejs.meIndex=0;
mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo",
"video/x-vimeo"]}]};
mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script"),h=f.length,l=a.length;b<h;b++){g=f[b].src;for(c=0;c<l;c++){e=a[c];if(g.indexOf(e)>
-1){d=g.substring(0,g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0],
10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,h=0;if(c)f=parseInt(a[3])/d;return h=b*3600+e*60+g+f},convertSMPTEtoSeconds:function(a){if(typeof a!="string")return false;a=a.replace(",",".");var b=0,c=a.indexOf(".")!=-1?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++){d=1;if(e>0)d=Math.pow(60,e);b+=Number(a[e])*d}return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);if(b&&/object|embed/i.test(b.nodeName))if(mejs.MediaFeatures.isIE){b.style.display=
"none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}};
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!==
null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.isOpera=d.match(/opera/gi)!==null;a.hasTouch="ontouchstart"in window;a.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";
a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen;a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;
else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen();else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.src=c.src;break}}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={};this.attributes={}};
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,tagName:"",muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused=
false}},pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably"}return""},
positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(a,b,c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));
this.src=mejs.Utility.absolutizeUrl(a);break}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a);
this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&
this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},hasAttribute:function(a){return a in
this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id);mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}};
mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},unregisterPluginElement:function(a){delete this.pluginMediaElements[a];delete this.htmlMediaElements[a]},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);
b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,c)}},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}};
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8,
success:function(){},error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;l=typeof l=="undefined"||l===null||l==="false"?
"none":l;h=!(typeof h=="undefined"||h===null||h==="false");j=!(typeof j=="undefined"||j===null||j==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,h,l)}else if(k.method!=="")return this.createPlugin(k,c,e,h,l,j);else{this.createErrorMessage(k,c,e);return this}},
determinePlayback:function(a,b,c,d,e){var g=[],f,h,l,j={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){l=this.formatType(e,a.getAttribute("type"));g.push({type:l,url:e})}else for(f=0;f<a.childNodes.length;f++){h=a.childNodes[f];if(h.nodeType==1&&h.tagName.toLowerCase()=="source"){e=h.getAttribute("src");
l=this.formatType(e,h.getAttribute("type"));h=h.getAttribute("media");if(!h||!window.matchMedia||window.matchMedia&&window.matchMedia(h).matches)g.push({type:l,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)j.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="native")){if(!d){f=document.createElement(j.isVideo?
"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";j.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,"")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){j.method="native";j.url=g[f].url;break}if(j.method==="native"){if(j.url!==null)a.src=j.url;if(b.mode!=="auto_plugin")return j}}if(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="shim")for(f=0;f<g.length;f++){l=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];
h=mejs.plugins[e];for(c=0;c<h.length;c++){k=h[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(l==k.types[d]){j.method=e;j.url=g[f].url;return j}}}}if(b.mode==="auto_plugin"&&j.method==="native")return j;if(j.method===""&&g.length>0)j.url=g[0].url;return j},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];a=a.substring(a.lastIndexOf(".")+
1);return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+this.getTypeFromExtension(a)},getTypeFromExtension:function(a){switch(a){case "mp4":case "m4v":return"mp4";case "webm":case "webma":case "webmv":return"webm";case "ogg":case "oga":case "ogv":return"ogg";default:return a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=
c!==""?'<a href="'+a.url+'"><img src="'+c+'" width="100%" height="100%" /></a>':'<a href="'+a.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>";d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,h=1,l="me_"+a.method+"_"+mejs.meIndex++,j=new mejs.PluginMediaElement(l,a.method,a.url),k=document.createElement("div"),m;j.tagName=c.tagName;for(m=0;m<c.attributes.length;m++){var n=c.attributes[m];n.specified==true&&j.setAttribute(n.name,
n.value)}for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);break}m=m.parentNode}if(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;h=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);h=mejs.Utility.encodeUrl(h)}else if(b.enablePluginDebug){f=
320;h=240}j.success=b.success;mejs.MediaPluginBridge.registerPluginElement(l,j,c);k.className="me-plugin";k.id=l+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+l,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+h];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):
d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+l+'" name="'+l+'" width="'+f+'" height="'+h+'" class="mejs-shim"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+
b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+l+'" width="'+f+'" height="'+h+'" class="mejs-shim"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML=
'<embed id="'+l+'" name="'+l+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+h+'" class="mejs-shim"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:j,pluginId:l,
videoId:b,height:h,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":j.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<iframe src="http://player.vimeo.com/video/'+j.vimeoid+'?portrait=0&byline=0&title=0" width="'+f+'" height="'+h+'" frameborder="0" class="mejs-shim"></iframe>'}c.style.display="none";return j},updateNative:function(a,b){var c=a.htmlMediaElement,
d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,
{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=
a;var b,c="http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim"><param name="movie" value="'+
c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=
document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;
c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement;
(function(a,b,c){var d={locale:{strings:{}},methods:{}};d.locale.getLanguage=function(){return{language:navigator.language}};d.locale.INIT_LANGUAGE=d.locale.getLanguage();d.methods.checkPlain=function(e){var g,f,h={"&":"&",'"':""","<":"<",">":">"};e=String(e);for(g in h)if(h.hasOwnProperty(g)){f=RegExp(g,"g");e=e.replace(f,h[g])}return e};d.methods.formatString=function(e,g){for(var f in g){switch(f.charAt(0)){case "@":g[f]=d.methods.checkPlain(g[f]);break;case "!":break;default:g[f]=
'<em class="placeholder">'+d.methods.checkPlain(g[f])+"</em>"}e=e.replace(f,g[f])}return e};d.methods.t=function(e,g,f){if(d.locale.strings&&d.locale.strings[f.context]&&d.locale.strings[f.context][e])e=d.locale.strings[f.context][e];if(g)e=d.methods.formatString(e,g);return e};d.t=function(e,g,f){if(typeof e==="string"&&e.length>0){var h=d.locale.getLanguage();f=f||{context:h.language};return d.methods.t(e,g,f)}else throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."};
};c.i18n=d})(jQuery,document,mejs);(function(a){a.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schlie\u00dfen"}})(mejs.i18n.locale.strings);
/*!
* MediaElementPlayer
* http://mediaelementjs.com/
*
* Creates a controller bar for HTML5 <video> add <audio> tags
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
*
* Copyright 2010-2012, John Dyer (http://j.hn/)
* License: MIT
*
*/if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return a.duration*0.05},defaultSeekForwardInterval:function(a){return a.duration*0.05},audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,autoRewind:true,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,hideVideoControlsOnLoad:false,
clickToPlayPause:true,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a,
b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen?
a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players={};mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);this.id="mep_"+mejs.mepIndex++;mejs.players[this.id]=
this;this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls",
"controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.options.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.container=f('<div id="'+a.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);
a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=a.isVideo?"video":"audio";d=b.substring(0,
1).toUpperCase()+b.substring(1);a.width=a.options[b+"Width"]>0||a.options[b+"Width"].toString().indexOf("%")>-1?a.options[b+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+d+"Width"];a.height=a.options[b+"Height"]>0||a.options[b+"Height"].toString().indexOf("%")>-1?a.options[b+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==
null?a.$media.attr("height"):a.options["default"+d+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c);a.container.trigger("controlsshown")},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true;b.container.trigger("controlsshown")});b.container.find(".mejs-control").css("visibility","visible").stop(true,
true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility","visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true;b.container.trigger("controlsshown")}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=
false;b.container.trigger("controlshidden")});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false;b.container.trigger("controlshidden")}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500;b.killControlsTimer("start");
b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay");
e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(d.isAndroid&&c.options.AndroidUseNativeControls)&&!(d.isiPad&&c.options.iPadUseNativeControls)&&!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=c.options.features[g];if(c["build"+d])try{c["build"+d](c,
c.controls,c.layers,c.media)}catch(l){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);else c.controlsEnabled&&c.showControls(false)});else{c.media.addEventListener("click",function(){if(c.options.clickToPlayPause)c.media.paused?c.media.play():c.media.pause()});c.container.bind("mouseenter mouseover",function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter");
c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1E3)})}c.options.hideVideoControlsOnLoad&&c.hideControls(false);e&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(j){if(c.options.videoHeight<=
0&&c.domNode.getAttribute("height")===null&&!isNaN(j.target.videoHeight)){c.setPlayerSize(j.target.videoWidth,j.target.videoHeight);c.setControlsSize();c.media.setVideoSize(j.target.videoWidth,j.target.videoHeight)}},false)}a.addEventListener("play",function(){for(var j in mejs.players){var k=mejs.players[j];k.id!=c.id&&c.options.pauseOtherPlayers&&!k.paused&&!k.ended&&k.pause();k.hasFocus=false}c.hasFocus=true},false);c.media.addEventListener("ended",function(){if(c.options.autoRewind)try{c.media.setCurrentTime(0)}catch(j){}c.media.pause();
c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();if(c.options.loop)c.media.play();else!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},false);c.media.addEventListener("loadedmetadata",function(){c.updateDuration&&c.updateDuration();c.updateCurrent&&c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,c.height);c.setControlsSize()},50);c.globalBind("resize",function(){c.isFullScreen||
mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}if(e&&a.pluginType=="native"){a.load();a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(a,
b){this.container.trigger("playerresize");if(typeof a!="undefined")this.width=a;if(typeof b!="undefined")this.height=b;if(this.height.toString().indexOf("%")>0||this.$node.css("max-width")==="100%"||this.$node[0].currentStyle&&this.$node[0].currentStyle.maxWidth==="100%"){var c=this.isVideo?this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth:this.options.defaultAudioWidth,d=this.isVideo?this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:
this.options.defaultVideoHeight:this.options.defaultAudioHeight,e=this.container.parent().closest(":visible").width();c=this.isVideo||!this.options.autosizeProgress?parseInt(e*d/c,10):d;if(this.container.parent()[0].tagName.toLowerCase()==="body"){e=f(window).width();c=f(window).height()}if(c!=0&&e!=0){this.container.width(e).height(c);this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%");this.isVideo&&this.media.setVideoSize&&this.media.setVideoSize(e,c);this.layers.children(".mejs-layer").width("100%").height("100%")}}else{this.container.width(this.width).height(this.height);
this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var e=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){e.each(function(){var g=f(this);if(g.css("position")!="absolute"&&g.is(":visible"))a+=f(this).outerWidth(true)});b=this.controls.width()-
a-(c.outerWidth(true)-c.width())}c.width(b-5);d.width(b-(d.outerWidth(true)-d.width()+5));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),
c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){var e=this;if(a.isVideo){var g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),l=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){if(e.options.clickToPlayPause)d.paused?
d.play():d.pause()});d.addEventListener("play",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();l.hide()},false);d.addEventListener("playing",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();l.hide()},false);d.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||j.show()},
false);d.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("canplay",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("error",function(){g.hide();b.find(".mejs-time-buffering").hide();l.show();l.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,d){this.globalBind("keydown",
function(e){if(a.hasFocus&&a.options.enableKeyboard){if(!a.isVideo)return;for(var g=0,l=a.options.keyActions.length;g<l;g++)for(var j=a.options.keyActions[g],k=0,s=j.keys.length;k<s;k++)if(e.keyCode==j.keys[k]){e.preventDefault();j.action(a,d,e.keyCode);return false}}return true});this.globalBind("click",function(e){if(f(e.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,d){d=f(d);a.tracks.push({srclang:d.attr("srclang")?
d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},
setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;for(a in this.options.features){b=this.options.features[a];if(this["clean"+b])try{this["clean"+b](this)}catch(c){}}this.media.pluginType==="native"?this.$media.prop("controls",true):this.media.remove();this.isDynamic||this.$node.insertBefore(this.container);mejs.players.splice(f.inArray(this,mejs.players),1);this.container.remove();this.globalUnbind();
delete this.node.player;delete mejs.players[this.id]}};(function(){function a(c,d){var e={d:[],w:[]};f.each((c||"").split(" "),function(g,l){e[b.test(l)?"w":"d"].push(l+"."+d)});e.d=e.d.join(" ");e.w=e.w.join(" ");return e}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,d,e){c=a(c,this.id);c.d&&f(document).bind(c.d,d,e);c.w&&f(window).bind(c.w,d,e)};mejs.MediaElementPlayer.prototype.globalUnbind=
function(c,d){c=a(c,this.id);c.d&&f(document).unbind(c.d,d);c.w&&f(window).unbind(c.w,d)}})();if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){a===false?this.each(function(){var b=jQuery(this).data("mediaelementplayer");b&&b.remove();jQuery(this).removeData("mediaelementplayer")}):this.each(function(){jQuery(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))});return this};f(document).ready(function(){f(".mejs-player").mediaelementplayer()});window.MediaElementPlayer=
mejs.MediaElementPlayer})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+'"></button></div>').appendTo(b).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);d.pause();b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left","0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));
b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$);
(function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(b);b.find(".mejs-time-buffering").hide();var e=
this,g=b.find(".mejs-time-total");c=b.find(".mejs-time-loaded");var l=b.find(".mejs-time-current"),j=b.find(".mejs-time-handle"),k=b.find(".mejs-time-float"),s=b.find(".mejs-time-float-current"),p=function(n){n=n.pageX;var h=g.offset(),q=g.outerWidth(true),m=0,o=m=0;if(d.duration){if(n<h.left)n=h.left;else if(n>q+h.left)n=q+h.left;o=n-h.left;m=o/q;m=m<=0.02?0:m*d.duration;r&&m!==d.currentTime&&d.setCurrentTime(m);if(!mejs.MediaFeatures.hasTouch){k.css("left",o);s.html(mejs.Utility.secondsToTimeCode(m));
k.show()}}},r=false;g.bind("mousedown",function(n){if(n.which===1){r=true;p(n);e.globalBind("mousemove.dur",function(h){p(h)});e.globalBind("mouseup.dur",function(){r=false;k.hide();e.globalUnbind(".dur")});return false}}).bind("mouseenter",function(){e.globalBind("mousemove.dur",function(n){p(n)});mejs.MediaFeatures.hasTouch||k.show()}).bind("mouseleave",function(){if(!r){e.globalUnbind(".dur");k.hide()}});d.addEventListener("progress",function(n){a.setProgressRail(n);a.setCurrentRail(n)},false);
d.addEventListener("timeupdate",function(n){a.setProgressRail(n);a.setCurrentRail(n)},false);e.loaded=c;e.total=g;e.current=l;e.handle=j},setProgressRail:function(a){var b=a!=undefined?a.target:this.media,c=null;if(b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration)c=b.buffered.end(0)/b.duration;else if(b&&b.bytesTotal!=undefined&&b.bytesTotal>0&&b.bufferedBytes!=undefined)c=b.bufferedBytes/b.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)c=a.loaded/a.total;if(c!==null){c=Math.min(1,
Math.max(0,c));this.loaded&&this.total&&this.loaded.width(this.total.width()*c)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=Math.round(this.total.width()*this.media.currentTime/this.media.duration),b=a-Math.round(this.handle.outerWidth(true)/2);this.current.width(a);this.handle.css("left",b)}}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" <span> | </span> "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,
b,c,d){if(b.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time"));else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");
f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(b)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},
false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){this.container.toggleClass("mejs-long-video",this.media.duration>3600);if(this.durationD&&(this.options.duration>0||this.media.duration))this.durationD.html(mejs.Utility.secondsToTimeCode(this.options.duration>0?this.options.duration:
this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=this,g=e.isVideo?e.options.videoVolume:e.options.audioVolume,l=g=="horizontal"?f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+
'"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(b):f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(b),
j=e.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),k=e.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),s=e.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),p=e.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),r=function(m,o){if(!j.is(":visible")&&typeof o=="undefined"){j.show();r(m,true);j.hide()}else{m=Math.max(0,m);m=Math.min(m,1);m==0?l.removeClass("mejs-mute").addClass("mejs-unmute"):l.removeClass("mejs-unmute").addClass("mejs-mute");
if(g=="vertical"){var t=k.height(),u=k.position(),v=t-t*m;p.css("top",Math.round(u.top+v-p.height()/2));s.height(t-v);s.css("top",u.top+v)}else{t=k.width();u=k.position();t=t*m;p.css("left",Math.round(u.left+t-p.width()/2));s.width(Math.round(t))}}},n=function(m){var o=null,t=k.offset();if(g=="vertical"){o=k.height();parseInt(k.css("top").replace(/px/,""),10);o=(o-(m.pageY-t.top))/o;if(t.top==0||t.left==0)return}else{o=k.width();o=(m.pageX-t.left)/o}o=Math.max(0,o);o=Math.min(o,1);r(o);o==0?d.setMuted(true):
d.setMuted(false);d.setVolume(o)},h=false,q=false;l.hover(function(){j.show();q=true},function(){q=false;!h&&g=="vertical"&&j.hide()});j.bind("mouseover",function(){q=true}).bind("mousedown",function(m){n(m);e.globalBind("mousemove.vol",function(o){n(o)});e.globalBind("mouseup.vol",function(){h=false;e.globalUnbind(".vol");!q&&g=="vertical"&&j.hide()});h=true;return false});l.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(){if(!h)if(d.muted){r(0);
l.removeClass("mejs-mute").addClass("mejs-unmute")}else{r(d.volume);l.removeClass("mejs-unmute").addClass("mejs-mute")}},false);if(e.container.is(":visible")){r(a.options.startVolume);a.options.startVolume===0&&d.setMuted(true);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}}}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,b,c,d){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){c=function(){if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen=true;a.setControlsSize()}else{a.isNativeFullScreen=
false;a.exitFullScreen()}};mejs.MediaFeatures.hasMozNativeFullScreen?a.globalBind(mejs.MediaFeatures.fullScreenEventName,c):a.container.bind(mejs.MediaFeatures.fullScreenEventName,c)}var e=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.fullscreenText+'"></button></div>').appendTo(b);if(e.media.pluginType==="native"||!e.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&
mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});else{var l=null;if(function(){var h=document.createElement("x"),q=document.documentElement,m=window.getComputedStyle;if(!("pointerEvents"in h.style))return false;h.style.pointerEvents="auto";h.style.pointerEvents="x";q.appendChild(h);m=m&&m(h,"").pointerEvents==="auto";q.removeChild(h);return!!m}()&&!mejs.MediaFeatures.isOpera){var j=false,k=function(){if(j){s.hide();p.hide();r.hide();g.css("pointer-events",
"");e.controls.css("pointer-events","");j=false}},s=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),p=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),r=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),n=function(){var h={position:"absolute",top:0,left:0};s.css(h);p.css(h);r.css(h);s.width(e.container.width()).height(e.container.height()-e.controls.height());h=g.offset().left-e.container.offset().left;fullScreenBtnWidth=
g.outerWidth(true);p.width(h).height(e.controls.height()).css({top:e.container.height()-e.controls.height()});r.width(e.container.width()-h-fullScreenBtnWidth).height(e.controls.height()).css({top:e.container.height()-e.controls.height(),left:h+fullScreenBtnWidth})};e.globalBind("resize",function(){n()});g.mouseover(function(){if(!e.isFullScreen){var h=g.offset(),q=a.container.offset();d.positionFullscreenButton(h.left-q.left,h.top-q.top,false);g.css("pointer-events","none");e.controls.css("pointer-events",
"none");s.show();r.show();p.show();n();j=true}});d.addEventListener("fullscreenchange",function(){k()})}else g.mouseover(function(){if(l!==null){clearTimeout(l);delete l}var h=g.offset(),q=a.container.offset();d.positionFullscreenButton(h.left-q.left,h.top-q.top,true)}).mouseout(function(){if(l!==null){clearTimeout(l);delete l}l=setTimeout(function(){d.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;e.globalBind("keydown",function(h){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||
e.isFullScreen)&&h.keyCode==27)a.exitFullScreen()})}},cleanfullscreen:function(a){a.exitFullScreen()},enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]);
a.isInIframe&&setTimeout(function c(){if(a.isNativeFullScreen)f(window).width()!==screen.width?a.exitFullScreen():setTimeout(c,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},
250);else{a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find(".mejs-shim").width("100%").height("100%");a.media.setVideoSize(f(window).width(),
f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=
docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=
false}}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles",hideCaptionsButtonWhenEmpty:true,toggleCaptionsButtonWhenOnlyOne:false,slidesSelector:""});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,d){if(a.tracks.length!=0){a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).hide();a.captions=f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>').prependTo(c).hide();a.captionsText=
a.captions.find(".mejs-captions-text");a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b);for(b=c=0;b<a.tracks.length;b++)a.tracks[b].kind=="subtitles"&&c++;
this.options.toggleCaptionsButtonWhenOnlyOne&&c==1?a.captionsButton.on("click",function(){a.setTrack(a.selectedTrack==null?a.tracks[0].srclang:"none")}):a.captionsButton.hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility","hidden")}).on("click","input[type=radio]",function(){lang=this.value;a.setTrack(lang)});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):
a.container.bind("controlsshown",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(b=0;b<a.tracks.length;b++)a.tracks[b].kind=="subtitles"&&a.addTrackButton(a.tracks[b].srclang,a.tracks[b].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},
false);if(a.options.slidesSelector!=""){a.slidesContainer=f(a.options.slidesSelector);d.addEventListener("timeupdate",function(){a.displaySlides()},false)}d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility","visible");a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight())}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");
f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},setTrack:function(a){var b;if(a=="none"){this.selectedTrack=null;this.captionsButton.removeClass("mejs-captions-enabled")}else for(b=0;b<this.tracks.length;b++)if(this.tracks[b].srclang==a){this.selectedTrack==null&&this.captionsButton.addClass("mejs-captions-enabled");this.selectedTrack=this.tracks[b];this.captions.attr("lang",this.selectedTrack.srclang);this.displayCaptions();break}},
loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else{this.isLoadingTrack=false;this.checkForTracks()}},loadTrack:function(a){var b=this,c=b.tracks[a];f.ajax({url:c.src,dataType:"text",success:function(d){c.entries=typeof d=="string"&&/<tt\s+xml/ig.exec(d)?mejs.TrackFormatParser.dfxp.parse(d):mejs.TrackFormatParser.webvvt.parse(d);c.isLoaded=true;b.enableTrackButton(c.srclang,c.label);b.loadNextTrack();c.kind==
"chapters"&&b.media.addEventListener("play",function(){b.media.duration>0&&b.displayChapters(c)},false);c.kind=="slides"&&b.setupSlides(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||a;this.captionsButton.find("input[value="+a+"]").prop("disabled",false).siblings("label").html(b);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||
a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+
this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},checkForTracks:function(){var a=false;if(this.options.hideCaptionsButtonWhenEmpty){for(i=0;i<this.tracks.length;i++)if(this.tracks[i].kind=="subtitles"){a=true;break}if(!a){this.captionsButton.hide();this.setControlsSize()}}},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&
this.media.currentTime<=b.entries.times[a].stop){if(this.captionsText.html()!==b.entries.text[a]){if(this.isVideo){this.captionsText.html(b.entries.text[a]);this.captions.show().height(0)}this.container.trigger("subtitle",[b.entries.times[a].start,b.entries.times[a].stop,b.entries.text[a]])}return}this.captions.hide()}},setupSlides:function(a){this.slides=a;this.slides.entries.imgs=[this.slides.entries.text.length];this.showSlide(0)},showSlide:function(a){if(!(typeof this.tracks=="undefined"||typeof this.slidesContainer==
"undefined")){var b=this,c=b.slides.entries.text[a],d=b.slides.entries.imgs[a];if(typeof d=="undefined"||typeof d.fadeIn=="undefined")b.slides.entries.imgs[a]=d=f('<img src="'+c+'">').on("load",function(){d.appendTo(b.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()});else if(!d.is(":visible")&&!d.is(":animated")){console.log("showing existing slide");d.fadeIn().siblings(":visible").fadeOut()}}},displaySlides:function(){if(typeof this.slides!="undefined"){var a=this.slides,b;for(b=
0;b<a.entries.times.length;b++)if(this.media.currentTime>=a.entries.times[b].start&&this.media.currentTime<=a.entries.times[b].stop){this.showSlide(b);break}}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var b=this,c,d,e=d=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){d=a.entries.times[c].stop-a.entries.times[c].start;
d=Math.floor(d/b.media.duration*100);if(d+e>100||c==a.entries.times.length-1&&d+e<100)d=100-e;b.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[c].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+
"</span></div></div>"));e+=d}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat(f(this).attr("rel")));b.media.paused&&b.media.play()});b.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",
el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,
pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(a){var b=0;a=mejs.TrackFormatParser.split2(a,/\r?\n/);for(var c={text:[],times:[]},d,e;b<a.length;b++)if(this.pattern_identifier.exec(a[b])){b++;if((d=this.pattern_timecode.exec(a[b]))&&b<a.length){b++;e=a[b];for(b++;a[b]!==""&&b<a.length;){e=e+"\n"+a[b];b++}e=f.trim(e).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");
c.text.push(e);c.times.push({start:mejs.Utility.convertSMPTEtoSeconds(d[1])==0?0.2:mejs.Utility.convertSMPTEtoSeconds(d[1]),stop:mejs.Utility.convertSMPTEtoSeconds(d[3]),settings:d[5]})}}return c}},dfxp:{parse:function(a){a=f(a).filter("tt");var b=0;b=a.children("div").eq(0);var c=b.find("p");b=a.find("#"+b.attr("style"));var d,e;a={text:[],times:[]};if(b.length){e=b.removeAttr("id").get(0).attributes;if(e.length){d={};for(b=0;b<e.length;b++)d[e[b].name.split(":")[1]]=e[b].value}}for(b=0;b<c.length;b++){var g;
e={start:null,stop:null,style:null};if(c.eq(b).attr("begin"))e.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("begin"));if(!e.start&&c.eq(b-1).attr("end"))e.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b-1).attr("end"));if(c.eq(b).attr("end"))e.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("end"));if(!e.stop&&c.eq(b+1).attr("begin"))e.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b+1).attr("begin"));if(d){g="";for(var l in d)g+=l+":"+d[l]+";"}if(g)e.style=g;if(e.start==0)e.start=0.2;
a.times.push(e);e=f.trim(c.eq(b).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");a.text.push(e);if(a.times.start==0)a.times.start=2}return a}},split2:function(a,b){return a.split(b)}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,b){var c=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(b.test(d)){c.push(d.replace(b,""));d=""}}c.push(d);return c}})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]});
f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:true,
enableContextMenu:function(){this.isContextMenuEnabled=true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){for(var c=
this,d="",e=c.options.contextMenuItems,g=0,l=e.length;g<l;g++)if(e[g].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var j=e[g].render(c);if(j!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+j+"</div>"}c.contextMenu.empty().append(f(d)).css({top:b,left:a}).show();c.contextMenu.find(".mejs-contextmenu-item").each(function(){var k=f(this),s=parseInt(k.data("itemindex"),10),p=c.options.contextMenuItems[s];typeof p.show!="undefined"&&
p.show(k,c);k.click(function(){typeof p.click!="undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")});f.extend(MediaElementPlayer.prototype,{buildpostroll:function(a,b,c){var d=this.container.find('link[rel="postroll"]').attr("href");if(typeof d!=="undefined"){a.postroll=f('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+this.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(c).hide();this.media.addEventListener("ended",
function(){f.ajax({dataType:"html",url:d,success:function(e){c.find(".mejs-postroll-layer-content").html(e)}});a.postroll.show()},false)}}})})(mejs.$);
/*jslint browser: true, plusplus: true, white: true, unparam: true */
/*global jQuery, console */
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
"use strict";
return this.replace(/^\s+|\s+$/g, '');
};
}
(function ($) {
'use strict';
var startAtTime = false,
stopAtTime = false,
// Keep all Players on site
players = [],
// Timecode as described in http://podlove.org/deep-link/
// and http://www.w3.org/TR/media-frags/#fragment-dimensions
timecodeRegExp = /(?:(\d+):)?(\d+):(\d+)(\.\d+)?([,\-](?:(\d+):)?(\d+):(\d+)(\.\d+)?)?/,
ignoreHashChange = false,
// all used functions
zeroFill, generateTimecode, parseTimecode, checkCurrentURL, validateURL, setFragmentURL, updateChapterMarks, checkTime, addressCurrentTime, generateChapterTable, addBehavior, handleCookies;
/**
* return number as string lefthand filled with zeros
* @param number number
* @param width number
* @return string
**/
zeroFill = function (number, width) {
var s = number.toString();
while (s.length < width) {
s = "0" + s;
}
return s;
};
/**
* accepts array with start and end time in seconds
* returns timecode in deep-linking format
* @param times array
* @param forceHours bool (optional)
* @return string
**/
$.generateTimecode = function (times, leadingZeros, forceHours) {
function generatePart(time) {
var part, hours, minutes, seconds, milliseconds;
// prevent negative values from player
if (!time || time <= 0) {
return (leadingZeros || !time) ? (forceHours ? '00:00:00' : '00:00') : '--';
}
hours = Math.floor(time / 60 / 60);
minutes = Math.floor(time / 60) % 60;
seconds = Math.floor(time % 60) % 60;
milliseconds = Math.floor(time % 1 * 1000);
if (leadingZeros) {
// required (minutes : seconds)
part = zeroFill(minutes, 2) + ':' + zeroFill(seconds, 2);
hours = zeroFill(hours, 2);
hours = hours === '00' && !forceHours ? '' : hours + ':';
milliseconds = milliseconds ? '.' + zeroFill(milliseconds, 3) : '';
} else {
part = hours ? zeroFill(minutes, 2) : minutes.toString();
part += ':' + zeroFill(seconds, 2);
hours = hours ? hours + ':' : '';
milliseconds = milliseconds ? '.' + milliseconds : '';
}
return hours + part + milliseconds;
}
if (times[1] > 0 && times[1] < 9999999 && times[0] < times[1]) {
return generatePart(times[0]) + ',' + generatePart(times[1]);
}
return generatePart(times[0]);
};
generateTimecode = $.generateTimecode;
/**
* parses time code into seconds
* @param string timecode
* @return number
**/
parseTimecode = function (timecode) {
var parts, startTime = 0,
endTime = 0;
if (timecode) {
parts = timecode.match(timecodeRegExp);
if (parts && parts.length === 10) {
// hours
startTime += parts[1] ? parseInt(parts[1], 10) * 60 * 60 : 0;
// minutes
startTime += parseInt(parts[2], 10) * 60;
// seconds
startTime += parseInt(parts[3], 10);
// milliseconds
startTime += parts[4] ? parseFloat(parts[4]) : 0;
// no negative time
startTime = Math.max(startTime, 0);
// if there only a startTime but no endTime
if (parts[5] === undefined) {
return [startTime, false];
}
// hours
endTime += parts[6] ? parseInt(parts[6], 10) * 60 * 60 : 0;
// minutes
endTime += parseInt(parts[7], 10) * 60;
// seconds
endTime += parseInt(parts[8], 10);
// milliseconds
endTime += parts[9] ? parseFloat(parts[9]) : 0;
// no negative time
endTime = Math.max(endTime, 0);
return (endTime > startTime) ? [startTime, endTime] : [startTime, false];
}
}
return false;
};
checkCurrentURL = function () {
var deepLink;
deepLink = parseTimecode(window.location.href);
if (deepLink !== false) {
startAtTime = deepLink[0];
stopAtTime = deepLink[1];
}
};
validateURL = function (url) {
//de comment this to validate URLs, if you want use relative paths leave it so.
//var urlregex = /(^|\s)((https?:\/\/)?[\w\-]+(\.[\w\-]+)+\.?(:\d+)?(\/\S*)?)/gi;
//url = url.match(urlregex);
//return (url !== null) ? url[0] : url;
return url.trim();
};
/**
* add a string as hash in the adressbar
* @param string fragment
**/
setFragmentURL = function (fragment) {
window.location.hash = fragment;
};
/**
* handle Cookies
**/
handleCookies = {
getItem: function (sKey) {
if (!sKey || !this.hasItem(sKey)) {
return null;
}
return window.unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + window.escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
},
setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/.test(sKey)) {
return;
}
var sExpires = "";
if (vEnd) {
switch (typeof vEnd) {
case "number":
sExpires = "; max-age=" + vEnd;
break;
case "string":
sExpires = "; expires=" + vEnd;
break;
case "object":
if (vEnd.hasOwnProperty("toGMTString")) {
sExpires = "; expires=" + vEnd.toGMTString();
}
break;
}
}
document.cookie = window.escape(sKey) + "=" + window.escape(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
},
removeItem: function (sKey) {
if (!sKey || !this.hasItem(sKey)) {
return;
}
var oExpDate = new Date();
oExpDate.setDate(oExpDate.getDate() - 1);
document.cookie = window.escape(sKey) + "=; expires=" + oExpDate.toGMTString() + "; path=/";
},
hasItem: function (sKey) {
return (new RegExp("(?:^|;\\s*)" + window.escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
}
};
/**
* update the chapter list when the data is loaded
* @param object player
* @param object marks
**/
updateChapterMarks = function (player, marks) {
var coverimg = marks.closest('.podlovewebplayer_wrapper').find('.coverimg');
marks.each(function () {
var isBuffered, chapterimg = null,
mark = $(this),
startTime = mark.data('start'),
endTime = mark.data('end'),
isEnabled = mark.data('enabled'),
isActive = player.currentTime > startTime - 0.3 &&
player.currentTime <= endTime;
// prevent timing errors
if (player.buffered.length > 0) {
isBuffered = player.buffered.end(0) > startTime;
}
if (isActive) {
chapterimg = validateURL(mark.data('img'));
if ((chapterimg !== null) && (mark.hasClass('active'))) {
if ((coverimg.attr('src') !== chapterimg) && (chapterimg.length > 5)) {
coverimg.attr('src', chapterimg);
}
} else {
if (coverimg.attr('src') !== coverimg.data('img')) {
coverimg.attr('src', coverimg.data('img'));
}
}
mark.addClass('active').siblings().removeClass('active');
}
if (!isEnabled && isBuffered) {
$(mark).data('enabled', true).addClass('loaded').find('a[rel=player]').removeClass('disabled');
}
});
};
checkTime = function (e) {
if (players.length > 1) {
return;
}
var player = e.data.player;
if (startAtTime !== false &&
//Kinda hackish: Make sure that the timejump is at least 1 second (fix for OGG/Firefox)
(player.lastCheck === undefined || Math.abs(startAtTime - player.lastCheck) > 1)) {
player.setCurrentTime(startAtTime);
player.lastCheck = startAtTime;
startAtTime = false;
}
if (stopAtTime !== false && player.currentTime >= stopAtTime) {
player.pause();
stopAtTime = false;
}
};
addressCurrentTime = function (e) {
var fragment;
if (players.length === 1) {
fragment = 't=' + generateTimecode([e.data.player.currentTime]);
setFragmentURL(fragment);
}
};
/**
* Given a list of chapters, this function creates the chapter table for the player.
*/
generateChapterTable = function (params) {
var div, table, tbody, tempchapters, maxchapterstart, line, tc, chaptitle, next, chapterImages, rowDummy, i, scroll = '';
if (params.chapterHeight !== "") {
if (typeof parseInt(params.chapterHeight,10) === 'number') {
scroll = 'style="overflow-y: auto; max-height: ' + parseInt(params.chapterHeight, 10) + 'px;"';
}
}
div = $('<div class="podlovewebplayer_chapterbox showonplay" ' + scroll + '><table><caption>Podcast Chapters</caption><thead><tr><th scope="col">Chapter Number</th><th scope="col">Start time</th><th scope="col">Title</th><th scope="col">Duration</th></tr></thead><tbody></tbody></table></div>');
table = div.children('table');
tbody = table.children('tbody');
if ((params.chaptersVisible === 'true') || (params.chaptersVisible === true)) {
div.addClass('active');
}
table.addClass('podlovewebplayer_chapters');
if (params.chapterlinks !== 'false') {
table.addClass('linked linked_' + params.chapterlinks);
}
//prepare row data
tempchapters = params.chapters;
maxchapterstart = 0;
//first round: kill empty rows and build structured object
if (typeof params.chapters === 'string') {
tempchapters = [];
$.each(params.chapters.split("\n"), function (i, chapter) {
//exit early if this line contains nothing but whitespace
if (!/\S/.test(chapter)) {
return;
}
//extract the timestamp
line = $.trim(chapter);
tc = parseTimecode(line.substring(0, line.indexOf(' ')));
chaptitle = $.trim(line.substring(line.indexOf(' ')));
tempchapters.push({
start: tc[0],
code: chaptitle
});
});
} else {
// assume array of objects
$.each(tempchapters, function (key, value) {
value.code = value.title;
if (typeof value.start === 'string') {
value.start = parseTimecode(value.start)[0];
}
});
}
// order is not guaranteed: http://podlove.org/simple-chapters/
tempchapters = tempchapters.sort(function (a, b) {
return a.start - b.start;
});
//second round: collect more information
maxchapterstart = Math.max.apply(Math,
$.map(tempchapters, function (value, i) {
next = tempchapters[i + 1];
// we use `this.end` to quickly calculate the duration in the next round
if (next) {
value.end = next.start;
}
// we need this data for proper formatting
return value.start;
}));
//this is a "template" for each chapter row
chapterImages = false;
for (i = 0; i < tempchapters.length; i++) {
if ((tempchapters[i].image !== "") && (tempchapters[i].image !== undefined)) {
chapterImages = true;
}
}
if (chapterImages) {
rowDummy = $('<tr class="chaptertr" data-start="" data-end="" data-img=""><td class="starttime"><span></span></td><td class="chapterimage"></td><td class="chaptername"></td><td class="timecode">\n<span></span>\n</td>\n</tr>');
} else {
rowDummy = $('<tr class="chaptertr" data-start="" data-end="" data-img=""><td class="starttime"><span></span></td><td class="chaptername"></td><td class="timecode">\n<span></span>\n</td>\n</tr>');
}
//third round: build actual dom table
$.each(tempchapters, function (i) {
var finalchapter = !tempchapters[i + 1],
duration = Math.round(this.end - this.start),
forceHours,
row = rowDummy.clone();
//make sure the duration for all chapters are equally formatted
if (!finalchapter) {
this.duration = generateTimecode([duration], false);
} else {
if (params.duration === 0) {
this.end = 9999999999;
this.duration = '…';
} else {
this.end = params.duration;
this.duration = generateTimecode([Math.round(this.end - this.start)], false);
}
}
if (i % 2) {
row.addClass('oddchapter');
}
//deeplink, start and end
row.attr({
'data-start': this.start,
'data-end': this.end,
'data-img': (this.image !== undefined) ? this.image : ''
});
//if there is a chapter that starts after an hour, force '00:' on all previous chapters
forceHours = (maxchapterstart >= 3600);
//insert the chapter data
row.find('.starttime > span').text(generateTimecode([Math.round(this.start)], true, forceHours));
if (this.href !== undefined) {
if (this.href !== "") {
row.find('.chaptername').html('<span>' + this.code + '</span>' + ' <a href="' + this.href + '"></a>');
} else {
row.find('.chaptername').html('<span>' + this.code + '</span>');
}
} else {
row.find('.chaptername').html('<span>' + this.code + '</span>');
}
row.find('.timecode > span').html('<span>' + this.duration + '</span>');
if (chapterImages) {
if (this.image !== undefined) {
if (this.image !== "") {
row.find('.chapterimage').html('<img src="' + this.image + '"/>');
}
}
}
row.appendTo(tbody);
});
return div;
};
/**
* add chapter behavior and deeplinking: skip to referenced
* time position & write current time into address
* @param player object
*/
addBehavior = function (player, params, wrapper) {
var jqPlayer = $(player),
layoutedPlayer = jqPlayer,
canplay = false,
metainfo,
summary,
podlovewebplayer_timecontrol,
podlovewebplayer_sharebuttons,
podlovewebplayer_downloadbuttons,
chapterdiv,
list,
marks;
/**
* The `player` is an interface. It provides the play and pause functionality. The
* `layoutedPlayer` on the other hand is a DOM element. In native mode, these two
* are one and the same object. In Flash though the interface is a plain JS object.
*/
if (players.length === 1) {
// check if deeplink is set
checkCurrentURL();
}
// get things straight for flash fallback
if (player.pluginType === 'flash') {
layoutedPlayer = $('#mep_' + player.id.substring(9));
console.log(layoutedPlayer);
}
// cache some jQ objects
metainfo = wrapper.find('.podlovewebplayer_meta');
summary = wrapper.find('.summary');
podlovewebplayer_timecontrol = wrapper.find('.podlovewebplayer_timecontrol');
podlovewebplayer_sharebuttons = wrapper.find('.podlovewebplayer_sharebuttons');
podlovewebplayer_downloadbuttons = wrapper.find('.podlovewebplayer_downloadbuttons');
chapterdiv = wrapper.find('.podlovewebplayer_chapterbox');
list = wrapper.find('table');
marks = list.find('tr');
// fix height of summary for better toggability
summary.each(function () {
$(this).data('height', $(this).height() + 10);
if (!$(this).hasClass('active')) {
$(this).height('0px');
} else {
$(this).height($(this).find('div.summarydiv').height() + 10 + 'px');
}
});
chapterdiv.each(function () {
$(this).data('height', $(this).find('.podlovewebplayer_chapters').height());
if (!$(this).hasClass('active')) {
$(this).height('0px');
} else {
$(this).height($(this).find('.podlovewebplayer_chapters').height() + 'px');
}
});
if (metainfo.length === 1) {
metainfo.find('a.infowindow').click(function () {
summary.toggleClass('active');
if (summary.hasClass('active')) {
summary.height(summary.find('div.summarydiv').height() + 10 + 'px');
} else {
summary.height('0px');
}
return false;
});
metainfo.find('a.showcontrols').on('click', function () {
podlovewebplayer_timecontrol.toggleClass('active');
if (podlovewebplayer_sharebuttons !== undefined) {
if (podlovewebplayer_sharebuttons.hasClass('active')) {
podlovewebplayer_sharebuttons.removeClass('active');
} else if (podlovewebplayer_downloadbuttons.hasClass('active')) {
podlovewebplayer_downloadbuttons.removeClass('active');
}
}
return false;
});
metainfo.find('a.showsharebuttons').on('click', function () {
podlovewebplayer_sharebuttons.toggleClass('active');
if (podlovewebplayer_timecontrol.hasClass('active')) {
podlovewebplayer_timecontrol.removeClass('active');
} else if (podlovewebplayer_downloadbuttons.hasClass('active')) {
podlovewebplayer_downloadbuttons.removeClass('active');
}
return false;
});
metainfo.find('a.showdownloadbuttons').on('click', function () {
podlovewebplayer_downloadbuttons.toggleClass('active');
if (podlovewebplayer_timecontrol.hasClass('active')) {
podlovewebplayer_timecontrol.removeClass('active');
} else if (podlovewebplayer_sharebuttons.hasClass('active')) {
podlovewebplayer_sharebuttons.removeClass('active');
}
return false;
});
metainfo.find('.bigplay').on('click', function () {
if ($(this).hasClass('bigplay')) {
var playButton = $(this).parent().find('.bigplay');
if ((typeof player.currentTime === 'number') && (player.currentTime > 0)) {
if (player.paused) {
playButton.addClass('playing');
player.play();
} else {
playButton.removeClass('playing');
player.pause();
}
} else {
if (!playButton.hasClass('playing')) {
playButton.addClass('playing');
$(this).parent().parent().find('.mejs-time-buffering').show();
}
// flash fallback needs additional pause
if (player.pluginType === 'flash') {
player.pause();
}
player.play();
}
}
return false;
});
wrapper.find('.chaptertoggle').unbind('click').click(function () {
wrapper.find('.podlovewebplayer_chapterbox').toggleClass('active');
if (wrapper.find('.podlovewebplayer_chapterbox').hasClass('active')) {
wrapper.find('.podlovewebplayer_chapterbox').height(parseInt(wrapper.find('.podlovewebplayer_chapterbox').data('height'), 10) + 2 + 'px');
} else {
wrapper.find('.podlovewebplayer_chapterbox').height('0px');
}
return false;
});
wrapper.find('.prevbutton').click(function () {
if ((typeof player.currentTime === 'number') && (player.currentTime > 0)) {
if (player.currentTime > chapterdiv.find('.active').data('start') + 10) {
player.setCurrentTime(chapterdiv.find('.active').data('start'));
} else {
player.setCurrentTime(chapterdiv.find('.active').prev().data('start'));
}
} else {
player.play();
}
return false;
});
wrapper.find('.nextbutton').click(function () {
if ((typeof player.currentTime === 'number') && (player.currentTime > 0)) {
player.setCurrentTime(chapterdiv.find('.active').next().data('start'));
} else {
player.play();
}
return false;
});
wrapper.find('.rewindbutton').click(function () {
if ((typeof player.currentTime === 'number') && (player.currentTime > 0)) {
player.setCurrentTime(player.currentTime - 30);
} else {
player.play();
}
return false;
});
wrapper.find('.forwardbutton').click(function () {
if ((typeof player.currentTime === 'number') && (player.currentTime > 0)) {
player.setCurrentTime(player.currentTime + 30);
} else {
player.play();
}
return false;
});
wrapper.find('.currentbutton').click(function () {
window.prompt('This URL directly points to this episode', $(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href'));
return false;
});
wrapper.find('.tweetbutton').click(function () {
window.open('https://twitter.com/share?text=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '&url=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href')), 'tweet it', 'width=550,height=420,resizable=yes');
return false;
});
wrapper.find('.fbsharebutton').click(function () {
window.open('http://www.facebook.com/share.php?t=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '&u=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href')), 'share it', 'width=550,height=340,resizable=yes');
return false;
});
wrapper.find('.gplusbutton').click(function () {
window.open('https://plus.google.com/share?title=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '&url=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href')), 'plus it', 'width=550,height=420,resizable=yes');
return false;
});
wrapper.find('.adnbutton').click(function () {
window.open('https://alpha.app.net/intent/post?text=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '%20' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href')), 'plus it', 'width=550,height=420,resizable=yes');
return false;
});
wrapper.find('.mailbutton').click(function () {
window.location = 'mailto:?subject=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '&body=' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').text()) + '%20%3C' + encodeURIComponent($(this).closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href')) + '%3E';
return false;
});
wrapper.find('.fileselect').change(function () {
var dlurl, dlname;
$(this).parent().find(".fileselect option:selected").each(function () {
dlurl = $(this).data('dlurl');
});
$(this).parent().find(".downloadbutton").each(function () {
dlname = dlurl.split('/');
dlname = dlname[dlname.length - 1];
$(this).attr('href', dlurl);
$(this).attr('download', dlname);
});
return false;
});
wrapper.find('.openfilebutton').click(function () {
$(this).parent().find(".fileselect option:selected").each(function () {
window.open($(this).data('url'), 'Podlove Popup', 'width=550,height=420,resizable=yes');
});
return false;
});
wrapper.find('.fileinfobutton').click(function () {
$(this).parent().find(".fileselect option:selected").each(function () {
window.prompt('file URL:', $(this).val());
});
return false;
});
}
// chapters list
list
.show()
.delegate('.chaptertr', 'click', function (e) {
if ($(this).closest('table').hasClass('linked_all') || $(this).closest('tr').hasClass('loaded')) {
e.preventDefault();
var mark = $(this).closest('tr'),
startTime = mark.data('start');
//endTime = mark.data('end');
// If there is only one player also set deepLink
if (players.length === 1) {
// setFragmentURL('t=' + generateTimecode([startTime, endTime]));
setFragmentURL('t=' + generateTimecode([startTime]));
} else {
if (canplay) {
// Basic Chapter Mark function (without deeplinking)
player.setCurrentTime(startTime);
} else {
jqPlayer.one('canplay', function () {
player.setCurrentTime(startTime);
});
}
}
// flash fallback needs additional pause
if (player.pluginType === 'flash') {
player.pause();
}
player.play();
}
return false;
});
list
.show()
.delegate('.chaptertr a', 'click', function (e) {
if ($(this).closest('table').hasClass('linked_all') || $(this).closest('td').hasClass('loaded')) {
e.preventDefault();
window.open($(this)[0].href, '_blank');
}
return false;
});
// wait for the player or you'll get DOM EXCEPTIONS
// And just listen once because of a special behaviour in firefox
// --> https://bugzilla.mozilla.org/show_bug.cgi?id=664842
jqPlayer.one('canplay', function () {
canplay = true;
// add duration of final chapter
if (player.duration) {
marks.find('.timecode code').eq(-1).each(function () {
var start, end;
start = Math.floor($(this).closest('tr').data('start'));
end = Math.floor(player.duration);
$(this).text(generateTimecode([end - start]));
});
}
// add Deeplink Behavior if there is only one player on the site
if (players.length === 1) {
jqPlayer.bind('play timeupdate', {
player: player
}, checkTime)
.bind('pause', {
player: player
}, addressCurrentTime);
// disabled 'cause it overrides chapter clicks
// bind seeked to addressCurrentTime
checkCurrentURL();
// handle browser history navigation
jQuery(window).bind('hashchange onpopstate', function (e) {
if (!ignoreHashChange) {
checkCurrentURL();
}
ignoreHashChange = false;
});
}
});
// always update Chaptermarks though
jqPlayer
.on('timeupdate', function () {
updateChapterMarks(player, marks);
})
// update play/pause status
.on('play playing', function () {
if (!player.persistingTimer) {
player.persistingTimer = window.setInterval(function () {
if (players.length === 1) {
ignoreHashChange = true;
window.location.replace('#t=' + generateTimecode([player.currentTime, false]));
}
handleCookies.setItem('podloveWebPlayerTime-' + params.permalink, player.currentTime);
}, 5000);
}
list.find('.paused').removeClass('paused');
if (metainfo.length === 1) {
metainfo.find('.bigplay').addClass('playing');
}
})
.on('pause', function () {
window.clearInterval(player.persistingTimer);
player.persistingTimer = null;
if (metainfo.length === 1) {
metainfo.find('.bigplay').removeClass('playing');
}
});
};
$.fn.podlovewebplayer = function (options) {
// MEJS options default values
var mejsoptions = {
defaultVideoWidth: 480,
defaultVideoHeight: 270,
videoWidth: -1,
videoHeight: -1,
audioWidth: -1,
audioHeight: 30,
startVolume: 0.8,
loop: false,
enableAutosize: true,
features: ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'],
alwaysShowControls: false,
iPadUseNativeControls: false,
iPhoneUseNativeControls: false,
AndroidUseNativeControls: false,
alwaysShowHours: false,
showTimecodeFrameCount: false,
framesPerSecond: 25,
enableKeyboard: true,
pauseOtherPlayers: true,
duration: false,
plugins: ['flash', 'silverlight'],
pluginPath: './static/',
flashName: 'flashmediaelement.swf',
silverlightName: 'silverlightmediaelement.xap'
},
// Additional parameters default values
params = $.extend({}, {
chapterlinks: 'all',
width: '100%',
duration: false,
chaptersVisible: false,
timecontrolsVisible: false,
sharebuttonsVisible: false,
downloadbuttonsVisible: false,
summaryVisible: false,
hidetimebutton: false,
hidedownloadbutton: false,
hidesharebutton: false,
sharewholeepisode: false,
sources: []
}, options);
// turn each player in the current set into a Podlove Web Player
return this.each(function (index, player) {
var richplayer = false,
haschapters = false,
hiddenTab = false,
i = 0,
secArray,
orig,
deepLink,
wrapper,
summaryActive,
timecontrolsActive,
sharebuttonsActive,
downloadbuttonsActive,
size,
name,
downloadname,
selectform,
storageKey;
//fine tuning params
if (params.width.toLowerCase() === 'auto') {
params.width = '100%';
} else {
params.width = params.width.replace('px', '');
}
//audio params
if (player.tagName === 'AUDIO') {
if (params.audioWidth !== undefined) {
params.width = params.audioWidth;
}
mejsoptions.audioWidth = params.width;
//kill fullscreen button
$.each(mejsoptions.features, function (i) {
if (this === 'fullscreen') {
mejsoptions.features.splice(i, 1);
}
});
//video params
} else if (player.tagName === 'VIDEO') {
if (params.height !== undefined) {
mejsoptions.videoWidth = params.width;
mejsoptions.videoHeight = params.height;
}
if ($(player).attr('width') !== undefined) {
params.width = $(player).attr('width');
}
}
//duration can be given in seconds or in NPT format
if (params.duration && params.duration !== parseInt(params.duration, 10)) {
secArray = parseTimecode(params.duration);
params.duration = secArray[0];
}
//Overwrite MEJS default values with actual data
$.each(mejsoptions, function (key) {
if (params[key] !== undefined) {
mejsoptions[key] = params[key];
}
});
//wrapper and init stuff
if (params.width.toString().trim() === parseInt(params.width, 10).toString().trim()) {
params.width = params.width.toString().trim() + 'px';
}
orig = player;
player = $(player).clone().wrap('<div class="podlovewebplayer_wrapper" style="width: ' + params.width + '"></div>')[0];
wrapper = $(player).parent();
players.push(player);
//add params from html fallback area and remove them from the DOM-tree
$(player).find('[data-pwp]').each(function () {
params[$(this).data('pwp')] = $(this).html();
$(this).remove();
});
//add params from audio and video elements
$(player).find('source').each(function () {
if (params.sources !== undefined) {
params.sources.push($(this).attr('src'));
} else {
params.sources[0] = $(this).attr('src');
}
});
//build rich player with meta data
if (params.chapters !== undefined ||
params.title !== undefined ||
params.subtitle !== undefined ||
params.summary !== undefined ||
params.poster !== undefined ||
$(player).attr('poster') !== undefined) {
//set status variable
richplayer = true;
wrapper.addClass('podlovewebplayer_' + player.tagName.toLowerCase());
if (player.tagName === "AUDIO") {
//kill play/pause button from miniplayer
$.each(mejsoptions.features, function (i) {
if (this === 'playpause') {
mejsoptions.features.splice(i, 1);
}
});
wrapper.prepend('<div class="podlovewebplayer_meta"></div>');
wrapper.find('.podlovewebplayer_meta').prepend('<a class="bigplay" title="Play Episode" href="#"></a>');
if (params.poster !== undefined) {
wrapper.find('.podlovewebplayer_meta').append(
'<div class="coverart"><img class="coverimg" src="' + params.poster + '" data-img="' + params.poster + '" alt=""></div>');
}
if ($(player).attr('poster') !== undefined) {
wrapper.find('.podlovewebplayer_meta').append(
'<div class="coverart"><img src="' + $(player).attr('poster') + '" alt=""></div>');
}
}
if (player.tagName === "VIDEO") {
wrapper.prepend('<div class="podlovewebplayer_top"></div>');
wrapper.append('<div class="podlovewebplayer_meta"></div>');
}
if (params.title !== undefined) {
if (params.permalink !== undefined) {
wrapper.find('.podlovewebplayer_meta').append(
'<h3 class="episodetitle"><a href="' + params.permalink + '">' + params.title + '</a></h3>');
} else {
wrapper.find('.podlovewebplayer_meta').append(
'<h3 class="episodetitle">' + params.title + '</h3>');
}
}
if (params.subtitle !== undefined) {
wrapper.find('.podlovewebplayer_meta').append(
'<div class="subtitle">' + params.subtitle + '</div>');
} else {
if (params.title !== undefined) {
if ((params.title.length < 42) && (params.poster === undefined)) {
wrapper.addClass('podlovewebplayer_smallplayer');
}
}
wrapper.find('.podlovewebplayer_meta').append(
'<div class="subtitle"></div>');
}
//always render toggler buttons wrapper
wrapper.find('.podlovewebplayer_meta').append('<div class="togglers"></div>');
wrapper.on('playerresize', function () {
wrapper.find('.podlovewebplayer_chapterbox').data('height', wrapper.find('.podlovewebplayer_chapters').height());
if (wrapper.find('.podlovewebplayer_chapterbox').hasClass('active')) {
wrapper.find('.podlovewebplayer_chapterbox').height(parseInt(wrapper.find('.podlovewebplayer_chapterbox').data('height'), 10) + 2 + 'px');
}
wrapper.find('.summary').data('height', wrapper.find('.summarydiv').height());
if (wrapper.find('.summary').hasClass('active')) {
wrapper.find('.summary').height(wrapper.find('.summarydiv').height() + 'px');
}
});
if (params.summary !== undefined) {
summaryActive = "";
if (params.summaryVisible === true) {
summaryActive = " active";
}
wrapper.find('.togglers').append(
'<a href="#" class="infowindow infobuttons pwp-icon-info-circle" title="More information about this"></a>');
wrapper.find('.podlovewebplayer_meta').after(
'<div class="summary' + summaryActive + '"><div class="summarydiv">' + params.summary + '</div></div>');
}
if (params.chapters !== undefined) {
if (((params.chapters.length > 10) && (typeof params.chapters === 'string')) || ((params.chapters.length > 1) && (typeof params.chapters === 'object'))) {
wrapper.find('.togglers').append(
'<a href="#" class="chaptertoggle infobuttons pwp-icon-list-bullet" title="Show/hide chapters"></a>');
}
}
if (params.hidetimebutton !== true) {
wrapper.find('.togglers').append('<a href="#" class="showcontrols infobuttons pwp-icon-clock" title="Show/hide time navigation controls"></a>');
}
}
timecontrolsActive = "";
if (params.timecontrolsVisible === true) {
timecontrolsActive = " active";
}
sharebuttonsActive = "";
if (params.sharebuttonsVisible === true) {
sharebuttonsActive = " active";
}
downloadbuttonsActive = "";
if (params.downloadbuttonsVisible === true) {
downloadbuttonsActive = " active";
}
wrapper.append('<div class="podlovewebplayer_timecontrol podlovewebplayer_controlbox' + timecontrolsActive + '"></div>');
if (params.chapters !== undefined) {
if (params.chapters.length > 10) {
wrapper.find('.podlovewebplayer_timecontrol').append('<a href="#" class="prevbutton infobuttons pwp-icon-to-start" title="Jump backward to previous chapter"></a><a href="#" class="nextbutton infobuttons pwp-icon-to-end" title="next chapter"></a>');
wrapper.find('.controlbox').append('<a href="#" class="prevbutton infobuttons pwp-icon-step-backward" title="previous chapter"></a><a href="#" class="nextbutton infobuttons pwp-icon-to-end" title="Jump to next chapter"></a>');
}
}
wrapper.find('.podlovewebplayer_timecontrol').append(
'<a href="#" class="rewindbutton infobuttons pwp-icon-fast-bw" title="Rewind 30 seconds"></a>');
wrapper.find('.podlovewebplayer_timecontrol').append('<a href="#" class="forwardbutton infobuttons pwp-icon-fast-fw" title="Fast forward 30 seconds"></a>');
if ((wrapper.closest('.podlovewebplayer_wrapper').find('.episodetitle a').attr('href') !== undefined) && (params.hidesharebutton !== true)) {
wrapper.append('<div class="podlovewebplayer_sharebuttons podlovewebplayer_controlbox' + sharebuttonsActive + '"></div>');
wrapper.find('.togglers').append('<a href="#" class="showsharebuttons infobuttons pwp-icon-export" title="Show/hide sharing controls"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" class="currentbutton infobuttons pwp-icon-link" title="Get URL for this"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" target="_blank" class="tweetbutton infobuttons pwp-icon-twitter" title="Share this on Twitter"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" target="_blank" class="fbsharebutton infobuttons pwp-icon-facebook" title="Share this on Facebook"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" target="_blank" class="gplusbutton infobuttons pwp-icon-gplus" title="Share this on Google+"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" target="_blank" class="adnbutton infobuttons pwp-icon-appnet" title="Share this on App.net"></a>');
wrapper.find('.podlovewebplayer_sharebuttons').append('<a href="#" target="_blank" class="mailbutton infobuttons pwp-icon-mail" title="Share this via e-mail"></a>');
}
if (((params.downloads !== undefined) || (params.sources !== undefined)) && (params.hidedownloadbutton !== true)) {
selectform = '<select name="downloads" class="fileselect" size="1" onchange="this.value=this.options[this.selectedIndex].value;">';
wrapper.append('<div class="podlovewebplayer_downloadbuttons podlovewebplayer_controlbox' + downloadbuttonsActive + '"></div>');
wrapper.find('.togglers').append('<a href="#" class="showdownloadbuttons infobuttons pwp-icon-download" title="Show/hide download bar"></a>');
if (params.downloads !== undefined) {
for (i = 0; i < params.downloads.length; i += 1) {
size = (parseInt(params.downloads[i].size, 10) < 1048704) ? Math.round(parseInt(params.downloads[i].size, 10) / 100) / 10 + 'kB' : Math.round(parseInt(params.downloads[i].size, 10) / 1000 / 100) / 10 + 'MB';
selectform += '<option value="' + params.downloads[i].url + '" data-url="' + params.downloads[i].url + '" data-dlurl="' + params.downloads[i].dlurl + '">' + params.downloads[i].name + ' (' + size + ')</option>';
}
} else {
for (i = 0; i < params.sources.length; i += 1) {
name = params.sources[i].split('.');
name = name[name.length - 1];
selectform += '<option value="' + params.sources[i] + '" data-url="' + params.sources[i] + '" data-dlurl="' + params.sources[i] + '">' + name + '</option>';
}
}
selectform += '</select>';
wrapper.find('.podlovewebplayer_downloadbuttons').append(selectform);
if (params.downloads !== undefined && params.downloads.length > 0) {
downloadname = params.downloads[0].url.split('/');
downloadname = downloadname[downloadname.length - 1];
wrapper.find('.podlovewebplayer_downloadbuttons').append('<a href="' + params.downloads[0].url + '" download="' + downloadname + '" class="downloadbutton infobuttons pwp-icon-download" title="Download"></a> ');
}
wrapper.find('.podlovewebplayer_downloadbuttons').append('<a href="#" class="openfilebutton infobuttons pwp-icon-link-ext" title="Open"></a> ');
wrapper.find('.podlovewebplayer_downloadbuttons').append('<a href="#" class="fileinfobutton infobuttons pwp-icon-info-circle" title="Info"></a> ');
}
//build chapter table
if (params.chapters !== undefined) {
if (((params.chapters.length > 10) && (typeof params.chapters === 'string')) || ((params.chapters.length > 1) && (typeof params.chapters === 'object'))) {
haschapters = true;
generateChapterTable(params).appendTo(wrapper);
}
}
if (richplayer || haschapters) {
wrapper.append('<div class="podlovewebplayer_tableend"></div>');
}
// parse deeplink
deepLink = parseTimecode(window.location.href);
if (deepLink !== false && players.length === 1) {
if (document.hidden !== undefined) {
hiddenTab = document.hidden;
} else if (document.mozHidden !== undefined) {
hiddenTab = document.mozHidden;
} else if (document.msHidden !== undefined) {
hiddenTab = document.msHidden;
} else if (document.webkitHidden !== undefined) {
hiddenTab = document.webkitHidden;
}
if (hiddenTab === true) {
$(player).attr({
preload: 'auto'
});
} else {
$(player).attr({
preload: 'auto',
autoplay: 'autoplay'
});
}
startAtTime = deepLink[0];
stopAtTime = deepLink[1];
} else if (params && params.permalink) {
storageKey = 'podloveWebPlayerTime-' + params.permalink;
if (handleCookies.getItem(storageKey)) {
$(player).one('canplay', function () {
this.currentTime = handleCookies.getItem(storageKey);
});
}
}
$(player).on('ended', function () {
handleCookies.setItem('podloveWebPlayerTime-' + params.permalink, '', new Date(2000, 1, 1));
});
// init MEJS to player
mejsoptions.success = function (player) {
addBehavior(player, params, wrapper);
if (deepLink !== false && players.length === 1) {
$('html, body').delay(150).animate({
scrollTop: $('.podlovewebplayer_wrapper:first').offset().top - 25
});
}
};
$(orig).replaceWith(wrapper);
$(player).mediaelementplayer(mejsoptions);
});
};
}(jQuery));
| mit |
dticln/CaCln | app/views/pages/deny.php | 670 | <?php
namespace App\Views\Pages;
use Pure\Utils\Res;
?>
<div class="container">
<?php if($error_message):?>
<div class="col-md-4 col-md-offset-4">
<div class="alert alert-danger">
<strong>
<?= Res::str('ops') ?>
</strong><?= $error_message; ?>
</div>
</div>
<?php endif; ?>
<div class="col-md-8 col-md-offset-2 header" style="text-align: center;">
<h1>
<span><?= Res::str('deny_header') ?></span>
<span style="font-size:0.4em;"><?= Res::str('access_request') ?>
</span>
<span>
<a href="mailto:<?= Res::str('dti_email') ?>" style="color: white;">
<?= Res::str('dti_email') ?>
</a>
</span>
</h1>
</div>
</div> | mit |
Dissolving-in-Eternity/GigHub | GigHub/Persistence/Migrations/201704241438301_AddMoreGenres.Designer.cs | 817 | // <auto-generated />
namespace GigHub.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
public sealed partial class AddMoreGenres : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMoreGenres));
string IMigrationMetadata.Id
{
get { return "201704241438301_AddMoreGenres"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
| mit |
KHs000/lpii_INF3_g4 | src/main/webapp/WEB-INF/classes/br/cefetmg/inf/model/service/IManterDepartamento.java | 534 | package br.cefetmg.inf.model.service;
import br.cefetmg.inf.model.domain.Departamento;
import br.cefetmg.inf.util.db.exception.NegocioException;
import br.cefetmg.inf.util.db.exception.PersistenciaException;
import java.util.List;
/**
*
* @author Felipe Rabelo
*/
public interface IManterDepartamento {
public void cadastrar(Departamento departamento) throws PersistenciaException, NegocioException;
public List<Departamento> listarTodos() throws PersistenciaException, NegocioException;
}
| mit |
py-in-the-sky/redux-webpack | webpack.production.config.js | 658 | var path = require('path');
module.exports = {
devtool: 'source-map', // normal source mapping
context: path.join(__dirname, 'app'),
entry: {
javascript: './app.js',
html: './index.html'
},
output: {
filename: 'app.js',
path: path.join(__dirname, 'dist'),
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel'],
},
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file?name=[name].[ext]',
},
// TODO:
// {
// test: /\.css$/,
// loader: 'style!css'
// }
],
}
};
| mit |
makotoarakaki/d-denwa | fuel/app/logs/2016/01/07.php | 20002 | <?php defined('COREPATH') or exit('No direct script access allowed'); ?>
INFO - 2016-01-07 09:29:07 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 09:29:07 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:29:07 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:29:09 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:29:09 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:29:09 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:17 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 09:34:17 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:17 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:18 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:34:18 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:18 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:34 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:46 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:34:46 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:46 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:34:55 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:34:55 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:34:55 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:35:55 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:35:55 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:35:55 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:36:39 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:36:39 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:36:39 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:36:40 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 09:36:40 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:36:40 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:36:41 --> Fuel\Core\Request::__construct - Creating a new HMVC Request with URI = "admin/daily"
INFO - 2016-01-07 09:36:41 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:36:45 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 09:36:45 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:36:45 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:41:51 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvexport"
INFO - 2016-01-07 09:41:51 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:41:51 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:41:58 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvexport"
INFO - 2016-01-07 09:41:58 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:41:58 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:42:01 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/tocsv"
INFO - 2016-01-07 09:42:01 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:42:01 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:42:56 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 09:42:56 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:42:56 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:42:57 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 09:42:57 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:42:57 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:42:58 --> Fuel\Core\Request::__construct - Creating a new HMVC Request with URI = "admin/daily"
INFO - 2016-01-07 09:42:58 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:02 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/person"
INFO - 2016-01-07 09:43:02 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:02 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:43:05 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 09:43:05 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:05 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:43:09 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvexport"
INFO - 2016-01-07 09:43:09 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:09 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:43:15 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvexport"
INFO - 2016-01-07 09:43:15 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:15 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:43:18 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/tocsv"
INFO - 2016-01-07 09:43:18 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:43:18 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:59:13 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily"
INFO - 2016-01-07 09:59:13 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:59:13 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 09:59:50 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 09:59:50 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 09:59:50 --> Fuel\Core\Request::execute - Setting main Request
ERROR - 2016-01-07 09:59:51 --> 1048 - Column 'firs_tname' cannot be null [ INSERT INTO `cm_customers` (`last_name`, `firs_tname`, `ph_family_name`, `ph_name`, `sex`, `post_code`, `adress1`, `adress2`, `adress3`, `phone`, `age`, `birthday`, `mail`, `person_id`, `personname`, `last_visit_date`, `biko`, `created_at`, `updated_at`) VALUES ('新規顧客', null, null, null, null, null, null, null, null, null, null, null, null, '3', ('当山 テスト'), null, '新規メモ', 1452128391, 1452128391) ] in C:\Users\USER\custumersys\cm0001\fuel\core\classes\database\mysqli\connection.php on line 290
INFO - 2016-01-07 10:02:02 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:02:02 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:02:02 --> Fuel\Core\Request::execute - Setting main Request
ERROR - 2016-01-07 10:02:03 --> 1048 - Column 'firs_tname' cannot be null [ INSERT INTO `cm_customers` (`last_name`, `firs_tname`, `ph_family_name`, `ph_name`, `sex`, `post_code`, `adress1`, `adress2`, `adress3`, `phone`, `age`, `birthday`, `mail`, `person_id`, `personname`, `last_visit_date`, `biko`, `created_at`, `updated_at`) VALUES ('新規顧客', null, null, null, null, null, null, null, null, null, null, null, null, '3', ('当山 テスト'), null, '新規メモ', 1452128523, 1452128523) ] in C:\Users\USER\custumersys\cm0001\fuel\core\classes\database\mysqli\connection.php on line 290
INFO - 2016-01-07 10:02:42 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:02:42 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:02:42 --> Fuel\Core\Request::execute - Setting main Request
ERROR - 2016-01-07 10:02:43 --> 1048 - Column 'firs_tname' cannot be null [ INSERT INTO `cm_customers` (`last_name`, `firs_tname`, `ph_family_name`, `ph_name`, `sex`, `post_code`, `adress1`, `adress2`, `adress3`, `phone`, `age`, `birthday`, `mail`, `person_id`, `personname`, `last_visit_date`, `biko`, `created_at`, `updated_at`) VALUES ('新規顧客', null, null, null, null, null, null, null, null, null, null, null, null, '3', ('当山 テスト'), null, '新規メモ', 1452128563, 1452128563) ] in C:\Users\USER\custumersys\cm0001\fuel\core\classes\database\mysqli\connection.php on line 290
INFO - 2016-01-07 10:05:15 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:05:15 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:05:15 --> Fuel\Core\Request::execute - Setting main Request
ERROR - 2016-01-07 10:05:16 --> 1048 - Column 'ph_family_name' cannot be null [ INSERT INTO `cm_customers` (`last_name`, `firs_tname`, `ph_family_name`, `ph_name`, `sex`, `post_code`, `adress1`, `adress2`, `adress3`, `phone`, `age`, `birthday`, `mail`, `person_id`, `personname`, `last_visit_date`, `biko`, `created_at`, `updated_at`) VALUES ('新規テスト', '日別で登録', null, null, null, null, null, null, null, null, null, null, null, '3', ('当山 テスト'), null, '新規メモ', 1452128716, 1452128716) ] in C:\Users\USER\custumersys\cm0001\fuel\core\classes\database\mysqli\connection.php on line 290
INFO - 2016-01-07 10:10:04 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:10:04 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:10:04 --> Fuel\Core\Request::execute - Setting main Request
ERROR - 2016-01-07 10:10:05 --> 1048 - Column 'adress1' cannot be null [ INSERT INTO `cm_customers` (`last_name`, `firs_tname`, `ph_family_name`, `ph_name`, `sex`, `post_code`, `adress1`, `adress2`, `adress3`, `phone`, `age`, `birthday`, `mail`, `person_id`, `personname`, `last_visit_date`, `biko`, `created_at`, `updated_at`) VALUES ('新規テスト', '日別で登録', ' ', ' ', null, null, null, null, null, null, null, null, null, '3', ('当山 テスト'), null, '新規メモ', 1452129005, 1452129005) ] in C:\Users\USER\custumersys\cm0001\fuel\core\classes\database\mysqli\connection.php on line 290
INFO - 2016-01-07 10:13:14 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:13:14 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:13:14 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:13:16 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily"
INFO - 2016-01-07 10:13:16 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:13:16 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:13:35 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily"
INFO - 2016-01-07 10:13:35 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:13:35 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:06 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily/create"
INFO - 2016-01-07 10:14:06 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:06 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:08 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/daily"
INFO - 2016-01-07 10:14:08 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:08 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:12 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/dailyhistory"
INFO - 2016-01-07 10:14:12 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:12 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:18 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 10:14:18 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:18 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:25 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 10:14:25 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:25 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:14:45 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 10:14:45 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:14:45 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:44:57 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvimport"
INFO - 2016-01-07 10:44:57 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:44:57 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:45:10 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvupload"
INFO - 2016-01-07 10:45:10 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:45:10 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:45:42 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvupload"
INFO - 2016-01-07 10:45:42 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:45:42 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:45:46 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 10:45:46 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:45:46 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 10:46:12 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 10:46:12 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 10:46:12 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:13:50 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 16:13:50 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:13:50 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:13:55 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 16:13:55 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:13:55 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:13:57 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 16:13:57 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:13:57 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:13:58 --> Fuel\Core\Request::__construct - Creating a new HMVC Request with URI = "admin/daily"
INFO - 2016-01-07 16:13:58 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:01 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:14:01 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:01 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:05 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvimport"
INFO - 2016-01-07 16:14:05 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:05 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:15 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer/csvupload"
INFO - 2016-01-07 16:14:15 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:15 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:20 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:14:20 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:20 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:41 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:14:41 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:41 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:51 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:14:51 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:51 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:14:56 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:14:56 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:14:56 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 16:15:17 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/customer"
INFO - 2016-01-07 16:15:17 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 16:15:17 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 18:36:37 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 18:40:47 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 18:40:47 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 18:40:47 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 18:40:48 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 18:40:48 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 18:40:48 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 19:17:18 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 19:17:18 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 19:17:18 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 19:17:19 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 19:17:19 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 19:17:19 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin"
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::execute - Setting main Request
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "admin/login"
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::execute - Called
INFO - 2016-01-07 19:21:58 --> Fuel\Core\Request::execute - Setting main Request
| mit |
tsgao/project_557_2015_tg | Homework_4/p1/main_multi_texture.cpp | 6623 | //
// main_spotlight.cpp
// HCI 557 Spotlight example
//
// Created by Rafael Radkowski on 5/28/15.
// Copyright (c) 2015 -. All rights reserved.
//
// stl include
#include <iostream>
#include <string>
// GLEW include
#include <GL/glew.h>
// GLM include files
#define GLM_FORCE_INLINE
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
// glfw includes
#include <GLFW/glfw3.h>
// include local files
#include "controls.h"
#include "HCI557Common.h"
#include "CoordSystem.h"
#include "Plane3D.h"
#include "Texture.h"
using namespace std;
// The handle to the window object
GLFWwindow* window;
// Define some of the global variables we're using for this sample
GLuint program;
/* A trackball to move and rotate the camera view */
extern Trackball trackball;
// this is a helper variable to allow us to change the texture blend model
extern int g_change_texture_blend;
int main(int argc, const char * argv[])
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Init glfw, create a window, and init glew
// Init the GLFW Window
window = initWindow();
// Init the glew api
initGlew();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Create some models
// coordinate system
CoordSystem* cs = new CoordSystem(40.0);
// create an apperance object.
GLAppearance* apperance_0 = new GLAppearance("../../data/shaders/multi_texture.vs", "../../data/shaders/multi_texture.fs");
GLDirectLightSource light_source;
light_source._lightPos = glm::vec4(0.0,10.0,100.0, 0.0);
light_source._ambient_intensity = 0.2;
light_source._specular_intensity = 4.5;
light_source._diffuse_intensity = 1.0;
light_source._attenuation_coeff = 0.0;
// add the light to this apperance object
apperance_0->addLightSource(light_source);
GLSpotLightSource spotlight_source;
spotlight_source._lightPos = glm::vec4(0.0,50.0,50.0, 1.0);
spotlight_source._ambient_intensity = 0.6;
spotlight_source._specular_intensity = 10.5;
spotlight_source._diffuse_intensity = 8.0;
spotlight_source._attenuation_coeff = 0.0002;
spotlight_source._cone_direction = glm::vec3(-1.0, -1.0,-1.0);
spotlight_source._cone_angle = 20.0;
apperance_0->addLightSource(spotlight_source);
// Create a material object
GLMaterial material_0;
material_0._diffuse_material = glm::vec3(0.8, 0.8, 0.0);
material_0._ambient_material = glm::vec3(0.8, 0.8, 0.0);
material_0._specular_material = glm::vec3(1.0, 1.0, 1.0);
material_0._shininess = 12.0;
material_0._transparency = 1.0;
// Add the material to the apperance object
apperance_0->setMaterial(material_0);
//************************************************************************************************
// Add a texture
GLMultiTexture* texture = new GLMultiTexture();
int texid = texture->loadAndCreateTextures("../../data/textures/1landscape.bmp", "../../data/textures/1gradient.bmp", "../../data/textures/2animal.bmp");
//int texid = texture->loadAndCreateTexture("../../data/textures/texture_earth_128x128_a.bmp");
apperance_0->setTexture(texture);
//************************************************************************************************
// Finalize the appearance object
apperance_0->finalize();
// create the sphere geometry
GLPlane3D* plane_0 = new GLPlane3D(0.0, 0.0, 0.0, 50.0, 50.0);
plane_0->setApperance(*apperance_0);
plane_0->init();
// If you want to change appearance parameters after you init the object, call the update function
apperance_0->updateLightSources();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Main render loop
// Set up our green background color
static const GLfloat clear_color[] = { 0.0f, 0.0f, 0.0f, 1.0f };
static const GLfloat clear_depth[] = { 1.0f, 1.0f, 1.0f, 1.0f };
// This sets the camera to a new location
// the first parameter is the eye position, the second the center location, and the third the up vector.
SetViewAsLookAt(glm::vec3(0.0f, 0.0f, 65.5f), glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
// Enable depth test
// ignore this line, it allows us to keep the distance value after we proejct each object to a 2d canvas.
glEnable(GL_DEPTH_TEST);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Blending
// Enable blending
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//glBlendFunc(GL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_DST_ALPHA);
// sphere->enableNormalVectorRenderer();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Main render loop
// This is our render loop. As long as our window remains open (ESC is not pressed), we'll continue to render things.
while(!glfwWindowShouldClose(window))
{
// Clear the entire buffer with our green color (sets the background to be green).
glClearBufferfv(GL_COLOR , 0, clear_color);
glClearBufferfv(GL_DEPTH , 0, clear_depth);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// This renders the objects
// Set the trackball locatiom
SetTrackballLocation(trackball.getRotationMatrix());
// draw the objects
//cs->draw();
plane_0->draw();
// change the texture appearance blend mode
bool ret = texture->setTextureBlendMode(g_change_texture_blend);
if(ret)apperance_0->updateTextures();
//// This renders the objects
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Swap the buffers so that what we drew will appear on the screen.
glfwSwapBuffers(window);
glfwPollEvents();
}
delete cs;
}
| mit |
danche354/Sequence-Labeling | tools/hashing.py | 2089 | '''
letter-3-gram hashing
convert word or sentence to letter-3-gram representation matrix
'''
import numpy as np
from scipy.sparse import csc_matrix
import conf
chunk_feature_length = conf.chunk_feature_length
chunk_l3g_dict = conf.chunk_l3g_dict
chunk_feature_length_2 = conf.chunk_feature_length_2
chunk_l2g_dict = conf.chunk_l2g_dict
ner_feature_length = conf.ner_feature_length
ner_l3g_dict = conf.ner_l3g_dict
ner_feature_length_2 = conf.ner_feature_length_2
ner_l2g_dict = conf.ner_l2g_dict
def pre_process(word_list):
word_list = ['#'+word.strip()+'#' for word in word_list]
return word_list
def word2index(word_list, task, gram):
if gram=='tri':
if task=='chunk':
feature_length = chunk_feature_length
l3g_dict = chunk_l3g_dict
elif task=='ner':
feature_length = ner_feature_length
l3g_dict = ner_l3g_dict
word_list_length = len(word_list)
sen_matrix = np.zeros((word_list_length, feature_length))
for i, word in enumerate(word_list):
length = len(word) - 2
# for letter preprocessing
lword = word.lower()
for j in range(length):
sen_matrix[i, l3g_dict[lword[j: j+3]]] += 1
elif gram=='bi':
if task=='chunk':
feature_length = chunk_feature_length_2
l2g_dict = chunk_l2g_dict
elif task=='ner':
feature_length = ner_feature_length_2
l2g_dict = ner_l2g_dict
word_list_length = len(word_list)
sen_matrix = np.zeros((word_list_length, feature_length))
for i, word in enumerate(word_list):
length = len(word) - 1
# for letter preprocessing
lword = word.lower()
for j in range(length):
sen_matrix[i, l2g_dict[lword[j: j+2]]] += 1
return sen_matrix
def sen2matrix(word_list, task, gram):
word_list = pre_process(word_list)
sen_matrix = word2index(word_list, task, gram)
sparse_sen_matrix = csc_matrix(sen_matrix)
return sparse_sen_matrix
| mit |
aed86/webmodern | src/Bundle/MainBundle/Controller/Api/DocumentTypeController.php | 2258 | <?php
namespace Bundle\MainBundle\Controller\Api;
use Bundle\MainBundle\Entity\DocumentType;
use Bundle\MainBundle\Repository\DocumentTypeRepository;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
/**
* DocumentType controller
*
* @Route("/api")
*/
class DocumentTypeController extends ApiController
{
/**
* Сохранение типов документов
* @Route("/putDocumentType/")
*/
public function putDocumentTypeAction()
{
$request = $this->getRequest();
if (!$this->checkSecretKey($request)) {
throw new AccessDeniedHttpException();
}
$content = $request->getContent();
if ($this->container->getParameter('enable_api_logs')) {
$this->get('my_logger')->logData($content, 'api_log_document_type');
}
$types = unserialize($content);
if (empty($types)) return new Response();
/** @var DocumentTypeRepository $documentTypeRepository */
$documentTypeRepository = $this->getRepository('documentType');
if ($types) {
foreach ($types as $type) {
try {
$typeObj = $documentTypeRepository->findOneBy(array(
'originalId' => $type['originalId']
));
if (!$typeObj) {
$typeObj = new DocumentType();
}
foreach ($type as $field => $value) {
$method = 'set' . ucfirst($field);
if (method_exists($typeObj, $method)) {
$typeObj->$method($value);
}
}
} catch (\Exception $ex) {
$this->get('myLogger')->log($ex);
continue;
}
$documentTypeRepository->save($typeObj);
}
}
return new Response();
}
}
| mit |
AMPATH/ng2-amrs | src/app/openmrs-api/patient-relationship-type-resource.service.ts | 965 | import { map } from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { AppSettingsService } from '../app-settings/app-settings.service';
import { Response } from '@angular/http';
import { Observable } from 'rxjs';
import { HttpClient, HttpParams } from '@angular/common/http';
@Injectable()
export class PatientRelationshipTypeResourceService {
constructor(
protected http: HttpClient,
protected appSettingsService: AppSettingsService
) {}
public getUrl(): string {
return (
this.appSettingsService.getOpenmrsRestbaseurl().trim() +
'relationshiptype'
);
}
public getPatientRelationshipTypes(): Observable<any> {
const url = this.getUrl();
const v = 'full';
const params: HttpParams = new HttpParams().set('v', v);
return this.http
.get<any>(url, {
params: params
})
.pipe(
map((response) => {
return response.results;
})
);
}
}
| mit |
jeroendesloovere/fork-cms-module-agenda | backend/modules/agenda/actions/edit.php | 11094 | <?php
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
/**
* This is the edit-action, it will display a form with the item data to edit
*
* @author Tim van Wolfswinkel <[email protected]>
*/
class BackendAgendaEdit extends BackendBaseActionEdit
{
/**
* The recurring options for a item
*
* @var array
*/
private $recurringOptions;
/**
* Array of days within the recurring options
*
* @var array
*/
private $recurringOptionsDays;
/**
* The max interval of recurring item
*
* @var int
*/
private $maxInterval = 31;
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->loadData();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
}
/**
* Load the item data
*/
protected function loadData()
{
$this->id = $this->getParameter('id', 'int', null);
if($this->id == null || !BackendAgendaModel::exists($this->id))
{
$this->redirect(
BackendModel::createURLForAction('index') . '&error=non-existing'
);
}
$this->record = BackendAgendaModel::get($this->id);
// get recurring options
if($this->record['recurring'] == 'Y')
{
$this->recurringOptions = BackendAgendaModel::getRecurringOptions($this->record['id']);
$this->recurringOptionsDays = explode(",", $this->recurringOptions['days']);
}
}
/**
* Load the form
*/
protected function loadForm()
{
// create form
$this->frm = new BackendForm('edit');
// set array of recurring types
$selectTypes = array('0' => ucfirst(BL::lbl('Daily')),
'1' => ucfirst(BL::lbl('Weekly')),
'2' => ucfirst(BL::lbl('Monthly')),
'3' => ucfirst(BL::lbl('Yearly'))
);
// set array of recurring interval
$selectInterval = array();
$i = 1;
while($i < $this->maxInterval)
{
$selectInterval[$i] = $i;
$i++;
}
// set array of reservation values
$radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('Yes'), 'value' => 'Y');
$radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('No'), 'value' => 'N');
// set array of possibilities which an item can end on
$radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('Never')), 'value' => '0');
$radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('After')), 'value' => '1');
$radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('On')), 'value' => '2');
// set array of recurring days of item
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Monday')), 'value' => '0');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Tuesday')), 'value' => '1');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Wednesday')), 'value' => '2');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Thursday')), 'value' => '3');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Friday')), 'value' => '4');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Saturday')), 'value' => '5');
$multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Sunday')), 'value' => '6');
// recurring item options
$this->frm->addCheckbox('recurring', ($this->record['recurring'] === 'Y' ? true : false));
$this->frm->addDropdown('type', $selectTypes, $this->recurringOptions['type']);
$this->frm->addDropdown('interval', $selectInterval, $this->recurringOptions['interval']);
$this->frm->addMultiCheckbox('days', $multiCheckboxDays, $this->recurringOptionsDays);
$this->frm->addRadioButton('ends_on', $radiobuttonEndsOn, $this->recurringOptions['ends_on']);
$this->frm->addText('frequency', $this->recurringOptions['frequency']);
$this->frm->addDate('recurr_end_date_date', $this->recurringOptions['end_date']);
$this->frm->addTime('recurr_end_date_time', date('H:i', $this->recurringOptions['end_date']));
$this->frm->addCheckbox('whole_day', ($this->record['whole_day'] === 'Y' ? true : false));
// location options
$this->frm->addText('name', $this->record['location_name']);
$this->frm->addText('street', $this->record['street']);
$this->frm->addText('number', $this->record['number']);
$this->frm->addText('zip', $this->record['zip']);
$this->frm->addText('city', $this->record['city']);
$this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage()), $this->record['country']);
$this->frm->addCheckbox('google_maps', ($this->record['google_maps'] === 'Y' ? true : false));
// standard options
$this->frm->addText('title' ,$this->record['title'], null, 'inputText title', 'inputTextError title');
$this->frm->addEditor('text', $this->record['text']);
$this->frm->addEditor('introduction', $this->record['introduction']);
$this->frm->addDate('begin_date_date', $this->record['begin_date']);
$this->frm->addTime('begin_date_time', date('H:i', $this->record['begin_date']));
$this->frm->addDate('end_date_date', $this->record['end_date']);
$this->frm->addTime('end_date_time', date('H:i', $this->record['end_date']));
$this->frm->addImage('image');
$this->frm->addCheckbox('delete_image');
$this->frm->addRadioButton('subscriptions', $radiobuttonSubscriptionsValues, $this->record['allow_subscriptions']);
// get categories
$categories = BackendAgendaModel::getCategories();
$this->frm->addDropdown('category_id', $categories, $this->record['category_id']);
// meta
$this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title', true);
$this->meta->setUrlCallBack('BackendAgendaModel', 'getUrl', array($this->record['id']));
}
/**
* Parse the page
*/
protected function parse()
{
parent::parse();
// add css
$this->header->addCSS('/backend/modules/agenda/layout/css/agenda.css', null, true);
// get url
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail');
$url404 = BackendModel::getURL(404);
// parse additional variables
if($url404 != $url) $this->tpl->assign('detailURL', SITE_URL . $url);
$this->record['url'] = $this->meta->getURL();
$this->tpl->assign('item', $this->record);
}
/**
* Validate the form
*/
protected function validateForm()
{
if($this->frm->isSubmitted())
{
$this->frm->cleanupFields();
// validation
$fields = $this->frm->getFields();
$fields['title']->isFilled(BL::err('FieldIsRequired'));
$fields['begin_date_date']->isFilled(BL::err('FieldIsRequired'));
$fields['begin_date_time']->isFilled(BL::err('FieldIsRequired'));
$fields['begin_date_date']->isValid(BL::err('DateIsInvalid'));
$fields['begin_date_time']->isValid(BL::err('TimeIsInvalid'));
$fields['end_date_date']->isFilled(BL::err('FieldIsRequired'));
$fields['end_date_time']->isFilled(BL::err('FieldIsRequired'));
$fields['end_date_date']->isValid(BL::err('DateIsInvalid'));
$fields['end_date_time']->isValid(BL::err('TimeIsInvalid'));
$fields['category_id']->isFilled(BL::err('FieldIsRequired'));
// validate meta
$this->meta->validate();
if($this->frm->isCorrect())
{
$item['id'] = $this->id;
$item['language'] = BL::getWorkingLanguage();
$item['title'] = $fields['title']->getValue();
$item['text'] = $fields['text']->getValue();
$item['introduction'] = $fields['introduction']->getValue();
$item['begin_date'] = BackendModel::getUTCDate(
null,
BackendModel::getUTCTimestamp(
$this->frm->getField('begin_date_date'),
$this->frm->getField('begin_date_time')
)
);
$item['end_date'] = BackendModel::getUTCDate(
null,
BackendModel::getUTCTimestamp(
$this->frm->getField('end_date_date'),
$this->frm->getField('end_date_time')
)
);
$item['category_id'] = $this->frm->getField('category_id')->getValue();
$item['whole_day'] = $fields['whole_day']->getChecked() ? 'Y' : 'N';
$item['recurring'] = $fields['recurring']->getChecked() ? 'Y' : 'N';
$item['allow_subscriptions'] = $fields['subscriptions']->getValue();
$item['google_maps'] = $fields['google_maps']->getChecked() ? 'Y' : 'N';
$item['location_name'] = $fields['name']->getValue();
$item['street'] = $fields['street']->getValue();
$item['number'] = $fields['number']->getValue();
$item['zip'] = $fields['zip']->getValue();
$item['city'] = $fields['city']->getValue();
$item['country'] = $fields['country']->getValue();
$item['meta_id'] = $this->meta->save();
// geocode address
$url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($item['street'] . ' ' . $item['number'] . ', ' . $item['zip'] . ' ' . $item['city'] . ', ' . SpoonLocale::getCountry($item['country'], BL::getWorkingLanguage())) . '&sensor=false';
$geocode = json_decode(SpoonHTTP::getContent($url));
$item['lat'] = isset($geocode->results[0]->geometry->location->lat) ? $geocode->results[0]->geometry->location->lat : null;
$item['lng'] = isset($geocode->results[0]->geometry->location->lng) ? $geocode->results[0]->geometry->location->lng : null;
// update item
BackendAgendaModel::update($item);
$item['id'] = $this->id;
// recurring item
if($item['recurring'] == 'Y')
{
$recurringItem['id'] = $this->recurringOptions['id'];
$recurringItem['agenda_id'] = $item['id'];
$recurringItem['type'] = $fields['type']->getValue();
$recurringItem['interval'] = $fields['interval']->getValue();
$recurringItem['ends_on'] = $fields['ends_on']->getValue();
// if recurring type is weekly, get days checked
if($recurringItem['type'] == 1)
{
$days = $fields['days']->getChecked();
$recurringItem['days'] = implode(",", $days);
}
// if item ends on x amount of times
if($recurringItem['ends_on'] == 1)
{
$recurringItem['frequency'] = $fields['frequency']->getValue();
}
// else if item ends on specific date
else if($recurringItem['ends_on'] == 2)
{
// check date/time fields
if($fields['recurr_end_date_date']->isFilled() || $fields['recurr_end_date_time']->isFilled())
{
$recurringItem['end_date'] = BackendModel::getUTCDate(
null,
BackendModel::getUTCTimestamp(
$this->frm->getField('recurr_end_date_date'),
$this->frm->getField('recurr_end_date_time')
)
);
}
}
// update if options exist
if(BackendAgendaModel::existsRecurringOptions($recurringItem['id'], $recurringItem['agenda_id']))
{
BackendAgendaModel::updateRecurringOptions($recurringItem);
}
// else insert new options
else
{
BackendAgendaModel::insertRecurringOptions($recurringItem);
}
}
// add search index
BackendSearchModel::saveIndex(
$this->getModule(), $item['id'],
array('title' => $item['title'], 'Text' => $item['text'])
);
BackendModel::triggerEvent(
$this->getModule(), 'after_edit', $item
);
$this->redirect(
BackendModel::createURLForAction('index') . '&report=edited&highlight=row-' . $item['id']
);
}
}
}
}
| mit |
hmltnbrn/brian-hamilton | src/components/NotFound/NotFound.tsx | 920 | import React from 'react';
import styles from './NotFound.module.scss';
import classNames from 'classnames/bind';
import { withRouter, RouteComponentProps } from 'react-router-dom';
const cx = classNames.bind(styles);
const NotFound = ({ history }: RouteComponentProps): JSX.Element => {
const goBack = (): void => {
history.goBack();
};
return (
<div className={cx('not-found')}>
<div className={cx('error-section')}>
<h1>404</h1>
<p className={cx('small')}>Page Not Found</p>
</div>
<p className={cx('description')}>
The page you're looking for doesn't exist. Sorry.
</p>
<p className={cx('contact')}>
<span className={cx('span-link')} onClick={goBack}>
Go back
</span>{' '}
or <a href="mailto:[email protected]">contact me</a> with details.
</p>
</div>
);
};
export default withRouter(NotFound);
| mit |
nemundo/framework | src/App/Script/Reset/ScriptReset.php | 556 | <?php
namespace Nemundo\App\Script\Reset;
use Nemundo\App\Script\Data\Script\ScriptDelete;
use Nemundo\App\Script\Data\Script\ScriptUpdate;
use Nemundo\Project\Reset\AbstractReset;
class ScriptReset extends AbstractReset
{
public function reset()
{
$update = new ScriptUpdate();
$update->setupStatus = false;
$update->update();
}
public function remove()
{
$delete = new ScriptDelete();
$delete->filter->andEqual($delete->model->setupStatus, false);
$delete->delete();
}
} | mit |
tarasfrompir/majordomo | lib/messages.class.php | 6075 | <?php
function sayReplySafe($ph, $level = 0, $replyto = '')
{
$data = array(
'sayReply' => 1,
'ph' => $ph,
'level' => $level,
'replyto' => $replyto,
);
if (session_id()) {
$data[session_name()] = session_id();
}
$url = BASE_URL . '/objects/?' . http_build_query($data);
if (is_array($params)) {
foreach ($params as $k => $v) {
$url .= '&' . $k . '=' . urlencode($v);
}
}
$result = getURLBackground($url, 0);
return $result;
}
/**
* Summary of sayReply
* @param mixed $ph Phrase
* @param mixed $level Level (default 0)
* @param mixed $replyto Original request
* @return void
*/
function sayReply($ph, $level = 0, $replyto = '')
{
$source = '';
if ($replyto) {
$terminal_rec = SQLSelectOne("SELECT * FROM terminals WHERE LATEST_REQUEST LIKE '%" . DBSafe($replyto) . "%' ORDER BY LATEST_REQUEST_TIME DESC LIMIT 1");
$orig_msg = SQLSelectOne("SELECT * FROM shouts WHERE SOURCE!='' AND MESSAGE LIKE '%" . DBSafe($replyto) . "%' AND ADDED>=(NOW() - INTERVAL 30 SECOND) ORDER BY ADDED DESC LIMIT 1");
if ($orig_msg['ID']) {
$source = $orig_msg['SOURCE'];
}
} else {
$terminal_rec = SQLSelectOne("SELECT * FROM terminals WHERE LATEST_REQUEST_TIME>=(NOW() - INTERVAL 5 SECOND) ORDER BY LATEST_REQUEST_TIME DESC LIMIT 1");
}
if (!$terminal_rec) {
$source = 'terminal_not_found';
say($ph, $level);
} else {
$source = 'terminal' . $terminal_rec['ID'];
$said_status = sayTo($ph, $level, $terminal_rec['NAME']);
if (!$said_status) {
say($ph, $level);
} else {
//$rec = array();
//$rec['MESSAGE'] = $ph;
//$rec['ADDED'] = date('Y-m-d H:i:s');
//$rec['ROOM_ID'] = 0;
//$rec['MEMBER_ID'] = 0;
//if ($level > 0) $rec['IMPORTANCE'] = $level;
//$rec['ID'] = SQLInsert('shouts', $rec);
}
}
processSubscriptionsSafe('SAYREPLY', array('level' => $level, 'message' => $ph, 'replyto' => $replyto, 'source' => $source));
}
function sayToSafe($ph, $level = 0, $destination = '')
{
$data = array(
'sayTo' => 1,
'ph' => $ph,
'level' => $level,
'destination' => $destination,
);
if (session_id()) {
$data[session_name()] = session_id();
}
$url = BASE_URL . '/objects/?' . http_build_query($data);
if (is_array($params)) {
foreach ($params as $k => $v) {
$url .= '&' . $k . '=' . urlencode($v);
}
}
$result = getURLBackground($url, 0);
return $result;
}
/**
* Summary of sayTo
* @param mixed $ph Phrase
* @param mixed $level Level (default 0)
* @param mixed $destination Destination terminal name
* @return void
*/
function sayTo($ph, $level = 0, $destination = '')
{
if (!$destination) {
return 0;
}
// add message to chat
$rec = array();
$rec['MESSAGE'] = $ph;
$rec['ADDED'] = date('Y-m-d H:i:s');
$rec['ROOM_ID'] = 0;
$rec['MEMBER_ID'] = 0;
if ($level > 0) $rec['IMPORTANCE'] = $level;
$rec['ID'] = SQLInsert('shouts', $rec);
$processed = processSubscriptionsSafe('SAYTO', array('level' => $level, 'message' => $ph, 'destination' => $destination));
return 1;
}
function saySafe($ph, $level = 0, $member_id = 0, $source = '')
{
$data = array(
'say' => 1,
'ph' => $ph,
'level' => $level,
'member_id' => $member_id,
'source' => $source,
);
if (session_id()) {
$data[session_name()] = session_id();
}
$url = BASE_URL . '/objects/?' . http_build_query($data);
if (is_array($params)) {
foreach ($params as $k => $v) {
$url .= '&' . $k . '=' . urlencode($v);
}
}
$result = getURLBackground($url, 0);
return $result;
}
/**
* Summary of say
* @param mixed $ph Phrase
* @param mixed $level Level (default 0)
* @param mixed $member_id Member ID (default 0)
* @return void
*/
function say($ph, $level = 0, $member_id = 0, $source = '')
{
//dprint(date('Y-m-d H:i:s')." Say started",false);
verbose_log("SAY (level: $level; member: $member; source: $source): " . $ph);
//DebMes("SAY (level: $level; member: $member; source: $source): ".$ph,'say');
$rec = array();
$rec['MESSAGE'] = $ph;
$rec['ADDED'] = date('Y-m-d H:i:s');
$rec['ROOM_ID'] = 0;
$rec['MEMBER_ID'] = $member_id;
$rec['SOURCE'] = $source;
if ($level > 0) $rec['IMPORTANCE'] = $level;
$rec['ID'] = SQLInsert('shouts', $rec);
if ($member_id) {
$processed = processSubscriptionsSafe('COMMAND', array('level' => $level, 'message' => $ph, 'member_id' => $member_id, 'source' => $source));
return;
}
if (defined('SETTINGS_HOOK_BEFORE_SAY') && SETTINGS_HOOK_BEFORE_SAY != '') {
eval(SETTINGS_HOOK_BEFORE_SAY);
}
if (!defined('SETTINGS_SPEAK_SIGNAL') || SETTINGS_SPEAK_SIGNAL == '1') {
if ($level >= (int)getGlobal('minMsgLevel') && !$member_id) { // && !$ignoreVoice
$passed = time() - (int)getGlobal('lastSayTime');
if ($passed > 20) {
playSound('dingdong', 1, $level);
}
}
}
setGlobal('lastSayTime', time());
setGlobal('lastSayMessage', $ph);
processSubscriptionsSafe('SAY', array('level' => $level, 'message' => $ph, 'member_id' => $member_id)); //, 'ignoreVoice'=>$ignoreVoice
if (defined('SETTINGS_HOOK_AFTER_SAY') && SETTINGS_HOOK_AFTER_SAY != '') {
eval(SETTINGS_HOOK_AFTER_SAY);
}
//dprint(date('Y-m-d H:i:s')." Say OK",false);
}
function ask($prompt, $target = '')
{
processSubscriptionsSafe('ASK', array('prompt' => $prompt, 'message' => $prompt, 'target' => $target, 'destination' => $target));
}
| mit |
DavidLievrouw/MSBuildTasks | src/MSBuildTasks/Handlers/ValidationAwareQueryHandler.cs | 864 | using System;
using System.Threading.Tasks;
using DavidLievrouw.Utils;
using FluentValidation;
namespace DavidLievrouw.MSBuildTasks.Handlers {
public class ValidationAwareQueryHandler<TArg, TResult> : IQueryHandler<TArg, TResult> {
readonly IValidator<TArg> _validator;
readonly IQueryHandler<TArg, TResult> _innerQueryHandler;
public ValidationAwareQueryHandler(IValidator<TArg> validator, IQueryHandler<TArg, TResult> innerQueryHandler) {
if (validator == null) throw new ArgumentNullException("validator");
if (innerQueryHandler == null) throw new ArgumentNullException("innerQueryHandler");
_validator = validator;
_innerQueryHandler = innerQueryHandler;
}
public async Task<TResult> Handle(TArg query) {
_validator.ValidateAndThrow(query);
return await _innerQueryHandler.Handle(query);
}
}
} | mit |
UCSB-CS56-W15/W15-lab04 | src/edu/ucsb/cs56/w15/drawings/ecarnohan/advanced/CoffeeCup.java | 3184 | package edu.ucsb.cs56.w15.drawings.ecarnohan.advanced;
import java.awt.geom.GeneralPath; // combinations of lines and curves
import java.awt.geom.AffineTransform; // translation, rotation, scale
import java.awt.Shape; // general class for shapes
// all imports below this line needed if you are implementing Shape
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.Rectangle;
import java.awt.geom.PathIterator;
import java.awt.geom.AffineTransform;
import edu.ucsb.cs56.w15.drawings.utilities.ShapeTransforms;
import edu.ucsb.cs56.w15.drawings.utilities.GeneralPathWrapper;
/**
A Coffee Cup (wrapper around a General Path, implements Shape)
This provides an example of how you can start with the coordinates
of a hard coded object, and end up with an object that can be
drawn anywhere, with any width or height.
@author Phill Conrad
@version for CS56, W11, UCSB, 02/23/2011
*/
public class CoffeeCup extends GeneralPathWrapper implements Shape
{
/**
* Constructor for objects of class CoffeeCup
*/
public CoffeeCup(double x, double y, double width, double height)
{
// Specify the upper left corner, and the
// width and height of the original points used to
// plot the *hard-coded* coffee cup
final double ORIG_ULX = 100.0;
final double ORIG_ULY = 100.0;
final double ORIG_HEIGHT = 300.0;
final double ORIG_WIDTH = 400.0;
GeneralPath leftSide = new GeneralPath();
// left side of cup
leftSide.moveTo(200,400);
leftSide.lineTo(160,360);
leftSide.lineTo(130,300);
leftSide.lineTo(100,200);
leftSide.lineTo(100,100);
GeneralPath topAndBottom = new GeneralPath();
topAndBottom.moveTo(100,100);
topAndBottom.lineTo(500,100); // top of cup
topAndBottom.moveTo(200,400);
topAndBottom.lineTo(400,400); // bottom of cup
Shape rightSide = ShapeTransforms.horizontallyFlippedCopyOf(leftSide);
// after flipping around the upper left hand corner of the
// bounding box, we move this over to the right by 400 pixels
rightSide = ShapeTransforms.translatedCopyOf(rightSide, 400.0, 0.0);
// now we put the whole thing together ino a single path.
GeneralPath wholeCup = new GeneralPath ();
wholeCup.append(topAndBottom, false);
wholeCup.append(leftSide, false);
wholeCup.append(rightSide, false);
// translate to the origin by subtracting the original upper left x and y
// then translate to (x,y) by adding x and y
Shape s = ShapeTransforms.translatedCopyOf(wholeCup, -ORIG_ULX + x, -ORIG_ULY + y);
// scale to correct height and width
s = ShapeTransforms.scaledCopyOf(s,
width/ORIG_WIDTH,
height/ORIG_HEIGHT) ;
// Use the GeneralPath constructor that takes a shape and returns
// it as a general path to set our instance variable cup
this.set(new GeneralPath(s));
}
}
| mit |
keke78ui9/UNITTEST_Example | ClassLibrary1/Properties/AssemblyInfo.cs | 1420 | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ClassLibrary1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d81ece50-d356-4004-93f0-3f690d8970ca")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| mit |
UVInventario/Relace | module/Seguridad/src/Seguridad/Entities/Rol.php | 1924 | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Seguridad\Entities;
/**
* Description of Rol
*
* @author MIGUEL
*/
class Rol {
/**
*
* @var long
*/
private $id;
/**
*
* @var string
*/
private $descripcion;
/**
*
* @var int
*/
private $codigo;
/**
*
* @var bool
*/
private $estado;
/**
*
* @var array
*/
private $recursos;
function __construct() {
if (isset($this->id)) {
$this->id = intval($this->id);
}
if (isset($this->codigo)) {
$this->setCodigo($this->codigo);
}
if (isset($this->estado)) {
$this->setEstado($this->estado);
}
}
public function getId() {
return $this->id;
}
public function getDescripcion() {
return $this->descripcion;
}
public function getCodigo() {
return $this->codigo;
}
public function getEstado() {
return $this->estado;
}
public function getRecursos() {
return $this->recursos;
}
public function setId(long $id) {
$this->id = $id;
return $this;
}
public function setEstado($estado) {
$this->estado = boolval($estado);
return $this;
}
public function setDescripcion($descripcion) {
$this->descripcion = $descripcion;
return $this;
}
public function setCodigo($codigo) {
$this->codigo = intval($codigo);
return $this;
}
public function setRecursos($recursos) {
$this->recursos = $recursos;
return $this;
}
}
| mit |
PierreSylvain/nao | src/AppBundle/Repository/ObservationRepository.php | 7558 | <?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
use AppBundle\Entity\Observation;
use Doctrine\ORM\Tools\Pagination\Paginator;
/**
* Class NotificationRepository
*
* @package AppBundle\Repository
*/
class ObservationRepository extends EntityRepository
{
public function deleteByUser($user_id)
{
$query = $this->createQueryBuilder('o')
->delete()
->where('o.user = :user_id')
->orWhere('o.naturalist = :user_id')
->setParameter('user_id', $user_id)
->getQuery();
return 1 === $query->getScalarResult();
}
/**
* Get my validated observation (role NATURALIST)
*
* @param $user
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getValidateValidation($user, $currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::VALIDATED)
->andWhere('o.naturalist = :user')
->setParameter('user', $user)
->orderBy('o.validated', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
/**
* Paginator Helper
*
* @param $dql DQL Query Object
* @param int $page Current page (defaults to 1)
* @param int $limit The total number per page (defaults to 50)
*
* @return Paginator Object
*/
public function paginate($dql, $page = 1, $limit = 50)
{
$paginator = new Paginator($dql);
$paginator->getQuery()
->setFirstResult($limit * ($page - 1))// Offset
->setMaxResults($limit); // Limit
return $paginator;
}
/**
* Get last observation for specimen
*
* @param $taxref_id
* @param $observation_id
* @return array
*/
public function getLastObservationForBird($taxref_id, $observation_id)
{
return $this->createQueryBuilder('o')
->where('o.taxref = :taxref')
->setParameter('taxref', $taxref_id)
->andWhere('o.status = :status')
->setParameter('status', Observation::VALIDATED)
->andWhere('o.id != :id')
->setParameter('id', $observation_id)
->orderBy('o.watched', 'DESC')
->getQuery()
->getResult();
}
/**
* Get observations
*
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getValideObservations($currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::VALIDATED)
->orderBy('o.watched', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
/**
* Get all observations wit filter
*
* @return array
*/
public function getObservationsWithFilter($speciment, $department)
{
$query = $this->createQueryBuilder('o')
->innerJoin('o.taxref', 't')
->addSelect('t')
->where('o.status = :status')->setParameter('status', Observation::VALIDATED);
if (!empty($speciment)) {
$query->andwhere('t.taxon_sc = :specimen')->setParameter('specimen', $speciment);
}
if (!empty($department)) {
$query->andwhere('o.place LIKE :department')->setParameter('department', '%(' . $department . ')%');
}
$query->orderBy('o.watched', 'DESC');
return $query->getQuery()->getResult();
}
public function getMyObservations($state, $user, $currentPage, $limit = 50)
{
switch ($state) {
case 'my_draft':
return $this->getMyDraftObservations($user, $currentPage, $limit);
break;
case Observation::REFUSED:
break;
case 'my_validate':
return $this->getMyValidateObservations($user, $currentPage, $limit);
case 'my_waiting':
return $this->getMyWaitingObservations($user, $currentPage, $limit);
case 'waiting':
return $this->getWaitingValidation($currentPage, $limit);
case 'refuse':
return $this->getDeclineValidation($user, $currentPage, $limit);
case 'my_validatevalidation':
return $this->getValidateValidation($user, $currentPage, $limit);
}
}
/**
* Get my draft observation
*
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getMyDraftObservations($user, $currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::DRAFT)
->andWhere('o.user = :user')
->setParameter('user', $user)
->orderBy('o.watched', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
/**
* Get my validate observation
*
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getMyValidateObservations($user, $currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::VALIDATED)
->andWhere('o.user = :user')
->setParameter('user', $user)
->orderBy('o.watched', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
/**
* Get my wainting observation
*
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getMyWaitingObservations($user, $currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::WAITING)
->andWhere('o.user = :user')
->setParameter('user', $user)
->orderBy('o.watched', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
/**
* get observation to be validated
*
* @param $currentPage
* @param int $limit
* @return Paginator
*/
public function getWaitingValidation($currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::WAITING)
->orderBy('o.watched', 'ASC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
public function getDeclineValidation($user, $currentPage, $limit = 50)
{
$query = $this->createQueryBuilder('o')
->where('o.status = :status')
->setParameter('status', Observation::REFUSED)
->andWhere('o.naturalist = :user')
->setParameter('user', $user)
->orderBy('o.validated', 'DESC')
->getQuery();
$paginator = $this->paginate($query, $currentPage, $limit);
return $paginator;
}
}
| mit |
arturoleon/curso-titanium | JoseLuis/Intents/email.js | 726 | /*
* Android
*/
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_EMAIL, addresses);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_STREAM, attachment);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
/*
* Titanium
*/
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SENDTO,
type: 'text/plain'
});
intent.putExtra(Ti.Android.EXTRA_EMAIL, '[email protected]');
intent.putExtra(Ti.Android.EXTRA_CC, '[email protected]');
intent.putExtra(Ti.Android.EXTRA_SUBJECT, 'Asunto');
intent.putExtra(Ti.Android.EXTRA_TEXT, 'Contenido');
Ti.Android.currentActivity.startActivity(intent); | mit |
thoward/parrano | Parrano.Api/Color.cs | 123 | namespace Parrano.Api
{
public abstract class Color
{
public abstract float[] ToFloatArray();
}
} | mit |
deric/treeviz | src/main/java/ch/randelshofer/tree/sunray/MultilineIcerayDraw.java | 11634 | /*
* @(#)MultilineIcerayDraw.java 1.0 2011-08-20
*
* Copyright (c) 2011 Werner Randelshofer, Goldau, Switzerland.
* All rights reserved.
*
* You may not use, copy or modify this file, except in compliance with the
* license agreement you entered into with Werner Randelshofer.
* For details see accompanying license terms.
*/package ch.randelshofer.tree.sunray;
import ch.randelshofer.tree.sunburst.*;
import java.util.Iterator;
import ch.randelshofer.tree.NodeInfo;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Shape;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.Rectangle2D;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import java.util.LinkedList;
import javax.swing.SwingConstants;
import static javax.swing.SwingConstants.*;
/**
* {@code MultilineIcerayDraw}.
*
* @author Werner Randelshofer
* @version 1.0 2011-08-20 Created.
*/
public class MultilineIcerayDraw extends IcerayDraw {
private final static int TEXT_ALIGNMENT = SwingConstants.LEFT;
private final static Insets INSETS = new Insets(4, 4, 4, 4);
private final static int TAB_SIZE = 8;
public MultilineIcerayDraw(SunrayNode root, NodeInfo info) {
super(root, info);
}
public MultilineIcerayDraw(SunrayTree model) {
super(model);
}
@Override
public void drawLabel(Graphics2D g, SunrayNode node) {
double h = height * node.getExtent() / root.getExtent();
double less;
if (h > 2 && node.getExtent() < root.getExtent()) {
less = 0.5;
} else {
less = 0;
}
Rectangle2D.Double rect;
if (node.isLeaf()) {
double sw = width / totalDepth / node.getMaxScatter();
rect = new Rectangle2D.Double(
cx + width * (node.getDepth() - root.getDepth()) / totalDepth +
node.getScatter() * sw,
cy + height * (node.getLeft() - root.getLeft()) / root.getExtent() + less,
sw - 1,
height * node.getExtent() / root.getExtent() - less * 2
);
} else {
rect = new Rectangle2D.Double(
cx + width * (node.getDepth() - root.getDepth()) / totalDepth,
cy + height * (node.getLeft() - root.getLeft()) / root.getExtent() + less,
width / totalDepth - 1,
height * node.getExtent() / root.getExtent() - less * 2
);
}
String name = info.getName(node.getDataNodePath());
g.setColor(Color.BLACK);
drawText(g, name, rect);
}
protected void drawText(Graphics2D g, String text, Rectangle2D.Double bounds) {
if (text != null) {
Font font = g.getFont();
boolean isUnderlined = false;
Insets insets = INSETS;
Rectangle2D.Double textRect = new Rectangle2D.Double(
bounds.x + insets.left,
bounds.y + insets.top,
bounds.width - insets.left - insets.right,
bounds.height - insets.top - insets.bottom);
float leftMargin = (float) textRect.x;
float rightMargin = (float) Math.max(leftMargin + 1, textRect.x + textRect.width + 1);
float verticalPos = (float) textRect.y;
float maxVerticalPos = (float) (textRect.y + textRect.height);
if (leftMargin < rightMargin) {
//float tabWidth = (float) (getTabSize() * g.getFontMetrics(font).charWidth('m'));
float tabWidth = (float) (TAB_SIZE * font.getStringBounds("m", g.getFontRenderContext()).getWidth());
float[] tabStops = new float[(int) (textRect.width / tabWidth)];
for (int i = 0; i < tabStops.length; i++) {
tabStops[i] = (float) (textRect.x + (int) (tabWidth * (i + 1)));
}
if (text != null) {
Shape savedClipArea = g.getClip();
g.clip(textRect);
String[] paragraphs = text.split("\n");//Strings.split(getText(), '\n');
for (int i = 0; i < paragraphs.length; i++) {
if (paragraphs[i].length() == 0) {
paragraphs[i] = " ";
}
AttributedString as = new AttributedString(paragraphs[i]);
as.addAttribute(TextAttribute.FONT, font);
if (isUnderlined) {
as.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
}
int tabCount = paragraphs[i].split("\t").length - 1;
Rectangle2D.Double paragraphBounds = drawParagraph(g, as.getIterator(), verticalPos, maxVerticalPos, leftMargin, rightMargin, tabStops, tabCount);
verticalPos = (float) (paragraphBounds.y + paragraphBounds.height);
if (verticalPos > maxVerticalPos) {
break;
}
}
g.setClip(savedClipArea);
}
}
}
}
/**
* Draws or measures a paragraph of text at the specified y location and
* the bounds of the paragraph.
*
* @param g Graphics object. This parameter is null, if we want to
* measure the size of the paragraph.
* @param styledText the text of the paragraph.
* @param verticalPos the top bound of the paragraph
* @param maxVerticalPos the bottom bound of the paragraph
* @param leftMargin the left bound of the paragraph
* @param rightMargin the right bound of the paragraph
* @param tabStops an array with tab stops
* @param tabCount the number of entries in tabStops which contain actual
* values
* @return Returns the actual bounds of the paragraph.
*/
private Rectangle2D.Double drawParagraph(Graphics2D g, AttributedCharacterIterator styledText,
float verticalPos, float maxVerticalPos, float leftMargin, float rightMargin, float[] tabStops, int tabCount) {
// This method is based on the code sample given
// in the class comment of java.awt.font.LineBreakMeasurer,
// assume styledText is an AttributedCharacterIterator, and the number
// of tabs in styledText is tabCount
Rectangle2D.Double paragraphBounds = new Rectangle2D.Double(leftMargin, verticalPos, 0, 0);
int[] tabLocations = new int[tabCount + 1];
int i = 0;
for (char c = styledText.first(); c != styledText.DONE; c = styledText.next()) {
if (c == '\t') {
tabLocations[i++] = styledText.getIndex();
}
}
tabLocations[tabCount] = styledText.getEndIndex() - 1;
// Now tabLocations has an entry for every tab's offset in
// the text. For convenience, the last entry is tabLocations
// is the offset of the last character in the text.
LineBreakMeasurer measurer = new LineBreakMeasurer(styledText, g.getFontRenderContext());
int currentTab = 0;
while (measurer.getPosition() < styledText.getEndIndex()
&& verticalPos <= maxVerticalPos) {
// Lay out and draw each line. All segments on a line
// must be computed before any drawing can occur, since
// we must know the largest ascent on the line.
// TextLayouts are computed and stored in a List;
// their horizontal positions are stored in a parallel
// List.
// lineContainsText is true after first segment is drawn
boolean lineContainsText = false;
boolean lineComplete = false;
float maxAscent = 0, maxDescent = 0;
float horizontalPos = leftMargin;
LinkedList<TextLayout> layouts = new LinkedList<TextLayout>();
LinkedList<Float> penPositions = new LinkedList<Float>();
int first = layouts.size();
while (!lineComplete && verticalPos <= maxVerticalPos) {
float wrappingWidth = rightMargin - horizontalPos;
TextLayout layout = null;
layout =
measurer.nextLayout(wrappingWidth,
tabLocations[currentTab] + 1,
lineContainsText);
// layout can be null if lineContainsText is true
if (layout != null) {
layouts.add(layout);
penPositions.add(horizontalPos);
horizontalPos += layout.getAdvance();
maxAscent = Math.max(maxAscent, layout.getAscent());
maxDescent = Math.max(maxDescent,
layout.getDescent() + layout.getLeading());
} else {
lineComplete = true;
}
lineContainsText = true;
if (measurer.getPosition() == tabLocations[currentTab] + 1) {
currentTab++;
}
if (measurer.getPosition() == styledText.getEndIndex()) {
lineComplete = true;
} else if (tabStops.length == 0 || horizontalPos >= tabStops[tabStops.length - 1]) {
lineComplete = true;
}
if (!lineComplete) {
// move to next tab stop
int j;
for (j = 0; horizontalPos >= tabStops[j]; j++) {
}
horizontalPos = tabStops[j];
}
}
// If there is only one layout element on the line, and we are
// drawing, then honor alignemnt
if (first == layouts.size() - 1 && g != null) {
switch (TEXT_ALIGNMENT) {
case TRAILING:
penPositions.set(first, rightMargin - layouts.get(first).getVisibleAdvance() - 1);
break;
case CENTER:
penPositions.set(first, (rightMargin - 1 - leftMargin - layouts.get(first).getVisibleAdvance()) / 2 + leftMargin);
break;
case LEADING:
default:
break;
}
}
verticalPos += maxAscent;
Iterator<TextLayout> layoutEnum = layouts.iterator();
Iterator<Float> positionEnum = penPositions.iterator();
// now iterate through layouts and draw them
while (layoutEnum.hasNext()) {
TextLayout nextLayout = layoutEnum.next();
float nextPosition = positionEnum.next();
if (g != null) {
nextLayout.draw(g, nextPosition, verticalPos);
}
Rectangle2D layoutBounds = nextLayout.getBounds();
paragraphBounds.add(new Rectangle2D.Double(layoutBounds.getX() + nextPosition,
layoutBounds.getY() + verticalPos,
layoutBounds.getWidth(),
layoutBounds.getHeight()));
}
verticalPos += maxDescent;
}
return paragraphBounds;
}
}
| mit |
ignazioc/MoneyManager | lib/moneymanager/reviewer.rb | 457 | class Reviewer
def review(entries)
archiver = Moneymanager::Archiver.new
entries.each do |entry|
Layout.print_single(entry)
prompt = TTY::Prompt.new
action = prompt.select('Do you recognize?', %i[yes no skip abort], per_page: 30)
case action
when :yes
entry.approved = true
when :no
entry.approved = false
when :abort
exit
end
archiver.update(entry)
end
end
end
| mit |
ElementsProject/elements | test/functional/p2p_eviction.py | 5754 | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
""" Test node eviction logic
When the number of peers has reached the limit of maximum connections,
the next connecting inbound peer will trigger the eviction mechanism.
We cannot currently test the parts of the eviction logic that are based on
address/netgroup since in the current framework, all peers are connecting from
the same local address. See Issue #14210 for more info.
Therefore, this test is limited to the remaining protection criteria.
"""
import time
from test_framework.blocktools import create_block, create_coinbase
from test_framework.messages import CTransaction, FromHex, msg_pong, msg_tx
from test_framework.p2p import P2PDataStore, P2PInterface
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
class SlowP2PDataStore(P2PDataStore):
def on_ping(self, message):
time.sleep(0.1)
self.send_message(msg_pong(message.nonce))
class SlowP2PInterface(P2PInterface):
def on_ping(self, message):
time.sleep(0.1)
self.send_message(msg_pong(message.nonce))
class P2PEvict(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
# The choice of maxconnections=32 results in a maximum of 21 inbound connections
# (32 - 10 outbound - 1 feeler). 20 inbound peers are protected from eviction:
# 4 by netgroup, 4 that sent us blocks, 4 that sent us transactions and 8 via lowest ping time
self.extra_args = [['-maxconnections=32']]
def run_test(self):
protected_peers = set() # peers that we expect to be protected from eviction
current_peer = -1
node = self.nodes[0]
node.generatetoaddress(101, node.get_deterministic_priv_key().address)
self.log.info("Create 4 peers and protect them from eviction by sending us a block")
for _ in range(4):
block_peer = node.add_p2p_connection(SlowP2PDataStore())
current_peer += 1
block_peer.sync_with_ping()
best_block = node.getbestblockhash()
tip = int(best_block, 16)
best_block_time = node.getblock(best_block)['time']
block = create_block(tip, create_coinbase(node.getblockcount() + 1), best_block_time + 1)
block.solve()
block_peer.send_blocks_and_test([block], node, success=True)
protected_peers.add(current_peer)
self.log.info("Create 5 slow-pinging peers, making them eviction candidates")
for _ in range(5):
node.add_p2p_connection(SlowP2PInterface())
current_peer += 1
self.log.info("Create 4 peers and protect them from eviction by sending us a tx")
for i in range(4):
txpeer = node.add_p2p_connection(SlowP2PInterface())
current_peer += 1
txpeer.sync_with_ping()
prevtx = node.getblock(node.getblockhash(i + 1), 2)['tx'][0]
rawtx = node.createrawtransaction(
inputs=[{'txid': prevtx['txid'], 'vout': 0}],
outputs=[{node.get_deterministic_priv_key().address: 50 - 0.00125}, {"fee": 0.00125}],
)
sigtx = node.signrawtransactionwithkey(
hexstring=rawtx,
privkeys=[node.get_deterministic_priv_key().key],
prevtxs=[{
'txid': prevtx['txid'],
'vout': 0,
'scriptPubKey': prevtx['vout'][0]['scriptPubKey']['hex'],
}],
)['hex']
txpeer.send_message(msg_tx(FromHex(CTransaction(), sigtx)))
protected_peers.add(current_peer)
self.log.info("Create 8 peers and protect them from eviction by having faster pings")
for _ in range(8):
fastpeer = node.add_p2p_connection(P2PInterface())
current_peer += 1
self.wait_until(lambda: "ping" in fastpeer.last_message, timeout=10)
# Make sure by asking the node what the actual min pings are
peerinfo = node.getpeerinfo()
pings = {}
for i in range(len(peerinfo)):
pings[i] = peerinfo[i]['minping'] if 'minping' in peerinfo[i] else 1000000
sorted_pings = sorted(pings.items(), key=lambda x: x[1])
# Usually the 8 fast peers are protected. In rare case of unreliable pings,
# one of the slower peers might have a faster min ping though.
for i in range(8):
protected_peers.add(sorted_pings[i][0])
self.log.info("Create peer that triggers the eviction mechanism")
node.add_p2p_connection(SlowP2PInterface())
# One of the non-protected peers must be evicted. We can't be sure which one because
# 4 peers are protected via netgroup, which is identical for all peers,
# and the eviction mechanism doesn't preserve the order of identical elements.
evicted_peers = []
for i in range(len(node.p2ps)):
if not node.p2ps[i].is_connected:
evicted_peers.append(i)
self.log.info("Test that one peer was evicted")
self.log.debug("{} evicted peer: {}".format(len(evicted_peers), set(evicted_peers)))
assert_equal(len(evicted_peers), 1)
self.log.info("Test that no peer expected to be protected was evicted")
self.log.debug("{} protected peers: {}".format(len(protected_peers), protected_peers))
assert evicted_peers[0] not in protected_peers
if __name__ == '__main__':
P2PEvict().main()
| mit |
facebook/jest | scripts/remove-examples.js | 578 | /**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const {writeFileSync} = require('fs');
const {resolve} = require('path');
const rimraf = require('rimraf');
const configFile = require.resolve('../jest.config');
const config = require(configFile);
delete config.projects;
writeFileSync(configFile, `module.exports = ${JSON.stringify(config)};\n`);
rimraf.sync(resolve(__dirname, '../examples/'));
| mit |
haefele/Mileage | src/04 Shared/Mileage.Localization/Properties/AssemblyInfo.cs | 922 | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Mileage.Localization")]
[assembly: AssemblyDescription("Contains the available languages for the Mileage server and desktop client applications.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a8d36055-9404-4611-bf20-81412ffaefbd")] | mit |
elementary/mvp | _scripts/pages/store/cart.js | 4536 | /**
* scripts/pages/store/cart.js
* Does update logic for cart quantities and some basic address validation
*/
/* global plausible */
import jQuery from '~/lib/jquery'
Promise.all([jQuery]).then(([$]) => {
plausible('Store: Cart Visit')
$(document).ready(function () {
var baseUrl = $('base').attr('href')
var country = {}
if (typeof window.country !== 'undefined') {
country = window.country
} else if (Object.keys(country).length === 0) {
console.error('Unable to find country data')
$.getJSON(baseUrl + 'data/country.json', function (data) {
console.log('Was able to fetch country data manually')
country = data
})
}
/**
* updateTotal
* Adds prices for everything in cart and puts sub total in footer
*/
var updateTotal = function () {
var $products = $('.list--product .list__item')
if ($products.length <= 0) location.reload()
var total = 0
$products.each(function (i, p) {
var n = $(p).attr('id').replace('product-', '')
var $i = $('.list__item#product-' + n)
var price = $('input[name$="price"]', $i).val()
var quantity = $('input[name$="quantity"]', $i).val()
var t = (price * quantity)
$('.subtotal b', $i).text('$' + parseFloat(t).toFixed(2))
total += t
})
$('.list--product .list__footer h4').text('Sub-Total: $' + parseFloat(total).toFixed(2))
}
/**
* POSTs to inventory endpoint to update cart quantities without page refresh
*/
$('.list--product .list__item input[name$="quantity"]').on('change', function (e) {
try {
if (!$(this)[0].checkValidity || !$(this)[0].checkValidity()) return
} catch (err) {
console.error('You have a really old browser...')
}
var $input = $(this)
var $item = $input.closest('.list__item')
var id = $item.attr('id').replace('product-', '').split('-')
var productId = id[0]
var variantId = id[1]
var quantity = $input.val()
var $error = $item.find('.alert--error')
$.get(baseUrl + 'store/inventory', {
id: productId,
variant: variantId,
quantity: quantity,
math: 'set',
simple: true
})
.done(function (data) {
if (data === 'OK') {
$error.text('')
if (quantity <= 0) $item.remove()
updateTotal()
} else {
console.error('Unable to update cart quantity')
console.error(data)
$error.text('Unable to update quantity')
}
})
})
/**
* updateAddressForm
* Updates state field based on current selected country
*
* @return {void}
*/
const updateAddressForm = (notify = true) => {
const form = $('form[action$="checkout"]')
const value = $('select[name="country"]', form).val()
const $state = $('select[name="state"]', form)
const $statelabel = $('label[for="state"]', form)
if (notify) plausible('Store: Country Change') // value
if (country[value] != null && typeof country[value].states === 'object') {
$state.empty()
var options = []
Object.keys(country[value].states).forEach(function (code) {
var state = country[value].states[code]
options.push('<option value="' + code + '">' + state + '</option>')
})
$state.append(options.join(''))
$state.show().attr('required', true)
$statelabel.show().attr('required', true)
} else {
$state.hide().attr('required', false)
$statelabel.hide().attr('required', false)
}
}
// Hide the inputs we don't need depending on the country
$('form[action$="checkout"] select[name="country"]').on('change', () => updateAddressForm(true))
updateAddressForm(false)
})
})
| mit |
mahasayz/expenses | src/Expense/SiteBundle/Controller/LoginController.php | 3554 | <?php
namespace Expense\SiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Expense\StoreBundle\Entity\User;
use Expense\StoreBundle\Utils;
class LoginController extends Controller
{
/**
* @Route("/login", name="_my_login")
* @Template()
*/
public function loginAction()
{
$request = $this->getRequest();
$session = $request->getSession();
// get the login error if there is one
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(
SecurityContext::AUTHENTICATION_ERROR
);
} else {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
}
return array(
// last username entered by the user
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
'error' => $error,
);
}
/**
* @Route("/login_check", name="_my_login_check")
*/
public function loginCheckAction()
{
}
/**
* @Route("/logout", name="_my_logout")
*/
public function logoutAction()
{
// The security layer will intercept this request
}
/**
* @Route("/signup", name="_my_signup")
* @Template()
*/
public function signUpAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
//get country code and symbol for dropdown
$countryOptions = array();
foreach(Utils::getCountry() as $key => $value){
$countryOptions[$key] = $key . " ($value)";
}
$user = new User();
$form= $this->createFormBuilder($user)
->add("firstName")
->add("lastName")
->add("username")
->add("password", "password")
->add("countryCode", "choice", array(
'choices' => $countryOptions,
'preferred_choices' => array('USD'),
))
->getForm();
$form->handleRequest($request);
if ($form->isValid()) {
$user = $form->getData();
/////password encoding//
$factory = $this->get("security.encoder_factory");
$encoder = $factory->getEncoder($user);
$password = $encoder->encodePassword($user->getPassword(), $user->getSalt());
$user->setPassword($password);
///password encoding ends//
$role = $em->getRepository("ExpenseStoreBundle:Role")->findOneByRole("CUSTOMER");
$user->addRole($role);
$em->persist($user);
$em->flush();
$this->get('session')->getFlashBag()->add(
'success',
'Account created successfully!'
);
///send email
/* $message = \Swift_Message::newInstance()
->setSubject("Account Created")
->setFrom("[email protected]")
->setTo($user->getUsername())
->setBody(
"Thankyou {$user->getFirstName()} your account is created"
);
$this->get('mailer')->send($message); */
return $this->redirect($this->generateUrl("_my_login"));
}
return array(
"user" => $form->createView(),
);
}
} | mit |
plotly/plotly.py | packages/python/plotly/plotly/validators/isosurface/_legendgroup.py | 412 | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="isosurface", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "style"),
**kwargs
)
| mit |
LabLayers/CIS-1068 | 04 Loops/LoopWhile.java | 1984 | /**
* Meal Plan Calculator using while loops
* @author Victor Lourng
* @version 2016
*/
import java.util.Scanner;
public class LoopWhile {
/**
* Ask user for information about their meal plan, then runs methods below.
*/
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("How much does the meal plan cost?");
Double plan_rate = keyboard.nextDouble();
System.out.println("How many meals per week does the meal plan provide?");
Double plan_type = keyboard.nextDouble();
System.out.println("On average, how many meals do you actually plan to eat on campus per week?");
Double actual = keyboard.nextDouble();
Double actual_rate = CalculateActualRate(actual);
SuggestMealPlan(plan_rate, actual_rate);
}
/**
* Calculate actual cost of meals if purchased invidually.
*/
public static Double CalculateActualRate (Double actual) {
int weeks = 1;
Double actual_rate = 0.00;
while (weeks <= 20) { // A meal plan is valid for 20 weeks.
actual_rate += actual * 8.49; // A meal purchased individually costs $8.49.
weeks += 1;
}
return actual_rate;
}
/**
* Suggest to the user if it is cheaper to purchase a meal plan or purchase a meal individually.
*/
public static void SuggestMealPlan (Double plan_rate, Double actual_rate) {
if (actual_rate < plan_rate) {
System.out.println("It is cheaper to purchase meals individually (at $" + actual_rate + "/semester) than to purchase a meal plan (at $" + plan_rate + "/semester).");
}
else if (actual_rate > plan_rate) {
System.out.println("It is cheaper to purchase a meal plan (at $" + plan_rate + "/semester) than it is to purchase a meal individually (at $" + actual_rate + "/semester).");
}
else {
System.out.println("It costs the same to purchase a meal plan than it is to purchase a meal individually (at $" + actual_rate + "/semester).");
}
}
} | mit |
pequalsnp/eve-isk-tracker | app/modules/MetricModule.scala | 311 | package modules
import com.codahale.metrics.MetricRegistry
import com.google.inject.AbstractModule
import net.codingwell.scalaguice.ScalaModule
class MetricModule extends AbstractModule with ScalaModule {
override def configure(): Unit = {
bind[MetricRegistry].toInstance(new MetricRegistry)
}
}
| mit |
ShivamMukherjee/TL4_TestingGrounds | TL4_TestingGrounds/Source/TL4_TestingGrounds/TL4_TestingGroundsGameMode.cpp | 727 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "TL4_TestingGrounds.h"
#include "TL4_TestingGroundsGameMode.h"
#include "TL4_TestingGroundsHUD.h"
#include "Player/FirstPersonCharacter.h"
#include "UObject/ConstructorHelpers.h"
#include "Misc/Paths.h"
ATL4_TestingGroundsGameMode::ATL4_TestingGroundsGameMode()
: Super()
{
// set default pawn class to our Blueprinted character
const TCHAR* TL4CharacterHardLink = TEXT("/Game/Dynamic/TL4Character/Behaviour/BP_TL4Character");
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TL4CharacterHardLink);
DefaultPawnClass = PlayerPawnClassFinder.Class;
// use our custom HUD class
HUDClass = ATL4_TestingGroundsHUD::StaticClass();
}
| mit |
paulsapps/7-Gears | inc/kernel/stream.hpp | 719 | #pragma once
#include <vector>
#include <iostream>
#include <memory>
#include <SDL_types.h>
class Stream
{
public:
explicit Stream(const std::string& fileName);
explicit Stream(std::vector<Uint8>&& data);
void ReadUInt8(Uint8& output);
void ReadUInt32(Uint32& output);
void ReadUInt16(Uint16& output);
void ReadSInt16(Sint16& output);
void ReadBytes(Sint8* pDest, size_t destSize);
void ReadBytes(Uint8* pDest, size_t destSize);
void Seek(size_t pos);
size_t Pos() const;
size_t Size() const;
bool AtEnd() const;
std::string Name() const { return mName; }
private:
mutable std::unique_ptr<std::istream> mStream;
size_t mSize = 0;
std::string mName;
};
| mit |
plotly/python-api | packages/python/plotly/plotly/graph_objs/layout/_modebar.py | 13508 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Modebar(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.modebar"
_valid_props = {"activecolor", "bgcolor", "color", "orientation", "uirevision"}
# activecolor
# -----------
@property
def activecolor(self):
"""
Sets the color of the active or hovered on icons in the
modebar.
The 'activecolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["activecolor"]
@activecolor.setter
def activecolor(self, val):
self["activecolor"] = val
# bgcolor
# -------
@property
def bgcolor(self):
"""
Sets the background color of the modebar.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bgcolor"]
@bgcolor.setter
def bgcolor(self, val):
self["bgcolor"] = val
# color
# -----
@property
def color(self):
"""
Sets the color of the icons in the modebar.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"]
@color.setter
def color(self, val):
self["color"] = val
# orientation
# -----------
@property
def orientation(self):
"""
Sets the orientation of the modebar.
The 'orientation' property is an enumeration that may be specified as:
- One of the following enumeration values:
['v', 'h']
Returns
-------
Any
"""
return self["orientation"]
@orientation.setter
def orientation(self, val):
self["orientation"] = val
# uirevision
# ----------
@property
def uirevision(self):
"""
Controls persistence of user-driven changes related to the
modebar, including `hovermode`, `dragmode`, and `showspikes` at
both the root level and inside subplots. Defaults to
`layout.uirevision`.
The 'uirevision' property accepts values of any type
Returns
-------
Any
"""
return self["uirevision"]
@uirevision.setter
def uirevision(self, val):
self["uirevision"] = val
# Self properties description
# ---------------------------
@property
def _prop_descriptions(self):
return """\
activecolor
Sets the color of the active or hovered on icons in the
modebar.
bgcolor
Sets the background color of the modebar.
color
Sets the color of the icons in the modebar.
orientation
Sets the orientation of the modebar.
uirevision
Controls persistence of user-driven changes related to
the modebar, including `hovermode`, `dragmode`, and
`showspikes` at both the root level and inside
subplots. Defaults to `layout.uirevision`.
"""
def __init__(
self,
arg=None,
activecolor=None,
bgcolor=None,
color=None,
orientation=None,
uirevision=None,
**kwargs
):
"""
Construct a new Modebar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.Modebar`
activecolor
Sets the color of the active or hovered on icons in the
modebar.
bgcolor
Sets the background color of the modebar.
color
Sets the color of the icons in the modebar.
orientation
Sets the orientation of the modebar.
uirevision
Controls persistence of user-driven changes related to
the modebar, including `hovermode`, `dragmode`, and
`showspikes` at both the root level and inside
subplots. Defaults to `layout.uirevision`.
Returns
-------
Modebar
"""
super(Modebar, self).__init__("modebar")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.Modebar
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.Modebar`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("activecolor", None)
_v = activecolor if activecolor is not None else _v
if _v is not None:
self["activecolor"] = _v
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("orientation", None)
_v = orientation if orientation is not None else _v
if _v is not None:
self["orientation"] = _v
_v = arg.pop("uirevision", None)
_v = uirevision if uirevision is not None else _v
if _v is not None:
self["uirevision"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False
| mit |
MadMikeyB/kwnme.framework.2.0 | app/views/Spam/SpamIP.php | 278 | <div class="alert alert-danger" role="alert">
<i class="fa fa-exclamation-triangle"></i>
The IP address which you made your request with has been banned from our service. Please <a href="http://kwn.me/contact">email us</a> if you think that this is an error. Thank you.
</div> | mit |
swipesapp/valjs | tools/build.js | 1240 | const fs = require('fs')
const execSync = require('child_process').execSync
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
const exec = (command, extraEnv) =>
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv)
})
const isTest = process.env.NODE_ENV === 'test';
if(!isTest) {
console.log('Building CommonJS modules ...');
exec('babel src -d dist/cjs --ignore __tests__', {
BABEL_ENV: 'cjs'
})
console.log('\nBuilding ES modules ...');
exec('babel src -d dist/es --ignore __tests__', {
BABEL_ENV: 'es'
})
}
console.log('\nBuilding valjs.js ...')
exec('rollup -c -f umd -o dist/umd/valjs.js', {
BABEL_ENV: 'umd',
NODE_ENV: 'development'
})
if(isTest) {
console.log('\nBuilding tester.js ...')
exec('babel src/tester.js --out-file dist/tester.js', {
BABEL_ENV: 'cjs'
})
console.log('\n\n\n');
}
if(!isTest) {
console.log('\nBuilding valjs.min.js ...')
exec('rollup -c -f umd -o dist/umd/valjs.min.js', {
BABEL_ENV: 'umd',
NODE_ENV: 'production'
})
const size = gzipSize.sync(
fs.readFileSync('dist/umd/valjs.min.js')
)
console.log('\ngzipped, the UMD build is %s', prettyBytes(size))
}
| mit |
TeaLang/tea | tests/syntax/dist/operations.php | 1246 | <?php
namespace tea\tests\syntax;
require_once dirname(__DIR__, 1) . '/__public.php';
#internal
const PI = 3.1415926;
// ---------
$some = 'abc' . (1 + fmod((2 & 2) * 2 ** 3 / 5, 6));
$uint_num = 123;
$int_num = 123;
$uint_from_string = uint_ensure((int)'123');
$str_from_uint = (string)123;
$str_from_float = (string)123.123;
$dict = ['a' => 1, 'b' => '100'];
$val = isset($dict['b']) ? (int)$dict['b'] : 0;
echo 'Value for ?? expression is: ', LF;
var_dump($val);
if (is_string($str_from_float)) {
echo $str_from_float . ' is String', LF;
}
if (!is_string($uint_num)) {
echo $uint_num . ' is not a String', LF;
}
$str_for_find = 'abc123';
$found = strpos($str_for_find, 'abc');
if ($found === false) {
echo '"abc" has not be found in ' . $str_for_find, LF;
}
$num = 3;
$result = -$num * PI ** 2 - 12;
$is_greater = 3 > $num;
$b1 = true;
$b2 = !$b1;
$b3 = !($num - 3);
$b4 = !($num > 3);
$l1 = !($num < 0) && $num != 3;
is_int(1);
is_uint(2);
!is_int(1);
new \ErrorException('demo') instanceof \Exception;
$a = 1;
$b = $a == 1 ? 'one' : ($a == 2 ? 'two' : ($a == 3 ? 'three' : 'other'));
$c = ($a ?: 1) ? ($a ?: 2) : ($a ?: 3);
$d = 0 ? 1 : (2 + $a ? $a : 3);
$e = $a ?? 1 ? $a ?? 2 : $a ?? 3;
// ---------
// program end
| mit |
DLukeNelson/Arduino-Battleship | Arduino-Battleship/Place_Ships.cpp | 7962 | /* Function for a player to place his ships at the start of the game.
*/
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#include <SD.h>
#include "Place_Ships.h"
#include "Draw_Screen.h"
#include "lcd_image.h"
#include "Images.h"
#include "Cursor.h"
#include "SoundFX.h"
Ship Ship_Array[5]; // Creates an array of 5 ships that will be
// defined below.
// Checks if a selected location is a valid ship placement. (ie. Ensures
// that a player cannot overlap ships.)
bool Valid_Horiz(int8_t* Array, int location, int size) {
for( int i=0; i<size; i++ ) { // checks each square in a ship's size
// if that location is nonzero, then a ship must be there
if( Array[location+i] != 0 ) {
return 1; // return 1 for invalid location
}
}
// return 0 if the location is fine. Can only reach this point by
// checking each square in the grid.
return 0;
}
// Works just as Valid_Horiz, but for a vertically placed ship.
bool Valid_Vert(int8_t* Array, int location, int size) {
for( int i=0; i<size; i++ ) {
if( Array[location+i*10] != 0 ) {
return 1;
}
}
return 0;
}
Ship* Place_Ships(int8_t* Array, int8_t* ArraytoCheck) {
// draw a green square at the top left corner
tft.fillRect(0, 0, 8, 8, 0x07E0);
// draw the screen (will always be a blank ocean).
Draw_Screen(Array, ArraytoCheck);
// Carrier = 5 (#defined in Place_Ships.h)
int remainingShips = Carrier;
// create some text settings for use later
tft.setTextWrap(false);
tft.setTextColor(0xFFFF, 0);
// initialize the array of ships
Ship_Array[Carrier] = (Ship){"Carrier", 1, 5, 0};
Ship_Array[Battleship] = (Ship){"Battleship", 1, 4, 0};
Ship_Array[Cruiser] = (Ship){"Cruiser", 1, 3, 0};
Ship_Array[Submarine] = (Ship){"Submarine", 1, 3, 0};
Ship_Array[Destroyer] = (Ship){"Destroyer", 1, 2, 0};
// A while loop was chosen over a for loop so it is easy to repeat
// when an invalid ship placement attempt occurs.
while( remainingShips >= 0 ) {
// set the cursor and write text at the bottom of the screen.
tft.setCursor(0, 129);
tft.println("Please place your:");
tft.print(Ship_Array[remainingShips].name);
tft.print(" (");
tft.print(Ship_Array[remainingShips].size);
tft.print(") ");
// draw an example of the ship to be placed at the bottom.
lcd_image_draw(&Images[shipl], &tft, 0, 0, 25, 146, unit, unit);
for(int i = 1; i<Ship_Array[remainingShips].size; i++) {
if( i+1 != Ship_Array[remainingShips].size ) {
lcd_image_draw(&Images[shipm], &tft, 0, 0, 25+(12*i), 146, unit, unit);
}
else {
lcd_image_draw(&Images[shipr], &tft, 0, 0, 25+(12*i), 146, unit, unit);
if( remainingShips != 4 ) {
tft.fillRect(25+(unit*(i+1)), 146, unit, unit, 0);
}
}
}
// Use the cursor to select a location for the ship.
Ship_Array[remainingShips].location = Cursor(
Ship_Array[remainingShips].size,
&Ship_Array[remainingShips].orientation, Array);
// Refer to line 49 in Battleship.cpp for how My_Ocean (called Array
// in this function) works.
// For horizontal ships.
if( Ship_Array[remainingShips].orientation == 1 ) {
if( Valid_Horiz(Array, Ship_Array[remainingShips].location,
Ship_Array[remainingShips].size) ) {
// if the location was invalid, write an error message.
tft.setCursor(0,129);
tft.print("Invalid location ");
// redraw the spot where the cursor was.
HorizontalRedraw(Ship_Array[remainingShips].size,
Array, Ship_Array[remainingShips].location);
Sound_Error(); // play an error sound effect.
delay(500); // A short delay (plus the delay from the sound
// effect) to allow time to see the error message.
}
else { // if the location was valid.
// Set the value of Array[location] to shipl, associated to the
// ship currently being placed.
Array[Ship_Array[remainingShips].location] = shipl+10*remainingShips;
// Draw a shipl image.
lcd_image_draw(&Images[shipl], &tft, 0, 0,
(Ship_Array[remainingShips].location%10)*unit+8,
(Ship_Array[remainingShips].location/10)*unit+8,
unit, unit);
// goes through each remaining piece of the ship.
for( int i = 1; i<Ship_Array[remainingShips].size; i++ ) {
// assigns each piece (up to size-1) of the ship to its
// corresponding position in the array as shipm, and draws it.
if( i+1 != Ship_Array[remainingShips].size ) {
Array[Ship_Array[remainingShips].location+i] = shipm+10*remainingShips;
lcd_image_draw(&Images[shipm], &tft, 0, 0,
((Ship_Array[remainingShips].location+i)%10)*12+8,
(Ship_Array[remainingShips].location/10)*12+8,
unit, unit);
}
// assigns the last piece of the ship, shipr to its
// corresponding position in the array, and draws it.
else {
Array[Ship_Array[remainingShips].location+i] = shipr+10*remainingShips;
lcd_image_draw(&Images[shipr], &tft, 0, 0,
((Ship_Array[remainingShips].location+i)%10)*12+8,
(Ship_Array[remainingShips].location/10)*12+8,
unit, unit);
}
}
// decrement remaining ships. (Is not decremented when the
// placement fails the validity check, so that the loop repeats
// for the same ship over again.)
remainingShips--;
}
}
// For vertical ships.
else if( Ship_Array[remainingShips].orientation == 0 ) {
// if the location was invalid
if( Valid_Vert(Array, Ship_Array[remainingShips].location,
Ship_Array[remainingShips].size) ) {
tft.setCursor(0,129);
tft.print("Invalid location ");
Ship_Array[remainingShips].orientation = 1;
// redraw the spot where the cursor was
VerticalRedraw(Ship_Array[remainingShips].size,
Array, Ship_Array[remainingShips].location);
Sound_Error();
delay(500); // delay to view the error message.
}
else { // location was invalid
// Same process as above, with slight modifications for vertical
// instead of horizontal.
Array[Ship_Array[remainingShips].location] = shipt+10*remainingShips;
lcd_image_draw(&Images[shipt], &tft, 0, 0,
(Ship_Array[remainingShips].location%10)*12+8,
(Ship_Array[remainingShips].location/10)*12+8,
unit, unit);
for( int i = 1; i<Ship_Array[remainingShips].size; i++ ) {
if( i+1 != Ship_Array[remainingShips].size ) {
Array[Ship_Array[remainingShips].location+10*i] = shipm+10*remainingShips;
lcd_image_draw(&Images[shipm], &tft, 0, 0,
(Ship_Array[remainingShips].location%10)*12+8,
(Ship_Array[remainingShips].location/10+i)*12+8,
unit, unit);
}
else {
Array[Ship_Array[remainingShips].location+10*i] = shipb+10*remainingShips;
lcd_image_draw(&Images[shipb], &tft, 0, 0,
(Ship_Array[remainingShips].location%10)*12+8,
(Ship_Array[remainingShips].location/10+i)*12+8,
unit, unit);
}
}
remainingShips--;
}
}
}
return Ship_Array;
}
| mit |
n4ch03/zendhub | src/middlewares/index.js | 968 | 'use strict';
/*
* Middlewares: define all global middlewares for your api
*/
import express from 'express';
import bodyParser from 'body-parser';
export default () => {
let middlewares = express.Router();
middlewares.use(bodyParser.json()); // for parsing application/json
middlewares.use((req, res, next) => {
if (req.webtaskContext.data.ZENDESK_USERNAME !== undefined &&
req.webtaskContext.data.ZENDESK_PASSWORD !== undefined &&
req.webtaskContext.data.ZENDESK_DOMAIN !== undefined &&
req.webtaskContext.data.ZENDESK_GITHUB_FIELD_ID !== undefined &&
req.webtaskContext.data.GITHUB_USERNAME !== undefined &&
req.webtaskContext.data.GITHUB_PASSWORD !== undefined &&
req.webtaskContext.data.GITHUB_REPO !== undefined) {
next();
} else {
res.status(412).json({"ok": false, "error": "Missing Webtask configuration parameter"});
}
});
return middlewares;
}
| mit |
xygdev/XYG_QBORD | src/com/xinyiglass/xygdev/controller/FuncController.java | 3571 | package com.xinyiglass.xygdev.controller;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMethod;
import com.xinyiglass.xygdev.entity.FunctionVO;
import com.xinyiglass.xygdev.service.FunctionVOService;
import xygdev.commons.core.BaseController;
@Controller
@RequestMapping("/func")
@Scope("prototype")
public class FuncController extends BaseController{
@Autowired
FunctionVOService FVS;
//http://192.168.88.123:8080/XYG_WEBDEV_SAMPLE/function/function.do
@RequestMapping("/setFuncId.do")
public void setFuncId(){
Long funcId = this.getParaToLong("FUNCTION_ID");
this.setSessionAttr("FUNCTION_ID", funcId);
}
@RequestMapping("/funcManage.do")
public String function(){
return this.getSessionAttr("LANG")+"/xygQbordFuncManage";
}
@RequestMapping(value = "/getFuncPage.do", method = RequestMethod.POST)
public void getFuncPage() throws Exception
{
Map<String,Object> conditionMap=new HashMap<String,Object>();
conditionMap.put("pageSize", this.getParaToInt("pageSize"));
conditionMap.put("pageNo", this.getParaToInt("pageNo"));
conditionMap.put("goLastPage", this.getParaToBoolean("goLastPage"));
conditionMap.put("funcId", this.getParaToLong("FUNCTION_ID"));
conditionMap.put("orderBy", this.getPara("orderby"));
this.renderStr(FVS.findForPage(conditionMap,loginId));
}
@RequestMapping(value = "/insert.do", method = RequestMethod.POST)
public void insert() throws Exception
{
FunctionVO f = new FunctionVO();
f.setFunctionCode(this.getPara("FUNCTION_CODE"));
f.setFunctionName(this.getPara("FUNCTION_NAME"));
f.setFunctionUrl(this.getPara("FUNCTION_URL"));
f.setDescription(this.getPara("DESCRIPTION"));
f.setIconId(this.getParaToLong("ICON_ID"));
this.renderStr(FVS.insert(f, loginId).toJsonStr());
}
@RequestMapping(value = "/preUpdate.do", method = RequestMethod.POST)
public void preUpdate() throws Exception
{
Long functionId = this.getParaToLong("FUNCTION_ID");
FunctionVO functionVO = FVS.findById(functionId, loginId);
this.setSessionAttr("lockFunctionVO", functionVO);
this.renderStr(FVS.findByIdForJSON(functionId,loginId));
}
@RequestMapping(value = "/update.do", method = RequestMethod.POST)
public void update() throws Exception
{
Long functionId = this.getParaToLong("FUNCTION_ID");
FunctionVO lockFunctionVO = (FunctionVO)this.getSessionAttr("lockFunctionVO");
if (lockFunctionVO ==null){
throw new RuntimeException("更新数据出错:会话数据已经无效!请返回再重新操作!");
}
if (!functionId.equals(lockFunctionVO.getFunctionId())){
throw new RuntimeException("更新的数据无法匹配!请重新查询!");
}
FunctionVO f = new FunctionVO();//复制对象!
f = (FunctionVO) lockFunctionVO.clone();
f.setFunctionId(functionId);
f.setFunctionCode(this.getPara("FUNCTION_CODE"));
f.setFunctionName(this.getPara("FUNCTION_NAME"));
f.setFunctionUrl(this.getPara("FUNCTION_URL"));
f.setDescription(this.getPara("DESCRIPTION"));
f.setIconId(this.getParaToLong("ICON_ID"));
this.renderStr(FVS.update(lockFunctionVO,f, loginId).toJsonStr());
}
}
| mit |
ivan-uskov/dnaclub | dnaclub/src/AppBundle/Form/ProductForm.php | 1523 | <?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use AppBundle\Entity\Product;
class ProductForm extends AbstractType
{
public function getName()
{
return 'product_form';
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$isNew = $options['isNew'];
$buttonName = $isNew ? 'Добавить' : 'Сохранить';
$measureTypes = Product::getMeasureTypes();
$builder
->add('name', 'text', array(
'label' => 'Наименование',
'trim' => true
))
->add('price', 'money', array(
'label' => 'Цена',
'currency' => 'RUB'
))
->add('pieceName', 'choice', array(
'label' => 'Ед.изм.',
//'placeholder' => '',
'choices' => $measureTypes,
'choices_as_values' => false
))
->add('save', 'submit', array(
'label' => $buttonName,
'attr' => array('class' => 'btn-success')
));
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Product',
'isNew' => false
));
}
} | mit |
d0niek/ftp-update | src/Update/Update.php | 2922 | <?php
/**
* User: d0niek
* Date: 11/11/15
* Time: 2:23 PM
*/
namespace Update;
use Exception;
class Update
{
/**
* Gets modified files array since last update
*
* @param string $source
* @param int $lastUpdate
* @param array $ignoredFiles
*
* @return array
* @throws \Exception
*/
public function modifiedFiles($source, $lastUpdate = 0, $ignoredFiles = [])
{
$basePath = $source;
$files = [];
$paths = [
[
$source,
$lastUpdate
]
];
for ($i = 0; $i < count($paths); $i++) {
list($sourcePath, $lastUpdate) = $paths[$i];
// Change backslash to slash (Windows)
if (DIRECTORY_SEPARATOR == '\\') {
$sourcePath = str_replace('\\', '/', $sourcePath);
}
if ($this->isIgnoredFile($sourcePath, $basePath, $ignoredFiles)) {
continue;
}
// If file doesn't exists or was removed, throw exception
if (!file_exists($sourcePath)) {
throw new Exception("$sourcePath must be a valid file");
}
// Add files if they were modified after last update
if (is_file($sourcePath)) {
if (filemtime($sourcePath) > $lastUpdate) {
$files[] = $sourcePath;
}
} else {
$paths = array_merge($paths, $this->getFilesFromDirectory($sourcePath, $lastUpdate));
}
}
return $files;
}
/**
* Checks if file is on ignored files list
*
* @param string $sourcePath
* @param string $basePath
* @param array $ignoredFiles
*
* @return bool
*/
private function isIgnoredFile($sourcePath, $basePath, $ignoredFiles)
{
$isIgnored = false;
foreach ($ignoredFiles as $ignoredFile) {
// Ignore comments
if (strpos($ignoredFile, '#') === 0) {
continue;
}
if ($basePath . DIRECTORY_SEPARATOR . $ignoredFile === $sourcePath) {
$isIgnored = true;
break;
}
}
return $isIgnored;
}
/**
* Gets files from source directory
*
* @param string $sourcePath
* @param int $lastUpdate
*
* @return array
*/
private function getFilesFromDirectory($sourcePath, $lastUpdate)
{
$files = [];
$directory = opendir($sourcePath);
while (($item = readdir($directory)) !== false) {
if ($item === '.' || $item === '..') {
continue;
}
$files[] = [
$sourcePath . DIRECTORY_SEPARATOR . $item,
$lastUpdate
];
}
closedir($directory);
return $files;
}
}
| mit |
ciscohdz/learning-python-basic | google-exercises/basic/string1.py | 3644 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already set up
# to call the functions with a few different inputs,
# printing 'OK' when each function is correct.
# The starter code for each function includes a 'return'
# which is just a placeholder for your code.
# It's ok if you do not complete all the functions, and there
# are some additional functions to try in string2.py.
# A. donuts
# Given an int count of a number of donuts, return a string
# of the form 'Number of donuts: <count>', where <count> is the number
# passed in. However, if the count is 10 or more, then use the word 'many'
# instead of the actual count.
# So donuts(5) returns 'Number of donuts: 5'
# and donuts(23) returns 'Number of donuts: many'
def donuts(count):
# +++your code here+++
count_str = '';
if count >= 10:
count_str = 'many';
else:
count_str = str(count)
return 'Number of donuts: %s' % count_str
# B. both_ends
# Given a string s, return a string made of the first 2
# and the last 2 chars of the original string,
# so 'spring' yields 'spng'. However, if the string length
# is less than 2, return instead the empty string.
def both_ends(s):
if len(s) < 2:
return '';
return s[0:2] + s[-2:]
# C. fix_start
# Given a string s, return a string
# where all occurences of its first char have
# been changed to '*', except do not change
# the first char itself.
# e.g. 'babble' yields 'ba**le'
# Assume that the string is length 1 or more.
# Hint: s.replace(stra, strb) returns a version of string s
# where all instances of stra have been replaced by strb.
def fix_start(s):
first_char = s[0];
return first_char + s[1:].replace(first_char, '*')
# D. MixUp
# Given strings a and b, return a single string with a and b separated
# by a space '<a> <b>', except swap the first 2 chars of each string.
# e.g.
# 'mix', pod' -> 'pox mid'
# 'dog', 'dinner' -> 'dig donner'
# Assume a and b are length 2 or more.
def mix_up(a, b):
first = b[0:2] + a[2:]
second = a[0:2] + b[2:]
return "%s %s" % (first, second)
# Provided simple test() function used in main() to print
# what each function returns vs. what it's supposed to return.
def test(got, expected):
if got == expected:
prefix = ' OK '
else:
prefix = ' X '
print '%s got: %s expected: %s' % (prefix, repr(got), repr(expected))
# Provided main() calls the above functions with interesting inputs,
# using test() to check if each result is correct or not.
def main():
print 'donuts'
# Each line calls donuts, compares its result to the expected for that call.
test(donuts(4), 'Number of donuts: 4')
test(donuts(9), 'Number of donuts: 9')
test(donuts(10), 'Number of donuts: many')
test(donuts(99), 'Number of donuts: many')
print
print 'both_ends'
test(both_ends('spring'), 'spng')
test(both_ends('Hello'), 'Helo')
test(both_ends('a'), '')
test(both_ends('xyz'), 'xyyz')
print
print 'fix_start'
test(fix_start('babble'), 'ba**le')
test(fix_start('aardvark'), 'a*rdv*rk')
test(fix_start('google'), 'goo*le')
test(fix_start('donut'), 'donut')
print
print 'mix_up'
test(mix_up('mix', 'pod'), 'pox mid')
test(mix_up('dog', 'dinner'), 'dig donner')
test(mix_up('gnash', 'sport'), 'spash gnort')
test(mix_up('pezzy', 'firm'), 'fizzy perm')
# Standard boilerplate to call the main() function.
if __name__ == '__main__':
main()
| mit |
lhzhou/share_web | app/Http/Controllers/Helper/Http.php | 2269 | <?php
namespace App\Http\Controllers\Helper;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use GuzzleHttp\Client;
class Http extends Controller
{
/**
* @param $url
* @array $params
* @return object
*/
public static function post($url , array $params = [])
{
self::encryption($params);
$client = new Client();
$response = $client->request(
'POST',
$url,
[
'form_params' => $params,
'timeout' => 30,
'http_errors' => true
]
);
if ($response->getStatusCode() != 200)
{
return \Response::json((object)['status' => -1 , 'message' => '链接服务器错误']);
}
$results = $response->getBody(true);
if (is_object(json_decode($results)))
{
return json_decode($results);
}else{
return \Response::json((object)['status' => -1 , 'message' => '返回对象错误']);
}
}
/**
* @param $url
* @array $params
* @return object
*/
public static function get($url , array $params = [])
{
self::encryption($params);
$client = new Client();
$response = $client->request(
'GET',
$url,
[
'form_params' => $params,
'timeout' => 30,
'http_errors' => false
]
);
$response->getStatusCode(); // 200
$results = $response->getBody(true);
if ($response->getStatusCode() != 200)
{
return \Response::json((object)['status' => -1 , 'message' => '链接服务器错误']);
}
$results = $response->getBody();
if (is_object(json_decode($results)))
{
return json_decode($results);
}else{
return \Response::json((object)['status' => -1 , 'message' => '返回对象错误']);
}
}
private static function encryption(&$params)
{
$params['t'] = time();
$params['sign'] = strtolower(md5(env('SECRET').time().env('PUBLIC')));
return $params;
}
}
| mit |
adamfluke/ScoutCleaner | spec/spec_helper.rb | 30 | require_relative '../cleaner'
| mit |
leader22/simple-pokedex-v2 | _scraping/fetch/519.js | 4266 | module.exports = {
"key": "pidove",
"moves": [
{
"learn_type": "tutor",
"name": "heat-wave"
},
{
"learn_type": "tutor",
"name": "sleep-talk"
},
{
"learn_type": "tutor",
"name": "snore"
},
{
"learn_type": "machine",
"name": "work-up"
},
{
"learn_type": "egg move",
"name": "bestow"
},
{
"learn_type": "machine",
"name": "echoed-voice"
},
{
"learn_type": "machine",
"name": "round"
},
{
"learn_type": "level up",
"level": 29,
"name": "air-slash"
},
{
"learn_type": "egg move",
"name": "lucky-chant"
},
{
"learn_type": "machine",
"name": "u-turn"
},
{
"learn_type": "level up",
"level": 46,
"name": "tailwind"
},
{
"learn_type": "machine",
"name": "pluck"
},
{
"learn_type": "level up",
"level": 18,
"name": "roost"
},
{
"learn_type": "machine",
"name": "aerial-ace"
},
{
"learn_type": "level up",
"level": 15,
"name": "air-cutter"
},
{
"learn_type": "level up",
"level": 36,
"name": "featherdance"
},
{
"learn_type": "egg move",
"name": "wish"
},
{
"learn_type": "level up",
"level": 25,
"name": "taunt"
},
{
"learn_type": "level up",
"level": 43,
"name": "facade"
},
{
"learn_type": "egg move",
"name": "uproar"
},
{
"learn_type": "machine",
"name": "sunny-day"
},
{
"learn_type": "machine",
"name": "rain-dance"
},
{
"learn_type": "machine",
"name": "hidden-power"
},
{
"learn_type": "egg move",
"name": "morning-sun"
},
{
"learn_type": "machine",
"name": "frustration"
},
{
"learn_type": "machine",
"name": "return"
},
{
"learn_type": "machine",
"name": "attract"
},
{
"learn_type": "egg move",
"name": "steel-wing"
},
{
"learn_type": "level up",
"level": 39,
"name": "swagger"
},
{
"learn_type": "level up",
"level": 22,
"name": "detect"
},
{
"learn_type": "machine",
"name": "protect"
},
{
"learn_type": "machine",
"name": "substitute"
},
{
"learn_type": "machine",
"name": "rest"
},
{
"learn_type": "level up",
"level": 50,
"name": "sky-attack"
},
{
"learn_type": "machine",
"name": "double-team"
},
{
"learn_type": "level up",
"level": 11,
"name": "quick-attack"
},
{
"learn_type": "egg move",
"name": "hypnosis"
},
{
"learn_type": "machine",
"name": "toxic"
},
{
"learn_type": "level up",
"level": 4,
"name": "growl"
},
{
"learn_type": "level up",
"level": 8,
"name": "leer"
},
{
"learn_type": "machine",
"name": "fly"
},
{
"learn_type": "level up",
"level": 1,
"name": "gust"
},
{
"learn_type": "level up",
"level": 32,
"name": "razor-wind"
}
]
}; | mit |
wesley-kiyohara/react.net-sample | react.net-sample/Areas/HelpPage/SampleGeneration/InvalidSample.cs | 978 | using System;
namespace react.net_sample.Areas.HelpPage
{
/// <summary>
/// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
/// </summary>
public class InvalidSample
{
public InvalidSample(string errorMessage)
{
if (errorMessage == null)
{
throw new ArgumentNullException("errorMessage");
}
ErrorMessage = errorMessage;
}
public string ErrorMessage { get; private set; }
public override bool Equals(object obj)
{
InvalidSample other = obj as InvalidSample;
return other != null && ErrorMessage == other.ErrorMessage;
}
public override int GetHashCode()
{
return ErrorMessage.GetHashCode();
}
public override string ToString()
{
return ErrorMessage;
}
}
} | mit |
amite/js-links | config/webpack.config.js | 1846 | /* global __dirname */
import webpack from 'webpack';
import postcss, { getCSSLoaderConfig } from './postcss.config';
import path from 'path';
import packageJson from '../package.json';
import HtmlPlugin from 'html-webpack-plugin';
const basePath = path.join(__dirname, '..', 'app');
const env = process.env.NODE_ENV || 'development';
/* eslint-disable no-console */
console.log('Webpack running in ' + env);
/* eslint-enable no-console */
export default ({
plugins = [],
resolve = {},
devtool = 'eval'
}) => {
return {
entry: {
app: path.join(basePath, 'app.js'),
vendor: Object.keys(packageJson.dependencies)
},
output: {
path: path.join(basePath, '..', 'assets'),
publicPath: env === 'development' ? '/' : '',
filename: '[name].js'
},
devtool,
plugins: [
new HtmlPlugin({
title: 'JS Links',
template: path.join(basePath, 'index.html')
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: '[name].js'
}),
new webpack.LoaderOptionsPlugin({ options: { postcss } })
].concat(plugins),
resolve: Object.assign({}, {
modules: [
'node_modules',
'app'
],
alias: {
views: path.join(basePath, 'views'),
components: path.join(basePath, 'components'),
styles: path.join(basePath, 'styles')
}
}, resolve),
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: [
basePath
]
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
getCSSLoaderConfig(env)
]
},
devServer: {
noInfo: true,
port: 4000,
contentBase: path.join(basePath, 'assets')
}
};
};
| mit |
mmkassem/gitlabhq | db/migrate/20200527152657_add_foreign_key_to_project_id_on_build_report_results.rb | 505 | # frozen_string_literal: true
class AddForeignKeyToProjectIdOnBuildReportResults < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
add_foreign_key :ci_build_report_results, :projects, column: :project_id, on_delete: :cascade # rubocop:disable Migration/AddConcurrentForeignKey
end
end
def down
with_lock_retries do
remove_foreign_key :ci_build_report_results, column: :project_id
end
end
end
| mit |
ayeletshpigelman/azure-sdk-for-net | sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.cs | 3286 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
namespace Azure.Containers.ContainerRegistry
{
/// <summary> Manifest details. </summary>
internal partial class ManifestAttributesBase
{
/// <summary> Initializes a new instance of ManifestAttributesBase. </summary>
/// <param name="digest"> Manifest. </param>
/// <exception cref="ArgumentNullException"> <paramref name="digest"/> is null. </exception>
internal ManifestAttributesBase(string digest)
{
if (digest == null)
{
throw new ArgumentNullException(nameof(digest));
}
Digest = digest;
References = new ChangeTrackingList<ManifestAttributesManifestReferences>();
Tags = new ChangeTrackingList<string>();
}
/// <summary> Initializes a new instance of ManifestAttributesBase. </summary>
/// <param name="digest"> Manifest. </param>
/// <param name="size"> Image size. </param>
/// <param name="createdOn"> Created time. </param>
/// <param name="lastUpdatedOn"> Last update time. </param>
/// <param name="cpuArchitecture"> CPU architecture. </param>
/// <param name="operatingSystem"> Operating system. </param>
/// <param name="references"> List of manifest attributes details. </param>
/// <param name="tags"> List of tags. </param>
/// <param name="writeableProperties"> Writeable properties of the resource. </param>
internal ManifestAttributesBase(string digest, long? size, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, string cpuArchitecture, string operatingSystem, IReadOnlyList<ManifestAttributesManifestReferences> references, IReadOnlyList<string> tags, ContentProperties writeableProperties)
{
Digest = digest;
Size = size;
CreatedOn = createdOn;
LastUpdatedOn = lastUpdatedOn;
CpuArchitecture = cpuArchitecture;
OperatingSystem = operatingSystem;
References = references;
Tags = tags;
WriteableProperties = writeableProperties;
}
/// <summary> Manifest. </summary>
public string Digest { get; }
/// <summary> Image size. </summary>
public long? Size { get; }
/// <summary> Created time. </summary>
public DateTimeOffset? CreatedOn { get; }
/// <summary> Last update time. </summary>
public DateTimeOffset? LastUpdatedOn { get; }
/// <summary> CPU architecture. </summary>
public string CpuArchitecture { get; }
/// <summary> Operating system. </summary>
public string OperatingSystem { get; }
/// <summary> List of manifest attributes details. </summary>
public IReadOnlyList<ManifestAttributesManifestReferences> References { get; }
/// <summary> List of tags. </summary>
public IReadOnlyList<string> Tags { get; }
/// <summary> Writeable properties of the resource. </summary>
public ContentProperties WriteableProperties { get; }
}
}
| mit |
ahyiru/react-ui-demo | project/p1/configs/tools.ts | 3490 |
export const hasClass=(target,cname)=>{
return target.className.match(new RegExp('(\\s|^)'+cname+'(\\s|$)'));
};
export const addClass=(target,cname)=>{
var nameArr=cname.split(' ');
nameArr.map((v,k)=>{
if(!!v&&!hasClass(target,v)){
target.className+=' '+v;
}
});
};
export const removeClass=(target,cname)=>{
var nameArr=cname.split(' ');
nameArr.map((v,k)=>{
if(!!v&&hasClass(target,v)){
var reg=new RegExp('(\\s|^)'+v+'(\\s|$)');
target.className=target.className.replace(reg,'');
}
});
};
export const toggleClass=(target,cname)=>{
if(hasClass(target,cname)){
removeClass(target,cname);
}
else{
addClass(target,cname);
}
};
export const resetObj=(obj)=>{
var keys=Object.keys(obj);
for(var i=0,j=keys.length;i<j;i++){
obj[keys[i]]='';
}
return obj;
};
//对象赋值 深拷贝
export const cloneObj=(obj)=>{
var str='',newobj=obj.constructor===Array?[]:{};
if(typeof obj!=='object'){
return;
}
/*else if(window.JSON){//浏览器支持json解析
str=JSON.stringify(obj);
newobj=JSON.pares(str);
}*/
else{
for(var i in obj){
newobj[i]=typeof obj[i]==='object'?cloneObj(obj[i]):obj[i];
}
}
return newobj;
};
/*//返回顶部
export const backTop=(st)=>{
let timer=setInterval(function(){
if(st<=0){
st=0;
clearInterval(timer);
return;
}
st-=50;
},1);
};*/
//获取当前页面
export const getCurrent=(obj,str,data)=>{
if(str){
str=str[1];
if(str==='/') str='/#/';
obj.map((v,k)=>{
if(v.subMenu&&v.subMenu.length>0){
let flag=false;
v.subMenu.map((sv,sk)=>{
if(sv.url==str){
data.subTitle=sv.title;
flag=true;
data.level=2;
sv.selected='active';
}
else{
sv.selected='';
}
});
flag?(
data.title=v.title,
v.selMenu='active',
v.open='open',
v.toggleSlide={
height:v.subMenu.length*32+16
}
):(
v.selMenu='',
v.open='',
v.toggleSlide={
height:0
}
);
}
else{
if(v.url==str){
data.title=v.title;
data.subTitle='';
data.level=1;
v.selMenu='active';
}
else{
v.selMenu='';
!!v.subMenu&&v.subMenu.map((sv,sk)=>{
sv.selected='';
});
}
}
});
}
return obj;
};
//fullscreen
export const fs=(element)=>{
if(!document.fullscreenElement&&/*!document.msFullscreenElement&&!document.mozFullScreenElement&&*/!document.webkitFullscreenElement){
if(element.requestFullscreen){
element.requestFullscreen();
}
else if(element.msRequestFullscreen){
element.msRequestFullscreen();
}
else if(element.mozRequestFullscreen){
element.mozRequestFullscreen();
}
else if(element.webkitRequestFullscreen){
element.webkitRequestFullscreen();
}
}
else{
if(document.exitFullscreen){
document.exitFullscreen();
}
/*else if(document.msExitFullscreen){
document.msExitFullscreen();
}
else if(document.mozCanselFullscreen){
document.mozCanselFullscreen();
}*/
else if(document.webkitExitFullscreen){
document.webkitExitFullscreen();
}
}
};
/*let ele=document.getElementsByClassName('fs')[0];
fs(ele);*/
| mit |
PhilVargas/js_game_of_afterlife | test/pathfinderTest.js | 1456 | import { default as chai } from 'chai';
const expect = chai.expect;
import { default as Pathfinder } from 'pathfinder';
describe('Pathfinder', function(){
describe('#distanceTo', function(){
let coord1, coord2;
beforeEach(function(){
coord1 = { x: 0, y: 0 };
coord2 = { x: 1, y: 1 };
});
it('should give the distance between two points', function(){
expect(Pathfinder.distanceTo(coord1, coord2)).to.equal(Math.sqrt(2));
});
});
describe('::arePositionsEqual', function(){
context('comparing two unequal positions', function(){
it('returns false', function(){
expect(Pathfinder.arePositionsEqual({ x: 10, y: 10 }, { x: 5, y: 5 })).to.equal(false);
});
});
context('comparing two equal positions', function(){
it('returns true', function(){
expect(Pathfinder.arePositionsEqual({ x: 5, y: 5 }, { x: 5, y: 5 })).to.equal(true);
});
});
});
describe('::getRelativePosition', function(){
context('when not exceeding the board boundries', function(){
it('returns the position', function(){
expect(Pathfinder.getRelativePosition({ x: 60, y: 40 })).to.eql({ x: 60, y: 40 });
});
});
context('when exceeding the board boundries', function(){
it('returns the relative board position', function(){
expect(Pathfinder.getRelativePosition({ x: 605, y: 410 })).to.eql({ x: 5, y: 10 });
});
});
});
});
| mit |
AsrOneSdk/azure-sdk-for-net | sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeLinkedEntitiesActionResult.cs | 1772 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Azure.AI.TextAnalytics.Models;
namespace Azure.AI.TextAnalytics
{
/// <summary>
/// The result of the execution of a <see cref="RecognizeLinkedEntitiesAction"/> on the input documents.
/// </summary>
public class RecognizeLinkedEntitiesActionResult : TextAnalyticsActionResult
{
private readonly RecognizeLinkedEntitiesResultCollection _documentsResults;
/// <summary>
/// Successful action.
/// </summary>
internal RecognizeLinkedEntitiesActionResult(RecognizeLinkedEntitiesResultCollection result, DateTimeOffset completedOn)
: base(completedOn)
{
_documentsResults = result;
}
/// <summary>
/// Action with an error.
/// </summary>
internal RecognizeLinkedEntitiesActionResult(DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error) { }
/// <summary>
/// Gets the result of the execution of a <see cref="RecognizeLinkedEntitiesAction"/> per each input document.
/// </summary>
public RecognizeLinkedEntitiesResultCollection DocumentsResults
{
get
{
if (HasError)
{
#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations
throw new InvalidOperationException($"Cannot access the results of this action, due to error {Error.ErrorCode}: {Error.Message}");
#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations
}
return _documentsResults;
}
}
}
}
| mit |
Julien-Mialon/Cake.Storm | fluent/src/Cake.Storm.Fluent/Interfaces/IFluentContext.cs | 324 | using Cake.Core;
namespace Cake.Storm.Fluent.Interfaces
{
public interface IFluentContext
{
ICakeContext CakeContext { get; }
TaskDelegate Task { get; }
SetupDelegate Setup { get; }
TeardownDelegate Teardown { get; }
TaskSetupDelegate TaskSetup { get; }
TaskTeardownDelegate TaskTeardown { get; }
}
} | mit |
wenhulove333/ScutServer | Sample/Koudai/Server/src/ZyGames.Tianjiexing.BLL.Combat/PlotTeamCombat.cs | 30502 | /****************************************************************************
Copyright (c) 2013-2015 scutgame.com
http://www.scutgame.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using ZyGames.Framework.Collection.Generic;
using ZyGames.Framework.Common.Log;
using ZyGames.Framework.Common.Serialization;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Combat;
using ZyGames.Framework.Collection;
using ZyGames.Framework.Common;
using ZyGames.Framework.Net;
using ZyGames.Tianjiexing.Component.Chat;
using ZyGames.Tianjiexing.Lang;
using ZyGames.Tianjiexing.Model;
using ZyGames.Tianjiexing.Model.Config;
using ZyGames.Tianjiexing.Component;
namespace ZyGames.Tianjiexing.BLL.Combat
{
public class PlotTeamCombat
{
private static readonly object ThisLock = new object();
/// <summary>
/// 战斗过程 Key:teamId
/// </summary>
private static DictionaryExtend<int, TeamCombatResult> _combatProcessList;
/// <summary>
/// Key:userid, value:teamId
/// </summary>
private static DictionaryExtend<string, int> _userList;
/// <summary>
/// Key:teamId, value:组队类
/// </summary>
private static DictionaryExtend<int, MorePlotTeam> _teamList;
/// <summary>
/// Key:userid+plotid, value:战斗次数
/// </summary>
private static DictionaryExtend<string, int> _userTimesList;
private int MaxCombatNum = ConfigEnvSet.GetInt("ProplePlot.MaxCombatNum");
public static int TeamMaxPeople = ConfigEnvSet.GetInt("ProplePlot.MaxPeopleNum");
private string _userId;
public static void Init(GameActive gameActive)
{
_combatProcessList = new DictionaryExtend<int, TeamCombatResult>();
_userList = new DictionaryExtend<string, int>();
_teamList = new DictionaryExtend<int, MorePlotTeam>();
_userTimesList = new DictionaryExtend<string, int>();
}
static PlotTeamCombat()
{
Init(null);
}
public static void Dispose(GameActive gameActive)
{
_combatProcessList = null;
_userList = null;
_teamList = null;
_userTimesList = null;
}
public PlotTeamCombat(GameUser user)
{
_userId = user.UserID;
}
private static void SetCombatResult(int teamId, bool isWin)
{
if (_combatProcessList != null)
{
if (!_combatProcessList.ContainsKey(teamId))
{
_combatProcessList.TryAdd(teamId, new TeamCombatResult());
}
lock (ThisLock)
{
TeamCombatResult tempList = _combatProcessList[teamId];
tempList.IsWin = isWin;
}
}
}
private static int _currTeamId = 1000;
private static int NextTeamId
{
get
{
lock (ThisLock)
{
_currTeamId++;
return _currTeamId;
}
}
}
/// <summary>
/// 获取Team信息
/// </summary>
/// <param name="teamId"></param>
/// <returns></returns>
public MorePlotTeam GetTeam(int teamId)
{
return _teamList != null && _teamList.ContainsKey(teamId) ? _teamList[teamId] : new MorePlotTeam();
}
/// <summary>
/// 查询所在Team
/// </summary>
/// <param name="userId"></param>
/// <returns>无:-1</returns>
public int GetTeamId(string userId)
{
if (_userList != null && _userList.ContainsKey(userId))
{
return _userList[userId];
}
return -1;
}
/// <summary>
/// 设置赢的次数
/// </summary>
/// <param name="userId"></param>
/// <param name="plotId"></param>
public void SetWinNum(string userId, int plotId)
{
if (_userTimesList == null) return;
string key = userId + plotId;
lock (ThisLock)
{
if (_userTimesList.ContainsKey(key))
{
_userTimesList[key] = _userTimesList[key] + 1;
}
else
{
_userTimesList.Add(key, 1);
}
}
}
/// <summary>
/// 获取所在Team的位置
/// </summary>
/// <param name="teamId"></param>
/// <returns></returns>
public int TeamPos(int teamId)
{
var plotTeam = GetTeam(teamId);
if (plotTeam != null)
{
return plotTeam.UserList.FindIndex(m => m.UserId.Equals(_userId));
}
return -1;
}
/// <summary>
/// 获取等待组队列表
/// </summary>
/// <returns></returns>
public List<MorePlotTeam> ToTeamList()
{
List<MorePlotTeam> list = new List<MorePlotTeam>();
if (_teamList != null)
{
List<KeyValuePair<int, MorePlotTeam>> cuserList = _teamList.ToList();
foreach (KeyValuePair<int, MorePlotTeam> keyPair in cuserList)
{
MorePlotTeam cuser = keyPair.Value;
if (cuser.IsAllow && IsCombat(cuser.MorePlot.PlotID))
{
list.Add(cuser);
}
}
}
return list;
}
/// <summary>
/// 活动获取等待组队列表
/// </summary>
/// <returns></returns>
public List<MorePlotTeam> ToMoreTeamList()
{
List<MorePlotTeam> list = new List<MorePlotTeam>();
if (_teamList != null)
{
var cuserList = _teamList.ToList();
foreach (KeyValuePair<int, MorePlotTeam> keyPair in cuserList)
{
MorePlotTeam cuser = keyPair.Value;
if (cuser.IsAllow && IsMoreCombat(cuser.MorePlot.PlotID))
{
list.Add(cuser);
}
}
}
return list;
}
/// <summary>
/// 快速加入
/// 优先顺序:副本低到高,队中人数高到低 改为随机
/// </summary>
/// <param name="teamId"></param>
public bool AddTeam(out int teamId)
{
teamId = -1;
List<MorePlotTeam> tempList = new List<MorePlotTeam>();
List<MorePlotTeam> list = ToTeamList();
foreach (MorePlotTeam item in list)
{
MorePlotTeam cuser = item;
if (cuser.IsAllow && IsCombat(cuser.MorePlot.PlotID))
{
tempList.Add(cuser);
}
}
if (tempList.Count > 0)
{
MorePlotTeam team = tempList[RandomUtils.GetRandom(0, list.Count)];
teamId = team.TeamID;
AddTeam(teamId);
return true;
}
return false;
}
/// <summary>
/// 快速加入 活动
/// 优先顺序:副本低到高,队中人数高到低 改为随机
/// </summary>
/// <param name="teamId"></param>
public bool AddMoreTeam(out int teamId)
{
teamId = -1;
List<MorePlotTeam> tempList = new List<MorePlotTeam>();
List<MorePlotTeam> list = ToMoreTeamList(); //ToTeamList();
foreach (MorePlotTeam item in list)
{
MorePlotTeam cuser = item;
if (cuser.IsAllow && IsMoreCombat(cuser.MorePlot.PlotID))
{
tempList.Add(cuser);
}
}
if (tempList.Count > 0)
{
MorePlotTeam team = tempList[RandomUtils.GetRandom(0, list.Count)];
teamId = team.TeamID;
AddTeam(teamId);
return true;
}
return false;
}
/// <summary>
/// 加入组队,若已经在其它组队则自动退出
/// </summary>
/// <param name="teamId"></param>
public bool AddTeam(int teamId)
{
if (_teamList == null) return false;
if (_teamList.ContainsKey(teamId))
{
var team = _teamList[teamId];
if (!team.IsAllow) return false;
//是否在其它组队
if (_userList.ContainsKey(_userId))
{
int oldTeamId = _userList[_userId];
if (oldTeamId != teamId)
{
LeaveTeam(oldTeamId);
_userList[_userId] = teamId;
}
}
else
{
_userList.Add(_userId, teamId);
}
GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(_userId);
team.Append(gameUser);
return true;
}
return false;
}
public bool IsCombat(int plotId)
{
var plot = new ConfigCacheSet<PlotInfo>().FindKey(plotId);
if (plot != null)
{
//todo
var userPlot = UserPlotHelper.GetUserPlotInfo(_userId, plot.PrePlotID);
//new GameDataCacheSet<UserPlot>().FindKey(_userId, plot.PrePlotID);)
if (userPlot != null && userPlot.PlotStatus == PlotStatus.Completed)
{
//string key = _userId + plotId;
//int timesNum = _userTimesList != null && _userTimesList.ContainsKey(key) ? _userTimesList[key] : 0;
//return timesNum < MaxCombatNum;
int timesNum = CombatHelper.GetDailyMorePlotNum(_userId, plotId);
return timesNum < MaxCombatNum;
}
}
return false;
}
public bool IsMoreCombat(int plotId)
{
var plot = new ConfigCacheSet<PlotInfo>().FindKey(plotId);
if (plot != null)
{
//string key = _userId + plotId;
//int timesNum = _userTimesList != null && _userTimesList.ContainsKey(key) ? _userTimesList[key] : 0;
//return timesNum < MaxCombatNum;
int timesNum = CombatHelper.GetDailyMorePlotNum(_userId, plotId);
return timesNum < MaxCombatNum;
}
return false;
}
/// <summary>
/// 可创建多人副本列表
/// </summary>
/// <returns></returns>
public MorePlot[] GetMorePlotList()
{
List<MorePlot> morePlotsList = new List<MorePlot>();
var plotsArray = UserPlotHelper.UserPlotFindAll(_userId);
// todo new GameDataCacheSet<UserPlot>().FindAll(_userId);)
foreach (UserPlotInfo plot in plotsArray)
{
var morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(u => u.PlotType == PlotType.MorePlot && u.PrePlotID == plot.PlotID);
if (morePlotArray.Count > 0)
{
var morePlot = morePlotArray[0];
if (IsCombat(morePlot.PlotID))
{
morePlotsList.Add(GetItem(morePlot.PlotID));
}
}
}
return morePlotsList.ToArray();
}
/// <summary>
/// 可创建活动多人副本列表
/// </summary>
/// <returns></returns>
public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum)
{
List<MorePlot> morePlotsList = new List<MorePlot>();
var morePlotArray = new List<PlotInfo>();
if (functionEnum == FunctionEnum.MorePlotCoin)
{
morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin);
}
else if (functionEnum == FunctionEnum.MorePlotEnergy)
{
morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotEnergy);
}
if (morePlotArray.Count > 0)
{
//var morePlot = morePlotArray[0];
foreach (PlotInfo info in morePlotArray)
{
if (functionEnum == FunctionEnum.MorePlotCoin && IsMoreCombat(info.PlotID))
{
morePlotsList.Add(GetItem(info.PlotID));
}
else if (functionEnum == FunctionEnum.MorePlotEnergy && IsMoreCombat(info.PlotID))
{
morePlotsList.Add(GetItem(info.PlotID));
}
}
}
return morePlotsList.ToArray();
}
/// <summary>
/// 是否在组队中
/// </summary>
/// <returns></returns>
public bool IsInTeam()
{
if (GetTeamId(_userId) != -1)
{
return true;
}
return false;
}
/// <summary>
/// 创建组队
/// </summary>
/// <param name="plotId"></param>
/// <param name="teamId"></param>
/// <returns></returns>
public bool CreateTeam(int plotId, out int teamId)
{
teamId = GetTeamId(_userId);
if (teamId != -1)
{
//退出组队
if (!LeaveTeam(teamId)) return false;
}
GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(_userId);
teamId = Create(gameUser, plotId);
return true;
}
/// <summary>
/// 创建组队
/// </summary>
/// <param name="user"></param>
/// <param name="plotId"></param>
/// <returns></returns>
private int Create(GameUser user, int plotId)
{
if (_teamList == null) return -1;
int teamId = NextTeamId;
MorePlot morePlot = GetItem(plotId);
var team = new MorePlotTeam
{
MorePlot = morePlot,
TeamID = teamId,
TeamUser = new TeamUser
{
UserId = user.UserID,
NickName = user.NickName,
//UserLv = user.UserLv,
//UseMagicID = user.UseMagicID
},
CombatResult = false,
Status = 1,
};
_teamList.Add(teamId, team);
AddTeam(teamId);
return teamId;
}
private MorePlot GetItem(int plotId)
{
var plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(plotId);
MorePlot morePlot = new MorePlot
{
PlotID = plotId,
PlotName = plotInfo.PlotName,
Experience = plotInfo.Experience,
ExpNum = plotInfo.ExpNum,
ObtainNum = plotInfo.ObtainNum
};
if (plotInfo == null || string.IsNullOrEmpty(plotInfo.ItemRank))
{
return morePlot;
}
string[] itemRandArray = plotInfo.ItemRank.Split(',');
if (itemRandArray.Length > 0)
{
string[] itemArray = itemRandArray[0].Split('=');
if (itemArray.Length == 2)
{
var itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itemArray[0]);
morePlot.ItemId = itemInfo.ItemID;
morePlot.ItemName = itemInfo.ItemName;
morePlot.ItemNum = Convert.ToInt32(itemArray[1]);
}
}
return morePlot;
}
/// <summary>
/// 调整队伍位置
/// </summary>
/// <param name="teamId"></param>
/// <param name="userId"></param>
/// <param name="isUp"></param>
public bool MoveTeamPos(int teamId, string userId, bool isUp)
{
if (_teamList == null) return false;
if (_teamList.ContainsKey(teamId))
{
var team = _teamList[teamId];
if (team.Status != 1) return false;
int index = team.UserList.FindIndex(m => m.UserId.Equals(userId));
if (index == -1) return false;
if (isUp && index > 0)
{
//向上
var temp = team.UserList[index - 1];
team.UserList[index - 1] = team.UserList[index];
team.UserList[index] = temp;
}
else if (!isUp && index < TeamMaxPeople)
{
//向下
var temp = team.UserList[index + 1];
team.UserList[index + 1] = team.UserList[index];
team.UserList[index] = temp;
}
return true;
}
return false;
}
/// <summary>
/// 离开组队,自己是队长则解散组队
/// </summary>
/// <param name="teamId"></param>
public bool LeaveTeam(int teamId)
{
return SendOutMember(teamId, _userId);
}
/// <summary>
/// 踢出队员
/// </summary>
public bool SendOutMember(int teamId, string userId)
{
if (_teamList == null) return false;
if (_teamList.ContainsKey(teamId))
{
var team = _teamList[teamId];
if (team == null || team.Status != 1) return false;
if (team.TeamUser.UserId.Equals(userId))
{
if (_userList.ContainsKey(userId)) _userList.Remove(userId);
team.Status = 3;//解散组队
team.TeamUser = new TeamUser();
team.UserList.Clear();
}
team.UserList.RemoveAll(m => m.UserId.Equals(userId));
if (_userList.ContainsKey(userId)) _userList.Remove(userId);
}
return true;
}
/// <summary>
/// 取当前用户所占位置的战斗过程,位置从0开始
/// </summary>
/// <returns></returns>
public TeamCombatResult GetCombatProcess(int teamId)
{
var combatResult = new TeamCombatResult();
if (_combatProcessList != null && _combatProcessList.ContainsKey(teamId))
{
var processList = _combatProcessList[teamId];
combatResult.IsWin = processList.IsWin;
int[] posList = new int[2];
int pos = TeamPos(teamId);
if (ConfigPos.GetLength(0) > pos)
{
for (int i = 0; i < posList.Length; i++)
{
posList[i] = ConfigPos[pos, i] - 1;
}
}
combatResult.ProcessList = processList.ProcessList.FindAll(m => m.UserId.Equals(_userId)
|| (!m.UserId.Equals(_userId) && (m.Position == posList[0] || m.Position == posList[1])));
//foreach (var process in combatResult.ProcessList)
//{
// Trace.WriteLine(string.Format("多人副本>>{0}打{1}位置{2}结果{3}", process.ProcessContainer.DefenseList.Count,
// process.PlotNpcID, process.Position, process.IsWin));
//}
//Trace.WriteLine(string.Format("多人副本>>{0}", combatResult.IsWin));
if (_userList != null && _userList.ContainsKey(_userId)) _userList.Remove(_userId);
}
return combatResult;
}
/// <summary>
/// 开始战斗
/// </summary>
/// <param name="teamId"></param>
public bool DoStart(int teamId)
{
if (_teamList.ContainsKey(teamId))
{
var team = _teamList[teamId];
if (team.UserList.Count > 1)
{
if (team.Status == 1)
{
lock (this)
{
team.Status = 2;
}
DoCombat(team);
return true;
}
}
}
return false;
}
private void DoCombat(MorePlotTeam team)
{
//初始阵形
var plotNpcTeam = new ConfigCacheSet<PlotNPCInfo>().FindAll(m => m.PlotID == team.MorePlot.PlotID);
List<MonsterQueue> monsterQueueList = new List<MonsterQueue>(plotNpcTeam.Count);
var userEmbattleList = new List<UserEmbattleQueue>(team.UserList.Count);
foreach (var npcInfo in plotNpcTeam)
{
monsterQueueList.Add(new MonsterQueue(npcInfo.PlotNpcID));
}
foreach (var user in team.UserList)
{
var gameUser = new GameDataCacheSet<GameUser>().FindKey(user.UserId);
userEmbattleList.Add(new UserEmbattleQueue(user.UserId, gameUser.UseMagicID, 0, CombatType.MultiPlot));
}
bool isLoop = true;
int maxCount = 0;
while (isLoop)
{
if (maxCount > 500)
{
break;
}
int overNum = 0;
for (int i = 0; i < userEmbattleList.Count; i++)
{
maxCount++;
int position;
var userEmbattle = userEmbattleList[i];
if (userEmbattle.IsOver)
{
overNum++;
continue;
}
var monster = GetMonster(monsterQueueList, i, out position);
if (monster == null || monster.IsOver)
{
team.CombatResult = true;
isLoop = false;
break;
}
ICombatController controller = new TjxCombatController();
ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.MultiPlot);
plotCombater.SetAttack(userEmbattle);
plotCombater.SetDefend(monster);
bool IsWin = plotCombater.Doing();
var processLost = new TeamCombatProcess
{
TeamID = team.TeamID,
PlotID = team.MorePlot.PlotID,
Position = position,
ProcessContainer = (CombatProcessContainer)plotCombater.GetProcessResult(),
UserId = team.UserList[i].UserId,
PlotNpcID = plotNpcTeam[position].PlotNpcID,
IsWin = IsWin
};
//new BaseLog().SaveDebuLog(string.Format("多人副本>>{4}组队{0}打{1}位置{2}结果{3}", processLost.UserId, processLost.PlotNpcID, position + 1, IsWin, team.TeamID));
AppendLog(team.TeamID, processLost);
}
if (overNum == userEmbattleList.Count)
{
team.CombatResult = false;
isLoop = false;
}
}
//奖励
if (team.CombatResult)
{
//new BaseLog().SaveDebuLog(string.Format("多人副本>>组队{0}结果{1}", team.TeamID, team.CombatResult));
SetCombatResult(team.TeamID, team.CombatResult);
var chatService = new TjxChatService();
foreach (var user in team.UserList)
{
GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(user.UserId);
gameUser.ExpNum = MathUtils.Addition(gameUser.ExpNum, team.MorePlot.ExpNum, int.MaxValue);
//gameUser.Update();
UserItemHelper.AddUserItem(user.UserId, team.MorePlot.ItemId, team.MorePlot.ItemNum);
new BaseLog("参加多人副本获得奖励:" + team.MorePlot.ItemName);
SetWinNum(user.UserId, team.MorePlot.PlotID);
CombatHelper.DailyMorePlotRestrainNum(gameUser.UserID, team.MorePlot.PlotID); // 多人副本获胜加一次
chatService.SystemSendWhisper(gameUser, string.Format(LanguageManager.GetLang().St4211_MorePlotReward,
team.MorePlot.ExpNum, team.MorePlot.ItemName, team.MorePlot.ItemNum));
}
}
}
private static void AppendLog(int teamId, TeamCombatProcess logTeam)
{
if (_combatProcessList != null)
{
if (!_combatProcessList.ContainsKey(teamId))
{
_combatProcessList.Add(teamId, new TeamCombatResult());
}
lock (ThisLock)
{
TeamCombatResult tempList = _combatProcessList[teamId];
tempList.ProcessList.Add(logTeam);
}
UserCombatLog log = new UserCombatLog
{
CombatLogID = Guid.NewGuid().ToString(),
CombatType = CombatType.MultiPlot,
UserID = logTeam.UserId,
PlotID = logTeam.PlotID,
NpcID = logTeam.PlotNpcID,
HostileUser = logTeam.TeamID.ToString(),
IsWin = logTeam.IsWin,
CombatProcess = JsonUtils.Serialize(logTeam.ProcessContainer),
CreateDate = DateTime.Now
};
var sender = DataSyncManager.GetDataSender();
sender.Send(log);
}
}
private static readonly int[,] ConfigPos = new[,] {
{ 1, 4, 2, 5, 3, 6 },
{ 2, 5, 1, 4, 3, 6 },
{ 3, 6, 2, 5, 1, 4 }
};
private static MonsterQueue GetMonster(List<MonsterQueue> monsterQueueList, int index, out int position)
{
MonsterQueue monster = null;
position = -1;
if (ConfigPos.GetLength(0) > index)
{
for (int i = 0; i < ConfigPos.GetLength(1); i++)
{
position = ConfigPos[index, i] - 1;
if (monsterQueueList.Count > position)
{
var temp = monsterQueueList[position];
if (!temp.IsOver)
{
monster = temp;
break;
}
}
}
}
return monster;
}
/// <summary>
/// 是否多人副本时间
/// </summary>
/// <param name="function"></param>
/// <returns></returns>
public static bool IsMorePlotDate(string userID, FunctionEnum activeType)
{
DateTime beginTime = new DateTime();
DateTime enableTime = new DateTime();
GameActive[] gameActivesArray
= new List<GameActive>(new GameActiveCenter(userID).GetActiveList()).FindAll(m => m.ActiveType == activeType).ToArray();
foreach (GameActive gameActive in gameActivesArray)
{
beginTime = gameActive.BeginTime;
enableTime = gameActive.EndTime;
if (DateTime.Now > beginTime && DateTime.Now < enableTime)
{
return true;
}
}
return false;
}
}
} | mit |
viktorrr/SurveySystem | Data/SurveySystem.Data.Models/QuestionType.cs | 138 | namespace SurveySystem.Data.Models
{
public enum QuestionType
{
FreeText,
Checkbox,
RadioButton
}
} | mit |
mshRoR/blog_api | frontend/components/pagination/pagination.component.js | 1155 | angular.module('blogApp')
.component('pagination', {
bindings: {
pageInfo: '<'
},
// require: {
// homeCtrl: '^^home'
// },
controller: PaginationController,
templateUrl: 'components/pagination/pagination.template.html'
});
function PaginationController($http, PostService){
// current_page: 2
// next_page:3
// prev_page:1
// total_objects:30
// total_pages:3
var self = this;
// self.totalItems = 64;
self.currentPage = 1;
self.maxSize = 5;
self.itemsPerPage = 10;
self.$onInit = function(){
console.log(this.pageInfo);
self.totalItems = this.pageInfo.total_objects;
self.numPages = this.pageInfo.total_pages;
};
self.pageChanged = function(){
console.log(this.currentPage);
PostService.getAllPost(this.currentPage).then(function(res){
// $http.get('http://localhost:3000/posts/page/'+ this.currentPage).then(function(res){
console.log(res);
// self.posts = res.data[0].posts;
});
};
self.setPage = function(pageNo){
console.log(pageNo);
self.currentPage = pageNo;
};
}
| mit |
ademakov/Evenk | tests/thread_pool-test.cc | 572 | #include <evenk/synch_queue.h>
#include <evenk/thread_pool.h>
template <typename T>
using queue = evenk::synch_queue<T>;
int
main()
{
static constexpr std::uint32_t expected = 100 * 1000;
std::atomic<std::uint32_t> counter = ATOMIC_VAR_INIT(0);
evenk::thread_pool<queue> pool(8);
for (std::uint32_t i = 0; i < expected; i++)
pool.submit([&counter] { counter.fetch_add(1, std::memory_order_relaxed); });
pool.wait();
std::uint32_t actual = counter.load(std::memory_order_relaxed);
printf("%u %s\n", actual, actual == expected ? "Okay" : "FAIL");
return 0;
}
| mit |
anandpdoshi/frappe | frappe/website/website_generator.py | 2271 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import quoted
from frappe.model.document import Document
from frappe.model.naming import append_number_if_name_exists
from frappe.website.utils import cleanup_page_name, get_home_page
from frappe.website.render import clear_cache
from frappe.modules import get_module_name
from frappe.website.router import get_page_context_from_template, get_page_context
class WebsiteGenerator(Document):
website = frappe._dict(
page_title_field = "name"
)
def __init__(self, *args, **kwargs):
self.route = None
super(WebsiteGenerator, self).__init__(*args, **kwargs)
def autoname(self):
if not self.name and self.meta.autoname != "hash":
self.name = self.scrub(self.get(self.website.page_title_field or "title"))
def onload(self):
self.get("__onload").update({
"is_website_generator": True,
"published": self.is_website_published()
})
def validate(self):
if self.is_website_published() and not self.route:
self.route = self.make_route()
if self.route:
self.route = self.route.strip('/.')
def make_route(self):
return self.scrub(self.get(self.website.page_title_field or "name"))
def on_update(self):
clear_cache(self.route)
if getattr(self, "save_versions", False):
frappe.add_version(self)
def clear_cache(self):
clear_cache(self.route)
def scrub(self, text):
return quoted(cleanup_page_name(text).replace('_', '-'))
def get_parents(self, context):
'''Return breadcrumbs'''
pass
def on_trash(self):
self.clear_cache()
def is_website_published(self):
"""Return true if published in website"""
if self.website.condition_field:
return self.get(self.website.condition_field) and True or False
else:
return True
def get_page_info(self):
route = frappe._dict()
route.update({
"doc": self,
"page_or_generator": "Generator",
"ref_doctype":self.doctype,
"idx": self.idx,
"docname": self.name,
"controller": get_module_name(self.doctype, self.meta.module),
})
route.update(self.website)
if not route.page_title:
route.page_title = self.get(self.website.page_title_field or "name")
return route
| mit |
tsileo/broxy | vendor/github.com/gdamore/tcell/terminfo/term_rxvt.go | 2983 | // Generated automatically. DO NOT HAND-EDIT.
package terminfo
func init() {
// rxvt terminal emulator (X Window System)
AddTerminfo(&Terminfo{
Name: "rxvt",
Columns: 80,
Lines: 24,
Colors: 8,
Bell: "\a",
Clear: "\x1b[H\x1b[2J",
EnterCA: "\x1b7\x1b[?47h",
ExitCA: "\x1b[2J\x1b[?47l\x1b8",
ShowCursor: "\x1b[?25h",
HideCursor: "\x1b[?25l",
AttrOff: "\x1b[m\x0017",
Underline: "\x1b[4m",
Bold: "\x1b[1m",
Blink: "\x1b[5m",
Reverse: "\x1b[7m",
EnterKeypad: "\x1b=",
ExitKeypad: "\x1b>",
SetFg: "\x1b[3%p1%dm",
SetBg: "\x1b[4%p1%dm",
SetFgBg: "\x1b[3%p1%d;4%p2%dm",
PadChar: "\x00",
AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~",
EnterAcs: "\x0e",
ExitAcs: "\x0f",
EnableAcs: "\x1b(B\x1b)0",
Mouse: "\x1b[M",
MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c",
SetCursor: "\x1b[%i%p1%d;%p2%dH",
CursorBack1: "\b",
CursorUp1: "\x1b[A",
KeyUp: "\x1b[A",
KeyDown: "\x1b[B",
KeyRight: "\x1b[C",
KeyLeft: "\x1b[D",
KeyInsert: "\x1b[2~",
KeyDelete: "\x1b[3~",
KeyBackspace: "\b",
KeyHome: "\x1b[7~",
KeyEnd: "\x1b[8~",
KeyPgUp: "\x1b[5~",
KeyPgDn: "\x1b[6~",
KeyF1: "\x1b[11~",
KeyF2: "\x1b[12~",
KeyF3: "\x1b[13~",
KeyF4: "\x1b[14~",
KeyF5: "\x1b[15~",
KeyF6: "\x1b[17~",
KeyF7: "\x1b[18~",
KeyF8: "\x1b[19~",
KeyF9: "\x1b[20~",
KeyF10: "\x1b[21~",
KeyF11: "\x1b[23~",
KeyF12: "\x1b[24~",
KeyF13: "\x1b[25~",
KeyF14: "\x1b[26~",
KeyF15: "\x1b[28~",
KeyF16: "\x1b[29~",
KeyF17: "\x1b[31~",
KeyF18: "\x1b[32~",
KeyF19: "\x1b[33~",
KeyF20: "\x1b[34~",
KeyF21: "\x1b[23$",
KeyF22: "\x1b[24$",
KeyF23: "\x1b[11^",
KeyF24: "\x1b[12^",
KeyF25: "\x1b[13^",
KeyF26: "\x1b[14^",
KeyF27: "\x1b[15^",
KeyF28: "\x1b[17^",
KeyF29: "\x1b[18^",
KeyF30: "\x1b[19^",
KeyF31: "\x1b[20^",
KeyF32: "\x1b[21^",
KeyF33: "\x1b[23^",
KeyF34: "\x1b[24^",
KeyF35: "\x1b[25^",
KeyF36: "\x1b[26^",
KeyF37: "\x1b[28^",
KeyF38: "\x1b[29^",
KeyF39: "\x1b[31^",
KeyF40: "\x1b[32^",
KeyF41: "\x1b[33^",
KeyF42: "\x1b[34^",
KeyF43: "\x1b[23@",
KeyF44: "\x1b[24@",
KeyBacktab: "\x1b[Z",
KeyShfLeft: "\x1b[d",
KeyShfRight: "\x1b[c",
KeyShfUp: "\x1b[a",
KeyShfDown: "\x1b[b",
KeyCtrlLeft: "\x1b[Od",
KeyCtrlRight: "\x1b[Oc",
KeyCtrlUp: "\x1b[Oa",
KeyCtrlDown: "\x1b[Ob",
KeyShfHome: "\x1b[7$",
KeyShfEnd: "\x1b[8$",
KeyCtrlHome: "\x1b[7^",
KeyCtrlEnd: "\x1b[8^",
})
}
| mit |
arcthur/react-book-examples | 06/src/components/Home/Modal.js | 949 | import React, { Component, PropTypes } from 'react';
import { Modal } from 'antd';
import { createForm } from 'redux-form-utils';
import formConfig from './Modal.config';
@createForm(formConfig)
export default class ArticleModal extends Component {
render() {
const { title, desc, date } = this.props.fields;
return (
<Modal
visible={this.props.visible}
onCancel={this.props.hideModal}
onOk={this.props.addArticle}
>
<div className="form">
<div className="control-group">
<label>标题</label>
<input type="text" {...title} />
</div>
<div className="control-group">
<label>描述</label>
<textarea {...title} />
</div>
<div className="control-group">
<label>发布日期</label>
<input type="date" {...title} />
</div>
</div>
</Modal>
);
}
}
| mit |
robocon/platwo-eventsniff-api | tests/api/PutUserProfilePictureCept.php | 566 | <?php
// Get test image and convert into base64
$image = base64_encode(file_get_contents(dirname(dirname(__FILE__)).'/test.png'));
$user_id = '54ba29c210f0edb8048b457a';
$I = new ApiTester($scenario);
$I->wantTo('Update User Profile Picture');
$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
$I->sendPUT('user/profile/'.$user_id.'/picture', [
'picture' => $image
]);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$success = $I->grabDataFromJsonResponse('success');
$I->seeResponseContainsJson([
'success' => $success
]); | mit |
NECDisplaySolutions/necpdsdk | nec_pd_sdk/constants.py | 18713 | """constants.py - Various constants used for communicating with NEC large-screen displays.
Revision: 180220
"""
#
#
# Copyright (C) 2016-18 NEC Display Solutions, Ltd
# written by Will Hollingworth <whollingworth at necdisplay.com>
# See LICENSE.rst for details.
#
# timeout in seconds for establishing a TCP connection
connect_timeout = 2.0
# timeout in seconds for waiting for a reply from the display
reply_timeout = 7.0
# opcode definitions
OPCODE_RESET__FACTORY_RESET = 0x0004
OPCODE_RESET__GEOMETRY_RESET = 0x0006
OPCODE_RESET__COLOR_RESET = 0x0008
OPCODE_ADJUST__CLOCK = 0x000e
OPCODE_PICTURE__BRIGHTNESS = 0x0010
OPCODE_PICTURE__CONTRAST = 0x0012
OPCODE_PICTURE__COLOR__SELECT_COLOR_PRESET = 0x0014
OPCODE_PICTURE__COLOR__GAIN__RED_GAIN = 0x0016
OPCODE_PICTURE__COLOR__GAIN__GREEN_GAIN = 0x0018
OPCODE_PICTURE__COLOR__GAIN__BLUE_GAIN = 0x001a
OPCODE_ADJUST__AUTO_SETUP = 0x001e
OPCODE_ADJUST__H_POSITION = 0x0020
OPCODE_ADJUST__V_POSITION = 0x0030
OPCODE_ADJUST__CLOCK_PHASE = 0x003e
OPCODE_PICTURE__COLOR__COLOR_TEMP = 0x0054
OPCODE_INPUT = 0x0060
OPCODE_AUDIO__AUDIO_VOLUME = 0x0062
OPCODE_OSD__OSD_LANGUAGE = 0x0068
OPCODE_PICTURE__COLOR__SATURATION = 0x008a
OPCODE_TV_CHANNEL = 0x008b
OPCODE_PICTURE__SHARPNESS = 0x008c
OPCODE_AUDIO__MUTE = 0x008d
OPCODE_AUDIO__AUDIO_TREBLE = 0x008f
OPCODE_PICTURE__COLOR__TINT = 0x0090
OPCODE_AUDIO__AUDIO_BASS = 0x0091
OPCODE_PICTURE__BLACK_LEVEL = 0x0092
OPCODE_AUDIO__AUDIO_BALANCE = 0x0093
OPCODE_AUDIO__AUDIO_CHANNEL_MODE = 0x0094
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_RED = 0x009b
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_YELLOW = 0x009c
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_GREEN = 0x009d
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_CYAN = 0x009e
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_BLUE = 0x009f
OPCODE_PICTURE__COLOR__6_AXIS_COLOR_MAGENTA = 0x00a0
OPCODE_SETTINGS = 0x00b0
OPCODE_MONITOR_TYPE_READ_ONLY = 0x00b6
OPCODE_POWER_MODE_READ_ONLY = 0x00d6
OPCODE_SCAN_MODE = 0x00da
OPCODE_VCP_VERSION_READ_ONLY = 0x00df
OPCODE_POWER_SAVE = 0x00e1
OPCODE_TOTAL_OPERATING_TIME_30_MIN_READ_ONLY = 0x00fa
OPCODE_KEY_LOCK = 0x00fb
OPCODE_OSD__OSD_TURN_OFF_DELAY = 0x00fc
OPCODE_OPERATING_TIME_ON_30_MIN_READ_ONLY = 0x00ff
OPCODE_PICTURE__PICTURE_MODE = 0x021a
OPCODE_PICTURE__COLOR__COLOR = 0x021f
OPCODE_PICTURE__NOISE_REDUCTION = 0x0220
OPCODE_COLOR_SYSTEM = 0x0221
OPCODE_PICTURE__FILM_MODE = 0x0223
OPCODE_SCAN_CONVERSION = 0x0225
OPCODE_NOISE_REDUCTION = 0x0226
OPCODE_OFF_TIMER_HOURS = 0x022b
OPCODE_AUDIO__MTS_AUDIO = 0x022c
OPCODE_AUTO_BRIGHTNESS = 0x022d
OPCODE_AUDIO__AUDIO_INPUT = 0x022e
OPCODE_RESET__SOUND_RESET = 0x0231
OPCODE_AUDIO__SURROUND_SOUND = 0x0234
OPCODE_OSD__OSD_H_POSITION = 0x0238
OPCODE_OSD__OSD_V_POSITION = 0x0239
OPCODE_OSD__INFORMATION_OSD = 0x023d
OPCODE_MONITOR_ID = 0x023e
OPCODE_IR_CONTROL = 0x023f
OPCODE_INPUT_DETECT = 0x0240
OPCODE_OSD__OSD_ROTATION = 0x0241
OPCODE_ADJUST__H_RESOLUTION = 0x0250
OPCODE_ADJUST__V_RESOLUTION = 0x0251
OPCODE_PICTURE__GAMMA = 0x0268
OPCODE_ADJUST__ASPECT__ZOOM_H_EXPANSION = 0x026c
OPCODE_ADJUST__ASPECT__ZOOM_V_EXPANSION = 0x026d
OPCODE_ADJUST__ASPECT__ZOOM = 0x026f
OPCODE_ADJUST__ASPECT__ASPECT = 0x0270
OPCODE_PIP__PIP_SIZE = 0x0271
OPCODE_PIP__PIP_MODE = 0x0272
OPCODE_PIP__PIP_INPUT_SUB_INPUT = 0x0273
OPCODE_PIP__PIP_H_POSITION = 0x0274
OPCODE_PIP__PIP_V_POSITION = 0x0275
OPCODE_STILL_CAPTURE = 0x0276
OPCODE_SELECT_TEMPERATURE_SENSOR = 0x0278
OPCODE_READ_TEMPERATURE_SENSOR_READ_ONLY = 0x0279
OPCODE_FAN__FAN_SELECT = 0x027a
OPCODE_FAN__FAN_STATUS_READ_ONLY = 0x027b
OPCODE_FAN__FAN_CONTROL = 0x027d
OPCODE_PICTURE__ADAPTIVE_CONTRAST = 0x028d
OPCODE_STANDBY_MODE = 0x029a
OPCODE_SCART_MODE = 0x029e
OPCODE_SPECTRAVIEW_ENGINE__LUMINANCE_SET = 0x02b3
OPCODE_CURRENT_LUMINANCE_READ_ONLY = 0x02b4
OPCODE_BRIGHT_SENSOR_READ_READ_ONLY = 0x02b5
OPCODE_OSD__OSD_TRANSPARENCY = 0x02b8
OPCODE_POWER_LED_INDICATOR = 0x02be
OPCODE_TEST_PATTERN__VT_MODE = 0x02c3
OPCODE_CSC_GAIN = 0x02ca
OPCODE_RESET__MENU_TREE_RESET = 0x02cb
OPCODE_ADJUST__ASPECT__ZOOM_H_POSITION = 0x02cc
OPCODE_ADJUST__ASPECT__ZOOM_V_POSITION = 0x02cd
OPCODE_ADJUST__ASPECT__BASE_ZOOM = 0x02ce
OPCODE_DVI_MODE = 0x02cf
OPCODE_TILE_MATRIX__TILE_MATRIX_H_MONITORS = 0x02d0
OPCODE_TILE_MATRIX__TILE_MATRIX_V_MONITORS = 0x02d1
OPCODE_TILE_MATRIX__TILE_MATRIX_POSITION = 0x02d2
OPCODE_TILE_MATRIX__TILE_MATRIX_MODE = 0x02d3
OPCODE_TILE_MATRIX__TILE_MATRIX_TILE_COMP = 0x02d5
OPCODE_VIDEO_AV_INPUT_POWER_SAVE = 0x02d6
OPCODE_IMAGE_FLIP = 0x02d7
OPCODE_POWER_ON_DELAY = 0x02d8
OPCODE_ADJUST__INPUT_RESOLUTION = 0x02da
OPCODE_SCREEN_SAVER__SCREEN_SAVER_GAMMA = 0x02db
OPCODE_SCREEN_SAVER__SCREEN_SAVER_BRIGHTNESS = 0x02dc
OPCODE_SCREEN_SAVER__SCREEN_SAVER_MOTION = 0x02dd
OPCODE_SIDE_BORDER_COLOR = 0x02df
OPCODE_LONG_CABLE__MANUAL_SYNC_TERMINATE = 0x02e1
OPCODE_SCAN_MODE_ALT = 0x02e3
OPCODE_RESET__ADVANCED_OPTION_RESET = 0x02e4
OPCODE_ENABLE_SCHEDULE = 0x02e5
OPCODE_DISABLE_SCHEDULE = 0x02e6
OPCODE_SPECTRAVIEW_ENGINE__CUSTOM_GAMMA_VALUE = 0x02e8
OPCODE_SIGNAL_INFORMATION = 0x02ea
OPCODE_UNIFORMITY_CORRECTION_LEVEL = 0x02ee
OPCODE_LONG_CABLE__COMP_DVI = 0x02f0
OPCODE_RESET__GAMMA_PROGRAMMABLE_RESET = 0x02f8
OPCODE_GAMMA_PROGRAMMABLE_LUT_SIZE = 0x02f9
OPCODE_ISF = 0x1000
OPCODE_ISF_MODE = 0x1001
OPCODE_ISF_DATA_COPY = 0x1002
OPCODE_PIP__TEXT_TICKER_MODE = 0x1008
OPCODE_PIP__TEXT_TICKER_POSITION = 0x1009
OPCODE_PIP__TEXT_TICKER_SIZE = 0x100a
OPCODE_PIP__TEXT_TICKER_BLEND = 0x100b
OPCODE_PIP__TEXT_TICKER_DETECT = 0x100c
OPCODE_PIP__TEXT_TICKER_FADE_IN = 0x100d
OPCODE_CARBON_FOOTPRINT_G_READ_ONLY = 0x1010
OPCODE_CARBON_FOOTPRINT_KG_READ_ONLY = 0x1011
OPCODE_CARBON_USAGE_G_READ_ONLY = 0x1026
OPCODE_CARBON_USAGE_KG_READ_ONLY = 0x1027
OPCODE_CARBON_FOOTPRINT_SAVINGS_NO_RESET_G_READ_ONLY = 0x1028
OPCODE_CARBON_FOOTPRINT_SAVINGS_NO_RESET_KG_READ_ONLY = 0x1029
OPCODE_CARBON_USAGE_NO_RESET_G_READ_ONLY = 0x102a
OPCODE_CARBON_USAGE_NO_RESET_KG_READ_ONLY = 0x102b
OPCODE_CUSTOM_DETECT_PRIORITY_1 = 0x102e
OPCODE_CUSTOM_DETECT_PRIORITY_2 = 0x102f
OPCODE_CUSTOM_DETECT_PRIORITY_3 = 0x1030
OPCODE_CUSTOM_DETECT_PRIORITY_4 = 0x1031
OPCODE_CUSTOM_DETECT_PRIORITY_5 = 0x1032
OPCODE_AMBIENT_BRIGHTNESS_LOW = 0x1033
OPCODE_AMBIENT_BRIGHTNESS_HIGH = 0x1034
OPCODE_SCREEN_SAVER__SCREEN_SAVER_ZOOM = 0x1035
OPCODE_LONG_CABLE__COMP_MANUAL_POLE = 0x1036
OPCODE_LONG_CABLE__COMP_MANUAL_PEAK = 0x1037
OPCODE_LONG_CABLE__COMP_MANUAL_GAIN = 0x1038
OPCODE_LONG_CABLE__COMP_MANUAL_OFFSET = 0x1039
OPCODE_TEST_PATTERN__TEST_PATTERN_RED_LEVEL = 0x103a
OPCODE_TEST_PATTERN__TEST_PATTERN_GREEN_LEVEL = 0x103b
OPCODE_TEST_PATTERN__TEST_PATTERN_BLUE_LEVEL = 0x103c
OPCODE_LONG_CABLE__COMP_MANUAL_EQUALIZE = 0x103d
OPCODE_EXTERNAL_CONTROL__EXTERNAL_CONTROL = 0x103e
OPCODE_FAN__FAN_SPEED = 0x103f
OPCODE_HDMI_SIGNAL = 0x1040
OPCODE_OPS__OPTION_SLOT_POWER = 0x1041
OPCODE_EDID_SWITCH = 0x1049
OPCODE_TILE_MATRIX__TILE_MATRIX_MEMORY = 0x104a
OPCODE_SPECTRAVIEW_ENGINE__PICTURE_MODE = 0x1050
OPCODE_SPECTRAVIEW_ENGINE__PRESET = 0x1051
OPCODE_SPECTRAVIEW_ENGINE__TARGET_WHITE_POINT_CIE_X_X1000 = 0x1052
OPCODE_SPECTRAVIEW_ENGINE__TARGET_WHITE_POINT_CIE_Y_X1000 = 0x1053
OPCODE_SPECTRAVIEW_ENGINE__BLACK_LEVEL_X10 = 0x1054
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_RED_CIE_X_X1000 = 0x1055
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_RED_CIE_Y_X1000 = 0x1056
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_GREEN_CIE_X_X1000 = 0x1057
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_GREEN_CIE_Y_X1000 = 0x1058
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_BLUE_CIE_X_X1000 = 0x1059
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_BLUE_CIE_Y_X1000 = 0x105a
OPCODE_SPECTRAVIEW_ENGINE__COLOR_VISION_EMULATION = 0x105b
OPCODE_SPECTRAVIEW_ENGINE__METAMERISM = 0x105c
OPCODE_SPECTRAVIEW_ENGINE__PRINT_PREVIEW_3D_LUT = 0x1069
OPCODE_SPECTRAVIEW_ENGINE__3D_LUTPROG_GAMMA_SELECT = 0x106b
OPCODE_SPECTRAVIEW_ENGINE__RESET_PICTURE_MODE = 0x1070
OPCODE_SPECTRAVIEW_ENGINE__TARGET_COLORSPACE_RESET = 0x1071
OPCODE_HUMAN_SENSING__HUMAN_SENSING_MODE = 0x1075
OPCODE_HUMAN_SENSING__HUMAN_SENSING_READING = 0x1076
OPCODE_HUMAN_SENSING__HUMAN_SENSING_THRESHOLD = 0x1077
OPCODE_HUMAN_SENSING__HUMAN_SENSING_START_TIME = 0x1078
OPCODE_BNC_MODE = 0x107e
OPCODE_GROUP_ID = 0x107f
OPCODE_AUDIO__PIP_AUDIO = 0x1080
OPCODE_AUDIO__AUDIO_LINE_OUT = 0x1081
OPCODE_PIP__KEEP_PIP_MODE = 0x1082
OPCODE_PIP__PIP_ASPECT = 0x1083
OPCODE_CLOSED_CAPTION = 0x1084
OPCODE_EXTERNAL_CONTROL__ID_ALL_REPLY = 0x1085
OPCODE_INPUT_CHANGE = 0x1086
OPCODE_MOTION_COMPENSATION_120HZ = 0x1087
OPCODE_EDGE_COMPENSATION__MURA = 0x1088
OPCODE_OSD__OSD_OFF = 0x1089
OPCODE_SHUTDOWN = 0x108a
OPCODE_OPTION_LAN_ALERT = 0x108b
OPCODE_EDGE_COMP_TYPE = 0x108c
OPCODE_EDGE_COMP_BRIGHTNESS = 0x108d
OPCODE_DSUB_MODE = 0x108e
OPCODE_OSD__DISPLAY_ID_ON_OSD = 0x1095
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_BASE_RED = 0x1098
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_BASE_GREEN = 0x1099
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_BASE_BLUE = 0x109a
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_RED = 0x109b
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_GREEN = 0x109c
OPCODE_EXPERT_ANALOG_VIDEO__ADC_OFFSET_BLUE = 0x109d
OPCODE_EXPERT_ANALOG_VIDEO__ADC_GAIN_RED = 0x109e
OPCODE_EXPERT_ANALOG_VIDEO__ADC_GAIN_GREEN = 0x109f
OPCODE_EXPERT_ANALOG_VIDEO__ADC_GAIN_BLUE = 0x10a0
OPCODE_DIGITAL_CLOSED_CAPTION = 0x10a1
OPCODE_AUDIO__AUDIO_VOLUME_STEP = 0x10ad
OPCODE_AUDIO__OPTION_SLOT_AUDIO = 0x10b0
OPCODE_PIP__PBP_TYPE = 0x10b5
OPCODE_SCREEN_MUTE = 0x10b6
OPCODE_AUTO_ADJUST = 0x10b7
OPCODE_OSD__OSD_FLIP = 0x10b8
OPCODE_PIP__PIP_SIZE__VARIABLE = 0x10b9
OPCODE_MEMO_DISPLAY = 0x10ba
OPCODE_POWER_ON_DELAY_LINK_TO_ID = 0x10bc
OPCODE_DDCI = 0x10be
OPCODE_OPS__INTERNAL_PC_OFF_WARNING = 0x10c0
OPCODE_OPS__INTERNAL_PC_AUTO_OFF = 0x10c1
OPCODE_OPS__INTERNAL_PC_START = 0x10c2
OPCODE_OPS__INTERNAL_PC_FORCE_QUIT = 0x10c3
OPCODE_TOUCH_PANEL_POWER_SUPPLY = 0x10c4
OPCODE_TOUCH_PANEL_PC_SOURCE = 0x10c5
OPCODE_HUMAN_SENSING__HUMAN_SENSING_BACKLIGHT = 0x10c6
OPCODE_HUMAN_SENSING__HUMAN_SENSING_VOLUME = 0x10c7
OPCODE_ROOM_LIGHT_SENSING = 0x10c8
OPCODE_ROOM_AMBIENT_BRIGHTNESS_MAX = 0x10c9
OPCODE_INPUT_CHANGE_SUPER_INPUT_1 = 0x10ce
OPCODE_INPUT_CHANGE_SUPER_INPUT_2 = 0x10cf
OPCODE_HUMAN_SENSING__HUMAN_SENSING_INPUT = 0x10d0
OPCODE_POWER_SAVE_TIMER = 0x10d2
OPCODE_LAN_POWER = 0x10d3
OPCODE_IR_LOCK_SETTINGS_MODE_SELECT = 0x10d4
OPCODE_IR_LOCK_SETTINGS_POWER = 0x10d5
OPCODE_IR_LOCK_SETTINGS_VOLUME = 0x10d6
OPCODE_IR_LOCK_SETTINGS_MIN_VOLUME = 0x10d7
OPCODE_IR_LOCK_SETTINGS_MAX_VOLUME = 0x10d8
OPCODE_IR_LOCK_SETTINGS_INPUT = 0x10d9
OPCODE_IR_LOCK_SETTINGS_UNLOCK_SELECT_1 = 0x10da
OPCODE_IR_LOCK_SETTINGS_UNLOCK_SELECT_2 = 0x10db
OPCODE_IR_LOCK_SETTINGS_UNLOCK_SELECT_3 = 0x10dc
OPCODE_HUMAN_SENSING__HUMAN_SENSING_BACKLIGHT_ONOFF = 0x10dd
OPCODE_HUMAN_SENSING__HUMAN_SENSING_VOLUME_ONOFF = 0x10de
OPCODE_HUMAN_SENSING__HUMAN_SENSING_INPUT_ONOFF = 0x10df
OPCODE_FAN__FAN_CONTROL_SENSOR_1_SET_TEMPERATURE = 0x10e0
OPCODE_FAN__FAN_CONTROL_SENSOR_1_TEMPERATURE_FROM_MAX = 0x10e1
OPCODE_FAN__FAN_CONTROL_SENSOR_2_SET_TEMPERATURE = 0x10e2
OPCODE_FAN__FAN_CONTROL_SENSOR_2_TEMPERATURE_FROM_MAX = 0x10e3
OPCODE_FAN__FAN_CONTROL_SENSOR_3_SET_TEMPERATURE = 0x10e4
OPCODE_FAN__FAN_CONTROL_SENSOR_3_TEMPERATURE_FROM_MAX = 0x10e5
OPCODE_VIDEO_LOOP_OUT_SETTING = 0x10ea
OPCODE_INTELLIGENT_WIRELESS_DATA = 0x10ec
OPCODE_RF_TAG_DESTINATION_ID_READ_ONLY = 0x10ee
OPCODE_BOWLING_MODE = 0x10ef
OPCODE_HUMAN_SENSING__HUMAN_SENSOR_ATTACHMENT_STATUS_READ_ONLY = 0x10f0
OPCODE_DISPLAYPORT_TERMINAL_SELECT = 0x10f1
OPCODE_DISPLAYPORT_TERMINAL_TYPE = 0x10f2
OPCODE_EXTENDED_POWER_SAVE = 0x10f5
OPCODE_AUTO_POWER_SAVE_TIME_SEC_X5 = 0x10f6
OPCODE_AUTO_STANDBY_TIME_SEC_X5 = 0x10f7
OPCODE_TILE_MATRIX__FRAME_COMP_MODE = 0x1101
OPCODE_TILE_MATRIX__FRAME_COMP_AUTO_VALUE = 0x1102
OPCODE_TILE_MATRIX__FRAME_COMP_MANUAL_VALUE = 0x1103
OPCODE_TILE_MATRIX__V_SCAN_REVERSE_MODE = 0x1104
OPCODE_TILE_MATRIX__V_SCAN_REVERSE_MANUAL = 0x1105
OPCODE_INPUT_ALT = 0x1106
OPCODE_UHD_UPSCALING = 0x1109
OPCODE_PIP__ACTIVE_WINDOW = 0x110b
OPCODE_PIP__ACTIVE_FRAME = 0x110d
OPCODE_PIP__INPUT_SELECT_WINDOW_1 = 0x110e
OPCODE_PIP__INPUT_SELECT_WINDOW_2 = 0x110f
OPCODE_PIP__INPUT_SELECT_WINDOW_3 = 0x1110
OPCODE_PIP__INPUT_SELECT_WINDOW_4 = 0x1111
OPCODE_PIP__PIVOT_WINDOW_1 = 0x1112
OPCODE_PIP__PIVOT_WINDOW_2 = 0x1113
OPCODE_PIP__PIVOT_WINDOW_3 = 0x1114
OPCODE_PIP__PIVOT_WINDOW_4 = 0x1115
OPCODE_PIP__PIVOT_ALL_WINDOWS = 0x1116
OPCODE_OSD__COMMUNICATIONS_INFORMATION = 0x1117
OPCODE_HDMIDVI_SELECT = 0x1118
OPCODE_DISPLAY_PORT_BIT_RATE = 0x1119
OPCODE_LONG_CABLE__COMP_DVI2 = 0x111a
OPCODE_LONG_CABLE__COMP_HDMI1 = 0x111b
OPCODE_LONG_CABLE__COMP_HDMI2 = 0x111c
OPCODE_LONG_CABLE__COMP_HDMI3 = 0x111d
OPCODE_LONG_CABLE__COMP_HDMI4 = 0x111e
OPCODE_INPUT_CONFIGURATION__PRESET_1_MODE = 0x111f
OPCODE_INPUT_CONFIGURATION__PRESET_2_MODE = 0x1120
OPCODE_INPUT_CONFIGURATION__PRESET_3_MODE = 0x1121
OPCODE_INPUT_CONFIGURATION__TOP_LEFT = 0x1122
OPCODE_INPUT_CONFIGURATION__TOP_RIGHT = 0x1123
OPCODE_INPUT_CONFIGURATION__BOTTOM_LEFT = 0x1124
OPCODE_INPUT_CONFIGURATION__BOTTOM_RIGHT = 0x1125
OPCODE_INPUT_CONFIGURATION__LEFT = 0x1126
OPCODE_INPUT_CONFIGURATION__RIGHT = 0x1127
OPCODE_INPUT_CONFIGURATION__TOP = 0x1128
OPCODE_INPUT_CONFIGURATION__BOTTOM = 0x1129
OPCODE_TEXT_TICKER__WINDOW_1 = 0x112a
OPCODE_TEXT_TICKER__WINDOW_2 = 0x112b
OPCODE_ADJUST__ASPECT__EXTENSION_ZOOM = 0x112c
OPCODE_ADJUST__ASPECT__EXTENSION_H_ZOOM = 0x112d
OPCODE_ADJUST__ASPECT__EXTENSION_V_ZOOM = 0x112e
OPCODE_SPECTRAVIEW_ENGINE__SPECTRAVIEW_ENGINE_MODE = 0x1147
OPCODE_HUMAN_SENSING_HUMAN_SENSOR_STATUS = 0x114c
OPCODE_COMMAND_TRANSFER = 0x114f
OPCODE_OSD_CLOSE_OSD = 0x1157
OPCODE_MULTI_INPUT_TERMINAL_SETTINGS_DISPLAYPORT = 0x1167
OPCODE_MULTI_INPUT_TERMINAL_SETTINGS_HDMI = 0x1168
OPCODE_CONTROL_IR_LOCK_SETTINGS_CHANNEL = 0x1169
OPCODE_CONTROL_KEY_LOCK_SETTINGS_MODE_SELECT = 0x116a
OPCODE_CONTROL_KEY_LOCK_SETTINGS_POWER = 0x116b
OPCODE_CONTROL_KEY_LOCK_SETTINGS_VOLUME = 0x116c
OPCODE_CONTROL_KEY_LOCK_SETTINGS_MIN_VOLUME = 0x116d
OPCODE_CONTROL_KEY_LOCK_SETTINGS_MAX_VOLUME = 0x116e
OPCODE_CONTROL_KEY_LOCK_SETTINGS_INPUT = 0x116f
OPCODE_CONTROL_KEY_LOCK_SETTINGS_CHANNEL = 0x1170
OPCODE_CONTROL_POWER_INDICATOR_SCHEDULE_INDICATOR = 0x1171
OPCODE_CONTROL_USB_USB_TOUCH_POWER = 0x1172
OPCODE_CONTROL_USB_USB_EXTERNAL_CONTROL = 0x1173
OPCODE_CONTROL_USB_USB_PC_SOURCE = 0x1174
OPCODE_CONTROL_USB_USB_POWER = 0x1175
OPCODE_CONTROL_CEC = 0x1176
OPCODE_CONTROL_CEC_AUTO_TURN_OFF = 0x1177
OPCODE_CONTROL_CEC_AUDIO_RECEIVER = 0x1178
OPCODE_CONTROL_CEC_SEARCH_DEVICE = 0x1179
OPCODE_OSD_KEY_GUIDE = 0x117a
OPCODE_POWER_SAVE_MESSAGE = 0x117b
OPCODE_COMPUTE_MODULE_POWER_SUPPLY = 0x117c
OPCODE_COMPUTE_MODULE_AUTO_POWER_ON = 0x117d
OPCODE_COMPUTE_MODULE_USB_BOOT_MODE = 0x117e
OPCODE_COMPUTE_MODULE_IR_SIGNAL = 0x117f
OPCODE_COMPUTE_MODULE_MONITOR_CONTROL = 0x1180
OPCODE_COMPUTE_MODULE_SHUTDOWN_SIGNAL = 0x1181
OPCODE_COMPUTE_MODULE_POWER_SUPPLY_OFF_DELAY = 0x1182
OPCODE_DP_POWER_SETTING = 0x1183
OPCODE_DUAL_LINK_HDCP_SWITCH = 0x1184
OPCODE_INTERNAL_TOUCH = 0x1185
OPCODE_HDMI_SW_THROUGH = 0x1186
OPCODE_COMPUTE_MODULE_WATCHDOG_TIMER_ENABLE = 0x119b
OPCODE_COMPUTE_MODULE_WATCHDOG_TIMER_START_UP_TIME = 0x119c
OPCODE_COMPUTE_MODULE_WATCHDOG_TIMER_PERIOD_TIME = 0x119d
OPCODE_COMPUTE_MODULE_WATCHDOG_TIMER_RESET = 0x119e
OPCODE_COMPUTE_MODULE_FAN_POWER_MODE = 0x11b5
OPCODE_COMPUTE_MODULE_FAN_POWER_STATUS = 0x11b6
OPCODE_COMPUTE_MODULE_AUTO_SHUTDOWN = 0x11b7
OPCODE_TOTAL_OPERATING_TIME__UPPER___MINUTES___READ_ONLY_ = 0x11fa
OPCODE_TOTAL_OPERATING_TIME__LOWER___MINUTES___READ_ONLY_ = 0x11fb
OPCODE_OPERATING_TIME_ON__UPPER___MINUTES___READ_ONLY_ = 0x11fe
OPCODE_OPERATING_TIME_ON__LOWER___MINUTES___READ_ONLY_ = 0x11ff
# dictionary of codes for use when sending IR remote button emulation commands
# e.g. command_send_ir_remote_control_code() and helper_send_ir_remote_control_codes()
PD_IR_COMMAND_CODES = {
'power': 0x03,
'standby': 0x4e,
'power_on': 0x52,
'menu': 0x20,
'display': 0x19,
'up': 0x15,
'-': 0x21,
'set': 0x23,
'+': 0x22,
'auto': 0x1c,
'down': 0x14,
'exit': 0x1f,
'1': 0x08,
'2': 0x09,
'3': 0x0a,
'4': 0x0b,
'5': 0x0c,
'6': 0x0d,
'7': 0x0e,
'8': 0x0f,
'9': 0x10,
'0': 0x12,
'hyphen': 0x44,
'ent': 0x45,
'vol+': 0x17,
'vol-': 0x16,
'ch+': 0x33,
'ch-': 0x32,
'guide': 0x34,
'mute': 0x1b,
'still': 0x27,
'capture': 0x28,
'dvi': 0x2d,
'displayport': 0x55,
'vga': 0x04,
'rgbhv': 0x2e,
'hdmi': 0x42,
'dvdhd': 0x31,
'ypbpr': 0x31,
'video': 0x06,
'svideo': 0x54,
'dvi1': 0x65,
'dvi2': 0x5b,
'hdmi1': 0x64,
'hdmi2': 0x58,
'hdmi3': 0x59,
'hdmi4': 0x5a,
'displayport1': 0x66,
'displayport2': 0x67,
'media_player': 0x68,
'compute_module': 0x69,
'picture_mode': 0x1d,
'aspect': 0x29,
'sound': 0x43,
'option': 0x39,
'image_flip': 0x57,
'option_menu': 0x56,
'audio_input': 0x1e,
'active_picture': 0x5f,
'multipicture_on_off': 0x24,
'multipicture_mode': 0x63,
'multipicture_change': 0x26,
'multipicture_picture_aspect': 0x62,
'multipicture_rotate': 0x60,
'multipicture_rotate_all': 0x61,
'preset1': 0x5c,
'preset2': 0x5d,
'preset3': 0x5e
}
# dictionary of diagnostic error codes that can be returned by the display
# e.g. helper_self_diagnosis_status_text() and command_self_diagnosis_status_read()
DISPLAY_DIAGNOSTIC_ERROR_CODES = {
0x00: "Normal",
0x70: "Standby-power +3.3V abnormality",
0x71: "Standby-power +5V abnormality",
0x72: "Panel-power +12V abnormality",
0x73: "Main-power +2.5V abnormality",
0x74: "Main-power +1.8V abnormality",
0x75: "Main-power +5V abnormality",
0x76: "Sub-power +3.3V abnormality",
0x77: "Main-power +3.3V abnormality",
0x78: "Inverter power/Option slot2 power +24V Abnormality",
0x80: "Cooling fan-1 abnormality",
0x81: "Cooling fan-2 abnormality",
0x82: "Cooling fan-3 abnormality)",
0x83: "COMPUTE MODULE Cooling fan abnormality",
0x90: "LED Backlight abnormality",
0x91: "LED Backlight abnormality",
0xA0: "Temperature abnormality -shutdown",
0xA1: "Temperature abnormality - half brightness",
0xA2: "SENSOR reached at the temperature that the user had specified.",
0xB0: "No signal",
0xC0: "Option board (SLOT3) abnormality",
0xD0: "PROOF OF PLAY buffer full",
0xD1: "RTC error",
0xE0: "System/EEPROM error",
0xE1: "Pegasus error",
0xE2: "LPM-Mission communication error",
0xE3: "NFC-EEPROM error",
0xE4: "CPLD error"
}
# dictionary of fan status modes returned by the display
DISPLAY_FAN_STATUS = {
0x00: "Off",
0x01: "On",
0x02: "Error"
}
# dictionary of power state modes returned by the display
PD_POWER_STATES = {
'Error': 0,
'On': 1,
'Standby': 2,
'Suspend': 3,
'Off': 4,
}
| mit |
WaywardGame/mod-reference | definitions/tile/ITileEventManager.d.ts | 1235 | /*!
* Copyright Unlok, Vaughn Royko 2011-2019
* http://www.unlok.ca
*
* Credits & Thanks:
* http://www.unlok.ca/credits-thanks/
*
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
* https://waywardgame.github.io/
*/
import { InspectionResult } from "game/inspection/IInspection";
import Inspection from "game/inspection/Inspect";
import { ITile } from "tile/ITerrain";
import { ITileEvent, TileEventType } from "tile/ITileEvent";
export interface ITileEventManager {
create(type: TileEventType, x: number, y: number, z: number): ITileEvent | undefined;
remove(tileEvent: ITileEvent): void;
moveTo(tileEvent: ITileEvent, x: number, y: number, z: number): void;
getMovementProgress(tileEvent: ITileEvent): number;
get(tile: ITile, type: TileEventType): ITileEvent | undefined;
canGather(tile: ITile): ITileEvent | undefined;
updateAll(): void;
fireOverflow(x: number, y: number, z: number): void;
inspect(inspection: Inspection, ...events: ITileEvent[]): InspectionResult;
is(thing: any): thing is ITileEvent;
}
export default ITileEventManager;
| mit |
kylaris18/tempbiomes | pages/pasu_redirect.php | 6625 | <?php
#starting session
session_start();
include 'database/database.php';
$pdo = Database::connect();
$sql = "SELECT *
FROM tbl_pasu_status
WHERE pasu_uname = '".$_SESSION['uname']."' AND ps_status = 0;";
//var_dump($sql);
$ongoing = 0;
foreach ($pdo->query($sql) as $row) {
if ($row) {
$ongoing = 1;
$_SESSION['quarter'] = $row['ps_quarter'];
$_SESSION['year'] = $row['ps_year'];
}
}
if ($ongoing == 1) {
header('Location: pasu_profile.php');
}
Database::disconnect();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PASuBIOMES | PASU Profile</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="../dist/css/AdminLTE.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="../plugins/iCheck/all.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Site wrapper -->
<div class="wrapper">
<div class="content-wrapper" style="background-color:#cccccc; margin:0;">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<!-- <img src="../dist/img/DENRlogo.png" style="width:100%; padding-top:30%;"> -->
<!-- <form role="form" > -->
<div class="box box-info" style="margin-top:40%;">
<div class="box-header with-border">
<h3 class="box-title">Oops!</h3>
<div style="float:right;"><a href="logout.php">Log out</a></div>
</div><!-- /.box-header -->
<div class="box-body">
<div>
<label>Choose your option.</label><br>
<p>You do not have any present monitoring. What do you want to do?</p>
</div><br>
</div><!-- /.box-body -->
<div class="box-footer">
<button class="btn btn-md btn-primary" style="width: 150px;" data-toggle="modal" data-target="#SetModal"> Start a new BIOMES.</button>
<button class="btn btn-md btn-danger" style="float: right; width: 150px;"> View Past Reacords.</button>
</div><!-- /.box-footer -->
</div>
</div>
<div class="modal fade" id="SetModal" role="dialog">
<div class="modal-dialog modal-md">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">New Monitoring</h4>
</div>
<div class="modal-body" id="format1_modal_body">
<form role="form">
<div class="box-body">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<select name="quarter" id="quarter">
<option value="1">1st Quarter</option>
<option value="2">2nd Quarter</option>
<option value="3">3rd Quarter</option>
<option value="4">4th Quarter</option>
</select>
</div><br>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input type="text" class="form-control" id="year" placeholder="Year">
</div><br>
</div>
</div><!-- /.box-body -->
</form>
</div>
<div class="modal-footer">
<button type="submit" onclick="getData('<?php echo $_SESSION['uname']; ?>')" class="btn btn-primary">Continue</button>
<button type="button" class="btn btn-danger">Cancel</button>
</div>
</div>
</div>
</div>
</div><!-- ./wrapper -->
<!-- jQuery 2.1.4 -->
<script src="../plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../plugins/fastclick/fastclick.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../plugins/iCheck/icheck.min.js"></script>
<script>
function getData(sessionName) {
var data={
quarter: $('#quarter').val(),
year: $('#year').val(),
id: sessionName
}
//console.log(data);
$.ajax({
url: 'model/model_redirect.php',
type: 'post',
data: data, // mode 0 = fgd, 1 = field diary, 2 = photo doc, 3 = transect
success: function(result) {
window.location.assign("pasu_profile.php");
},
error: function(error) {
alert(error);
}
});
}
</script>
</body>
</html>
| mit |
neotonyxx/personal | app/Providers/AppServiceProvider.php | 645 | <?php
namespace App\Providers;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Add some custom validation rules
Validator::extend('valid_path', function ($attribute, $value, $parameters, $validator) {
return is_dir($value) && is_readable($value);
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
| mit |
pointcache/URSA | Assets/URSA/Utility/TransformUtilities.cs | 5214 | namespace URSA.Utility {
using UnityEngine;
using System;
using System.Collections.Generic;
public static class TransformUtilities {
public static Vector3 GetAxis(this Axis axis) {
switch (axis) {
case Axis.x:
return Vector3.right;
case Axis.y:
return Vector3.up;
case Axis.z:
return Vector3.forward;
}
return Vector3.zero;
}
public static List<Transform> GetTransformsInOrder(this GameObject go) {
var tr = go.transform;
List<Transform> list = new List<Transform>(tr.childCount);
foreach (Transform t in tr) {
list.Add(t);
}
return list;
}
public static void GetChildren(this Transform tr, List<Transform> container) {
if (container == null) {
Debug.LogError("List is null");
return;
}
foreach (Transform child in tr) {
container.Add(child);
}
}
public static void DestroyChildren(this Transform tr) {
if (tr.childCount == 0)
return;
List<Transform> list = new List<Transform>();
foreach (Transform child in tr) {
list.Add(child);
}
int count = list.Count;
for (int i = 0; i < count; i++) {
#if UNITY_EDITOR
if(!Application.isPlaying)
GameObject.DestroyImmediate(list[i].gameObject);
else
GameObject.Destroy(list[i].gameObject);
#else
GameObject.Destroy(list[i].gameObject);
#endif
}
}
public static void GetAllChildren(this Transform tr, List<Transform> container) {
if (container == null) {
Debug.LogError("Attempt to use null List");
return;
}
_GetAllChildrenRecursive(tr, container);
}
private static void _GetAllChildrenRecursive(Transform tr, List<Transform> container) {
foreach (Transform child in tr) {
container.Add(child);
_GetAllChildrenRecursive(child, container);
}
}
public static void SetAllChildren(this Transform tr, bool state) {
foreach (Transform t in tr) {
t.gameObject.SetActive(state);
}
}
public static Vector2 GetRealMax(this RectTransform rect) {
float x = rect.position.x + (rect.sizeDelta.x * (1 - rect.pivot.x));
float y = rect.position.y + (rect.sizeDelta.y * (1 - rect.pivot.y));
return new Vector2(x, y);
}
public static Vector2 GetRealMin(this RectTransform rect) {
float x = (rect.position.x - (rect.sizeDelta.x * rect.pivot.x));
float y = rect.position.y - (rect.sizeDelta.y * rect.pivot.y);
return new Vector2(x, y);
}
public static void DisableAllChildren(this Transform tr) {
foreach (Transform t in tr) {
t.gameObject.SetActive(false);
}
}
//Breadth-first search
public static Transform FindDeepChild(this Transform aParent, string aName) {
var result = aParent.Find(aName);
if (result != null)
return result;
foreach (Transform child in aParent) {
result = child.FindDeepChild(aName);
if (result != null)
return result;
}
return null;
}
/// <summary>
/// Deep search, returns first found
/// </summary>
/// <param name="transform"></param>
/// <param name="Tag"></param>
/// <returns></returns>
public static Transform FindChildWithTag(this Transform transform, string Tag) {
Transform result = null;
foreach (Transform tr in transform) {
if (tr.tag == Tag)
result = tr;
}
if (result != null)
return result;
foreach (Transform child in transform) {
result = child.FindChildWithTag(Tag);
if (result != null)
return result;
}
return null;
}
public static void ZeroOut(this Transform tr) {
tr.position = Vector3.zero;
tr.rotation = Quaternion.identity;
}
public static void ZeroOutLocal(this Transform tr) {
tr.localPosition = Vector3.zero;
tr.localRotation = Quaternion.identity;
}
public static Vector2[] GetScreenCorners(this RectTransform tr) {
Vector3[] corners = new Vector3[4];
tr.GetWorldCorners(corners);
Vector2[] s_corners = new Vector2[4];
for (int i = 0; i < 4; i++) {
s_corners[i].x = corners[i].x;
s_corners[i].y = corners[i].y;
}
return s_corners;
}
}
} | mit |
TAV2017GERM/assignment | src/Models/ActuatorsInterface.java | 618 | package Models;
/**
* @author Group 4 on 2/13/17.
*/
public interface ActuatorsInterface {
/**
* Description: Increase the position of the car
* <p>
* Pre-condition: position < 500
* <p>
* Post-condition: position <= 500
* <p>
* Test-cases: testMoveForward, testRunFwd
*/
int moveForward(int position);
/**
* Description: Decrease the position of the car
* <p>
* Pre-condition: position > 0
* <p>
* Post-condition: position =< 0
* <p>
* Test-cases: testMoveBackward, testRunBkd
*/
int moveBackward(int position);
}
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.