code
stringlengths 2
1.05M
|
---|
//
// Scripts
// -------------------
// Required libraries
require('lib/jquery/jquery.min');
require('lib/bootstrap/bootstrap');
// Application initialization
require('main');
|
$(document).ready(function(){
$(".button-collapse").sideNav({
menuWidth: 300
});
$(".modal-trigger").leanModal();
$(".modal-trigger").click(function(){
$.getJSON('/leaderboard', function(data){
data['percent_correct'] = Math.round(data['percent_correct']);
tmpl = $('#scorecard-template').html();
$('#score-modal .modal-content').html(Mustache.render(tmpl, data))
})
});
$("#welcome.card-panel i").click(function(){
$(this).closest('.card-panel').slideUp();
});
var austat = new Austat();
});
function Austat(){
this.map = null;
this.layers = [];
this.answer = null;
this.question_num = 1;
this.question_max = 10;
this.makeTopics();
this.makeQuestion();
this.correct = 0;
}
Austat.prototype.get_map = function(){
if( !this.map ){
this.map = new L.Map('map');
// create the tile layer with correct attribution
var osmUrll = 'http://otile2.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png'
//var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrll, {minZoom: 0, maxZoom: 12, attribution: osmAttrib});
// start the map in Central Australia
this.map.addLayer(osm);
}
this.map.setView(new L.LatLng(-27.967335, 134.625094), 4);
return this.map;
}
Austat.prototype.checkboxQuestion = function(question){
var austat = this
var tmpl = $('#question-template').html();
var html = Mustache.render(tmpl, question);
$('.question').html(html);
var tmpl = $('#checkbox-template').html();
var html = Mustache.render(tmpl, question);
$('#checkboxes').html(html);
$('#checkboxes input[type=radio]').click(function(){
var selected = $(this).attr('id');
austat.results(selected);
return false;
});
$('#checkboxes').closest('.card').slideDown();
}
Austat.prototype.makeQuestion = function(){
var austat = this;
austat.answer = null;
var topic = this.getRandomTopic();
if(!topic){
$('#notopic').slideDown();
$('#enabletopic').click(function(e){
$('#notopic').slideUp(function(){
austat.makeQuestion();
});
});
return;
}
$.ajax({
url: '/query/' + topic,
success: function(q){
var l = austat.getRandomItem(q.locations);
q.question = Mustache.render(q.question, l)
var details = null;
if (q.link) {
details = q.link;
}
austat.answer = {value: l.value, name: l.name, details: details};
if(l.geometry){
austat.addPlacemarks(q)
}else{
austat.checkboxQuestion(q);
}
}
});
}
Austat.prototype.getRandomItem = function(list){
return list[Math.floor(Math.random()*list.length)];
}
Austat.prototype.getRandomTopic = function(){
// Get a random topic.
topics = this.getAllTopics();
return this.getRandomItem(topics);
}
Austat.prototype.getAllTopics = function(){
// Get a list of ids for selected topics.
var topics = [];
$('input[name=topic]').each(function(i, topic){
if($(this).is(':checked')){
topics.push($(this).attr('topic'));
}
});
return topics;
}
Austat.prototype.makeTopics = function(){
// Get topics from api and create controls.
$.ajax({
async: false,
url: '/topics',
success: function(topics){
var template = $('#topics-template').html();
var html = Mustache.render(template, topics);
$('#topics').html(html)
}
});
}
Austat.prototype.results = function(selected){
var austat = this;
var correct = (austat.answer.value === selected);
$.ajax({
'url': '/leaderboard?success='+correct,
'type': 'POST',
'data': {success:correct}
});
$('#answer').closest('.card').slideDown();
if(correct){
austat.correct += 1;
};
var tmpl = $('#answer-template').html();
var html = Mustache.render(tmpl, {correct: correct, answer: austat.answer.name, details: austat.answer.details});
$('#answer').html(html);
$('#answer #next').click(function(){
$(this).closest('.card').slideUp(function(){
austat.question_num += 1;
$('.progress .determinate').css('width', (austat.question_num * 10) + '%');
if(austat.question_num < 10){
austat.makeQuestion();
}else{
austat.gameFinished();
}
});
});
}
Austat.prototype.gameFinished = function(){
var austat = this;
var tmpl = $('#gameover-template').html();
$('#game-modal .modal-content').html(Mustache.render(tmpl, {correct:austat.correct}));
$('#game-modal').openModal();
$('#game-modal button').click(function(){
window.location.reload()
});
}
Austat.prototype.addPlacemarks = function(question){
var austat = this;
var map = this.get_map();
var tmpl = $('#question-template').html();
var html = Mustache.render(tmpl, question);
$('.question').html(html);
$('#map').closest('.card').slideDown();
austat.layers.forEach(function(layer){
austat.map.removeLayer(layer);
});
austat.layers = [];
question.locations.forEach(function(elem){
var layer = L.geoJson(elem.geometry);
layer.bindPopup(elem.name);
layer.on('mouseover', function(e) {
e.layer.openPopup();
});
layer.on('mouseout', function(e) {
e.layer.closePopup();
});
layer.on('click', function(e) {
austat.layers.forEach(function(l){
l.off('click');
});
austat.results(elem.value)
});
layer.openPopup();
layer.addTo(map);
austat.layers.push(layer);
map.invalidateSize()
});
}
|
var Agent = require('./sqlserver').connect('mssql://peto:yLtS7zazWp6hKMN2@sql.savara.sk/domayn_peto');
var sql = new Agent();
sql.listing('domains', 'Domain', 'name').make(function(builder) {
builder.page(10, 10);
});
sql.on('query', console.log);
sql.exec(function(err, response) {
console.log(err, response);
});
|
var net = require('net');
var test = require('tap').test;
var async = require('async');
var endpoint = require('endpoint');
var now = require('../now.js')();
var match = require('../match.js');
var setup = require('../setup.js')();
var DailyClient = require('../../daily-interface.js').Client;
setup.open();
test('write - A', function (t) {
var client = new DailyClient(net.connect(setup.port, '127.0.0.1'));
client.log({
'seconds': now.second,
'milliseconds': now.millisecond,
'level': 1,
'message': new Buffer('message - A')
}, function (err) {
t.equal(err, null);
client.once('close', t.end.bind(t));
client.close();
});
});
test('write - B', function (t) {
var client = new DailyClient(net.connect(setup.port, '127.0.0.1'));
client.log({
'seconds': now.second,
'milliseconds': now.millisecond,
'level': 1,
'message': new Buffer('message - B')
}, function (err) {
t.equal(err, null);
client.once('close', t.end.bind(t));
client.close();
});
});
test('expect reader to yield two items', function (t) {
var client = new DailyClient(net.connect(setup.port, '127.0.0.1'));
client.reader({
'startSeconds': null,
'startMilliseconds': null,
'endSeconds': null,
'endMilliseconds': null,
'levels': [1, 9]
}).pipe(endpoint({objectMode: true}, function (err, rows) {
t.equal(err, null);
match(t, rows[0], {
level: 1,
seconds: now.second,
milliseconds: now.millisecond,
message: new Buffer('message - A')
});
match(t, rows[1], {
level: 1,
seconds: now.second,
milliseconds: now.millisecond,
message: new Buffer('message - B')
});
client.once('close', t.end.bind(t));
client.close();
}));
});
setup.close();
|
import React from 'react';
import classNames from 'classnames';
import './index.scss';
const {
Component,
PropTypes
} = React;
export default class Button extends Component {
constructor (props) {
super(props);
}
render () {
let btnClasses = classNames({
large: this.props.size === 'large',
blue: this.props.color === 'blue',
orange: this.props.color === 'orange'
});
return (
<button className={`mirana-button ${btnClasses} ${this.props.className}`}
onClick={this.props.onClick}>
{this.props.text}
</button>
);
}
}
Button.propTypes = {
className: PropTypes.string,
text: PropTypes.string.isRequired,
size: PropTypes.oneOf(['small', 'mid', 'large']),
color: PropTypes.oneOf(['white', 'orange', 'blue']),
onClick: PropTypes.func
};
Button.defaultProps = {
className: '',
text: '',
size: 'small',
color: 'white',
onClick () {}
};
|
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'image2', 'et', {
alt: 'Alternatiivne tekst',
btnUpload: 'Saada serverisse',
captioned: 'Pealkirjaga pilt',
captionPlaceholder: 'Pealkiri',
infoTab: 'Pildi info',
lockRatio: 'Lukusta kuvasuhe',
menu: 'Pildi omadused',
pathName: 'pilt',
pathNameCaption: 'pealkiri',
resetSize: 'Lähtesta suurus',
resizer: 'Click and drag to resize', // MISSING
title: 'Pildi omadused',
uploadTab: 'Lae üles',
urlMissing: 'Pildi lähte-URL on puudu.',
altMissing: 'Alternative text is missing.' // MISSING
} );
|
window.data = {};
var guid = function () {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4();
}
var degreesToRadians = function (deg) {
return (deg / 180) * Math.PI;
};
var radiansToDegrees = function (rad) {
return (rad / Math.PI) * 180;
};
var vector = function (arr, name) {
if (arr) {
if (arr instanceof Array) {
this.intrinsic = arr;
} else {
throw ("invalid constructor argument!");
}
} else {
throw ("no constructor argument!");
}
this.n = this.intrinsic.length;
if (name) {
window.data[name] = this;
}
};
vector.prototype.sumSquared = function() {
var sum = 0;
for (i in this.intrinsic) {
sum += Math.pow(this.intrinsic[i], 2);
}
return sum;
};
vector.prototype.magnitude = function () {
return Math.sqrt(this.sumSquared());
};
vector.prototype.unit = function () {
var newVector = [];
var mag = this.magnitude();
for (i in this.intrinsic) {
newVector.push(this.intrinsic[i] / mag);
}
return new vector(newVector);
};
vector.prototype.v = function (i) {
return this.intrinsic[i - 1];
}
vector.prototype.dot = function (vec) {
var other;
if (vec instanceof vector) {
other = vec;
} else {
other = new vector(vec);
}
if (other.n == this.n) {
var products = [];
for (i in this.intrinsic) {
products.push(this.intrinsic[i] * other.intrinsic[i]);
}
return products.reduce(function (last, current) {
return last + current;
});
} else {
throw ("vectors have different dimensions!");
}
};
vector.prototype.cross = function (vec) {
var other;
if (vec instanceof vector) {
other = vec;
} else {
other = new vector(vec);
}
if (other.n == 3 && 3 == this.n) {
return new vector([
this.v(2) * other.v(3) - this.v(3) * other.v(2),
this.v(3) * other.v(1) - this.v(1) * other.v(3),
this.v(1) * other.v(2) - this.v(2) * other.v(1)
]);
} else {
throw ("cross product not valid for any vector that is not in R^3");
}
}
vector.prototype.angle = function (vec) {
var v;
if (vec instanceof vector) {
v = vec;
} else {
v = new vector(vec);
}
var u = this;
if (u.n == 2 && 2 == v.n) {
return Math.acos(
u.dot(v)
/
(u.magnitude() * v.magnitude())
);
} else {
throw ("angle not valid for any vector that is not in R^2");
}
};
vector.prototype.scalarMult = function (n) {
var arr = this.intrinsic;
for (i in arr) {
arr[i] *= n;
}
return new vector(arr);
};
var matrix = function (vals, n, name) {
if (vals) {
// See if argument is array
if (vals instanceof Array) {
// Set m value
this.m = vals.length;
// Check array validity
if (this.m < 1) {
throw ("array of length zero given!");
} else {
// Set n value
this.n = vals[0].length;
for (i in vals) {
// Make sure that array has valid length fro each row
if (vals[i].length != this.n) {
throw ("not all rows have equal length!");
}
}
}
} else if (typeof vals == "number") {
// If m and n where specified, set them
if (typeof n == "number") {
this.m = vals;
this.n = n;
} else {
throw ("invalid constructor value specified");
}
} else {
throw ("invalid constructor value specified");
}
} else {
throw ("no constructor value specified");
}
this.intrinsic = [];
// create instrinsic data
if (vals instanceof Array) {
// If we have an array, fill in the data
for (i in vals) {
this.intrinsic.push(new vector(vals[i]));
}
} else {
// If we don't have an array, create zero vectors
for (var i = 0; i < this.m; i ++) {
this.intrinsic.push(new vector(new Array(this.n)));
this.intrinsic[i].intrinsic.fill(0);
}
}
this.display = document.createElement("div");
this.display.classList.add("item");
this.display.appendChild(document.createElement("div"));
this.display.childNodes[0].classList.add("item-detail");
this.display.childNodes[0].innerHTML = "<span class=\"item-title\">Matrix ?</span>\
<span class=\"item-info\">" + this.m + " x " + this.n + " matrix</span>";
this.display.appendChild(document.createElement("div"));
this.display.childNodes[1].classList.add("item-data");
this.display.childNodes[1].appendChild(document.createElement("div"));
this.display.childNodes[1].childNodes[0].classList.add("matrix");
var matrixDisplay = this.display.childNodes[1].childNodes[0];
matrixDisplay.parentMatrix = this;
var handleChange = function (e) {
try {
this.matrixParent.intrinsic[this.i].intrinsic[this.j] = parseFloat(this.value);
} catch (e) {
this.matrixParent.intrinsic[this.i].intrinsic[this.j] = this.value.toString();
}
};
for (i in this.intrinsic) {
matrixDisplay.appendChild(document.createElement("div"));
var row = matrixDisplay.childNodes[i];
row.classList.add("row");
for (var j = 0; j < this.intrinsic[i].intrinsic.length; j ++) {
row.appendChild(document.createElement("div"));
var cell = row.childNodes[j];
cell.classList.add("element");
cell.appendChild(document.createElement("input"));
var input = cell.firstChild;
input.setAttribute("type", "text");
input.classList.add("matrix-element");
input.value = this.intrinsic[i].intrinsic[j];
input.i = i;
input.j = j;
input.matrixParent = this;
input.addEventListener("keyup", handleChange);
}
}
document.querySelector("#content").appendChild(this.display);
if (name) {
window.data[name] = this;
}
}
matrix.prototype.setName = function (name) {
this.name = name;
this.display.querySelector(".item-title").innerHTML = "Matrix " + name;
}
matrix.prototype.destroy = function () {
this.display.parentElement.removeChild(this.display);
this.display = null;
};
matrix.prototype.setValue = function (m, n, v) {
this.intrinsic[m].intrinsic[n] = v;
this.display.childNodes[1].childNodes[0].childNodes[m].childNodes[n].firstChild.value = v.toString();
};
matrix.prototype.getValue = function (m, n) {
return this.intrinsic[m].intrinsic[n];
}
matrix.prototype.export = function () {
var data = "";
for (i in this.intrinsic) {
if (i != this.intrinsic.length - 1) {
data += this.intrinsic[i].intrinsic.join("\t") + "\n";
} else {
data += this.intrinsic[i].intrinsic.join("\t");
}
}
window.prompt("Hit Crtl-c", data);
};
matrix.prototype.transpose = function (name) {
var out = new matrix(this.n, this.m, name);
for (var i = 0; i < this.m; i ++) {
for (var j = 0; j < this.n; j ++) {
out.setValue(j, i, this.getValue(i, j));
}
}
return out;
};
matrix.prototype.getColumn = function (n) {
var out = [];
for (i in this.intrinsic) {
out.push(this.intrinsic[i].intrinsic[n]);
}
return new vector(out);
};
matrix.prototype.getRow = function (m) {
return this.intrinsic[m];
};
matrix.prototype.mmult = function (that) {
var outMatrix = new matrix(this.m, that.n);
if (this.n == that.m) {
for (var i = 0; i < that.n; i ++) {
var thatColumn = that.getColumn(i);
for (var j = 0; j < this.m; j ++) {
var thisRow = this.getRow(j);
outMatrix.setValue(i, j, thatColumn.dot(thisRow));
}
}
return outMatrix;
} else {
throw "Matrices must have valid corresponding dimensions";
}
};
matrix.prototype.augment = function (mat) {
};
document.addEventListener("DOMContentLoaded", function (e) {
document.querySelector("#content").addEventListener("paste", function (e) {
var pasteData = e.clipboardData.getData('text/plain');
var rows = pasteData.split("\n");
if (rows[rows.length - 1].length == 0) {
rows.pop();
}
for (i in rows) {
rows[i] = rows[i].split("\t");
}
for (i in rows) {
for (j in rows[i]) {
try {
rows[i][j] = parseFloat(rows[i][j]);
} catch (e) {
rows[i][j] = rows[i][j];
}
}
}
var name = guid();
new matrix(rows, undefined, name);
console.log(name);
});
});
|
// @flow
declare var __DEV__: ?string
export const SC_ATTR = 'data-styled-components'
export const SC_STREAM_ATTR = 'data-styled-streamed'
export const CONTEXT_KEY = '__styled-components-stylesheet__'
export const IS_BROWSER = typeof window !== 'undefined'
export const DISABLE_SPEEDY =
(typeof __DEV__ === 'boolean' && __DEV__) ||
process.env.NODE_ENV !== 'production'
|
import { typeOf } from '@ember/utils';
import { htmlSafe } from '@ember/template';
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import ENV from 'bracco/config/environment';
export default Component.extend({
session: service(),
currentUser: service(),
features: service(),
default: false,
type: 'transparent',
title: null,
home: '/',
user: true,
init(...args) {
this._super(...args);
if (ENV.featureFlags['enable-doi-estimate']) {
this.get('features').enable('enableDoiEstimate');
} else {
this.get('features').disable('enableDoiEstimate');
}
this.data = this.data || {};
},
didReceiveAttrs() {
this._super(...arguments);
if (this.default) {
this.set('type', null);
this.set('title', htmlSafe(ENV.SITE_TITLE));
} else if (this['sign-in']) {
this.set('title', htmlSafe(ENV.SITE_TITLE));
this.set('user', false);
}
let home = this.currentUser.get('home');
if (typeOf(home) == 'object') {
this.set('home', { route: home.route, model: home.id });
} else if (home === 'password') {
this.set('home', null);
} else if (home) {
this.set('home', { href: home });
} else {
this.set('home', null);
}
let settings = this.currentUser.get('settings');
if (typeOf(settings) == 'object') {
this.set('settings', { route: settings.route, model: settings.id });
} else if (home === 'password') {
this.set('settings', null);
} else if (home) {
this.set('settings', { href: settings });
} else {
this.set('settings', null);
}
},
actions: {
transitionNoAccess() {
this.router.transitionTo(this.home);
},
invalidateSession() {
this.session.invalidate();
}
}
});
|
/**
* Created by User on 6/29/2017.
*/
'use strict';
const express = require('express'),
mongoose = require('mongoose');
mongoose.set('debug', false);
const ReservationModel = mongoose.model('ReservationNEW');
const Router = express.Router();
Router.get('/', (req, res) => {
ReservationModel.find().exec().then(resp => {
res.json(resp);
}).catch(err => {
console.error(err);
res.sendStatus(500);
});
});
/*Router.get('/sum', (req, res) => {
db.roomdetails.aggregate({
$group: {
_id: '',
amount: { $sum: '$amount' }
}
}).populate('comments').exec().then(resp => {
res.json(resp);
console.log('sum'+resp);
}).catch(err => {
console.error(err);
res.sendStatus(500);
});
});*/
Router.get('/:id', (req, res) => {
ReservationModel.findById(req.params.id).exec().then(reserv => {
res.json(reserv || {});
}).catch(err => {
console.error(err);
res.sendStatus(500);
});
});
Router.post('/', (req, res) => {
const r = new ReservationModel(req.body);
r.save().then(r => {
res.sendStatus(200);
}).catch(err => {
console.error(err);
res.sendStatus(500);
});
});
Router.put('/:id', (req, res) => {
const user=new ReservationModel({_id:req.params.id});
user.update(req.body).then(()=>{
res.sendStatus(200);
}).catch(err=>{
console.error(err);
res.sendStatus(500);
});
});
Router.delete('/:id',(req,res)=>{
ReservationModel.remove({_id:req.params.id}).then(()=>{
res.sendStatus(200);
}).catch(err=>{
res.sendStatus(500);
});
});
module.exports = Router;
|
import React, { Component } from "react"
import PropTypes from "prop-types"
const sumAggregate = (total, val) => total + val
const mapBy = (val, key) => {
return val.map(next => next[key])
}
class DeploymentDistribution extends Component {
constructor(props) {
super(props)
this.state = { active: null }
}
data() {
const counter = {
DesiredCanaries: 0,
PlacedCanaries: 0,
DesiredTotal: 0,
PlacedAllocs: 0,
HealthyAllocs: 0,
UnhealthyAllocs: 0
}
const summary = this.props.deployment.TaskGroups
Object.keys(summary).forEach(taskGroupID => {
counter.DesiredCanaries += summary[taskGroupID].DesiredCanaries
counter.PlacedCanaries += (summary[taskGroupID].PlacedCanaries || []).length
counter.DesiredTotal += summary[taskGroupID].DesiredTotal
counter.PlacedAllocs += summary[taskGroupID].PlacedAllocs
counter.HealthyAllocs += summary[taskGroupID].HealthyAllocs
counter.UnhealthyAllocs += summary[taskGroupID].UnhealthyAllocs
})
let sum = 0
let data = []
let progress = 0
let remaining = 0
switch (this.props.type) {
case "canary":
if (counter.DesiredCanaries == 0) {
return null
}
sum = 100
progress = counter.PlacedCanaries / counter.DesiredCanaries * 100
remaining = 100 - progress
if (progress > 100) {
progress = 100
remaining = 0
} else if (progress < 0) {
progress = 0
remaining = 100
} else if (Number.isNaN(progress)) {
progress = 0
remaining = 0
sum = 0
}
data = [
{
label: "Placed",
value: progress,
className: "placed",
tooltip: counter.PlacedCanaries + " (" + parseInt(progress) + "% complete)"
},
{
label: "Desired",
value: remaining,
className: "desired",
tooltip: counter.DesiredCanaries + " (" + parseInt(100 - progress) + "% remaining)"
}
]
break
case "healthy":
sum = counter.DesiredTotal
data = [
{ label: "Healthy", value: counter.HealthyAllocs, className: "healthy" },
{ label: "Unhealthy", value: counter.UnhealthyAllocs, className: "failed" },
{ label: "Pending", value: sum - (counter.UnhealthyAllocs + counter.HealthyAllocs), className: "pending" }
]
break
case "total":
sum = 100
progress = counter.PlacedAllocs / counter.DesiredTotal * 100
remaining = 100 - progress
if (progress > 100) {
progress = 100
remaining = 0
} else if (progress < 0) {
progress = 0
remaining = 100
}
data = [
{
label: "Placed",
value: progress,
className: "placed",
tooltip: counter.PlacedAllocs + " (" + parseInt(progress) + "% complete)"
},
{
label: "Desired",
value: remaining,
className: "desired",
tooltip: counter.DesiredTotal + " (" + parseInt(100 - progress) + "% remaining)"
}
]
break
default:
throw "Unknown type: " + this.props.type
}
return data.map(({ label, value, className, tooltip }, index) => ({
label,
value,
className,
tooltip,
percent: sum > 0 ? value / sum * 100 : 0,
offset: mapBy(data.slice(0, index), "value").reduce(sumAggregate, 0) / sum * 100
}))
}
render() {
let data = this.data()
if (data == null) {
return null
}
let percentSum = 0
let self = this
let tt = ""
if (this.state.active) {
tt = (
<ol>
{data.map(x => {
return (
<li key={x.label}>
<span className="label">
<span className={`color-swatch ${x.className}`} />
{x.label}
</span>
<span className="value">{x.tooltip || x.value}</span>
</li>
)
})}
</ol>
)
}
return (
<div>
<div style={{ height: 20 }} className="chart distribution-bar">
{tt}
<svg data-tip data-for={`deployment-${this.props.type}-stats-${this.props.deployment.ID}`}>
<g className="bars">
{data.map(x => {
let mouseenter = e => {
self.setState({ active: x.label })
}
let mouseleave = e => {
self.setState({ active: null })
}
let className = x.className
if (self.state.active) {
className = className + (self.state.active == x.label ? " active" : " inactive")
}
let el = (
<rect
key={x.label}
width={x.percent + "%"}
height={20}
x={percentSum + "%"}
className={className}
onMouseEnter={mouseenter}
onMouseLeave={mouseleave}
/>
)
percentSum += x.percent
return el
})}
</g>
<rect width="100%" height="100%" className="border" />
</svg>
</div>
</div>
)
}
}
DeploymentDistribution.propTypes = {
type: PropTypes.string.isRequired
}
export default DeploymentDistribution
|
/* */
var test = require("tape");
var distance = require("turf-distance");
var destination = require("./index");
test('destination', function(t) {
var pt1 = {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-75.0, 39.0]
}
};
var dist = 100;
var bear = 180;
var pt2 = destination(pt1, dist, bear, 'kilometers');
t.ok(pt2, 'should return a point');
t.end();
});
|
import RootPath from '../RootPath'
export default (id) => `${RootPath}/api/v1/generators/${id}/scenarios/new`
|
'use strict';
angular.module('myApp.nview', ['ui.router', 'ui.bootstrap'])
.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('nview', {
url: '/nview',
views: {
'': {
// url: '',
templateUrl: 'nested_view/nview.html',
controller: 'nviewCtrl'
},
'header@nview': {
// url: '',
templateUrl: 'nested_view/templates/header.html'
// controller: 'HeaderController'
},
'content@nview': {
// url:'',
templateUrl: 'nested_view/templates/content.html'
// controller: 'ContentController'
},
'footer@nview': {
// url: '',
templateUrl: 'nested_view/templates/footer.html'
// controller: 'FooterController'
}
}
});
//.state('home', {
// url: '/',
// views: {
// 'header': {
// templateUrl: '/templates/partials/header.html',
// controller: 'HeaderController'
// },
// 'content': {
// templateUrl: '/templates/partials/content.html',
// controller: 'ContentController'
// },
// 'footer': {
// templateUrl: '/templates/partials/footer.html',
// controller: 'FooterController'
// }
// }
//})
//.state('shows', {
// url: '/shows',
// templateUrl: 'templates/shows.html',
// controller: 'ShowsController'
//})
// .state('shows.detail', {
// url: '/detail/:id',
// templateUrl: 'templates/shows-detail.html',
// controller: 'ShowsDetailController'
// });
}])
.controller('nviewCtrl', ['$scope', '$http', function ($scope, $http) {
//$scope.today = function () {
// $scope.dt = new Date();
//};
//$scope.today();
}]);
|
/* jshint esversion: 6 */
(function() {
'use strict';
class ChildImportAsync extends HTMLElement {
constructor() {
super();
this._shadowRoot = this.attachShadow({mode: 'closed'});
// Programmatically style the shadow root
const style = document.createElement('style');
style.innerText = ':host { display: block; background: LightGoldenrodYellow; }';
this._shadowRoot.appendChild(style);
// Expose the BaseURI for debugging purposes
const p = document.createElement('p');
p.innerHTML = `Parent Async BaseURI: ${document.currentScript.baseURI}`;
this._shadowRoot.appendChild(p);
const doc = document.currentScript.ownerDocument;
const template = doc.getElementById('parent-async');
if (template) {
const instance = template.content.cloneNode(true);
this._shadowRoot.insertBefore(instance, p);
} else {
console.error('Could not find "parent-async"');
}
}
}
window.customElements.define('parent-async', ChildImportAsync);
})();
|
module.exports = {
presets: ['@babel/preset-react', '@babel/preset-env']
}
|
/**
* Created by on 2016/5/19.
*/
import React from 'react';
import {
Component,
Picker,
Text,
View,
AsyncStorage,
Alert,
}from 'react-native';
var STORAGE_KEY = '@AsyncStorageLoading:key';
var COLORS = ['red', 'orange', 'yellow', 'green', 'blue'];
var PickerItem = Picker.Item;
var AsyncStorageExample = React.createClass({
getInitialState(){
return {
selectedValue: COLORS[0],
messages: []
}
}
,
async _loadInitialState(){
try {
var value = await AsyncStorage.getItem(STORAGE_KEY);
if (value != null) {
this.setState({selectedValue: value});
this._appendMessage('Recovered selection from disk: ' + value);
} else {
this._appendMessage('Initialized with no selection on disk.');
}
} catch (error) {
this._appendMessage('AsyncStorage error:' + error.messages);
}
},
_appendMessage(message){
this.setState({
messages: this.state.messages.concat(message),
});
},
async _onValueChange(selectedValue){
this.setState({selectedValue});
try {
var exist = AsyncStorage.getItem(STORAGE_KEY);
Alert.alert(exist.toString());
await AsyncStorage.setItem(STORAGE_KEY, selectedValue);
this._appendMessage('Save selection to disk: ' + selectedValue);
} catch (error) {
this._appendMessage('AsyncStorage error: ' + error.message);
}
},
async _removeStorage(){
try {
await AsyncStorage.removeItem(STORAGE_KEY);
this._appendMessage('Selection remove from disk.');
} catch (error) {
this._appendMessage('AsyncStorage error: ' + error.messages);
}
},
componentDidMount() {
this._loadInitialState().done();
},
render(){
var color = this.state.selectedValue;
return (
<View>
<Picker
selectedValue={color}
onValueChange={this._onValueChange}>
{COLORS.map((value)=>(
<PickerItem
value={value}
label={value}
key={value}/>
))}
</Picker>
<Text>
{'Selected: '}
<Text style={{color}}>
{this.state.selectedValue}
</Text>
</Text>
<Text>{' '}</Text>
<Text onPress={this._removeStorage}>
Press here to remove from storage
</Text>
<Text>{' '}</Text>
<Text>Message:</Text>
{this.state.messages.map((m)=><Text key={m}>{m}</Text>)}
</View>
);
}
});
export default class AsyncStorageLoading extends Component {
render() {
return (
<AsyncStorageExample />
)
}
}
|
/*!
* MyBenefitslab (http://getbootstrapadmin.com/MyBenefitslab)
* Copyright 2016 amazingsurge
* Licensed under the Themeforest Standard Licenses
*/
!function(document,window,$){"use strict";var Site=window.Site;$(document).ready(function($){Site.run()}),function(){var $example=$("#examplePieApi");$(".pie-api-start").on("click",function(){$example.asPieProgress("start")}),$(".pie-api-finish").on("click",function(){$example.asPieProgress("finish")}),$(".pie-api-go").on("click",function(){$example.asPieProgress("go",200)}),$(".pie-api-go_percentage").on("click",function(){$example.asPieProgress("go","50%")}),$(".pie-api-stop").on("click",function(){$example.asPieProgress("stop")}),$(".pie-api-reset").on("click",function(){$example.asPieProgress("reset")})}()}(document,window,jQuery);
|
"use strict";
var _regenerator = require("babel-runtime/regenerator");
var _regenerator2 = _interopRequireDefault(_regenerator);
var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
var startServer = function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(program) {
var _this = this;
var directory, directoryPath, createIndexHtml, compilerConfig, devConfig, compiler, app, proxy, prefix, _url, server, io, listener, watchGlobs;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
directory = program.directory;
directoryPath = withBasePath(directory);
createIndexHtml = function createIndexHtml() {
return developHtml(program).catch(function (err) {
if (err.name !== `WebpackError`) {
report.panic(err);
return;
}
report.panic(report.stripIndent`
There was an error compiling the html.js component for the development server.
See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
`, err);
});
};
// Start bootstrap process.
_context2.next = 5;
return bootstrap(program);
case 5:
_context2.next = 7;
return createIndexHtml();
case 7:
_context2.next = 9;
return webpackConfig(program, directory, `develop`, program.port);
case 9:
compilerConfig = _context2.sent;
devConfig = compilerConfig.resolve();
compiler = webpack(devConfig);
/**
* Set up the express app.
**/
app = express();
app.use(require(`webpack-hot-middleware`)(compiler, {
log: function log() {},
path: `/__webpack_hmr`,
heartbeat: 10 * 1000
}));
app.use(`/___graphql`, graphqlHTTP({
schema: store.getState().schema,
graphiql: true
}));
// Allow requests from any origin. Avoids CORS issues when using the `--host` flag.
app.use(function (req, res, next) {
res.header(`Access-Control-Allow-Origin`, `*`);
res.header(`Access-Control-Allow-Headers`, `Origin, X-Requested-With, Content-Type, Accept`);
next();
});
/**
* Refresh external data sources.
* This behavior is disabled by default, but the ENABLE_REFRESH_ENDPOINT env var enables it
* If no GATSBY_REFRESH_TOKEN env var is available, then no Authorization header is required
**/
app.post(`/__refresh`, function (req, res) {
var enableRefresh = process.env.ENABLE_GATSBY_REFRESH_ENDPOINT;
var refreshToken = process.env.GATSBY_REFRESH_TOKEN;
var authorizedRefresh = !refreshToken || req.headers.authorization === refreshToken;
if (enableRefresh && authorizedRefresh) {
console.log(`Refreshing source data`);
sourceNodes();
}
res.end();
});
app.get(`/__open-stack-frame-in-editor`, function (req, res) {
launchEditor(req.query.fileName, req.query.lineNumber);
res.end();
});
app.use(express.static(__dirname + `/public`));
app.use(require(`webpack-dev-middleware`)(compiler, {
noInfo: true,
quiet: true,
publicPath: devConfig.output.publicPath
}));
// Set up API proxy.
proxy = store.getState().config.proxy;
if (proxy) {
prefix = proxy.prefix, _url = proxy.url;
app.use(`${prefix}/*`, function (req, res) {
var proxiedUrl = _url + req.originalUrl;
req.pipe(request(proxiedUrl)).pipe(res);
});
}
// Check if the file exists in the public folder.
app.get(`*`, function (req, res, next) {
// Load file but ignore errors.
res.sendFile(directoryPath(`/public${decodeURIComponent(req.path)}`), function (err) {
// No err so a file was sent successfully.
if (!err || !err.path) {
next();
} else if (err) {
// There was an error. Let's check if the error was because it
// couldn't find an HTML file. We ignore these as we want to serve
// all HTML from our single empty SSR html file.
var parsedPath = parsePath(err.path);
if (parsedPath.extname === `` || parsedPath.extname.startsWith(`.html`)) {
next();
} else {
res.status(404).end();
}
}
});
});
// Render an HTML page and serve it.
app.use(function (req, res, next) {
var parsedPath = parsePath(req.path);
if (parsedPath.extname === `` || parsedPath.extname.startsWith(`.html`)) {
res.sendFile(directoryPath(`public/index.html`), function (err) {
if (err) {
res.status(500).end();
}
});
} else {
next();
}
});
/**
* Set up the HTTP server and socket.io.
**/
server = require(`http`).Server(app);
io = require(`socket.io`)(server);
io.on(`connection`, function (socket) {
socket.join(`clients`);
});
listener = server.listen(program.port, program.host, function (err) {
if (err) {
if (err.code === `EADDRINUSE`) {
// eslint-disable-next-line max-len
report.panic(`Unable to start Gatsby on port ${program.port} as there's already a process listing on that port.`);
return;
}
report.panic(`There was a problem starting the development server`, err);
}
});
// Register watcher that rebuilds index.html every time html.js changes.
watchGlobs = [`src/html.js`, `plugins/**/gatsby-ssr.js`].map(function (path) {
return directoryPath(path);
});
chokidar.watch(watchGlobs).on(`change`, (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return createIndexHtml();
case 2:
io.to(`clients`).emit(`reload`);
case 3:
case "end":
return _context.stop();
}
}
}, _callee, _this);
})));
return _context2.abrupt("return", [compiler, listener]);
case 31:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
return function startServer(_x) {
return _ref.apply(this, arguments);
};
}();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var url = require(`url`);
var chokidar = require(`chokidar`);
var express = require(`express`);
var graphqlHTTP = require(`express-graphql`);
var parsePath = require(`parse-filepath`);
var request = require(`request`);
var rl = require(`readline`);
var webpack = require(`webpack`);
var webpackConfig = require(`../utils/webpack.config`);
var bootstrap = require(`../bootstrap`);
var _require = require(`../redux`),
store = _require.store;
var copyStaticDirectory = require(`../utils/copy-static-directory`);
var developHtml = require(`./develop-html`);
var _require2 = require(`../utils/path`),
withBasePath = _require2.withBasePath;
var report = require(`gatsby-cli/lib/reporter`);
var launchEditor = require(`react-dev-utils/launchEditor`);
var formatWebpackMessages = require(`react-dev-utils/formatWebpackMessages`);
var chalk = require(`chalk`);
var address = require(`address`);
var sourceNodes = require(`../utils/source-nodes`);
// const isInteractive = process.stdout.isTTY
// Watch the static directory and copy files to public as they're added or
// changed. Wait 10 seconds so copying doesn't interfer with the regular
// bootstrap.
setTimeout(function () {
copyStaticDirectory();
}, 10000);
var rlInterface = rl.createInterface({
input: process.stdin,
output: process.stdout
});
// Quit immediately on hearing ctrl-c
rlInterface.on(`SIGINT`, function () {
process.exit();
});
module.exports = function () {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(program) {
var detect, port, compiler, prepareUrls, printInstructions, isFirstCompile;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
printInstructions = function printInstructions(appName, urls, useYarn) {
console.log();
console.log(`You can now view ${chalk.bold(appName)} in the browser.`);
console.log();
if (urls.lanUrlForTerminal) {
console.log(` ${chalk.bold(`Local:`)} ${urls.localUrlForTerminal}`);
console.log(` ${chalk.bold(`On Your Network:`)} ${urls.lanUrlForTerminal}`);
} else {
console.log(` ${urls.localUrlForTerminal}`);
}
console.log();
console.log(`View GraphiQL, an in-browser IDE, to explore your site's data and schema`);
console.log();
console.log(` ${urls.localUrlForTerminal}___graphql`);
console.log();
console.log(`Note that the development build is not optimized.`);
console.log(`To create a production build, use ` + `${chalk.cyan(`gatsby build`)}`);
console.log();
};
prepareUrls = function prepareUrls(protocol, host, port) {
var formatUrl = function formatUrl(hostname) {
return url.format({
protocol,
hostname,
port,
pathname: `/`
});
};
var prettyPrintUrl = function prettyPrintUrl(hostname) {
return url.format({
protocol,
hostname,
port: chalk.bold(port),
pathname: `/`
});
};
var isUnspecifiedHost = host === `0.0.0.0` || host === `::`;
var lanUrlForConfig = void 0,
lanUrlForTerminal = void 0;
if (isUnspecifiedHost) {
try {
// This can only return an IPv4 address
lanUrlForConfig = address.ip();
if (lanUrlForConfig) {
// Check if the address is a private ip
// https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces
if (/^10[.]|^172[.](1[6-9]|2[0-9]|3[0-1])[.]|^192[.]168[.]/.test(lanUrlForConfig)) {
// Address is private, format it for later use
lanUrlForTerminal = prettyPrintUrl(lanUrlForConfig);
} else {
// Address is not private, so we will discard it
lanUrlForConfig = undefined;
}
}
} catch (_e) {
// ignored
}
}
// TODO collect errors (GraphQL + Webpack) in Redux so we
// can clear terminal and print them out on every compile.
// Borrow pretty printing code from webpack plugin.
var localUrlForTerminal = prettyPrintUrl(host);
var localUrlForBrowser = formatUrl(host);
return {
lanUrlForConfig,
lanUrlForTerminal,
localUrlForTerminal,
localUrlForBrowser
};
};
detect = require(`detect-port`);
port = typeof program.port === `string` ? parseInt(program.port, 10) : program.port;
compiler = void 0;
_context3.next = 7;
return new Promise(function (resolve) {
detect(port, function (err, _port) {
if (err) {
report.panic(err);
}
if (port !== _port) {
// eslint-disable-next-line max-len
var question = `Something is already running at port ${port} \nWould you like to run the app at another port instead? [Y/n] `;
rlInterface.question(question, function (answer) {
if (answer.length === 0 || answer.match(/^yes|y$/i)) {
program.port = _port; // eslint-disable-line no-param-reassign
}
startServer(program).then(function (_ref4) {
var c = _ref4[0],
l = _ref4[1];
compiler = c;
resolve();
});
});
} else {
startServer(program).then(function (_ref5) {
var c = _ref5[0],
l = _ref5[1];
compiler = c;
resolve();
});
}
});
});
case 7:
isFirstCompile = true;
// "done" event fires when Webpack has finished recompiling the bundle.
// Whether or not you have warnings or errors, you will get this event.
compiler.plugin(`done`, function (stats) {
// We have switched off the default Webpack output in WebpackDevServer
// options so we are going to "massage" the warnings and errors and present
// them in a readable focused way.
var messages = formatWebpackMessages(stats.toJson({}, true));
var urls = prepareUrls(`http`, program.host, program.port);
var isSuccessful = !messages.errors.length && !messages.warnings.length;
// if (isSuccessful) {
// console.log(chalk.green(`Compiled successfully!`))
// }
// if (isSuccessful && (isInteractive || isFirstCompile)) {
if (isSuccessful && isFirstCompile) {
printInstructions(program.sitePackageJson.name, urls, program.useYarn);
if (program.open) {
require(`opn`)(urls.localUrlForBrowser);
}
}
isFirstCompile = false;
// If errors exist, only show errors.
// if (messages.errors.length) {
// // Only keep the first error. Others are often indicative
// // of the same problem, but confuse the reader with noise.
// if (messages.errors.length > 1) {
// messages.errors.length = 1
// }
// console.log(chalk.red("Failed to compile.\n"))
// console.log(messages.errors.join("\n\n"))
// return
// }
// Show warnings if no errors were found.
// if (messages.warnings.length) {
// console.log(chalk.yellow("Compiled with warnings.\n"))
// console.log(messages.warnings.join("\n\n"))
// // Teach some ESLint tricks.
// console.log(
// "\nSearch for the " +
// chalk.underline(chalk.yellow("keywords")) +
// " to learn more about each warning."
// )
// console.log(
// "To ignore, add " +
// chalk.cyan("// eslint-disable-next-line") +
// " to the line before.\n"
// )
// }
});
case 9:
case "end":
return _context3.stop();
}
}
}, _callee3, undefined);
}));
return function (_x2) {
return _ref3.apply(this, arguments);
};
}();
//# sourceMappingURL=develop.js.map
|
//run init and return the express app, used for testing
module.exports = require('./System/Bootstrap')();
|
/*
* restClient
*/
(function(root) {
let restClient = {};
let parameters = {
baseUrl: 'http://localhost:5000/'
};
/**
* restClient request
* @property {string} url
* @property {object} options
*/
restClient.request = function(url, options) {
let properties = {
url: parameters.baseUrl + url,
dataType: "json",
cache: false,
timeout: 10000
};
// merge properties and options
properties = $.extend(true, properties, options);
// ajax request
$.ajax(properties);
}
root.restClient = restClient;
})(window);
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.defineMode("rpm-changes", function () {
var headerSeperator = /^-+$/;
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
return {
token: function (stream) {
if (stream.sol()) {
if (stream.match(headerSeperator)) {
return 'tag';
}
if (stream.match(headerLine)) {
return 'tag';
}
}
if (stream.match(simpleEmail)) {
return 'string';
}
stream.next();
return null;
}
};
});
CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
// Quick and dirty spec file highlighting
CodeMirror.defineMode("rpm-spec", function () {
var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;
var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
return {
startState: function () {
return {
controlFlow: false,
macroParameters: false,
section: false
};
},
token: function (stream, state) {
var ch = stream.peek();
if (ch == "#") {
stream.skipToEnd();
return "comment";
}
if (stream.sol()) {
if (stream.match(preamble)) {
return "preamble";
}
if (stream.match(section)) {
return "section";
}
}
if (stream.match(/^\$\w+/)) {
return "def";
} // Variables like '$RPM_BUILD_ROOT'
if (stream.match(/^\$\{\w+\}/)) {
return "def";
} // Variables like '${RPM_BUILD_ROOT}'
if (stream.match(control_flow_simple)) {
return "keyword";
}
if (stream.match(control_flow_complex)) {
state.controlFlow = true;
return "keyword";
}
if (state.controlFlow) {
if (stream.match(operators)) {
return "operator";
}
if (stream.match(/^(\d+)/)) {
return "number";
}
if (stream.eol()) {
state.controlFlow = false;
}
}
if (stream.match(arch)) {
return "number";
}
// Macros like '%make_install' or '%attr(0775,root,root)'
if (stream.match(/^%[\w]+/)) {
if (stream.match(/^\(/)) {
state.macroParameters = true;
}
return "macro";
}
if (state.macroParameters) {
if (stream.match(/^\d+/)) {
return "number";
}
if (stream.match(/^\)/)) {
state.macroParameters = false;
return "macro";
}
}
if (stream.match(/^%\{\??[\w \-]+\}/)) {
return "macro";
} // Macros like '%{defined fedora}'
//TODO: Include bash script sub-parser (CodeMirror supports that)
stream.next();
return null;
}
};
});
CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
});
|
/**
* Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
describe('OC.SetupChecks tests', function() {
var suite = this;
var protocolStub;
beforeEach( function(){
protocolStub = sinon.stub(OC, 'getProtocol');
suite.server = sinon.fakeServer.create();
});
afterEach( function(){
suite.server.restore();
protocolStub.restore();
});
describe('checkWebDAV', function() {
it('should fail with another response status code than 201 or 207', function(done) {
var async = OC.SetupChecks.checkWebDAV();
suite.server.requests[0].respond(200);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken.',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}]);
done();
});
});
it('should return no error with a response status code of 207', function(done) {
var async = OC.SetupChecks.checkWebDAV();
suite.server.requests[0].respond(207);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return no error with a response status code of 401', function(done) {
var async = OC.SetupChecks.checkWebDAV();
suite.server.requests[0].respond(401);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
});
describe('checkWellKnownUrl', function() {
it('should fail with another response status code than 207', function(done) {
var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', true);
suite.server.requests[0].respond(200);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Your web server is not set up properly to resolve "/.well-known/caldav/". Further information can be found in our <a target="_blank" rel="noreferrer" href="http://example.org/admin-setup-well-known-URL">documentation</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_INFO
}]);
done();
});
});
it('should return no error with a response status code of 207', function(done) {
var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', true);
suite.server.requests[0].respond(207);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return no error when no check should be run', function(done) {
var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', false);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
});
describe('checkDataProtected', function() {
oc_dataURL = "data";
it('should return an error if data directory is not protected', function(done) {
var async = OC.SetupChecks.checkDataProtected();
suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '*cough*HTACCESSFAIL*cough*');
async.done(function( data, s, x ){
expect(data).toEqual([
{
msg: 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}]);
done();
});
});
it('should not return an error if data directory is protected', function(done) {
var async = OC.SetupChecks.checkDataProtected();
suite.server.requests[0].respond(403);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should not return an error if data directory is protected and redirects to main page', function(done) {
var async = OC.SetupChecks.checkDataProtected();
suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '<html><body>blah</body></html>');
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return an error if data directory is a boolean', function(done) {
oc_dataURL = false;
var async = OC.SetupChecks.checkDataProtected();
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
});
describe('checkSetup', function() {
it('should return an error if server has no internet connection', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json'
},
JSON.stringify({
isUrandomAvailable: true,
serverHasInternetConnection: false,
memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance',
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([
{
msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target="_blank" rel="noreferrer" href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_INFO
}]);
done();
});
});
it('should return an error if server has no internet connection and data directory is not protected', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json'
},
JSON.stringify({
isUrandomAvailable: true,
serverHasInternetConnection: false,
memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance',
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([
{
msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
},
{
msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target="_blank" rel="noreferrer" href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_INFO
}]);
done();
});
});
it('should return an error if server has no internet connection and data directory is not protected and memcache is available', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
},
JSON.stringify({
isUrandomAvailable: true,
serverHasInternetConnection: false,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([
{
msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}
]);
done();
});
});
it('should return an error if /dev/urandom is not accessible', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
},
JSON.stringify({
isUrandomAvailable: false,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a target="_blank" rel="noreferrer" href="https://docs.owncloud.org/myDocs.html">documentation</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return an error if the wrong memcache PHP module is installed', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
},
JSON.stringify({
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: false,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a target="_blank" rel="noreferrer" href="https://code.google.com/p/memcached/wiki/PHPClientComparison">memcached wiki about both modules</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return an error if the forwarded for headers are not working', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
},
JSON.stringify({
isUrandomAvailable: true,
serverHasInternetConnection: true,
isMemcacheConfigured: true,
forwardedForHeadersWorking: false,
reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'The reverse proxy headers configuration is incorrect, or you are accessing ownCloud from a trusted proxy. If you are not accessing ownCloud from a trusted proxy, this is a security issue and can allow an attacker to spoof their IP address as visible to ownCloud. Further information can be found in our <a target="_blank" rel="noreferrer" href="https://docs.owncloud.org/foo/bar.html">documentation</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return an error if the response has no statuscode 200', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
500,
{
'Content-Type': 'application/json'
},
JSON.stringify({data: {serverHasInternetConnection: false}})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Error occurred while checking server setup',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}]);
done();
});
});
it('should return an error if the php version is no longer supported', function(done) {
var async = OC.SetupChecks.checkSetup();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
},
JSON.stringify({
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
phpSupported: {eol: true, version: '5.4.0'},
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'You are currently running PHP 5.4.0. We encourage you to upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer" href="https://secure.php.net/supported-versions.php">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.',
type: OC.SetupChecks.MESSAGE_TYPE_INFO
}]);
done();
});
});
});
describe('checkGeneric', function() {
it('should return an error if the response has no statuscode 200', function(done) {
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(
500,
{
'Content-Type': 'application/json'
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Error occurred while checking server setup',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
},{
msg: 'Error occurred while checking server setup',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}]);
done();
});
});
it('should return all errors if all headers are missing', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(
200,
{
'Content-Type': 'application/json',
'Strict-Transport-Security': 'max-age=15768000'
}
);
async.done(function( data, s, x ){
expect(data).toEqual([
{
msg: 'The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'The "X-Robots-Tag" HTTP header is not configured to equal to "none". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'The "X-Download-Options" HTTP header is not configured to equal to "noopen". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}, {
msg: 'The "X-Permitted-Cross-Domain-Policies" HTTP header is not configured to equal to "none". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
},
]);
done();
});
});
it('should return only some errors if just some headers are missing', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(
200,
{
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'Strict-Transport-Security': 'max-age=15768000;preload',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING,
}, {
msg: 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return none errors if all headers are there', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(
200,
{
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'Strict-Transport-Security': 'max-age=15768000',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
});
it('should return a SSL warning if HTTPS is not used', function(done) {
protocolStub.returns('http');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200,
{
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href="">security tips</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return an error if the response has no statuscode 200', function(done) {
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(
500,
{
'Content-Type': 'application/json'
},
JSON.stringify({data: {serverHasInternetConnection: false}})
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Error occurred while checking server setup',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}, {
msg: 'Error occurred while checking server setup',
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
}]);
done();
});
});
it('should return a SSL warning if SSL used without Strict-Transport-Security-Header', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200,
{
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="" rel="noreferrer">security tips</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return a SSL warning if SSL used with to small Strict-Transport-Security-Header', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200,
{
'Strict-Transport-Security': 'max-age=15551999',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="" rel="noreferrer">security tips</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return a SSL warning if SSL used with to a bogus Strict-Transport-Security-Header', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200,
{
'Strict-Transport-Security': 'iAmABogusHeader342',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
}
);
async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="" rel="noreferrer">security tips</a>.',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});
it('should return no SSL warning if SSL used with to exact the minimum Strict-Transport-Security-Header', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200, {
'Strict-Transport-Security': 'max-age=15768000',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
});
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return no SSL warning if SSL used with to more than the minimum Strict-Transport-Security-Header', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200, {
'Strict-Transport-Security': 'max-age=99999999',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
});
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return no SSL warning if SSL used with to more than the minimum Strict-Transport-Security-Header and includeSubDomains parameter', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200, {
'Strict-Transport-Security': 'max-age=99999999; includeSubDomains',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
});
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
it('should return no SSL warning if SSL used with to more than the minimum Strict-Transport-Security-Header and includeSubDomains and preload parameter', function(done) {
protocolStub.returns('https');
var async = OC.SetupChecks.checkGeneric();
suite.server.requests[0].respond(200, {
'Strict-Transport-Security': 'max-age=99999999; preload; includeSubDomains',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Robots-Tag': 'none',
'X-Frame-Options': 'SAMEORIGIN',
'X-Download-Options': 'noopen',
'X-Permitted-Cross-Domain-Policies': 'none',
});
async.done(function( data, s, x ){
expect(data).toEqual([]);
done();
});
});
});
|
define(function () {
return {
currentDate: function () {
var date = new Date();
var dd = date.getDate();
var mm = date.getMonth() + 1;
var yyyy = date.getFullYear();
var hh = date.getHours();
var MM = date.getMinutes();
var ss = date.getSeconds();
return (hh < 10 ? '0' + hh : hh) + ':' + (MM < 10 ? '0' + MM : MM) + ':' + (ss < 10 ? '0' + ss : ss) + ' ' + (dd < 10 ? '0' + dd : dd) + '.' + (mm < 10 ? '0' + mm : mm) + '.' + yyyy;
}
}
});
String.prototype.format = function () {
var formatted = this;
for (var i = 0; i < arguments.length; i++) {
var regexp = new RegExp('\\{' + i + '\\}', 'gi');
formatted = formatted.replace(regexp, arguments[i]);
}
return formatted;
};
|
function checkPassword(str)
{
var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/;
return re.test(str);
}
function checkForm(form)
{
if(form.gyear.value == "") {
alert("Error: Graduation cannot be blank!");
form.gyear.focus();
return false;
}
if(form.password1.value != "" && form.password2.value == form.password1.value) {
if(!checkPassword(form.password1.value)) {
alert("The password you have entered is not valid! You need 8 characters, with at least one capital letter, one lowercase letter, one number, and one special character.");
form.password1.focus();
return false;
}
} else {
alert("Error: Please check that your passwords match");
form.password1.focus();
return false;
}
return true;
}
|
var config = {};
config.cmdbUrl = 'http://10.1.15.27:5000';
// config.cmdbUrl = 'http://test-cmdb.ippjr-inc.net';
// config.cmdbUrl = 'http://127.0.0.1:5000';
config.deployUrl = 'http://10.1.15.59:5010';
config.oauthUrl = 'http://test-oauth.ippjr-inc.net';
//config.oauthUrl = 'http://10.1.60.59:5000';
|
import defaultMember from "a";
import * as name from "b";
import { member } from "c";
import { member as alias } from "d";
import { member1 , member2 } from "e";
import { member1 , member2 as alias2 } from "f";
import defaultMember, { member } from "g";
import defaultMember, * as name from "h";
import "i";
|
// vim:softtabstop=4:shiftwidth=4
"use strict";
var Util = require('../shared/util');
var _parent = Util.Base.prototype;
var Base = Util.extend(Util.Base, {
properties: ['healingRate',
{field: '_entity', getter: true}
],
_strategies: null,
_strategy: null,
_healingRate: 15,
_counter: 0,
_onTick: function() {
var me = this;
if (me._healingRate > 0 && (me._counter % me._healingRate === 0)) {
me._entity.getStats().heal(1);
}
me._counter++;
},
create: function() {
var me = this;
_parent.create.apply(me, arguments);
me._strategies = {};
},
decorate: function(entity) {
var me = this;
me._entity = entity;
entity._brain = me;
entity.getBrain = function() {return this._brain;};
entity.attachListeners({
tick: me._onTick
}, me);
},
destroy: function() {
var me = this;
if (!me._entity) return;
me._entity.detachListeners({
tick: me._onTick
}, me);
me._entity._brain = null;
},
_decide: function(strategy) {
var me = this;
var action = strategy.decide();
if (action) {
me._entity.fireEvent('action', action);
}
},
_getStrategy: function() {
var me = this;
return me._strategy && me._strategies.hasOwnProperty(me._strategy) ? me._strategies[me._strategy] : null;
},
_setStrategy: function(strategy) {
var me = this;
me._strategy = strategy;
return me._getStrategy(strategy);
},
_addStrategy: function(strategy) {
var me = this;
me._strategies[strategy.type] = strategy;
}
});
module.exports = Base;
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.lang['is'] = {
undo :
{
redo : 'Hætta við afturköllun',
undo : 'Afturkalla'
},
toolbar :
{
toolbarCollapse : 'Collapse Toolbar',
toolbarExpand : 'Expand Toolbar',
toolbarGroups :
{
document : 'Document',
clipboard : 'Clipboard/Undo',
editing : 'Editing',
forms : 'Forms',
basicstyles : 'Basic Styles',
paragraph : 'Paragraph',
links : 'Links',
insert : 'Insert',
styles : 'Styles',
colors : 'Colors',
tools : 'Tools'
},
toolbars : 'Editor toolbars'
},
templates :
{
button : 'Sniðmát',
emptyListMsg : '(Ekkert sniðmát er skilgreint!)',
insertOption : 'Skipta út raunverulegu innihaldi',
options : 'Template Options',
selectPromptMsg : 'Veldu sniðmát til að opna í ritlinum.<br>(Núverandi innihald víkur fyrir því!):',
title : 'Innihaldssniðmát'
},
table :
{
border : 'Breidd ramma',
caption : 'Titill',
cell :
{
menu : 'Reitur',
insertBefore : 'Skjóta inn reiti fyrir aftan',
insertAfter : 'Skjóta inn reiti fyrir framan',
deleteCell : 'Fella reit',
merge : 'Sameina reiti',
mergeRight : 'Sameina til hægri',
mergeDown : 'Sameina niður á við',
splitHorizontal : 'Kljúfa reit lárétt',
splitVertical : 'Kljúfa reit lóðrétt',
title : 'Cell Properties',
cellType : 'Cell Type',
rowSpan : 'Rows Span',
colSpan : 'Columns Span',
wordWrap : 'Word Wrap',
hAlign : 'Horizontal Alignment',
vAlign : 'Vertical Alignment',
alignBaseline : 'Baseline',
bgColor : 'Background Color',
borderColor : 'Border Color',
data : 'Data',
header : 'Header',
yes : 'Yes',
no : 'No',
invalidWidth : 'Cell width must be a number.',
invalidHeight : 'Cell height must be a number.',
invalidRowSpan : 'Rows span must be a whole number.',
invalidColSpan : 'Columns span must be a whole number.',
chooseColor : 'Choose'
},
cellPad : 'Reitaspássía',
cellSpace : 'Bil milli reita',
column :
{
menu : 'Dálkur',
insertBefore : 'Skjóta inn dálki vinstra megin',
insertAfter : 'Skjóta inn dálki hægra megin',
deleteColumn : 'Fella dálk'
},
columns : 'Dálkar',
deleteTable : 'Fella töflu',
headers : 'Fyrirsagnir',
headersBoth : 'Hvort tveggja',
headersColumn : 'Fyrsti dálkur',
headersNone : 'Engar',
headersRow : 'Fyrsta röð',
invalidBorder : 'Border size must be a number.',
invalidCellPadding : 'Cell padding must be a positive number.',
invalidCellSpacing : 'Cell spacing must be a positive number.',
invalidCols : 'Number of columns must be a number greater than 0.',
invalidHeight : 'Table height must be a number.',
invalidRows : 'Number of rows must be a number greater than 0.',
invalidWidth : 'Table width must be a number.',
menu : 'Eigindi töflu',
row :
{
menu : 'Röð',
insertBefore : 'Skjóta inn röð fyrir ofan',
insertAfter : 'Skjóta inn röð fyrir neðan',
deleteRow : 'Eyða röð'
},
rows : 'Raðir',
summary : 'Áfram',
title : 'Eigindi töflu',
toolbar : 'Tafla',
widthPc : 'prósent',
widthPx : 'myndeindir',
widthUnit : 'width unit'
},
stylescombo :
{
label : 'Stílflokkur',
panelTitle : 'Formatting Styles',
panelTitle1 : 'Block Styles',
panelTitle2 : 'Inline Styles',
panelTitle3 : 'Object Styles'
},
specialchar :
{
options : 'Special Character Options',
title : 'Velja tákn',
toolbar : 'Setja inn merki'
},
sourcearea :
{
toolbar : 'Kóði'
},
smiley :
{
options : 'Smiley Options',
title : 'Velja svip',
toolbar : 'Svipur'
},
showblocks :
{
toolbar : 'Sýna blokkir'
},
selectall :
{
toolbar : 'Velja allt'
},
save :
{
toolbar : 'Vista'
},
removeformat :
{
toolbar : 'Fjarlægja snið'
},
print :
{
toolbar : 'Prenta'
},
preview :
{
preview : 'Forskoða'
},
pastetext :
{
button : 'Líma sem ósniðinn texta',
title : 'Líma sem ósniðinn texta'
},
pastefromword :
{
confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?',
error : 'It was not possible to clean up the pasted data due to an internal error',
title : 'Líma úr Word',
toolbar : 'Líma úr Word'
},
pagebreak :
{
alt : 'Page Break',
toolbar : 'Setja inn síðuskil'
},
newpage :
{
toolbar : 'Ný síða'
},
maximize :
{
maximize : 'Maximize',
minimize : 'Minimize'
},
magicline :
{
title : 'Insert paragraph here'
},
liststyle :
{
armenian : 'Armenian numbering',
bulletedTitle : 'Bulleted List Properties',
circle : 'Circle',
decimal : 'Decimal (1, 2, 3, etc.)',
decimalLeadingZero : 'Decimal leading zero (01, 02, 03, etc.)',
disc : 'Disc',
georgian : 'Georgian numbering (an, ban, gan, etc.)',
lowerAlpha : 'Lower Alpha (a, b, c, d, e, etc.)',
lowerGreek : 'Lower Greek (alpha, beta, gamma, etc.)',
lowerRoman : 'Lower Roman (i, ii, iii, iv, v, etc.)',
none : 'None',
notset : '<not set>',
numberedTitle : 'Numbered List Properties',
square : 'Square',
start : 'Start',
type : 'Type',
upperAlpha : 'Upper Alpha (A, B, C, D, E, etc.)',
upperRoman : 'Upper Roman (I, II, III, IV, V, etc.)',
validateStartNumber : 'List start number must be a whole number.'
},
list :
{
bulletedlist : 'Punktalisti',
numberedlist : 'Númeraður listi'
},
link :
{
acccessKey : 'Skammvalshnappur',
advanced : 'Tæknilegt',
advisoryContentType : 'Tegund innihalds',
advisoryTitle : 'Titill',
anchor :
{
toolbar : 'Stofna/breyta kaflamerki',
menu : 'Eigindi kaflamerkis',
title : 'Eigindi kaflamerkis',
name : 'Nafn bókamerkis',
errorName : 'Sláðu inn nafn bókamerkis!',
remove : 'Remove Anchor'
},
anchorId : 'Eftir auðkenni einingar',
anchorName : 'Eftir akkerisnafni',
charset : 'Táknróf',
cssClasses : 'Stílsniðsflokkur',
emailAddress : 'Netfang',
emailBody : 'Meginmál',
emailSubject : 'Efni',
id : 'Auðkenni',
info : 'Almennt',
langCode : 'Lesstefna',
langDir : 'Lesstefna',
langDirLTR : 'Frá vinstri til hægri (LTR)',
langDirRTL : 'Frá hægri til vinstri (RTL)',
menu : 'Breyta stiklu',
name : 'Nafn',
noAnchors : '<Engin bókamerki á skrá>',
noEmail : 'Sláðu inn netfang!',
noUrl : 'Sláðu inn veffang stiklunnar!',
other : '<annar>',
popupDependent : 'Háð venslum (Netscape)',
popupFeatures : 'Eigindi sprettiglugga',
popupFullScreen : 'Heilskjár (IE)',
popupLeft : 'Fjarlægð frá vinstri',
popupLocationBar : 'Fanglína',
popupMenuBar : 'Vallína',
popupResizable : 'Resizable',
popupScrollBars : 'Skrunstikur',
popupStatusBar : 'Stöðustika',
popupToolbar : 'Verkfærastika',
popupTop : 'Fjarlægð frá efri brún',
rel : 'Relationship',
selectAnchor : 'Veldu akkeri',
styles : 'Stíll',
tabIndex : 'Raðnúmer innsláttarreits',
target : 'Mark',
targetFrame : '<rammi>',
targetFrameName : 'Nafn markglugga',
targetPopup : '<sprettigluggi>',
targetPopupName : 'Nafn sprettiglugga',
title : 'Stikla',
toAnchor : 'Bókamerki á þessari síðu',
toEmail : 'Netfang',
toUrl : 'Vefslóð',
toolbar : 'Stofna/breyta stiklu',
type : 'Stikluflokkur',
unlink : 'Fjarlægja stiklu',
upload : 'Senda upp'
},
justify :
{
block : 'Jafna báðum megin',
center : 'Miðja texta',
left : 'Vinstrijöfnun',
right : 'Hægrijöfnun'
},
indent :
{
indent : 'Minnka inndrátt',
outdent : 'Auka inndrátt'
},
image :
{
alt : 'Baklægur texti',
border : 'Rammi',
btnUpload : 'Hlaða upp',
button2Img : 'Do you want to transform the selected image button on a simple image?',
hSpace : 'Vinstri bil',
img2Button : 'Do you want to transform the selected image on a image button?',
infoTab : 'Almennt',
linkTab : 'Stikla',
lockRatio : 'Festa stærðarhlutfall',
menu : 'Eigindi myndar',
resetSize : 'Reikna stærð',
title : 'Eigindi myndar',
titleButton : 'Eigindi myndahnapps',
upload : 'Hlaða upp',
urlMissing : 'Image source URL is missing.',
vSpace : 'Hægri bil',
validateBorder : 'Border must be a whole number.',
validateHSpace : 'HSpace must be a whole number.',
validateVSpace : 'VSpace must be a whole number.'
},
iframe :
{
border : 'Show frame border',
noUrl : 'Please type the iframe URL',
scrolling : 'Enable scrollbars',
title : 'IFrame Properties',
toolbar : 'IFrame'
},
horizontalrule :
{
toolbar : 'Lóðrétt lína'
},
forms :
{
button :
{
title : 'Eigindi hnapps',
text : 'Texti',
type : 'Gerð',
typeBtn : 'Hnappur',
typeSbm : 'Staðfesta',
typeRst : 'Hreinsa'
},
checkboxAndRadio :
{
checkboxTitle : 'Eigindi markreits',
radioTitle : 'Eigindi valhnapps',
value : 'Gildi',
selected : 'Valið',
required : 'Required'
},
form :
{
title : 'Eigindi innsláttarforms',
menu : 'Eigindi innsláttarforms',
action : 'Aðgerð',
method : 'Aðferð',
encoding : 'Encoding'
},
hidden :
{
title : 'Eigindi falins svæðis',
name : 'Nafn',
value : 'Gildi'
},
select :
{
title : 'Eigindi lista',
selectInfo : 'Upplýsingar',
opAvail : 'Kostir',
value : 'Gildi',
size : 'Stærð',
lines : 'línur',
chkMulti : 'Leyfa fleiri kosti',
required : 'Required',
opText : 'Texti',
opValue : 'Gildi',
btnAdd : 'Bæta við',
btnModify : 'Breyta',
btnUp : 'Upp',
btnDown : 'Niður',
btnSetValue : 'Merkja sem valið',
btnDelete : 'Eyða'
},
textarea :
{
title : 'Eigindi textasvæðis',
cols : 'Dálkar',
rows : 'Línur'
},
textfield :
{
title : 'Eigindi textareits',
name : 'Nafn',
value : 'Gildi',
charWidth : 'Breidd (leturtákn)',
maxChars : 'Hámarksfjöldi leturtákna',
required : 'Required',
type : 'Gerð',
typeText : 'Texti',
typePass : 'Lykilorð',
typeEmail : 'Email',
typeSearch : 'Search',
typeTel : 'Telephone Number',
typeUrl : 'Vefslóð'
}
},
format :
{
label : 'Stílsnið',
panelTitle : 'Stílsnið',
tag_address : 'Vistfang',
tag_div : 'Venjulegt (DIV)',
tag_h1 : 'Fyrirsögn 1',
tag_h2 : 'Fyrirsögn 2',
tag_h3 : 'Fyrirsögn 3',
tag_h4 : 'Fyrirsögn 4',
tag_h5 : 'Fyrirsögn 5',
tag_h6 : 'Fyrirsögn 6',
tag_p : 'Venjulegt letur',
tag_pre : 'Forsniðið'
},
font :
{
fontSize :
{
label : 'Leturstærð ',
voiceLabel : 'Font Size',
panelTitle : 'Leturstærð '
},
label : 'Leturgerð ',
panelTitle : 'Leturgerð ',
voiceLabel : 'Leturgerð '
},
flash :
{
access : 'Script Access',
accessAlways : 'Always',
accessNever : 'Never',
accessSameDomain : 'Same domain',
alignAbsBottom : 'Abs neðst',
alignAbsMiddle : 'Abs miðjuð',
alignBaseline : 'Grunnlína',
alignTextTop : 'Efri brún texta',
bgcolor : 'Bakgrunnslitur',
chkFull : 'Allow Fullscreen',
chkLoop : 'Endurtekning',
chkMenu : 'Sýna Flash-valmynd',
chkPlay : 'Sjálfvirk spilun',
flashvars : 'Variables for Flash',
hSpace : 'Vinstri bil',
properties : 'Eigindi Flash',
propertiesTab : 'Properties',
quality : 'Quality',
qualityAutoHigh : 'Auto High',
qualityAutoLow : 'Auto Low',
qualityBest : 'Best',
qualityHigh : 'High',
qualityLow : 'Low',
qualityMedium : 'Medium',
scale : 'Skali',
scaleAll : 'Sýna allt',
scaleFit : 'Fella skala að stærð',
scaleNoBorder : 'Án ramma',
title : 'Eigindi Flash',
vSpace : 'Hægri bil',
validateHSpace : 'HSpace must be a number.',
validateSrc : 'Sláðu inn veffang stiklunnar!',
validateVSpace : 'VSpace must be a number.',
windowMode : 'Window mode',
windowModeOpaque : 'Opaque',
windowModeTransparent : 'Transparent',
windowModeWindow : 'Window'
},
find :
{
find : 'Leita',
findOptions : 'Find Options',
findWhat : 'Leita að:',
matchCase : 'Gera greinarmun á¡ há¡- og lágstöfum',
matchCyclic : 'Match cyclic',
matchWord : 'Aðeins heil orð',
notFoundMsg : 'Leitartexti fannst ekki!',
replace : 'Skipta út',
replaceAll : 'Skipta út allsstaðar',
replaceSuccessMsg : '%1 occurrence(s) replaced.',
replaceWith : 'Skipta út fyrir:',
title : 'Finna og skipta'
},
fakeobjects :
{
anchor : 'Anchor',
flash : 'Flash Animation',
hiddenfield : 'Hidden Field',
iframe : 'IFrame',
unknown : 'Unknown Object'
},
elementspath :
{
eleLabel : 'Elements path',
eleTitle : '%1 element'
},
div :
{
IdInputLabel : 'Id',
advisoryTitleInputLabel : 'Advisory Title',
cssClassInputLabel : 'Stylesheet Classes',
edit : 'Edit Div',
inlineStyleInputLabel : 'Inline Style',
langDirLTRLabel : 'Left to Right (LTR)',
langDirLabel : 'Language Direction',
langDirRTLLabel : 'Right to Left (RTL)',
languageCodeInputLabel : ' Language Code',
remove : 'Remove Div',
styleSelectLabel : 'Style',
title : 'Create Div Container',
toolbar : 'Create Div Container'
},
contextmenu :
{
options : 'Context Menu Options'
},
colordialog :
{
clear : 'Clear',
highlight : 'Highlight',
options : 'Color Options',
selected : 'Selected Color',
title : 'Select color'
},
colorbutton :
{
auto : 'Sjálfval',
bgColorTitle : 'Bakgrunnslitur',
colors :
{
'000' : 'Black',
'800000' : 'Maroon',
'8B4513' : 'Saddle Brown',
'2F4F4F' : 'Dark Slate Gray',
'008080' : 'Teal',
'000080' : 'Navy',
'4B0082' : 'Indigo',
'696969' : 'Dark Gray',
B22222 : 'Fire Brick',
A52A2A : 'Brown',
DAA520 : 'Golden Rod',
'006400' : 'Dark Green',
'40E0D0' : 'Turquoise',
'0000CD' : 'Medium Blue',
'800080' : 'Purple',
'808080' : 'Gray',
F00 : 'Red',
FF8C00 : 'Dark Orange',
FFD700 : 'Gold',
'008000' : 'Green',
'0FF' : 'Cyan',
'00F' : 'Blue',
EE82EE : 'Violet',
A9A9A9 : 'Dim Gray',
FFA07A : 'Light Salmon',
FFA500 : 'Orange',
FFFF00 : 'Yellow',
'00FF00' : 'Lime',
AFEEEE : 'Pale Turquoise',
ADD8E6 : 'Light Blue',
DDA0DD : 'Plum',
D3D3D3 : 'Light Grey',
FFF0F5 : 'Lavender Blush',
FAEBD7 : 'Antique White',
FFFFE0 : 'Light Yellow',
F0FFF0 : 'Honeydew',
F0FFFF : 'Azure',
F0F8FF : 'Alice Blue',
E6E6FA : 'Lavender',
FFF : 'White'
},
more : 'Fleiri liti...',
panelTitle : 'Colors',
textColorTitle : 'Litur texta'
},
clipboard :
{
copy : 'Afrita',
copyError : 'Öryggisstillingar vafrans þíns leyfa ekki afritun texta með músaraðgerð. Notaðu lyklaborðið í afrita (Ctrl/Cmd+C).',
cut : 'Klippa',
cutError : 'Öryggisstillingar vafrans þíns leyfa ekki klippingu texta með músaraðgerð. Notaðu lyklaborðið í klippa (Ctrl/Cmd+X).',
paste : 'Líma',
pasteArea : 'Paste Area',
pasteMsg : 'Límdu í svæðið hér að neðan og (<STRONG>Ctrl/Cmd+V</STRONG>) og smelltu á <STRONG>OK</STRONG>.',
securityMsg : 'Vegna öryggisstillinga í vafranum þínum fær ritillinn ekki beinan aðgang að klippuborðinu. Þú verður að líma innihaldið aftur inn í þennan glugga.',
title : 'Líma'
},
button :
{
selectedLabel : '%1 (Selected)'
},
blockquote :
{
toolbar : 'Inndráttur'
},
bidi :
{
ltr : 'Text direction from left to right',
rtl : 'Text direction from right to left'
},
basicstyles :
{
bold : 'Feitletrað',
italic : 'Skáletrað',
strike : 'Yfirstrikað',
subscript : 'Niðurskrifað',
superscript : 'Uppskrifað',
underline : 'Undirstrikað'
},
about :
{
copy : 'Copyright © $1. All rights reserved.',
dlgTitle : 'About CKEditor',
help : 'Check $1 for help.',
moreInfo : 'For licensing information please visit our web site:',
title : 'About CKEditor',
userGuide : 'CKEditor User\'s Guide'
},
editor : 'Rich Text Editor',
editorPanel : 'Rich Text Editor panel',
common :
{
editorHelp : 'Press ALT 0 for help',
browseServer : 'Fletta í skjalasafni',
url : 'Vefslóð',
protocol : 'Samskiptastaðall',
upload : 'Senda upp',
uploadSubmit : 'Hlaða upp',
image : 'Setja inn mynd',
flash : 'Flash',
form : 'Setja inn innsláttarform',
checkbox : 'Setja inn hökunarreit',
radio : 'Setja inn valhnapp',
textField : 'Setja inn textareit',
textarea : 'Setja inn textasvæði',
hiddenField : 'Setja inn falið svæði',
button : 'Setja inn hnapp',
select : 'Setja inn lista',
imageButton : 'Setja inn myndahnapp',
notSet : '<ekkert valið>',
id : 'Auðkenni',
name : 'Nafn',
langDir : 'Lesstefna',
langDirLtr : 'Frá vinstri til hægri (LTR)',
langDirRtl : 'Frá hægri til vinstri (RTL)',
langCode : 'Tungumálakóði',
longDescr : 'Nánari lýsing',
cssClass : 'Stílsniðsflokkur',
advisoryTitle : 'Titill',
cssStyle : 'Stíll',
ok : 'Í lagi',
cancel : 'Hætta við',
close : 'Close',
preview : 'Forskoða',
resize : 'Resize',
generalTab : 'Almennt',
advancedTab : 'Tæknilegt',
validateNumberFailed : 'This value is not a number.',
confirmNewPage : 'Any unsaved changes to this content will be lost. Are you sure you want to load new page?',
confirmCancel : 'You have changed some options. Are you sure you want to close the dialog window?',
options : 'Options',
target : 'Mark',
targetNew : 'New Window (_blank)',
targetTop : 'Topmost Window (_top)',
targetSelf : 'Same Window (_self)',
targetParent : 'Parent Window (_parent)',
langDirLTR : 'Frá vinstri til hægri (LTR)',
langDirRTL : 'Frá hægri til vinstri (RTL)',
styles : 'Stíll',
cssClasses : 'Stílsniðsflokkur',
width : 'Breidd',
height : 'Hæð',
align : 'Jöfnun',
alignLeft : 'Vinstri',
alignRight : 'Hægri',
alignCenter : 'Miðjað',
alignJustify : 'Jafna báðum megin',
alignTop : 'Efst',
alignMiddle : 'Miðjuð',
alignBottom : 'Neðst',
alignNone : 'None',
invalidValue : 'Invalid value.',
invalidHeight : 'Height must be a number.',
invalidWidth : 'Width must be a number.',
invalidCssLength : 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).',
invalidHtmlLength : 'Value specified for the "%1" field must be a positive number with or without a valid HTML measurement unit (px or %).',
invalidInlineStyle : 'Value specified for the inline style must consist of one or more tuples with the format of "name : value", separated by semi-colons.',
cssLengthTooltip : 'Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).',
unavailable : '%1<span class="cke_accessibility">, unavailable</span>'
} };
|
// Here is the core script file.
(function(){
})();
|
import UIComponent from './UIComponent';
import { debounce } from 'lib/util';
export default function Image(spec, def) {
let self = new UIComponent(spec, def);
let {src='imageBackground'} = def;
self.anchorObject=self.add(spec.game.add.image(0, 0, 'core', src));
if (def.onClicked) {
self.anchorObject.inputEnabled=true;
self.anchorObject.events.onInputUp.add(debounce(def.onClicked,UIComponent.INPUTEVENT_DEBOUNCE_INTERVAL,true));
}
return self;
}
|
angular.module('dedSearch').component('dedSearch', {
templateUrl: 'ded-search/ded-search.template.html',
controller: dedSearchController
}).filter('searchId', function(){
return function (v, query) {
return v.filter(function (i) {
return i.manId.indexOf(query) > -1;
});
};
});
dedSearchController.$inject = ['getJSON', '$scope'];
function dedSearchController(getJSON, $scope) {
var self = this;
self.searchId = 'dd';
self.jsonList = [];
alert($scope.searchId);
getJSON.then(function(response){
self.jsonList = response.data;
});
}
|
import {ordinal} from './const.js';
import {cons} from './list.js';
/* c8 ignore next */
var captureStackTrace = Error.captureStackTrace || captureStackTraceFallback;
var _debug = debugHandleNone;
export {captureStackTrace};
export function debugMode(debug){
_debug = debug ? debugHandleAll : debugHandleNone;
}
export function debugHandleNone(x){
return x;
}
export function debugHandleAll(x, fn, a, b, c){
return fn(a, b, c);
}
export function debug(x, fn, a, b, c){
return _debug(x, fn, a, b, c);
}
export function captureContext(previous, tag, fn){
return debug(previous, debugCaptureContext, previous, tag, fn);
}
export function debugCaptureContext(previous, tag, fn){
var context = {tag: tag, name: ' from ' + tag + ':'};
captureStackTrace(context, fn);
return cons(context, previous);
}
export function captureApplicationContext(context, n, f){
return debug(context, debugCaptureApplicationContext, context, n, f);
}
export function debugCaptureApplicationContext(context, n, f){
return debugCaptureContext(context, ordinal[n - 1] + ' application of ' + f.name, f);
}
export function captureStackTraceFallback(x){
var e = new Error;
if(typeof e.stack === 'string'){
x.stack = x.name + '\n' + e.stack.split('\n').slice(1).join('\n');
/* c8 ignore next 3 */
}else{
x.stack = x.name;
}
}
|
import mongoose from 'mongoose'
import crypto from 'crypto'
import ExtError from '../errors';
import Post from './post';
import Token from './token';
const schema = mongoose.Schema({
_id: {
type: mongoose.Schema.Types.ObjectId,
'default': function () {
return new mongoose.Types.ObjectId
}
},
login: {
type: String,
unique: false,
required: true
},
email: {
type: String,
unique: true,
required: true
},
hashedPassword: {
type: String,
required: true
},
salt: {
type: String,
required: true
},
tokens: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Token'}],
created: {
type: Date,
default: Date.now
}
});
schema.methods.encryptPassword = function(password) {
return crypto.createHmac('sha1', this.salt).update(password).digest('hex');
};
schema.virtual('password')
.set(function(password) {
this._plainPassword = password;
this.salt = Math.random() + '';
this.hashedPassword = this.encryptPassword(password);
})
.get(function() { return this._plainPassword; });
schema.statics.authorize = function(username, password) {
return new Promise((resolve, reject) => {
User.findOne({login: username}).then(
user => {
if (user && user.checkPassword(password)) {
resolve(user);
}
reject(new AuthError(400, 'Invalid user'));
}, error => {
reject(error);
}
);
});
};
schema.methods.checkPassword = function(password) {
return this.encryptPassword(password) === this.hashedPassword;
};
schema.statics.isAdmin = function (user) {
return (user && user.login === 'admin');
};
schema.statics.addUser = (data) => {
const user = new User({...data});
return new Promise((resolve, reject) => {
user.save().then(user => {
resolve(user);
}, error => {
if (error.code === 11000 ) {
reject(new AuthError('User already exusts'));
}
reject(error);
});
});
};
schema.statics.getUserByEmailOrLogin = function(email, login) {
return User.findOne({
$or: [
{ email: email },
{ login: login }
]
})
};
const User = mongoose.model('user', schema);
export default User;
class UserAuthError extends ExtError {
constructor(code, message) {
super(code, message);
}
}
export const AuthError = UserAuthError;
|
var searchData=
[
['e',['E',['../class_tile.html#af8130191ee5d094e7505fd26f676393c',1,'Tile']]],
['element',['element',['../class_attack.html#a0910777fac28d0a017e5ab7d976984fb',1,'Attack']]],
['enemies',['enemies',['../class_game_state.html#a5a075a4ab1460fb1035c6b87c56e6c05',1,'GameState']]],
['eventtick',['eventTick',['../class_game_state.html#a27785a1da6711d7ec2d777bd029830b9',1,'GameState']]]
];
|
'use strict';
/**
* @ngdoc function
* @name lifeMonitorDoctorApp.controller:patientCtrl
* @description
* # patientCtrl
* Controller of the lifeMonitorDoctorApp
*/
app.controller('patientCtrl', ['$rootScope', '$scope', '$stateParams', '$state', 'Patients', function ($rootScope, $scope, $stateParams, $state, Patients){
// For nav redirections
$scope.$state = $state;
$scope.$stateParams = $stateParams;
$rootScope.loading = [true,true];
$scope.patient = null;
$scope.loadPatient = function() {
Patients.getPatient($stateParams.id).then(
// OK
function(patient){
$scope.patient = patient ;
$rootScope.loading[0] = false;
},
// ERROR
function(msg){
alert('Error in loadPatient(' + $stateParams.id + ') method');
}
);
};
$scope.loadPatient();
}]);
|
// disable-eslint
/* eslint-disable */
const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const imimage = require('./imimage');
const getConfig = require('../../../configs').getGlobalDbConfig;
const db = {};
const env = process.env.NODE_ENV || 'development';
const getDb = () =>{
const config = getConfig()[env];
if (config.use_env_variable) {
var sequelize = new Sequelize(process.env[config.use_env_variable]);
} else {
var sequelize = new Sequelize(config.database, config.username, config.password, config);
}
const imimageModel = imimage(sequelize, Sequelize);
db[imimageModel.name] = imimageModel;
Object.keys(db).forEach((modelName) => {
if (db[modelName].associate) {
db[modelName].associate(db);
}
});
db.sequelize = sequelize;
db.Sequelize = Sequelize;
return db;
}
module.exports = getDb;
|
'use strict';
const Game = require('../../lib/game');
describe('Game', () => {
describe('#extraTurn', () => {
it('should return true if the value is 4', () => {
expect(Game.extraTurn(4)).toBe(true);
});
it('should return true if the value is 6', () => {
expect(Game.extraTurn(6)).toBe(true);
});
it('should return false is the value is not 4 or 6', () => {
expect(Game.extraTurn(0)).toBe(false);
expect(Game.extraTurn(1)).toBe(false);
expect(Game.extraTurn(2)).toBe(false);
expect(Game.extraTurn(3)).toBe(false);
expect(Game.extraTurn(5)).toBe(false);
expect(Game.extraTurn(7)).toBe(false);
});
})
});
|
const h = require('react').createElement
const { mount, configure } = require('enzyme')
const ReactAdapter = require('enzyme-adapter-react-16')
const Uppy = require('@uppy/core')
beforeAll(() => {
configure({ adapter: new ReactAdapter() })
})
jest.mock('@uppy/file-input', () => require('./__mocks__/FileInputPlugin'))
const FileInput = require('./FileInput')
describe('react <FileInput />', () => {
it('can be mounted and unmounted', () => {
const oninstall = jest.fn()
const onuninstall = jest.fn()
const uppy = new Uppy()
const input = mount((
<FileInput
uppy={uppy}
onInstall={oninstall}
onUninstall={onuninstall}
/>
))
expect(oninstall).toHaveBeenCalled()
expect(onuninstall).not.toHaveBeenCalled()
input.unmount()
expect(oninstall).toHaveBeenCalled()
expect(onuninstall).toHaveBeenCalled()
})
})
|
(function() {
var ObjectWrapper = window.ObjectWrapper.noConflict();
var data = ObjectWrapper({
name: {
first: "",
last: ""
},
sex: "male",
age: "25",
interest: []
});
//use cookie for storage
var storage = {
get: function(key) {
var cookies = document.cookie.split(';');
var key = key + "=";
for(var i = 0; i <cookies.length; i++) {
var cookie = cookies[i];
while (cookie.charAt(0)==' ') {
cookie = cookie.substring(1);
}
if (cookie.indexOf(key) == 0) {
return cookie.substring(key.length, cookie.length);
}
}
return "";
},
set : function(key, value) {
var expires = new Date();
expires.setTime(expires.getTime() + (24*60*60*1000));
document.cookie = key + "=" + value + "; " + "expires=" + expires.toUTCString();
}
}
loadData();
bindFormEvent();
function bindFormEvent() {
data.forEachAll(function(key, value, path) {
var snapKey = this.snapKey(path, key);
var elements = [].concat(document.getElementById(snapKey)
|| [].slice.call(document.getElementsByName(snapKey)));
for(var i=0;i<elements.length;i++) {
elements[i].onchange = function() {
onChangeForm.call(this, key, path);
};
}
});
document.getElementById("save").onclick = function() {
saveData();
setButtonDisable(true);
}
document.getElementById("reset").onclick = function() {
data.restore();
loadData();
setButtonDisable(true);
}
}
function onChangeForm(key, path) {
var value = data.get(path).get(key);
if(this.type === "checkbox") {
if(!(value instanceof Array)) value = [].concat(value);
if(this.checked) value.push(this.value);
else {
var index = value.indexOf(this.value);
if(index >= 0) value.splice(index, 1);
}
}
else value = this.value;
data.get(path).set(key, value);
setButtonDisable(!data.changed());
}
function setButtonDisable(disabled) {
document.getElementById("save").disabled = disabled;
document.getElementById("reset").disabled = disabled;
}
function setForm(id, value) {
var element = document.getElementById(id) || document.getElementsByName(id);
if(element.length) {
for(var i=0;i<element.length;i++) {
element[i].checked = value instanceof Array
? value.indexOf(element[i].value) >= 0
: element[i].value === value;
}
}
else element.value = value;
}
function loadData() {
data.forEachAll(function(key, value, path) {
var snapKey = this.snapKey(path, key);
var storeValue = storage.get(snapKey);
if(storeValue !== "") {
if(value instanceof Array) {
storeValue = storeValue.split(",");
}
this.get(path).set(key, storeValue)
}
setForm(snapKey, storeValue || value);
});
data.snapshot();
}
function saveData() {
data.changed(function(key, current, before, path) {
var snapKey = this.snapKey(path, key);
storage.set(snapKey, current);
});
data.snapshot();
}
})();
|
import { getWindow, getDocument } from 'ssr-window';
import $ from '../../shared/dom.js';
import { now } from '../../shared/utils.js';
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
function closestElement(selector, base = this) {
function __closestFrom(el) {
if (!el || el === getDocument() || el === getWindow()) return null;
if (el.assignedSlot) el = el.assignedSlot;
const found = el.closest(selector);
return found || __closestFrom(el.getRootNode().host);
}
return __closestFrom(base);
}
export default function onTouchStart(event) {
const swiper = this;
const document = getDocument();
const window = getWindow();
const data = swiper.touchEventsData;
const { params, touches, enabled } = swiper;
if (!enabled) return;
if (swiper.animating && params.preventInteractionOnTransition) {
return;
}
if (!swiper.animating && params.cssMode && params.loop) {
swiper.loopFix();
}
let e = event;
if (e.originalEvent) e = e.originalEvent;
let $targetEl = $(e.target);
if (params.touchEventsTarget === 'wrapper') {
if (!$targetEl.closest(swiper.wrapperEl).length) return;
}
data.isTouchEvent = e.type === 'touchstart';
if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
if (data.isTouched && data.isMoved) return;
// change target el for shadow root component
const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) {
$targetEl = $(event.path[0]);
}
const noSwipingSelector = params.noSwipingSelector
? params.noSwipingSelector
: `.${params.noSwipingClass}`;
const isTargetShadow = !!(e.target && e.target.shadowRoot);
// use closestElement for shadow root element to get the actual closest for nested shadow root element
if (
params.noSwiping &&
(isTargetShadow
? closestElement(noSwipingSelector, e.target)
: $targetEl.closest(noSwipingSelector)[0])
) {
swiper.allowClick = true;
return;
}
if (params.swipeHandler) {
if (!$targetEl.closest(params.swipeHandler)[0]) return;
}
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
const startX = touches.currentX;
const startY = touches.currentY;
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
if (
edgeSwipeDetection &&
(startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)
) {
if (edgeSwipeDetection === 'prevent') {
event.preventDefault();
} else {
return;
}
}
Object.assign(data, {
isTouched: true,
isMoved: false,
allowTouchCallbacks: true,
isScrolling: undefined,
startMoving: undefined,
});
touches.startX = startX;
touches.startY = startY;
data.touchStartTime = now();
swiper.allowClick = true;
swiper.updateSize();
swiper.swipeDirection = undefined;
if (params.threshold > 0) data.allowThresholdMove = false;
if (e.type !== 'touchstart') {
let preventDefault = true;
if ($targetEl.is(data.focusableElements)) preventDefault = false;
if (
document.activeElement &&
$(document.activeElement).is(data.focusableElements) &&
document.activeElement !== $targetEl[0]
) {
document.activeElement.blur();
}
const shouldPreventDefault =
preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
if (
(params.touchStartForcePreventDefault || shouldPreventDefault) &&
!$targetEl[0].isContentEditable
) {
e.preventDefault();
}
}
swiper.emit('touchStart', e);
}
|
/**
* @name Array
* @description 基础Array兼容,扩展一些常用方法
* @class LArray
* @type {Object}
* @requires Lass
*/
// javascript 1.6 indexOf lastIndexOf | every filter forEach map some
// javascript 1.8 reduce reduceRight
// javascript 1.8.5 isArray
// other clean, contains, getLast, empty, distinct
// ECMA6 of, entries, find, findIndex, keys, toSource
;void function() {
'use strict';
var LArray = /** @lends LArray.prototype */{
/**
* 判断一个对象是否为数组,如果是,则返回true,否则返回false. version(1.8.5)
* @type {Function}
* @param {Object} array
* @return {Boolean}
*/
isArray : function(array) {},
/**
* 查找元素在数组中出现的位置 找到返回对应的索引,找不到返回-1. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Object} searchElement
* @param {Number} [formIndex] 开始查找的初始位置
* @return {Number}
*/
indexOf : function(array, searchElement, fromIndex) {},
/**
* 返回指定项最后一次出现的索引,找不到返回-1. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Object} searchElement
* @param {Number} [fromIndex] 可选的整数参数。规定在字符串中开始检索的位置。它的合法取值是 0 到 stringObject.length - 1。如省略该参数,则将从字符串的最后一个字符处开始检索。
*/
lastIndexOf : function(array, searchElement, fromIndex) {},
/**
* 遍历array 中所有元素,并执行callback函数. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Function} callback (item, index, array)
* @param {Object} [thisArg] 在执行callback函数时指定的this值.
* @return {Boolean}
*/
every : function(array, callback, thisArg) {},
/**
* 过滤数组中的元素,根据callback计算返回boolean类型. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Function} callback (item, index, array)
* @param {Object} [thisArg] 在执行callback函数时指定的this值.
* @return {Array}
*/
filter : function(array, callback, thisArg) {},
/**
* forEach 不解释. version(1.6)
* @type {Function}
* @param {Array} arr 遍历的数组对象
* @param {Function} callback 为每个数组元素执行的函数.
* @param {Object} [thisArg] 在执行callback函数时指定的this值.
* 如果 thisArg参数被提供,它将作为callback函数的执行上下文,类似执行如下函数callback.call(thisArg, element, index, array)。
* 如果thisArg是 undefined 或 null,函数的 this 值取决于函数是否在严格模式(严格模式下为空,非严格模式下为全局对象)。
*/
forEach : function(array, callback, thisArg) {},
/**
* 对数组中的所有数据执行callback函数并返回新的数组. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Function} callback(item, index, array)
* @param {Object} [thisArg] 在执行callback函数时指定的this值.
* @return {Array}
*/
map : function(array, callback, thisArg) {},
/**
* 判断数组中是否有部分是成立的 即 callback返回是否存在为true的值,存在返回true 否则false. version(1.6)
* @type {Function}
* @param {Array} array
* @param {Function} callback(item, index, array)
* @param {Object} [thisArg] 在执行callback函数时指定的this值.
* @return {Boolean}
*/
some : function(array, callback, thisArg) {},
/**
* 递归遍历数组中的元素,并执行callback. version(1.8)
* @type {Function}
* @param {Function} callback (previousValue(累加值), currentValue(当前数组的值), index(索引), array)
* @param {String} [initialValue] 递归初始值
*/
reduce : function(array, callback, initialValue) {},
/**
* 递归遍历数组中的元素,并执行callback. 与reduce相反,reduce 从 0 ~ length-1, reduceRight 从 length-1 ~ 0. version(1.8)
* @type {Function}
* @param {Function} callback (previousValue(累加值), currentValue(当前数组的值), index(索引), array)
* @param {String} [initialValue] 递归初始值
*/
reduceRight : function(array, callback, initialValue) {},
/**
* 根据传入参数创建新数组. version(ECMA6)
* @param [item,..] 多个元素
* @type {Function}
*/
of : function() {},
// other
/**
* 返回一个由原数组中计算值为true(即不是以下情况的值: null, undefined, zero, false, 或 "")的项
* @type {Function}
* @param {Array} array
* @return {Array}
*/
clean : function(array) {},
/**
* 测试指定项是否在数组中存在
* @param {Array} array
* @param {Object} item 要进行测试的项
* @param {Number} [fromIndex] 可选: 默认值为0 在数组中开始搜索的起始位索引
* @return {Boolean}
*/
contains : function(array, item, fromIndex) {},
/**
* 获取数组最后一项的值,如果数组为空,则返回null
* @param {Array} array
* @return {Object}
*/
getLast : function(array) {},
/**
* 清空数组
* @param array
* @returns {Array}
*/
empty : function() {},
/**
* 去数组中的重复项,返回无重复数据的数组
* @param {Array} array
* @return {Array}
*/
distinct : function(array) {}
};
var slice = Array.prototype.slice;
LArray.isArray = (Array.prototype.isArray) ? function(array) {
return Array.isArray(array);
} :
function(array) {
return array instanceof Array;
};
LArray.indexOf = (Array.prototype.indexOf) ? function(array) {
return Array.prototype.indexOf.apply(array, slice.call(arguments, 1));
} :
function(array, searchElement, fromIndex) {
var i, l,
f = (fromIndex) ? fromIndex : 0;
l = array.length;
if (l === 0 || fromIndex >= l) {
return -1;
}
if (f < 0) {
f = l - Math.abs(f);
}
for (i = f; i < l; i++) {
if (array[i] === searchElement) {
return i;
}
}
return -1;
};
LArray.lastIndexOf = (Array.prototype.lastIndexOf) ? function(array) {
return Array.prototype.lastIndexOf.apply(array, slice.call(arguments, 1));
} :
function(array, searchElement, fromIndex) {
if (array === void 0 || array === null)
throw new TypeError('array must not be null or undefined');
var i, l,
t = array,
f = (fromIndex) ? fromIndex : 0,
len = array.length >>> 0;
if (len === 0 || f > len) {
return -1;
}
l = len;
if (fromIndex && f !== 0) {
l = Number(f);
if (l !== l) {
l = 0;
} else if (l !== 0 && l !== (1 / 0) && l !== -(1 / 0)) {
l = (l > 0 || -1) * Math.floor(Math.abs(l));
}
}
for (i = l >= 0 ?
Math.min(l, len - 1)
: len - Math.abs(l); i >= 0; i--) {
if (i in t && t[i] === searchElement) {
return i;
}
}
return -1;
};
LArray.forEach = (Array.prototype.forEach) ? function(array) {
return Array.prototype.forEach.apply(array, slice.call(arguments, 1));
} :
function(array, callback, thisArg) {
if (!LArray.isArray(array))
throw new TypeError('array must not be null or undefined');
if (typeof callback !== 'function')
throw new TypeError(callback +' is not a function');
var i, l;
for (i = 0, l = array.length; i < l; i++) {
if (i in array) {
callback.call(thisArg, array[i], i, array);
}
}
};
LArray.ervery = (Array.prototype.every) ? function(array) {
return Array.prototype.ervery.apply(array, slice.call(arguments, 1));
} :
function(array, callback, thisArg) {
if (array === void 0 || array === null)
throw new TypeError('array must not be null or undefined');
var len = array.length >>> 0;
if (typeof callback !== 'function')
throw new TypeError(callback +' is not a function');
for (var i = 0; i < len; i++) {
if (i in array && !callback.call(thisArg, array[i], i, array))
return false;
}
return true;
};
LArray.filter = (Array.prototype.filter) ? function(array) {
return Array.prototype.filter.apply(array, slice.call(arguments, 1));
} :
function(array, callback, thisArg) {
if (array === void 0 || array === null)
throw new TypeError('array must not be null or undefined');
var res = [];
var len = array.length >>> 0;
if (typeof callback !== 'function')
throw new TypeError(callback +' is not a function');
for (var i = 0; i < len; i++) {
if (i in array && callback.call(thisArg, array[i], i, array))
res.push(array[i]);
}
return res;
};
LArray.map = (Array.prototype.map) ? function(array) {
return Array.prototype.map.apply(array, slice.call(arguments, 1));
} :
function(array, callback, thisArg) {
if (array === void 0 || array === null)
throw new TypeError('array must not be null or undefined');
var len = array.length >>> 0;
var res = new Array(len);
if (typeof callback !== 'function')
throw new TypeError(callback+ ' is not a function');
for (var i = 0; i < len; i++) {
if (i in array)
res[i] = callback.call(thisArg, array[i], i, array);
}
return res;
};
LArray.some = (Array.prototype.some) ? function(array) {
return Array.prototype.some.apply(array, slice.call(arguments, 1));
} :
function(array, callback, thisArg) {
if (array === void 0 || array === null)
throw new TypeError('array must not be null or undefined');
var len = array.length >>> 0;
if (typeof callback !== 'function')
throw new TypeError(callback +' is not a function');
for (var i = 0; i < len; i++) {
if (i in array && callback.call(thisArg, array[i], i, array))
return true;
}
return false;
};
LArray.reduce = (Array.prototype.reduce) ? function(array) {
return Array.prototype.reduce.apply(array, slice.call(arguments, 1));
} :
function(array, callback, initialValue) {
if (array === null || array === void 0)
throw new TypeError('array must not be null or undefined');
if (typeof callback !== 'function')
throw new TypeError(callback + ' is not a function');
var i, l, val,
isValueSet = false,
t = array;
l = t.length >>> 0;
if (initialValue) {
val = initialValue;
isValueSet = true;
}
for (i = 0; i < l; i++) {
if (i in t && isValueSet) {
val = callback(val, t[i], i, t);
} else {
val = t[i];
isValueSet = true;
}
}
if (!isValueSet)
throw new TypeError('Reduce of empty array with no initial value');
return val;
};
LArray.reduceRight = (Array.prototype.reduceRight) ? function(array) {
return Array.prototype.reduceRight.apply(array, slice.call(arguments, 1));
} :
function(array, callback, initialValue) {
if (array === null || array === void 0)
throw new TypeError('array must not be null or undefined');
if (typeof callback !== 'function')
throw new TypeError(callback + ' is not a function');
var i, l, val,
isValueSet = false,
t = array;
l = t.length >>> 0;
if (initialValue) {
val = initialValue;
isValueSet = true;
}
for (i = l - 1; i > -1; i--) {
if (i in t && isValueSet) {
val = callback(val, t[i], i, t);
} else {
val = t[i];
isValueSet = true;
}
}
if (!isValueSet)
throw new TypeError('Reduce of empty array with no initial value');
return val;
};
LArray.of = (Array.prototype.of) ? function(item) {
return Array.of(item);
} :
function() {
return Array.prototype.slice.call(arguments);
};
LArray.clean = function(array) {
return LArray.filter(array, function(item) {
if (item === void 0 || item === null || item === "" || item === 0 || item === false) {
return false;
}
return true;
});
};
LArray.contains = function(array, item, fromIndex) {
return LArray.indexOf(array, item, fromIndex) !== -1;
};
LArray.getLast = function(array) {
if (array === null || array === void 0)
return null;
var l = array.length >>> 0;
if (l === 0) return null;
return array[l - 1];
};
LArray.empty = function(array) {
if (LArray.isArray(array)) {
array.length = 0;
}
return array;
};
LArray.distinct = function(array) {
if (array === null || array === void 0)
throw new TypeError('array must not be null or undefined');
var ret = [];
for (var i = 0, l = array.length; i < l; i++) {
if (!LArray.contains(array, array[i])) {
ret.push(array[i]);
}
}
return ret;
}
this.register('L.Array', LArray);
}.call(L);
|
//////MOBILE NAVBar!/////
$(".navbar-nav li a").click(function (event) {
// check if window is small enough so dropdown is created
var toggle = $(".navbar-toggle").is(":visible");
if (toggle) {
$(".navbar-collapse").collapse('hide');
}
});
// $('.navbar-nav').on('click', 'li a', function() {
// $('.navbar-collapse').collapse('hide');
// });
/* affix the navbar after scroll below header */
$('#nav').affix({
offset: {
top: $('header').height()-$('#nav').height()
}
});
/* highlight the top nav as scrolling occurs */
$('body').scrollspy({ target: '#nav' })
/* smooth scrolling for scroll to top */
$('.scroll-top').click(function(){
$('body,html').animate({scrollTop:0},1000);
})
/* smooth scrolling for nav sections */
$('#nav .navbar-nav li>a').click(function(){
var link = $(this).attr('href');
var posi = $(link).offset().top;
$('body,html').animate({scrollTop:posi},700);
});
/* ----------------------------------------------------------- */
/* 2. Fixed Top Menubar
/* ----------------------------------------------------------- */
jQuery(function($){
// For fixed top bar
$(window).scroll(function(){
if($(window).scrollTop() >100 /*or $(window).height()*/){
$(".navbar-fixed-top").addClass('past-main');
}
else{
$(".navbar-fixed-top").removeClass('past-main');
}
});
$(function() {
"use strict";
var topoffset = 70; //variable for menu height
var slideqty = $('#featured .item').length;
var wheight = $(window).height(); //get the height of the window
var randSlide = Math.floor(Math.random()*slideqty);
$('#featured .item').eq(randSlide).addClass('active');
$('.fullheight').css('height', wheight); //set to window tallness
$(document).ready(function(){
$('body').scrollspy({
target: '#navbar',
offset: topoffset
});
});
// add inbody class
var hash = $(this).find('li.active a').attr('href');
if(hash !== '#featured') {
$('header nav').addClass('inbody');
} else {
$('header nav').removeClass('inbody');
}
// Add an inbody class to nav when scrollspy event fires
$('.navbar-fixed-top').on('activate.bs.scrollspy', function() {
var hash = $(this).find('li.active a').attr('href');
if(hash !== '#featured') {
$('header nav').addClass('inbody');
} else {
$('header nav').removeClass('inbody');
}
});
// Use smooth scrolling when clicking on navigation
$('.navbar a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') ===
this.pathname.replace(/^\//,'') &&
location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top-topoffset+2
}, 500);
return false;
} //target.length
} //click function
}); //smooth scrolling
});
});
|
import { getShowDetail } from '../api/endpoints';
export const FETCH_DETAIL_REQUEST = 'FETCH_DETAIL_REQUEST';
export const FETCH_DETAIL_SUCCESS = 'FETCH_DETAIL_SUCCESS';
export const FETCH_DETAIL_ERROR = 'FETCH_DETAIL_ERROR';
export function fetchShowDetailRequest(){
return {
type: FETCH_DETAIL_REQUEST
}
}
export function fetchShowDetailSuccess(payload) {
return {
type: FETCH_DETAIL_SUCCESS,
payload
}
}
export function fetchShowDetailError() {
return {
type: FETCH_DETAIL_ERROR
}
}
export function fetchShowDetail(id) {
return (dispatch) => {
dispatch(fetchShowDetailRequest());
return getShowDetail(id).then(([response, json]) =>{
if (response.status === 200) {
dispatch(fetchShowDetailSuccess(json))
} else {
dispatch(fetchShowDetailError())
}
})
}
}
|
/* globals $ */
(function() {
'use strict';
angular
.module('bibalDenisApp')
.directive('passwordStrengthBar', passwordStrengthBar);
function passwordStrengthBar () {
var directive = {
replace: true,
restrict: 'E',
template: '<div id="strength">' +
'<small>Password strength:</small>' +
'<ul id="strengthBar">' +
'<li class="point"></li><li class="point"></li><li class="point"></li><li class="point"></li><li class="point"></li>' +
'</ul>' +
'</div>',
scope: {
passwordToCheck: '='
},
link: linkFunc
};
return directive;
/* private helper methods*/
function linkFunc(scope, iElement) {
var strength = {
colors: ['#F00', '#F90', '#FF0', '#9F0', '#0F0'],
mesureStrength: function (p) {
var _force = 0;
var _regex = /[$-/:-?{-~!"^_`\[\]]/g; // "
var _lowerLetters = /[a-z]+/.test(p);
var _upperLetters = /[A-Z]+/.test(p);
var _numbers = /[0-9]+/.test(p);
var _symbols = _regex.test(p);
var _flags = [_lowerLetters, _upperLetters, _numbers, _symbols];
var _passedMatches = $.grep(_flags, function (el) {
return el === true;
}).length;
_force += 2 * p.length + ((p.length >= 10) ? 1 : 0);
_force += _passedMatches * 10;
// penality (short password)
_force = (p.length <= 6) ? Math.min(_force, 10) : _force;
// penality (poor variety of characters)
_force = (_passedMatches === 1) ? Math.min(_force, 10) : _force;
_force = (_passedMatches === 2) ? Math.min(_force, 20) : _force;
_force = (_passedMatches === 3) ? Math.min(_force, 40) : _force;
return _force;
},
getColor: function (s) {
var idx;
if (s <= 10) {
idx = 0;
}
else if (s <= 20) {
idx = 1;
}
else if (s <= 30) {
idx = 2;
}
else if (s <= 40) {
idx = 3;
}
else {
idx = 4;
}
return { idx: idx + 1, col: this.colors[idx] };
}
};
scope.$watch('passwordToCheck', function (password) {
if (password) {
var c = strength.getColor(strength.mesureStrength(password));
iElement.removeClass('ng-hide');
iElement.find('ul').children('li')
.css({ 'background-color': '#DDD' })
.slice(0, c.idx)
.css({ 'background-color': c.col });
}
});
}
}
})();
|
window.jQuery = window.$ = $ = require('jquery');
window.Vue = require('vue');
window.perfectScrollbar = require('./perfect-scrollbar');
window.toastr = require('toastr');
window.DataTable = require('./bootstrap-datatables');
window.SimpleMDE = require('simplemde');
window.tooltip = require('./bootstrap-tooltip');
require('dropzone');
require('./readmore');
require('./media');
require('./jquery-match-height');
require('./bootstrap-toggle');
require('./jquery-cookie');
require('./jquery-nestable');
require('bootstrap');
require('bootstrap-switch');
require('jquery-match-height');
require('select2');
require('bootstrap-datetimepicker/src/js/bootstrap-datetimepicker');
var brace = require('brace');
require('brace/mode/json');
require('brace/theme/github');
require('./slugify');
window.TinyMCE = window.tinymce = require('./tinymce');
require('./multilingual');
require('./voyager_tinymce');
require('./voyager_ace_editor');
require('./helpers.js');
$(document).ready(function(){
var appContainer = $(".app-container"),
sidebarAnchor = $('#sidebar-anchor'),
fadedOverlay = $('.fadetoblack'),
hamburger = $('.hamburger');
$('.side-menu').perfectScrollbar();
$('#voyager-loader').fadeOut();
$('.readmore').readmore({
collapsedHeight: 60,
embedCSS: true,
lessLink: '<a href="#" class="readm-link">Read Less</a>',
moreLink: '<a href="#" class="readm-link">Read More</a>',
});
$(".hamburger, .navbar-expand-toggle, .side-menu .navbar-nav li:not(.dropdown)").on('click', function() {
if ($(this).is('button')) {
appContainer.toggleClass("expanded");
$(this).toggleClass('is-active');
} else {
if (!sidebarAnchor.hasClass('active')) {
appContainer.removeClass("expanded");
hamburger.toggleClass('is-active');
}
}
});
fadedOverlay.on('click', function(){
appContainer.removeClass('expanded');
hamburger.removeClass('is-active');
});
sidebarAnchor.on('click', function(){
if (appContainer.hasClass('expanded')) {
if ($(this).hasClass('active')) {
appContainer.removeClass("expanded");
$(this).removeClass('active');
window.localStorage.removeItem('voyager.stickySidebar');
toastr.success("Sidebar isn't sticky anymore.");
sidebarAnchor[0].title = sidebarAnchor.data('sticky');
}
else {
$(this).addClass('active');
window.localStorage.setItem('voyager.stickySidebar', true);
toastr.success("Sidebar is now sticky");
sidebarAnchor.data('sticky', sidebarAnchor[0].title);
sidebarAnchor[0].title = sidebarAnchor.data('unstick');
}
}
else {
appContainer.addClass("expanded");
$(this).removeClass('active');
window.localStorage.removeItem('voyager.stickySidebar');
toastr.success("Sidebar isn't sticky anymore.");
sidebarAnchor[0].title = sidebarAnchor.data('sticky');
}
});
$('select.select2').select2({ width: '100%' });
$('.match-height').matchHeight();
$('.datatable').DataTable({
"dom": '<"top"fl<"clear">>rt<"bottom"ip<"clear">>'
});
$(".side-menu .nav .dropdown").on('show.bs.collapse', function() {
return $(".side-menu .nav .dropdown .collapse").collapse('hide');
});
$(document).on('click', '.panel-heading a.panel-action[data-toggle="panel-collapse"]', function(e){
e.preventDefault();
var $this = $(this);
// Toggle Collapse
if(!$this.hasClass('panel-collapsed')) {
$this.parents('.panel').find('.panel-body').slideUp();
$this.addClass('panel-collapsed');
$this.removeClass('voyager-angle-down').addClass('voyager-angle-up');
} else {
$this.parents('.panel').find('.panel-body').slideDown();
$this.removeClass('panel-collapsed');
$this.removeClass('voyager-angle-up').addClass('voyager-angle-down');
}
});
//Toggle fullscreen
$(document).on('click', '.panel-heading a.panel-action[data-toggle="panel-fullscreen"]', function (e) {
e.preventDefault();
var $this = $(this);
if (!$this.hasClass('voyager-resize-full')) {
$this.removeClass('voyager-resize-small').addClass('voyager-resize-full');
} else {
$this.removeClass('voyager-resize-full').addClass('voyager-resize-small');
}
$this.closest('.panel').toggleClass('is-fullscreen');
});
$('.datepicker').datetimepicker();
// Right navbar toggle
$('.navbar-right-expand-toggle').on('click', function(){
$('ul.navbar-right').toggleClass('expanded');
});
// Save shortcut
$(document).keydown(function (e){
if ((e.metaKey || e.ctrlKey) && e.keyCode == 83) { /*ctrl+s or command+s*/
$(".btn.save").click();
e.preventDefault();
return false;
}
});
/********** MARKDOWN EDITOR **********/
$('textarea.simplemde').each(function() {
var simplemde = new SimpleMDE({
element: this,
});
simplemde.render();
});
/********** END MARKDOWN EDITOR **********/
});
$(document).ready(function(){
$(".form-edit-add").submit(function(e){
e.preventDefault();
var url = $(this).attr('action');
var form = $(this);
var data = new FormData(this);
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: data,
processData: false,
contentType: false,
beforeSend: function(){
$("body").css("cursor", "progress");
$("div").removeClass("has-error");
$(".help-block").remove();
},
success: function(d){
$("body").css("cursor", "auto");
$.each(d.errors, function(key, row){
//Scroll to first error
if (Object.keys(d.errors).indexOf(key) === 0) {
$('html, body').animate({
scrollTop: $("[name='"+key+"']").parent().offset().top
- $('nav.navbar').height() + 'px'
}, 'fast');
}
$("[name='"+key+"']").parent().addClass("has-error");
$("[name='"+key+"']").parent().append("<span class='help-block' style='color:#f96868'>"+row+"</span>")
});
},
error: function(){
$(form).unbind("submit").submit();
}
});
});
});
|
define(['fake-dom/parse5', 'fake-dom/parse5-tree-adapter'], function (Parse5, treeAdapter) {
describe('parse5', function () {
it('should exist', function () {
var parser = new Parse5(treeAdapter);
expect(parser).toBeTruthy();
///* global console */
// parser.parse('<html><!-- 1 --><span>2</span><!-- 3 --></html>');
});
});
});
|
var fs = require('fs');
var jf = require('jsonfile');
var reader = require('./reader.js');
fs.readFile('sailfish_branches.output', 'utf8', function (err,data) {
finalOutput = reader.parseBranchesOutput(data);
jf.writeFileSync("/workspace/sailfish_branches.json", finalOutput);
});
|
// @flow
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { TableRow, TableRowColumn }
from 'material-ui/Table';
import TextField from 'material-ui/TextField';
import DatePicker from 'material-ui/DatePicker';
import RaisedButton from 'material-ui/RaisedButton';
import { fullWhite } from 'material-ui/styles/colors';
import ActionOK from 'material-ui/svg-icons/action/done';
export const fields = ['description', 'dateBoxBook'];
const style = {
margin: 12,
};
// transformar pro hroario pt br .toLocaleString('pt-br')
const upper = value => value && value.toUpperCase();
const fillValue = value => value || 0;
const DateTimeFormat = global.Intl.DateTimeFormat;
const formatDate = date => Intl.DateTimeFormat('PT-BR').format(date);
const renderDatePicker = ({
input,
floatingLabelText,
hintText,
container,
}) => (
<DatePicker
hintText={hintText}
DateTimeFormat={DateTimeFormat}
formatDate={formatDate}
floatingLabelText={floatingLabelText}
okLabel="OK"
cancelLabel="Cancelar"
locale="pt-br"
onChange={(event, value) => input.onChange(value)}
/>
);
const validate = values => {
const errors = {};
if (!values.dateBoxBook) {
errors.dateBoxBook = 'Data obrigatória';
}
if (!values.description) {
errors.description = 'Descrição obrigatória';
}
if (!values.input && !values.output) {
errors.description = 'Informe o valor de entrada ou saída';
}
return errors;
};
const renderTextField = ({
input,
floatingLabelText,
type,
}) =>
(<TextField
floatingLabelText={floatingLabelText}
type={type}
{...input}
/>);
class Input extends Component <void, Props, State> {
sendBoxBook: Function;
props: {
handleInput: () => void,
handleSubmit: () => void
}
constructor() {
super();
this.state = {
open: false,
};
this.sendBoxBook = this.sendBoxBook.bind(this);
}
sendBoxBook(payload: object) {
payload.isData = true;
payload.output = fillValue(payload.output);
payload.input = fillValue(payload.input);
this.props.handleInput(payload);
}
render() {
return (
<TableRow>
<TableRowColumn>
<Field
name="dateBoxBook"
floatingLabelText="DATA"
hintText="DATA"
container="inline"
component={renderDatePicker}
/>
</TableRowColumn>
<TableRowColumn>
<Field
name="description"
floatingLabelText="DESCRIÇÃO"
component={renderTextField}
normalize={upper}
type="text"
/>
</TableRowColumn>
<TableRowColumn>
<Field
name="input"
floatingLabelText="ENTRADA"
component={renderTextField}
type="number"
/>
</TableRowColumn>
<TableRowColumn>
<Field
name="output"
floatingLabelText="SAÍDA"
component={renderTextField}
type="number"
/>
</TableRowColumn>
<TableRowColumn>
<RaisedButton
onClick={this.props.handleSubmit(this.sendBoxBook)}
backgroundColor="#a4c639"
icon={<ActionOK color={fullWhite} />}
style={style}
/>
</TableRowColumn>
</TableRow>
);
}
}
export default reduxForm({
form: 'RegisterBoxBook',
validate,
})(Input);
|
/*Place Holder*/
/* <![CDATA[ */
$(function()
{
var input = document.createElement("input") && document.createElement("textarea");
if(('placeholder' in input)==false)
{
$('[placeholder]').focus(function()
{
var i = $(this);
if(i.val() == i.attr('placeholder'))
{
i.val('').removeClass('placeholder');
if(i.hasClass('password'))
{
i.removeClass('password');
this.type='password';
}
}
}).blur(function()
{
var i = $(this);
if(i.val() == '' || i.val() == i.attr('placeholder'))
{
if(this.type=='password')
{
i.addClass('password');
this.type='text';
this.type='tel';
this.type='email';
}
i.addClass('placeholder').val(i.attr('placeholder'));
}
}).blur().parents('form').submit(function()
{
$(this).find('[placeholder]').each(function()
{
var i = $(this);
if(i.val() == i.attr('placeholder'))
i.val('');
})
});
}
});
/* ]]> */
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createEvaluate = void 0;
var _collection = require("../../utils/collection");
var _factory = require("../../utils/factory");
var name = 'evaluate';
var dependencies = ['typed', 'parse'];
var createEvaluate =
/* #__PURE__ */
(0, _factory.factory)(name, dependencies, function (_ref) {
var typed = _ref.typed,
parse = _ref.parse;
/**
* Evaluate an expression.
*
* Note the evaluating arbitrary expressions may involve security risks,
* see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.
*
* Syntax:
*
* math.evaluate(expr)
* math.evaluate(expr, scope)
* math.evaluate([expr1, expr2, expr3, ...])
* math.evaluate([expr1, expr2, expr3, ...], scope)
*
* Example:
*
* math.evaluate('(2+3)/4') // 1.25
* math.evaluate('sqrt(3^2 + 4^2)') // 5
* math.evaluate('sqrt(-4)') // 2i
* math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]
*
* let scope = {a:3, b:4}
* math.evaluate('a * b', scope) // 12
*
* See also:
*
* parse, compile
*
* @param {string | string[] | Matrix} expr The expression to be evaluated
* @param {Object} [scope] Scope to read/write variables
* @return {*} The result of the expression
* @throws {Error}
*/
return typed(name, {
string: function string(expr) {
var scope = {};
return parse(expr).compile().evaluate(scope);
},
'string, Object': function stringObject(expr, scope) {
return parse(expr).compile().evaluate(scope);
},
'Array | Matrix': function ArrayMatrix(expr) {
var scope = {};
return (0, _collection.deepMap)(expr, function (entry) {
return parse(entry).compile().evaluate(scope);
});
},
'Array | Matrix, Object': function ArrayMatrixObject(expr, scope) {
return (0, _collection.deepMap)(expr, function (entry) {
return parse(entry).compile().evaluate(scope);
});
}
});
});
exports.createEvaluate = createEvaluate;
|
import publications from './publications';
import methods from './methods';
import user_config from './configs/user-config';
publications();
methods();
user_config();
|
'use strict';
var markdown = require('js-markdown-extra').Markdown;
module.exports = {
md: function (options) {
return markdown(options.fn(this));
},
'md-file': function(options){
//TODO: read markdown file and render it
return markdown('#TODO');
}
};
|
import {
ToastServiceBus
} from './toastServiceBus'
import { ADD_TOAST, REMOVE_TOAST } from '../utils/constants'
export default {
/**
* Synchronously create and show a new toast instance.
*
* @param {(string | Toast)} type The type of the toast, or a Toast object.
* @param {string=} title The toast title.
* @param {string=} body The toast body.
* @returns {Toast}
* The newly created Toast instance with a randomly generated GUID Id.
*/
pop(type, title, body) {
let toast = typeof type === 'string' ? {
type: type,
title: title,
body: body
} : type
if (!toast || !toast.type || !toast.type.length) {
throw new Error('A toast type must be provided')
}
if (ToastServiceBus.subscribers.length < 1) {
throw new Error(
'No Toaster Containers have been initialized to receive toasts.')
}
toast.toastId = Guid.newGuid()
ToastServiceBus.$emit(ADD_TOAST, toast)
return toast
},
/**
* Removes a toast by toastId and/or toastContainerId.
*
* @param {string} toastId The toastId of the toast to remove.
* @param {number=} toastContainerId
* The toastContainerId of the container to remove toasts from.
*/
remove(toastId, toastContainerId) {
ToastServiceBus.$emit(REMOVE_TOAST, toastId, toastContainerId)
}
}
// http://stackoverflow.com/questions/26501688/a-typescript-guid-class
class Guid {
static newGuid() {
function match(c) {
const r = Math.random() * 16 | 0
const v = c === 'x' ? r : (r & 0x3 | 0x8)
return v.toString(16)
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, match)
}
}
|
// 'use strict';
// var fs = require('fs');
// var path = require('path');
// var Sequelize = require('sequelize');
// var basename = path.basename(__filename);
// var env = process.env.NODE_ENV || 'development';
// var config = require(__dirname + '/../config/config.json')[env];
// var db = {};
// if (config.use_env_variable) {
// var sequelize = new Sequelize(process.env[config.use_env_variable]);
// } else {
// var sequelize = new Sequelize(config.database, config.username, config.password, config);
// }
// fs
// .readdirSync(__dirname)
// .filter(file => {
// return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
// })
// .forEach(file => {
// var model = sequelize['import'](path.join(__dirname, file));
// db[model.name] = model;
// });
// Object.keys(db).forEach(modelName => {
// if (db[modelName].associate) {
// db[modelName].associate(db);
// }
// });
// db.sequelize = sequelize;
// db.Sequelize = Sequelize;
// module.exports = db;
|
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/*.ts']
};
|
require("requirish")._(module);
var should = require("should");
var assert = require("better-assert");
var async = require("async");
var util = require("util");
var _ = require("underscore");
var opcua = require("index");
var OPCUAClient = opcua.OPCUAClient;
var StatusCodes = opcua.StatusCodes;
var Variant = opcua.Variant;
var DataType = opcua.DataType;
var DataValue = opcua.DataValue;
var BrowseDirection = opcua.browse_service.BrowseDirection;
var debugLog = opcua.utils.make_debugLog(__filename);
var port = 2000;
function sendPublishRequest(session, callback) {
var publishRequest = new opcua.subscription_service.PublishRequest({});
session.performMessageTransaction(publishRequest, function (err, response) {
callback(err, response);
});
}
function createSubscription(session, callback) {
var publishingInterval = 1000;
var createSubscriptionRequest = new opcua.subscription_service.CreateSubscriptionRequest({
requestedPublishingInterval: publishingInterval,
requestedLifetimeCount: 60,
requestedMaxKeepAliveCount: 10,
maxNotificationsPerPublish: 10,
publishingEnabled: true,
priority: 6
});
session.performMessageTransaction(createSubscriptionRequest, function (err, response) {
callback(err);
});
}
module.exports = function (test) {
describe("testing session transfer to different channel", function () {
it("RQC1 - It should be possible to close a session that has not be activated yet", function (done) {
var client1;
var session1;
async.series([
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1, whitout activating it
function (callback) {
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
function (callback) {
client1.closeSession(session1, function (err) {
if(err) {
callback(err); // Failure , close session expected to work
}
callback();
});
},
function (callback) {
client1.disconnect(callback);
}
],done);
});
it("RQB1 - calling CreateSession and CloseSession & CloseSession again should return BadSessionIdInvalid", function (done) {
var client1;
var session1;
async.series([
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
function(callback) {
session1.close(callback);
},
function(callback) {
session1.close(function(err) {
err.message.should.match(/SessionIdInvalid/);
callback();
});
},
//
function (callback) {
client1.disconnect(callback);
}
], done);
});
it("RQB2 - calling CloseSession without calling CreateSession first", function (done) {
var client1;
var session1;
async.series([
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
function (callback) {
var request = new opcua.session_service.CloseSessionRequest({
deleteSubscriptions: true
});
client1.performMessageTransaction(request, function (err, response) {
should(err).eql(null);
//err.message.should.match(/BadSessionIdInvalid/);
response.responseHeader.serviceResult.should.eql(StatusCodes.BadSessionIdInvalid);
callback();
});
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
it("RQB3 - calling CreateSession, CloseSession and CloseSession again", function (done) {
var client1;
var session1;
async.series([
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
client1.createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
// first call to close session should be OK
function (callback) {
client1.closeSession(session1, function (err) {
callback(err);
});
},
// second call to close session should raise an error
function (callback) {
var request = new opcua.session_service.CloseSessionRequest({
deleteSubscriptions: true
});
client1.performMessageTransaction(request, function (err, response) {
should(err).eql(null);
//err.message.should.match(/BadSessionIdInvalid/);
response.responseHeader.serviceResult.should.eql(StatusCodes.BadSessionIdInvalid);
callback();
});
},
function (callback) {
client1.disconnect(callback);
}
], function final(err) {
client1.disconnect(function () {
done(err);
});
});
});
it("RQ0 - call ActiveSession on a session that has been transferred to a different channel", function (done) {
// this test verifies that the following requirement can be met
// OpcUA 1.02 part 3 $5.5 Secure Channel Set page 20
// Once a Client has established a Session it may wish to access the Session from a different
// SecureChannel. The Client can do this by validating the new SecureChannel with the
// ActivateSession Service described in 5.6.3.
var client1, client2;
var session1;
async.series([
// create a first channel (client1)
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
// activate the session as expected on same channel used to create it
function (callback) {
client1._activateSession(session1, function (err) {
callback(err);
});
},
// let verify that it is now possible to send a request on client1's session
function (callback) {
// coerce nodeIds
var request = new opcua.read_service.ReadRequest({
nodesToRead: [{nodeId: "i=2255", attributeId: 13}],
maxAge: 0,
timestampsToReturn: opcua.read_service.TimestampsToReturn.Both
});
request.requestHeader.authenticationToken = session1.authenticationToken;
client1.performMessageTransaction(request, function (err, response) {
should(err).eql(null);
response.responseHeader.serviceResult.should.eql(StatusCodes.Good);
callback();
});
},
// create a second channel (client2)
function (callback) {
client2 = new OPCUAClient();
client2.connect(test.endpointUrl, callback);
},
// reactivate session on second channel
function (callback) {
client2.reactivateSession(session1, function (err) {
callback(err);
});
},
// now that session has been assigned to client 1,
// server shall refuse any requests on channel1
function (callback) {
// coerce nodeIds
var request = new opcua.read_service.ReadRequest({
nodesToRead: [{nodeId: "i=2255", attributeId: 13}],
maxAge: 0,
timestampsToReturn: opcua.read_service.TimestampsToReturn.Both
});
request.requestHeader.authenticationToken = session1.authenticationToken;
client1.performMessageTransaction(request, function (err, response) {
if (!err) {
response.responseHeader.serviceResult.should.eql(StatusCodes.BadSecureChannelIdInvalid);
}
callback(err);
});
},
// but server shall access request on new channel
function (callback) {
// coerce nodeIds
var request = new opcua.read_service.ReadRequest({
nodesToRead: [{nodeId: "i=2255", attributeId: 13}],
maxAge: 0,
timestampsToReturn: opcua.read_service.TimestampsToReturn.Both
});
request.requestHeader.authenticationToken = session1.authenticationToken;
client2.performMessageTransaction(request, function (err, response) {
if (!err) {
response.responseHeader.serviceResult.should.eql(StatusCodes.Good);
}
callback(err);
});
},
// terminate
function (callback) {
client2.disconnect(callback);
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
// OpcUA 1.02 part 3 $5.6.3.1 ActiveSession Set page 29
// When the ActivateSession Service is called f or the first time then the Server shall reject the request
// if the SecureChannel is not same as the one associated with the CreateSession request.
it("RQ1 - should reject if the channel used to activate the session for the first time is not the same as the channel used to create the session", function (done) {
var client1, client2;
var session1;
var initialChannelCount = 0;
async.series([
// create a first channel (client1)
function (callback) {
initialChannelCount = test.server.getChannels().length;
test.server.getChannels().length.should.equal(initialChannelCount);
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
// ( without activating it)
function (callback) {
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
test.server.getChannels().length.should.equal(initialChannelCount+1);
callback();
});
},
// create a second channel (client2)
function (callback) {
client2 = new OPCUAClient();
client2.connect(test.endpointUrl, callback);
},
// activate the session created with client1 using client2 !!
// this should be detected by server and server shall return an error
function (callback) {
test.server.getChannels().length.should.equal(initialChannelCount+2);
//xx console.log(" ID1 =", client1._secureChannel.channelId);
//xx console.log(" ID2 =", client2._secureChannel.channelId);
client2.reactivateSession(session1, function (err) {
if (!err) {
callback(new Error("_activateSession shall return an error "));
}
err.message.should.match(/BadSessionNotActivated/);
callback();
});
},
// terminate
function (callback) {
client2.disconnect(callback);
},
// activate the session as expected on same channel used to create it
// so we can close it properly
function (callback) {
client1._activateSession(session1, function (err) {
session1.close(callback);
});
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
var path = require("path");
var fs = require("fs");
function m(file) {
var p = path.join("../../", file);
p = path.join(__dirname, p);
if (!fs.existsSync(p)) {
console.error(" cannot find ", p);
}
return p;
}
var crypto_utils = require("lib/misc/crypto_utils");
if (!crypto_utils.isFullySupported()) {
console.log(" SKIPPING TESTS ON SECURE CONNECTION because crypto, please check your installation".red.bold);
} else {
// OpcUA 1.02 part 3 $5.6.3.1 ActiveSession Set page 29
// Subsequent calls to ActivateSession may be associated with different SecureChannels. If this is the
// case then the Server shall verify that the Certificate the Client used to create the new
// SecureChannel is the same as the Certificate used to create the original SecureChannel.
it("RQ2 -server should raise an error if a existing session is reactivated from a channel that have different certificate than the original channel", function (done) {
var serverCertificate = test.server.getCertificate();
var client1, client2;
var session1;
async.series([
// create a first channel (client1)
function (callback) {
//xx console.log(" creating initial channel with some certificate");
var certificateFile1 = m("certificates/client_cert_1024.pem");
var privateKeyFile1 = m("certificates/client_key_1024.pem");
client1 = new OPCUAClient({
certificateFile: certificateFile1,
privateKeyFile: privateKeyFile1,
securityMode: opcua.MessageSecurityMode.SIGN,
securityPolicy: opcua.SecurityPolicy.Basic128Rsa15,
serverCertificate: serverCertificate
});
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
//xx console.log(" create session");
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
// activate the session as expected on same channel used to create it
function (callback) {
//xx console.log(" activate session");
client1._activateSession(session1, function (err) {
callback(err);
});
},
// create a second channel (client2)
// with a different certificate ....
function (callback) {
// creating second channel with different credential
//xx console.log(" creating second channel with different certificate");
var certificateFile2 = m("certificates/client_cert_2048.pem");
var privateKeyFile2 = m("certificates/client_key_2048.pem");
client2 = new OPCUAClient({
certificateFile: certificateFile2,
privateKeyFile: privateKeyFile2,
securityMode: opcua.MessageSecurityMode.SIGN,
securityPolicy: opcua.SecurityPolicy.Basic256,
serverCertificate: serverCertificate
});
client2.connect(test.endpointUrl, callback);
},
function (callback) {
// reactivate session on second channel
// Reactivate should fail because certificate is not the same as the original one
client2.reactivateSession(session1, function (err) {
if (err) {
err.message.should.match(/BadNoValidCertificates/);
callback();
} else {
callback(new Error("expecting reactivateSession to fail"));
}
});
},
// terminate
function (callback) {
client2.disconnect(callback);
},
function (callback) {
session1.close(callback);
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
// In addition,the Server shall verify that the Client supplied a UserIdentityToken that is identical to the token
// currently associated with the Session.
it("RQ3 - server should raise an error if a session is reactivated with different user identity tokens", function (done) {
var client1, client2;
var session1;
var user1 = {
userName: "user1", password: "password1"
};
var user2 = new opcua.UserNameIdentityToken({
userName: "user1", password: "password1"
});
//xx console.log(" user1 ", user1.toString());
async.series([
// given a established session with a subscription and some publish request
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
client1.createSession(user1, function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
// when the session is transferred to a different channel
// create a second channel (client2)
function (callback) {
client2 = new OPCUAClient();
client2.connect(test.endpointUrl, callback);
},
function (callback) {
// reactivate session on second channel
// alter session1.userIdentityInfo
session1.userIdentityInfo = user2;
session1.userIdentityInfo.userName.should.eql("user1");
client2.reactivateSession(session1, function (err) {
err.message.should.match(/BadIdentityChangeNotSupported/);
_.contains(client1._sessions, session1).should.eql(true);// should have failed
callback();
});
},
// terminate
function (callback) {
client2.disconnect(callback);
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
}
// Once the Server accepts the new SecureChannel it shall reject requests sent via the old SecureChannel.
xit("RQ4 - server should reject request send via old channel when session has been transferred to new channel", function (done) {
async.series([], done);
});
// unprocessed pending Requests such as PublishRequest shall be be denied by the server
// Once the Server accepts the new SecureChannel it shall reject requests sent via the old SecureChannel
it("RQ5 - server should reject pending requests send to old channel when session has been transferred to new channel", function (done) {
var sinon = require("sinon");
var collectPublishResponse = sinon.spy();
var client1, client2;
var session1;
async.series([
// given a established session with a subscription and some publish request
function (callback) {
client1 = new OPCUAClient();
client1.connect(test.endpointUrl, callback);
},
// create a session using client1
function (callback) {
client1._createSession(function (err, session) {
if (err) {
return callback(err);
}
session1 = session;
callback();
});
},
// activate the session as expected on same channel used to create it
function (callback) {
client1._activateSession(session1, function (err) {
callback(err);
});
},
// creaet a subscription,
function (callback) {
createSubscription(session1, callback);
},
// when the session is transferred to a different channel
// create a second channel (client2)
function (callback) {
client2 = new OPCUAClient();
client2.connect(test.endpointUrl, callback);
collectPublishResponse.callCount.should.eql(0);
},
// provision 3 publish requests and wait for the first keep alive
function (callback) {
sendPublishRequest(session1, function (err) {
should(err).eql(null);
collectPublishResponse.callCount.should.eql(0);
callback();
});
sendPublishRequest(session1, collectPublishResponse);
sendPublishRequest(session1, collectPublishResponse);
},
function (callback) {
// reactivate session on second channel
client2.reactivateSession(session1, function (err) {
callback(err);
});
},
function (callback) {
setTimeout(callback, 100);
},
function (callback) {
collectPublishResponse.callCount.should.eql(2);
collectPublishResponse.getCall(0).args[0].message.should.match(/BadSecureChannelClosed/);
collectPublishResponse.getCall(1).args[0].message.should.match(/BadSecureChannelClosed/);
callback();
},
// terminate
function (callback) {
client2.disconnect(callback);
},
function (callback) {
client1.disconnect(callback);
}
], done);
});
});
}
|
$(document).ready(function () {
// Code to post data over Ajax
$('#codeSubmit').click(function () {
var code_val = $('textarea[id="code"]').val();
var lang_val = $('select[id="lang"]').val();
$.ajax({
type: 'POST',
url: 'process/'+lang_val+'.php',
data: {
"data": code_val
},
success: function (response) {
if(response == 0) {
$("#responseHolder").html("Submitted successfully!");
}
else {
$("#responseHolder").html("Oops! Something went wrong.");
}
}
});
});
// Code to remove \n from code field
$("#code").keypress(function(e) {
if(e.keyCode == 13) {
var msg = $("#code").val().replace(/\n/g, "");
if (!util.isBlank(msg)) {
send(msg);
$("#code").val("");
}
}
else if(e.keyCode == 9) {
var start = this.selectionStart;
var end = this.selectionEnd;
var $this = $(this);
var value = $this.val();
$this.val(value.substring(0, start) + " " + value.substring(end));
this.selectionStart = this.selectionEnd = start + 4;
e.preventDefault();
}
else {
return;
}
return false;
});
});
|
import Ember from 'ember';
import { assert } from "ember-data/debug";
const get = Ember.get;
/**
Assert that `addedRecord` has a valid type so it can be added to the
relationship of the `record`.
The assert basically checks if the `addedRecord` can be added to the
relationship (specified via `relationshipMeta`) of the `record`.
This utility should only be used internally, as both record parameters must
be an InternalModel and the `relationshipMeta` needs to be the meta
information about the relationship, retrieved via
`record.relationshipFor(key)`.
@method assertPolymorphicType
@param {InternalModel} record
@param {RelationshipMeta} relationshipMeta retrieved via
`record.relationshipFor(key)`
@param {InternalModel} addedRecord record which
should be added/set for the relationship
*/
var assertPolymorphicType = function(record, relationshipMeta, addedRecord) {
var addedType = addedRecord.type.modelName;
var recordType = record.type.modelName;
var key = relationshipMeta.key;
var typeClass = record.store.modelFor(relationshipMeta.type);
var assertionMessage = `You cannot add a record of type '${addedType}' to the '${recordType}.${key}' relationship (only '${typeClass.modelName}' allowed)`;
assert(assertionMessage, checkPolymorphic(typeClass, addedRecord));
};
function checkPolymorphic(typeClass, addedRecord) {
if (typeClass.__isMixin) {
//TODO Need to do this in order to support mixins, should convert to public api
//once it exists in Ember
return typeClass.__mixin.detect(addedRecord.type.PrototypeMixin);
}
if (Ember.MODEL_FACTORY_INJECTIONS) {
typeClass = typeClass.superclass;
}
return typeClass.detect(addedRecord.type);
}
/**
Check if the passed model has a `type` attribute or a relationship named `type`.
@method modelHasAttributeOrRelationshipNamedType
@param modelClass
*/
function modelHasAttributeOrRelationshipNamedType(modelClass) {
return get(modelClass, 'attributes').has('type') || get(modelClass, 'relationshipsByName').has('type');
}
/*
ember-container-inject-owner is a new feature in Ember 2.3 that finally provides a public
API for looking items up. This function serves as a super simple polyfill to avoid
triggering deprecations.
*/
function getOwner(context) {
var owner;
if (Ember.getOwner) {
owner = Ember.getOwner(context);
}
if (!owner && context.container) {
owner = context.container;
}
if (owner && owner.lookupFactory && !owner._lookupFactory) {
// `owner` is a container, we are just making this work
owner._lookupFactory = owner.lookupFactory;
owner.register = function() {
var registry = owner.registry || owner._registry || owner;
return registry.register(...arguments);
};
}
return owner;
}
export {
assertPolymorphicType,
modelHasAttributeOrRelationshipNamedType,
getOwner
};
|
import { loadFixture, testVM } from '../../../tests/utils'
describe('dropdown', async () => {
beforeEach(loadFixture(__dirname, 'dropdown'))
testVM()
it('should work', async () => {
const { app: { $refs } } = window
const dds = Object.keys($refs).map(ref => $refs[ref])
dds.forEach(dd => {
expect(dd._isVue).toBe(true)
expect(dd).toHaveClass('dropdown')
})
})
it('should work with shorthand component tag names', async () => {
const { app: { $refs } } = window
const { dd_5 } = $refs // eslint-disable-line camelcase
expect(dd_5).toBeComponent('b-dd')
})
/*
// This test complains somewhat due to mising Range functions in JSDOM
// Commenting out for now
it("should open only one dropdown at a time", async () => {
const { app: { $refs } } = window;
const dds = Object.keys($refs).map(ref => $refs[ref]);
// Without async iterators, just use a for loop.
for (let i = 0; i < dds.length; i++) {
Array.from(dds[i].$el.children)
.find(node => node.tagName === "BUTTON" && node.id === `${dds[i].safeId('_BV_toggle_')}`)
.click();
// Await the next render after click triggers dropdown.
await nextTick();
const openDds = dds.filter(dd => dd.$el.classList.contains("show"));
expect(openDds.length).toBe(1);
}
});
*/
it('should not have a toggle caret when no-caret is true', async () => {
const { app: { $refs } } = window
const { dd_7 } = $refs // eslint-disable-line camelcase
const toggle = Array.from(dd_7.$el.children)
.find(node => node.tagName === 'BUTTON' && node.id === `${dd_7.safeId('_BV_toggle_')}`)
expect(toggle).not.toHaveClass('dropdown-toggle')
})
it('should have a toggle caret when no-caret and split are true', async () => {
const { app: { $refs } } = window
const { dd_8 } = $refs // eslint-disable-line camelcase
const toggle = Array.from(dd_8.$el.children)
.find(node => node.tagName === 'BUTTON' && node.id === `${dd_8.safeId('_BV_toggle_')}`)
expect(toggle).toHaveClass('dropdown-toggle')
})
/*
it('boundary set to viewport should have class position-static', async () => {
const {app: {$refs}} = window
const {dd_9} = $refs
expect(dd_9).toHaveClass('position-static')
})
it('boundary not set should not have class position-static', async () => {
const {app: {$refs}} = window
const {dd_1} = $refs
expect(dd_1).not.toHaveClass('position-static')
})
*/
it('dd-item should render as link by default', async () => {
const {app: {$refs}} = window
const {dd_6} = $refs // eslint-disable-line camelcase
expect(Array.from(dd_6.$refs.menu.children).find(node => node.innerHTML === 'link')).toBeElement('a')
})
it('dd-item-button should render as button', async () => {
const {app: {$refs}} = window
const {dd_6} = $refs // eslint-disable-line camelcase
expect(Array.from(dd_6.$refs.menu.children).find(node => node.innerHTML === 'button')).toBeElement('button')
})
it('dd-item-button should emit click event', async () => {
const {app: {$refs}} = window
const {dd_6} = $refs // eslint-disable-line camelcase
const spy = jest.fn()
dd_6.$parent.$root.$on('clicked::link', spy)
const buttonItem = Array.from(dd_6.$refs.menu.children).find(node => node.innerHTML === 'button')
buttonItem.click()
expect(spy).toHaveBeenCalled()
})
it('dd-divider should render', async () => {
const {app: {$refs}} = window
const {dd_6} = $refs // eslint-disable-line camelcase
expect(Array.from(dd_6.$refs.menu.children).filter(node => node.classList.contains('dropdown-divider')).length).toBe(1)
})
it('.dropdown menu aria-labelledby should target `_BV_toggle_` when not in split mode', async () => {
const { app: { $refs } } = window
const { dd_1 } = $refs // eslint-disable-line camelcase
const menu = Array.from(dd_1.$el.children)
.find(node => node.attributes.role && node.attributes.role.value === 'menu')
expect(menu.attributes['aria-labelledby'].value).toMatch(/_BV_toggle_$/)
})
it('.dropdown menu aria-labelledby should target `_BV_button_` when in split mode', async () => {
const { app: { $refs } } = window
const { dd_2 } = $refs // eslint-disable-line camelcase
const menu = Array.from(dd_2.$el.children)
.find(node => node.attributes.role && node.attributes.role.value === 'menu')
expect(menu.attributes['aria-labelledby'].value).toMatch(/_BV_button_$/)
})
})
|
// answer-page
import React from 'react';
import ReactDOM from 'react-dom';
import SynapsesTextEditor from './index.js';
const App = (props) => {
return (
<div className="row">
<div className="col-main">
<SynapsesTextEditor />
</div>
<div className="clearfix"></div>
</div>
);
}
ReactDOM.render(
<App />,
document.getElementById('app-root')
);
|
// base translations that get translated
export default {
};
|
var NAVTREEINDEX4 =
{
"classHelix_1_1Glob_1_1IOConn.html#acd0f08614d9fe3419f0313f492e00b3a":[2,0,0,1,21,15],
"classHelix_1_1Glob_1_1IOConn.html#ad07b39a07a30abf02e388410ea06c84c":[2,0,0,1,21,26],
"classHelix_1_1Glob_1_1IOConn.html#ad91e3026218766d839136bfb2a56425a":[2,0,0,1,21,13],
"classHelix_1_1Glob_1_1IOConn.html#ae6663203cf903fe2291e205f4347a752":[2,0,0,1,21,7],
"classHelix_1_1Glob_1_1IOConn.html#ae948054a977cbe1acb52c333f7c70d0f":[2,0,0,1,21,16],
"classHelix_1_1Glob_1_1IOConn.html#aea0f0646a2a98e9fd6e393fb6c80fbdc":[2,0,0,1,21,0],
"classHelix_1_1Glob_1_1IOConn.html#af092e54df7314cda52fb37c4895c2759":[2,0,0,1,21,12],
"classHelix_1_1Glob_1_1IOConn.html#af7830352ad94047f6150681af348fe62":[2,0,0,1,21,19],
"classHelix_1_1Glob_1_1Jvm.html":[2,0,0,1,22],
"classHelix_1_1Glob_1_1Jvm.html#a01ccb9404ea5c30ae98b76fed7c09ba7":[2,0,0,1,22,8],
"classHelix_1_1Glob_1_1Jvm.html#a27d3025663243e2abd4d4298aeec7e3f":[2,0,0,1,22,3],
"classHelix_1_1Glob_1_1Jvm.html#a387e62d8b03f41d7ac3679b8bbfda163":[2,0,0,1,22,6],
"classHelix_1_1Glob_1_1Jvm.html#a3f32e10a3cde016a60948b3750671e32":[2,0,0,1,22,12],
"classHelix_1_1Glob_1_1Jvm.html#a4eca62bfcdbb2516b7045dd0064c42f4":[2,0,0,1,22,1],
"classHelix_1_1Glob_1_1Jvm.html#a65498aa00d07cc770892d5e1f20b8435":[2,0,0,1,22,2],
"classHelix_1_1Glob_1_1Jvm.html#a69a3b52d9b8c42f510db8c1d26379f7f":[2,0,0,1,22,4],
"classHelix_1_1Glob_1_1Jvm.html#a733cba5eb9d57d1d3f98857a90bee007":[2,0,0,1,22,5],
"classHelix_1_1Glob_1_1Jvm.html#a7b235da5edd44c2871ffd977f0c95c14":[2,0,0,1,22,0],
"classHelix_1_1Glob_1_1Jvm.html#aa001d68a4ad975e3daff8fa842fd94b3":[2,0,0,1,22,10],
"classHelix_1_1Glob_1_1Jvm.html#ac66ece367408ba95ef58455738e52cc7":[2,0,0,1,22,9],
"classHelix_1_1Glob_1_1Jvm.html#ac6f6175701ab59c66ad92b832872d472":[2,0,0,1,22,11],
"classHelix_1_1Glob_1_1Jvm.html#ae63d608bf67eee066c8ce3ed9f4d9933":[2,0,0,1,22,7],
"classHelix_1_1Glob_1_1LongRunningTask.html":[2,0,0,1,23],
"classHelix_1_1Glob_1_1LongRunningTask.html#a0411ef32f0c2966ee93cf83cc22f7c5b":[2,0,0,1,23,10],
"classHelix_1_1Glob_1_1LongRunningTask.html#a44d10f845a61d8f370b68a9d4a16065f":[2,0,0,1,23,11],
"classHelix_1_1Glob_1_1LongRunningTask.html#a70af6d1099278028aa67be8a8f6b7e50":[2,0,0,1,23,3],
"classHelix_1_1Glob_1_1LongRunningTask.html#a9e5f53a6672ee2b23d7b57342ea5889f":[2,0,0,1,23,4],
"classHelix_1_1Glob_1_1LongRunningTask.html#ab699764dce22b82bba03f00b0897fcc3":[2,0,0,1,23,9],
"classHelix_1_1Glob_1_1LongRunningTask.html#abf6318a41f5a2c8ed54b4f1c4e41ded9":[2,0,0,1,23,6],
"classHelix_1_1Glob_1_1LongRunningTask.html#ac8dd34a2736dc9facdb734d4690c403b":[2,0,0,1,23,0],
"classHelix_1_1Glob_1_1LongRunningTask.html#acb1abed310f06ee51137b34d15dc6a5d":[2,0,0,1,23,2],
"classHelix_1_1Glob_1_1LongRunningTask.html#ace6816ad80c5b56ed86b1b2738669f6b":[2,0,0,1,23,8],
"classHelix_1_1Glob_1_1LongRunningTask.html#ad0cf8444968febbdada8d0f6867b1bf8":[2,0,0,1,23,12],
"classHelix_1_1Glob_1_1LongRunningTask.html#ada46faafbd46ea54ac1e50d59b621c83":[2,0,0,1,23,7],
"classHelix_1_1Glob_1_1LongRunningTask.html#adca98592cacdf8945fc370aa4f5be3fe":[2,0,0,1,23,5],
"classHelix_1_1Glob_1_1LongRunningTask.html#aff7543f717f410ac73ffc6a183705b30":[2,0,0,1,23,1],
"classHelix_1_1Glob_1_1MsgProcScaler.html":[2,0,0,1,25],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a102cb8047634540b9870b61284c270cf":[2,0,0,1,25,2],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a360db9d1e3bb4f2e234f6c8644994bfe":[2,0,0,1,25,4],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a42f1ef5f6e176fd8865e2f255b079661":[2,0,0,1,25,3],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a587e1059081b373cf73ebc7a8a9dec80":[2,0,0,1,25,1],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a8eef8161e121ac007bed1d903050b9e2":[2,0,0,1,25,6],
"classHelix_1_1Glob_1_1MsgProcScaler.html#a955ff672e2bf9edbb510bf83d158d446":[2,0,0,1,25,8],
"classHelix_1_1Glob_1_1MsgProcScaler.html#abb85cda58f9cb25b7fb9263cfc3a21bb":[2,0,0,1,25,7],
"classHelix_1_1Glob_1_1MsgProcScaler.html#ac15c6c1f6484a1cbad4f9a7c4a7e0a24":[2,0,0,1,25,9],
"classHelix_1_1Glob_1_1MsgProcScaler.html#aea55a3401d465cf62ddeb10613b4fc01":[2,0,0,1,25,5],
"classHelix_1_1Glob_1_1MsgProcScaler.html#af1cb7613dd22a12e1bf183bdfc34fb23":[2,0,0,1,25,0],
"classHelix_1_1Glob_1_1MsgProcessor.html":[2,0,0,1,24],
"classHelix_1_1Glob_1_1MsgProcessor.html#a2d674c9349deb0adc3e7e8ffb6aae2ea":[2,0,0,1,24,5],
"classHelix_1_1Glob_1_1MsgProcessor.html#a2f462fa3811b1293b1f0282598ad6844":[2,0,0,1,24,3],
"classHelix_1_1Glob_1_1MsgProcessor.html#a508218b04af794ae3ace982f7420c2c2":[2,0,0,1,24,1],
"classHelix_1_1Glob_1_1MsgProcessor.html#a70fe0d6385395d3501c9341ece2f5836":[2,0,0,1,24,0],
"classHelix_1_1Glob_1_1MsgProcessor.html#a8112d60b5541e8684904dd4c27fbacb0":[2,0,0,1,24,4],
"classHelix_1_1Glob_1_1MsgProcessor.html#a8c378f3460a14a2c446555eebbc389b5":[2,0,0,1,24,2],
"classHelix_1_1Glob_1_1OdbcDrv.html":[2,0,0,1,26],
"classHelix_1_1Glob_1_1OdbcDrv.html#a0157edd4b65ad89bdd5422235886f615":[2,0,0,1,26,47],
"classHelix_1_1Glob_1_1OdbcDrv.html#a03dfe034a33cad799b436b4d2b66e97a":[2,0,0,1,26,41],
"classHelix_1_1Glob_1_1OdbcDrv.html#a045bfc3d9b3d1bb1f919f6d2f8bdbc9d":[2,0,0,1,26,45],
"classHelix_1_1Glob_1_1OdbcDrv.html#a06d78598affb2cbb6d90e7bf73ffeb4c":[2,0,0,1,26,56],
"classHelix_1_1Glob_1_1OdbcDrv.html#a10d05190b41beb55173ce8ad0a0501d0":[2,0,0,1,26,1],
"classHelix_1_1Glob_1_1OdbcDrv.html#a149545524ef9b4763f77ceaf95b3b989":[2,0,0,1,26,35],
"classHelix_1_1Glob_1_1OdbcDrv.html#a167788a3c2cbba7b1290fa0f168be3c4":[2,0,0,1,26,21],
"classHelix_1_1Glob_1_1OdbcDrv.html#a175988cd153b5f4d8febadade720fd53":[2,0,0,1,26,16],
"classHelix_1_1Glob_1_1OdbcDrv.html#a1b241568bfa65208246ffe1521e5b0e7":[2,0,0,1,26,29],
"classHelix_1_1Glob_1_1OdbcDrv.html#a1b8f72e2791c0369df72fc126948bef3":[2,0,0,1,26,24],
"classHelix_1_1Glob_1_1OdbcDrv.html#a1fdc0a5107d41491e31c0d99c21ca0b1":[2,0,0,1,26,39],
"classHelix_1_1Glob_1_1OdbcDrv.html#a233b7d9b0bd37967b0aa199dcd687d91":[2,0,0,1,26,25],
"classHelix_1_1Glob_1_1OdbcDrv.html#a29287a9e5e9d0b1e0a5bdf6e227a5e9d":[2,0,0,1,26,34],
"classHelix_1_1Glob_1_1OdbcDrv.html#a2a3ed46558754d5c1cd8a75bf0403913":[2,0,0,1,26,62],
"classHelix_1_1Glob_1_1OdbcDrv.html#a2c4fd5a59b4885e12a8592e19252549d":[2,0,0,1,26,65],
"classHelix_1_1Glob_1_1OdbcDrv.html#a2c663d3ac2c3f23abfe2fc285759cf07":[2,0,0,1,26,63],
"classHelix_1_1Glob_1_1OdbcDrv.html#a37206dd922345685549f8821491435f8":[2,0,0,1,26,23],
"classHelix_1_1Glob_1_1OdbcDrv.html#a3b4a7297debb8e0c6a174b5a0c83fbb1":[2,0,0,1,26,11],
"classHelix_1_1Glob_1_1OdbcDrv.html#a3b96a31ae3c618ff4677907ccb2a9b2b":[2,0,0,1,26,9],
"classHelix_1_1Glob_1_1OdbcDrv.html#a41115bd2724723acb198fea5b237e226":[2,0,0,1,26,60],
"classHelix_1_1Glob_1_1OdbcDrv.html#a41bed77917a3536dd88bbc95c67197f9":[2,0,0,1,26,61],
"classHelix_1_1Glob_1_1OdbcDrv.html#a45cda7441ad1dec90d7394f098f97773":[2,0,0,1,26,6],
"classHelix_1_1Glob_1_1OdbcDrv.html#a4608a82a2d736f349fdc11b1431d1b21":[2,0,0,1,26,57],
"classHelix_1_1Glob_1_1OdbcDrv.html#a48045387a25a0653e930ec30c75d740b":[2,0,0,1,26,0],
"classHelix_1_1Glob_1_1OdbcDrv.html#a496aabef7ac9dff34330acb4bf4d28a8":[2,0,0,1,26,27],
"classHelix_1_1Glob_1_1OdbcDrv.html#a4baa081adeae190317032a57df9138e9":[2,0,0,1,26,3],
"classHelix_1_1Glob_1_1OdbcDrv.html#a5a1c0b6d9282047b3d41343d4b436d2d":[2,0,0,1,26,49],
"classHelix_1_1Glob_1_1OdbcDrv.html#a5d9869124ff82c95e07531c7d0359c09":[2,0,0,1,26,12],
"classHelix_1_1Glob_1_1OdbcDrv.html#a5f401b6c60be7f408996806874383d2e":[2,0,0,1,26,53],
"classHelix_1_1Glob_1_1OdbcDrv.html#a609b34f863bd4fba3202389fbbe59288":[2,0,0,1,26,66],
"classHelix_1_1Glob_1_1OdbcDrv.html#a64ed47b14511308ed10bafeb7cb996b4":[2,0,0,1,26,48],
"classHelix_1_1Glob_1_1OdbcDrv.html#a65d3b083e2987e893e27a76cba9364a6":[2,0,0,1,26,22],
"classHelix_1_1Glob_1_1OdbcDrv.html#a6ca63ce4ea59477d522acbd594e59c52":[2,0,0,1,26,44],
"classHelix_1_1Glob_1_1OdbcDrv.html#a6dd38884002a002d4f6f89c2be68e7d6":[2,0,0,1,26,42],
"classHelix_1_1Glob_1_1OdbcDrv.html#a6de03588725a6e78f72353c8396d2a29":[2,0,0,1,26,46],
"classHelix_1_1Glob_1_1OdbcDrv.html#a6de07ea6b002ddd6d3688f7014aea530":[2,0,0,1,26,26],
"classHelix_1_1Glob_1_1OdbcDrv.html#a6f0dda5211dcd47db057b851bda0f39d":[2,0,0,1,26,38],
"classHelix_1_1Glob_1_1OdbcDrv.html#a710f858cad8a2efbb9e6f6038ee667c4":[2,0,0,1,26,36],
"classHelix_1_1Glob_1_1OdbcDrv.html#a746cfc4df9f91ca02f882be8abb3c8c4":[2,0,0,1,26,20],
"classHelix_1_1Glob_1_1OdbcDrv.html#a74aec98e8383c073ec9b6ff9c0c87137":[2,0,0,1,26,14],
"classHelix_1_1Glob_1_1OdbcDrv.html#a7ab5efe69d794deabb61d88e91937211":[2,0,0,1,26,8],
"classHelix_1_1Glob_1_1OdbcDrv.html#a7f2c83edbe88155057a42a5751ae5957":[2,0,0,1,26,2],
"classHelix_1_1Glob_1_1OdbcDrv.html#a87bf0bc9a3214704519e240102fd85f6":[2,0,0,1,26,37],
"classHelix_1_1Glob_1_1OdbcDrv.html#a890f80ae23ab73ffd07cc65421805e68":[2,0,0,1,26,52],
"classHelix_1_1Glob_1_1OdbcDrv.html#a8a9f2c2ad6faf686e28434dcbcad32c8":[2,0,0,1,26,51],
"classHelix_1_1Glob_1_1OdbcDrv.html#a8c546d78dd2b1381716b52ecf16dfaca":[2,0,0,1,26,7],
"classHelix_1_1Glob_1_1OdbcDrv.html#a8e985cef911e6a7f94003ca065dcd791":[2,0,0,1,26,13],
"classHelix_1_1Glob_1_1OdbcDrv.html#a97709ebe07e14851307d9c52a6dd3add":[2,0,0,1,26,10],
"classHelix_1_1Glob_1_1OdbcDrv.html#a9bd9b0a2673c4cb4a18dd3960fb1d587":[2,0,0,1,26,33],
"classHelix_1_1Glob_1_1OdbcDrv.html#aaae374de3165d905b3f6fa8884c37629":[2,0,0,1,26,30],
"classHelix_1_1Glob_1_1OdbcDrv.html#aabb771f3e71386563d0e50eaea9a28e1":[2,0,0,1,26,32],
"classHelix_1_1Glob_1_1OdbcDrv.html#ab46799abcaff14ccc0852a82b2bcc987":[2,0,0,1,26,4],
"classHelix_1_1Glob_1_1OdbcDrv.html#aba158c6b32754feb4397a2d653853c06":[2,0,0,1,26,19],
"classHelix_1_1Glob_1_1OdbcDrv.html#abf6cfc4a665943d774a832709cf62132":[2,0,0,1,26,17],
"classHelix_1_1Glob_1_1OdbcDrv.html#ac0bf634b654ccb848ccea0306ebfcd56":[2,0,0,1,26,5],
"classHelix_1_1Glob_1_1OdbcDrv.html#ac252082cc805e4aa2f812792b0c89b4d":[2,0,0,1,26,15],
"classHelix_1_1Glob_1_1OdbcDrv.html#ac400040e7794c2719d360a606005ec44":[2,0,0,1,26,58],
"classHelix_1_1Glob_1_1OdbcDrv.html#ac6ec18f5b313b52d282a2e3b3abdfb63":[2,0,0,1,26,43],
"classHelix_1_1Glob_1_1OdbcDrv.html#ace08bc8a8bb3e0433cde2a79dd39977f":[2,0,0,1,26,55],
"classHelix_1_1Glob_1_1OdbcDrv.html#ad09e6d36d0ecb4c18c7c097bd338ca29":[2,0,0,1,26,18],
"classHelix_1_1Glob_1_1OdbcDrv.html#ad39141d3bfad42732b5d91a435474de7":[2,0,0,1,26,54],
"classHelix_1_1Glob_1_1OdbcDrv.html#ad6efbe0fbbf7a92fac0355b0c311de4f":[2,0,0,1,26,40],
"classHelix_1_1Glob_1_1OdbcDrv.html#ae4c662b57b774a6b2ceb5b492e3a915f":[2,0,0,1,26,59],
"classHelix_1_1Glob_1_1OdbcDrv.html#aed8b024aacff2887a5c56109a4574ac5":[2,0,0,1,26,31],
"classHelix_1_1Glob_1_1OdbcDrv.html#aef2dafa726c3a0a2a3565acc3704df7b":[2,0,0,1,26,28],
"classHelix_1_1Glob_1_1OdbcDrv.html#af0cce752ac13b1025ee6511530b2828c":[2,0,0,1,26,50],
"classHelix_1_1Glob_1_1OdbcDrv.html#afac92e18a98ac55c9e94c5c24abbbb71":[2,0,0,1,26,64],
"classHelix_1_1Glob_1_1OdbcObj.html":[2,0,0,1,27],
"classHelix_1_1Glob_1_1OdbcObj.html#a03161cf848669fb47fe520223dd59fbb":[2,0,0,1,27,28],
"classHelix_1_1Glob_1_1OdbcObj.html#a036a2c59e2fe18613446797be068be78":[2,0,0,1,27,6],
"classHelix_1_1Glob_1_1OdbcObj.html#a0835e4db34d2fe34e261b9af88c88551":[2,0,0,1,27,16],
"classHelix_1_1Glob_1_1OdbcObj.html#a0b459798e3d94d526f4bfd11954aab08":[2,0,0,1,27,18],
"classHelix_1_1Glob_1_1OdbcObj.html#a0bb4059498bf6c75f5ee163caee26276":[2,0,0,1,27,39],
"classHelix_1_1Glob_1_1OdbcObj.html#a0bbae86d2030a93a71b9d435fe0371f9":[2,0,0,1,27,10],
"classHelix_1_1Glob_1_1OdbcObj.html#a10b4cfc1e071366cccfc5c39aca94ff2":[2,0,0,1,27,24],
"classHelix_1_1Glob_1_1OdbcObj.html#a10d618270f90eba3a2bc59713574fe92":[2,0,0,1,27,20],
"classHelix_1_1Glob_1_1OdbcObj.html#a18de6892fc470d89e18d3af7d8364465":[2,0,0,1,27,40],
"classHelix_1_1Glob_1_1OdbcObj.html#a20e4fa31b0cef26a755bdd967fbf05bb":[2,0,0,1,27,27],
"classHelix_1_1Glob_1_1OdbcObj.html#a2420949d7478e6a5fa68fc5fa46b5198":[2,0,0,1,27,13],
"classHelix_1_1Glob_1_1OdbcObj.html#a27a2d67c6b08e01ef90e218e8d5afb32":[2,0,0,1,27,19],
"classHelix_1_1Glob_1_1OdbcObj.html#a399aa6465d7820965c664f26a9e6ed64":[2,0,0,1,27,23],
"classHelix_1_1Glob_1_1OdbcObj.html#a42d44e9519bd88099b92e870d04ce93f":[2,0,0,1,27,21],
"classHelix_1_1Glob_1_1OdbcObj.html#a4824e3b8c4a2012fc5fb671becf84ce4":[2,0,0,1,27,26],
"classHelix_1_1Glob_1_1OdbcObj.html#a48d5fe246f4af338171476951783c469":[2,0,0,1,27,32],
"classHelix_1_1Glob_1_1OdbcObj.html#a585536c99c85051989f662a1f0f20dd7":[2,0,0,1,27,3],
"classHelix_1_1Glob_1_1OdbcObj.html#a5f406707a0398c80a11df41471216084":[2,0,0,1,27,17],
"classHelix_1_1Glob_1_1OdbcObj.html#a62abe34e83fa1402516ddc4a1ef034cc":[2,0,0,1,27,5],
"classHelix_1_1Glob_1_1OdbcObj.html#a634a75e4acb817c85333f92bdb2f525b":[2,0,0,1,27,8],
"classHelix_1_1Glob_1_1OdbcObj.html#a671ced6855cc68e5fba9a7073835f329":[2,0,0,1,27,34],
"classHelix_1_1Glob_1_1OdbcObj.html#a6e0a85b0c913c547dc0655c5c06808f6":[2,0,0,1,27,41],
"classHelix_1_1Glob_1_1OdbcObj.html#a7206d5f0a604fa4ff5826607abf52840":[2,0,0,1,27,1],
"classHelix_1_1Glob_1_1OdbcObj.html#a7fac5bc6419b41ed74ce2cddb7bff28c":[2,0,0,1,27,7],
"classHelix_1_1Glob_1_1OdbcObj.html#a82eeafea6699f4b89814bdec149908f3":[2,0,0,1,27,30],
"classHelix_1_1Glob_1_1OdbcObj.html#a870dcc45e2e552e1720c4dfcb09718ad":[2,0,0,1,27,42],
"classHelix_1_1Glob_1_1OdbcObj.html#a880e0ed9497f7c22ce9ca5aaab30ea08":[2,0,0,1,27,12],
"classHelix_1_1Glob_1_1OdbcObj.html#a8958c53d0ad293e1fe1c34bc7c373f2f":[2,0,0,1,27,37],
"classHelix_1_1Glob_1_1OdbcObj.html#a8dc467c5ac948d7d7e9c4d5f8cb63af8":[2,0,0,1,27,0],
"classHelix_1_1Glob_1_1OdbcObj.html#a964eb6691e61a5208bdf4200f1b59124":[2,0,0,1,27,33],
"classHelix_1_1Glob_1_1OdbcObj.html#ab6fb41025fc71e9f697b84ff957b6777":[2,0,0,1,27,11],
"classHelix_1_1Glob_1_1OdbcObj.html#ac53c894d593ef8baf76474d39fa11a2d":[2,0,0,1,27,38],
"classHelix_1_1Glob_1_1OdbcObj.html#ac91caf3097392538ec4b8af51972342d":[2,0,0,1,27,15],
"classHelix_1_1Glob_1_1OdbcObj.html#accfcde98103f54719f363e945b0f2834":[2,0,0,1,27,4],
"classHelix_1_1Glob_1_1OdbcObj.html#ad4d80e597ad15aa3767fd671512d5485":[2,0,0,1,27,31],
"classHelix_1_1Glob_1_1OdbcObj.html#adaeec9ca768059e92ad1bf88473b57bc":[2,0,0,1,27,35],
"classHelix_1_1Glob_1_1OdbcObj.html#adccda77d0fd61ca5388483c1e430efa7":[2,0,0,1,27,2],
"classHelix_1_1Glob_1_1OdbcObj.html#add2fd85d7dfc5424a49e53e358fc251a":[2,0,0,1,27,25],
"classHelix_1_1Glob_1_1OdbcObj.html#ae5f3f86c7d725226dd5d8504601737a4":[2,0,0,1,27,22],
"classHelix_1_1Glob_1_1OdbcObj.html#ae8222d7308cce099d2a7eddd14653c1c":[2,0,0,1,27,14],
"classHelix_1_1Glob_1_1OdbcObj.html#af69770e355a2e94d696a592af65bedb5":[2,0,0,1,27,29],
"classHelix_1_1Glob_1_1OdbcObj.html#afa4aa13c8f105c250f4275410cae4514":[2,0,0,1,27,9],
"classHelix_1_1Glob_1_1OdbcObj.html#afd824fe64e7e473a266d31c9cd5035f2":[2,0,0,1,27,36],
"classHelix_1_1Glob_1_1Scaler.html":[2,0,0,1,28],
"classHelix_1_1Glob_1_1Scaler.html#a08f14b9ccf6592213937c3aad24d86f5":[2,0,0,1,28,11],
"classHelix_1_1Glob_1_1Scaler.html#a182f4b3207c499f84fd2b504792ec5d5":[2,0,0,1,28,1],
"classHelix_1_1Glob_1_1Scaler.html#a19b9983294549f149488f930cc9f5186":[2,0,0,1,28,15],
"classHelix_1_1Glob_1_1Scaler.html#a2791f4a912aca39ac0e600bceb5816a6":[2,0,0,1,28,13],
"classHelix_1_1Glob_1_1Scaler.html#a357c2776524a23ef85a5764921635767":[2,0,0,1,28,3],
"classHelix_1_1Glob_1_1Scaler.html#a608d9bac1cdcb546707e8e6e079fdc36":[2,0,0,1,28,10],
"classHelix_1_1Glob_1_1Scaler.html#a6a70bffb32b928fe3da914986a1553a6":[2,0,0,1,28,6],
"classHelix_1_1Glob_1_1Scaler.html#a82b255ced116b74036ebe31f5def4eab":[2,0,0,1,28,17],
"classHelix_1_1Glob_1_1Scaler.html#a83ad3f7e422375ac1b171c31b6da752a":[2,0,0,1,28,14],
"classHelix_1_1Glob_1_1Scaler.html#a8806e2abcfdf9761a20e3a47bf1aef84":[2,0,0,1,28,5],
"classHelix_1_1Glob_1_1Scaler.html#a88abb540f73c2339a9e71eeca314878d":[2,0,0,1,28,9],
"classHelix_1_1Glob_1_1Scaler.html#a9d284db84969c9d445d989657bcffc1c":[2,0,0,1,28,12],
"classHelix_1_1Glob_1_1Scaler.html#aa2a4f541259cc6cf6260f83368a1f81f":[2,0,0,1,28,2],
"classHelix_1_1Glob_1_1Scaler.html#aac7be05d8fc3bb9ad08788785d134ea7":[2,0,0,1,28,8],
"classHelix_1_1Glob_1_1Scaler.html#ab3235c7cabde5d728b16762ac5b64367":[2,0,0,1,28,16],
"classHelix_1_1Glob_1_1Scaler.html#abdf51fc0ddff9f672d7d8a4dc66edf7d":[2,0,0,1,28,0],
"classHelix_1_1Glob_1_1Scaler.html#ac2dfa44304c90adbe201663b85cdf696":[2,0,0,1,28,18],
"classHelix_1_1Glob_1_1Scaler.html#ae2eae13e4b1f1beb65712c9854016e81":[2,0,0,1,28,7],
"classHelix_1_1Glob_1_1Scaler.html#ae6508da5ff48fed6e14a4df8ac48ac9d":[2,0,0,1,28,4],
"classHelix_1_1Glob_1_1SchedConn.html":[2,0,0,1,29],
"classHelix_1_1Glob_1_1SchedConn.html#a0c9f0a31e8ba15c363b8c8b4b1fa447c":[2,0,0,1,29,5],
"classHelix_1_1Glob_1_1SchedConn.html#a116ef34f88379e761cb7b190af62f556":[2,0,0,1,29,7],
"classHelix_1_1Glob_1_1SchedConn.html#a31ff4d0c2a76e01a8506fc46974a0fd0":[2,0,0,1,29,9],
"classHelix_1_1Glob_1_1SchedConn.html#a7fff711e91c7ea48e24536e767c5f95e":[2,0,0,1,29,2],
"classHelix_1_1Glob_1_1SchedConn.html#a866bb13e2835549ce97797a025ec74a9":[2,0,0,1,29,10],
"classHelix_1_1Glob_1_1SchedConn.html#a97bece188b648af3e7c7a23e4c92d21c":[2,0,0,1,29,3],
"classHelix_1_1Glob_1_1SchedConn.html#a9c726435cc926a4cbb24c1273374a298":[2,0,0,1,29,13],
"classHelix_1_1Glob_1_1SchedConn.html#aa0172a642f5bf000a52939e5cb4cf70b":[2,0,0,1,29,1],
"classHelix_1_1Glob_1_1SchedConn.html#aa22fc9d2124cfebd59f0dc5e96779b86":[2,0,0,1,29,8],
"classHelix_1_1Glob_1_1SchedConn.html#aa64154a02c65301ef92383c21f0a097c":[2,0,0,1,29,15],
"classHelix_1_1Glob_1_1SchedConn.html#abd3e73e56512963db4d0f0c4cba690f2":[2,0,0,1,29,0],
"classHelix_1_1Glob_1_1SchedConn.html#aca8cdc8be5f2cfab7dd40f65c92812e2":[2,0,0,1,29,4],
"classHelix_1_1Glob_1_1SchedConn.html#ad8126d1190bb6440e5223c7ef1138ffa":[2,0,0,1,29,16],
"classHelix_1_1Glob_1_1SchedConn.html#ada74f42caa2f40e4d61e63cad7673c11":[2,0,0,1,29,11],
"classHelix_1_1Glob_1_1SchedConn.html#adacd9c4df5322506222e61074acb8d46":[2,0,0,1,29,14],
"classHelix_1_1Glob_1_1SchedConn.html#adc79ca6c0dd37f48175a0c8916057d80":[2,0,0,1,29,12],
"classHelix_1_1Glob_1_1SchedConn.html#af3b10f948d97ee38a2ce20eebf52ae98":[2,0,0,1,29,6],
"classHelix_1_1Glob_1_1SchedEntry.html":[2,0,0,1,30],
"classHelix_1_1Glob_1_1SchedEntry.html#a01c2c756bea712b512f3e45c8d32afc2":[2,0,0,1,30,2],
"classHelix_1_1Glob_1_1SchedEntry.html#a0fa65d94ed5c0c72cb0de9d1b0a41ebc":[2,0,0,1,30,27],
"classHelix_1_1Glob_1_1SchedEntry.html#a1c904fd7ec2be9b5f26a7b0aad87ca41":[2,0,0,1,30,13],
"classHelix_1_1Glob_1_1SchedEntry.html#a21267dd8a136ced6d1659c7eb461db2b":[2,0,0,1,30,9],
"classHelix_1_1Glob_1_1SchedEntry.html#a3255d67f4377eb6ec3d15fd016419d6e":[2,0,0,1,30,21],
"classHelix_1_1Glob_1_1SchedEntry.html#a418aa2ff6d23ec3cdfdafb414cc81929":[2,0,0,1,30,10],
"classHelix_1_1Glob_1_1SchedEntry.html#a51b7d7ff2d1c9591133ddcfac924a9a6":[2,0,0,1,30,8],
"classHelix_1_1Glob_1_1SchedEntry.html#a540e34b219073542fd32ba1dfc7306a3":[2,0,0,1,30,16],
"classHelix_1_1Glob_1_1SchedEntry.html#a56eae5dfc93b5cb80e31a6ec6217d844":[2,0,0,1,30,24],
"classHelix_1_1Glob_1_1SchedEntry.html#a5a81c9a34628aa9f46ecf9494c6e9468":[2,0,0,1,30,22],
"classHelix_1_1Glob_1_1SchedEntry.html#a6af660d0613aa72d06be3dccb9193bce":[2,0,0,1,30,15],
"classHelix_1_1Glob_1_1SchedEntry.html#a6dccbd9c94183902c03b5b356cdeb7d1":[2,0,0,1,30,11],
"classHelix_1_1Glob_1_1SchedEntry.html#a6fe0519e43332f17acd7f5bf7e213a22":[2,0,0,1,30,7],
"classHelix_1_1Glob_1_1SchedEntry.html#a78882805634b7b2a11004b8f46bebdbb":[2,0,0,1,30,4],
"classHelix_1_1Glob_1_1SchedEntry.html#a78bedc960661746ce665ddc6ce93d213":[2,0,0,1,30,18],
"classHelix_1_1Glob_1_1SchedEntry.html#a79c0ba83b14df67649a8747b085a91fe":[2,0,0,1,30,1],
"classHelix_1_1Glob_1_1SchedEntry.html#a871071c2f883f0f9618b451aa61f0f6d":[2,0,0,1,30,12],
"classHelix_1_1Glob_1_1SchedEntry.html#a8d3312f16d47ac12eabb267051f01895":[2,0,0,1,30,17],
"classHelix_1_1Glob_1_1SchedEntry.html#a90dc3b595f10ec8a39487fcd6111bc66":[2,0,0,1,30,3],
"classHelix_1_1Glob_1_1SchedEntry.html#a93ada2aa2d4a549b7b4f9d7d2419e120":[2,0,0,1,30,26],
"classHelix_1_1Glob_1_1SchedEntry.html#aa464d7608425345b85dcaa2ca72cebe3":[2,0,0,1,30,23],
"classHelix_1_1Glob_1_1SchedEntry.html#aab4f26c2793117874c7933842ef2bdf8":[2,0,0,1,30,25],
"classHelix_1_1Glob_1_1SchedEntry.html#ab42d338591c07b847367117a712c39b6":[2,0,0,1,30,14],
"classHelix_1_1Glob_1_1SchedEntry.html#ab5f0a33fb0d0a474591b763fe102d4ca":[2,0,0,1,30,20],
"classHelix_1_1Glob_1_1SchedEntry.html#ac30ef51c1cc8bedf01efbdd201f84da2":[2,0,0,1,30,28],
"classHelix_1_1Glob_1_1SchedEntry.html#ac3b6e0154d6a1e555efb8f0ab78abe34":[2,0,0,1,30,19],
"classHelix_1_1Glob_1_1SchedEntry.html#acdb0481e31e2166aa5413b01d87d756e":[2,0,0,1,30,5],
"classHelix_1_1Glob_1_1SchedEntry.html#acea81113cc9b766bbac5cd8b1cc8aa1c":[2,0,0,1,30,6],
"classHelix_1_1Glob_1_1SchedEntry.html#ae19fd11196603a39521ed81b663b904a":[2,0,0,1,30,0],
"classHelix_1_1Glob_1_1Schedule.html":[2,0,0,1,31],
"classHelix_1_1Glob_1_1Schedule.html#a32d4e4dfd004d5a1181f7791b302a1a1":[2,0,0,1,31,2],
"classHelix_1_1Glob_1_1Schedule.html#a4806b985197d35c00b9e707c0ed87998":[2,0,0,1,31,0],
"classHelix_1_1Glob_1_1Schedule.html#a56635c24ba55db246d603faa20c17380":[2,0,0,1,31,9],
"classHelix_1_1Glob_1_1Schedule.html#a5ffdc13992378c0c8bb718052b1e4581":[2,0,0,1,31,10],
"classHelix_1_1Glob_1_1Schedule.html#a804dd881fc1ab9828db5d045e1f02e59":[2,0,0,1,31,4],
"classHelix_1_1Glob_1_1Schedule.html#a878716f4043a016224a14f78974edf1d":[2,0,0,1,31,1],
"classHelix_1_1Glob_1_1Schedule.html#a9100e48cf40c9ead4c5e2131f617e696":[2,0,0,1,31,6],
"classHelix_1_1Glob_1_1Schedule.html#ac5e1f4a647c3fe327f485e444dac71a6":[2,0,0,1,31,8],
"classHelix_1_1Glob_1_1Schedule.html#ad3507015b6c439c2ba056c342cb99bd4":[2,0,0,1,31,7],
"classHelix_1_1Glob_1_1Schedule.html#af1cc483bbf2c3c08c05e50c0e471b5f0":[2,0,0,1,31,5],
"classHelix_1_1Glob_1_1Schedule.html#af825b04028b765190ba342296f725550":[2,0,0,1,31,3],
"classHelix_1_1Glob_1_1SessionInfo.html":[2,0,0,1,32],
"classHelix_1_1Glob_1_1SessionInfo.html#a06dc382ebfe85d21aa83b42f390f5d6d":[2,0,0,1,32,12],
"classHelix_1_1Glob_1_1SessionInfo.html#a0c3354a1be15b778d42e0c5e945af541":[2,0,0,1,32,11],
"classHelix_1_1Glob_1_1SessionInfo.html#a0e16d7c37a07d4e6fa2cec90d97d6461":[2,0,0,1,32,5]
};
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* Julian Viereck <julian DOT viereck AT gmail DOT com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("../../support/paths");
require("ace/test/mockdom");
}
define(function(require, exports, module) {
var lang = require("pilot/lang");
var EditSession = require("ace/edit_session").EditSession;
var Editor = require("ace/editor").Editor;
var UndoManager = require("ace/undomanager").UndoManager;
var MockRenderer = require("ace/test/mockrenderer");
var Range = require("ace/range").Range;
var assert = require("ace/test/assertions");
function createFoldTestSession() {
var lines = [
"function foo(items) {",
" for (var i=0; i<items.length; i++) {",
" alert(items[i] + \"juhu\");",
" } // Real Tab.",
"}"
];
var session = new EditSession(lines.join("\n"));
session.setUndoManager(new UndoManager());
session.addFold("args...", new Range(0, 13, 0, 18));
session.addFold("foo...", new Range(1, 10, 2, 10));
session.addFold("bar...", new Range(2, 20, 2, 25));
return session;
}
module.exports = {
"test: find matching opening bracket" : function() {
var session = new EditSession(["(()(", "())))"]);
assert.position(session.findMatchingBracket({row: 0, column: 3}), 0, 1);
assert.position(session.findMatchingBracket({row: 1, column: 2}), 1, 0);
assert.position(session.findMatchingBracket({row: 1, column: 3}), 0, 3);
assert.position(session.findMatchingBracket({row: 1, column: 4}), 0, 0);
assert.equal(session.findMatchingBracket({row: 1, column: 5}), null);
},
"test: find matching closing bracket" : function() {
var session = new EditSession(["(()(", "())))"]);
assert.position(session.findMatchingBracket({row: 1, column: 1}), 1, 1);
assert.position(session.findMatchingBracket({row: 1, column: 1}), 1, 1);
assert.position(session.findMatchingBracket({row: 0, column: 4}), 1, 2);
assert.position(session.findMatchingBracket({row: 0, column: 2}), 0, 2);
assert.position(session.findMatchingBracket({row: 0, column: 1}), 1, 3);
assert.equal(session.findMatchingBracket({row: 0, column: 0}), null);
},
"test: match different bracket types" : function() {
var session = new EditSession(["({[", ")]}"]);
assert.position(session.findMatchingBracket({row: 0, column: 1}), 1, 0);
assert.position(session.findMatchingBracket({row: 0, column: 2}), 1, 2);
assert.position(session.findMatchingBracket({row: 0, column: 3}), 1, 1);
assert.position(session.findMatchingBracket({row: 1, column: 1}), 0, 0);
assert.position(session.findMatchingBracket({row: 1, column: 2}), 0, 2);
assert.position(session.findMatchingBracket({row: 1, column: 3}), 0, 1);
},
"test: move lines down" : function() {
var session = new EditSession(["a1", "a2", "a3", "a4"]);
session.moveLinesDown(0, 1);
assert.equal(session.getValue(), ["a3", "a1", "a2", "a4"].join("\n"));
session.moveLinesDown(1, 2);
assert.equal(session.getValue(), ["a3", "a4", "a1", "a2"].join("\n"));
session.moveLinesDown(2, 3);
assert.equal(session.getValue(), ["a3", "a4", "a1", "a2"].join("\n"));
session.moveLinesDown(2, 2);
assert.equal(session.getValue(), ["a3", "a4", "a2", "a1"].join("\n"));
},
"test: move lines up" : function() {
var session = new EditSession(["a1", "a2", "a3", "a4"]);
session.moveLinesUp(2, 3);
assert.equal(session.getValue(), ["a1", "a3", "a4", "a2"].join("\n"));
session.moveLinesUp(1, 2);
assert.equal(session.getValue(), ["a3", "a4", "a1", "a2"].join("\n"));
session.moveLinesUp(0, 1);
assert.equal(session.getValue(), ["a3", "a4", "a1", "a2"].join("\n"));
session.moveLinesUp(2, 2);
assert.equal(session.getValue(), ["a3", "a1", "a4", "a2"].join("\n"));
},
"test: duplicate lines" : function() {
var session = new EditSession(["1", "2", "3", "4"]);
session.duplicateLines(1, 2);
assert.equal(session.getValue(), ["1", "2", "3", "2", "3", "4"].join("\n"));
},
"test: duplicate last line" : function() {
var session = new EditSession(["1", "2", "3"]);
session.duplicateLines(2, 2);
assert.equal(session.getValue(), ["1", "2", "3", "3"].join("\n"));
},
"test: duplicate first line" : function() {
var session = new EditSession(["1", "2", "3"]);
session.duplicateLines(0, 0);
assert.equal(session.getValue(), ["1", "1", "2", "3"].join("\n"));
},
"test: getScreenLastRowColumn": function() {
var session = new EditSession([
"juhu",
"12\t\t34",
"ぁぁa"
]);
assert.equal(session.getScreenLastRowColumn(0), 4);
assert.equal(session.getScreenLastRowColumn(1), 10);
assert.equal(session.getScreenLastRowColumn(2), 5);
},
"test: convert document to screen coordinates" : function() {
var session = new EditSession("01234\t567890\t1234");
session.setTabSize(4);
assert.equal(session.documentToScreenColumn(0, 0), 0);
assert.equal(session.documentToScreenColumn(0, 4), 4);
assert.equal(session.documentToScreenColumn(0, 5), 5);
assert.equal(session.documentToScreenColumn(0, 6), 8);
assert.equal(session.documentToScreenColumn(0, 12), 14);
assert.equal(session.documentToScreenColumn(0, 13), 16);
session.setTabSize(2);
assert.equal(session.documentToScreenColumn(0, 0), 0);
assert.equal(session.documentToScreenColumn(0, 4), 4);
assert.equal(session.documentToScreenColumn(0, 5), 5);
assert.equal(session.documentToScreenColumn(0, 6), 6);
assert.equal(session.documentToScreenColumn(0, 7), 7);
assert.equal(session.documentToScreenColumn(0, 12), 12);
assert.equal(session.documentToScreenColumn(0, 13), 14);
},
"test: convert document to screen coordinates with leading tabs": function() {
var session = new EditSession("\t\t123");
session.setTabSize(4);
assert.equal(session.documentToScreenColumn(0, 0), 0);
assert.equal(session.documentToScreenColumn(0, 1), 4);
assert.equal(session.documentToScreenColumn(0, 2), 8);
assert.equal(session.documentToScreenColumn(0, 3), 9);
},
"test: documentToScreen without soft wrap": function() {
var session = new EditSession([
"juhu",
"12\t\t34",
"ぁぁa"
]);
assert.position(session.documentToScreenPosition(0, 3), 0, 3);
assert.position(session.documentToScreenPosition(1, 3), 1, 4);
assert.position(session.documentToScreenPosition(1, 4), 1, 8);
assert.position(session.documentToScreenPosition(2, 2), 2, 4);
},
"test: documentToScreen with soft wrap": function() {
var session = new EditSession(["foo bar foo bar"]);
session.setUseWrapMode(true);
session.setWrapLimitRange(12, 12);
session.adjustWrapLimit(80);
assert.position(session.documentToScreenPosition(0, 11), 0, 11);
assert.position(session.documentToScreenPosition(0, 12), 1, 0);
},
"test: documentToScreen with soft wrap and multibyte characters": function() {
session = new EditSession(["ぁぁa"]);
session.setUseWrapMode(true);
session.setWrapLimitRange(2, 2);
session.adjustWrapLimit(80);
assert.position(session.documentToScreenPosition(0, 1), 1, 0);
assert.position(session.documentToScreenPosition(0, 2), 2, 0);
assert.position(session.documentToScreenPosition(0, 4), 2, 1);
},
"test: documentToScreen should clip position to the document boundaries": function() {
var session = new EditSession("foo bar\njuhu kinners");
assert.position(session.documentToScreenPosition(-1, 4), 0, 0);
assert.position(session.documentToScreenPosition(3, 0), 1, 12);
},
"test: convert screen to document coordinates" : function() {
var session = new EditSession("01234\t567890\t1234");
session.setTabSize(4);
assert.equal(session.screenToDocumentColumn(0, 0), 0);
assert.equal(session.screenToDocumentColumn(0, 4), 4);
assert.equal(session.screenToDocumentColumn(0, 5), 5);
assert.equal(session.screenToDocumentColumn(0, 6), 5);
assert.equal(session.screenToDocumentColumn(0, 7), 5);
assert.equal(session.screenToDocumentColumn(0, 8), 6);
assert.equal(session.screenToDocumentColumn(0, 9), 7);
assert.equal(session.screenToDocumentColumn(0, 15), 12);
assert.equal(session.screenToDocumentColumn(0, 19), 16);
session.setTabSize(2);
assert.equal(session.screenToDocumentColumn(0, 0), 0);
assert.equal(session.screenToDocumentColumn(0, 4), 4);
assert.equal(session.screenToDocumentColumn(0, 5), 5);
assert.equal(session.screenToDocumentColumn(0, 6), 6);
assert.equal(session.screenToDocumentColumn(0, 12), 12);
assert.equal(session.screenToDocumentColumn(0, 13), 12);
assert.equal(session.screenToDocumentColumn(0, 14), 13);
},
"test: screenToDocument with soft wrap": function() {
var session = new EditSession(["foo bar foo bar"]);
session.setUseWrapMode(true);
session.setWrapLimitRange(12, 12);
session.adjustWrapLimit(80);
assert.position(session.screenToDocumentPosition(1, 0), 0, 12);
assert.position(session.screenToDocumentPosition(0, 11), 0, 11);
// Check if the position is clamped the right way.
assert.position(session.screenToDocumentPosition(0, 12), 0, 11);
assert.position(session.screenToDocumentPosition(0, 20), 0, 11);
},
"test: screenToDocument with soft wrap and multi byte characters": function() {
session = new EditSession(["ぁ a"]);
session.setUseWrapMode(true);
session.adjustWrapLimit(80);
assert.position(session.screenToDocumentPosition(0, 1), 0, 0);
assert.position(session.screenToDocumentPosition(0, 2), 0, 1);
assert.position(session.screenToDocumentPosition(0, 3), 0, 2);
assert.position(session.screenToDocumentPosition(0, 4), 0, 3);
assert.position(session.screenToDocumentPosition(0, 5), 0, 3);
},
"test: screenToDocument should clip position to the document boundaries": function() {
var session = new EditSession("foo bar\njuhu kinners");
assert.position(session.screenToDocumentPosition(-1, 4), 0, 0);
assert.position(session.screenToDocumentPosition(0, -1), 0, 0);
assert.position(session.screenToDocumentPosition(0, 30), 0, 7);
assert.position(session.screenToDocumentPosition(2, 4), 1, 12);
assert.position(session.screenToDocumentPosition(1, 30), 1, 12);
assert.position(session.screenToDocumentPosition(20, 50), 1, 12);
assert.position(session.screenToDocumentPosition(20, 5), 1, 12);
},
"test: wrapLine split function" : function() {
var splits;
var c = 0;
function computeAndAssert(line, assertEqual, wrapLimit, tabSize) {
wrapLimit = wrapLimit || 12;
tabSize = tabSize || 4;
line = lang.stringTrimRight(line);
var tokens = EditSession.prototype.$getDisplayTokens(line);
var splits = EditSession.prototype.$computeWrapSplits(tokens, wrapLimit, tabSize);
// console.log("String:", line, "Result:", splits, "Expected:", assertEqual);
assert.ok(splits.length == assertEqual.length);
for (var i = 0; i < splits.length; i++) {
assert.ok(splits[i] == assertEqual[i]);
}
}
// Basic splitting.
computeAndAssert("foo bar foo bar", [ 12 ]);
computeAndAssert("foo bar f bar", [ 12 ]);
computeAndAssert("foo bar f r", [ 14 ]);
computeAndAssert("foo bar foo bar foo bara foo", [12, 25]);
// Don't split if there is only whitespaces/tabs at the end of the line.
computeAndAssert("foo foo foo \t \t", [ ]);
// If there is no space to split, force split.
computeAndAssert("foooooooooooooo", [ 12 ]);
computeAndAssert("fooooooooooooooooooooooooooo", [12, 24]);
computeAndAssert("foo bar fooooooooooobooooooo", [8, 20]);
// Basic splitting + tabs.
computeAndAssert("foo \t\tbar", [ 6 ]);
computeAndAssert("foo \t \tbar", [ 7 ]);
// Ignore spaces/tabs at beginning of split.
computeAndAssert("foo \t \t \t \t bar", [ 14 ]);
// Test wrapping for asian characters.
computeAndAssert("ぁぁ", [1], 2);
computeAndAssert(" ぁぁ", [1, 2], 2);
computeAndAssert(" ぁ\tぁ", [1, 3], 2);
computeAndAssert(" ぁぁ\tぁ", [1, 4], 4);
},
"test get longest line" : function() {
var session = new EditSession(["12"]);
session.setTabSize(4);
assert.equal(session.getWidth(), 2);
assert.equal(session.getScreenWidth(), 2);
session.doc.insertNewLine(0);
session.doc.insertLines(1, ["123"]);
assert.equal(session.getWidth(), 3);
assert.equal(session.getScreenWidth(), 3);
session.doc.insertNewLine(0);
session.doc.insertLines(1, ["\t\t"]);
assert.equal(session.getWidth(), 3);
assert.equal(session.getScreenWidth(), 8);
session.setTabSize(2);
assert.equal(session.getWidth(), 3);
assert.equal(session.getScreenWidth(), 4);
},
"test getDisplayString": function() {
var session = new EditSession(["12"]);
session.setTabSize(4);
assert.equal(session.$getDisplayTokens("\t").length, 4);
assert.equal(session.$getDisplayTokens("abc").length, 3);
assert.equal(session.$getDisplayTokens("abc\t").length, 4);
},
"test issue 83": function() {
var session = new EditSession("");
var editor = new Editor(new MockRenderer(), session);
var document = session.getDocument();
session.setUseWrapMode(true);
document.insertLines(0, ["a", "b"]);
document.insertLines(2, ["c", "d"]);
document.removeLines(1, 2);
},
"test wrapMode init has to create wrapData array": function() {
var session = new EditSession("foo bar\nfoo bar");
var editor = new Editor(new MockRenderer(), session);
var document = session.getDocument();
session.setUseWrapMode(true);
session.setWrapLimitRange(3, 3);
session.adjustWrapLimit(80);
// Test if wrapData is there and was computed.
assert.equal(session.$wrapData.length, 2);
assert.equal(session.$wrapData[0].length, 1);
assert.equal(session.$wrapData[1].length, 1);
},
"test first line blank with wrap": function() {
var session = new EditSession("\nfoo");
session.setUseWrapMode(true);
assert.equal(session.doc.getValue(), ["", "foo"].join("\n"));
},
"test first line blank with wrap 2" : function() {
var session = new EditSession("");
session.setUseWrapMode(true);
session.setValue("\nfoo");
assert.equal(session.doc.getValue(), ["", "foo"].join("\n"));
},
"test fold getFoldDisplayLine": function() {
var session = createFoldTestSession();
function assertDisplayLine(foldLine, str) {
var line = session.getLine(foldLine.end.row);
var displayLine =
session.getFoldDisplayLine(foldLine, foldLine.end.row, line.length);
assert.equal(displayLine, str);
}
assertDisplayLine(session.$foldData[0], "function foo(args...) {")
assertDisplayLine(session.$foldData[1], " for (vfoo...ert(items[bar...\"juhu\");");
},
"test foldLine idxToPosition": function() {
var session = createFoldTestSession();
function assertIdx2Pos(foldLineIdx, idx, row, column) {
var foldLine = session.$foldData[foldLineIdx];
assert.position(foldLine.idxToPosition(idx), row, column);
}
// "function foo(items) {",
// " for (var i=0; i<items.length; i++) {",
// " alert(items[i] + \"juhu\");",
// " } // Real Tab.",
// "}"
assertIdx2Pos(0, 12, 0, 12);
assertIdx2Pos(0, 13, 0, 13);
assertIdx2Pos(0, 14, 0, 13);
assertIdx2Pos(0, 19, 0, 13);
assertIdx2Pos(0, 20, 0, 18);
assertIdx2Pos(1, 10, 1, 10);
assertIdx2Pos(1, 11, 1, 10);
assertIdx2Pos(1, 15, 1, 10);
assertIdx2Pos(1, 16, 2, 10);
assertIdx2Pos(1, 26, 2, 20);
assertIdx2Pos(1, 27, 2, 20);
assertIdx2Pos(1, 32, 2, 25);
},
"test fold documentToScreen": function() {
var session = createFoldTestSession();
function assertDoc2Screen(docRow, docCol, screenRow, screenCol) {
assert.position(
session.documentToScreenPosition(docRow, docCol),
screenRow, screenCol
);
}
// One fold ending in the same row.
assertDoc2Screen(0, 0, 0, 0);
assertDoc2Screen(0, 13, 0, 13);
assertDoc2Screen(0, 14, 0, 13);
assertDoc2Screen(0, 17, 0, 13);
assertDoc2Screen(0, 18, 0, 20);
// Fold ending on some other row.
assertDoc2Screen(1, 0, 1, 0);
assertDoc2Screen(1, 10, 1, 10);
assertDoc2Screen(1, 11, 1, 10);
assertDoc2Screen(1, 99, 1, 10);
assertDoc2Screen(2, 0, 1, 10);
assertDoc2Screen(2, 9, 1, 10);
assertDoc2Screen(2, 10, 1, 16);
assertDoc2Screen(2, 11, 1, 17);
// Fold in the same row with fold over more then one row in the same row.
assertDoc2Screen(2, 19, 1, 25);
assertDoc2Screen(2, 20, 1, 26);
assertDoc2Screen(2, 21, 1, 26);
assertDoc2Screen(2, 24, 1, 26);
assertDoc2Screen(2, 25, 1, 32);
assertDoc2Screen(2, 26, 1, 33);
assertDoc2Screen(2, 99, 1, 40);
// Test one position after the folds. Should be all like normal.
assertDoc2Screen(3, 0, 2, 0);
},
"test fold screenToDocument": function() {
var session = createFoldTestSession();
function assertScreen2Doc(docRow, docCol, screenRow, screenCol) {
assert.position(
session.screenToDocumentPosition(screenRow, screenCol),
docRow, docCol
);
}
// One fold ending in the same row.
assertScreen2Doc(0, 0, 0, 0);
assertScreen2Doc(0, 13, 0, 13);
assertScreen2Doc(0, 13, 0, 14);
assertScreen2Doc(0, 18, 0, 20);
assertScreen2Doc(0, 19, 0, 21);
// Fold ending on some other row.
assertScreen2Doc(1, 0, 1, 0);
assertScreen2Doc(1, 10, 1, 10);
assertScreen2Doc(1, 10, 1, 11);
assertScreen2Doc(1, 10, 1, 15);
assertScreen2Doc(2, 10, 1, 16);
assertScreen2Doc(2, 11, 1, 17);
// Fold in the same row with fold over more then one row in the same row.
assertScreen2Doc(2, 19, 1, 25);
assertScreen2Doc(2, 20, 1, 26);
assertScreen2Doc(2, 20, 1, 27);
assertScreen2Doc(2, 20, 1, 31);
assertScreen2Doc(2, 25, 1, 32);
assertScreen2Doc(2, 26, 1, 33);
assertScreen2Doc(2, 33, 1, 99);
// Test one position after the folds. Should be all like normal.
assertScreen2Doc(3, 0, 2, 0);
},
"test getFoldsInRange()": function() {
var session = createFoldTestSession(),
foldLines = session.$foldData;
folds = foldLines[0].folds.concat(foldLines[1].folds);
function test(startRow, startColumn, endColumn, endRow, folds) {
var r = new Range(startRow, startColumn, endColumn, endRow);
var retFolds = session.getFoldsInRange(r);
assert.ok(retFolds.length == folds.length);
for (var i = 0; i < retFolds.length; i++) {
assert.equal(retFolds[i].range + "", folds[i].range + "");
}
}
test(0, 0, 0, 13, [ ]);
test(0, 0, 0, 14, [ folds[0] ]);
test(0, 0, 0, 18, [ folds[0] ]);
test(0, 0, 1, 10, [ folds[0] ]);
test(0, 0, 1, 11, [ folds[0], folds[1] ]);
test(0, 18, 1, 11, [ folds[1] ]);
test(2, 0, 2, 13, [ folds[1] ]);
test(2, 10, 2, 20, [ ]);
test(2, 10, 2, 11, [ ]);
test(2, 19, 2, 20, [ ]);
},
"test fold one-line text insert": function() {
// These are mostly test for the FoldLine.addRemoveChars function.
var session = createFoldTestSession();
var undoManager = session.getUndoManager();
var foldLines = session.$foldData;
function insert(row, column, text) {
session.insert({row: row, column: column}, text);
// Force the session to store all changes made to the document NOW
// on the undoManager's queue. Otherwise we can't undo in separate
// steps later.
session.$syncInformUndoManager();
}
var foldLine, fold, folds;
// First line.
foldLine = session.$foldData[0];
fold = foldLine.folds[0];
insert(0, 0, "0");
assert.range(foldLine.range, 0, 14, 0, 19);
assert.range(fold.range, 0, 14, 0, 19);
insert(0, 14, "1");
assert.range(foldLine.range, 0, 15, 0, 20);
assert.range(fold.range, 0, 15, 0, 20);
insert(0, 20, "2");
assert.range(foldLine.range, 0, 15, 0, 20);
assert.range(fold.range, 0, 15, 0, 20);
// Second line.
foldLine = session.$foldData[1];
folds = foldLine.folds;
insert(1, 0, "3");
assert.range(foldLine.range, 1, 11, 2, 25);
assert.range(folds[0].range, 1, 11, 2, 10);
assert.range(folds[1].range, 2, 20, 2, 25);
insert(1, 11, "4");
assert.range(foldLine.range, 1, 12, 2, 25);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 20, 2, 25);
insert(2, 10, "5");
assert.range(foldLine.range, 1, 12, 2, 26);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 21, 2, 26);
insert(2, 21, "6");
assert.range(foldLine.range, 1, 12, 2, 27);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 22, 2, 27);
insert(2, 27, "7");
assert.range(foldLine.range, 1, 12, 2, 27);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 22, 2, 27);
// UNDO = REMOVE
undoManager.undo(); // 6
assert.range(foldLine.range, 1, 12, 2, 27);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 22, 2, 27);
undoManager.undo(); // 5
assert.range(foldLine.range, 1, 12, 2, 26);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 21, 2, 26);
undoManager.undo(); // 4
assert.range(foldLine.range, 1, 12, 2, 25);
assert.range(folds[0].range, 1, 12, 2, 10);
assert.range(folds[1].range, 2, 20, 2, 25);
undoManager.undo(); // 3
assert.range(foldLine.range, 1, 11, 2, 25);
assert.range(folds[0].range, 1, 11, 2, 10);
assert.range(folds[1].range, 2, 20, 2, 25);
undoManager.undo(); // Beginning first line.
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 0, 15, 0, 20);
assert.range(foldLines[1].range, 1, 10, 2, 25);
foldLine = session.$foldData[0];
fold = foldLine.folds[0];
undoManager.undo(); // 2
assert.range(foldLine.range, 0, 15, 0, 20);
assert.range(fold.range, 0, 15, 0, 20);
undoManager.undo(); // 1
assert.range(foldLine.range, 0, 14, 0, 19);
assert.range(fold.range, 0, 14, 0, 19);
undoManager.undo(); // 0
assert.range(foldLine.range, 0, 13, 0, 18);
assert.range(fold.range, 0, 13, 0, 18);
},
"test fold multi-line insert/remove": function() {
var session = createFoldTestSession(),
undoManager = session.getUndoManager(),
foldLines = session.$foldData;
function insert(row, column, text) {
session.insert({row: row, column: column}, text);
// Force the session to store all changes made to the document NOW
// on the undoManager's queue. Otherwise we can't undo in separate
// steps later.
session.$syncInformUndoManager();
}
var foldLines = session.$foldData, foldLine, fold, folds;
insert(0, 0, "\nfo0");
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 2, 10, 3, 25);
insert(2, 0, "\nba1");
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 3, 13, 4, 25);
insert(3, 10, "\nfo2");
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 4, 6, 5, 25);
insert(5, 10, "\nba3");
assert.equal(foldLines.length, 3);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 4, 6, 5, 10);
assert.range(foldLines[2].range, 6, 13, 6, 18);
insert(6, 18, "\nfo4");
assert.equal(foldLines.length, 3);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 4, 6, 5, 10);
assert.range(foldLines[2].range, 6, 13, 6, 18);
undoManager.undo(); // 3
assert.equal(foldLines.length, 3);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 4, 6, 5, 10);
assert.range(foldLines[2].range, 6, 13, 6, 18);
undoManager.undo(); // 2
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 4, 6, 5, 25);
undoManager.undo(); // 1
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 3, 13, 4, 25);
undoManager.undo(); // 0
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 1, 16, 1, 21);
assert.range(foldLines[1].range, 2, 10, 3, 25);
undoManager.undo(); // Beginning
assert.equal(foldLines.length, 2);
assert.range(foldLines[0].range, 0, 13, 0, 18);
assert.range(foldLines[1].range, 1, 10, 2, 25);
// TODO: Add test for inseration inside of folds.
},
"test fold wrap data compution": function() {
function assertArray(a, b) {
assert.ok(a.length == b.length);
for (var i = 0; i < a.length; i++) {
assert.equal(a[i], b[i]);
}
}
function assertWrap(line0, line1, line2) {
line0 && assertArray(wrapData[0], line0);
line1 && assertArray(wrapData[1], line1);
line2 && assertArray(wrapData[2], line2);
}
function removeFoldAssertWrap(docRow, docColumn, line0, line1, line2) {
session.removeFold(session.getFoldAt(docRow, docColumn));
assertWrap(line0, line1, line2);
}
var lines = [
"foo bar foo bar",
"foo bar foo bar",
"foo bar foo bar"
];
var session = new EditSession(lines.join("\n"));
session.setUseWrapMode(true);
session.$wrapLimit = 7;
session.$updateWrapData(0, 2);
var wrapData = session.$wrapData;
// Do a simple assertion without folds to check basic functionallity.
assertWrap([8], [8], [8]);
// --- Do in line folding ---
// Adding a fold. The split position is inside of the fold. As placeholder
// are not splitable, the split should be before the split.
session.addFold("woot", new Range(0, 4, 0, 15));
assertWrap([4], [8], [8]);
// Remove the fold again which should reset the wrapData.
removeFoldAssertWrap(0, 4, [8], [8], [8]);
session.addFold("woot", new Range(0, 6, 0, 9));
assertWrap([6, 13], [8], [8]);
removeFoldAssertWrap(0, 6, [8], [8], [8]);
// The fold fits into the wrap limit - no split expected.
session.addFold("woot", new Range(0, 3, 0, 15));
assertWrap([], [8], [8]);
removeFoldAssertWrap(0, 4, [8], [8], [8]);
// Fold after split position should be all fine.
session.addFold("woot", new Range(0, 8, 0, 15));
assertWrap([8], [8], [8]);
removeFoldAssertWrap(0, 8, [8], [8], [8]);
// Fold's placeholder is far too long for wrapSplit.
session.addFold("woot0123456789", new Range(0, 8, 0, 15));
assertWrap([8], [8], [8]);
removeFoldAssertWrap(0, 8, [8], [8], [8]);
// Fold's placeholder is far too long for wrapSplit
// + content at the end of the line
session.addFold("woot0123456789", new Range(0, 6, 0, 8));
assertWrap([6, 20], [8], [8]);
removeFoldAssertWrap(0, 8, [8], [8], [8]);
session.addFold("woot0123456789", new Range(0, 6, 0, 8));
session.addFold("woot0123456789", new Range(0, 8, 0, 10));
assertWrap([6, 20, 34], [8], [8]);
session.removeFold(session.getFoldAt(0, 7));
removeFoldAssertWrap(0, 8, [8], [8], [8]);
session.addFold("woot0123456789", new Range(0, 7, 0, 9));
session.addFold("woot0123456789", new Range(0, 13, 0, 15));
assertWrap([7, 21, 25], [8], [8]);
session.removeFold(session.getFoldAt(0, 7));
removeFoldAssertWrap(0, 14, [8], [8], [8]);
// --- Do some multiline folding ---
// Add a fold over two lines. Note, that the wrapData[1] stays the
// same. This is an implementation detail and expected behavior.
session.addFold("woot", new Range(0, 8, 1, 15));
assertWrap([8], [8 /* See comments */], [8]);
removeFoldAssertWrap(0, 8, [8], [8], [8]);
session.addFold("woot", new Range(0, 9, 1, 11));
assertWrap([8, 14], [8 /* See comments */], [8]);
removeFoldAssertWrap(0, 9, [8], [8], [8]);
session.addFold("woot", new Range(0, 9, 1, 15));
assertWrap([8], [8 /* See comments */], [8]);
removeFoldAssertWrap(0, 9, [8], [8], [8]);
return session;
},
"test add fold": function() {
var session = createFoldTestSession();
var fold;
function tryAddFold(placeholder, range, shouldFail) {
var fail = false;
try {
fold = session.addFold(placeholder, range);
} catch (e) {
fail = true;
}
if (fail != shouldFail) {
throw "Expected to get an exception";
}
}
tryAddFold("foo", new Range(0, 13, 0, 17), true);
tryAddFold("foo", new Range(0, 14, 0, 18), true);
tryAddFold("foo", new Range(0, 13, 0, 18), false);
assert.equal(session.$foldData[0].folds.length, 1);
tryAddFold("f", new Range(0, 13, 0, 18), true);
tryAddFold("foo", new Range(0, 18, 0, 21), false);
assert.equal(session.$foldData[0].folds.length, 2);
session.removeFold(fold);
tryAddFold("foo", new Range(0, 18, 0, 22), true);
tryAddFold("foo", new Range(0, 18, 0, 19), true);
tryAddFold("foo", new Range(0, 22, 1, 10), true);
},
"test add subfolds": function() {
var session = createFoldTestSession();
var fold, oldFold;
var foldData = session.$foldData;
oldFold = foldData[0].folds[0];
fold = session.addFold("fold0", new Range(0, 10, 0, 21));
assert.equal(foldData[0].folds.length, 1);
assert.equal(fold.subFolds.length, 1);
assert.equal(fold.subFolds[0], oldFold);
session.expandFold(fold);
assert.equal(foldData[0].folds.length, 1);
assert.equal(foldData[0].folds[0], oldFold);
assert.equal(fold.subFolds.length, 0);
fold = session.addFold("fold0", new Range(0, 13, 2, 10));
assert.equal(foldData.length, 1);
assert.equal(fold.subFolds.length, 2);
assert.equal(fold.subFolds[0], oldFold);
session.expandFold(fold);
assert.equal(foldData.length, 2);
assert.equal(foldData[0].folds.length, 1);
assert.equal(foldData[0].folds[0], oldFold);
assert.equal(fold.subFolds.length, 0);
}
};
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec()
}
|
const processHelpString = require('../../helpers/process-help-string');
const versionUtils = require('../../../lib/utilities/version-utils');
var emberCLIVersion = versionUtils.emberCLIVersion;
module.exports = {
name: 'ember',
description: null,
aliases: [],
works: 'insideProject',
availableOptions: [],
anonymousOptions: ['<command (Default: help)>'],
version: emberCLIVersion(),
commands: [
{
name: 'addon',
description: 'Generates a new folder structure for building an addon, complete with test harness.',
aliases: [],
works: 'outsideProject',
availableOptions: [
{
name: 'dry-run',
default: false,
aliases: ['d'],
key: 'dryRun',
required: false
},
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'blueprint',
default: 'addon',
aliases: ['b'],
key: 'blueprint',
required: false
},
{
name: 'skip-npm',
default: false,
aliases: ['sn'],
key: 'skipNpm',
required: false
},
{
name: 'skip-bower',
default: false,
aliases: ['sb'],
key: 'skipBower',
required: false
},
{
name: 'skip-git',
default: false,
aliases: ['sg'],
key: 'skipGit',
required: false
},
{
name: 'yarn',
default: false,
key: 'yarn',
required: false
},
{
name: 'directory',
aliases: ['dir'],
key: 'directory',
required: false
}
],
anonymousOptions: ['<addon-name>']
},
{
name: 'asset-sizes',
description: 'Shows the sizes of your asset files.',
works: 'insideProject',
aliases: [],
anonymousOptions: [],
availableOptions: [
{
name: 'output-path',
default: 'dist/',
key: 'outputPath',
required: false,
aliases: ['o'],
type: 'Path'
},
{
default: false,
key: 'json',
name: 'json',
required: false
}
]
},
{
name: 'build',
description: 'Builds your app and places it into the output path (dist/ by default).',
aliases: ['b'],
works: 'insideProject',
availableOptions: [
{
name: 'environment',
description: 'Possible values are "development", "production", and "test".',
default: 'development',
aliases: [
'e',
{ dev: 'development' },
{ prod: 'production' }
],
key: 'environment',
required: false
},
{
name: 'output-path',
default: 'dist/',
aliases: ['o'],
key: 'outputPath',
required: false,
type: 'Path',
},
{
name: 'watch',
default: false,
aliases: ['w'],
key: 'watch',
required: false
},
{
name: 'watcher',
key: 'watcher',
required: false
},
{
name: 'suppress-sizes',
default: false,
key: 'suppressSizes',
required: false
}
],
anonymousOptions: []
},
{
name: 'destroy',
description: 'Destroys code generated by `generate` command.',
aliases: ['d'],
works: 'insideProject',
availableOptions: [
{
name: 'dry-run',
default: false,
aliases: ['d'],
key: 'dryRun',
required: false
},
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'pod',
default: false,
aliases: ['p'],
key: 'pod',
required: false
},
{
name: 'classic',
default: false,
aliases: ['c'],
key: 'classic',
required: false
},
{
name: 'dummy',
default: false,
aliases: ['dum', 'id'],
key: 'dummy',
required: false
},
{
name: 'in-repo-addon',
default: null,
aliases: ['in-repo', 'ir'],
key: 'inRepoAddon',
required: false
}
],
anonymousOptions: ['<blueprint>']
},
{
name: 'generate',
description: 'Generates new code from blueprints.',
aliases: ['g'],
works: 'insideProject',
availableOptions: [
{
name: 'dry-run',
default: false,
aliases: ['d'],
key: 'dryRun',
required: false
},
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'pod',
default: false,
aliases: ['p'],
key: 'pod',
required: false
},
{
name: 'classic',
default: false,
aliases: ['c'],
key: 'classic',
required: false
},
{
name: 'dummy',
default: false,
aliases: ['dum', 'id'],
key: 'dummy',
required: false
},
{
name: 'in-repo-addon',
default: null,
aliases: ['in-repo', 'ir'],
key: 'inRepoAddon',
required: false
}
],
anonymousOptions: ['<blueprint>'],
availableBlueprints: [
{
fixtures: [
{
name: 'basic',
description: 'A basic blueprint',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'basic_2',
description: 'Another basic blueprint',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'exporting-object',
description: 'A blueprint that exports an object',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'with-templating',
description: 'A blueprint with templating',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
}
]
},
{
'ember-cli': [
{
name: 'addon',
description: 'The default blueprint for ember-cli addons.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'addon-import',
description: 'Generates an import wrapper.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'app',
description: 'The default blueprint for ember-cli projects.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'blueprint',
description: 'Generates a blueprint and definition.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'http-mock',
description: 'Generates a mock api endpoint in /api prefix.',
availableOptions: [],
anonymousOptions: ['endpoint-path'],
overridden: false
},
{
name: 'http-proxy',
description: 'Generates a relative proxy to another server.',
availableOptions: [],
anonymousOptions: ['local-path', 'remote-url'],
overridden: false
},
{
name: 'in-repo-addon',
description: 'The blueprint for addon in repo ember-cli addons.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'lib',
description: 'Generates a lib directory for in-repo addons.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'server',
description: 'Generates a server directory for mocks and proxies.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
},
{
name: 'vendor-shim',
description: 'Generates an ES6 module shim for global libraries.',
availableOptions: [],
anonymousOptions: ['name'],
overridden: false
}
]
}
]
},
{
name: 'help',
description: 'Outputs the usage instructions for all commands or the provided command',
aliases: [null, 'h', '--help', '-h'],
works: 'everywhere',
availableOptions: [
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'json',
default: false,
key: 'json',
required: false
}
],
anonymousOptions: ['<command-name (Default: all)>']
},
{
name: 'init',
description: 'Creates a new ember-cli project in the current folder.',
aliases: [],
works: 'everywhere',
availableOptions: [
{
name: 'dry-run',
default: false,
aliases: ['d'],
key: 'dryRun',
required: false
},
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'blueprint',
aliases: ['b'],
key: 'blueprint',
required: false
},
{
name: 'skip-npm',
default: false,
aliases: ['sn'],
key: 'skipNpm',
required: false
},
{
name: 'skip-bower',
default: false,
aliases: ['sb'],
key: 'skipBower',
required: false
},
{
name: 'welcome',
key: 'welcome',
description: 'Installs and uses {{ember-welcome-page}}. Use --no-welcome to skip it.',
default: true,
required: false
},
{
name: 'yarn',
key: 'yarn',
required: false
},
{
name: 'name',
default: '',
aliases: ['n'],
key: 'name',
required: false
}
],
anonymousOptions: ['<glob-pattern>']
},
{
name: 'install',
description: 'Installs an ember-cli addon from npm.',
aliases: ['i'],
works: 'insideProject',
availableOptions: [
{
name: 'save',
default: false,
aliases: ['S'],
key: 'save',
required: false
},
{
name: 'save-dev',
default: true,
aliases: ['D'],
key: 'saveDev',
required: false
},
{
name: 'save-exact',
default: false,
aliases: ['E', 'exact'],
key: 'saveExact',
required: false
},
{
name: 'yarn',
key: 'yarn',
required: false,
description: 'Use --yarn to enforce yarn usage, or --no-yarn to enforce npm'
}
],
anonymousOptions: ['<addon-name>']
},
{
name: 'new',
description: processHelpString('Creates a new directory and runs \u001b[32member init\u001b[39m in it.'),
aliases: [],
works: 'outsideProject',
availableOptions: [
{
name: 'dry-run',
default: false,
aliases: ['d'],
key: 'dryRun',
required: false
},
{
name: 'verbose',
default: false,
aliases: ['v'],
key: 'verbose',
required: false
},
{
name: 'blueprint',
default: 'app',
aliases: ['b'],
key: 'blueprint',
required: false
},
{
name: 'skip-npm',
default: false,
aliases: ['sn'],
key: 'skipNpm',
required: false
},
{
name: 'skip-bower',
default: false,
aliases: ['sb'],
key: 'skipBower',
required: false
},
{
name: 'skip-git',
default: false,
aliases: ['sg'],
key: 'skipGit',
required: false
},
{
name: 'welcome',
key: 'welcome',
description: 'Installs and uses {{ember-welcome-page}}. Use --no-welcome to skip it.',
default: true,
required: false
},
{
name: 'yarn',
key: 'yarn',
required: false
},
{
name: 'directory',
aliases: ['dir'],
key: 'directory',
required: false
}
],
anonymousOptions: ['<app-name>']
},
{
name: 'serve',
description: 'Builds and serves your app, rebuilding on file changes.',
aliases: ['server', 's'],
works: 'insideProject',
availableOptions: [
{
name: 'port',
default: 4200,
description: 'To use a port different than 4200. Pass 0 to automatically pick an available port.',
aliases: ['p'],
key: 'port',
required: false
},
{
name: 'host',
description: 'Listens on all interfaces by default',
aliases: ['H'],
key: 'host',
required: false
},
{
name: 'proxy',
aliases: ['pr', 'pxy'],
key: 'proxy',
required: false
},
{
name: 'secure-proxy',
default: true,
description: 'Set to false to proxy self-signed SSL certificates',
aliases: ['spr'],
key: 'secureProxy',
required: false
},
{
name: 'transparent-proxy',
default: true,
description: 'Set to false to omit x-forwarded-* headers when proxying',
aliases: ['transp'],
key: 'transparentProxy',
required: false
},
{
name: 'watcher',
default: 'events',
aliases: ['w'],
key: 'watcher',
required: false
},
{
name: 'live-reload',
default: true,
aliases: ['lr'],
key: 'liveReload',
required: false
},
{
name: 'live-reload-host',
description: 'Defaults to host',
aliases: ['lrh'],
key: 'liveReloadHost',
required: false
},
{
aliases: ['lrbu'],
description: 'Defaults to baseURL',
key: 'liveReloadBaseUrl',
name: 'live-reload-base-url',
required: false
},
{
name: 'live-reload-port',
description: '(Defaults to port number within [49152...65535])',
aliases: ['lrp'],
key: 'liveReloadPort',
required: false
},
{
name: 'environment',
description: 'Possible values are "development", "production", and "test".',
default: 'development',
aliases: [
'e',
{ dev: 'development' },
{ prod: 'production' }
],
key: 'environment',
required: false
},
{
name: 'output-path',
default: 'dist/',
aliases: ['op', 'out'],
key: 'outputPath',
required: false,
type: 'Path',
},
{
name: 'ssl',
default: false,
key: 'ssl',
required: false
},
{
name: 'ssl-key',
default: 'ssl/server.key',
key: 'sslKey',
required: false
},
{
name: 'ssl-cert',
default: 'ssl/server.crt',
key: 'sslCert',
required: false
}
],
anonymousOptions: []
},
{
name: 'test',
description: 'Runs your app\'s test suite.',
aliases: ['t'],
works: 'insideProject',
availableOptions: [
{
name: 'environment',
description: 'Possible values are "development", "production", and "test".',
default: 'test',
aliases: ['e'],
key: 'environment',
required: false
},
{
name: 'config-file',
aliases: ['c', 'cf'],
key: 'configFile',
required: false
},
{
name: 'server',
default: false,
aliases: ['s'],
key: 'server',
required: false
},
{
name: 'host',
aliases: ['H'],
key: 'host',
required: false
},
{
name: 'test-port',
default: 7357,
description: 'The test port to use when running tests. Pass 0 to automatically pick an available port',
aliases: ['tp'],
key: 'testPort',
required: false
},
{
name: 'filter',
description: 'A string to filter tests to run',
aliases: ['f'],
key: 'filter',
required: false
},
{
name: 'module',
description: 'The name of a test module to run',
aliases: ['m'],
key: 'module',
required: false
},
{
name: 'watcher',
default: 'events',
aliases: ['w'],
key: 'watcher',
required: false
},
{
name: 'launch',
default: false,
description: 'A comma separated list of browsers to launch for tests.',
key: 'launch',
required: false
},
{
name: 'reporter',
description: 'Test reporter to use [tap|dot|xunit] (default: tap)',
aliases: ['r'],
key: 'reporter',
required: false
},
{
name: 'silent',
default: false,
description: 'Suppress any output except for the test report',
key: 'silent',
required: false
},
{
name: 'testem-debug',
description: 'File to write a debug log from testem',
key: 'testemDebug',
required: false
},
{
name: 'test-page',
description: 'Test page to invoke',
key: 'testPage',
required: false
},
{
name: 'path',
description: 'Reuse an existing build at given path.',
key: 'path',
required: false,
type: 'Path',
},
{
name: 'query',
description: 'A query string to append to the test page URL.',
key: 'query',
required: false
}
],
anonymousOptions: []
},
{
name: 'version',
description: 'outputs ember-cli version',
aliases: ['v', '--version', '-v'],
works: 'everywhere',
availableOptions: [
{
name: 'verbose',
default: false,
key: 'verbose',
required: false
}
],
anonymousOptions: []
}
],
addons: []
};
|
import Config from '../config';
/**
* Given a base channel name, applies the global prefix.
*
* @param baseChannelName
* @return {string}
*/
export default function getChannelName(baseChannelName) {
return (Config.globalRedisPrefix || '') + baseChannelName;
}
|
import React, {PropTypes} from 'react';
import Helmet from 'react-helmet';
import {connect} from 'react-redux';
import {createStructuredSelector} from 'reselect';
import {push } from 'react-router-redux'
import Timeline from '../../components/Timeline';
import {loadAuthors} from '../App/actions';
import {makeSelectLocale} from '../../containers/LanguageProvider/selectors';
import {makeSelectAuthors, makeSelectLoading, makeSelectError} from 'containers/App/selectors';
import {makeSelectCurrentAuthor, makeSelectAuthor} from './selectors';
import RevealList from '../../components/RevealList';
export class AuthorsView extends React.PureComponent {
componentWillMount() {
this.props.fetchAuthors(this.props.locale);
}
selectAndSetLink(authorName){
if(authorName !== 'church-fathers' && this.props.currentAuthor !== authorName) this.props.changeLink(authorName.split(" ").join("-"));
}
onTimelineChange(unique_id){
this.selectAndSetLink(unique_id)
}
render(){
const currentSlide = (this.props.currentAuthor) ? this.props.currentAuthor.name : "";
return (<div>
<Helmet title="HomePage" meta={[{
name: 'description',
content: 'Description of HomePage'
}
]}/>
<Timeline
currentSlide={currentSlide}
onEventChange={this.onTimelineChange.bind(this)}
lang={this.props.locale}
events={this.props.authors}
startDateType={'birthDate'}
endDateType={'deathDate'}
type={"author"}
headline={'Church Fathers'}
text={'Title[1] mark<span class=\"tl-note\">Explore the chronology of the church fathers</span>'}/>
<div>
{this.props.children}
</div>
</div>)
}
}
AuthorsView.propTypes = {
dispatch: PropTypes.func.isRequired,
currentAuthor: PropTypes.any
};
const mapStateToProps = createStructuredSelector({
authors: makeSelectAuthors(),
locale: makeSelectLocale(),
currentAuthor: makeSelectAuthor()
});
function mapDispatchToProps(dispatch) {
return {
dispatch,
changeLink: (a)=>{
dispatch(push('/authors/' + a));
},
fetchAuthors: (evt) => {
dispatch(loadAuthors(evt));
}
};
}
export default connect(mapStateToProps, mapDispatchToProps)(AuthorsView);
|
/**
* Import Angular
*/
import { ANALYZE_FOR_ENTRY_COMPONENTS, APP_INITIALIZER, ComponentFactoryResolver, Inject, Injector, NgModule, NgZone, Optional } from '@angular/core';
import { APP_BASE_HREF, HashLocationStrategy, Location, LocationStrategy, PathLocationStrategy, PlatformLocation } from '@angular/common';
import { DOCUMENT, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
/**
* Global Providers
*/
import { App } from './components/app/app';
import { AppRootToken } from './components/app/app-root';
import { Config, ConfigToken, setupConfig } from './config/config';
import { DeepLinker, setupDeepLinker } from './navigation/deep-linker';
import { DomController } from './platform/dom-controller';
import { Events, setupProvideEvents } from './util/events';
import { Form } from './util/form';
import { GestureController } from './gestures/gesture-controller';
import { IonicGestureConfig } from './gestures/gesture-config';
import { Haptic } from './tap-click/haptic';
import { Keyboard } from './platform/keyboard';
import { LAZY_LOADED_TOKEN, ModuleLoader, provideModuleLoader, setupPreloading } from './util/module-loader';
import { NgModuleLoader } from './util/ng-module-loader';
import { Platform, setupPlatform } from './platform/platform';
import { PlatformConfigToken, providePlatformConfigs } from './platform/platform-registry';
import { TapClick, setupTapClick } from './tap-click/tap-click';
import { registerModeConfigs } from './config/mode-registry';
import { TransitionController } from './transitions/transition-controller';
import { DeepLinkConfigToken, UrlSerializer, setupUrlSerializer } from './navigation/url-serializer';
/**
* Import Components/Directives/Etc
*/
import { ActionSheetCmp } from './components/action-sheet/action-sheet-component';
import { ActionSheetController } from './components/action-sheet/action-sheet-controller';
import { AlertCmp } from './components/alert/alert-component';
import { AlertController } from './components/alert/alert-controller';
import { ClickBlock } from './components/app/click-block';
import { IonicApp } from './components/app/app-root';
import { OverlayPortal } from './components/app/overlay-portal';
import { Avatar } from './components/avatar/avatar';
import { Backdrop } from './components/backdrop/backdrop';
import { Badge } from './components/badge/badge';
import { Button } from './components/button/button';
import { Card } from './components/card/card';
import { CardContent } from './components/card/card-content';
import { CardHeader } from './components/card/card-header';
import { CardTitle } from './components/card/card-title';
import { Checkbox } from './components/checkbox/checkbox';
import { Chip } from './components/chip/chip';
import { Content } from './components/content/content';
import { DateTime } from './components/datetime/datetime';
import { FabButton } from './components/fab/fab';
import { FabContainer } from './components/fab/fab-container';
import { FabList } from './components/fab/fab-list';
import { Col } from './components/grid/col';
import { Grid } from './components/grid/grid';
import { Row } from './components/grid/row';
import { Icon } from './components/icon/icon';
import { Img } from './components/img/img';
import { InfiniteScroll } from './components/infinite-scroll/infinite-scroll';
import { InfiniteScrollContent } from './components/infinite-scroll/infinite-scroll-content';
import { TextInput } from './components/input/input';
import { Item } from './components/item/item';
import { ItemContent } from './components/item/item-content';
import { ItemDivider } from './components/item/item-divider';
import { ItemGroup } from './components/item/item-group';
import { ItemOptions } from './components/item/item-options';
import { ItemReorder } from './components/item/item-reorder';
import { ItemSliding } from './components/item/item-sliding';
import { Reorder } from './components/item/reorder';
import { Label } from './components/label/label';
import { List } from './components/list/list';
import { ListHeader } from './components/list/list-header';
import { LoadingCmp } from './components/loading/loading-component';
import { LoadingController } from './components/loading/loading-controller';
import { Menu } from './components/menu/menu';
import { MenuClose } from './components/menu/menu-close';
import { MenuController } from './components/app/menu-controller';
import { MenuToggle } from './components/menu/menu-toggle';
import { ModalCmp } from './components/modal/modal-component';
import { ModalController } from './components/modal/modal-controller';
import { Nav } from './components/nav/nav';
import { NavPop } from './components/nav/nav-pop';
import { NavPopAnchor } from './components/nav/nav-pop-anchor';
import { NavPush } from './components/nav/nav-push';
import { NavPushAnchor } from './components/nav/nav-push-anchor';
import { Note } from './components/note/note';
import { Option } from './components/option/option';
import { PickerCmp } from './components/picker/picker-component';
import { PickerColumnCmp } from './components/picker/picker-column';
import { PickerController } from './components/picker/picker-controller';
import { PopoverCmp } from './components/popover/popover-component';
import { PopoverController } from './components/popover/popover-controller';
import { RadioButton } from './components/radio/radio-button';
import { RadioGroup } from './components/radio/radio-group';
import { Range } from './components/range/range';
import { RangeKnob } from './components/range/range-knob';
import { Refresher } from './components/refresher/refresher';
import { RefresherContent } from './components/refresher/refresher-content';
import { Scroll } from './components/scroll/scroll';
import { Searchbar } from './components/searchbar/searchbar';
import { Segment } from './components/segment/segment';
import { Select } from './components/select/select';
import { SelectPopover } from './components/select/select-popover-component';
import { SegmentButton } from './components/segment/segment-button';
import { ShowWhen } from './components/show-hide-when/show-when';
import { HideWhen } from './components/show-hide-when/hide-when';
import { Slide } from './components/slides/slide';
import { Slides } from './components/slides/slides';
import { Spinner } from './components/spinner/spinner';
import { SplitPane } from './components/split-pane/split-pane';
import { Tab } from './components/tabs/tab';
import { TabButton } from './components/tabs/tab-button';
import { TabHighlight } from './components/tabs/tab-highlight';
import { Tabs } from './components/tabs/tabs';
import { Thumbnail } from './components/thumbnail/thumbnail';
import { ToastCmp } from './components/toast/toast-component';
import { ToastController } from './components/toast/toast-controller';
import { Toggle } from './components/toggle/toggle';
import { Footer } from './components/toolbar/toolbar-footer';
import { Header } from './components/toolbar/toolbar-header';
import { Toolbar } from './components/toolbar/toolbar';
import { ToolbarItem } from './components/toolbar/toolbar-item';
import { ToolbarTitle } from './components/toolbar/toolbar-title';
import { Navbar } from './components/toolbar/navbar';
import { Typography } from './components/typography/typography';
import { VirtualFooter } from './components/virtual-scroll/virtual-footer';
import { VirtualHeader } from './components/virtual-scroll/virtual-header';
import { VirtualItem } from './components/virtual-scroll/virtual-item';
import { VirtualScroll } from './components/virtual-scroll/virtual-scroll';
/**
* \@name IonicModule
* \@description
* IonicModule is an [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) that bootstraps
* an Ionic App. By passing a root component, IonicModule will make sure that all of the components,
* directives, and providers from the framework are imported.
*
* Any configuration for the app can be passed as the second argument to `forRoot`. This can be any
* valid property from the [Config](/docs/api/config/Config/).
*
* \@usage
* ```ts
* import { NgModule } from '\@angular/core';
*
* import { IonicApp, IonicModule } from 'ionic-angular';
*
* import { MyApp } from './app.component';
* import { HomePage } from '../pages/home/home';
*
* \@NgModule({
* declarations: [
* MyApp,
* HomePage
* ],
* imports: [
* BrowserModule,
* IonicModule.forRoot(MyApp, {
*
* })
* ],
* bootstrap: [IonicApp],
* entryComponents: [
* MyApp,
* HomePage
* ],
* providers: []
* })
* export class AppModule {}
* ```
*/
export class IonicModule {
/**
* Set the root app component for you IonicModule
* @param {?} appRoot
* @param {?=} config
* @param {?=} deepLinkConfig
* @return {?}
*/
static forRoot(appRoot, config = null, deepLinkConfig = null) {
return {
ngModule: IonicModule,
providers: [
// useValue: bootstrap values
{ provide: AppRootToken, useValue: appRoot },
{ provide: ConfigToken, useValue: config },
{ provide: DeepLinkConfigToken, useValue: deepLinkConfig },
{ provide: APP_BASE_HREF, useValue: '/' },
// useFactory: user values
{ provide: PlatformConfigToken, useFactory: providePlatformConfigs },
// useFactory: ionic core providers
{ provide: Platform, useFactory: setupPlatform, deps: [DOCUMENT, PlatformConfigToken, NgZone] },
{ provide: Config, useFactory: setupConfig, deps: [ConfigToken, Platform] },
// useFactory: ionic app initializers
{ provide: APP_INITIALIZER, useFactory: registerModeConfigs, deps: [Config], multi: true },
{ provide: APP_INITIALIZER, useFactory: setupProvideEvents, deps: [Platform, DomController], multi: true },
{ provide: APP_INITIALIZER, useFactory: setupTapClick, deps: [Config, Platform, DomController, App, GestureController], multi: true },
{ provide: APP_INITIALIZER, useFactory: setupPreloading, deps: [Config, DeepLinkConfigToken, ModuleLoader, NgZone], multi: true },
// useClass
{ provide: HAMMER_GESTURE_CONFIG, useClass: IonicGestureConfig },
// useValue
{ provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: appRoot, multi: true },
// ionic providers
ActionSheetController,
AlertController,
App,
DomController,
Events,
Form,
GestureController,
Haptic,
Keyboard,
LoadingController,
Location,
MenuController,
ModalController,
NgModuleLoader,
PickerController,
PopoverController,
TapClick,
ToastController,
TransitionController,
{ provide: ModuleLoader, useFactory: provideModuleLoader, deps: [NgModuleLoader, Injector] },
{ provide: LocationStrategy, useFactory: provideLocationStrategy, deps: [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], Config] },
{ provide: UrlSerializer, useFactory: setupUrlSerializer, deps: [DeepLinkConfigToken] },
{ provide: DeepLinker, useFactory: setupDeepLinker, deps: [App, UrlSerializer, Location, ModuleLoader, ComponentFactoryResolver] },
]
};
}
}
IonicModule.decorators = [
{ type: NgModule, args: [{
declarations: [
ActionSheetCmp,
AlertCmp,
ClickBlock,
IonicApp,
OverlayPortal,
Avatar,
Backdrop,
Badge,
Button,
Card,
CardContent,
CardHeader,
CardTitle,
Checkbox,
Chip,
Col,
Content,
DateTime,
FabButton,
FabContainer,
FabList,
Grid,
Img,
Icon,
InfiniteScroll,
InfiniteScrollContent,
Item,
ItemContent,
ItemDivider,
ItemGroup,
ItemOptions,
ItemReorder,
ItemSliding,
Label,
List,
ListHeader,
Reorder,
LoadingCmp,
Menu,
MenuClose,
MenuToggle,
ModalCmp,
Nav,
NavPop,
NavPopAnchor,
NavPush,
NavPushAnchor,
Note,
Option,
PickerCmp,
PickerColumnCmp,
PopoverCmp,
RadioButton,
RadioGroup,
Range,
RangeKnob,
Refresher,
RefresherContent,
Row,
Scroll,
Searchbar,
Segment,
SegmentButton,
Select,
SelectPopover,
ShowWhen,
HideWhen,
Slide,
Slides,
Spinner,
SplitPane,
Tab,
TabButton,
TabHighlight,
Tabs,
TextInput,
Thumbnail,
ToastCmp,
Toggle,
Footer,
Header,
Toolbar,
ToolbarItem,
ToolbarTitle,
Navbar,
Typography,
VirtualFooter,
VirtualHeader,
VirtualItem,
VirtualScroll
],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
],
exports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
ActionSheetCmp,
AlertCmp,
ClickBlock,
IonicApp,
OverlayPortal,
Avatar,
Backdrop,
Badge,
Button,
Card,
CardContent,
CardHeader,
CardTitle,
Checkbox,
Chip,
Col,
Content,
DateTime,
FabButton,
FabContainer,
FabList,
Grid,
Img,
Icon,
InfiniteScroll,
InfiniteScrollContent,
Item,
ItemContent,
ItemDivider,
ItemGroup,
ItemOptions,
ItemReorder,
ItemSliding,
Label,
List,
ListHeader,
Reorder,
LoadingCmp,
Menu,
MenuClose,
MenuToggle,
ModalCmp,
Nav,
NavPop,
NavPopAnchor,
NavPush,
NavPushAnchor,
Note,
Option,
PickerCmp,
PickerColumnCmp,
PopoverCmp,
RadioButton,
RadioGroup,
Range,
RangeKnob,
Refresher,
RefresherContent,
Row,
Scroll,
Searchbar,
Segment,
SegmentButton,
Select,
SelectPopover,
ShowWhen,
HideWhen,
Slide,
Slides,
Spinner,
SplitPane,
Tab,
TabButton,
TabHighlight,
Tabs,
TextInput,
Thumbnail,
ToastCmp,
Toggle,
Footer,
Header,
Toolbar,
ToolbarItem,
ToolbarTitle,
Navbar,
Typography,
VirtualFooter,
VirtualHeader,
VirtualItem,
VirtualScroll
],
entryComponents: [
ActionSheetCmp,
AlertCmp,
IonicApp,
LoadingCmp,
ModalCmp,
PickerCmp,
PopoverCmp,
SelectPopover,
ToastCmp
]
},] },
];
/**
* @nocollapse
*/
IonicModule.ctorParameters = () => [];
function IonicModule_tsickle_Closure_declarations() {
/** @type {?} */
IonicModule.decorators;
/**
* @nocollapse
* @type {?}
*/
IonicModule.ctorParameters;
}
/**
* \@name IonicPageModule
* \@description
* IonicPageModule is an [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) that
* bootstraps a child [IonicPage](../navigation/IonicPage/) in order to set up routing.
*
* \@usage
* ```ts
* import { NgModule } from '\@angular/core';
*
* import { IonicPageModule } from 'ionic-angular';
*
* import { HomePage } from './home';
*
* \@NgModule({
* declarations: [
* HomePage
* ],
* imports: [
* IonicPageModule.forChild(HomePage)
* ],
* entryComponents: [
* HomePage
* ]
* })
* export class HomePageModule { }
* ```
*/
export class IonicPageModule {
/**
* @param {?} page
* @return {?}
*/
static forChild(page) {
return {
ngModule: IonicPageModule,
providers: [
{ provide: /** @type {?} */ (LAZY_LOADED_TOKEN), useValue: page },
{ provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: page, multi: true },
]
};
}
}
IonicPageModule.decorators = [
{ type: NgModule, args: [{
imports: [IonicModule],
exports: [IonicModule]
},] },
];
/**
* @nocollapse
*/
IonicPageModule.ctorParameters = () => [];
function IonicPageModule_tsickle_Closure_declarations() {
/** @type {?} */
IonicPageModule.decorators;
/**
* @nocollapse
* @type {?}
*/
IonicPageModule.ctorParameters;
}
/**
* @hidden
* @param {?} platformLocationStrategy
* @param {?} baseHref
* @param {?} config
* @return {?}
*/
export function provideLocationStrategy(platformLocationStrategy, baseHref, config) {
return config.get('locationStrategy') === 'path' ?
new PathLocationStrategy(platformLocationStrategy, baseHref) :
new HashLocationStrategy(platformLocationStrategy, baseHref);
}
//# sourceMappingURL=module.js.map
|
import STORE from './store'
import {User, PetitionModel} from './models/models'
import Backbone from 'backbone'
import $ from 'jquery'
Backbone.$.ajaxSetup({
headers: {
'Authorization': 'Bearer ' + localStorage.token
}
})
const ACTIONS = {
_registerUser: function(newUserObj) {
var userObj = {
user: newUserObj
}
User.register(userObj).then(() => this._getUserToken(newUserObj),
(error) => {
console.log(error)
})
},
_loginUser: function(userObj) {
console.log(userObj)
User.login(userObj).then(() => this._getUserToken(userObj),
(error) => {
console.log(error)
})
},
_getUserToken:function(userObj) {
// console.log(userObj)
User.getToken(userObj).then(
(response) => {
location.hash = 'dataInput'
},
(error) => {
console.log(error)
})
},
_submitPetition: function(newPetitionObj) {
// console.log(newPetitionObj)
var petitionObj = {
petition: newPetitionObj
}
var petition = new PetitionModel(petitionObj)
petition.save([], {dataType: 'html'}).then(
(response) => {
console.log('Success! Thank you for your submission')
},
(error) => {
console.log(error)
})
},
_logoutUser: function() {
User.logout().then( () => {
this._handleLocalStorage()
})
},
_handleLocalStorage: function() {
localStorage.removeItem('token')
localStorage.removeItem('currentUser')
location.hash = 'home'
}
}
export default ACTIONS
|
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import AccessibleFakeInkedButton from '../Helpers/AccessibleFakeInkedButton';
import TileAddon from '../Lists/TileAddon';
export default class MiniListItem extends PureComponent {
static propTypes = {
style: PropTypes.object,
className: PropTypes.string,
tileStyle: PropTypes.object,
tileClassName: PropTypes.string,
component: PropTypes.oneOfType([
PropTypes.func,
PropTypes.string,
]),
active: PropTypes.bool,
activeClassName: PropTypes.string,
leftIcon: PropTypes.node,
leftAvatar: PropTypes.node,
disabled: PropTypes.bool,
onTouchStart: PropTypes.func,
onTouchEnd: PropTypes.func,
onMouseOver: PropTypes.func,
onMouseLeave: PropTypes.func,
};
static defaultProps = {
activeClassName: 'md-text--theme-primary',
component: 'div',
};
constructor(props) {
super(props);
this.state = { active: false };
this._handleTouchStart = this._handleTouchStart.bind(this);
this._handleTouchEnd = this._handleTouchEnd.bind(this);
this._handleMouseOver = this._handleMouseOver.bind(this);
this._handleMouseLeave = this._handleMouseLeave.bind(this);
}
componentWillUnmount() {
if (this._touchTimeout) {
clearTimeout(this._touchTimeout);
}
}
_handleMouseOver(e) {
if (this.props.onMouseOver) {
this.props.onMouseOver(e);
}
if (!this.props.disabled) {
this.setState({ active: true });
}
}
_handleMouseLeave(e) {
if (this.props.onMouseLeave) {
this.props.onMouseLeave(e);
}
if (!this.props.disabled) {
this.setState({ active: false });
}
}
_handleTouchStart(e) {
if (this.props.onTouchStart) {
this.props.onTouchStart(e);
}
this._touched = true;
this.setState({ active: true, touchedAt: Date.now() });
}
_handleTouchEnd(e) {
if (this.props.onTouchEnd) {
this.props.onTouchEnd(e);
}
const time = Date.now() - this.state.touchedAt;
this._touchTimeout = setTimeout(() => {
this._touchTimeout = null;
this.setState({ active: false });
}, time > 450 ? 0 : 450 - time);
}
render() {
const {
style,
className,
tileStyle,
tileClassName,
leftIcon,
leftAvatar,
active,
activeClassName,
...props
} = this.props;
delete props.defaultOpen;
return (
<li style={style} className={className}>
<AccessibleFakeInkedButton
{...props}
style={tileStyle}
className={cn('md-list-tile md-list-tile--icon md-list-tile--mini', {
'md-list-tile--active': this.state.active && !this._touched,
}, tileClassName)}
onMouseOver={this._handleMouseOver}
onMouseLeave={this._handleMouseLeave}
onTouchStart={this._handleTouchStart}
onTouchEnd={this._handleTouchEnd}
>
<TileAddon
active={active}
activeClassName={activeClassName}
icon={leftIcon}
avatar={leftAvatar}
/>
</AccessibleFakeInkedButton>
</li>
);
}
}
|
var cu = window.app.get('currentUser');
cu.setAttrs({
"nick": "eugene",
"timezone": "+5",
"avatar": "eugene.trounev@gmail.com",
"rated": ["postyui_3_17_2_1_1404866127097_19"],
"following": ["postyui_3_17_2_1_1404866127097_19"]
});
cu.save();
var u = window.app.get('users');
u.create({
"sysID": "dkfndhfde83ywery",
"nick": "eugene",
"timezone": "+5",
"avatar": "eugene.trounev@gmail.com"
});
u.create({
"sysID": "djhfjshf8324yrh",
"nick": "sasha",
"timezone": "+2",
"avatar": "/images/avatar-girl.jpg"
});
var p = window.app.get('posts');
p.create({
"sysParentID": null,
"sysAuthorID": "djhfjshf8324yrh",
"dateCreated": "Wed, 09 Jul 2014 00:35:27 GMT",
"dateModified": null,
"tags": [
"mim",
"test",
"sys-type-discussion"
],
"rate": 0,
"slug": "new-test-discussion",
"title": "New test discussion",
"content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
});
|
module.exports = function(grunt) {
return {
bootstrap: {
src: [ 'bootstrap/javascripts/*.js' ],
dest: 'js/bootstrap.js',
}
};
};
|
'use strict';
/* App Module */
var app = angular.module('movieApp', [
'ngRoute',
'movieControllers',
]);
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/movies', {
templateUrl: 'partials/movie-list.html',
controller: 'MovieListCtrl'
}).
otherwise({
redirectTo: '/movies'
});
}]);
|
'use strict';
var expect = require('chai').expect;
var sinon = require('sinon');
var Pack = require('../').Pack;
var Package = require('../').Package;
require('sinon-as-promised');
describe('Pack', function () {
var pack, pkg, sandbox;
beforeEach(function () {
pack = new Pack();
pkg = new Package('./package.json');
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
describe('#load', function () {
var read;
beforeEach(function () {
read = sandbox.stub(Package.prototype, 'read')
});
it('reads the packages', function () {
read.resolves({});
return pack.load(['./package.json'])
.then(function (pack) {
expect(pack.packages).to.have.length(1);
});
});
it('recovers from errors on optional packages', function () {
read.onCall(0).resolves({});
read.onCall(1).rejects({
code: 'ENOENT'
});
return pack.load(['./package.json', {
path: './bower.json',
optional: true
}])
.then(function (pack) {
expect(pack.packages).to.have.length(1);
});
});
});
describe('#get', function () {
it('gets from the first package', function () {
pack.packages.push(pkg);
pkg.set('foo', 'bar');
expect(pack.get('foo')).to.equal('bar');
});
});
describe('#set', function () {
it('sets on all packages', function () {
var pkg2 = new Package('./bower.json');
pack.packages.push(pkg, pkg2);
pack.set('foo', 'bar');
expect(pkg.get('foo')).to.equal('bar');
expect(pkg2.get('foo')).to.equal('bar');
});
});
describe('#read / #write', function () {
it('calls the method on all packages', function () {
var read = sandbox.stub(Package.prototype, 'read');
read.resolves({});
pack.packages.push(pkg);
return pack.read().then(function (pack) {
expect(pack.packages[0].read.callCount).to.equal(1);
});
});
});
describe('#paths', function () {
it('gets the package paths', function () {
pack.packages.push(pkg);
var paths = pack.paths();
expect(paths).to.have.length(1);
expect(paths[0]).to.contain('package.json');
});
});
});
|
const Style = function(){
let gid = 0;
return function(o,key){
if(o.$) return o;
const id = gid++;
const cc = x => x.replace(/([A-Z])/g, (x)=> "-"+ x.toLowerCase());
const a = [];
let SC = "";
let md = "@media ";
for(let i in o){
switch(i){
case "$":
SC += typeof o[i] == "string" ? EmpatiJS.Theme.Styles[o[i]] :
o[i].map(x=> EmpatiJS.Theme.Styles[x].$ ).join(' ');
break;
case "$$":
EmpatiJS.Theme.Styles[o[i]].$ = "c" + id;
break;
case "_":
break;
case "media":
md += o[i];
break;
default:
if(o[i] in EmpatiJS.Theme.Rules) o[i] = EmpatiJS.Theme.Rules[o[i]];
a.push(cc(i) + ":" + o[i].toString());
break;
}
}
const ruls = a.join(';');
let style = ".c"+id+(o._||"")+" { " + ruls + " } ";
if(o.media) style = md + " { " + style + " } ";
EmpatiJS.Theme.StyleSheet.insertRule(style, id);
if(o.$_) SC += ' ' + EmpatiJS.Theme.AppendStyles(o.$_, key).join(' ');
return new Proxy({Orgin:o, SubClass: SC, Id: id}, {
get: (t, n) => {
if(n == "$") return "c" + t.Id + t.SubClass;
return t.Orgin[n];
},
set: (t, n, v) => {
if(v in EmpatiJS.Theme.Rules) v = EmpatiJS.Theme.Rules[v];
t.Orgin[n] = v;
if(n == "$") t.SubClass += " " + (typeof v == "string" ? v : v.$);
else EmpatiJS.Theme.StyleSheet.cssRules[t.Id].style[n] = v;
return v;
}
});
}
}()
EmpatiJS.Theme = {
Styles:{},
Rules:{},
AppendStyles: function(o, k = ""){
o.forEach((x,y)=>{this.Styles[k+y] = Style(x,k+y)});
return Object.keys(o).map(x=> this.Styles[k+x].$);
},
StyleSheet: (function() {
const style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
return style.sheet;
})(),
Style
}
|
// flow-typed signature: c8fbda04551ed202307fbc1f64a6be6c
// flow-typed version: <<STUB>>/cp-file_v^6.0.0/flow_v0.102.0
/**
* This is an autogenerated libdef stub for:
*
* 'cp-file'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'cp-file' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'cp-file/cp-file-error' {
declare module.exports: any;
}
declare module 'cp-file/fs' {
declare module.exports: any;
}
declare module 'cp-file/progress-emitter' {
declare module.exports: any;
}
// Filename aliases
declare module 'cp-file/cp-file-error.js' {
declare module.exports: $Exports<'cp-file/cp-file-error'>;
}
declare module 'cp-file/fs.js' {
declare module.exports: $Exports<'cp-file/fs'>;
}
declare module 'cp-file/index' {
declare module.exports: $Exports<'cp-file'>;
}
declare module 'cp-file/index.js' {
declare module.exports: $Exports<'cp-file'>;
}
declare module 'cp-file/progress-emitter.js' {
declare module.exports: $Exports<'cp-file/progress-emitter'>;
}
|
/**
* loads sub modules and wraps them up into the main module
* this should be used for top-level module definitions only
*/
define([
'angular',
'ngChosen',
'ngCookie',
'ngLocalStorage',
'ngMask',
'magnificPopup'
], function (ng) {
'use strict';
var conexaoRedeApp = ng.module('conexaoRedeApp', ['ui.mask', 'localytics.directives', 'angularLocalStorage']);
jQuery.support.cors = true;
conexaoRedeApp.directive('gallery', function(){
return function ($scope, $element, attrs) {
jQuery('.simple-ajax-popup').magnificPopup({
type: 'ajax',
midClick: true
});
}
});
conexaoRedeApp.controller('FiliacaoForm', ['$scope', '$http', 'storage',
function FiliacaoForm($scope, $http, storage) {
$scope.ja_preencheu = false;
$scope.logged = (window.WP_USER_ID ? true : false) ;
//$http.defaults.headers.post = {'Content-Type': 'application/json'};
//$http.defaults.headers.post["Content-Type"] = "application/json";
$http.defaults.useXDomain = true;
delete $http.defaults.headers.common['X-Requested-With'];
if(window.WP_USER_ID) {
jQuery.ajax({ type: 'GET', url: API_PATH+'/usuario/filiado/'+WP_USER_ID })
.done(function (data) {
$scope.$apply(function(){
$scope.ja_preencheu = true;
});
});
}
$scope.master= {};
$scope.filiado= {};
$scope.somenteNumeros = /^[0-9]+$/;
storage.bind($scope,'filiado');
$scope.steps = [
{'name': 'Introdução', 'id': '1', 'status': 'doing'},
{'name': 'Dados Pessoais', 'id': '2', 'status': 'todo'},
{'name': 'Dados Eleitorais', 'id': '3', 'status': 'todo'},
{'name': 'Interesses', 'id': '4', 'status': 'todo'}
];
// $http.get(API_PATH+'/area-interesse').success(function(data) {
// $scope.listaAreasInteresse = data;
// });
// $http.get(API_PATH+'/atuacao-profissional').success(function(data) {
// $scope.listaAtuacoesProfissionais = data;
// });
$scope.listaEscolaridade = [
'',
'Não Alfabetizado',
'Ensino Fundamental - Incompleto',
'Ensino Fundamental - Completo',
'Ensino Médio - Incompleto',
'Ensino Médio - Completo',
'Superior - Incompleto',
'Superior - Completo',
'Especialização - Incompleto',
'Especialização - Completo',
'Mestrado - Incompleto',
'Mestrado - Completo',
'Doutorado - Incompleto',
'Doutorado - Completo'
];
$scope.nacionalidades = [
'',
'Brasil - Brasileiro',
'Antígua e Barbuda - Antiguano',
'Argentina - Argentino',
'Bahamas - Bahamense',
'Barbados - Barbadiano, barbadense',
'Belize - Belizenho',
'Bolívia - Boliviano',
'Chile - Chileno',
'Colômbia - Colombiano',
'Costa Rica - Costarriquenho',
'Cuba - Cubano',
'Dominica - Dominicano',
'Equador - Equatoriano',
'El Salvador - Salvadorenho',
'Granada - Granadino',
'Guatemala - Guatemalteco',
'Guiana - Guianês',
'Guiana Francesa - Guianense',
'Haiti - Haitiano',
'Honduras - Hondurenho',
'Jamaica - Jamaicano',
'México - Mexicano',
'Nicarágua - Nicaraguense',
'Panamá - Panamenho',
'Paraguai - Paraguaio',
'Peru - Peruano',
'Porto Rico - Portorriquenho',
'República Dominicana - Dominicana',
'São Cristóvão e Nevis - São-cristovense',
'São Vicente e Granadinas - São-vicentino',
'Santa Lúcia - Santa-lucense',
'Suriname - Surinamês',
'Trinidad e Tobago - Trindadense',
'Uruguai - Uruguaio',
'Venezuela - Venezuelano',
'Alemanha - Alemão',
'Áustria - Austríaco',
'Bélgica - Belga',
'Croácia - Croata',
'Dinamarca - Dinamarquês',
'Eslováquia - Eslovaco',
'Eslovênia - Esloveno',
'Espanha - Espanhol',
'França - Francês',
'Grécia - Grego',
'Hungria - Húngaro',
'Irlanda - Irlandês',
'Itália - Italiano',
'Noruega - Noruego',
'Países Baixos - Holandês',
'Polônia - Polonês',
'Portugal - Português',
'Reino Unido - Britânico',
'Inglaterra - Inglês',
'País de Gales - Galês',
'Escócia - Escocês',
'Romênia - Romeno',
'Rússia - Russo',
'Sérvio - Sérvio',
'Suécia - Sueco',
'Suíça - Suíço',
'Turquia - Turco',
'Ucrânia - Ucraniano',
'Estados Unidos - Americano',
'Canadá - Canadense',
'Angola - Angolano',
'Moçambique - Moçambicano',
'África do Sul - Sul-africano',
'Zimbabue - Zimbabuense',
'Argélia - Argélia',
'Comores - Comorense',
'Egito - Egípcio',
'Líbia - Líbio',
'Marrocos - Marroquino',
'Gana - Ganés',
'Quênia - Queniano',
'Ruanda - Ruandês',
'Uganda - Ugandense',
'Botsuana - Bechuano',
'Costa do Marfim - Marfinense',
'Camarões - Camaronense',
'Nigéria - Nigeriano',
'Somália - Somali',
'Austrália - Australiano',
'Nova Zelândia - Neozelandês',
'Afeganistão - Afegão',
'Arábia Saudita - Saudita',
'Armênia - Armeno',
'Armeno - Bangladesh',
'China - Chinês',
'Coréia do Norte - Norte-coreano, coreano',
'Coréia do Sul - Sul-coreano, coreano',
'Índia - Indiano',
'Indonésia - Indonésio',
'Iraque - Iraquiano',
'Irã - Iraniano',
'Israel - Israelita',
'Japão - Japonês',
'Malásia - Malaio',
'Nepal - Nepalês',
'Omã - Omanense',
'Paquistão - Paquistanês',
'Palestina - Palestino',
'Qatar - Qatarense',
'Síria - Sírio',
'Sri Lanka - Cingalês',
'Tailândia - Tailandês',
'Timor-Leste - Timorense, maubere',
'Emirados Árabes Unidos - Árabe, emiratense',
'Vietnã - Vietnamita',
'Iêmen - Iemenita'
];
//$scope.steps = ['Leitura', 'Dados Pessoais', 'Dados Eleitorais', 'Pré-filiação', 'Dados Adicionais'];
$scope.step = 0;
$scope.isCurrentStep = function(step) {
return $scope.step === step;
};
$scope.setCurrentStep = function(step) {
$scope.step = step;
};
$scope.getCurrentStep = function() {
return $scope.steps[$scope.step].name;
};
$scope.isFirstStep = function() {
return $scope.step === 0;
};
$scope.isLastStep = function() {
var len = jQuery.map($scope.steps, function(n, i) { return i; }).length;
return $scope.step === (len - 1);
};
$scope.getNextLabel = function() {
return ($scope.isLastStep()) ? 'Finalizar' : 'Próximo';
};
$scope.moveTopScroll = function () {
jQuery('html, body').animate({
scrollTop: jQuery(".container-filiacao").offset().top
}, 500);
};
$scope.handlePrevious = function() {
$scope.steps[$scope.step].status = 'todo';
if ($scope.isFirstStep()) {
$scope.step -= 0;
} else {
$scope.step -= 1;
}
$scope.steps[$scope.step].status = 'doing';
$scope.moveTopScroll();
};
$scope.handleBack = function() {
$scope.registro_ja_afiliado = false;
$scope.registro_ja_passaporte = false;
$scope.enviado_falha = false;
$scope.moveTopScroll();
};
$scope.handleNext = function(dismiss) {
if($scope.isLastStep()) {
dismiss();
_gaq.push(['_trackEvent', 'Filiação', 'Concluiu passo', $scope.steps[$scope.step].name]);
} else {
$scope.moveTopScroll();
_gaq.push(['_trackEvent', 'Filiação', 'Concluiu passo', $scope.steps[$scope.step].name]);
$scope.steps[$scope.step].status = 'done';
$scope.step += 1;
$scope.steps[$scope.step].status = 'doing';
}
};
$scope.isUnchanged = function(filiado) {
return ng.equals(filiado, $scope.master);
};
$scope.carregaEndereco = function () {
var cep = $scope.filiado.cep;
jQuery.ajax({type:'GET', url:'http://cep.correiocontrol.com.br/'+cep+'.json'})
.done(function(data) {
$scope.filiado.endereco = data.logradouro;
$scope.filiado.bairro = data.bairro;
$scope.filiado.cidade = data.localidade;
$scope.filiado.uf = data.uf;
jQuery('#numero').focus();
});
};
$scope.validaValor = function () {
$scope.filiado.contribuicao_mais = 'N';
};
$scope.saveFiliado = function () {
var filiado = $scope.filiado,
areasInteresse = new Array,
atuacoesProfissionais = new Array;
if(window.WP_USER_ID && window.WP_EMAIL) {
filiado.user_id = WP_USER_ID;
filiado.email = WP_EMAIL;
call_rest_filiacao();
} else {
var data = new FormData();
data.append('email', filiado.email);
jQuery.ajax({
type: "POST",
contentType: 'application/json',
url: PASSPORT_PATH+'/registration',
data: JSON.stringify({
'email': filiado.email
}),
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
crossDomain: true
})
.fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown);
$scope.registro_erro = true;
})
.done(function (data, textStatus) {
console.log('filiado:', filiado);
console.log('data:', data, textStatus);
if(!data.passaporte && !data.afiliado) {
$scope.$apply(function(){
filiado.user_id = data.idUser;
$scope.registro_sucesso = true;
$scope.registro_ja_afiliado = false;
$scope.registro_ja_passaporte = false;
call_rest_filiacao();
});
} else if (data.afiliado) {
$scope.$apply(function() {
$scope.registro_ja_afiliado = true;
$scope.registro_sucesso = false;
$scope.registro_ja_passaporte = false;
})
} else if (data.passaporte) {
$scope.$apply(function () {
$scope.registro_ja_passaporte = true;
$scope.registro_ja_afiliado = false;
$scope.registro_sucesso = false;
})
}
window.scrollTo(0, 0);
});
}
function call_rest_filiacao() {
// jQuery.each(filiado.areasInteresse, function(key, element) {
// areasInteresse.push(element.id);
// });
// jQuery.each(filiado.atuacoesProfissionais, function(key, element) {
// atuacoesProfissionais.push(element.id);
// });
delete filiado.contribuicao_mais;
// delete filiado.areasInteresse;
// delete filiado.atuacoesProfissionais;
delete filiado.enviado_sucesso;
// filiado.areasInteresse = areasInteresse;
// filiado.atuacoesProfissionais = atuacoesProfissionais;
//$scope.enviado_sucesso = true;
// $http.post( API_PATH+'/usuario/filiado', filiado).
// success(function (data, status, headers, config) {
// $scope.enviado_sucesso = true;
// }).
// error(function (data, status, headers, config) {
// $scope.enviado_falha = false;
// });
jQuery.ajax({
type: "POST",
processData: false,
url: API_PATH+'/usuario/filiado',
data: JSON.stringify(filiado),
contentType: 'application/json',
dataType: 'json',
crossDomain: true
})
.fail(function (jqXHR, textStatus, errorThrown) {
$scope.$apply(function(){
$scope.enviado_falha = true;
});
console.log(jqXHR, textStatus, errorThrown);
})
.done(function (data, textStatus) {
console.log('filiado:', filiado);
console.log('data:', data, textStatus);
$scope.$apply(function(){
$scope.enviado_sucesso = true;
});
window.scrollTo(0, 0);
});
}
}
}]);
conexaoRedeApp.controller('SejaConectadoForm', ['$scope', '$http', 'storage',
function SejaConectadoForm($scope, $http, storage) {
$http.defaults.useXDomain = true;
delete $http.defaults.headers.common['X-Requested-With'];
$scope.master= {};
$scope.filiado= {};
storage.bind($scope,'filiado');
$scope.steps = [
{'name': 'Dados Pessoais', 'id': '1', 'status': 'todo'}
];
//$scope.steps = ['Leitura', 'Dados Pessoais'];
$scope.step = 0;
$scope.isCurrentStep = function(step) {
return $scope.step === step;
};
$scope.setCurrentStep = function(step) {
$scope.step = step;
};
$scope.getCurrentStep = function() {
return $scope.steps[$scope.step].name;
};
$scope.isFirstStep = function() {
return $scope.step === 0;
};
$scope.isLastStep = function() {
var len = jQuery.map($scope.steps, function(n, i) { return i; }).length;
return $scope.step === (len - 1);
};
$scope.getNextLabel = function() {
return ($scope.isLastStep()) ? 'Finalizar' : 'Próximo';
};
$scope.moveTopScroll = function () {
jQuery('html, body').animate({
scrollTop: jQuery(".container-filiacao").offset().top
}, 500);
};
$scope.handlePrevious = function() {
$scope.steps[$scope.step].status = 'todo';
if ($scope.isFirstStep()) {
$scope.step -= 0;
} else {
$scope.step -= 1;
}
$scope.steps[$scope.step].status = 'doing';
$scope.moveTopScroll();
};
$scope.handleBack = function() {
$scope.registro_ja_afiliado = false;
$scope.registro_ja_passaporte = false;
$scope.enviado_falha = false;
$scope.moveTopScroll();
};
$scope.handleNext = function(dismiss) {
if($scope.isLastStep()) {
dismiss();
_gaq.push(['_trackEvent', 'Filiação', 'Concluiu passo', $scope.steps[$scope.step].name]);
} else {
$scope.moveTopScroll();
_gaq.push(['_trackEvent', 'Filiação', 'Concluiu passo', $scope.steps[$scope.step].name]);
$scope.steps[$scope.step].status = 'done';
$scope.step += 1;
$scope.steps[$scope.step].status = 'doing';
}
};
$scope.isUnchanged = function(filiado) {
return ng.equals(filiado, $scope.master);
};
$scope.saveFiliado = function () {
var filiado = $scope.filiado;
var data = new FormData();
data.append('email', filiado.email);
jQuery.ajax({
type: "POST",
contentType: 'application/json',
url: PASSPORT_PATH+'/registration',
data: JSON.stringify({
'email': filiado.email
}),
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
crossDomain: true
})
.fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown);
$scope.registro_erro = true;
})
.done(function (data, textStatus) {
console.log('filiado:', filiado);
console.log('data:', data, textStatus);
if(!data.passaporte && !data.afiliado) {
$scope.$apply(function(){
filiado.user_id = data.idUser;
$scope.enviado_sucesso = true;
$scope.registro_sucesso = true;
$scope.registro_ja_afiliado = false;
$scope.registro_ja_passaporte = false;
});
} else if (data.afiliado) {
$scope.$apply(function() {
$scope.registro_ja_afiliado = true;
$scope.registro_sucesso = false;
$scope.registro_ja_passaporte = false;
})
} else if (data.passaporte) {
$scope.$apply(function () {
$scope.registro_ja_passaporte = true;
$scope.registro_ja_afiliado = false;
$scope.registro_sucesso = false;
})
}
window.scrollTo(0, 0);
});
}
}]);
return conexaoRedeApp;
});
|
/**
* Attempt.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
var Promise = require('bluebird');
var Sandbox = require('sandbox');
var languages = [
{
value: 'js',
name: "Node.js",
'default': true,
test: (function () {
var sandbox = new Sandbox();
return function (attempt, test) {
return new Promise(function (resolve, reject) {
sandbox.run('var i=' + test.input + ';' + attempt.code, function (output) {
var retval = {},
result = output.result;
if (result.match(/^'.*'$/g)) {
if (result.match(/^(\w*Error)((\: )?|$)/g)) {
retval.error = result;
} else {
retval.data = JSON.parse('"' + result.slice(1, -1) + '"');
}
} else {
retval.data = JSON.parse(result);
}
resolve(retval);
});
});
};
}())
}
];
module.exports = {
languages: languages,
types: {
results: function (results) {
return results.every(function (result) {
return ['input', 'output', 'result'].every(function (key) { return key in result; });
});
}
},
attributes: {
hole: {
model: 'Hole',
required: true
},
code: {
type: 'string',
required: true
},
codeLength: 'integer',
language: {
type: 'string',
required: true,
in: _.pluck(languages, 'value')
},
status: {
type: 'string',
required: true,
in: ['pending', 'running', 'sink', 'miss'],
defaultsTo: 'pending'
},
results: {
type: 'array',
results: true
}
},
beforeValidate: function (values, next) {
values.codeLength = values.code.length;
next();
},
afterCreate: function (attempt, next) {
// Possibly queue
return Attempt.findOne({id: attempt.id}).then(function (attempt) {
return Hole.findOne({id: attempt.hole}).then(function (hole) {
attempt.status = 'running';
attempt.save(next);
return Promise
.map(hole.tests, function (test) {
return _.findWhere(languages, {value: attempt.language}).test(attempt, test);
})
.then(function (results) {
var success = true;
attempt.results = results.map(function (result, index) {
var result = _.extend({}, hole.tests[index], {result: result.error || result.data});
success = success && result.result === result.output;
return result;
});
attempt.status = success
? 'sink'
: 'miss';
Attempt.publishUpdate(attempt.id, _.extend({}, attempt));
return attempt;
})
.call('save');
});
});
}
};
|
'use strict';
exports.setRoutes = function (app) {
//app.use('/', require('./routers/index'));
app.use('/register', require('./routers/register'));
app.use('/login', require('./routers/login'));
app.use('/logout', require('./routers/logout'));
app.use('/account', require('./routers/account'));
app.use('/upload', require('./routers/upload'));
app.use('/movies', require('./routers/movie'));
app.use('/animes', require('./routers/anime'));
app.use('/tvplays', require('./routers/tvplays'));
app.use('/varieties', require('./routers/varieties'));
app.use('/educates', require('./routers/educates'));
app.use('/musics', require('./routers/musics'));
app.use('/technologys', require('./routers/technologys'));
app.use('/news', require('./routers/news'));
app.use('/schools', require('./routers/schools'));
app.use('/others', require('./routers/others'));
app.use('/originals', require('./routers/originals'));
app.use('/video', require('./routers/video'));
app.use('/search', require('./routers/search'));
app.use('/categorymore', require('./routers/categorymore'));
app.use('/user-detail', require('./routers/user-detail'));
app.use('/user-manage', require('./routers/user-manage'));
app.use('/video-manage', require('./routers/video-manage'));
};
|
var BTR = require('../lib/btr');
require('chai').should();
describe('ctx.getParam()', function() {
var btr;
beforeEach(function() {
btr = new BTR();
});
it('should return param', function() {
btr.match('button', function(ctx) {
ctx.getParam('type').should.equal('button');
});
btr.apply({ block: 'button', type: 'button' });
});
});
|
/**
* 是否为有效的电话(座机)
*
* @param {string} val
* @returns {boolean}
* @example
*
* isTelephone('0571-4211236');
* // => true
*/
function isValidTelephone(val) {
const reg = /^0\d{2,3}-\d{7,8}$/;
return reg.test(val);
}
export default isValidTelephone;
|
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _url = __webpack_require__(2);
var _url2 = _interopRequireDefault(_url);
var _utils = __webpack_require__(3);
var _tableauApi = __webpack_require__(4);
var _tableauApi2 = _interopRequireDefault(_tableauApi);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = {
filters: _react.PropTypes.object,
url: _react.PropTypes.string,
parameters: _react.PropTypes.object,
options: _react.PropTypes.object,
token: _react.PropTypes.string
};
var defaultProps = {
loading: false,
parameters: {},
filters: {},
options: {}
};
/**
* React Component to render reports created in Tableau.
*
* @class TableauReport
* @extends {Component}
*/
var TableauReport = function (_Component) {
_inherits(TableauReport, _Component);
function TableauReport(props) {
_classCallCheck(this, TableauReport);
var _this = _possibleConstructorReturn(this, (TableauReport.__proto__ || Object.getPrototypeOf(TableauReport)).call(this, props));
_this.state = {
filters: props.filters,
parameters: props.parameters,
currentUrl: props.url
};
return _this;
}
_createClass(TableauReport, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.initTableau();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var isReportChanged = nextProps.url !== this.state.currentUrl;
var isFiltersChanged = !(0, _utils.shallowequal)(this.props.filters, nextProps.filters);
var isParametersChanged = !(0, _utils.shallowequal)(this.props.parameters, nextProps.parameters);
var isLoading = this.state.loading;
if (isReportChanged) {
this.state.currentUrl = nextProps.url;
this.forceUpdate();
this.initTableau();
}
if (!isReportChanged && isFiltersChanged && !isLoading) {
this.applyFilters(nextProps.filters);
}
if (!isReportChanged && isParametersChanged && !isLoading) {
this.applyParameters(nextProps.parameters);
}
}
/**
* Gets the url for the tableau report.
*
* @returns {String} A constructed url.
* @memberOf TableauReport
*/
}, {
key: 'getUrl',
value: function getUrl() {
var parsed = _url2.default.parse(this.props.url, true);
var result = parsed.protocol + '//' + parsed.host;
if (this.props.token) result += '/trusted/' + this.props.token;
result += parsed.pathname + '?:embed=yes&:comments=no&:toolbar=yes&:refresh=yes';
return result;
}
/**
* Asynchronously applies filters to the worksheet, excluding those that have
* already been applied, which is determined by checking against state.
* @param {Object} filters
* @return {void}
* @memberOf TableauReport
*/
}, {
key: 'applyFilters',
value: function applyFilters(filters) {
var _this2 = this;
var REPLACE = _tableauApi2.default.FilterUpdateType.REPLACE;
var promises = [];
this.setState({ loading: true });
for (var key in filters) {
if (!this.state.filters.hasOwnProperty(key) || !(0, _utils.shallowequal)(this.state.filters[key], filters[key])) {
promises.push(this.sheet.applyFilterAsync(key, filters[key], REPLACE));
}
}
Promise.all(promises).then(function () {
_this2.setState({ loading: false, filters: filters });
});
}
/**
* Asynchronously applies parameters to the worksheet, excluding those that have
* already been applied, which is determined by checking against state.
* @param {Object} parameters
* @return {void}
* @memberOf TableauReport
*/
}, {
key: 'applyParameters',
value: function applyParameters(parameters) {
var _this3 = this;
var promises = [];
for (var key in parameters) {
if (!this.state.parameters.hasOwnProperty(key) || this.state.parameters[key] !== parameters[key]) {
var val = parameters[key];
promises.push(this.workbook.changeParameterValueAsync(key, val));
}
}
Promise.all(promises).then(function () {
return _this3.setState({ loading: false, parameters: parameters });
});
}
/**
* Initialize the viz via the Tableau JS API.
* @return {void}
* @memberOf TableauReport
*/
}, {
key: 'initTableau',
value: function initTableau() {
var _this4 = this;
var vizUrl = this.getUrl();
var options = _extends({}, this.props.filters, this.props.parameters, this.props.options, {
onFirstInteractive: function onFirstInteractive() {
_this4.workbook = _this4.viz.getWorkbook();
_this4.sheets = _this4.workbook.getActiveSheet().getWorksheets();
_this4.sheet = _this4.sheets[0];
}
});
if (this.viz) {
this.viz.dispose();
this.viz = null;
}
this.viz = new _tableauApi2.default.Viz(this.container, vizUrl, options);
}
}, {
key: 'render',
value: function render() {
var _this5 = this;
return _react2.default.createElement('div', { ref: function ref(c) {
return _this5.container = c;
} });
}
}]);
return TableauReport;
}(_react.Component);
TableauReport.propTypes = propTypes;
TableauReport.defaultProps = defaultProps;
exports.default = TableauReport;
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = require("react");
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = require("url");
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/**
* Provides a shallow equality check on two arrays or objects.
*
* @param {Array|Object} a : The value to compare.
* @param {Array|Object} b : The other value to compare.
* @returns {bool}
*/
exports.shallowequal = function (a, b) {
if (a === b) return true;
if (Array.isArray(a) && Array.isArray(b)) return seArray(a, b);
if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && (typeof b === 'undefined' ? 'undefined' : _typeof(b)) === 'object') return seObject(a, b);
return false;
};
/**
* Shallow equality check for arrays.
*
* @param {Array} a : The value to compare.
* @param {Array} b : The other value to compare.
* @returns {bool}
*/
function seArray(a, b) {
var l = a.length;
if (l !== b.length) return false;
for (var i = 0; i < l; i++) {
if (a[i] !== b[i]) return false;
}return true;
};
/**
* Shallow equality check for objects.
*
* @param {Object} a : The value to compare.
* @param {Object} b : The other value to compare.
* @returns {bool}
*/
function seObject(a, b) {
var ka = Object.keys(a),
l = ka.length;
if (l !== Object.keys(b).length.length) return false;
for (var i = 0; i < l; i++) {
if (a[ka[i]] !== b[ka[i]]) return false;
}return true;
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
// Modified by Ilya Boyandin from the original version:
// https://online.tableau.com/javascripts/api/tableau-2.0.0.js
//
//! tableau-2.0.0.js
//
var tableauSoftware = {};
(function () {
// (function() {
////////////////////////////////////////////////////////////////////////////////
// Utility methods (generated via Script.IsNull, etc.)
////////////////////////////////////////////////////////////////////////////////
var ss = {
version: '0.7.4.0',
isUndefined: function isUndefined(o) {
return o === undefined;
},
isNull: function isNull(o) {
return o === null;
},
isNullOrUndefined: function isNullOrUndefined(o) {
return o === null || o === undefined;
},
isValue: function isValue(o) {
return o !== null && o !== undefined;
}
};
// If the browser does not support Object.keys this alternative
// function returns the same list without using the keys method.
// This code was found in mscorlib.js (BUGZID:116352)
if (!Object.keys) {
Object.keys = function Object$keys(d) {
var keys = [];
for (var key in d) {
keys.push(key);
}
return keys;
};
}
////////////////////////////////////////////////////////////////////////////////
// Type System Implementation
////////////////////////////////////////////////////////////////////////////////
var Type = Function;
var originalRegistrationFunctions = {
registerNamespace: { isPrototype: false, func: Type.registerNamespace },
registerInterface: { isPrototype: true, func: Type.prototype.registerInterface },
registerClass: { isPrototype: true, func: Type.prototype.registerClass },
registerEnum: { isPrototype: true, func: Type.prototype.registerEnum }
};
var tab = {};
var tabBootstrap = {};
Type.registerNamespace = function (name) {};
Type.prototype.registerInterface = function (name) {};
Type.prototype.registerEnum = function (name, flags) {
for (var field in this.prototype) {
this[field] = this.prototype[field];
}
};
Type.prototype.registerClass = function (name, baseType, interfaceType) {
var that = this;
this.prototype.constructor = this;
this.__baseType = baseType || Object;
if (baseType) {
this.__basePrototypePending = true;
this.__setupBase = function () {
Type$setupBase(that);
};
this.initializeBase = function (instance, args) {
Type$initializeBase(that, instance, args);
};
this.callBaseMethod = function (instance, name, args) {
Type$callBaseMethod(that, instance, name, args);
};
}
};
function Type$setupBase(that) {
if (that.__basePrototypePending) {
var baseType = that.__baseType;
if (baseType.__basePrototypePending) {
baseType.__setupBase();
}
for (var memberName in baseType.prototype) {
var memberValue = baseType.prototype[memberName];
if (!that.prototype[memberName]) {
that.prototype[memberName] = memberValue;
}
}
delete that.__basePrototypePending;
delete that.__setupBase;
}
}
function Type$initializeBase(that, instance, args) {
if (that.__basePrototypePending) {
that.__setupBase();
}
if (!args) {
that.__baseType.apply(instance);
} else {
that.__baseType.apply(instance, args);
}
}
function Type$callBaseMethod(that, instance, name, args) {
var baseMethod = that.__baseType.prototype[name];
if (!args) {
return baseMethod.apply(instance);
} else {
return baseMethod.apply(instance, args);
}
}
// Restore the original functions on the Type (Function) object so that we
// don't pollute the global namespace.
function restoreTypeSystem() {
for (var regFuncName in originalRegistrationFunctions) {
if (!originalRegistrationFunctions.hasOwnProperty(regFuncName)) {
continue;
}
var original = originalRegistrationFunctions[regFuncName];
var typeOrPrototype = original.isPrototype ? Type.prototype : Type;
if (original.func) {
typeOrPrototype[regFuncName] = original.func;
} else {
delete typeOrPrototype[regFuncName];
}
}
}
////////////////////////////////////////////////////////////////////////////////
// Delegate
////////////////////////////////////////////////////////////////////////////////
ss.Delegate = function Delegate$() {};
ss.Delegate.registerClass('Delegate');
ss.Delegate.empty = function () {};
ss.Delegate._contains = function Delegate$_contains(targets, object, method) {
for (var i = 0; i < targets.length; i += 2) {
if (targets[i] === object && targets[i + 1] === method) {
return true;
}
}
return false;
};
ss.Delegate._create = function Delegate$_create(targets) {
var delegate = function delegate() {
if (targets.length == 2) {
return targets[1].apply(targets[0], arguments);
} else {
var clone = targets.concat();
for (var i = 0; i < clone.length; i += 2) {
if (ss.Delegate._contains(targets, clone[i], clone[i + 1])) {
clone[i + 1].apply(clone[i], arguments);
}
}
return null;
}
};
delegate._targets = targets;
return delegate;
};
ss.Delegate.create = function Delegate$create(object, method) {
if (!object) {
return method;
}
return ss.Delegate._create([object, method]);
};
ss.Delegate.combine = function Delegate$combine(delegate1, delegate2) {
if (!delegate1) {
if (!delegate2._targets) {
return ss.Delegate.create(null, delegate2);
}
return delegate2;
}
if (!delegate2) {
if (!delegate1._targets) {
return ss.Delegate.create(null, delegate1);
}
return delegate1;
}
var targets1 = delegate1._targets ? delegate1._targets : [null, delegate1];
var targets2 = delegate2._targets ? delegate2._targets : [null, delegate2];
return ss.Delegate._create(targets1.concat(targets2));
};
ss.Delegate.remove = function Delegate$remove(delegate1, delegate2) {
if (!delegate1 || delegate1 === delegate2) {
return null;
}
if (!delegate2) {
return delegate1;
}
var targets = delegate1._targets;
var object = null;
var method;
if (delegate2._targets) {
object = delegate2._targets[0];
method = delegate2._targets[1];
} else {
method = delegate2;
}
for (var i = 0; i < targets.length; i += 2) {
if (targets[i] === object && targets[i + 1] === method) {
if (targets.length == 2) {
return null;
}
targets.splice(i, 2);
return ss.Delegate._create(targets);
}
}
return delegate1;
};
////////////////////////////////////////////////////////////////////////////////
// IEnumerator
ss.IEnumerator = function IEnumerator$() {};
ss.IEnumerator.prototype = {
get_current: null,
moveNext: null,
reset: null
};
ss.IEnumerator.getEnumerator = function ss_IEnumerator$getEnumerator(enumerable) {
if (enumerable) {
return enumerable.getEnumerator ? enumerable.getEnumerator() : new ss.ArrayEnumerator(enumerable);
}
return null;
};
// ss.IEnumerator.registerInterface('IEnumerator');
////////////////////////////////////////////////////////////////////////////////
// IEnumerable
ss.IEnumerable = function IEnumerable$() {};
ss.IEnumerable.prototype = {
getEnumerator: null
};
// ss.IEnumerable.registerInterface('IEnumerable');
////////////////////////////////////////////////////////////////////////////////
// ArrayEnumerator
ss.ArrayEnumerator = function ArrayEnumerator$(array) {
this._array = array;
this._index = -1;
this.current = null;
};
ss.ArrayEnumerator.prototype = {
moveNext: function ArrayEnumerator$moveNext() {
this._index++;
this.current = this._array[this._index];
return this._index < this._array.length;
},
reset: function ArrayEnumerator$reset() {
this._index = -1;
this.current = null;
}
};
// ss.ArrayEnumerator.registerClass('ArrayEnumerator', null, ss.IEnumerator);
////////////////////////////////////////////////////////////////////////////////
// IDisposable
ss.IDisposable = function IDisposable$() {};
ss.IDisposable.prototype = {
dispose: null
};
// ss.IDisposable.registerInterface('IDisposable');
////////////////////////////////////////////////////////////////////////////////
// StringBuilder
ss.StringBuilder = function StringBuilder$(s) {
this._parts = !ss.isNullOrUndefined(s) ? [s] : [];
this.isEmpty = this._parts.length == 0;
};
ss.StringBuilder.prototype = {
append: function StringBuilder$append(s) {
if (!ss.isNullOrUndefined(s)) {
//this._parts.add(s);
this._parts.push(s);
this.isEmpty = false;
}
return this;
},
appendLine: function StringBuilder$appendLine(s) {
this.append(s);
this.append('\r\n');
this.isEmpty = false;
return this;
},
clear: function StringBuilder$clear() {
this._parts = [];
this.isEmpty = true;
},
toString: function StringBuilder$toString(s) {
return this._parts.join(s || '');
}
};
ss.StringBuilder.registerClass('StringBuilder');
////////////////////////////////////////////////////////////////////////////////
// EventArgs
ss.EventArgs = function EventArgs$() {};
ss.EventArgs.registerClass('EventArgs');
ss.EventArgs.Empty = new ss.EventArgs();
////////////////////////////////////////////////////////////////////////////////
// CancelEventArgs
ss.CancelEventArgs = function CancelEventArgs$() {
ss.CancelEventArgs.initializeBase(this);
this.cancel = false;
};
ss.CancelEventArgs.registerClass('CancelEventArgs', ss.EventArgs);
////////////////////////////////////////////////////////////////////////////////
// Tuple
ss.Tuple = function (first, second, third) {
this.first = first;
this.second = second;
if (arguments.length == 3) {
this.third = third;
}
};
ss.Tuple.registerClass('Tuple');
//})();
//! tabcoreslim.debug.js
//
// (function() {
Type.registerNamespace('tab');
////////////////////////////////////////////////////////////////////////////////
// tab.EscapingUtil
tab.EscapingUtil = function tab_EscapingUtil() {};
tab.EscapingUtil.escapeHtml = function tab_EscapingUtil$escapeHtml(html) {
var escaped = html || '';
escaped = escaped.replace(new RegExp('&', 'g'), '&');
escaped = escaped.replace(new RegExp('<', 'g'), '<');
escaped = escaped.replace(new RegExp('>', 'g'), '>');
escaped = escaped.replace(new RegExp('"', 'g'), '"');
escaped = escaped.replace(new RegExp("'", 'g'), ''');
escaped = escaped.replace(new RegExp('/', 'g'), '/');
return escaped;
};
////////////////////////////////////////////////////////////////////////////////
// tab.WindowHelper
tab.WindowHelper = function tab_WindowHelper(window) {
this._window = window;
};
tab.WindowHelper.get_windowSelf = function tab_WindowHelper$get_windowSelf() {
return window.self;
};
tab.WindowHelper.close = function tab_WindowHelper$close(window) {
window.close();
};
tab.WindowHelper.getOpener = function tab_WindowHelper$getOpener(window) {
return window.opener;
};
tab.WindowHelper.getLocation = function tab_WindowHelper$getLocation(window) {
return window.location;
};
tab.WindowHelper.getPathAndSearch = function tab_WindowHelper$getPathAndSearch(window) {
return window.location.pathname + window.location.search;
};
tab.WindowHelper.setLocationHref = function tab_WindowHelper$setLocationHref(window, href) {
window.location.href = href;
};
tab.WindowHelper.locationReplace = function tab_WindowHelper$locationReplace(window, url) {
window.location.replace(url);
};
tab.WindowHelper.open = function tab_WindowHelper$open(href, target, options) {
return window.open(href, target, options);
};
tab.WindowHelper.reload = function tab_WindowHelper$reload(w, foreGet) {
w.location.reload(foreGet);
};
tab.WindowHelper.requestAnimationFrame = function tab_WindowHelper$requestAnimationFrame(action) {
return tab.WindowHelper._requestAnimationFrameFunc(action);
};
tab.WindowHelper.cancelAnimationFrame = function tab_WindowHelper$cancelAnimationFrame(animationId) {
if (ss.isValue(animationId)) {
tab.WindowHelper._cancelAnimationFrameFunc(animationId);
}
};
tab.WindowHelper._setDefaultRequestAnimationFrameImpl = function tab_WindowHelper$_setDefaultRequestAnimationFrameImpl() {
var lastTime = 0;
tab.WindowHelper._requestAnimationFrameFunc = function (callback) {
var curTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (curTime - lastTime));
lastTime = curTime + timeToCall;
var id = window.setTimeout(function () {
callback();
}, timeToCall);
return id;
};
};
tab.WindowHelper.prototype = {
_window: null,
get_pageXOffset: function tab_WindowHelper$get_pageXOffset() {
return tab.WindowHelper._pageXOffsetFunc(this._window);
},
get_pageYOffset: function tab_WindowHelper$get_pageYOffset() {
return tab.WindowHelper._pageYOffsetFunc(this._window);
},
get_clientWidth: function tab_WindowHelper$get_clientWidth() {
return tab.WindowHelper._clientWidthFunc(this._window);
},
get_clientHeight: function tab_WindowHelper$get_clientHeight() {
return tab.WindowHelper._clientHeightFunc(this._window);
},
get_innerWidth: function tab_WindowHelper$get_innerWidth() {
return tab.WindowHelper._innerWidthFunc(this._window);
},
get_outerWidth: function tab_WindowHelper$get_outerWidth() {
return tab.WindowHelper._outerWidthFunc(this._window);
},
get_innerHeight: function tab_WindowHelper$get_innerHeight() {
return tab.WindowHelper._innerHeightFunc(this._window);
},
get_outerHeight: function tab_WindowHelper$get_outerHeight() {
return tab.WindowHelper._outerHeightFunc(this._window);
},
get_screenLeft: function tab_WindowHelper$get_screenLeft() {
return tab.WindowHelper._screenLeftFunc(this._window);
},
get_screenTop: function tab_WindowHelper$get_screenTop() {
return tab.WindowHelper._screenTopFunc(this._window);
}
};
tab.EscapingUtil.registerClass('tab.EscapingUtil');
tab.WindowHelper.registerClass('tab.WindowHelper');
tab.WindowHelper._innerWidthFunc = null;
tab.WindowHelper._innerHeightFunc = null;
tab.WindowHelper._clientWidthFunc = null;
tab.WindowHelper._clientHeightFunc = null;
tab.WindowHelper._pageXOffsetFunc = null;
tab.WindowHelper._pageYOffsetFunc = null;
tab.WindowHelper._screenLeftFunc = null;
tab.WindowHelper._screenTopFunc = null;
tab.WindowHelper._outerWidthFunc = null;
tab.WindowHelper._outerHeightFunc = null;
tab.WindowHelper._requestAnimationFrameFunc = null;
tab.WindowHelper._cancelAnimationFrameFunc = null;
(function () {
if ('innerWidth' in window) {
tab.WindowHelper._innerWidthFunc = function (w) {
return w.innerWidth;
};
} else {
tab.WindowHelper._innerWidthFunc = function (w) {
return w.document.documentElement.offsetWidth;
};
}
if ('outerWidth' in window) {
tab.WindowHelper._outerWidthFunc = function (w) {
return w.outerWidth;
};
} else {
tab.WindowHelper._outerWidthFunc = tab.WindowHelper._innerWidthFunc;
}
if ('innerHeight' in window) {
tab.WindowHelper._innerHeightFunc = function (w) {
return w.innerHeight;
};
} else {
tab.WindowHelper._innerHeightFunc = function (w) {
return w.document.documentElement.offsetHeight;
};
}
if ('outerHeight' in window) {
tab.WindowHelper._outerHeightFunc = function (w) {
return w.outerHeight;
};
} else {
tab.WindowHelper._outerHeightFunc = tab.WindowHelper._innerHeightFunc;
}
if ('clientWidth' in window) {
tab.WindowHelper._clientWidthFunc = function (w) {
return w.clientWidth;
};
} else {
tab.WindowHelper._clientWidthFunc = function (w) {
return w.document.documentElement.clientWidth;
};
}
if ('clientHeight' in window) {
tab.WindowHelper._clientHeightFunc = function (w) {
return w.clientHeight;
};
} else {
tab.WindowHelper._clientHeightFunc = function (w) {
return w.document.documentElement.clientHeight;
};
}
if (ss.isValue(window.self.pageXOffset)) {
tab.WindowHelper._pageXOffsetFunc = function (w) {
return w.pageXOffset;
};
} else {
tab.WindowHelper._pageXOffsetFunc = function (w) {
return w.document.documentElement.scrollLeft;
};
}
if (ss.isValue(window.self.pageYOffset)) {
tab.WindowHelper._pageYOffsetFunc = function (w) {
return w.pageYOffset;
};
} else {
tab.WindowHelper._pageYOffsetFunc = function (w) {
return w.document.documentElement.scrollTop;
};
}
if ('screenLeft' in window) {
tab.WindowHelper._screenLeftFunc = function (w) {
return w.screenLeft;
};
} else {
tab.WindowHelper._screenLeftFunc = function (w) {
return w.screenX;
};
}
if ('screenTop' in window) {
tab.WindowHelper._screenTopFunc = function (w) {
return w.screenTop;
};
} else {
tab.WindowHelper._screenTopFunc = function (w) {
return w.screenY;
};
}
var DefaultRequestName = 'requestAnimationFrame';
var DefaultCancelName = 'cancelAnimationFrame';
var vendors = ['ms', 'moz', 'webkit', 'o'];
var requestFuncName = null;
var cancelFuncName = null;
if (DefaultRequestName in window) {
requestFuncName = DefaultRequestName;
}
if (DefaultCancelName in window) {
cancelFuncName = DefaultCancelName;
}
for (var ii = 0; ii < vendors.length && (requestFuncName == null || cancelFuncName == null); ++ii) {
var vendor = vendors[ii];
var funcName = vendor + 'RequestAnimationFrame';
if (requestFuncName == null && funcName in window) {
requestFuncName = funcName;
}
if (cancelFuncName == null) {
funcName = vendor + 'CancelAnimationFrame';
if (funcName in window) {
cancelFuncName = funcName;
}
funcName = vendor + 'CancelRequestAnimationFrame';
if (funcName in window) {
cancelFuncName = funcName;
}
}
}
if (requestFuncName != null) {
tab.WindowHelper._requestAnimationFrameFunc = function (callback) {
return window[requestFuncName](callback);
};
} else {
tab.WindowHelper._setDefaultRequestAnimationFrameImpl();
}
if (cancelFuncName != null) {
tab.WindowHelper._cancelAnimationFrameFunc = function (animationId) {
window[cancelFuncName](animationId);
};
} else {
tab.WindowHelper._cancelAnimationFrameFunc = function (id) {
window.clearTimeout(id);
};
}
})();
// }());
Type.registerNamespace('tab');
////////////////////////////////////////////////////////////////////////////////
// tab._SheetInfoImpl
tab.$create__SheetInfoImpl = function tab__SheetInfoImpl(name, sheetType, index, size, workbook, url, isActive, isHidden, zoneId) {
var $o = {};
$o.name = name;
$o.sheetType = sheetType;
$o.index = index;
$o.size = size;
$o.workbook = workbook;
$o.url = url;
$o.isActive = isActive;
$o.isHidden = isHidden;
$o.zoneId = zoneId;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab._dashboardZoneInfo
tab.$create__dashboardZoneInfo = function tab__dashboardZoneInfo(name, objectType, position, size, zoneId) {
var $o = {};
$o._name = name;
$o._objectType = objectType;
$o._position = position;
$o._size = size;
$o._zoneId = zoneId;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab._StoryPointInfoImpl
tab.$create__StoryPointInfoImpl = function tab__StoryPointInfoImpl(caption, index, storyPointId, isActive, isUpdated, parentStoryImpl) {
var $o = {};
$o.caption = caption;
$o.index = index;
$o.storyPointId = storyPointId;
$o.isActive = isActive;
$o.isUpdated = isUpdated;
$o.parentStoryImpl = parentStoryImpl;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab._ApiCommand
tab._ApiCommand = function tab__ApiCommand(name, sourceId, handlerId, parameters) {
this._name = name;
this._sourceId = sourceId;
this._handlerId = handlerId;
this._parameters = parameters;
};
tab._ApiCommand.parse = function tab__ApiCommand$parse(serialized) {
var name;
var index = serialized.indexOf(',');
if (index < 0) {
name = serialized;
return new tab._ApiCommand(name, null, null, null);
}
name = serialized.substr(0, index);
var sourceId;
var secondPart = serialized.substr(index + 1);
index = secondPart.indexOf(',');
if (index < 0) {
sourceId = secondPart;
return new tab._ApiCommand(name, sourceId, null, null);
}
sourceId = secondPart.substr(0, index);
var handlerId;
var thirdPart = secondPart.substr(index + 1);
index = thirdPart.indexOf(',');
if (index < 0) {
handlerId = thirdPart;
return new tab._ApiCommand(name, sourceId, handlerId, null);
}
handlerId = thirdPart.substr(0, index);
var parameters = thirdPart.substr(index + 1);
tab._ApiCommand.lastResponseMessage = serialized;
if (name === 'api.GetClientInfoCommand') {
tab._ApiCommand.lastClientInfoResponseMessage = serialized;
}
return new tab._ApiCommand(name, sourceId, handlerId, parameters);
};
tab._ApiCommand.prototype = {
_name: null,
_handlerId: null,
_sourceId: null,
_parameters: null,
get_name: function tab__ApiCommand$get_name() {
return this._name;
},
get_handlerId: function tab__ApiCommand$get_handlerId() {
return this._handlerId;
},
get_sourceId: function tab__ApiCommand$get_sourceId() {
return this._sourceId;
},
get_parameters: function tab__ApiCommand$get_parameters() {
return this._parameters;
},
get_isApiCommandName: function tab__ApiCommand$get_isApiCommandName() {
return !this.get_rawName().indexOf('api.', 0);
},
get_rawName: function tab__ApiCommand$get_rawName() {
return this._name;
},
serialize: function tab__ApiCommand$serialize() {
var message = [];
message.push(this._name);
message.push(this._sourceId);
message.push(this._handlerId);
if (ss.isValue(this._parameters)) {
message.push(this._parameters);
}
var serializedMessage = message.join(',');
tab._ApiCommand.lastRequestMessage = serializedMessage;
return serializedMessage;
}
////////////////////////////////////////////////////////////////////////////////
// tab._ApiServerResultParser
};tab._ApiServerResultParser = function tab__ApiServerResultParser(serverResult) {
var param = JSON.parse(serverResult);
this._commandResult = param['api.commandResult'];
this._commandData = param['api.commandData'];
};
tab._ApiServerResultParser.prototype = {
_commandResult: null,
_commandData: null,
get_result: function tab__ApiServerResultParser$get_result() {
return this._commandResult;
},
get_data: function tab__ApiServerResultParser$get_data() {
return this._commandData;
}
////////////////////////////////////////////////////////////////////////////////
// tab._ApiServerNotification
};tab._ApiServerNotification = function tab__ApiServerNotification(workbookName, worksheetName, data) {
this._workbookName = workbookName;
this._worksheetName = worksheetName;
this._data = data;
};
tab._ApiServerNotification.deserialize = function tab__ApiServerNotification$deserialize(json) {
var param = JSON.parse(json);
var workbookName = param['api.workbookName'];
var worksheetName = param['api.worksheetName'];
var data = param['api.commandData'];
return new tab._ApiServerNotification(workbookName, worksheetName, data);
};
tab._ApiServerNotification.prototype = {
_workbookName: null,
_worksheetName: null,
_data: null,
get_workbookName: function tab__ApiServerNotification$get_workbookName() {
return this._workbookName;
},
get_worksheetName: function tab__ApiServerNotification$get_worksheetName() {
return this._worksheetName;
},
get_data: function tab__ApiServerNotification$get_data() {
return this._data;
},
serialize: function tab__ApiServerNotification$serialize() {
var serialized = {};
serialized['api.workbookName'] = this._workbookName;
serialized['api.worksheetName'] = this._worksheetName;
serialized['api.commandData'] = this._data;
return JSON.stringify(serialized);
}
////////////////////////////////////////////////////////////////////////////////
// tab._CommandReturnHandler
};tab._CommandReturnHandler = function tab__CommandReturnHandler(commandName, successCallbackTiming, successCallback, errorCallback) {
this._commandName = commandName;
this._successCallback = successCallback;
this._successCallbackTiming = successCallbackTiming;
this._errorCallback = errorCallback;
};
tab._CommandReturnHandler.prototype = {
_commandName: null,
_successCallbackTiming: 0,
_successCallback: null,
_errorCallback: null,
get_commandName: function tab__CommandReturnHandler$get_commandName() {
return this._commandName;
},
get_successCallback: function tab__CommandReturnHandler$get_successCallback() {
return this._successCallback;
},
get_successCallbackTiming: function tab__CommandReturnHandler$get_successCallbackTiming() {
return this._successCallbackTiming;
},
get_errorCallback: function tab__CommandReturnHandler$get_errorCallback() {
return this._errorCallback;
}
////////////////////////////////////////////////////////////////////////////////
// tab._crossDomainMessageRouter
};tab._crossDomainMessageRouter = function tab__crossDomainMessageRouter() {
this._handlers = {};
this._commandCallbacks = {};
this._customViewLoadCallbacks = {};
this._commandReturnAfterStateReadyQueues = {};
if (tab._Utility.hasWindowAddEventListener()) {
window.addEventListener('message', this._getHandleCrossDomainMessageDelegate(), false);
} else if (tab._Utility.hasDocumentAttachEvent()) {
document.attachEvent('onmessage', this._getHandleCrossDomainMessageDelegate());
window.attachEvent('onmessage', this._getHandleCrossDomainMessageDelegate());
} else {
window.onmessage = this._getHandleCrossDomainMessageDelegate();
}
this._nextHandlerId = this._nextCommandId = 0;
};
tab._crossDomainMessageRouter.prototype = {
_nextHandlerId: 0,
_nextCommandId: 0,
registerHandler: function tab__crossDomainMessageRouter$registerHandler(handler) {
var uniqueId = 'handler' + this._nextHandlerId;
if (ss.isValue(handler.get_handlerId()) || ss.isValue(this._handlers[handler.get_handlerId()])) {
throw tab._TableauException.createInternalError("Handler '" + handler.get_handlerId() + "' is already registered.");
}
this._nextHandlerId++;
handler.set_handlerId(uniqueId);
this._handlers[uniqueId] = handler;
handler.add_customViewsListLoad(ss.Delegate.create(this, this._handleCustomViewsListLoad));
handler.add_stateReadyForQuery(ss.Delegate.create(this, this._handleStateReadyForQuery));
},
unregisterHandler: function tab__crossDomainMessageRouter$unregisterHandler(handler) {
if (ss.isValue(handler.get_handlerId()) || ss.isValue(this._handlers[handler.get_handlerId()])) {
delete this._handlers[handler.get_handlerId()];
handler.remove_customViewsListLoad(ss.Delegate.create(this, this._handleCustomViewsListLoad));
handler.remove_stateReadyForQuery(ss.Delegate.create(this, this._handleStateReadyForQuery));
}
},
sendCommand: function tab__crossDomainMessageRouter$sendCommand(source, commandParameters, returnHandler) {
var iframe = source.get_iframe();
var handlerId = source.get_handlerId();
if (!tab._Utility.hasWindowPostMessage() || ss.isNullOrUndefined(iframe) || ss.isNullOrUndefined(iframe.contentWindow)) {
return;
}
var sourceId = 'cmd' + this._nextCommandId;
this._nextCommandId++;
var callbackMap = this._commandCallbacks[handlerId];
if (ss.isNullOrUndefined(callbackMap)) {
callbackMap = {};
this._commandCallbacks[handlerId] = callbackMap;
}
callbackMap[sourceId] = returnHandler;
var commandName = returnHandler.get_commandName();
if (commandName === 'api.ShowCustomViewCommand') {
var customViewCallbackMap = this._customViewLoadCallbacks[handlerId];
if (ss.isNullOrUndefined(customViewCallbackMap)) {
customViewCallbackMap = {};
this._customViewLoadCallbacks[handlerId] = customViewCallbackMap;
}
customViewCallbackMap[sourceId] = returnHandler;
}
var serializedParams = null;
if (ss.isValue(commandParameters)) {
serializedParams = tab.JsonUtil.toJson(commandParameters, false, '');
}
var command = new tab._ApiCommand(commandName, sourceId, handlerId, serializedParams);
var message = command.serialize();
if (tab._Utility.isPostMessageSynchronous()) {
window.setTimeout(function () {
iframe.contentWindow.postMessage(message, source.get_serverRoot());
}, 0);
} else {
iframe.contentWindow.postMessage(message, source.get_serverRoot());
}
},
_handleCustomViewsListLoad: function tab__crossDomainMessageRouter$_handleCustomViewsListLoad(source) {
var handlerId = source.get_handlerId();
var customViewCallbackMap = this._customViewLoadCallbacks[handlerId];
if (ss.isNullOrUndefined(customViewCallbackMap)) {
return;
}
var $dict1 = customViewCallbackMap;
for (var $key2 in $dict1) {
var customViewCallback = { key: $key2, value: $dict1[$key2] };
var returnHandler = customViewCallback.value;
if (ss.isValue(returnHandler.get_successCallback())) {
returnHandler.get_successCallback()(null);
}
}
delete this._customViewLoadCallbacks[handlerId];
},
_handleStateReadyForQuery: function tab__crossDomainMessageRouter$_handleStateReadyForQuery(source) {
var queue = this._commandReturnAfterStateReadyQueues[source.get_handlerId()];
if (tab._Utility.isNullOrEmpty(queue)) {
return;
}
while (queue.length > 0) {
var successCallback = queue.pop();
if (ss.isValue(successCallback)) {
successCallback();
}
}
},
_getHandleCrossDomainMessageDelegate: function tab__crossDomainMessageRouter$_getHandleCrossDomainMessageDelegate() {
return ss.Delegate.create(this, function (e) {
this._handleCrossDomainMessage(e);
});
},
_handleCrossDomainMessage: function tab__crossDomainMessageRouter$_handleCrossDomainMessage(e) {
if (ss.isNullOrUndefined(e.data)) {
return;
}
var command = tab._ApiCommand.parse(e.data);
var rawName = command.get_rawName();
var handlerId = command.get_handlerId();
var handler = this._handlers[handlerId];
if (ss.isNullOrUndefined(handler) || handler.get_handlerId() !== command.get_handlerId()) {
handler = new tab._doNothingCrossDomainHandler();
}
if (command.get_isApiCommandName()) {
if (command.get_sourceId() === 'xdomainSourceId') {
handler.handleEventNotification(command.get_name(), command.get_parameters());
if (command.get_name() === 'api.FirstVizSizeKnownEvent') {
e.source.postMessage('tableau.bootstrap', '*');
}
} else {
this._handleCrossDomainResponse(command);
}
} else {
this._handleLegacyNotifications(rawName, e, handler);
}
},
_handleCrossDomainResponse: function tab__crossDomainMessageRouter$_handleCrossDomainResponse(command) {
var commandCallbackMap = this._commandCallbacks[command.get_handlerId()];
var returnHandler = ss.isValue(commandCallbackMap) ? commandCallbackMap[command.get_sourceId()] : null;
if (ss.isNullOrUndefined(returnHandler)) {
return;
}
delete commandCallbackMap[command.get_sourceId()];
if (command.get_name() !== returnHandler.get_commandName()) {
return;
}
var crossDomainResult = new tab._ApiServerResultParser(command.get_parameters());
var commandResult = crossDomainResult.get_data();
if (crossDomainResult.get_result() === 'api.success') {
switch (returnHandler.get_successCallbackTiming()) {
case 0:
if (ss.isValue(returnHandler.get_successCallback())) {
returnHandler.get_successCallback()(commandResult);
}
break;
case 1:
var postponedCallback = function postponedCallback() {
if (ss.isValue(returnHandler.get_successCallback())) {
returnHandler.get_successCallback()(commandResult);
}
};
var queue = this._commandReturnAfterStateReadyQueues[command.get_handlerId()];
if (ss.isNullOrUndefined(queue)) {
queue = [];
this._commandReturnAfterStateReadyQueues[command.get_handlerId()] = queue;
}
queue.push(postponedCallback);
break;
default:
throw tab._TableauException.createInternalError('Unknown timing value: ' + returnHandler.get_successCallbackTiming());
}
} else if (ss.isValue(returnHandler.get_errorCallback())) {
var remoteError = crossDomainResult.get_result() === 'api.remotefailed';
returnHandler.get_errorCallback()(remoteError, commandResult);
}
},
_handleLegacyNotifications: function tab__crossDomainMessageRouter$_handleLegacyNotifications(messageName, e, handler) {
if (messageName === 'layoutInfoReq') {
tab._VizManagerImpl._sendVizOffsets();
this._postLayoutInfo(e.source);
} else if (messageName === 'tableau.completed' || messageName === 'completed') {
handler.handleVizLoad();
}
},
_postLayoutInfo: function tab__crossDomainMessageRouter$_postLayoutInfo(source) {
if (!tab._Utility.hasWindowPostMessage()) {
return;
}
var win = new tab.WindowHelper(window.self);
var width = ss.isValue(win.get_innerWidth()) ? win.get_innerWidth() : document.documentElement.offsetWidth;
var height = ss.isValue(win.get_innerHeight()) ? win.get_innerHeight() : document.documentElement.offsetHeight;
var left = ss.isValue(win.get_pageXOffset()) ? win.get_pageXOffset() : document.documentElement.scrollLeft;
var top = ss.isValue(win.get_pageYOffset()) ? win.get_pageYOffset() : document.documentElement.scrollTop;
var msgArr = [];
msgArr.push('layoutInfoResp');
msgArr.push(left);
msgArr.push(top);
msgArr.push(width);
msgArr.push(height);
source.postMessage(msgArr.join(','), '*');
}
////////////////////////////////////////////////////////////////////////////////
// tab._doNothingCrossDomainHandler
};tab._doNothingCrossDomainHandler = function tab__doNothingCrossDomainHandler() {};
tab._doNothingCrossDomainHandler.prototype = {
_handlerId: null,
add_customViewsListLoad: function tab__doNothingCrossDomainHandler$add_customViewsListLoad(value) {
this.__customViewsListLoad = ss.Delegate.combine(this.__customViewsListLoad, value);
},
remove_customViewsListLoad: function tab__doNothingCrossDomainHandler$remove_customViewsListLoad(value) {
this.__customViewsListLoad = ss.Delegate.remove(this.__customViewsListLoad, value);
},
__customViewsListLoad: null,
add_stateReadyForQuery: function tab__doNothingCrossDomainHandler$add_stateReadyForQuery(value) {
this.__stateReadyForQuery = ss.Delegate.combine(this.__stateReadyForQuery, value);
},
remove_stateReadyForQuery: function tab__doNothingCrossDomainHandler$remove_stateReadyForQuery(value) {
this.__stateReadyForQuery = ss.Delegate.remove(this.__stateReadyForQuery, value);
},
__stateReadyForQuery: null,
get_iframe: function tab__doNothingCrossDomainHandler$get_iframe() {
return null;
},
get_handlerId: function tab__doNothingCrossDomainHandler$get_handlerId() {
return this._handlerId;
},
set_handlerId: function tab__doNothingCrossDomainHandler$set_handlerId(value) {
this._handlerId = value;
return value;
},
get_serverRoot: function tab__doNothingCrossDomainHandler$get_serverRoot() {
return '*';
},
handleVizLoad: function tab__doNothingCrossDomainHandler$handleVizLoad() {},
handleEventNotification: function tab__doNothingCrossDomainHandler$handleEventNotification(eventName, parameters) {},
_silenceTheCompilerWarning: function tab__doNothingCrossDomainHandler$_silenceTheCompilerWarning() {
this.__customViewsListLoad(null);
this.__stateReadyForQuery(null);
}
////////////////////////////////////////////////////////////////////////////////
// tab.CrossDomainMessagingOptions
};tab.CrossDomainMessagingOptions = function tab_CrossDomainMessagingOptions(router, handler) {
tab._Param.verifyValue(router, 'router');
tab._Param.verifyValue(handler, 'handler');
this._router = router;
this._handler = handler;
};
tab.CrossDomainMessagingOptions.prototype = {
_router: null,
_handler: null,
get_router: function tab_CrossDomainMessagingOptions$get_router() {
return this._router;
},
get_handler: function tab_CrossDomainMessagingOptions$get_handler() {
return this._handler;
},
sendCommand: function tab_CrossDomainMessagingOptions$sendCommand(commandParameters, returnHandler) {
this._router.sendCommand(this._handler, commandParameters, returnHandler);
}
////////////////////////////////////////////////////////////////////////////////
// tab._enums
};tab._enums = function tab__enums() {};
tab._enums._normalizePeriodType = function tab__enums$_normalizePeriodType(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.PeriodType, true);
};
tab._enums._normalizeDateRangeType = function tab__enums$_normalizeDateRangeType(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.DateRangeType, true);
};
tab._enums._normalizeFilterUpdateType = function tab__enums$_normalizeFilterUpdateType(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.FilterUpdateType, true);
};
tab._enums._normalizeSelectionUpdateType = function tab__enums$_normalizeSelectionUpdateType(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.SelectionUpdateType, true);
};
tab._enums._isSelectionUpdateType = function tab__enums$_isSelectionUpdateType(rawValue) {
var rawString = ss.isValue(rawValue) ? rawValue.toString() : '';
return tab._enums._normalizeEnum(rawString, '', tableauSoftware.SelectionUpdateType, false) != null;
};
tab._enums._normalizeNullOption = function tab__enums$_normalizeNullOption(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.NullOption, true);
};
tab._enums._normalizeSheetSizeBehavior = function tab__enums$_normalizeSheetSizeBehavior(rawValue, paramName) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, paramName, tableauSoftware.SheetSizeBehavior, true);
};
tab._enums._normalizeTableauEventName = function tab__enums$_normalizeTableauEventName(rawValue) {
var rawString = ss.isValue(rawValue) ? rawValue : '';
return tab._enums._normalizeEnum(rawString, '', tableauSoftware.TableauEventName, false);
};
tab._enums._normalizeEnum = function tab__enums$_normalizeEnum(rawValue, paramName, enumObject, throwOnInvalid) {
if (ss.isValue(rawValue)) {
var lookup = rawValue.toString().toUpperCase();
var $dict1 = enumObject;
for (var $key2 in $dict1) {
var entry = { key: $key2, value: $dict1[$key2] };
var compareValue = entry.value.toString().toUpperCase();
if (lookup === compareValue) {
return entry.value;
}
}
}
if (throwOnInvalid) {
throw tab._TableauException.createInvalidParameter(paramName);
}
return null;
};
////////////////////////////////////////////////////////////////////////////////
// tab._ApiBootstrap
tab._ApiBootstrap = function tab__ApiBootstrap() {};
tab._ApiBootstrap.initialize = function tab__ApiBootstrap$initialize() {
tab._ApiObjectRegistry.registerCrossDomainMessageRouter(function () {
return new tab._crossDomainMessageRouter();
});
};
////////////////////////////////////////////////////////////////////////////////
// tab._ApiObjectRegistry
tab._ApiObjectRegistry = function tab__ApiObjectRegistry() {};
tab._ApiObjectRegistry.registerCrossDomainMessageRouter = function tab__ApiObjectRegistry$registerCrossDomainMessageRouter(objectCreationFunc) {
return tab._ApiObjectRegistry._registerType('ICrossDomainMessageRouter', objectCreationFunc);
};
tab._ApiObjectRegistry.getCrossDomainMessageRouter = function tab__ApiObjectRegistry$getCrossDomainMessageRouter() {
return tab._ApiObjectRegistry._getSingleton('ICrossDomainMessageRouter');
};
tab._ApiObjectRegistry.disposeCrossDomainMessageRouter = function tab__ApiObjectRegistry$disposeCrossDomainMessageRouter() {
tab._ApiObjectRegistry._clearSingletonInstance('ICrossDomainMessageRouter');
};
tab._ApiObjectRegistry._registerType = function tab__ApiObjectRegistry$_registerType(interfaceTypeName, objectCreationFunc) {
if (ss.isNullOrUndefined(tab._ApiObjectRegistry._creationRegistry)) {
tab._ApiObjectRegistry._creationRegistry = {};
}
var previousType = tab._ApiObjectRegistry._creationRegistry[interfaceTypeName];
tab._ApiObjectRegistry._creationRegistry[interfaceTypeName] = objectCreationFunc;
return previousType;
};
tab._ApiObjectRegistry._createType = function tab__ApiObjectRegistry$_createType(interfaceTypeName) {
if (ss.isNullOrUndefined(tab._ApiObjectRegistry._creationRegistry)) {
throw tab._TableauException.createInternalError('No types registered');
}
var creationFunc = tab._ApiObjectRegistry._creationRegistry[interfaceTypeName];
if (ss.isNullOrUndefined(creationFunc)) {
throw tab._TableauException.createInternalError("No creation function has been registered for interface type '" + interfaceTypeName + "'.");
}
var instance = creationFunc();
return instance;
};
tab._ApiObjectRegistry._getSingleton = function tab__ApiObjectRegistry$_getSingleton(interfaceTypeName) {
if (ss.isNullOrUndefined(tab._ApiObjectRegistry._singletonInstanceRegistry)) {
tab._ApiObjectRegistry._singletonInstanceRegistry = {};
}
var instance = tab._ApiObjectRegistry._singletonInstanceRegistry[interfaceTypeName];
if (ss.isNullOrUndefined(instance)) {
instance = tab._ApiObjectRegistry._createType(interfaceTypeName);
tab._ApiObjectRegistry._singletonInstanceRegistry[interfaceTypeName] = instance;
}
return instance;
};
tab._ApiObjectRegistry._clearSingletonInstance = function tab__ApiObjectRegistry$_clearSingletonInstance(interfaceTypeName) {
if (ss.isNullOrUndefined(tab._ApiObjectRegistry._singletonInstanceRegistry)) {
return null;
}
var instance = tab._ApiObjectRegistry._singletonInstanceRegistry[interfaceTypeName];
delete tab._ApiObjectRegistry._singletonInstanceRegistry[interfaceTypeName];
return instance;
};
////////////////////////////////////////////////////////////////////////////////
// tab._CustomViewImpl
tab._CustomViewImpl = function tab__CustomViewImpl(workbookImpl, name, messagingOptions) {
this._workbookImpl = workbookImpl;
this._name = name;
this._messagingOptions = messagingOptions;
this._isPublic = false;
this._isDefault = false;
this._isStale = false;
};
tab._CustomViewImpl._getAsync = function tab__CustomViewImpl$_getAsync(eventContext) {
var deferred = new tab._Deferred();
deferred.resolve(eventContext.get__customViewImpl().get__customView());
return deferred.get_promise();
};
tab._CustomViewImpl._createNew = function tab__CustomViewImpl$_createNew(workbookImpl, messagingOptions, apiPresModel, defaultId) {
var cv = new tab._CustomViewImpl(workbookImpl, apiPresModel.name, messagingOptions);
cv._isPublic = apiPresModel.isPublic;
cv._url = apiPresModel.url;
cv._ownerName = apiPresModel.owner.friendlyName;
cv._isDefault = ss.isValue(defaultId) && defaultId === apiPresModel.id;
cv._presModel = apiPresModel;
return cv;
};
tab._CustomViewImpl._saveNewAsync = function tab__CustomViewImpl$_saveNewAsync(workbookImpl, messagingOptions, name) {
var deferred = new tab._Deferred();
var param = {};
param['api.customViewName'] = name;
var returnHandler = tab._CustomViewImpl._createCustomViewCommandReturnHandler('api.SaveNewCustomViewCommand', deferred, function (result) {
tab._CustomViewImpl._processCustomViewUpdate(workbookImpl, messagingOptions, result, true);
var newView = null;
if (ss.isValue(workbookImpl.get__updatedCustomViews())) {
newView = workbookImpl.get__updatedCustomViews().get_item(0);
}
deferred.resolve(newView);
});
messagingOptions.sendCommand(param, returnHandler);
return deferred.get_promise();
};
tab._CustomViewImpl._showCustomViewAsync = function tab__CustomViewImpl$_showCustomViewAsync(workbookImpl, messagingOptions, serverCustomizedView) {
var deferred = new tab._Deferred();
var param = {};
if (ss.isValue(serverCustomizedView)) {
param['api.customViewParam'] = serverCustomizedView;
}
var returnHandler = tab._CustomViewImpl._createCustomViewCommandReturnHandler('api.ShowCustomViewCommand', deferred, function (result) {
var cv = workbookImpl.get_activeCustomView();
deferred.resolve(cv);
});
messagingOptions.sendCommand(param, returnHandler);
return deferred.get_promise();
};
tab._CustomViewImpl._makeCurrentCustomViewDefaultAsync = function tab__CustomViewImpl$_makeCurrentCustomViewDefaultAsync(workbookImpl, messagingOptions) {
var deferred = new tab._Deferred();
var param = {};
var returnHandler = tab._CustomViewImpl._createCustomViewCommandReturnHandler('api.MakeCurrentCustomViewDefaultCommand', deferred, function (result) {
var cv = workbookImpl.get_activeCustomView();
deferred.resolve(cv);
});
messagingOptions.sendCommand(param, returnHandler);
return deferred.get_promise();
};
tab._CustomViewImpl._getCustomViewsAsync = function tab__CustomViewImpl$_getCustomViewsAsync(workbookImpl, messagingOptions) {
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.FetchCustomViewsCommand', 0, function (result) {
tab._CustomViewImpl._processCustomViews(workbookImpl, messagingOptions, result);
deferred.resolve(workbookImpl.get__customViews()._toApiCollection());
}, function (remoteError, message) {
deferred.reject(tab._TableauException.create('serverError', message));
});
messagingOptions.sendCommand(null, returnHandler);
return deferred.get_promise();
};
tab._CustomViewImpl._processCustomViews = function tab__CustomViewImpl$_processCustomViews(workbookImpl, messagingOptions, info) {
tab._CustomViewImpl._processCustomViewUpdate(workbookImpl, messagingOptions, info, false);
};
tab._CustomViewImpl._processCustomViewUpdate = function tab__CustomViewImpl$_processCustomViewUpdate(workbookImpl, messagingOptions, info, doUpdateList) {
if (doUpdateList) {
workbookImpl.set__updatedCustomViews(new tab._Collection());
}
workbookImpl.set__currentCustomView(null);
var currentViewName = null;
if (ss.isValue(info.currentView)) {
currentViewName = info.currentView.name;
}
var defaultId = info.defaultCustomViewId;
if (doUpdateList && ss.isValue(info.newView)) {
var newViewImpl = tab._CustomViewImpl._createNew(workbookImpl, messagingOptions, info.newView, defaultId);
workbookImpl.get__updatedCustomViews()._add(newViewImpl.get__name(), newViewImpl.get__customView());
}
workbookImpl.set__removedCustomViews(workbookImpl.get__customViews());
workbookImpl.set__customViews(new tab._Collection());
if (ss.isValue(info.customViews)) {
var list = info.customViews;
if (list.length > 0) {
for (var i = 0; i < list.length; i++) {
var customViewImpl = tab._CustomViewImpl._createNew(workbookImpl, messagingOptions, list[i], defaultId);
workbookImpl.get__customViews()._add(customViewImpl.get__name(), customViewImpl.get__customView());
if (workbookImpl.get__removedCustomViews()._has(customViewImpl.get__name())) {
workbookImpl.get__removedCustomViews()._remove(customViewImpl.get__name());
} else if (doUpdateList) {
if (!workbookImpl.get__updatedCustomViews()._has(customViewImpl.get__name())) {
workbookImpl.get__updatedCustomViews()._add(customViewImpl.get__name(), customViewImpl.get__customView());
}
}
if (ss.isValue(currentViewName) && customViewImpl.get__name() === currentViewName) {
workbookImpl.set__currentCustomView(customViewImpl.get__customView());
}
}
}
}
};
tab._CustomViewImpl._createCustomViewCommandReturnHandler = function tab__CustomViewImpl$_createCustomViewCommandReturnHandler(commandName, deferred, successCallback) {
var errorCallback = function errorCallback(remoteError, message) {
deferred.reject(tab._TableauException.create('serverError', message));
};
return new tab._CommandReturnHandler(commandName, 0, successCallback, errorCallback);
};
tab._CustomViewImpl.prototype = {
_customView: null,
_presModel: null,
_workbookImpl: null,
_messagingOptions: null,
_name: null,
_ownerName: null,
_url: null,
_isPublic: false,
_isDefault: false,
_isStale: false,
get__customView: function tab__CustomViewImpl$get__customView() {
if (this._customView == null) {
this._customView = new tableauSoftware.CustomView(this);
}
return this._customView;
},
get__workbook: function tab__CustomViewImpl$get__workbook() {
return this._workbookImpl.get_workbook();
},
get__url: function tab__CustomViewImpl$get__url() {
return this._url;
},
get__name: function tab__CustomViewImpl$get__name() {
return this._name;
},
set__name: function tab__CustomViewImpl$set__name(value) {
if (this._isStale) {
throw tab._TableauException.create('staleDataReference', 'Stale data');
}
this._name = value;
return value;
},
get__ownerName: function tab__CustomViewImpl$get__ownerName() {
return this._ownerName;
},
get__advertised: function tab__CustomViewImpl$get__advertised() {
return this._isPublic;
},
set__advertised: function tab__CustomViewImpl$set__advertised(value) {
if (this._isStale) {
throw tab._TableauException.create('staleDataReference', 'Stale data');
}
this._isPublic = value;
return value;
},
get__isDefault: function tab__CustomViewImpl$get__isDefault() {
return this._isDefault;
},
saveAsync: function tab__CustomViewImpl$saveAsync() {
if (this._isStale || ss.isNullOrUndefined(this._presModel)) {
throw tab._TableauException.create('staleDataReference', 'Stale data');
}
this._presModel.isPublic = this._isPublic;
this._presModel.name = this._name;
var deferred = new tab._Deferred();
var param = {};
param['api.customViewParam'] = this._presModel;
var returnHandler = tab._CustomViewImpl._createCustomViewCommandReturnHandler('api.UpdateCustomViewCommand', deferred, ss.Delegate.create(this, function (result) {
tab._CustomViewImpl._processCustomViewUpdate(this._workbookImpl, this._messagingOptions, result, true);
deferred.resolve(this.get__customView());
}));
this._messagingOptions.sendCommand(param, returnHandler);
return deferred.get_promise();
},
_removeAsync: function tab__CustomViewImpl$_removeAsync() {
var deferred = new tab._Deferred();
var param = {};
param['api.customViewParam'] = this._presModel;
var returnHandler = tab._CustomViewImpl._createCustomViewCommandReturnHandler('api.RemoveCustomViewCommand', deferred, ss.Delegate.create(this, function (result) {
this._isStale = true;
tab._CustomViewImpl._processCustomViews(this._workbookImpl, this._messagingOptions, result);
deferred.resolve(this.get__customView());
}));
this._messagingOptions.sendCommand(param, returnHandler);
return deferred.get_promise();
},
_showAsync: function tab__CustomViewImpl$_showAsync() {
if (this._isStale || ss.isNullOrUndefined(this._presModel)) {
throw tab._TableauException.create('staleDataReference', 'Stale data');
}
return tab._CustomViewImpl._showCustomViewAsync(this._workbookImpl, this._messagingOptions, this._presModel);
},
_isDifferent: function tab__CustomViewImpl$_isDifferent(other) {
return this._ownerName !== other._ownerName || this._url !== other._url || this._isPublic !== other._isPublic || this._isDefault !== other._isDefault;
}
////////////////////////////////////////////////////////////////////////////////
// tab._DashboardImpl
};tab._DashboardImpl = function tab__DashboardImpl(sheetInfoImpl, workbookImpl, messagingOptions) {
this._worksheets$1 = new tab._Collection();
this._dashboardObjects$1 = new tab._Collection();
tab._DashboardImpl.initializeBase(this, [sheetInfoImpl, workbookImpl, messagingOptions]);
};
tab._DashboardImpl.prototype = {
_dashboard$1: null,
get_sheet: function tab__DashboardImpl$get_sheet() {
return this.get_dashboard();
},
get_dashboard: function tab__DashboardImpl$get_dashboard() {
if (this._dashboard$1 == null) {
this._dashboard$1 = new tableauSoftware.Dashboard(this);
}
return this._dashboard$1;
},
get_worksheets: function tab__DashboardImpl$get_worksheets() {
return this._worksheets$1;
},
get_objects: function tab__DashboardImpl$get_objects() {
return this._dashboardObjects$1;
},
_addObjects: function tab__DashboardImpl$_addObjects(zones, findSheetFunc) {
this._dashboardObjects$1 = new tab._Collection();
this._worksheets$1 = new tab._Collection();
for (var i = 0; i < zones.length; i++) {
var zone = zones[i];
var worksheet = null;
if (zones[i]._objectType === 'worksheet') {
var name = zone._name;
if (ss.isNullOrUndefined(name)) {
continue;
}
var index = this._worksheets$1.get__length();
var size = tab.SheetSizeFactory.createAutomatic();
var isActive = false;
var publishedSheetInfo = findSheetFunc(name);
var isHidden = ss.isNullOrUndefined(publishedSheetInfo);
var url = isHidden ? '' : publishedSheetInfo.getUrl();
var sheetInfoImpl = tab.$create__SheetInfoImpl(name, 'worksheet', index, size, this.get_workbook(), url, isActive, isHidden, zone._zoneId);
var worksheetImpl = new tab._WorksheetImpl(sheetInfoImpl, this.get_workbookImpl(), this.get_messagingOptions(), this);
worksheet = worksheetImpl.get_worksheet();
this._worksheets$1._add(name, worksheetImpl.get_worksheet());
}
var obj = new tableauSoftware.DashboardObject(zone, this.get_dashboard(), worksheet);
this._dashboardObjects$1._add(i.toString(), obj);
}
}
////////////////////////////////////////////////////////////////////////////////
// tab._DataSourceImpl
};tab._DataSourceImpl = function tab__DataSourceImpl(name, isPrimary) {
this._fields = new tab._Collection();
tab._Param.verifyString(name, 'name');
this._name = name;
this._isPrimary = isPrimary;
};
tab._DataSourceImpl.processDataSource = function tab__DataSourceImpl$processDataSource(dataSourcePm) {
var dataSourceImpl = new tab._DataSourceImpl(dataSourcePm.name, dataSourcePm.isPrimary);
var fields = dataSourcePm.fields || new Array(0);
var $enum1 = ss.IEnumerator.getEnumerator(fields);
while ($enum1.moveNext()) {
var fieldPm = $enum1.current;
var field = new tableauSoftware.Field(dataSourceImpl.get_dataSource(), fieldPm.name, fieldPm.role, fieldPm.aggregation);
dataSourceImpl.addField(field);
}
return dataSourceImpl;
};
tab._DataSourceImpl.processDataSourcesForWorksheet = function tab__DataSourceImpl$processDataSourcesForWorksheet(pm) {
var dataSources = new tab._Collection();
var primaryDataSourceImpl = null;
var $enum1 = ss.IEnumerator.getEnumerator(pm.dataSources);
while ($enum1.moveNext()) {
var dataSourcePm = $enum1.current;
var dataSourceImpl = tab._DataSourceImpl.processDataSource(dataSourcePm);
if (dataSourcePm.isPrimary) {
primaryDataSourceImpl = dataSourceImpl;
} else {
dataSources._add(dataSourcePm.name, dataSourceImpl.get_dataSource());
}
}
if (ss.isValue(primaryDataSourceImpl)) {
dataSources._addToFirst(primaryDataSourceImpl.get_name(), primaryDataSourceImpl.get_dataSource());
}
return dataSources;
};
tab._DataSourceImpl.prototype = {
_name: null,
_isPrimary: false,
_dataSource: null,
get_dataSource: function tab__DataSourceImpl$get_dataSource() {
if (this._dataSource == null) {
this._dataSource = new tableauSoftware.DataSource(this);
}
return this._dataSource;
},
get_name: function tab__DataSourceImpl$get_name() {
return this._name;
},
get_fields: function tab__DataSourceImpl$get_fields() {
return this._fields;
},
get_isPrimary: function tab__DataSourceImpl$get_isPrimary() {
return this._isPrimary;
},
addField: function tab__DataSourceImpl$addField(field) {
this._fields._add(field.getName(), field);
}
////////////////////////////////////////////////////////////////////////////////
// tab._deferredUtil
};tab._deferredUtil = function tab__deferredUtil() {};
tab._deferredUtil.coerceToTrustedPromise = function tab__deferredUtil$coerceToTrustedPromise(promiseOrValue) {
var promise;
if (promiseOrValue instanceof tableauSoftware.Promise) {
promise = promiseOrValue;
} else {
if (ss.isValue(promiseOrValue) && typeof promiseOrValue.valueOf === 'function') {
promiseOrValue = promiseOrValue.valueOf();
}
if (tab._deferredUtil.isPromise(promiseOrValue)) {
var deferred = new tab._DeferredImpl();
promiseOrValue.then(ss.Delegate.create(deferred, deferred.resolve), ss.Delegate.create(deferred, deferred.reject));
promise = deferred.get_promise();
} else {
promise = tab._deferredUtil.resolved(promiseOrValue);
}
}
return promise;
};
tab._deferredUtil.reject = function tab__deferredUtil$reject(promiseOrValue) {
return tab._deferredUtil.coerceToTrustedPromise(promiseOrValue).then(function (value) {
return tab._deferredUtil.rejected(value);
}, null);
};
tab._deferredUtil.resolved = function tab__deferredUtil$resolved(value) {
var p = new tab._PromiseImpl(function (callback, errback) {
try {
return tab._deferredUtil.coerceToTrustedPromise(ss.isValue(callback) ? callback(value) : value);
} catch (e) {
return tab._deferredUtil.rejected(e);
}
});
return p;
};
tab._deferredUtil.rejected = function tab__deferredUtil$rejected(reason) {
var p = new tab._PromiseImpl(function (callback, errback) {
try {
return ss.isValue(errback) ? tab._deferredUtil.coerceToTrustedPromise(errback(reason)) : tab._deferredUtil.rejected(reason);
} catch (e) {
return tab._deferredUtil.rejected(e);
}
});
return p;
};
tab._deferredUtil.isPromise = function tab__deferredUtil$isPromise(promiseOrValue) {
return ss.isValue(promiseOrValue) && typeof promiseOrValue.then === 'function';
};
////////////////////////////////////////////////////////////////////////////////
// tab._CollectionImpl
tab._CollectionImpl = function tab__CollectionImpl() {
this._items = [];
this._itemMap = {};
};
tab._CollectionImpl.prototype = {
get__length: function tab__CollectionImpl$get__length() {
return this._items.length;
},
get__rawArray: function tab__CollectionImpl$get__rawArray() {
return this._items;
},
_get: function tab__CollectionImpl$_get(key) {
var validKey = this._ensureValidKey(key);
if (ss.isValue(this._itemMap[validKey])) {
return this._itemMap[validKey];
}
return undefined;
},
_has: function tab__CollectionImpl$_has(key) {
return ss.isValue(this._get(key));
},
_add: function tab__CollectionImpl$_add(key, item) {
this._verifyKeyAndItemParameters(key, item);
var validKey = this._ensureValidKey(key);
this._items.push(item);
this._itemMap[validKey] = item;
},
_addToFirst: function tab__CollectionImpl$_addToFirst(key, item) {
this._verifyKeyAndItemParameters(key, item);
var validKey = this._ensureValidKey(key);
this._items.unshift(item);
this._itemMap[validKey] = item;
},
_remove: function tab__CollectionImpl$_remove(key) {
var validKey = this._ensureValidKey(key);
if (ss.isValue(this._itemMap[validKey])) {
var item = this._itemMap[validKey];
delete this._itemMap[validKey];
for (var index = 0; index < this._items.length; index++) {
if (this._items[index] === item) {
this._items.splice(index, 1);
break;
}
}
}
},
_toApiCollection: function tab__CollectionImpl$_toApiCollection() {
var clone = this._items.concat();
clone.get = ss.Delegate.create(this, function (key) {
return this._get(key);
});
clone.has = ss.Delegate.create(this, function (key) {
return this._has(key);
});
return clone;
},
_verifyUniqueKeyParameter: function tab__CollectionImpl$_verifyUniqueKeyParameter(key) {
if (tab._Utility.isNullOrEmpty(key)) {
throw new Error('Null key');
}
if (this._has(key)) {
throw new Error("Duplicate key '" + key + "'");
}
},
_verifyKeyAndItemParameters: function tab__CollectionImpl$_verifyKeyAndItemParameters(key, item) {
this._verifyUniqueKeyParameter(key);
if (ss.isNullOrUndefined(item)) {
throw new Error('Null item');
}
},
_ensureValidKey: function tab__CollectionImpl$_ensureValidKey(key) {
return '_' + key;
},
get_item: function tab__CollectionImpl$get_item(index) {
return this._items[index];
}
////////////////////////////////////////////////////////////////////////////////
// tab._DeferredImpl
};tab._DeferredImpl = function tab__DeferredImpl() {
this._listeners = [];
this._promise = new tab._PromiseImpl(ss.Delegate.create(this, this.then));
this._thenFunc = ss.Delegate.create(this, this._preResolutionThen);
this._resolveFunc = ss.Delegate.create(this, this._transitionToFulfilled);
};
tab._DeferredImpl.prototype = {
_promise: null,
_thenFunc: null,
_resolveFunc: null,
get_promise: function tab__DeferredImpl$get_promise() {
return this._promise;
},
all: function tab__DeferredImpl$all(promisesOrValues) {
var allDone = new tab._DeferredImpl();
var length = promisesOrValues.length;
var toResolve = length;
var results = [];
if (!length) {
allDone.resolve(results);
return allDone.get_promise();
}
var resolveOne = function resolveOne(promiseOrValue, index) {
var promise = tab._deferredUtil.coerceToTrustedPromise(promiseOrValue);
promise.then(function (returnValue) {
results[index] = returnValue;
toResolve--;
if (!toResolve) {
allDone.resolve(results);
}
return null;
}, function (e) {
allDone.reject(e);
return null;
});
};
for (var i = 0; i < length; i++) {
resolveOne(promisesOrValues[i], i);
}
return allDone.get_promise();
},
then: function tab__DeferredImpl$then(callback, errback) {
return this._thenFunc(callback, errback);
},
resolve: function tab__DeferredImpl$resolve(promiseOrValue) {
return this._resolveFunc(promiseOrValue);
},
reject: function tab__DeferredImpl$reject(e) {
return this._resolveFunc(tab._deferredUtil.rejected(e));
},
_preResolutionThen: function tab__DeferredImpl$_preResolutionThen(callback, errback) {
var deferred = new tab._DeferredImpl();
this._listeners.push(function (promise) {
promise.then(callback, errback).then(ss.Delegate.create(deferred, deferred.resolve), ss.Delegate.create(deferred, deferred.reject));
});
return deferred.get_promise();
},
_transitionToFulfilled: function tab__DeferredImpl$_transitionToFulfilled(completed) {
var completedPromise = tab._deferredUtil.coerceToTrustedPromise(completed);
this._thenFunc = completedPromise.then;
this._resolveFunc = tab._deferredUtil.coerceToTrustedPromise;
for (var i = 0; i < this._listeners.length; i++) {
var listener = this._listeners[i];
listener(completedPromise);
}
this._listeners = null;
return completedPromise;
}
////////////////////////////////////////////////////////////////////////////////
// tab._PromiseImpl
};tab._PromiseImpl = function tab__PromiseImpl(thenFunc) {
this.then = thenFunc;
};
tab._PromiseImpl.prototype = {
then: null,
always: function tab__PromiseImpl$always(callback) {
return this.then(callback, callback);
},
otherwise: function tab__PromiseImpl$otherwise(errback) {
return this.then(null, errback);
}
////////////////////////////////////////////////////////////////////////////////
// tab._markImpl
};tab._markImpl = function tab__markImpl(tupleIdOrPairs) {
this._collection = new tab._Collection();
if (tab._jQueryShim.isArray(tupleIdOrPairs)) {
var pairArr = tupleIdOrPairs;
for (var i = 0; i < pairArr.length; i++) {
var pair = pairArr[i];
if (!ss.isValue(pair.fieldName)) {
throw tab._TableauException.createInvalidParameter('pair.fieldName');
}
if (!ss.isValue(pair.value)) {
throw tab._TableauException.createInvalidParameter('pair.value');
}
var p = new tableauSoftware.Pair(pair.fieldName, pair.value);
this._collection._add(p.fieldName, p);
}
} else {
this._tupleId = tupleIdOrPairs;
}
};
tab._markImpl._processSelectedMarks = function tab__markImpl$_processSelectedMarks(marksPresModel) {
var marks = new tab._Collection();
if (ss.isNullOrUndefined(marksPresModel) || tab._Utility.isNullOrEmpty(marksPresModel.marks)) {
return marks;
}
var $enum1 = ss.IEnumerator.getEnumerator(marksPresModel.marks);
while ($enum1.moveNext()) {
var markPresModel = $enum1.current;
var tupleId = markPresModel.tupleId;
var mark = new tableauSoftware.Mark(tupleId);
marks._add(tupleId.toString(), mark);
var $enum2 = ss.IEnumerator.getEnumerator(markPresModel.pairs);
while ($enum2.moveNext()) {
var pairPresModel = $enum2.current;
var value = tab._Utility.convertRawValue(pairPresModel.value, pairPresModel.valueDataType);
var pair = new tableauSoftware.Pair(pairPresModel.fieldName, value);
pair.formattedValue = pairPresModel.formattedValue;
if (!mark._impl.get__pairs()._has(pair.fieldName)) {
mark._impl._addPair(pair);
}
}
}
return marks;
};
tab._markImpl.prototype = {
_clonedPairs: null,
_tupleId: 0,
get__pairs: function tab__markImpl$get__pairs() {
return this._collection;
},
get__tupleId: function tab__markImpl$get__tupleId() {
return this._tupleId;
},
get__clonedPairs: function tab__markImpl$get__clonedPairs() {
if (this._clonedPairs == null) {
this._clonedPairs = this._collection._toApiCollection();
}
return this._clonedPairs;
},
_addPair: function tab__markImpl$_addPair(pair) {
this._collection._add(pair.fieldName, pair);
}
////////////////////////////////////////////////////////////////////////////////
// tab._Param
};tab._Param = function tab__Param() {};
tab._Param.verifyString = function tab__Param$verifyString(argumentValue, argumentName) {
if (ss.isNullOrUndefined(argumentValue) || !argumentValue.length) {
throw tab._TableauException.createInternalStringArgumentException(argumentName);
}
};
tab._Param.verifyValue = function tab__Param$verifyValue(argumentValue, argumentName) {
if (ss.isNullOrUndefined(argumentValue)) {
throw tab._TableauException.createInternalNullArgumentException(argumentName);
}
};
////////////////////////////////////////////////////////////////////////////////
// tab._parameterImpl
tab._parameterImpl = function tab__parameterImpl(pm) {
this._name = pm.name;
this._currentValue = tab._Utility.getDataValue(pm.currentValue);
this._dataType = pm.dataType;
this._allowableValuesType = pm.allowableValuesType;
if (ss.isValue(pm.allowableValues) && this._allowableValuesType === 'list') {
this._allowableValues = [];
var $enum1 = ss.IEnumerator.getEnumerator(pm.allowableValues);
while ($enum1.moveNext()) {
var adv = $enum1.current;
this._allowableValues.push(tab._Utility.getDataValue(adv));
}
}
if (this._allowableValuesType === 'range') {
this._minValue = tab._Utility.getDataValue(pm.minValue);
this._maxValue = tab._Utility.getDataValue(pm.maxValue);
this._stepSize = pm.stepSize;
if ((this._dataType === 'date' || this._dataType === 'datetime') && ss.isValue(this._stepSize) && ss.isValue(pm.dateStepPeriod)) {
this._dateStepPeriod = pm.dateStepPeriod;
}
}
};
tab._parameterImpl.prototype = {
_parameter: null,
_name: null,
_currentValue: null,
_dataType: null,
_allowableValuesType: null,
_allowableValues: null,
_minValue: null,
_maxValue: null,
_stepSize: null,
_dateStepPeriod: null,
get__parameter: function tab__parameterImpl$get__parameter() {
if (this._parameter == null) {
this._parameter = new tableauSoftware.Parameter(this);
}
return this._parameter;
},
get__name: function tab__parameterImpl$get__name() {
return this._name;
},
get__currentValue: function tab__parameterImpl$get__currentValue() {
return this._currentValue;
},
get__dataType: function tab__parameterImpl$get__dataType() {
return this._dataType;
},
get__allowableValuesType: function tab__parameterImpl$get__allowableValuesType() {
return this._allowableValuesType;
},
get__allowableValues: function tab__parameterImpl$get__allowableValues() {
return this._allowableValues;
},
get__minValue: function tab__parameterImpl$get__minValue() {
return this._minValue;
},
get__maxValue: function tab__parameterImpl$get__maxValue() {
return this._maxValue;
},
get__stepSize: function tab__parameterImpl$get__stepSize() {
return this._stepSize;
},
get__dateStepPeriod: function tab__parameterImpl$get__dateStepPeriod() {
return this._dateStepPeriod;
}
////////////////////////////////////////////////////////////////////////////////
// tab._SheetImpl
};tab._SheetImpl = function tab__SheetImpl(sheetInfoImpl, workbookImpl, messagingOptions) {
tab._Param.verifyValue(sheetInfoImpl, 'sheetInfoImpl');
tab._Param.verifyValue(workbookImpl, 'workbookImpl');
tab._Param.verifyValue(messagingOptions, 'messagingOptions');
this._name = sheetInfoImpl.name;
this._index = sheetInfoImpl.index;
this._isActive = sheetInfoImpl.isActive;
this._isHidden = sheetInfoImpl.isHidden;
this._sheetType = sheetInfoImpl.sheetType;
this._size = sheetInfoImpl.size;
this._url = sheetInfoImpl.url;
this._workbookImpl = workbookImpl;
this._messagingOptions = messagingOptions;
this._zoneId = sheetInfoImpl.zoneId;
};
tab._SheetImpl._convertValueToIntIfValid = function tab__SheetImpl$_convertValueToIntIfValid(value) {
if (ss.isValue(value)) {
return tab._Utility.toInt(value);
}
return value;
};
tab._SheetImpl._normalizeSheetSize = function tab__SheetImpl$_normalizeSheetSize(size) {
var behavior = tab._enums._normalizeSheetSizeBehavior(size.behavior, 'size.behavior');
var minSize = size.minSize;
if (ss.isValue(minSize)) {
minSize = tab.$create_Size(tab._SheetImpl._convertValueToIntIfValid(size.minSize.width), tab._SheetImpl._convertValueToIntIfValid(size.minSize.height));
}
var maxSize = size.maxSize;
if (ss.isValue(maxSize)) {
maxSize = tab.$create_Size(tab._SheetImpl._convertValueToIntIfValid(size.maxSize.width), tab._SheetImpl._convertValueToIntIfValid(size.maxSize.height));
}
return tab.$create_SheetSize(behavior, minSize, maxSize);
};
tab._SheetImpl.prototype = {
_name: null,
_index: 0,
_isActive: false,
_isHidden: false,
_sheetType: null,
_size: null,
_url: null,
_workbookImpl: null,
_messagingOptions: null,
_parentStoryPointImpl: null,
_zoneId: 0,
get_name: function tab__SheetImpl$get_name() {
return this._name;
},
get_index: function tab__SheetImpl$get_index() {
return this._index;
},
get_workbookImpl: function tab__SheetImpl$get_workbookImpl() {
return this._workbookImpl;
},
get_workbook: function tab__SheetImpl$get_workbook() {
return this._workbookImpl.get_workbook();
},
get_url: function tab__SheetImpl$get_url() {
if (this._isHidden) {
throw tab._TableauException.createNoUrlForHiddenWorksheet();
}
return this._url;
},
get_size: function tab__SheetImpl$get_size() {
return this._size;
},
get_isHidden: function tab__SheetImpl$get_isHidden() {
return this._isHidden;
},
get_isActive: function tab__SheetImpl$get_isActive() {
return this._isActive;
},
set_isActive: function tab__SheetImpl$set_isActive(value) {
this._isActive = value;
return value;
},
get_isDashboard: function tab__SheetImpl$get_isDashboard() {
return this._sheetType === 'dashboard';
},
get_sheetType: function tab__SheetImpl$get_sheetType() {
return this._sheetType;
},
get_parentStoryPoint: function tab__SheetImpl$get_parentStoryPoint() {
if (ss.isValue(this._parentStoryPointImpl)) {
return this._parentStoryPointImpl.get_storyPoint();
}
return null;
},
get_parentStoryPointImpl: function tab__SheetImpl$get_parentStoryPointImpl() {
return this._parentStoryPointImpl;
},
set_parentStoryPointImpl: function tab__SheetImpl$set_parentStoryPointImpl(value) {
if (this._sheetType === 'story') {
throw tab._TableauException.createInternalError('A story cannot be a child of another story.');
}
this._parentStoryPointImpl = value;
return value;
},
get_zoneId: function tab__SheetImpl$get_zoneId() {
return this._zoneId;
},
get_messagingOptions: function tab__SheetImpl$get_messagingOptions() {
return this._messagingOptions;
},
changeSizeAsync: function tab__SheetImpl$changeSizeAsync(newSize) {
newSize = tab._SheetImpl._normalizeSheetSize(newSize);
if (this._sheetType === 'worksheet' && newSize.behavior !== 'automatic') {
throw tab._TableauException.createInvalidSizeBehaviorOnWorksheet();
}
var deferred = new tab._Deferred();
if (this._size.behavior === newSize.behavior && newSize.behavior === 'automatic') {
deferred.resolve(newSize);
return deferred.get_promise();
}
var dict = this._processSheetSize(newSize);
var param = {};
param['api.setSheetSizeName'] = this._name;
param['api.minWidth'] = dict['api.minWidth'];
param['api.minHeight'] = dict['api.minHeight'];
param['api.maxWidth'] = dict['api.maxWidth'];
param['api.maxHeight'] = dict['api.maxHeight'];
var returnHandler = new tab._CommandReturnHandler('api.SetSheetSizeCommand', 1, ss.Delegate.create(this, function (result) {
this.get_workbookImpl()._update(ss.Delegate.create(this, function () {
var updatedSize = this.get_workbookImpl().get_publishedSheets()._get(this.get_name()).getSize();
deferred.resolve(updatedSize);
}));
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(param, returnHandler);
return deferred.get_promise();
},
sendCommand: function tab__SheetImpl$sendCommand(commandParameters, returnHandler) {
this._messagingOptions.sendCommand(commandParameters, returnHandler);
},
_processSheetSize: function tab__SheetImpl$_processSheetSize(newSize) {
var fixedSheetSize = null;
if (ss.isNullOrUndefined(newSize) || ss.isNullOrUndefined(newSize.behavior) || newSize.behavior !== 'automatic' && ss.isNullOrUndefined(newSize.minSize) && ss.isNullOrUndefined(newSize.maxSize)) {
throw tab._TableauException.createInvalidSheetSizeParam();
}
var minWidth = 0;
var minHeight = 0;
var maxWidth = 0;
var maxHeight = 0;
var dict = {};
dict['api.minWidth'] = 0;
dict['api.minHeight'] = 0;
dict['api.maxWidth'] = 0;
dict['api.maxHeight'] = 0;
if (newSize.behavior === 'automatic') {
fixedSheetSize = tab.$create_SheetSize('automatic', undefined, undefined);
} else if (newSize.behavior === 'atmost') {
if (ss.isNullOrUndefined(newSize.maxSize) || ss.isNullOrUndefined(newSize.maxSize.width) || ss.isNullOrUndefined(newSize.maxSize.height)) {
throw tab._TableauException.createMissingMaxSize();
}
if (newSize.maxSize.width < 0 || newSize.maxSize.height < 0) {
throw tab._TableauException.createInvalidSizeValue();
}
dict['api.maxWidth'] = newSize.maxSize.width;
dict['api.maxHeight'] = newSize.maxSize.height;
fixedSheetSize = tab.$create_SheetSize('atmost', undefined, newSize.maxSize);
} else if (newSize.behavior === 'atleast') {
if (ss.isNullOrUndefined(newSize.minSize) || ss.isNullOrUndefined(newSize.minSize.width) || ss.isNullOrUndefined(newSize.minSize.height)) {
throw tab._TableauException.createMissingMinSize();
}
if (newSize.minSize.width < 0 || newSize.minSize.height < 0) {
throw tab._TableauException.createInvalidSizeValue();
}
dict['api.minWidth'] = newSize.minSize.width;
dict['api.minHeight'] = newSize.minSize.height;
fixedSheetSize = tab.$create_SheetSize('atleast', newSize.minSize, undefined);
} else if (newSize.behavior === 'range') {
if (ss.isNullOrUndefined(newSize.minSize) || ss.isNullOrUndefined(newSize.maxSize) || ss.isNullOrUndefined(newSize.minSize.width) || ss.isNullOrUndefined(newSize.maxSize.width) || ss.isNullOrUndefined(newSize.minSize.height) || ss.isNullOrUndefined(newSize.maxSize.height)) {
throw tab._TableauException.createMissingMinMaxSize();
}
if (newSize.minSize.width < 0 || newSize.minSize.height < 0 || newSize.maxSize.width < 0 || newSize.maxSize.height < 0 || newSize.minSize.width > newSize.maxSize.width || newSize.minSize.height > newSize.maxSize.height) {
throw tab._TableauException.createInvalidRangeSize();
}
dict['api.minWidth'] = newSize.minSize.width;
dict['api.minHeight'] = newSize.minSize.height;
dict['api.maxWidth'] = newSize.maxSize.width;
dict['api.maxHeight'] = newSize.maxSize.height;
fixedSheetSize = tab.$create_SheetSize('range', newSize.minSize, newSize.maxSize);
} else if (newSize.behavior === 'exactly') {
if (ss.isValue(newSize.minSize) && ss.isValue(newSize.maxSize) && ss.isValue(newSize.minSize.width) && ss.isValue(newSize.maxSize.width) && ss.isValue(newSize.minSize.height) && ss.isValue(newSize.maxSize.height)) {
minWidth = newSize.minSize.width;
minHeight = newSize.minSize.height;
maxWidth = newSize.maxSize.width;
maxHeight = newSize.maxSize.height;
if (minWidth !== maxWidth || minHeight !== maxHeight) {
throw tab._TableauException.createSizeConflictForExactly();
}
} else if (ss.isValue(newSize.minSize) && ss.isValue(newSize.minSize.width) && ss.isValue(newSize.minSize.height)) {
minWidth = newSize.minSize.width;
minHeight = newSize.minSize.height;
maxWidth = minWidth;
maxHeight = minHeight;
} else if (ss.isValue(newSize.maxSize) && ss.isValue(newSize.maxSize.width) && ss.isValue(newSize.maxSize.height)) {
maxWidth = newSize.maxSize.width;
maxHeight = newSize.maxSize.height;
minWidth = maxWidth;
minHeight = maxHeight;
}
dict['api.minWidth'] = minWidth;
dict['api.minHeight'] = minHeight;
dict['api.maxWidth'] = maxWidth;
dict['api.maxHeight'] = maxHeight;
fixedSheetSize = tab.$create_SheetSize('exactly', tab.$create_Size(minWidth, minHeight), tab.$create_Size(maxWidth, maxHeight));
}
this._size = fixedSheetSize;
return dict;
}
////////////////////////////////////////////////////////////////////////////////
// tab._StoryImpl
};tab._StoryImpl = function tab__StoryImpl(sheetInfoImpl, workbookImpl, messagingOptions, storyPm, findSheetFunc) {
tab._StoryImpl.initializeBase(this, [sheetInfoImpl, workbookImpl, messagingOptions]);
tab._Param.verifyValue(storyPm, 'storyPm');
tab._Param.verifyValue(findSheetFunc, 'findSheetFunc');
this._findSheetFunc$1 = findSheetFunc;
this.update(storyPm);
};
tab._StoryImpl.prototype = {
_activeStoryPointImpl$1: null,
_findSheetFunc$1: null,
_story$1: null,
_storyPointsInfo$1: null,
add_activeStoryPointChange: function tab__StoryImpl$add_activeStoryPointChange(value) {
this.__activeStoryPointChange$1 = ss.Delegate.combine(this.__activeStoryPointChange$1, value);
},
remove_activeStoryPointChange: function tab__StoryImpl$remove_activeStoryPointChange(value) {
this.__activeStoryPointChange$1 = ss.Delegate.remove(this.__activeStoryPointChange$1, value);
},
__activeStoryPointChange$1: null,
get_activeStoryPointImpl: function tab__StoryImpl$get_activeStoryPointImpl() {
return this._activeStoryPointImpl$1;
},
get_sheet: function tab__StoryImpl$get_sheet() {
return this.get_story();
},
get_story: function tab__StoryImpl$get_story() {
if (this._story$1 == null) {
this._story$1 = new tableauSoftware.Story(this);
}
return this._story$1;
},
get_storyPointsInfo: function tab__StoryImpl$get_storyPointsInfo() {
return this._storyPointsInfo$1;
},
update: function tab__StoryImpl$update(storyPm) {
var activeStoryPointContainedSheetInfo = null;
var newActiveStoryPointInfoImpl = null;
this._storyPointsInfo$1 = this._storyPointsInfo$1 || new Array(storyPm.storyPoints.length);
for (var i = 0; i < storyPm.storyPoints.length; i++) {
var storyPointPm = storyPm.storyPoints[i];
var caption = storyPointPm.caption;
var isActive = i === storyPm.activeStoryPointIndex;
var storyPointInfoImpl = tab.$create__StoryPointInfoImpl(caption, i, storyPointPm.storyPointId, isActive, storyPointPm.isUpdated, this);
if (ss.isNullOrUndefined(this._storyPointsInfo$1[i])) {
this._storyPointsInfo$1[i] = new tableauSoftware.StoryPointInfo(storyPointInfoImpl);
} else if (this._storyPointsInfo$1[i]._impl.storyPointId === storyPointInfoImpl.storyPointId) {
var existing = this._storyPointsInfo$1[i]._impl;
existing.caption = storyPointInfoImpl.caption;
existing.index = storyPointInfoImpl.index;
existing.isActive = isActive;
existing.isUpdated = storyPointInfoImpl.isUpdated;
} else {
this._storyPointsInfo$1[i] = new tableauSoftware.StoryPointInfo(storyPointInfoImpl);
}
if (isActive) {
activeStoryPointContainedSheetInfo = storyPointPm.containedSheetInfo;
newActiveStoryPointInfoImpl = storyPointInfoImpl;
}
}
var deleteCount = this._storyPointsInfo$1.length - storyPm.storyPoints.length;
this._storyPointsInfo$1.splice(storyPm.storyPoints.length, deleteCount);
var activeStoryPointChanged = ss.isNullOrUndefined(this._activeStoryPointImpl$1) || this._activeStoryPointImpl$1.get_storyPointId() !== newActiveStoryPointInfoImpl.storyPointId;
if (ss.isValue(this._activeStoryPointImpl$1) && activeStoryPointChanged) {
this._activeStoryPointImpl$1.set_isActive(false);
}
var previouslyActiveStoryPoint = this._activeStoryPointImpl$1;
if (activeStoryPointChanged) {
var containedSheetImpl = tab._StoryPointImpl.createContainedSheet(activeStoryPointContainedSheetInfo, this.get_workbookImpl(), this.get_messagingOptions(), this._findSheetFunc$1);
this._activeStoryPointImpl$1 = new tab._StoryPointImpl(newActiveStoryPointInfoImpl, containedSheetImpl);
} else {
this._activeStoryPointImpl$1.set_isActive(newActiveStoryPointInfoImpl.isActive);
this._activeStoryPointImpl$1.set_isUpdated(newActiveStoryPointInfoImpl.isUpdated);
}
if (activeStoryPointChanged && ss.isValue(previouslyActiveStoryPoint)) {
this._raiseActiveStoryPointChange$1(this._storyPointsInfo$1[previouslyActiveStoryPoint.get_index()], this._activeStoryPointImpl$1.get_storyPoint());
}
},
activatePreviousStoryPointAsync: function tab__StoryImpl$activatePreviousStoryPointAsync() {
return this._activatePreviousNextStoryPointAsync$1('api.ActivatePreviousStoryPoint');
},
activateNextStoryPointAsync: function tab__StoryImpl$activateNextStoryPointAsync() {
return this._activatePreviousNextStoryPointAsync$1('api.ActivateNextStoryPoint');
},
activateStoryPointAsync: function tab__StoryImpl$activateStoryPointAsync(index) {
var deferred = new tab._Deferred();
if (index < 0 || index >= this._storyPointsInfo$1.length) {
throw tab._TableauException.createIndexOutOfRange(index);
}
var previouslyActiveStoryPointImpl = this.get_activeStoryPointImpl();
var commandParameters = {};
commandParameters['api.storyPointIndex'] = index;
var returnHandler = new tab._CommandReturnHandler('api.ActivateStoryPoint', 0, ss.Delegate.create(this, function (result) {
var activeStoryPointPm = result;
this._updateActiveState$1(previouslyActiveStoryPointImpl, activeStoryPointPm);
deferred.resolve(this._activeStoryPointImpl$1.get_storyPoint());
}), function (remoteError, errorMessage) {
deferred.reject(tab._TableauException.createServerError(errorMessage));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
revertStoryPointAsync: function tab__StoryImpl$revertStoryPointAsync(index) {
index = index || this._activeStoryPointImpl$1.get_index();
if (index < 0 || index >= this._storyPointsInfo$1.length) {
throw tab._TableauException.createIndexOutOfRange(index);
}
var deferred = new tab._Deferred();
var commandParameters = {};
commandParameters['api.storyPointIndex'] = index;
var returnHandler = new tab._CommandReturnHandler('api.RevertStoryPoint', 0, ss.Delegate.create(this, function (result) {
var updatedStoryPointPm = result;
this._updateStoryPointInfo$1(index, updatedStoryPointPm);
deferred.resolve(this._storyPointsInfo$1[index]);
}), function (remoteError, errorMessage) {
deferred.reject(tab._TableauException.createServerError(errorMessage));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_activatePreviousNextStoryPointAsync$1: function tab__StoryImpl$_activatePreviousNextStoryPointAsync$1(commandName) {
if (commandName !== 'api.ActivatePreviousStoryPoint' && commandName !== 'api.ActivateNextStoryPoint') {
throw tab._TableauException.createInternalError("commandName '" + commandName + "' is invalid.");
}
var deferred = new tab._Deferred();
var previouslyActiveStoryPointImpl = this.get_activeStoryPointImpl();
var commandParameters = {};
var returnHandler = new tab._CommandReturnHandler(commandName, 0, ss.Delegate.create(this, function (result) {
var activeStoryPointPm = result;
this._updateActiveState$1(previouslyActiveStoryPointImpl, activeStoryPointPm);
deferred.resolve(this._activeStoryPointImpl$1.get_storyPoint());
}), function (remoteError, errorMessage) {
deferred.reject(tab._TableauException.createServerError(errorMessage));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_updateStoryPointInfo$1: function tab__StoryImpl$_updateStoryPointInfo$1(index, newStoryPointPm) {
var existingImpl = this._storyPointsInfo$1[index]._impl;
if (existingImpl.storyPointId !== newStoryPointPm.storyPointId) {
throw tab._TableauException.createInternalError("We should not be updating a story point where the IDs don't match. Existing storyPointID=" + existingImpl.storyPointId + ', newStoryPointID=' + newStoryPointPm.storyPointId);
}
existingImpl.caption = newStoryPointPm.caption;
existingImpl.isUpdated = newStoryPointPm.isUpdated;
if (newStoryPointPm.storyPointId === this._activeStoryPointImpl$1.get_storyPointId()) {
this._activeStoryPointImpl$1.set_isUpdated(newStoryPointPm.isUpdated);
}
},
_updateActiveState$1: function tab__StoryImpl$_updateActiveState$1(previouslyActiveStoryPointImpl, newActiveStoryPointPm) {
var newActiveIndex = newActiveStoryPointPm.index;
if (previouslyActiveStoryPointImpl.get_index() === newActiveIndex) {
return;
}
var oldStoryPointInfo = this._storyPointsInfo$1[previouslyActiveStoryPointImpl.get_index()];
var newStoryPointInfoImpl = this._storyPointsInfo$1[newActiveIndex]._impl;
var containedSheetImpl = tab._StoryPointImpl.createContainedSheet(newActiveStoryPointPm.containedSheetInfo, this.get_workbookImpl(), this.get_messagingOptions(), this._findSheetFunc$1);
newStoryPointInfoImpl.isActive = true;
this._activeStoryPointImpl$1 = new tab._StoryPointImpl(newStoryPointInfoImpl, containedSheetImpl);
previouslyActiveStoryPointImpl.set_isActive(false);
oldStoryPointInfo._impl.isActive = false;
this._raiseActiveStoryPointChange$1(oldStoryPointInfo, this._activeStoryPointImpl$1.get_storyPoint());
},
_raiseActiveStoryPointChange$1: function tab__StoryImpl$_raiseActiveStoryPointChange$1(oldStoryPointInfo, newStoryPoint) {
if (this.__activeStoryPointChange$1 != null) {
this.__activeStoryPointChange$1(oldStoryPointInfo, newStoryPoint);
}
}
////////////////////////////////////////////////////////////////////////////////
// tab._StoryPointImpl
};tab._StoryPointImpl = function tab__StoryPointImpl(storyPointInfoImpl, containedSheetImpl) {
this._isActive = storyPointInfoImpl.isActive;
this._isUpdated = storyPointInfoImpl.isUpdated;
this._caption = storyPointInfoImpl.caption;
this._index = storyPointInfoImpl.index;
this._parentStoryImpl = storyPointInfoImpl.parentStoryImpl;
this._storyPointId = storyPointInfoImpl.storyPointId;
this._containedSheetImpl = containedSheetImpl;
if (ss.isValue(containedSheetImpl)) {
this._containedSheetImpl.set_parentStoryPointImpl(this);
if (containedSheetImpl.get_sheetType() === 'dashboard') {
var containedDashboardImpl = this._containedSheetImpl;
for (var i = 0; i < containedDashboardImpl.get_worksheets().get__length(); i++) {
var worksheet = containedDashboardImpl.get_worksheets().get_item(i);
worksheet._impl.set_parentStoryPointImpl(this);
}
}
}
};
tab._StoryPointImpl.createContainedSheet = function tab__StoryPointImpl$createContainedSheet(containedSheetInfo, workbookImpl, messagingOptions, findSheetFunc) {
var containedSheetType = containedSheetInfo.sheetType;
var index = -1;
var size = tab.SheetSizeFactory.createAutomatic();
var isActive = false;
var publishedSheetInfo = findSheetFunc(containedSheetInfo.name);
var isHidden = ss.isNullOrUndefined(publishedSheetInfo);
var url = isHidden ? '' : publishedSheetInfo.getUrl();
var sheetInfoImpl = tab.$create__SheetInfoImpl(containedSheetInfo.name, containedSheetType, index, size, workbookImpl.get_workbook(), url, isActive, isHidden, containedSheetInfo.zoneId);
if (containedSheetInfo.sheetType === 'worksheet') {
var parentDashboardImpl = null;
var worksheetImpl = new tab._WorksheetImpl(sheetInfoImpl, workbookImpl, messagingOptions, parentDashboardImpl);
return worksheetImpl;
} else if (containedSheetInfo.sheetType === 'dashboard') {
var dashboardImpl = new tab._DashboardImpl(sheetInfoImpl, workbookImpl, messagingOptions);
var dashboardZones = tab._WorkbookImpl._createDashboardZones(containedSheetInfo.dashboardZones);
dashboardImpl._addObjects(dashboardZones, findSheetFunc);
return dashboardImpl;
} else if (containedSheetInfo.sheetType === 'story') {
throw tab._TableauException.createInternalError('Cannot have a story embedded within another story.');
} else {
throw tab._TableauException.createInternalError("Unknown sheet type '" + containedSheetInfo.sheetType + "'");
}
};
tab._StoryPointImpl.prototype = {
_caption: null,
_index: 0,
_isActive: false,
_isUpdated: false,
_containedSheetImpl: null,
_parentStoryImpl: null,
_storyPoint: null,
_storyPointId: 0,
get_caption: function tab__StoryPointImpl$get_caption() {
return this._caption;
},
get_containedSheetImpl: function tab__StoryPointImpl$get_containedSheetImpl() {
return this._containedSheetImpl;
},
get_index: function tab__StoryPointImpl$get_index() {
return this._index;
},
get_isActive: function tab__StoryPointImpl$get_isActive() {
return this._isActive;
},
set_isActive: function tab__StoryPointImpl$set_isActive(value) {
this._isActive = value;
return value;
},
get_isUpdated: function tab__StoryPointImpl$get_isUpdated() {
return this._isUpdated;
},
set_isUpdated: function tab__StoryPointImpl$set_isUpdated(value) {
this._isUpdated = value;
return value;
},
get_parentStoryImpl: function tab__StoryPointImpl$get_parentStoryImpl() {
return this._parentStoryImpl;
},
get_storyPoint: function tab__StoryPointImpl$get_storyPoint() {
if (this._storyPoint == null) {
this._storyPoint = new tableauSoftware.StoryPoint(this);
}
return this._storyPoint;
},
get_storyPointId: function tab__StoryPointImpl$get_storyPointId() {
return this._storyPointId;
},
_toInfoImpl: function tab__StoryPointImpl$_toInfoImpl() {
return tab.$create__StoryPointInfoImpl(this._caption, this._index, this._storyPointId, this._isActive, this._isUpdated, this._parentStoryImpl);
}
////////////////////////////////////////////////////////////////////////////////
// tab.StoryPointInfoImplUtil
};tab.StoryPointInfoImplUtil = function tab_StoryPointInfoImplUtil() {};
tab.StoryPointInfoImplUtil.clone = function tab_StoryPointInfoImplUtil$clone(impl) {
return tab.$create__StoryPointInfoImpl(impl.caption, impl.index, impl.storyPointId, impl.isActive, impl.isUpdated, impl.parentStoryImpl);
};
////////////////////////////////////////////////////////////////////////////////
// tab._TableauException
tab._TableauException = function tab__TableauException() {};
tab._TableauException.create = function tab__TableauException$create(id, message) {
var x = new Error(message);
x.tableauSoftwareErrorCode = id;
return x;
};
tab._TableauException.createInternalError = function tab__TableauException$createInternalError(details) {
if (ss.isValue(details)) {
return tab._TableauException.create('internalError', 'Internal error. Please contact Tableau support with the following information: ' + details);
} else {
return tab._TableauException.create('internalError', 'Internal error. Please contact Tableau support');
}
};
tab._TableauException.createInternalNullArgumentException = function tab__TableauException$createInternalNullArgumentException(argumentName) {
return tab._TableauException.createInternalError("Null/undefined argument '" + argumentName + "'.");
};
tab._TableauException.createInternalStringArgumentException = function tab__TableauException$createInternalStringArgumentException(argumentName) {
return tab._TableauException.createInternalError("Invalid string argument '" + argumentName + "'.");
};
tab._TableauException.createServerError = function tab__TableauException$createServerError(message) {
return tab._TableauException.create('serverError', message);
};
tab._TableauException.createNotActiveSheet = function tab__TableauException$createNotActiveSheet() {
return tab._TableauException.create('notActiveSheet', 'Operation not allowed on non-active sheet');
};
tab._TableauException.createInvalidCustomViewName = function tab__TableauException$createInvalidCustomViewName(customViewName) {
return tab._TableauException.create('invalidCustomViewName', 'Invalid custom view name: ' + customViewName);
};
tab._TableauException.createInvalidParameter = function tab__TableauException$createInvalidParameter(paramName) {
return tab._TableauException.create('invalidParameter', 'Invalid parameter: ' + paramName);
};
tab._TableauException.createInvalidFilterFieldNameOrValue = function tab__TableauException$createInvalidFilterFieldNameOrValue(fieldName) {
return tab._TableauException.create('invalidFilterFieldNameOrValue', 'Invalid filter field name or value: ' + fieldName);
};
tab._TableauException.createInvalidDateParameter = function tab__TableauException$createInvalidDateParameter(paramName) {
return tab._TableauException.create('invalidDateParameter', 'Invalid date parameter: ' + paramName);
};
tab._TableauException.createNullOrEmptyParameter = function tab__TableauException$createNullOrEmptyParameter(paramName) {
return tab._TableauException.create('nullOrEmptyParameter', 'Parameter cannot be null or empty: ' + paramName);
};
tab._TableauException.createMissingMaxSize = function tab__TableauException$createMissingMaxSize() {
return tab._TableauException.create('missingMaxSize', 'Missing maxSize for SheetSizeBehavior.ATMOST');
};
tab._TableauException.createMissingMinSize = function tab__TableauException$createMissingMinSize() {
return tab._TableauException.create('missingMinSize', 'Missing minSize for SheetSizeBehavior.ATLEAST');
};
tab._TableauException.createMissingMinMaxSize = function tab__TableauException$createMissingMinMaxSize() {
return tab._TableauException.create('missingMinMaxSize', 'Missing minSize or maxSize for SheetSizeBehavior.RANGE');
};
tab._TableauException.createInvalidRangeSize = function tab__TableauException$createInvalidRangeSize() {
return tab._TableauException.create('invalidSize', 'Missing minSize or maxSize for SheetSizeBehavior.RANGE');
};
tab._TableauException.createInvalidSizeValue = function tab__TableauException$createInvalidSizeValue() {
return tab._TableauException.create('invalidSize', 'Size value cannot be less than zero');
};
tab._TableauException.createInvalidSheetSizeParam = function tab__TableauException$createInvalidSheetSizeParam() {
return tab._TableauException.create('invalidSize', 'Invalid sheet size parameter');
};
tab._TableauException.createSizeConflictForExactly = function tab__TableauException$createSizeConflictForExactly() {
return tab._TableauException.create('invalidSize', 'Conflicting size values for SheetSizeBehavior.EXACTLY');
};
tab._TableauException.createInvalidSizeBehaviorOnWorksheet = function tab__TableauException$createInvalidSizeBehaviorOnWorksheet() {
return tab._TableauException.create('invalidSizeBehaviorOnWorksheet', 'Only SheetSizeBehavior.AUTOMATIC is allowed on Worksheets');
};
tab._TableauException.createNoUrlForHiddenWorksheet = function tab__TableauException$createNoUrlForHiddenWorksheet() {
return tab._TableauException.create('noUrlForHiddenWorksheet', 'Hidden worksheets do not have a URL.');
};
tab._TableauException._createInvalidAggregationFieldName = function tab__TableauException$_createInvalidAggregationFieldName(fieldName) {
return tab._TableauException.create('invalidAggregationFieldName', "Invalid aggregation type for field '" + fieldName + "'");
};
tab._TableauException.createIndexOutOfRange = function tab__TableauException$createIndexOutOfRange(index) {
return tab._TableauException.create('indexOutOfRange', "Index '" + index + "' is out of range.");
};
tab._TableauException.createUnsupportedEventName = function tab__TableauException$createUnsupportedEventName(eventName) {
return tab._TableauException.create('unsupportedEventName', "Unsupported event '" + eventName + "'.");
};
tab._TableauException.createBrowserNotCapable = function tab__TableauException$createBrowserNotCapable() {
return tab._TableauException.create('browserNotCapable', 'This browser is incapable of supporting the Tableau JavaScript API.');
};
////////////////////////////////////////////////////////////////////////////////
// tab._Utility
tab._Utility = function tab__Utility() {};
tab._Utility.hasOwnProperty = function tab__Utility$hasOwnProperty(value, field) {
return value.hasOwnProperty(field);
};
tab._Utility.isNullOrEmpty = function tab__Utility$isNullOrEmpty(value) {
return ss.isNullOrUndefined(value) || (value['length'] || 0) <= 0;
};
tab._Utility.isString = function tab__Utility$isString(value) {
return typeof value === 'string';
};
tab._Utility.isNumber = function tab__Utility$isNumber(value) {
return typeof value === 'number';
};
tab._Utility.isDate = function tab__Utility$isDate(value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value instanceof Date) {
return true;
} else if (Object.prototype.toString.call(value) !== '[object Date]') {
return false;
}
return !isNaN(value.getTime());
};
tab._Utility.isDateValid = function tab__Utility$isDateValid(dt) {
return !isNaN(dt.getTime());
};
tab._Utility.indexOf = function tab__Utility$indexOf(array, searchElement, fromIndex) {
if (ss.isValue(Array.prototype['indexOf'])) {
return array.indexOf(searchElement, fromIndex);
}
fromIndex = fromIndex || 0;
var length = array.length;
if (length > 0) {
for (var index = fromIndex; index < length; index++) {
if (array[index] === searchElement) {
return index;
}
}
}
return -1;
};
tab._Utility.contains = function tab__Utility$contains(array, searchElement, fromIndex) {
var index = tab._Utility.indexOf(array, searchElement, fromIndex);
return index >= 0;
};
tab._Utility.getTopmostWindow = function tab__Utility$getTopmostWindow() {
var win = window.self;
while (ss.isValue(win.parent) && win.parent !== win) {
win = win.parent;
}
return win;
};
tab._Utility.toInt = function tab__Utility$toInt(value) {
if (tab._Utility.isNumber(value)) {
return value;
}
return parseInt(value.toString(), 10);
};
tab._Utility.hasClass = function tab__Utility$hasClass(element, className) {
var regexClass = new RegExp('[\\n\\t\\r]', 'g');
return ss.isValue(element) && (' ' + element.className + ' ').replace(regexClass, ' ').indexOf(' ' + className + ' ') > -1;
};
tab._Utility.findParentWithClassName = function tab__Utility$findParentWithClassName(element, className, stopAtElement) {
var parent = ss.isValue(element) ? element.parentNode : null;
stopAtElement = stopAtElement || document.body;
while (parent != null) {
if (tab._Utility.hasClass(parent, className)) {
return parent;
}
if (parent === stopAtElement) {
parent = null;
} else {
parent = parent.parentNode;
}
}
return parent;
};
tab._Utility.hasJsonParse = function tab__Utility$hasJsonParse() {
return ss.isValue(window.JSON) && ss.isValue(window.JSON.parse);
};
tab._Utility.hasWindowPostMessage = function tab__Utility$hasWindowPostMessage() {
return ss.isValue(window.postMessage);
};
tab._Utility.isPostMessageSynchronous = function tab__Utility$isPostMessageSynchronous() {
if (tab._Utility.isIE()) {
var msieRegEx = new RegExp('(msie) ([\\w.]+)');
var matches = msieRegEx.exec(window.navigator.userAgent.toLowerCase());
var versionStr = matches[2] || '0';
var version = parseInt(versionStr, 10);
return version <= 8;
}
return false;
};
tab._Utility.hasDocumentAttachEvent = function tab__Utility$hasDocumentAttachEvent() {
return ss.isValue(document.attachEvent);
};
tab._Utility.hasWindowAddEventListener = function tab__Utility$hasWindowAddEventListener() {
return ss.isValue(window.addEventListener);
};
tab._Utility.isElementOfTag = function tab__Utility$isElementOfTag(element, tagName) {
return ss.isValue(element) && element.nodeType === 1 && element.tagName.toLowerCase() === tagName.toLowerCase();
};
tab._Utility.elementToString = function tab__Utility$elementToString(element) {
var str = new ss.StringBuilder();
str.append(element.tagName.toLowerCase());
if (!tab._Utility.isNullOrEmpty(element.id)) {
str.append('#').append(element.id);
}
if (!tab._Utility.isNullOrEmpty(element.className)) {
var classes = element.className.split(' ');
str.append('.').append(classes.join('.'));
}
return str.toString();
};
tab._Utility.tableauGCS = function tab__Utility$tableauGCS(e) {
if (ss.isValue(window.getComputedStyle)) {
return window.getComputedStyle(e);
} else {
return e.currentStyle;
}
};
tab._Utility.isIE = function tab__Utility$isIE() {
return window.navigator.userAgent.indexOf('MSIE') > -1 && ss.isNullOrUndefined(window.opera);
};
tab._Utility.isSafari = function tab__Utility$isSafari() {
var ua = window.navigator.userAgent;
var isChrome = ua.indexOf('Chrome') >= 0;
return ua.indexOf('Safari') >= 0 && !isChrome;
};
tab._Utility.mobileDetect = function tab__Utility$mobileDetect() {
var ua = window.navigator.userAgent;
if (ua.indexOf('iPad') !== -1) {
return true;
}
if (ua.indexOf('Android') !== -1) {
return true;
}
if (ua.indexOf('AppleWebKit') !== -1 && ua.indexOf('Mobile') !== -1) {
return true;
}
return false;
};
tab._Utility.elementOffset = function tab__Utility$elementOffset(element) {
var rect = null;
rect = element.getBoundingClientRect();
var elementTop = rect.top;
var elementLeft = rect.left;
var win = new tab.WindowHelper(window.self);
var docElement = window.document.documentElement;
var x = elementLeft + win.get_pageXOffset() - docElement.clientLeft;
var y = elementTop + win.get_pageYOffset() - docElement.clientTop;
return tab.$create_Point(x, y);
};
tab._Utility.convertRawValue = function tab__Utility$convertRawValue(rawValue, dataType) {
if (ss.isNullOrUndefined(rawValue)) {
return null;
}
switch (dataType) {
case 'bool':
return rawValue;
case 'date':
return new Date(rawValue);
case 'number':
if (rawValue == null) {
return Number.NaN;
}
return rawValue;
case 'string':
default:
return rawValue;
}
};
tab._Utility.getDataValue = function tab__Utility$getDataValue(dv) {
if (ss.isNullOrUndefined(dv)) {
return tab.$create_DataValue(null, null, null);
}
return tab.$create_DataValue(tab._Utility.convertRawValue(dv.value, dv.type), dv.formattedValue, dv.aliasedValue);
};
tab._Utility.serializeDateForServer = function tab__Utility$serializeDateForServer(date) {
var serializedDate = '';
if (ss.isValue(date) && tab._Utility.isDate(date)) {
var year = date.getUTCFullYear();
var month = date.getUTCMonth() + 1;
var day = date.getUTCDate();
var hh = date.getUTCHours();
var mm = date.getUTCMinutes();
var sec = date.getUTCSeconds();
serializedDate = year + '-' + month + '-' + day + ' ' + hh + ':' + mm + ':' + sec;
}
return serializedDate;
};
tab._Utility.computeContentSize = function tab__Utility$computeContentSize(element) {
var style = tab._Utility._getComputedStyle(element);
var paddingLeft = parseFloat(style.paddingLeft);
var paddingTop = parseFloat(style.paddingTop);
var paddingRight = parseFloat(style.paddingRight);
var paddingBottom = parseFloat(style.paddingBottom);
var width = element.clientWidth - Math.round(paddingLeft + paddingRight);
var height = element.clientHeight - Math.round(paddingTop + paddingBottom);
return tab.$create_Size(width, height);
};
tab._Utility._getComputedStyle = function tab__Utility$_getComputedStyle(element) {
if (ss.isValue(window.getComputedStyle)) {
if (ss.isValue(element.ownerDocument.defaultView.opener)) {
return element.ownerDocument.defaultView.getComputedStyle(element, null);
}
return window.getComputedStyle(element, null);
} else if (ss.isValue(element.currentStyle)) {
return element.currentStyle;
}
return element.style;
};
////////////////////////////////////////////////////////////////////////////////
// tab.VizImpl
tab.VizImpl = function tab_VizImpl(messageRouter, viz, parentElement, url, options) {
if (!tab._Utility.hasWindowPostMessage() || !tab._Utility.hasJsonParse()) {
throw tab._TableauException.createBrowserNotCapable();
}
this._messagingOptions = new tab.CrossDomainMessagingOptions(messageRouter, this);
this._viz = viz;
if (ss.isNullOrUndefined(parentElement) || parentElement.nodeType !== 1) {
parentElement = document.body;
}
this._parameters = new tab._VizParameters(parentElement, url, options);
if (ss.isValue(options)) {
this._onFirstInteractiveCallback = options.onFirstInteractive;
this._onFirstVizSizeKnownCallback = options.onFirstVizSizeKnown;
}
};
tab.VizImpl.prototype = {
_workbookTabSwitchHandler: null,
_viz: null,
_iframe: null,
_parameters: null,
_initialAvailableSize: null,
_instanceId: null,
_workbookImpl: null,
_onFirstInteractiveCallback: null,
_onFirstVizSizeKnownCallback: null,
_onFirstInteractiveAlreadyCalled: false,
_areTabsHidden: false,
_isToolbarHidden: false,
_areAutomaticUpdatesPaused: false,
_messagingOptions: null,
_vizSize: null,
_windowResizeHandler: null,
_initializingWorkbookImpl: false,
add_customViewsListLoad: function tab_VizImpl$add_customViewsListLoad(value) {
this.__customViewsListLoad = ss.Delegate.combine(this.__customViewsListLoad, value);
},
remove_customViewsListLoad: function tab_VizImpl$remove_customViewsListLoad(value) {
this.__customViewsListLoad = ss.Delegate.remove(this.__customViewsListLoad, value);
},
__customViewsListLoad: null,
add_stateReadyForQuery: function tab_VizImpl$add_stateReadyForQuery(value) {
this.__stateReadyForQuery = ss.Delegate.combine(this.__stateReadyForQuery, value);
},
remove_stateReadyForQuery: function tab_VizImpl$remove_stateReadyForQuery(value) {
this.__stateReadyForQuery = ss.Delegate.remove(this.__stateReadyForQuery, value);
},
__stateReadyForQuery: null,
add__marksSelection: function tab_VizImpl$add__marksSelection(value) {
this.__marksSelection = ss.Delegate.combine(this.__marksSelection, value);
},
remove__marksSelection: function tab_VizImpl$remove__marksSelection(value) {
this.__marksSelection = ss.Delegate.remove(this.__marksSelection, value);
},
__marksSelection: null,
add__filterChange: function tab_VizImpl$add__filterChange(value) {
this.__filterChange = ss.Delegate.combine(this.__filterChange, value);
},
remove__filterChange: function tab_VizImpl$remove__filterChange(value) {
this.__filterChange = ss.Delegate.remove(this.__filterChange, value);
},
__filterChange: null,
add__parameterValueChange: function tab_VizImpl$add__parameterValueChange(value) {
this.__parameterValueChange = ss.Delegate.combine(this.__parameterValueChange, value);
},
remove__parameterValueChange: function tab_VizImpl$remove__parameterValueChange(value) {
this.__parameterValueChange = ss.Delegate.remove(this.__parameterValueChange, value);
},
__parameterValueChange: null,
add__customViewLoad: function tab_VizImpl$add__customViewLoad(value) {
this.__customViewLoad = ss.Delegate.combine(this.__customViewLoad, value);
},
remove__customViewLoad: function tab_VizImpl$remove__customViewLoad(value) {
this.__customViewLoad = ss.Delegate.remove(this.__customViewLoad, value);
},
__customViewLoad: null,
add__customViewSave: function tab_VizImpl$add__customViewSave(value) {
this.__customViewSave = ss.Delegate.combine(this.__customViewSave, value);
},
remove__customViewSave: function tab_VizImpl$remove__customViewSave(value) {
this.__customViewSave = ss.Delegate.remove(this.__customViewSave, value);
},
__customViewSave: null,
add__customViewRemove: function tab_VizImpl$add__customViewRemove(value) {
this.__customViewRemove = ss.Delegate.combine(this.__customViewRemove, value);
},
remove__customViewRemove: function tab_VizImpl$remove__customViewRemove(value) {
this.__customViewRemove = ss.Delegate.remove(this.__customViewRemove, value);
},
__customViewRemove: null,
add__customViewSetDefault: function tab_VizImpl$add__customViewSetDefault(value) {
this.__customViewSetDefault = ss.Delegate.combine(this.__customViewSetDefault, value);
},
remove__customViewSetDefault: function tab_VizImpl$remove__customViewSetDefault(value) {
this.__customViewSetDefault = ss.Delegate.remove(this.__customViewSetDefault, value);
},
__customViewSetDefault: null,
add__tabSwitch: function tab_VizImpl$add__tabSwitch(value) {
this.__tabSwitch = ss.Delegate.combine(this.__tabSwitch, value);
},
remove__tabSwitch: function tab_VizImpl$remove__tabSwitch(value) {
this.__tabSwitch = ss.Delegate.remove(this.__tabSwitch, value);
},
__tabSwitch: null,
add__storyPointSwitch: function tab_VizImpl$add__storyPointSwitch(value) {
this.__storyPointSwitch = ss.Delegate.combine(this.__storyPointSwitch, value);
},
remove__storyPointSwitch: function tab_VizImpl$remove__storyPointSwitch(value) {
this.__storyPointSwitch = ss.Delegate.remove(this.__storyPointSwitch, value);
},
__storyPointSwitch: null,
add__vizResize: function tab_VizImpl$add__vizResize(value) {
this.__vizResize = ss.Delegate.combine(this.__vizResize, value);
},
remove__vizResize: function tab_VizImpl$remove__vizResize(value) {
this.__vizResize = ss.Delegate.remove(this.__vizResize, value);
},
__vizResize: null,
get_handlerId: function tab_VizImpl$get_handlerId() {
return this._parameters.handlerId;
},
set_handlerId: function tab_VizImpl$set_handlerId(value) {
this._parameters.handlerId = value;
return value;
},
get_iframe: function tab_VizImpl$get_iframe() {
return this._iframe;
},
get_instanceId: function tab_VizImpl$get_instanceId() {
return this._instanceId;
},
get_serverRoot: function tab_VizImpl$get_serverRoot() {
return this._parameters.serverRoot;
},
get__viz: function tab_VizImpl$get__viz() {
return this._viz;
},
get__areTabsHidden: function tab_VizImpl$get__areTabsHidden() {
return this._areTabsHidden;
},
get__isToolbarHidden: function tab_VizImpl$get__isToolbarHidden() {
return this._isToolbarHidden;
},
get__isHidden: function tab_VizImpl$get__isHidden() {
return this._iframe.style.display === 'none';
},
get__parentElement: function tab_VizImpl$get__parentElement() {
return this._parameters.parentElement;
},
get__url: function tab_VizImpl$get__url() {
return this._parameters.get_baseUrl();
},
get__workbook: function tab_VizImpl$get__workbook() {
return this._workbookImpl.get_workbook();
},
get__workbookImpl: function tab_VizImpl$get__workbookImpl() {
return this._workbookImpl;
},
get__areAutomaticUpdatesPaused: function tab_VizImpl$get__areAutomaticUpdatesPaused() {
return this._areAutomaticUpdatesPaused;
},
get__vizSize: function tab_VizImpl$get__vizSize() {
return this._vizSize;
},
getCurrentUrlAsync: function tab_VizImpl$getCurrentUrlAsync() {
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.GetCurrentUrlCommand', 0, function (result) {
deferred.resolve(result);
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createInternalError(message));
});
this._sendCommand(null, returnHandler);
return deferred.get_promise();
},
handleVizLoad: function tab_VizImpl$handleVizLoad() {
this._sendVizOffset();
if (ss.isNullOrUndefined(this._workbookImpl)) {
this._workbookImpl = new tab._WorkbookImpl(this, this._messagingOptions, ss.Delegate.create(this, function () {
this._onWorkbookInteractive();
}));
} else if (!this._initializingWorkbookImpl) {
this._workbookImpl._update(ss.Delegate.create(this, function () {
this._onWorkbookInteractive();
}));
}
},
_calculateFrameSize: function tab_VizImpl$_calculateFrameSize(availableSize) {
var chromeHeight = this._vizSize.chromeHeight;
var sheetSize = this._vizSize.sheetSize;
var width = 0;
var height = 0;
if (sheetSize.behavior === 'exactly') {
width = sheetSize.maxSize.width;
height = sheetSize.maxSize.height + chromeHeight;
} else {
var minWidth;
var maxWidth;
var minHeight;
var maxHeight;
switch (sheetSize.behavior) {
case 'range':
minWidth = sheetSize.minSize.width;
maxWidth = sheetSize.maxSize.width;
minHeight = sheetSize.minSize.height + chromeHeight;
maxHeight = sheetSize.maxSize.height + chromeHeight;
width = Math.max(minWidth, Math.min(maxWidth, availableSize.width));
height = Math.max(minHeight, Math.min(maxHeight, availableSize.height));
break;
case 'atleast':
minWidth = sheetSize.minSize.width;
minHeight = sheetSize.minSize.height + chromeHeight;
width = Math.max(minWidth, availableSize.width);
height = Math.max(minHeight, availableSize.height);
break;
case 'atmost':
maxWidth = sheetSize.maxSize.width;
maxHeight = sheetSize.maxSize.height + chromeHeight;
width = Math.min(maxWidth, availableSize.width);
height = Math.min(maxHeight, availableSize.height);
break;
case 'automatic':
width = availableSize.width;
height = Math.max(availableSize.height, chromeHeight);
break;
default:
throw tab._TableauException.createInternalError('Unknown SheetSizeBehavior for viz: ' + sheetSize.behavior);
}
}
return tab.$create_Size(width, height);
},
_getNewFrameSize: function tab_VizImpl$_getNewFrameSize() {
var availableSize;
if (ss.isValue(this._initialAvailableSize)) {
availableSize = this._initialAvailableSize;
this._initialAvailableSize = null;
} else {
availableSize = tab._Utility.computeContentSize(this.get__parentElement());
}
this._raiseVizResizeEvent(availableSize);
return this._calculateFrameSize(availableSize);
},
_refreshSize: function tab_VizImpl$_refreshSize() {
var frameSize = this._getNewFrameSize();
this._setFrameSize(frameSize.width + 'px', frameSize.height + 'px');
var resizeAttempts = 10;
for (var i = 0; i < resizeAttempts; i++) {
var newFrameSize = this._getNewFrameSize();
if (JSON.stringify(frameSize) === JSON.stringify(newFrameSize)) {
return;
}
frameSize = newFrameSize;
this._setFrameSize(frameSize.width + 'px', frameSize.height + 'px');
}
throw tab._TableauException.create('maxVizResizeAttempts', 'Viz resize limit hit. The calculated iframe size did not stabilize after ' + resizeAttempts + ' resizes.');
},
handleEventNotification: function tab_VizImpl$handleEventNotification(eventName, eventParameters) {
var notif = tab._ApiServerNotification.deserialize(eventParameters);
if (eventName === 'api.FirstVizSizeKnownEvent') {
var size = JSON.parse(notif.get_data());
this._handleInitialVizSize(size);
} else if (eventName === 'api.VizInteractiveEvent') {
this._instanceId = notif.get_data();
if (ss.isValue(this._workbookImpl) && this._workbookImpl.get_name() === notif.get_workbookName()) {
this._onWorkbookInteractive();
}
this._raiseStateReadyForQuery();
} else if (eventName === 'api.MarksSelectionChangedEvent') {
if (this.__marksSelection != null) {
if (this._workbookImpl.get_name() === notif.get_workbookName()) {
var worksheetImpl = null;
var activeSheetImpl = this._workbookImpl.get_activeSheetImpl();
if (activeSheetImpl.get_name() === notif.get_worksheetName()) {
worksheetImpl = activeSheetImpl;
} else if (activeSheetImpl.get_isDashboard()) {
var db = activeSheetImpl;
worksheetImpl = db.get_worksheets()._get(notif.get_worksheetName())._impl;
}
if (ss.isValue(worksheetImpl)) {
worksheetImpl.set_selectedMarks(null);
this.__marksSelection(new tab.MarksEvent('marksselection', this._viz, worksheetImpl));
}
}
}
} else if (eventName === 'api.FilterChangedEvent') {
if (this.__filterChange != null) {
if (this._workbookImpl.get_name() === notif.get_workbookName()) {
var worksheetImpl = null;
var activeSheetImpl = this._workbookImpl.get_activeSheetImpl();
if (activeSheetImpl.get_name() === notif.get_worksheetName()) {
worksheetImpl = activeSheetImpl;
} else if (activeSheetImpl.get_isDashboard()) {
var db = activeSheetImpl;
worksheetImpl = db.get_worksheets()._get(notif.get_worksheetName())._impl;
}
if (ss.isValue(worksheetImpl)) {
var results = JSON.parse(notif.get_data());
var filterFieldName = results[0];
var filterCaption = results[1];
this.__filterChange(new tab.FilterEvent('filterchange', this._viz, worksheetImpl, filterFieldName, filterCaption));
}
}
}
} else if (eventName === 'api.ParameterChangedEvent') {
if (this.__parameterValueChange != null) {
if (this._workbookImpl.get_name() === notif.get_workbookName()) {
this._workbookImpl.set__lastChangedParameterImpl(null);
var parameterName = notif.get_data();
this._raiseParameterValueChange(parameterName);
}
}
} else if (eventName === 'api.CustomViewsListLoadedEvent') {
var info = JSON.parse(notif.get_data());
var process = ss.Delegate.create(this, function () {
tab._CustomViewImpl._processCustomViews(this._workbookImpl, this._messagingOptions, info);
});
var raiseEvents = ss.Delegate.create(this, function () {
this._raiseCustomViewsListLoad();
if (this.__customViewLoad != null && !info.customViewLoaded) {
this._raiseCustomViewLoad(this._workbookImpl.get_activeCustomView());
}
});
if (ss.isNullOrUndefined(this._workbookImpl)) {
this._initializingWorkbookImpl = true;
this._workbookImpl = new tab._WorkbookImpl(this, this._messagingOptions, ss.Delegate.create(this, function () {
process();
this._onWorkbookInteractive(raiseEvents);
this._initializingWorkbookImpl = false;
}));
} else {
process();
this._ensureCalledAfterFirstInteractive(raiseEvents);
}
} else if (eventName === 'api.CustomViewUpdatedEvent') {
var info = JSON.parse(notif.get_data());
if (ss.isNullOrUndefined(this._workbookImpl)) {
this._workbookImpl = new tab._WorkbookImpl(this, this._messagingOptions, ss.Delegate.create(this, function () {
this._onWorkbookInteractive();
}));
}
if (ss.isValue(this._workbookImpl)) {
tab._CustomViewImpl._processCustomViewUpdate(this._workbookImpl, this._messagingOptions, info, true);
}
if (this.__customViewSave != null) {
var updated = this._workbookImpl.get__updatedCustomViews()._toApiCollection();
for (var i = 0, len = updated.length; i < len; i++) {
this._raiseCustomViewSave(updated[i]);
}
}
} else if (eventName === 'api.CustomViewRemovedEvent') {
if (this.__customViewRemove != null) {
var removed = this._workbookImpl.get__removedCustomViews()._toApiCollection();
for (var i = 0, len = removed.length; i < len; i++) {
this._raiseCustomViewRemove(removed[i]);
}
}
} else if (eventName === 'api.CustomViewSetDefaultEvent') {
var info = JSON.parse(notif.get_data());
if (ss.isValue(this._workbookImpl)) {
tab._CustomViewImpl._processCustomViews(this._workbookImpl, this._messagingOptions, info);
}
if (this.__customViewSetDefault != null) {
var updated = this._workbookImpl.get__updatedCustomViews()._toApiCollection();
for (var i = 0, len = updated.length; i < len; i++) {
this._raiseCustomViewSetDefault(updated[i]);
}
}
} else if (eventName === 'api.TabSwitchEvent') {
this._workbookImpl._update(ss.Delegate.create(this, function () {
if (ss.isValue(this._workbookTabSwitchHandler)) {
this._workbookTabSwitchHandler();
}
if (this._workbookImpl.get_name() === notif.get_workbookName()) {
var oldSheetName = notif.get_worksheetName();
var currSheetName = notif.get_data();
this._raiseTabSwitch(oldSheetName, currSheetName);
}
this._onWorkbookInteractive();
}));
} else if (eventName === 'api.StorytellingStateChangedEvent') {
var storyImpl = this._workbookImpl.get_activeSheetImpl();
if (storyImpl.get_sheetType() === 'story') {
storyImpl.update(JSON.parse(notif.get_data()));
}
}
},
addEventListener: function tab_VizImpl$addEventListener(eventName, handler) {
var normalizedEventName = tab._enums._normalizeTableauEventName(eventName);
if (normalizedEventName === 'marksselection') {
this.add__marksSelection(handler);
} else if (normalizedEventName === 'parametervaluechange') {
this.add__parameterValueChange(handler);
} else if (normalizedEventName === 'filterchange') {
this.add__filterChange(handler);
} else if (normalizedEventName === 'customviewload') {
this.add__customViewLoad(handler);
} else if (normalizedEventName === 'customviewsave') {
this.add__customViewSave(handler);
} else if (normalizedEventName === 'customviewremove') {
this.add__customViewRemove(handler);
} else if (normalizedEventName === 'customviewsetdefault') {
this.add__customViewSetDefault(handler);
} else if (normalizedEventName === 'tabswitch') {
this.add__tabSwitch(handler);
} else if (normalizedEventName === 'storypointswitch') {
this.add__storyPointSwitch(handler);
} else if (normalizedEventName === 'vizresize') {
this.add__vizResize(handler);
} else {
throw tab._TableauException.createUnsupportedEventName(eventName);
}
},
removeEventListener: function tab_VizImpl$removeEventListener(eventName, handler) {
var normalizedEventName = tab._enums._normalizeTableauEventName(eventName);
if (normalizedEventName === 'marksselection') {
this.remove__marksSelection(handler);
} else if (normalizedEventName === 'parametervaluechange') {
this.remove__parameterValueChange(handler);
} else if (normalizedEventName === 'filterchange') {
this.remove__filterChange(handler);
} else if (normalizedEventName === 'customviewload') {
this.remove__customViewLoad(handler);
} else if (normalizedEventName === 'customviewsave') {
this.remove__customViewSave(handler);
} else if (normalizedEventName === 'customviewremove') {
this.remove__customViewRemove(handler);
} else if (normalizedEventName === 'customviewsetdefault') {
this.remove__customViewSetDefault(handler);
} else if (normalizedEventName === 'tabswitch') {
this.remove__tabSwitch(handler);
} else if (normalizedEventName === 'storypointswitch') {
this.remove__storyPointSwitch(handler);
} else if (normalizedEventName === 'vizresize') {
this.remove__vizResize(handler);
} else {
throw tab._TableauException.createUnsupportedEventName(eventName);
}
},
_dispose: function tab_VizImpl$_dispose() {
if (ss.isValue(this._iframe)) {
this._iframe.parentNode.removeChild(this._iframe);
this._iframe = null;
}
tab._VizManagerImpl._unregisterViz(this._viz);
this._messagingOptions.get_router().unregisterHandler(this);
this._removeWindowResizeHandler();
},
_show: function tab_VizImpl$_show() {
this._iframe.style.display = 'block';
this._iframe.style.visibility = 'visible';
},
_hide: function tab_VizImpl$_hide() {
this._iframe.style.display = 'none';
},
_makeInvisible: function tab_VizImpl$_makeInvisible() {
this._iframe.style.visibility = 'hidden';
},
_showExportImageDialog: function tab_VizImpl$_showExportImageDialog() {
this._invokeCommand('showExportImageDialog');
},
_showExportDataDialog: function tab_VizImpl$_showExportDataDialog(sheetOrInfoOrName) {
var sheetName = this._verifyOperationAllowedOnActiveSheetOrSheetWithinActiveDashboard(sheetOrInfoOrName);
this._invokeCommand('showExportDataDialog', sheetName);
},
_showExportCrossTabDialog: function tab_VizImpl$_showExportCrossTabDialog(sheetOrInfoOrName) {
var sheetName = this._verifyOperationAllowedOnActiveSheetOrSheetWithinActiveDashboard(sheetOrInfoOrName);
this._invokeCommand('showExportCrosstabDialog', sheetName);
},
_showExportPDFDialog: function tab_VizImpl$_showExportPDFDialog() {
this._invokeCommand('showExportPDFDialog');
},
_revertAllAsync: function tab_VizImpl$_revertAllAsync() {
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.RevertAllCommand', 1, function (result) {
deferred.resolve();
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(null, returnHandler);
return deferred.get_promise();
},
_refreshDataAsync: function tab_VizImpl$_refreshDataAsync() {
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.RefreshDataCommand', 1, function (result) {
deferred.resolve();
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(null, returnHandler);
return deferred.get_promise();
},
_showShareDialog: function tab_VizImpl$_showShareDialog() {
this._invokeCommand('showShareDialog');
},
_showDownloadWorkbookDialog: function tab_VizImpl$_showDownloadWorkbookDialog() {
if (this.get__workbookImpl().get_isDownloadAllowed()) {
this._invokeCommand('showDownloadWorkbookDialog');
} else {
throw tab._TableauException.create('downloadWorkbookNotAllowed', 'Download workbook is not allowed');
}
},
_pauseAutomaticUpdatesAsync: function tab_VizImpl$_pauseAutomaticUpdatesAsync() {
return this._invokeAutomaticUpdatesCommandAsync('pauseAutomaticUpdates');
},
_resumeAutomaticUpdatesAsync: function tab_VizImpl$_resumeAutomaticUpdatesAsync() {
return this._invokeAutomaticUpdatesCommandAsync('resumeAutomaticUpdates');
},
_toggleAutomaticUpdatesAsync: function tab_VizImpl$_toggleAutomaticUpdatesAsync() {
return this._invokeAutomaticUpdatesCommandAsync('toggleAutomaticUpdates');
},
_setFrameSize: function tab_VizImpl$_setFrameSize(width, height) {
this._parameters.width = width;
this._parameters.height = height;
this._iframe.style.width = this._parameters.width;
this._iframe.style.height = this._parameters.height;
},
_setFrameSizeAndUpdate: function tab_VizImpl$_setFrameSizeAndUpdate(width, height) {
this._raiseVizResizeEvent(tab.$create_Size(-1, -1));
this._setFrameSize(width, height);
this._workbookImpl._updateActiveSheetAsync();
},
_setAreAutomaticUpdatesPaused: function tab_VizImpl$_setAreAutomaticUpdatesPaused(value) {
this._areAutomaticUpdatesPaused = value;
},
_contentRootElement: function tab_VizImpl$_contentRootElement() {
return this._parameters.parentElement;
},
_create: function tab_VizImpl$_create() {
try {
tab._VizManagerImpl._registerViz(this._viz);
} catch (e) {
this._dispose();
throw e;
}
if (!this._parameters.fixedSize) {
this._initialAvailableSize = tab._Utility.computeContentSize(this.get__parentElement());
if (!this._initialAvailableSize.width || !this._initialAvailableSize.height) {
this._initialAvailableSize = tab.$create_Size(800, 600);
}
this._iframe = this._createIframe();
this._makeInvisible();
} else {
this._iframe = this._createIframe();
this._show();
}
if (!tab._Utility.hasWindowPostMessage()) {
if (tab._Utility.isIE()) {
this._iframe.onreadystatechange = this._getOnCheckForDoneDelegate();
} else {
this._iframe.onload = this._getOnCheckForDoneDelegate();
}
}
this._isToolbarHidden = !this._parameters.toolbar;
this._areTabsHidden = !this._parameters.tabs;
this._messagingOptions.get_router().registerHandler(this);
this._iframe.src = this._parameters.get_url();
},
_sendVizOffset: function tab_VizImpl$_sendVizOffset() {
if (!tab._Utility.hasWindowPostMessage() || ss.isNullOrUndefined(this._iframe) || !ss.isValue(this._iframe.contentWindow)) {
return;
}
var offset = tab._Utility.elementOffset(this._iframe);
var param = [];
param.push('vizOffsetResp');
param.push(offset.x);
param.push(offset.y);
this._iframe.contentWindow.postMessage(param.join(','), '*');
},
_sendCommand: function tab_VizImpl$_sendCommand(commandParameters, returnHandler) {
this._messagingOptions.sendCommand(commandParameters, returnHandler);
},
_raiseParameterValueChange: function tab_VizImpl$_raiseParameterValueChange(parameterName) {
if (this.__parameterValueChange != null) {
this.__parameterValueChange(new tab.ParameterEvent('parametervaluechange', this._viz, parameterName));
}
},
_raiseCustomViewLoad: function tab_VizImpl$_raiseCustomViewLoad(customView) {
if (this.__customViewLoad != null) {
this.__customViewLoad(new tab.CustomViewEvent('customviewload', this._viz, ss.isValue(customView) ? customView._impl : null));
}
},
_raiseCustomViewSave: function tab_VizImpl$_raiseCustomViewSave(customView) {
if (this.__customViewSave != null) {
this.__customViewSave(new tab.CustomViewEvent('customviewsave', this._viz, customView._impl));
}
},
_raiseCustomViewRemove: function tab_VizImpl$_raiseCustomViewRemove(customView) {
if (this.__customViewRemove != null) {
this.__customViewRemove(new tab.CustomViewEvent('customviewremove', this._viz, customView._impl));
}
},
_raiseCustomViewSetDefault: function tab_VizImpl$_raiseCustomViewSetDefault(customView) {
if (this.__customViewSetDefault != null) {
this.__customViewSetDefault(new tab.CustomViewEvent('customviewsetdefault', this._viz, customView._impl));
}
},
_raiseTabSwitch: function tab_VizImpl$_raiseTabSwitch(oldSheetName, newSheetName) {
if (this.__tabSwitch != null) {
this.__tabSwitch(new tab.TabSwitchEvent('tabswitch', this._viz, oldSheetName, newSheetName));
}
},
raiseStoryPointSwitch: function tab_VizImpl$raiseStoryPointSwitch(oldStoryPointInfo, newStoryPoint) {
if (this.__storyPointSwitch != null) {
this.__storyPointSwitch(new tab.StoryPointSwitchEvent('storypointswitch', this._viz, oldStoryPointInfo, newStoryPoint));
}
},
_raiseStateReadyForQuery: function tab_VizImpl$_raiseStateReadyForQuery() {
if (this.__stateReadyForQuery != null) {
this.__stateReadyForQuery(this);
}
},
_raiseCustomViewsListLoad: function tab_VizImpl$_raiseCustomViewsListLoad() {
if (this.__customViewsListLoad != null) {
this.__customViewsListLoad(this);
}
},
_raiseVizResizeEvent: function tab_VizImpl$_raiseVizResizeEvent(availableSize) {
if (this.__vizResize != null) {
this.__vizResize(new tab.VizResizeEvent('vizresize', this._viz, availableSize));
}
},
_verifyOperationAllowedOnActiveSheetOrSheetWithinActiveDashboard: function tab_VizImpl$_verifyOperationAllowedOnActiveSheetOrSheetWithinActiveDashboard(sheetOrInfoOrName) {
if (ss.isNullOrUndefined(sheetOrInfoOrName)) {
return null;
}
var sheetImpl = this._workbookImpl._findActiveSheetOrSheetWithinActiveDashboard(sheetOrInfoOrName);
if (ss.isNullOrUndefined(sheetImpl)) {
throw tab._TableauException.createNotActiveSheet();
}
return sheetImpl.get_name();
},
_invokeAutomaticUpdatesCommandAsync: function tab_VizImpl$_invokeAutomaticUpdatesCommandAsync(command) {
if (command !== 'pauseAutomaticUpdates' && command !== 'resumeAutomaticUpdates' && command !== 'toggleAutomaticUpdates') {
throw tab._TableauException.createInternalError(null);
}
var param = {};
param['api.invokeCommandName'] = command;
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.InvokeCommandCommand', 0, ss.Delegate.create(this, function (result) {
var pm = result;
if (ss.isValue(pm) && ss.isValue(pm.isAutoUpdate)) {
this._areAutomaticUpdatesPaused = !pm.isAutoUpdate;
}
deferred.resolve(this._areAutomaticUpdatesPaused);
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(param, returnHandler);
return deferred.get_promise();
},
_invokeCommand: function tab_VizImpl$_invokeCommand(command, sheetName) {
if (command !== 'showExportImageDialog' && command !== 'showExportDataDialog' && command !== 'showExportCrosstabDialog' && command !== 'showExportPDFDialog' && command !== 'showShareDialog' && command !== 'showDownloadWorkbookDialog') {
throw tab._TableauException.createInternalError(null);
}
var param = {};
param['api.invokeCommandName'] = command;
if (ss.isValue(sheetName)) {
param['api.invokeCommandParam'] = sheetName;
}
var returnHandler = new tab._CommandReturnHandler('api.InvokeCommandCommand', 0, null, null);
this._sendCommand(param, returnHandler);
},
_onWorkbookInteractive: function tab_VizImpl$_onWorkbookInteractive(actionAfterFirstInteractive) {
if (!this._onFirstInteractiveAlreadyCalled) {
var callback = this._onFirstInteractiveCallback;
window.setTimeout(ss.Delegate.create(this, function () {
if (ss.isValue(callback)) {
callback(new tab.TableauEvent('firstinteractive', this._viz));
}
if (ss.isValue(actionAfterFirstInteractive)) {
actionAfterFirstInteractive();
}
}), 0);
this._onFirstInteractiveAlreadyCalled = true;
}
this._raiseStateReadyForQuery();
},
_ensureCalledAfterFirstInteractive: function tab_VizImpl$_ensureCalledAfterFirstInteractive(action) {
var start = new Date();
var poll = null;
poll = ss.Delegate.create(this, function () {
var now = new Date();
if (this._onFirstInteractiveAlreadyCalled) {
action();
} else if (now - start > 5 * 60 * 1000) {
throw tab._TableauException.createInternalError('Timed out while waiting for the viz to become interactive');
} else {
window.setTimeout(poll, 10);
}
});
poll();
},
_checkForDone: function tab_VizImpl$_checkForDone() {
if (tab._Utility.isIE()) {
if (this._iframe.readyState === 'complete') {
this.handleVizLoad();
}
} else {
this.handleVizLoad();
}
},
_onCheckForDone: function tab_VizImpl$_onCheckForDone() {
window.setTimeout(ss.Delegate.create(this, this._checkForDone), 3000);
},
_createIframe: function tab_VizImpl$_createIframe() {
if (ss.isNullOrUndefined(this._contentRootElement())) {
return null;
}
var ifr = document.createElement('IFrame');
ifr.frameBorder = '0';
ifr.setAttribute('allowTransparency', 'true');
ifr.marginHeight = '0';
ifr.marginWidth = '0';
ifr.style.display = 'block';
if (this._parameters.fixedSize) {
ifr.style.width = this._parameters.width;
ifr.style.height = this._parameters.height;
} else {
ifr.style.width = '1px';
ifr.style.height = '1px';
ifr.setAttribute('scrolling', 'no');
}
if (tab._Utility.isSafari()) {
ifr.addEventListener('mousewheel', ss.Delegate.create(this, this._onIframeMouseWheel), false);
}
this._contentRootElement().appendChild(ifr);
return ifr;
},
_onIframeMouseWheel: function tab_VizImpl$_onIframeMouseWheel(e) {},
_getOnCheckForDoneDelegate: function tab_VizImpl$_getOnCheckForDoneDelegate() {
return ss.Delegate.create(this, function (e) {
this._onCheckForDone();
});
},
_handleInitialVizSize: function tab_VizImpl$_handleInitialVizSize(vizAndChromeSize) {
var sheetSize = tab.SheetSizeFactory.fromSizeConstraints(vizAndChromeSize.sizeConstraints);
this._vizSize = tab.$create_VizSize(sheetSize, vizAndChromeSize.chromeHeight);
if (ss.isValue(this._onFirstVizSizeKnownCallback)) {
this._onFirstVizSizeKnownCallback(new tab.FirstVizSizeKnownEvent('firstvizsizeknown', this._viz, this._vizSize));
}
if (this._parameters.fixedSize) {
return;
}
this._refreshSize();
this._addWindowResizeHandler();
this._show();
},
_removeWindowResizeHandler: function tab_VizImpl$_removeWindowResizeHandler() {
if (ss.isNullOrUndefined(this._windowResizeHandler)) {
return;
}
if (tab._Utility.hasWindowAddEventListener()) {
window.removeEventListener('resize', this._windowResizeHandler, false);
} else {
window.self.detachEvent('onresize', this._windowResizeHandler);
}
this._windowResizeHandler = null;
},
_addWindowResizeHandler: function tab_VizImpl$_addWindowResizeHandler() {
if (ss.isValue(this._windowResizeHandler)) {
return;
}
this._windowResizeHandler = ss.Delegate.create(this, function () {
this._refreshSize();
});
if (tab._Utility.hasWindowAddEventListener()) {
window.addEventListener('resize', this._windowResizeHandler, false);
} else {
window.self.attachEvent('onresize', this._windowResizeHandler);
}
}
////////////////////////////////////////////////////////////////////////////////
// tab._VizManagerImpl
};tab._VizManagerImpl = function tab__VizManagerImpl() {};
tab._VizManagerImpl.get__clonedVizs = function tab__VizManagerImpl$get__clonedVizs() {
return tab._VizManagerImpl._vizs.concat();
};
tab._VizManagerImpl._registerViz = function tab__VizManagerImpl$_registerViz(viz) {
tab._VizManagerImpl._verifyVizNotAlreadyParented(viz);
tab._VizManagerImpl._vizs.push(viz);
};
tab._VizManagerImpl._unregisterViz = function tab__VizManagerImpl$_unregisterViz(viz) {
for (var i = 0, len = tab._VizManagerImpl._vizs.length; i < len; i++) {
if (tab._VizManagerImpl._vizs[i] === viz) {
tab._VizManagerImpl._vizs.splice(i, 1);
break;
}
}
};
tab._VizManagerImpl._sendVizOffsets = function tab__VizManagerImpl$_sendVizOffsets() {
for (var i = 0, len = tab._VizManagerImpl._vizs.length; i < len; i++) {
tab._VizManagerImpl._vizs[i]._impl._sendVizOffset();
}
};
tab._VizManagerImpl._verifyVizNotAlreadyParented = function tab__VizManagerImpl$_verifyVizNotAlreadyParented(viz) {
var parent = viz.getParentElement();
for (var i = 0, len = tab._VizManagerImpl._vizs.length; i < len; i++) {
if (tab._VizManagerImpl._vizs[i].getParentElement() === parent) {
var message = "Another viz is already present in element '" + tab._Utility.elementToString(parent) + "'.";
throw tab._TableauException.create('vizAlreadyInManager', message);
}
}
};
////////////////////////////////////////////////////////////////////////////////
// tab._VizParameters
tab._VizParameters = function tab__VizParameters(element, url, options) {
if (ss.isNullOrUndefined(element) || ss.isNullOrUndefined(url)) {
throw tab._TableauException.create('noUrlOrParentElementNotFound', 'URL is empty or Parent element not found');
}
if (ss.isNullOrUndefined(options)) {
options = {};
options.hideTabs = false;
options.hideToolbar = false;
options.onFirstInteractive = null;
}
if (ss.isValue(options.height) || ss.isValue(options.width)) {
this.fixedSize = true;
if (tab._Utility.isNumber(options.height)) {
options.height = options.height.toString() + 'px';
}
if (tab._Utility.isNumber(options.width)) {
options.width = options.width.toString() + 'px';
}
this.height = ss.isValue(options.height) ? options.height.toString() : null;
this.width = ss.isValue(options.width) ? options.width.toString() : null;
} else {
this.fixedSize = false;
}
this.tabs = !(options.hideTabs || false);
this.toolbar = !(options.hideToolbar || false);
this.parentElement = element;
this._createOptions = options;
this.toolBarPosition = options.toolbarPosition;
var urlParts = url.split('?');
this._urlFromApi = urlParts[0];
if (urlParts.length === 2) {
this.userSuppliedParameters = urlParts[1];
} else {
this.userSuppliedParameters = '';
}
var r = new RegExp('.*?[^/:]/', '').exec(this._urlFromApi);
if (ss.isNullOrUndefined(r) || r[0].toLowerCase().indexOf('http://') === -1 && r[0].toLowerCase().indexOf('https://') === -1) {
throw tab._TableauException.create('invalidUrl', 'Invalid url');
}
this.host_url = r[0].toLowerCase();
this.name = this._urlFromApi.replace(r[0], '');
this.name = this.name.replace('views/', '');
this.serverRoot = decodeURIComponent(this.host_url);
};
tab._VizParameters.prototype = {
name: '',
host_url: null,
tabs: false,
toolbar: false,
toolBarPosition: null,
handlerId: null,
width: null,
height: null,
serverRoot: null,
parentElement: null,
userSuppliedParameters: null,
fixedSize: false,
_urlFromApi: null,
_createOptions: null,
get_url: function tab__VizParameters$get_url() {
return this._constructUrl();
},
get_baseUrl: function tab__VizParameters$get_baseUrl() {
return this._urlFromApi;
},
_constructUrl: function tab__VizParameters$_constructUrl() {
var url = [];
url.push(this.get_baseUrl());
url.push('?');
if (this.userSuppliedParameters.length > 0) {
url.push(this.userSuppliedParameters);
url.push('&');
}
url.push(':embed=y');
url.push('&:showVizHome=n');
url.push('&:jsdebug=y');
if (!this.fixedSize) {
url.push('&:bootstrapWhenNotified=y');
}
if (!this.tabs) {
url.push('&:tabs=n');
}
if (!this.toolbar) {
url.push('&:toolbar=n');
} else if (!ss.isNullOrUndefined(this.toolBarPosition)) {
url.push('&:toolbar=');
url.push(this.toolBarPosition);
}
var userOptions = this._createOptions;
var $dict1 = userOptions;
for (var $key2 in $dict1) {
var entry = { key: $key2, value: $dict1[$key2] };
if (entry.key !== 'embed' && entry.key !== 'height' && entry.key !== 'width' && entry.key !== 'autoSize' && entry.key !== 'hideTabs' && entry.key !== 'hideToolbar' && entry.key !== 'onFirstInteractive' && entry.key !== 'onFirstVizSizeKnown' && entry.key !== 'toolbarPosition' && entry.key !== 'instanceIdToClone') {
url.push('&');
url.push(encodeURIComponent(entry.key));
url.push('=');
url.push(encodeURIComponent(entry.value.toString()));
}
}
url.push('&:apiID=' + this.handlerId);
if (ss.isValue(this._createOptions.instanceIdToClone)) {
url.push('#' + this._createOptions.instanceIdToClone);
}
return url.join('');
}
////////////////////////////////////////////////////////////////////////////////
// tab._WorkbookImpl
};tab._WorkbookImpl = function tab__WorkbookImpl(vizImpl, messagingOptions, callback) {
this._publishedSheetsInfo = new tab._Collection();
this._customViews = new tab._Collection();
this._updatedCustomViews = new tab._Collection();
this._removedCustomViews = new tab._Collection();
this._vizImpl = vizImpl;
this._messagingOptions = messagingOptions;
this._getClientInfo(callback);
};
tab._WorkbookImpl._createDashboardZones = function tab__WorkbookImpl$_createDashboardZones(zones) {
zones = zones || [];
var zonesInfo = [];
for (var i = 0; i < zones.length; i++) {
var zone = zones[i];
var objectType = zone.zoneType;
var size = tab.$create_Size(zone.width, zone.height);
var position = tab.$create_Point(zone.x, zone.y);
var name = zone.name;
var zoneInfo = tab.$create__dashboardZoneInfo(name, objectType, position, size, zone.zoneId);
zonesInfo.push(zoneInfo);
}
return zonesInfo;
};
tab._WorkbookImpl._extractSheetName = function tab__WorkbookImpl$_extractSheetName(sheetOrInfoOrName) {
if (ss.isNullOrUndefined(sheetOrInfoOrName)) {
return null;
}
if (tab._Utility.isString(sheetOrInfoOrName)) {
return sheetOrInfoOrName;
}
var info = sheetOrInfoOrName;
var getName = ss.Delegate.create(info, info.getName);
if (ss.isValue(getName)) {
return getName();
}
return null;
};
tab._WorkbookImpl._createSheetSize = function tab__WorkbookImpl$_createSheetSize(sheetInfo) {
if (ss.isNullOrUndefined(sheetInfo)) {
return tab.SheetSizeFactory.createAutomatic();
}
return tab.SheetSizeFactory.fromSizeConstraints(sheetInfo.sizeConstraints);
};
tab._WorkbookImpl._processParameters = function tab__WorkbookImpl$_processParameters(paramList) {
var parameters = new tab._Collection();
var $enum1 = ss.IEnumerator.getEnumerator(paramList.parameters);
while ($enum1.moveNext()) {
var model = $enum1.current;
var paramImpl = new tab._parameterImpl(model);
parameters._add(paramImpl.get__name(), paramImpl.get__parameter());
}
return parameters;
};
tab._WorkbookImpl._findAndCreateParameterImpl = function tab__WorkbookImpl$_findAndCreateParameterImpl(parameterName, paramList) {
var $enum1 = ss.IEnumerator.getEnumerator(paramList.parameters);
while ($enum1.moveNext()) {
var model = $enum1.current;
if (model.name === parameterName) {
return new tab._parameterImpl(model);
}
}
return null;
};
tab._WorkbookImpl.prototype = {
_workbook: null,
_vizImpl: null,
_name: null,
_activeSheetImpl: null,
_activatingHiddenSheetImpl: null,
_isDownloadAllowed: false,
_messagingOptions: null,
get_workbook: function tab__WorkbookImpl$get_workbook() {
if (ss.isNullOrUndefined(this._workbook)) {
this._workbook = new tableauSoftware.Workbook(this);
}
return this._workbook;
},
get_viz: function tab__WorkbookImpl$get_viz() {
return this._vizImpl.get__viz();
},
get_publishedSheets: function tab__WorkbookImpl$get_publishedSheets() {
return this._publishedSheetsInfo;
},
get_name: function tab__WorkbookImpl$get_name() {
return this._name;
},
get_activeSheetImpl: function tab__WorkbookImpl$get_activeSheetImpl() {
return this._activeSheetImpl;
},
get_activeCustomView: function tab__WorkbookImpl$get_activeCustomView() {
return this._currentCustomView;
},
get_isDownloadAllowed: function tab__WorkbookImpl$get_isDownloadAllowed() {
return this._isDownloadAllowed;
},
_findActiveSheetOrSheetWithinActiveDashboard: function tab__WorkbookImpl$_findActiveSheetOrSheetWithinActiveDashboard(sheetOrInfoOrName) {
if (ss.isNullOrUndefined(this._activeSheetImpl)) {
return null;
}
var sheetName = tab._WorkbookImpl._extractSheetName(sheetOrInfoOrName);
if (ss.isNullOrUndefined(sheetName)) {
return null;
}
if (sheetName === this._activeSheetImpl.get_name()) {
return this._activeSheetImpl;
}
if (this._activeSheetImpl.get_isDashboard()) {
var dashboardImpl = this._activeSheetImpl;
var sheet = dashboardImpl.get_worksheets()._get(sheetName);
if (ss.isValue(sheet)) {
return sheet._impl;
}
}
return null;
},
_setActiveSheetAsync: function tab__WorkbookImpl$_setActiveSheetAsync(sheetNameOrInfoOrIndex) {
if (tab._Utility.isNumber(sheetNameOrInfoOrIndex)) {
var index = sheetNameOrInfoOrIndex;
if (index < this._publishedSheetsInfo.get__length() && index >= 0) {
return this._activateSheetWithInfoAsync(this._publishedSheetsInfo.get_item(index)._impl);
} else {
throw tab._TableauException.createIndexOutOfRange(index);
}
}
var sheetName = tab._WorkbookImpl._extractSheetName(sheetNameOrInfoOrIndex);
var sheetInfo = this._publishedSheetsInfo._get(sheetName);
if (ss.isValue(sheetInfo)) {
return this._activateSheetWithInfoAsync(sheetInfo._impl);
} else if (this._activeSheetImpl.get_isDashboard()) {
var d = this._activeSheetImpl;
var sheet = d.get_worksheets()._get(sheetName);
if (ss.isValue(sheet)) {
this._activatingHiddenSheetImpl = null;
var sheetUrl = '';
if (sheet.getIsHidden()) {
this._activatingHiddenSheetImpl = sheet._impl;
} else {
sheetUrl = sheet._impl.get_url();
}
return this._activateSheetInternalAsync(sheet._impl.get_name(), sheetUrl);
}
}
throw tab._TableauException.create('sheetNotInWorkbook', 'Sheet is not found in Workbook');
},
_revertAllAsync: function tab__WorkbookImpl$_revertAllAsync() {
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.RevertAllCommand', 1, function (result) {
deferred.resolve();
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(null, returnHandler);
return deferred.get_promise();
},
_update: function tab__WorkbookImpl$_update(callback) {
this._getClientInfo(callback);
},
_activateSheetWithInfoAsync: function tab__WorkbookImpl$_activateSheetWithInfoAsync(sheetInfoImpl) {
return this._activateSheetInternalAsync(sheetInfoImpl.name, sheetInfoImpl.url);
},
_activateSheetInternalAsync: function tab__WorkbookImpl$_activateSheetInternalAsync(sheetName, sheetUrl) {
var deferred = new tab._Deferred();
if (ss.isValue(this._activeSheetImpl) && sheetName === this._activeSheetImpl.get_name()) {
deferred.resolve(this._activeSheetImpl.get_sheet());
return deferred.get_promise();
}
var param = {};
param['api.switchToSheetName'] = sheetName;
param['api.switchToRepositoryUrl'] = sheetUrl;
param['api.oldRepositoryUrl'] = this._activeSheetImpl.get_url();
var returnHandler = new tab._CommandReturnHandler('api.SwitchActiveSheetCommand', 0, ss.Delegate.create(this, function (result) {
this._vizImpl._workbookTabSwitchHandler = ss.Delegate.create(this, function () {
this._vizImpl._workbookTabSwitchHandler = null;
deferred.resolve(this._activeSheetImpl.get_sheet());
});
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(param, returnHandler);
return deferred.get_promise();
},
_updateActiveSheetAsync: function tab__WorkbookImpl$_updateActiveSheetAsync() {
var deferred = new tab._Deferred();
var param = {};
param['api.switchToSheetName'] = this._activeSheetImpl.get_name();
param['api.switchToRepositoryUrl'] = this._activeSheetImpl.get_url();
param['api.oldRepositoryUrl'] = this._activeSheetImpl.get_url();
var returnHandler = new tab._CommandReturnHandler('api.UpdateActiveSheetCommand', 0, ss.Delegate.create(this, function (result) {
deferred.resolve(this._activeSheetImpl.get_sheet());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(param, returnHandler);
return deferred.get_promise();
},
_sendCommand: function tab__WorkbookImpl$_sendCommand(commandParameters, returnHandler) {
this._messagingOptions.sendCommand(commandParameters, returnHandler);
},
_getClientInfo: function tab__WorkbookImpl$_getClientInfo(callback) {
var returnHandler = new tab._CommandReturnHandler('api.GetClientInfoCommand', 0, ss.Delegate.create(this, function (result) {
var clientInfo = result;
this._processInfo(clientInfo);
if (ss.isValue(callback)) {
callback();
}
}), null);
this._sendCommand(null, returnHandler);
},
_processInfo: function tab__WorkbookImpl$_processInfo(clientInfo) {
this._name = clientInfo.workbookName;
this._isDownloadAllowed = clientInfo.isDownloadAllowed;
this._vizImpl._setAreAutomaticUpdatesPaused(!clientInfo.isAutoUpdate);
this._createSheetsInfo(clientInfo);
this._initializeActiveSheet(clientInfo);
},
_initializeActiveSheet: function tab__WorkbookImpl$_initializeActiveSheet(clientInfo) {
var currentSheetName = clientInfo.currentSheetName;
var newActiveSheetInfo = this._publishedSheetsInfo._get(currentSheetName);
if (ss.isNullOrUndefined(newActiveSheetInfo) && ss.isNullOrUndefined(this._activatingHiddenSheetImpl)) {
throw tab._TableauException.createInternalError('The active sheet was not specified in baseSheets');
}
if (ss.isValue(this._activeSheetImpl) && this._activeSheetImpl.get_name() === currentSheetName) {
return;
}
if (ss.isValue(this._activeSheetImpl)) {
this._activeSheetImpl.set_isActive(false);
var oldActiveSheetInfo = this._publishedSheetsInfo._get(this._activeSheetImpl.get_name());
if (ss.isValue(oldActiveSheetInfo)) {
oldActiveSheetInfo._impl.isActive = false;
}
if (this._activeSheetImpl.get_sheetType() === 'story') {
var storyImpl = this._activeSheetImpl;
storyImpl.remove_activeStoryPointChange(ss.Delegate.create(this._vizImpl, this._vizImpl.raiseStoryPointSwitch));
}
}
if (ss.isValue(this._activatingHiddenSheetImpl)) {
var infoImpl = tab.$create__SheetInfoImpl(this._activatingHiddenSheetImpl.get_name(), 'worksheet', -1, this._activatingHiddenSheetImpl.get_size(), this.get_workbook(), '', true, true, 4294967295);
this._activatingHiddenSheetImpl = null;
this._activeSheetImpl = new tab._WorksheetImpl(infoImpl, this, this._messagingOptions, null);
} else {
var baseSheet = null;
for (var i = 0, len = clientInfo.publishedSheets.length; i < len; i++) {
if (clientInfo.publishedSheets[i].name === currentSheetName) {
baseSheet = clientInfo.publishedSheets[i];
break;
}
}
if (ss.isNullOrUndefined(baseSheet)) {
throw tab._TableauException.createInternalError('No base sheet was found corresponding to the active sheet.');
}
var findSheetFunc = ss.Delegate.create(this, function (sheetName) {
return this._publishedSheetsInfo._get(sheetName);
});
if (baseSheet.sheetType === 'dashboard') {
var dashboardImpl = new tab._DashboardImpl(newActiveSheetInfo._impl, this, this._messagingOptions);
this._activeSheetImpl = dashboardImpl;
var dashboardFrames = tab._WorkbookImpl._createDashboardZones(clientInfo.dashboardZones);
dashboardImpl._addObjects(dashboardFrames, findSheetFunc);
} else if (baseSheet.sheetType === 'story') {
var storyImpl = new tab._StoryImpl(newActiveSheetInfo._impl, this, this._messagingOptions, clientInfo.story, findSheetFunc);
this._activeSheetImpl = storyImpl;
storyImpl.add_activeStoryPointChange(ss.Delegate.create(this._vizImpl, this._vizImpl.raiseStoryPointSwitch));
} else {
this._activeSheetImpl = new tab._WorksheetImpl(newActiveSheetInfo._impl, this, this._messagingOptions, null);
}
newActiveSheetInfo._impl.isActive = true;
}
this._activeSheetImpl.set_isActive(true);
},
_createSheetsInfo: function tab__WorkbookImpl$_createSheetsInfo(clientInfo) {
var baseSheets = clientInfo.publishedSheets;
if (ss.isNullOrUndefined(baseSheets)) {
return;
}
for (var index = 0; index < baseSheets.length; index++) {
var baseSheet = baseSheets[index];
var sheetName = baseSheet.name;
var sheetInfo = this._publishedSheetsInfo._get(sheetName);
var size = tab._WorkbookImpl._createSheetSize(baseSheet);
if (ss.isNullOrUndefined(sheetInfo)) {
var isActive = sheetName === clientInfo.currentSheetName;
var sheetType = baseSheet.sheetType;
var sheetInfoImpl = tab.$create__SheetInfoImpl(sheetName, sheetType, index, size, this.get_workbook(), baseSheet.repositoryUrl, isActive, false, 4294967295);
sheetInfo = new tableauSoftware.SheetInfo(sheetInfoImpl);
this._publishedSheetsInfo._add(sheetName, sheetInfo);
} else {
sheetInfo._impl.size = size;
}
}
},
_currentCustomView: null,
get__customViews: function tab__WorkbookImpl$get__customViews() {
return this._customViews;
},
set__customViews: function tab__WorkbookImpl$set__customViews(value) {
this._customViews = value;
return value;
},
get__updatedCustomViews: function tab__WorkbookImpl$get__updatedCustomViews() {
return this._updatedCustomViews;
},
set__updatedCustomViews: function tab__WorkbookImpl$set__updatedCustomViews(value) {
this._updatedCustomViews = value;
return value;
},
get__removedCustomViews: function tab__WorkbookImpl$get__removedCustomViews() {
return this._removedCustomViews;
},
set__removedCustomViews: function tab__WorkbookImpl$set__removedCustomViews(value) {
this._removedCustomViews = value;
return value;
},
get__currentCustomView: function tab__WorkbookImpl$get__currentCustomView() {
return this._currentCustomView;
},
set__currentCustomView: function tab__WorkbookImpl$set__currentCustomView(value) {
this._currentCustomView = value;
return value;
},
_getCustomViewsAsync: function tab__WorkbookImpl$_getCustomViewsAsync() {
return tab._CustomViewImpl._getCustomViewsAsync(this, this._messagingOptions);
},
_showCustomViewAsync: function tab__WorkbookImpl$_showCustomViewAsync(customViewName) {
if (ss.isNullOrUndefined(customViewName) || tab._Utility.isNullOrEmpty(customViewName)) {
return tab._CustomViewImpl._showCustomViewAsync(this, this._messagingOptions, null);
} else {
var cv = this._customViews._get(customViewName);
if (ss.isNullOrUndefined(cv)) {
var deferred = new tab._Deferred();
deferred.reject(tab._TableauException.createInvalidCustomViewName(customViewName));
return deferred.get_promise();
}
return cv._impl._showAsync();
}
},
_removeCustomViewAsync: function tab__WorkbookImpl$_removeCustomViewAsync(customViewName) {
if (tab._Utility.isNullOrEmpty(customViewName)) {
throw tab._TableauException.createNullOrEmptyParameter('customViewName');
}
var cv = this._customViews._get(customViewName);
if (ss.isNullOrUndefined(cv)) {
var deferred = new tab._Deferred();
deferred.reject(tab._TableauException.createInvalidCustomViewName(customViewName));
return deferred.get_promise();
}
return cv._impl._removeAsync();
},
_rememberCustomViewAsync: function tab__WorkbookImpl$_rememberCustomViewAsync(customViewName) {
if (tab._Utility.isNullOrEmpty(customViewName)) {
throw tab._TableauException.createInvalidParameter('customViewName');
}
return tab._CustomViewImpl._saveNewAsync(this, this._messagingOptions, customViewName);
},
_setActiveCustomViewAsDefaultAsync: function tab__WorkbookImpl$_setActiveCustomViewAsDefaultAsync() {
return tab._CustomViewImpl._makeCurrentCustomViewDefaultAsync(this, this._messagingOptions);
},
_parameters: null,
_lastChangedParameterImpl: null,
get__lastChangedParameterImpl: function tab__WorkbookImpl$get__lastChangedParameterImpl() {
return this._lastChangedParameterImpl;
},
set__lastChangedParameterImpl: function tab__WorkbookImpl$set__lastChangedParameterImpl(value) {
this._lastChangedParameterImpl = value;
return value;
},
get__parameters: function tab__WorkbookImpl$get__parameters() {
return this._parameters;
},
_getSingleParameterAsync: function tab__WorkbookImpl$_getSingleParameterAsync(parameterName) {
var deferred = new tab._Deferred();
if (ss.isValue(this._lastChangedParameterImpl)) {
deferred.resolve(this._lastChangedParameterImpl.get__parameter());
return deferred.get_promise();
}
var commandParameters = {};
var returnHandler = new tab._CommandReturnHandler('api.FetchParametersCommand', 0, ss.Delegate.create(this, function (result) {
var paramList = result;
var parameterImpl = tab._WorkbookImpl._findAndCreateParameterImpl(parameterName, paramList);
this._lastChangedParameterImpl = parameterImpl;
deferred.resolve(parameterImpl.get__parameter());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_getParametersAsync: function tab__WorkbookImpl$_getParametersAsync() {
var deferred = new tab._Deferred();
var commandParameters = {};
var returnHandler = new tab._CommandReturnHandler('api.FetchParametersCommand', 0, ss.Delegate.create(this, function (result) {
var paramList = result;
this._parameters = tab._WorkbookImpl._processParameters(paramList);
deferred.resolve(this.get__parameters()._toApiCollection());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this._sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_changeParameterValueAsync: function tab__WorkbookImpl$_changeParameterValueAsync(parameterName, value) {
var deferred = new tab._Deferred();
var parameterImpl = null;
if (ss.isValue(this._parameters)) {
if (ss.isNullOrUndefined(this._parameters._get(parameterName))) {
deferred.reject(tab._TableauException.createInvalidParameter(parameterName));
return deferred.get_promise();
}
parameterImpl = this._parameters._get(parameterName)._impl;
if (ss.isNullOrUndefined(parameterImpl)) {
deferred.reject(tab._TableauException.createInvalidParameter(parameterName));
return deferred.get_promise();
}
}
var param = {};
param['api.setParameterName'] = ss.isValue(this._parameters) ? parameterImpl.get__name() : parameterName;
if (ss.isValue(value) && tab._Utility.isDate(value)) {
var date = value;
var dateStr = tab._Utility.serializeDateForServer(date);
param['api.setParameterValue'] = dateStr;
} else {
param['api.setParameterValue'] = ss.isValue(value) ? value.toString() : null;
}
this._lastChangedParameterImpl = null;
var returnHandler = new tab._CommandReturnHandler('api.SetParameterValueCommand', 0, ss.Delegate.create(this, function (result) {
var pm = result;
if (ss.isNullOrUndefined(pm)) {
deferred.reject(tab._TableauException.create('serverError', 'server error'));
return;
}
if (!pm.isValidPresModel) {
deferred.reject(tab._TableauException.createInvalidParameter(parameterName));
return;
}
var paramUpdated = new tab._parameterImpl(pm);
this._lastChangedParameterImpl = paramUpdated;
deferred.resolve(paramUpdated.get__parameter());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createInvalidParameter(parameterName));
});
this._sendCommand(param, returnHandler);
return deferred.get_promise();
}
////////////////////////////////////////////////////////////////////////////////
// tab._WorksheetImpl
};tab._WorksheetImpl = function tab__WorksheetImpl(sheetInfoImpl, workbookImpl, messagingOptions, parentDashboardImpl) {
this._filters$1 = new tab._Collection();
this._selectedMarks$1 = new tab._Collection();
tab._WorksheetImpl.initializeBase(this, [sheetInfoImpl, workbookImpl, messagingOptions]);
this._parentDashboardImpl$1 = parentDashboardImpl;
};
tab._WorksheetImpl._filterCommandError = function tab__WorksheetImpl$_filterCommandError(rawPm) {
var commandError = rawPm;
if (ss.isValue(commandError) && ss.isValue(commandError.errorCode)) {
var additionalInfo = commandError.additionalInformation;
switch (commandError.errorCode) {
case 'invalidFilterFieldName':
case 'invalidFilterFieldValue':
return tab._TableauException.create(commandError.errorCode, additionalInfo);
case 'invalidAggregationFieldName':
return tab._TableauException._createInvalidAggregationFieldName(additionalInfo);
default:
return tab._TableauException.createServerError(additionalInfo);
}
}
return null;
};
tab._WorksheetImpl._normalizeRangeFilterOption$1 = function tab__WorksheetImpl$_normalizeRangeFilterOption$1(filterOptions) {
if (ss.isNullOrUndefined(filterOptions)) {
throw tab._TableauException.createNullOrEmptyParameter('filterOptions');
}
if (ss.isNullOrUndefined(filterOptions.min) && ss.isNullOrUndefined(filterOptions.max)) {
throw tab._TableauException.create('invalidParameter', 'At least one of filterOptions.min or filterOptions.max must be specified.');
}
var fixedUpFilterOptions = {};
if (ss.isValue(filterOptions.min)) {
fixedUpFilterOptions.min = filterOptions.min;
}
if (ss.isValue(filterOptions.max)) {
fixedUpFilterOptions.max = filterOptions.max;
}
if (ss.isValue(filterOptions.nullOption)) {
fixedUpFilterOptions.nullOption = tab._enums._normalizeNullOption(filterOptions.nullOption, 'filterOptions.nullOption');
}
return fixedUpFilterOptions;
};
tab._WorksheetImpl._normalizeRelativeDateFilterOptions$1 = function tab__WorksheetImpl$_normalizeRelativeDateFilterOptions$1(filterOptions) {
if (ss.isNullOrUndefined(filterOptions)) {
throw tab._TableauException.createNullOrEmptyParameter('filterOptions');
}
var fixedUpFilterOptions = {};
fixedUpFilterOptions.rangeType = tab._enums._normalizeDateRangeType(filterOptions.rangeType, 'filterOptions.rangeType');
fixedUpFilterOptions.periodType = tab._enums._normalizePeriodType(filterOptions.periodType, 'filterOptions.periodType');
if (fixedUpFilterOptions.rangeType === 'lastn' || fixedUpFilterOptions.rangeType === 'nextn') {
if (ss.isNullOrUndefined(filterOptions.rangeN)) {
throw tab._TableauException.create('missingRangeNForRelativeDateFilters', 'Missing rangeN field for a relative date filter of LASTN or NEXTN.');
}
fixedUpFilterOptions.rangeN = tab._Utility.toInt(filterOptions.rangeN);
}
if (ss.isValue(filterOptions.anchorDate)) {
if (!tab._Utility.isDate(filterOptions.anchorDate) || !tab._Utility.isDateValid(filterOptions.anchorDate)) {
throw tab._TableauException.createInvalidDateParameter('filterOptions.anchorDate');
}
fixedUpFilterOptions.anchorDate = filterOptions.anchorDate;
}
return fixedUpFilterOptions;
};
tab._WorksheetImpl._createFilterCommandReturnHandler$1 = function tab__WorksheetImpl$_createFilterCommandReturnHandler$1(commandName, fieldName, deferred) {
return new tab._CommandReturnHandler(commandName, 1, function (result) {
var error = tab._WorksheetImpl._filterCommandError(result);
if (error == null) {
deferred.resolve(fieldName);
} else {
deferred.reject(error);
}
}, function (remoteError, message) {
if (remoteError) {
deferred.reject(tab._TableauException.createInvalidFilterFieldNameOrValue(fieldName));
} else {
var error = tab._TableauException.create('filterCannotBePerformed', message);
deferred.reject(error);
}
});
};
tab._WorksheetImpl._createSelectionCommandError$1 = function tab__WorksheetImpl$_createSelectionCommandError$1(rawPm) {
var commandError = rawPm;
if (ss.isValue(commandError) && ss.isValue(commandError.errorCode)) {
var additionalInfo = commandError.additionalInformation;
switch (commandError.errorCode) {
case 'invalidSelectionFieldName':
case 'invalidSelectionValue':
case 'invalidSelectionDate':
return tab._TableauException.create(commandError.errorCode, additionalInfo);
}
}
return null;
};
tab._WorksheetImpl.prototype = {
_worksheet$1: null,
_parentDashboardImpl$1: null,
get_sheet: function tab__WorksheetImpl$get_sheet() {
return this.get_worksheet();
},
get_worksheet: function tab__WorksheetImpl$get_worksheet() {
if (this._worksheet$1 == null) {
this._worksheet$1 = new tableauSoftware.Worksheet(this);
}
return this._worksheet$1;
},
get_parentDashboardImpl: function tab__WorksheetImpl$get_parentDashboardImpl() {
return this._parentDashboardImpl$1;
},
get_parentDashboard: function tab__WorksheetImpl$get_parentDashboard() {
if (ss.isValue(this._parentDashboardImpl$1)) {
return this._parentDashboardImpl$1.get_dashboard();
}
return null;
},
_getDataSourcesAsync: function tab__WorksheetImpl$_getDataSourcesAsync() {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
var deferred = new tab._Deferred();
var commandParameters = {};
commandParameters['api.worksheetName'] = this.get_name();
var returnHandler = new tab._CommandReturnHandler('api.GetDataSourcesCommand', 0, function (result) {
var dataSourcesPm = result;
var dataSources = tab._DataSourceImpl.processDataSourcesForWorksheet(dataSourcesPm);
deferred.resolve(dataSources._toApiCollection());
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_getDataSourceAsync: function tab__WorksheetImpl$_getDataSourceAsync(dataSourceName) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
var deferred = new tab._Deferred();
var commandParameters = {};
commandParameters['api.dataSourceName'] = dataSourceName;
commandParameters['api.worksheetName'] = this.get_name();
var returnHandler = new tab._CommandReturnHandler('api.GetDataSourceCommand', 0, function (result) {
var dataSourcePm = result;
var dataSourceImpl = tab._DataSourceImpl.processDataSource(dataSourcePm);
if (ss.isValue(dataSourceImpl)) {
deferred.resolve(dataSourceImpl.get_dataSource());
} else {
deferred.reject(tab._TableauException.createServerError("Data source '" + dataSourceName + "' not found"));
}
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_verifyActiveSheetOrEmbeddedInActiveDashboard$1: function tab__WorksheetImpl$_verifyActiveSheetOrEmbeddedInActiveDashboard$1() {
var isRootAndActiveWorksheet = this.get_isActive();
var isWithinActiveDashboard = ss.isValue(this._parentDashboardImpl$1) && this._parentDashboardImpl$1.get_isActive();
var isWithinActiveStoryPoint = ss.isValue(this.get_parentStoryPointImpl()) && this.get_parentStoryPointImpl().get_parentStoryImpl().get_isActive();
if (!isRootAndActiveWorksheet && !isWithinActiveDashboard && !isWithinActiveStoryPoint) {
throw tab._TableauException.createNotActiveSheet();
}
},
_addVisualIdToCommand$1: function tab__WorksheetImpl$_addVisualIdToCommand$1(commandParameters) {
if (ss.isValue(this.get_parentStoryPointImpl())) {
var visualId = {};
visualId.worksheet = this.get_name();
if (ss.isValue(this.get_parentDashboardImpl())) {
visualId.dashboard = this.get_parentDashboardImpl().get_name();
}
visualId.flipboardZoneId = this.get_parentStoryPointImpl().get_containedSheetImpl().get_zoneId();
visualId.storyboard = this.get_parentStoryPointImpl().get_parentStoryImpl().get_name();
visualId.storyPointId = this.get_parentStoryPointImpl().get_storyPointId();
commandParameters['api.visualId'] = visualId;
} else {
commandParameters['api.worksheetName'] = this.get_name();
if (ss.isValue(this.get_parentDashboardImpl())) {
commandParameters['api.dashboardName'] = this.get_parentDashboardImpl().get_name();
}
}
},
get__filters: function tab__WorksheetImpl$get__filters() {
return this._filters$1;
},
set__filters: function tab__WorksheetImpl$set__filters(value) {
this._filters$1 = value;
return value;
},
_getFilterAsync: function tab__WorksheetImpl$_getFilterAsync(fieldName, fieldCaption, options) {
if (!tab._Utility.isNullOrEmpty(fieldName) && !tab._Utility.isNullOrEmpty(fieldCaption)) {
throw tab._TableauException.createInternalError('Only fieldName OR fieldCaption is allowed, not both.');
}
options = options || {};
var deferred = new tab._Deferred();
var commandParameters = {};
this._addVisualIdToCommand$1(commandParameters);
if (!tab._Utility.isNullOrEmpty(fieldCaption) && tab._Utility.isNullOrEmpty(fieldName)) {
commandParameters['api.fieldCaption'] = fieldCaption;
}
if (!tab._Utility.isNullOrEmpty(fieldName)) {
commandParameters['api.fieldName'] = fieldName;
}
commandParameters['api.filterHierarchicalLevels'] = 0;
commandParameters['api.ignoreDomain'] = options.ignoreDomain || false;
var returnHandler = new tab._CommandReturnHandler('api.GetOneFilterInfoCommand', 0, ss.Delegate.create(this, function (result) {
var error = tab._WorksheetImpl._filterCommandError(result);
if (error == null) {
var filterJson = result;
var filter = tableauSoftware.Filter._createFilter(this, filterJson);
deferred.resolve(filter);
} else {
deferred.reject(error);
}
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_getFiltersAsync: function tab__WorksheetImpl$_getFiltersAsync(options) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
options = options || {};
var deferred = new tab._Deferred();
var commandParameters = {};
this._addVisualIdToCommand$1(commandParameters);
commandParameters['api.ignoreDomain'] = options.ignoreDomain || false;
var returnHandler = new tab._CommandReturnHandler('api.GetFiltersListCommand', 0, ss.Delegate.create(this, function (result) {
var filtersListJson = result;
this.set__filters(tableauSoftware.Filter._processFiltersList(this, filtersListJson));
deferred.resolve(this.get__filters()._toApiCollection());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_applyFilterAsync: function tab__WorksheetImpl$_applyFilterAsync(fieldName, values, updateType, options) {
return this._applyFilterWithValuesInternalAsync$1(fieldName, values, updateType, options);
},
_clearFilterAsync: function tab__WorksheetImpl$_clearFilterAsync(fieldName) {
return this._clearFilterInternalAsync$1(fieldName);
},
_applyRangeFilterAsync: function tab__WorksheetImpl$_applyRangeFilterAsync(fieldName, options) {
var fixedUpFilterOptions = tab._WorksheetImpl._normalizeRangeFilterOption$1(options);
return this._applyRangeFilterInternalAsync$1(fieldName, fixedUpFilterOptions);
},
_applyRelativeDateFilterAsync: function tab__WorksheetImpl$_applyRelativeDateFilterAsync(fieldName, options) {
var fixedUpFilterOptions = tab._WorksheetImpl._normalizeRelativeDateFilterOptions$1(options);
return this._applyRelativeDateFilterInternalAsync$1(fieldName, fixedUpFilterOptions);
},
_applyHierarchicalFilterAsync: function tab__WorksheetImpl$_applyHierarchicalFilterAsync(fieldName, values, updateType, options) {
if (ss.isNullOrUndefined(values) && updateType !== 'all') {
throw tab._TableauException.createInvalidParameter('values');
}
return this._applyHierarchicalFilterInternalAsync$1(fieldName, values, updateType, options);
},
_clearFilterInternalAsync$1: function tab__WorksheetImpl$_clearFilterInternalAsync$1(fieldName) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (tab._Utility.isNullOrEmpty(fieldName)) {
throw tab._TableauException.createNullOrEmptyParameter('fieldName');
}
var deferred = new tab._Deferred();
var commandParameters = {};
commandParameters['api.fieldCaption'] = fieldName;
this._addVisualIdToCommand$1(commandParameters);
var returnHandler = tab._WorksheetImpl._createFilterCommandReturnHandler$1('api.ClearFilterCommand', fieldName, deferred);
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_applyFilterWithValuesInternalAsync$1: function tab__WorksheetImpl$_applyFilterWithValuesInternalAsync$1(fieldName, values, updateType, options) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (tab._Utility.isNullOrEmpty(fieldName)) {
throw tab._TableauException.createNullOrEmptyParameter('fieldName');
}
updateType = tab._enums._normalizeFilterUpdateType(updateType, 'updateType');
var fieldValues = [];
if (tab._jQueryShim.isArray(values)) {
for (var i = 0; i < values.length; i++) {
fieldValues.push(values[i].toString());
}
} else if (ss.isValue(values)) {
fieldValues.push(values.toString());
}
var deferred = new tab._Deferred();
var commandParameters = {};
commandParameters['api.fieldCaption'] = fieldName;
commandParameters['api.filterUpdateType'] = updateType;
commandParameters['api.exclude'] = ss.isValue(options) && options.isExcludeMode ? true : false;
if (updateType !== 'all') {
commandParameters['api.filterCategoricalValues'] = fieldValues;
}
this._addVisualIdToCommand$1(commandParameters);
var returnHandler = tab._WorksheetImpl._createFilterCommandReturnHandler$1('api.ApplyCategoricalFilterCommand', fieldName, deferred);
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_applyRangeFilterInternalAsync$1: function tab__WorksheetImpl$_applyRangeFilterInternalAsync$1(fieldName, filterOptions) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (tab._Utility.isNullOrEmpty(fieldName)) {
throw tab._TableauException.createNullOrEmptyParameter('fieldName');
}
if (ss.isNullOrUndefined(filterOptions)) {
throw tab._TableauException.createNullOrEmptyParameter('filterOptions');
}
var commandParameters = {};
commandParameters['api.fieldCaption'] = fieldName;
if (ss.isValue(filterOptions.min)) {
if (tab._Utility.isDate(filterOptions.min)) {
var dt = filterOptions.min;
if (tab._Utility.isDateValid(dt)) {
commandParameters['api.filterRangeMin'] = tab._Utility.serializeDateForServer(dt);
} else {
throw tab._TableauException.createInvalidDateParameter('filterOptions.min');
}
} else {
commandParameters['api.filterRangeMin'] = filterOptions.min;
}
}
if (ss.isValue(filterOptions.max)) {
if (tab._Utility.isDate(filterOptions.max)) {
var dt = filterOptions.max;
if (tab._Utility.isDateValid(dt)) {
commandParameters['api.filterRangeMax'] = tab._Utility.serializeDateForServer(dt);
} else {
throw tab._TableauException.createInvalidDateParameter('filterOptions.max');
}
} else {
commandParameters['api.filterRangeMax'] = filterOptions.max;
}
}
if (ss.isValue(filterOptions.nullOption)) {
commandParameters['api.filterRangeNullOption'] = filterOptions.nullOption;
}
this._addVisualIdToCommand$1(commandParameters);
var deferred = new tab._Deferred();
var returnHandler = tab._WorksheetImpl._createFilterCommandReturnHandler$1('api.ApplyRangeFilterCommand', fieldName, deferred);
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_applyRelativeDateFilterInternalAsync$1: function tab__WorksheetImpl$_applyRelativeDateFilterInternalAsync$1(fieldName, filterOptions) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (tab._Utility.isNullOrEmpty(fieldName)) {
throw tab._TableauException.createInvalidParameter('fieldName');
} else if (ss.isNullOrUndefined(filterOptions)) {
throw tab._TableauException.createInvalidParameter('filterOptions');
}
var commandParameters = {};
commandParameters['api.fieldCaption'] = fieldName;
if (ss.isValue(filterOptions)) {
commandParameters['api.filterPeriodType'] = filterOptions.periodType;
commandParameters['api.filterDateRangeType'] = filterOptions.rangeType;
if (filterOptions.rangeType === 'lastn' || filterOptions.rangeType === 'nextn') {
if (ss.isNullOrUndefined(filterOptions.rangeN)) {
throw tab._TableauException.create('missingRangeNForRelativeDateFilters', 'Missing rangeN field for a relative date filter of LASTN or NEXTN.');
}
commandParameters['api.filterDateRange'] = filterOptions.rangeN;
}
if (ss.isValue(filterOptions.anchorDate)) {
commandParameters['api.filterDateArchorValue'] = tab._Utility.serializeDateForServer(filterOptions.anchorDate);
}
}
this._addVisualIdToCommand$1(commandParameters);
var deferred = new tab._Deferred();
var returnHandler = tab._WorksheetImpl._createFilterCommandReturnHandler$1('api.ApplyRelativeDateFilterCommand', fieldName, deferred);
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_applyHierarchicalFilterInternalAsync$1: function tab__WorksheetImpl$_applyHierarchicalFilterInternalAsync$1(fieldName, values, updateType, options) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (tab._Utility.isNullOrEmpty(fieldName)) {
throw tab._TableauException.createNullOrEmptyParameter('fieldName');
}
updateType = tab._enums._normalizeFilterUpdateType(updateType, 'updateType');
var fieldValues = null;
var levelValues = null;
if (tab._jQueryShim.isArray(values)) {
fieldValues = [];
var arr = values;
for (var i = 0; i < arr.length; i++) {
fieldValues.push(arr[i].toString());
}
} else if (tab._Utility.isString(values)) {
fieldValues = [];
fieldValues.push(values.toString());
} else if (ss.isValue(values) && ss.isValue(values.levels)) {
var levelValue = values.levels;
levelValues = [];
if (tab._jQueryShim.isArray(levelValue)) {
var levels = levelValue;
for (var i = 0; i < levels.length; i++) {
levelValues.push(levels[i].toString());
}
} else {
levelValues.push(levelValue.toString());
}
} else if (ss.isValue(values)) {
throw tab._TableauException.createInvalidParameter('values');
}
var commandParameters = {};
commandParameters['api.fieldCaption'] = fieldName;
commandParameters['api.filterUpdateType'] = updateType;
commandParameters['api.exclude'] = ss.isValue(options) && options.isExcludeMode ? true : false;
if (fieldValues != null) {
commandParameters['api.filterHierarchicalValues'] = tab.JsonUtil.toJson(fieldValues, false, '');
}
if (levelValues != null) {
commandParameters['api.filterHierarchicalLevels'] = tab.JsonUtil.toJson(levelValues, false, '');
}
this._addVisualIdToCommand$1(commandParameters);
var deferred = new tab._Deferred();
var returnHandler = tab._WorksheetImpl._createFilterCommandReturnHandler$1('api.ApplyHierarchicalFilterCommand', fieldName, deferred);
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
get_selectedMarks: function tab__WorksheetImpl$get_selectedMarks() {
return this._selectedMarks$1;
},
set_selectedMarks: function tab__WorksheetImpl$set_selectedMarks(value) {
this._selectedMarks$1 = value;
return value;
},
_clearSelectedMarksAsync: function tab__WorksheetImpl$_clearSelectedMarksAsync() {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
var deferred = new tab._Deferred();
var commandParameters = {};
this._addVisualIdToCommand$1(commandParameters);
commandParameters['api.filterUpdateType'] = 'replace';
var returnHandler = new tab._CommandReturnHandler('api.SelectMarksCommand', 1, function (result) {
deferred.resolve();
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_selectMarksAsync: function tab__WorksheetImpl$_selectMarksAsync(fieldNameOrFieldValuesMap, valueOrUpdateType, updateType) {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
if (fieldNameOrFieldValuesMap == null && valueOrUpdateType == null) {
return this._clearSelectedMarksAsync();
}
if (tab._Utility.isString(fieldNameOrFieldValuesMap) && (tab._jQueryShim.isArray(valueOrUpdateType) || tab._Utility.isString(valueOrUpdateType) || !tab._enums._isSelectionUpdateType(valueOrUpdateType))) {
return this._selectMarksWithFieldNameAndValueAsync$1(fieldNameOrFieldValuesMap, valueOrUpdateType, updateType);
} else if (tab._jQueryShim.isArray(fieldNameOrFieldValuesMap)) {
return this._selectMarksWithMarksArrayAsync$1(fieldNameOrFieldValuesMap, valueOrUpdateType);
} else {
return this._selectMarksWithMultiDimOptionAsync$1(fieldNameOrFieldValuesMap, valueOrUpdateType);
}
},
_getSelectedMarksAsync: function tab__WorksheetImpl$_getSelectedMarksAsync() {
this._verifyActiveSheetOrEmbeddedInActiveDashboard$1();
var deferred = new tab._Deferred();
var commandParameters = {};
this._addVisualIdToCommand$1(commandParameters);
var returnHandler = new tab._CommandReturnHandler('api.FetchSelectedMarksCommand', 0, ss.Delegate.create(this, function (result) {
var pm = result;
this._selectedMarks$1 = tab._markImpl._processSelectedMarks(pm);
deferred.resolve(this._selectedMarks$1._toApiCollection());
}), function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
},
_selectMarksWithFieldNameAndValueAsync$1: function tab__WorksheetImpl$_selectMarksWithFieldNameAndValueAsync$1(fieldName, value, updateType) {
var catNameList = [];
var catValueList = [];
var hierNameList = [];
var hierValueList = [];
var rangeNameList = [];
var rangeValueList = [];
this._parseMarksParam$1(catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, fieldName, value);
return this._selectMarksWithValuesAsync$1(null, catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, updateType);
},
_selectMarksWithMultiDimOptionAsync$1: function tab__WorksheetImpl$_selectMarksWithMultiDimOptionAsync$1(fieldValuesMap, updateType) {
var dict = fieldValuesMap;
var catNameList = [];
var catValueList = [];
var hierNameList = [];
var hierValueList = [];
var rangeNameList = [];
var rangeValueList = [];
var $dict1 = dict;
for (var $key2 in $dict1) {
var ent = { key: $key2, value: $dict1[$key2] };
if (fieldValuesMap.hasOwnProperty(ent.key)) {
if (!tab._jQueryShim.isFunction(dict[ent.key])) {
this._parseMarksParam$1(catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, ent.key, ent.value);
}
}
}
return this._selectMarksWithValuesAsync$1(null, catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, updateType);
},
_selectMarksWithMarksArrayAsync$1: function tab__WorksheetImpl$_selectMarksWithMarksArrayAsync$1(marksArray, updateType) {
var catNameList = [];
var catValueList = [];
var hierNameList = [];
var hierValueList = [];
var rangeNameList = [];
var rangeValueList = [];
var tupleIdList = [];
for (var i = 0; i < marksArray.length; i++) {
var mark = marksArray[i];
if (ss.isValue(mark._impl.get__tupleId()) && mark._impl.get__tupleId() > 0) {
tupleIdList.push(mark._impl.get__tupleId());
} else {
var pairs = mark._impl.get__pairs();
for (var j = 0; j < pairs.get__length(); j++) {
var pair = pairs.get_item(j);
if (pair.hasOwnProperty('fieldName') && pair.hasOwnProperty('value') && !tab._jQueryShim.isFunction(pair.fieldName) && !tab._jQueryShim.isFunction(pair.value)) {
this._parseMarksParam$1(catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, pair.fieldName, pair.value);
}
}
}
}
return this._selectMarksWithValuesAsync$1(tupleIdList, catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, updateType);
},
_parseMarksParam$1: function tab__WorksheetImpl$_parseMarksParam$1(catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, fieldName, value) {
var sourceOptions = value;
if (tab._WorksheetImpl._regexHierarchicalFieldName$1.test(fieldName)) {
this._addToParamLists$1(hierNameList, hierValueList, fieldName, value);
} else if (ss.isValue(sourceOptions.min) || ss.isValue(sourceOptions.max)) {
var range = {};
if (ss.isValue(sourceOptions.min)) {
if (tab._Utility.isDate(sourceOptions.min)) {
var dt = sourceOptions.min;
if (tab._Utility.isDateValid(dt)) {
range.min = tab._Utility.serializeDateForServer(dt);
} else {
throw tab._TableauException.createInvalidDateParameter('options.min');
}
} else {
range.min = sourceOptions.min;
}
}
if (ss.isValue(sourceOptions.max)) {
if (tab._Utility.isDate(sourceOptions.max)) {
var dt = sourceOptions.max;
if (tab._Utility.isDateValid(dt)) {
range.max = tab._Utility.serializeDateForServer(dt);
} else {
throw tab._TableauException.createInvalidDateParameter('options.max');
}
} else {
range.max = sourceOptions.max;
}
}
if (ss.isValue(sourceOptions.nullOption)) {
var nullOption = tab._enums._normalizeNullOption(sourceOptions.nullOption, 'options.nullOption');
range.nullOption = nullOption;
} else {
range.nullOption = 'allValues';
}
var jsonValue = tab.JsonUtil.toJson(range, false, '');
this._addToParamLists$1(rangeNameList, rangeValueList, fieldName, jsonValue);
} else {
this._addToParamLists$1(catNameList, catValueList, fieldName, value);
}
},
_addToParamLists$1: function tab__WorksheetImpl$_addToParamLists$1(paramNameList, paramValueList, paramName, paramValue) {
var markValues = [];
if (tab._jQueryShim.isArray(paramValue)) {
var values = paramValue;
for (var i = 0; i < values.length; i++) {
markValues.push(values[i]);
}
} else {
markValues.push(paramValue);
}
paramValueList.push(markValues);
paramNameList.push(paramName);
},
_selectMarksWithValuesAsync$1: function tab__WorksheetImpl$_selectMarksWithValuesAsync$1(tupleIdList, catNameList, catValueList, hierNameList, hierValueList, rangeNameList, rangeValueList, updateType) {
var commandParameters = {};
this._addVisualIdToCommand$1(commandParameters);
updateType = tab._enums._normalizeSelectionUpdateType(updateType, 'updateType');
commandParameters['api.filterUpdateType'] = updateType;
if (!tab._Utility.isNullOrEmpty(tupleIdList)) {
commandParameters['api.tupleIds'] = tab.JsonUtil.toJson(tupleIdList, false, '');
}
if (!tab._Utility.isNullOrEmpty(catNameList) && !tab._Utility.isNullOrEmpty(catValueList)) {
commandParameters['api.categoricalFieldCaption'] = tab.JsonUtil.toJson(catNameList, false, '');
var markValues = [];
for (var i = 0; i < catValueList.length; i++) {
var values = tab.JsonUtil.toJson(catValueList[i], false, '');
markValues.push(values);
}
commandParameters['api.categoricalMarkValues'] = tab.JsonUtil.toJson(markValues, false, '');
}
if (!tab._Utility.isNullOrEmpty(hierNameList) && !tab._Utility.isNullOrEmpty(hierValueList)) {
commandParameters['api.hierarchicalFieldCaption'] = tab.JsonUtil.toJson(hierNameList, false, '');
var markValues = [];
for (var i = 0; i < hierValueList.length; i++) {
var values = tab.JsonUtil.toJson(hierValueList[i], false, '');
markValues.push(values);
}
commandParameters['api.hierarchicalMarkValues'] = tab.JsonUtil.toJson(markValues, false, '');
}
if (!tab._Utility.isNullOrEmpty(rangeNameList) && !tab._Utility.isNullOrEmpty(rangeValueList)) {
commandParameters['api.rangeFieldCaption'] = tab.JsonUtil.toJson(rangeNameList, false, '');
var markValues = [];
for (var i = 0; i < rangeValueList.length; i++) {
var values = tab.JsonUtil.toJson(rangeValueList[i], false, '');
markValues.push(values);
}
commandParameters['api.rangeMarkValues'] = tab.JsonUtil.toJson(markValues, false, '');
}
if (tab._Utility.isNullOrEmpty(commandParameters['api.tupleIds']) && tab._Utility.isNullOrEmpty(commandParameters['api.categoricalFieldCaption']) && tab._Utility.isNullOrEmpty(commandParameters['api.hierarchicalFieldCaption']) && tab._Utility.isNullOrEmpty(commandParameters['api.rangeFieldCaption'])) {
throw tab._TableauException.createInvalidParameter('fieldNameOrFieldValuesMap');
}
var deferred = new tab._Deferred();
var returnHandler = new tab._CommandReturnHandler('api.SelectMarksCommand', 1, function (result) {
var error = tab._WorksheetImpl._createSelectionCommandError$1(result);
if (error == null) {
deferred.resolve();
} else {
deferred.reject(error);
}
}, function (remoteError, message) {
deferred.reject(tab._TableauException.createServerError(message));
});
this.sendCommand(commandParameters, returnHandler);
return deferred.get_promise();
}
////////////////////////////////////////////////////////////////////////////////
// tab.JsonUtil
};tab.JsonUtil = function tab_JsonUtil() {};
tab.JsonUtil.parseJson = function tab_JsonUtil$parseJson(jsonValue) {
return tab._jQueryShim.parseJSON(jsonValue);
};
tab.JsonUtil.toJson = function tab_JsonUtil$toJson(it, pretty, indentStr) {
pretty = pretty || false;
indentStr = indentStr || '';
var stack = [];
return tab.JsonUtil._serialize(it, pretty, indentStr, stack);
};
tab.JsonUtil._indexOf = function tab_JsonUtil$_indexOf(array, searchElement, fromIndex) {
if (ss.isValue(Array.prototype['indexOf'])) {
return array.indexOf(searchElement, fromIndex);
}
fromIndex = fromIndex || 0;
var length = array.length;
if (length > 0) {
for (var index = fromIndex; index < length; index++) {
if (array[index] === searchElement) {
return index;
}
}
}
return -1;
};
tab.JsonUtil._contains = function tab_JsonUtil$_contains(array, searchElement, fromIndex) {
var index = tab.JsonUtil._indexOf(array, searchElement, fromIndex);
return index >= 0;
};
tab.JsonUtil._serialize = function tab_JsonUtil$_serialize(it, pretty, indentStr, stack) {
if (tab.JsonUtil._contains(stack, it)) {
throw Error.createError('The object contains recursive reference of sub-objects', null);
}
if (ss.isUndefined(it)) {
return 'undefined';
}
if (it == null) {
return 'null';
}
var objtype = tab._jQueryShim.type(it);
if (objtype === 'number' || objtype === 'boolean') {
return it.toString();
}
if (objtype === 'string') {
return tab.JsonUtil._escapeString(it);
}
stack.push(it);
var newObj;
indentStr = indentStr || '';
var nextIndent = pretty ? indentStr + '\t' : '';
var tf = it.__json__ || it.json;
if (tab._jQueryShim.isFunction(tf)) {
var jsonCallback = tf;
newObj = jsonCallback(it);
if (it !== newObj) {
var res = tab.JsonUtil._serialize(newObj, pretty, nextIndent, stack);
stack.pop();
return res;
}
}
if (ss.isValue(it.nodeType) && ss.isValue(it.cloneNode)) {
throw Error.createError("Can't serialize DOM nodes", null);
}
var separator = pretty ? ' ' : '';
var newLine = pretty ? '\n' : '';
if (tab._jQueryShim.isArray(it)) {
return tab.JsonUtil._serializeArray(it, pretty, indentStr, stack, nextIndent, newLine);
}
if (objtype === 'function') {
stack.pop();
return null;
}
return tab.JsonUtil._serializeGeneric(it, pretty, indentStr, stack, nextIndent, newLine, separator);
};
tab.JsonUtil._serializeGeneric = function tab_JsonUtil$_serializeGeneric(it, pretty, indentStr, stack, nextIndent, newLine, separator) {
var d = it;
var bdr = new ss.StringBuilder('{');
var init = false;
var $dict1 = d;
for (var $key2 in $dict1) {
var e = { key: $key2, value: $dict1[$key2] };
var keyStr;
var val;
if (typeof e.key === 'number') {
keyStr = '"' + e.key + '"';
} else if (typeof e.key === 'string') {
keyStr = tab.JsonUtil._escapeString(e.key);
} else {
continue;
}
val = tab.JsonUtil._serialize(e.value, pretty, nextIndent, stack);
if (val == null) {
continue;
}
if (init) {
bdr.append(',');
}
bdr.append(newLine + nextIndent + keyStr + ':' + separator + val);
init = true;
}
bdr.append(newLine + indentStr + '}');
stack.pop();
return bdr.toString();
};
tab.JsonUtil._serializeArray = function tab_JsonUtil$_serializeArray(it, pretty, indentStr, stack, nextIndent, newLine) {
var initialized = false;
var sb = new ss.StringBuilder('[');
var a = it;
for (var i = 0; i < a.length; i++) {
var o = a[i];
var s = tab.JsonUtil._serialize(o, pretty, nextIndent, stack);
if (s == null) {
s = 'undefined';
}
if (initialized) {
sb.append(',');
}
sb.append(newLine + nextIndent + s);
initialized = true;
}
sb.append(newLine + indentStr + ']');
stack.pop();
return sb.toString();
};
tab.JsonUtil._escapeString = function tab_JsonUtil$_escapeString(str) {
str = '"' + str.replace(/(["\\])/g, '\\$1') + '"';
str = str.replace(new RegExp('[\f]', 'g'), '\\f');
str = str.replace(new RegExp('[\b]', 'g'), '\\b');
str = str.replace(new RegExp('[\n]', 'g'), '\\n');
str = str.replace(new RegExp('[\t]', 'g'), '\\t');
str = str.replace(new RegExp('[\r]', 'g'), '\\r');
return str;
};
Type.registerNamespace('tableauSoftware');
////////////////////////////////////////////////////////////////////////////////
// tab.DataValue
tab.$create_DataValue = function tab_DataValue(value, formattedValue, aliasedValue) {
var $o = {};
$o.value = value;
if (tab._Utility.isNullOrEmpty(aliasedValue)) {
$o.formattedValue = formattedValue;
} else {
$o.formattedValue = aliasedValue;
}
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab.VizSize
tab.$create_VizSize = function tab_VizSize(sheetSize, chromeHeight) {
var $o = {};
$o.sheetSize = sheetSize;
$o.chromeHeight = chromeHeight;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab.Point
tab.$create_Point = function tab_Point(x, y) {
var $o = {};
$o.x = x;
$o.y = y;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab.Size
tab.$create_Size = function tab_Size(width, height) {
var $o = {};
$o.width = width;
$o.height = height;
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tab.SheetSize
tab.$create_SheetSize = function tab_SheetSize(behavior, minSize, maxSize) {
var $o = {};
$o.behavior = behavior || 'automatic';
if (ss.isValue(minSize)) {
$o.minSize = minSize;
}
if (ss.isValue(maxSize)) {
$o.maxSize = maxSize;
}
return $o;
};
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.CustomView
tableauSoftware.CustomView = function tableauSoftware_CustomView(customViewImpl) {
this._impl = customViewImpl;
};
tableauSoftware.CustomView.prototype = {
_impl: null,
getWorkbook: function tableauSoftware_CustomView$getWorkbook() {
return this._impl.get__workbook();
},
getUrl: function tableauSoftware_CustomView$getUrl() {
return this._impl.get__url();
},
getName: function tableauSoftware_CustomView$getName() {
return this._impl.get__name();
},
setName: function tableauSoftware_CustomView$setName(value) {
this._impl.set__name(value);
},
getOwnerName: function tableauSoftware_CustomView$getOwnerName() {
return this._impl.get__ownerName();
},
getAdvertised: function tableauSoftware_CustomView$getAdvertised() {
return this._impl.get__advertised();
},
setAdvertised: function tableauSoftware_CustomView$setAdvertised(value) {
this._impl.set__advertised(value);
},
getDefault: function tableauSoftware_CustomView$getDefault() {
return this._impl.get__isDefault();
},
saveAsync: function tableauSoftware_CustomView$saveAsync() {
return this._impl.saveAsync();
}
////////////////////////////////////////////////////////////////////////////////
// tab.CustomViewEvent
};tab.CustomViewEvent = function tab_CustomViewEvent(eventName, viz, customViewImpl) {
tab.CustomViewEvent.initializeBase(this, [eventName, viz]);
this._context$1 = new tab._customViewEventContext(viz._impl.get__workbookImpl(), customViewImpl);
};
tab.CustomViewEvent.prototype = {
_context$1: null,
getCustomViewAsync: function tab_CustomViewEvent$getCustomViewAsync() {
var deferred = new tab._Deferred();
var customView = null;
if (ss.isValue(this._context$1.get__customViewImpl())) {
customView = this._context$1.get__customViewImpl().get__customView();
}
deferred.resolve(customView);
return deferred.get_promise();
}
////////////////////////////////////////////////////////////////////////////////
// tab._customViewEventContext
};tab._customViewEventContext = function tab__customViewEventContext(workbook, customViewImpl) {
tab._customViewEventContext.initializeBase(this, [workbook, null]);
this._customViewImpl$1 = customViewImpl;
};
tab._customViewEventContext.prototype = {
_customViewImpl$1: null,
get__customViewImpl: function tab__customViewEventContext$get__customViewImpl() {
return this._customViewImpl$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Dashboard
};tableauSoftware.Dashboard = function tableauSoftware_Dashboard(dashboardImpl) {
tableauSoftware.Dashboard.initializeBase(this, [dashboardImpl]);
};
tableauSoftware.Dashboard.prototype = {
_impl: null,
getParentStoryPoint: function tableauSoftware_Dashboard$getParentStoryPoint() {
return this._impl.get_parentStoryPoint();
},
getObjects: function tableauSoftware_Dashboard$getObjects() {
return this._impl.get_objects()._toApiCollection();
},
getWorksheets: function tableauSoftware_Dashboard$getWorksheets() {
return this._impl.get_worksheets()._toApiCollection();
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.DashboardObject
};tableauSoftware.DashboardObject = function tableauSoftware_DashboardObject(frameInfo, dashboard, worksheet) {
if (frameInfo._objectType === 'worksheet' && ss.isNullOrUndefined(worksheet)) {
throw tab._TableauException.createInternalError('worksheet parameter is required for WORKSHEET objects');
} else if (frameInfo._objectType !== 'worksheet' && ss.isValue(worksheet)) {
throw tab._TableauException.createInternalError('worksheet parameter should be undefined for non-WORKSHEET objects');
}
this._zoneInfo = frameInfo;
this._dashboard = dashboard;
this._worksheet = worksheet;
};
tableauSoftware.DashboardObject.prototype = {
_zoneInfo: null,
_dashboard: null,
_worksheet: null,
getObjectType: function tableauSoftware_DashboardObject$getObjectType() {
return this._zoneInfo._objectType;
},
getDashboard: function tableauSoftware_DashboardObject$getDashboard() {
return this._dashboard;
},
getWorksheet: function tableauSoftware_DashboardObject$getWorksheet() {
return this._worksheet;
},
getPosition: function tableauSoftware_DashboardObject$getPosition() {
return this._zoneInfo._position;
},
getSize: function tableauSoftware_DashboardObject$getSize() {
return this._zoneInfo._size;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.DataSource
};tableauSoftware.DataSource = function tableauSoftware_DataSource(impl) {
this._impl = impl;
};
tableauSoftware.DataSource.prototype = {
_impl: null,
getName: function tableauSoftware_DataSource$getName() {
return this._impl.get_name();
},
getFields: function tableauSoftware_DataSource$getFields() {
return this._impl.get_fields()._toApiCollection();
},
getIsPrimary: function tableauSoftware_DataSource$getIsPrimary() {
return this._impl.get_isPrimary();
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Field
};tableauSoftware.Field = function tableauSoftware_Field(dataSource, name, fieldRoleType, fieldAggrType) {
this._dataSource = dataSource;
this._name = name;
this._fieldRoleType = fieldRoleType;
this._fieldAggrType = fieldAggrType;
};
tableauSoftware.Field.prototype = {
_dataSource: null,
_name: null,
_fieldRoleType: null,
_fieldAggrType: null,
getDataSource: function tableauSoftware_Field$getDataSource() {
return this._dataSource;
},
getName: function tableauSoftware_Field$getName() {
return this._name;
},
getRole: function tableauSoftware_Field$getRole() {
return this._fieldRoleType;
},
getAggregation: function tableauSoftware_Field$getAggregation() {
return this._fieldAggrType;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.CategoricalFilter
};tableauSoftware.CategoricalFilter = function tableauSoftware_CategoricalFilter(worksheetImpl, pm) {
tableauSoftware.CategoricalFilter.initializeBase(this, [worksheetImpl, pm]);
this._initializeFromJson$1(pm);
};
tableauSoftware.CategoricalFilter.prototype = {
_isExclude$1: false,
_appliedValues$1: null,
getIsExcludeMode: function tableauSoftware_CategoricalFilter$getIsExcludeMode() {
return this._isExclude$1;
},
getAppliedValues: function tableauSoftware_CategoricalFilter$getAppliedValues() {
return this._appliedValues$1;
},
_updateFromJson: function tableauSoftware_CategoricalFilter$_updateFromJson(pm) {
this._initializeFromJson$1(pm);
},
_initializeFromJson$1: function tableauSoftware_CategoricalFilter$_initializeFromJson$1(pm) {
this._isExclude$1 = pm.isExclude;
if (ss.isValue(pm.appliedValues)) {
this._appliedValues$1 = [];
var $enum1 = ss.IEnumerator.getEnumerator(pm.appliedValues);
while ($enum1.moveNext()) {
var v = $enum1.current;
this._appliedValues$1.push(tab._Utility.getDataValue(v));
}
}
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Filter
};tableauSoftware.Filter = function tableauSoftware_Filter(worksheetImpl, pm) {
this._worksheetImpl = worksheetImpl;
this._initializeFromJson(pm);
};
tableauSoftware.Filter._createFilter = function tableauSoftware_Filter$_createFilter(worksheetImpl, pm) {
switch (pm.filterType) {
case 'categorical':
return new tableauSoftware.CategoricalFilter(worksheetImpl, pm);
case 'relativedate':
return new tableauSoftware.RelativeDateFilter(worksheetImpl, pm);
case 'hierarchical':
return new tableauSoftware.HierarchicalFilter(worksheetImpl, pm);
case 'quantitative':
return new tableauSoftware.QuantitativeFilter(worksheetImpl, pm);
}
return null;
};
tableauSoftware.Filter._processFiltersList = function tableauSoftware_Filter$_processFiltersList(worksheetImpl, filtersListDict) {
var filters = new tab._Collection();
var $enum1 = ss.IEnumerator.getEnumerator(filtersListDict.filters);
while ($enum1.moveNext()) {
var filterPm = $enum1.current;
var filter = tableauSoftware.Filter._createFilter(worksheetImpl, filterPm);
filters._add(filterPm.caption, filter);
}
return filters;
};
tableauSoftware.Filter.prototype = {
_worksheetImpl: null,
_type: null,
_caption: null,
_field: null,
_dataSourceName: null,
_fieldRole: null,
_fieldAggregation: null,
getFilterType: function tableauSoftware_Filter$getFilterType() {
return this._type;
},
getFieldName: function tableauSoftware_Filter$getFieldName() {
return this._caption;
},
getWorksheet: function tableauSoftware_Filter$getWorksheet() {
return this._worksheetImpl.get_worksheet();
},
getFieldAsync: function tableauSoftware_Filter$getFieldAsync() {
var deferred = new tab._Deferred();
if (this._field == null) {
var rejected = function rejected(e) {
deferred.reject(e);
return null;
};
var fulfilled = ss.Delegate.create(this, function (value) {
this._field = new tableauSoftware.Field(value, this._caption, this._fieldRole, this._fieldAggregation);
deferred.resolve(this._field);
return null;
});
this._worksheetImpl._getDataSourceAsync(this._dataSourceName).then(fulfilled, rejected);
} else {
window.setTimeout(ss.Delegate.create(this, function () {
deferred.resolve(this._field);
}), 0);
}
return deferred.get_promise();
},
_update: function tableauSoftware_Filter$_update(pm) {
this._initializeFromJson(pm);
this._updateFromJson(pm);
},
_addFieldParams: function tableauSoftware_Filter$_addFieldParams(param) {},
_initializeFromJson: function tableauSoftware_Filter$_initializeFromJson(pm) {
this._caption = pm.caption;
this._type = pm.filterType;
this._field = null;
this._dataSourceName = pm.dataSourceName;
this._fieldRole = pm.fieldRole || 0;
this._fieldAggregation = pm.fieldAggregation || 0;
}
////////////////////////////////////////////////////////////////////////////////
// tab.FilterEvent
};tab.FilterEvent = function tab_FilterEvent(eventName, viz, worksheetImpl, fieldName, filterCaption) {
tab.FilterEvent.initializeBase(this, [eventName, viz, worksheetImpl]);
this._filterCaption$2 = filterCaption;
this._context$2 = new tab._filterEventContext(viz._impl.get__workbookImpl(), worksheetImpl, fieldName, filterCaption);
};
tab.FilterEvent.prototype = {
_filterCaption$2: null,
_context$2: null,
getFieldName: function tab_FilterEvent$getFieldName() {
return this._filterCaption$2;
},
getFilterAsync: function tab_FilterEvent$getFilterAsync() {
return this._context$2.get__worksheetImpl()._getFilterAsync(this._context$2.get__filterFieldName(), null, null);
}
////////////////////////////////////////////////////////////////////////////////
// tab._filterEventContext
};tab._filterEventContext = function tab__filterEventContext(workbookImpl, worksheetImpl, fieldFieldName, filterCaption) {
tab._filterEventContext.initializeBase(this, [workbookImpl, worksheetImpl]);
this._fieldFieldName$1 = fieldFieldName;
this._filterCaption$1 = filterCaption;
};
tab._filterEventContext.prototype = {
_fieldFieldName$1: null,
_filterCaption$1: null,
get__filterFieldName: function tab__filterEventContext$get__filterFieldName() {
return this._fieldFieldName$1;
},
get__filterCaption: function tab__filterEventContext$get__filterCaption() {
return this._filterCaption$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.HierarchicalFilter
};tableauSoftware.HierarchicalFilter = function tableauSoftware_HierarchicalFilter(worksheetImpl, pm) {
tableauSoftware.HierarchicalFilter.initializeBase(this, [worksheetImpl, pm]);
this._initializeFromJson$1(pm);
};
tableauSoftware.HierarchicalFilter.prototype = {
_levels$1: 0,
_addFieldParams: function tableauSoftware_HierarchicalFilter$_addFieldParams(param) {
param['api.filterHierarchicalLevels'] = this._levels$1;
},
_updateFromJson: function tableauSoftware_HierarchicalFilter$_updateFromJson(pm) {
this._initializeFromJson$1(pm);
},
_initializeFromJson$1: function tableauSoftware_HierarchicalFilter$_initializeFromJson$1(pm) {
this._levels$1 = pm.levels;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.QuantitativeFilter
};tableauSoftware.QuantitativeFilter = function tableauSoftware_QuantitativeFilter(worksheetImpl, pm) {
tableauSoftware.QuantitativeFilter.initializeBase(this, [worksheetImpl, pm]);
this._initializeFromJson$1(pm);
};
tableauSoftware.QuantitativeFilter.prototype = {
_domainMin$1: null,
_domainMax$1: null,
_min$1: null,
_max$1: null,
_includeNullValues$1: false,
getMin: function tableauSoftware_QuantitativeFilter$getMin() {
return this._min$1;
},
getMax: function tableauSoftware_QuantitativeFilter$getMax() {
return this._max$1;
},
getIncludeNullValues: function tableauSoftware_QuantitativeFilter$getIncludeNullValues() {
return this._includeNullValues$1;
},
getDomainMin: function tableauSoftware_QuantitativeFilter$getDomainMin() {
return this._domainMin$1;
},
getDomainMax: function tableauSoftware_QuantitativeFilter$getDomainMax() {
return this._domainMax$1;
},
_updateFromJson: function tableauSoftware_QuantitativeFilter$_updateFromJson(pm) {
this._initializeFromJson$1(pm);
},
_initializeFromJson$1: function tableauSoftware_QuantitativeFilter$_initializeFromJson$1(pm) {
this._domainMin$1 = tab._Utility.getDataValue(pm.domainMinValue);
this._domainMax$1 = tab._Utility.getDataValue(pm.domainMaxValue);
this._min$1 = tab._Utility.getDataValue(pm.minValue);
this._max$1 = tab._Utility.getDataValue(pm.maxValue);
this._includeNullValues$1 = pm.includeNullValues;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.RelativeDateFilter
};tableauSoftware.RelativeDateFilter = function tableauSoftware_RelativeDateFilter(worksheetImpl, pm) {
tableauSoftware.RelativeDateFilter.initializeBase(this, [worksheetImpl, pm]);
this._initializeFromJson$1(pm);
};
tableauSoftware.RelativeDateFilter.prototype = {
_periodType$1: null,
_rangeType$1: null,
_rangeN$1: 0,
getPeriod: function tableauSoftware_RelativeDateFilter$getPeriod() {
return this._periodType$1;
},
getRange: function tableauSoftware_RelativeDateFilter$getRange() {
return this._rangeType$1;
},
getRangeN: function tableauSoftware_RelativeDateFilter$getRangeN() {
return this._rangeN$1;
},
_updateFromJson: function tableauSoftware_RelativeDateFilter$_updateFromJson(pm) {
this._initializeFromJson$1(pm);
},
_initializeFromJson$1: function tableauSoftware_RelativeDateFilter$_initializeFromJson$1(pm) {
if (ss.isValue(pm.periodType)) {
this._periodType$1 = tab._enums._normalizePeriodType(pm.periodType, 'periodType');
}
if (ss.isValue(pm.rangeType)) {
this._rangeType$1 = tab._enums._normalizeDateRangeType(pm.rangeType, 'rangeType');
}
if (ss.isValue(pm.rangeN)) {
this._rangeN$1 = pm.rangeN;
}
}
////////////////////////////////////////////////////////////////////////////////
// tab.FirstVizSizeKnownEvent
};tab.FirstVizSizeKnownEvent = function tab_FirstVizSizeKnownEvent(eventName, viz, vizSize) {
tab.FirstVizSizeKnownEvent.initializeBase(this, [eventName, viz]);
this._vizSize$1 = vizSize;
};
tab.FirstVizSizeKnownEvent.prototype = {
_vizSize$1: null,
getVizSize: function tab_FirstVizSizeKnownEvent$getVizSize() {
return this._vizSize$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Version
};tableauSoftware.Version = function tableauSoftware_Version(major, minor, patch, metadata) {
this._major = major;
this._minor = minor;
this._patch = patch;
this._metadata = metadata || null;
};
tableauSoftware.Version.getCurrent = function tableauSoftware_Version$getCurrent() {
return tableauSoftware.Version._currentVersion;
};
tableauSoftware.Version.prototype = {
_major: 0,
_minor: 0,
_patch: 0,
_metadata: null,
getMajor: function tableauSoftware_Version$getMajor() {
return this._major;
},
getMinor: function tableauSoftware_Version$getMinor() {
return this._minor;
},
getPatch: function tableauSoftware_Version$getPatch() {
return this._patch;
},
getMetadata: function tableauSoftware_Version$getMetadata() {
return this._metadata;
},
toString: function tableauSoftware_Version$toString() {
var version = this._major + '.' + this._minor + '.' + this._patch;
if (ss.isValue(this._metadata) && this._metadata.length > 0) {
version += '-' + this._metadata;
}
return version;
}
////////////////////////////////////////////////////////////////////////////////
// tab.VizResizeEvent
};tab.VizResizeEvent = function tab_VizResizeEvent(eventName, viz, availableSize) {
tab.VizResizeEvent.initializeBase(this, [eventName, viz]);
this._availableSize$1 = availableSize;
};
tab.VizResizeEvent.prototype = {
_availableSize$1: null,
getAvailableSize: function tab_VizResizeEvent$getAvailableSize() {
return this._availableSize$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Mark
};tableauSoftware.Mark = function tableauSoftware_Mark(tupleId) {
this._impl = new tab._markImpl(tupleId);
};
tableauSoftware.Mark.prototype = {
_impl: null,
getPairs: function tableauSoftware_Mark$getPairs() {
return this._impl.get__clonedPairs();
}
////////////////////////////////////////////////////////////////////////////////
// tab.MarksEvent
};tab.MarksEvent = function tab_MarksEvent(eventName, viz, worksheetImpl) {
tab.MarksEvent.initializeBase(this, [eventName, viz, worksheetImpl]);
this._context$2 = new tab._marksEventContext(viz._impl.get__workbookImpl(), worksheetImpl);
};
tab.MarksEvent.prototype = {
_context$2: null,
getMarksAsync: function tab_MarksEvent$getMarksAsync() {
var worksheetImpl = this._context$2.get__worksheetImpl();
if (ss.isValue(worksheetImpl.get_selectedMarks())) {
var deferred = new tab._Deferred();
return deferred.resolve(worksheetImpl.get_selectedMarks()._toApiCollection());
}
return worksheetImpl._getSelectedMarksAsync();
}
////////////////////////////////////////////////////////////////////////////////
// tab._marksEventContext
};tab._marksEventContext = function tab__marksEventContext(workbookImpl, worksheetImpl) {
tab._marksEventContext.initializeBase(this, [workbookImpl, worksheetImpl]);
};
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Pair
tableauSoftware.Pair = function tableauSoftware_Pair(fieldName, value) {
this.fieldName = fieldName;
this.value = value;
this.formattedValue = ss.isValue(value) ? value.toString() : '';
};
tableauSoftware.Pair.prototype = {
fieldName: null,
value: null,
formattedValue: null
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Parameter
};tableauSoftware.Parameter = function tableauSoftware_Parameter(impl) {
this._impl = impl;
};
tableauSoftware.Parameter.prototype = {
_impl: null,
getName: function tableauSoftware_Parameter$getName() {
return this._impl.get__name();
},
getCurrentValue: function tableauSoftware_Parameter$getCurrentValue() {
return this._impl.get__currentValue();
},
getDataType: function tableauSoftware_Parameter$getDataType() {
return this._impl.get__dataType();
},
getAllowableValuesType: function tableauSoftware_Parameter$getAllowableValuesType() {
return this._impl.get__allowableValuesType();
},
getAllowableValues: function tableauSoftware_Parameter$getAllowableValues() {
return this._impl.get__allowableValues();
},
getMinValue: function tableauSoftware_Parameter$getMinValue() {
return this._impl.get__minValue();
},
getMaxValue: function tableauSoftware_Parameter$getMaxValue() {
return this._impl.get__maxValue();
},
getStepSize: function tableauSoftware_Parameter$getStepSize() {
return this._impl.get__stepSize();
},
getDateStepPeriod: function tableauSoftware_Parameter$getDateStepPeriod() {
return this._impl.get__dateStepPeriod();
}
////////////////////////////////////////////////////////////////////////////////
// tab.ParameterEvent
};tab.ParameterEvent = function tab_ParameterEvent(eventName, viz, parameterName) {
tab.ParameterEvent.initializeBase(this, [eventName, viz]);
this._context$1 = new tab._parameterEventContext(viz._impl.get__workbookImpl(), parameterName);
};
tab.ParameterEvent.prototype = {
_context$1: null,
getParameterName: function tab_ParameterEvent$getParameterName() {
return this._context$1.get__parameterName();
},
getParameterAsync: function tab_ParameterEvent$getParameterAsync() {
return this._context$1.get__workbookImpl()._getSingleParameterAsync(this._context$1.get__parameterName());
}
////////////////////////////////////////////////////////////////////////////////
// tab._parameterEventContext
};tab._parameterEventContext = function tab__parameterEventContext(workbookImpl, parameterName) {
tab._parameterEventContext.initializeBase(this, [workbookImpl, null]);
this._parameterName$1 = parameterName;
};
tab._parameterEventContext.prototype = {
_parameterName$1: null,
get__parameterName: function tab__parameterEventContext$get__parameterName() {
return this._parameterName$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Sheet
};tableauSoftware.Sheet = function tableauSoftware_Sheet(sheetImpl) {
tab._Param.verifyValue(sheetImpl, 'sheetImpl');
this._impl = sheetImpl;
};
tableauSoftware.Sheet.prototype = {
_impl: null,
getName: function tableauSoftware_Sheet$getName() {
return this._impl.get_name();
},
getIndex: function tableauSoftware_Sheet$getIndex() {
return this._impl.get_index();
},
getWorkbook: function tableauSoftware_Sheet$getWorkbook() {
return this._impl.get_workbookImpl().get_workbook();
},
getSize: function tableauSoftware_Sheet$getSize() {
return this._impl.get_size();
},
getIsHidden: function tableauSoftware_Sheet$getIsHidden() {
return this._impl.get_isHidden();
},
getIsActive: function tableauSoftware_Sheet$getIsActive() {
return this._impl.get_isActive();
},
getSheetType: function tableauSoftware_Sheet$getSheetType() {
return this._impl.get_sheetType();
},
getUrl: function tableauSoftware_Sheet$getUrl() {
return this._impl.get_url();
},
changeSizeAsync: function tableauSoftware_Sheet$changeSizeAsync(size) {
return this._impl.changeSizeAsync(size);
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.SheetInfo
};tableauSoftware.SheetInfo = function tableauSoftware_SheetInfo(impl) {
this._impl = impl;
};
tableauSoftware.SheetInfo.prototype = {
_impl: null,
getName: function tableauSoftware_SheetInfo$getName() {
return this._impl.name;
},
getSheetType: function tableauSoftware_SheetInfo$getSheetType() {
return this._impl.sheetType;
},
getSize: function tableauSoftware_SheetInfo$getSize() {
return this._impl.size;
},
getIndex: function tableauSoftware_SheetInfo$getIndex() {
return this._impl.index;
},
getUrl: function tableauSoftware_SheetInfo$getUrl() {
return this._impl.url;
},
getIsActive: function tableauSoftware_SheetInfo$getIsActive() {
return this._impl.isActive;
},
getIsHidden: function tableauSoftware_SheetInfo$getIsHidden() {
return this._impl.isHidden;
},
getWorkbook: function tableauSoftware_SheetInfo$getWorkbook() {
return this._impl.workbook;
}
////////////////////////////////////////////////////////////////////////////////
// tab.SheetSizeFactory
};tab.SheetSizeFactory = function tab_SheetSizeFactory() {};
tab.SheetSizeFactory.createAutomatic = function tab_SheetSizeFactory$createAutomatic() {
var size = tab.$create_SheetSize('automatic', null, null);
return size;
};
tab.SheetSizeFactory.fromSizeConstraints = function tab_SheetSizeFactory$fromSizeConstraints(vizSizePresModel) {
var minHeight = vizSizePresModel.minHeight;
var minWidth = vizSizePresModel.minWidth;
var maxHeight = vizSizePresModel.maxHeight;
var maxWidth = vizSizePresModel.maxWidth;
var behavior = 'automatic';
var minSize = null;
var maxSize = null;
if (!minHeight && !minWidth) {
if (!maxHeight && !maxWidth) {} else {
behavior = 'atmost';
maxSize = tab.$create_Size(maxWidth, maxHeight);
}
} else if (!maxHeight && !maxWidth) {
behavior = 'atleast';
minSize = tab.$create_Size(minWidth, minHeight);
} else if (maxHeight === minHeight && maxWidth === minWidth) {
behavior = 'exactly';
minSize = tab.$create_Size(minWidth, minHeight);
maxSize = tab.$create_Size(minWidth, minHeight);
} else {
behavior = 'range';
minSize = tab.$create_Size(minWidth, minHeight);
maxSize = tab.$create_Size(maxWidth, maxHeight);
}
return tab.$create_SheetSize(behavior, minSize, maxSize);
};
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Story
tableauSoftware.Story = function tableauSoftware_Story(storyImpl) {
tableauSoftware.Story.initializeBase(this, [storyImpl]);
};
tableauSoftware.Story.prototype = {
_impl: null,
getActiveStoryPoint: function tableauSoftware_Story$getActiveStoryPoint() {
return this._impl.get_activeStoryPointImpl().get_storyPoint();
},
getStoryPointsInfo: function tableauSoftware_Story$getStoryPointsInfo() {
return this._impl.get_storyPointsInfo();
},
activatePreviousStoryPointAsync: function tableauSoftware_Story$activatePreviousStoryPointAsync() {
return this._impl.activatePreviousStoryPointAsync();
},
activateNextStoryPointAsync: function tableauSoftware_Story$activateNextStoryPointAsync() {
return this._impl.activateNextStoryPointAsync();
},
activateStoryPointAsync: function tableauSoftware_Story$activateStoryPointAsync(index) {
return this._impl.activateStoryPointAsync(index);
},
revertStoryPointAsync: function tableauSoftware_Story$revertStoryPointAsync(index) {
return this._impl.revertStoryPointAsync(index);
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.StoryPoint
};tableauSoftware.StoryPoint = function tableauSoftware_StoryPoint(impl) {
this._impl = impl;
};
tableauSoftware.StoryPoint.prototype = {
_impl: null,
getCaption: function tableauSoftware_StoryPoint$getCaption() {
return this._impl.get_caption();
},
getContainedSheet: function tableauSoftware_StoryPoint$getContainedSheet() {
return ss.isValue(this._impl.get_containedSheetImpl()) ? this._impl.get_containedSheetImpl().get_sheet() : null;
},
getIndex: function tableauSoftware_StoryPoint$getIndex() {
return this._impl.get_index();
},
getIsActive: function tableauSoftware_StoryPoint$getIsActive() {
return this._impl.get_isActive();
},
getIsUpdated: function tableauSoftware_StoryPoint$getIsUpdated() {
return this._impl.get_isUpdated();
},
getParentStory: function tableauSoftware_StoryPoint$getParentStory() {
return this._impl.get_parentStoryImpl().get_story();
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.StoryPointInfo
};tableauSoftware.StoryPointInfo = function tableauSoftware_StoryPointInfo(impl) {
this._impl = impl;
};
tableauSoftware.StoryPointInfo.prototype = {
_impl: null,
getCaption: function tableauSoftware_StoryPointInfo$getCaption() {
return this._impl.caption;
},
getIndex: function tableauSoftware_StoryPointInfo$getIndex() {
return this._impl.index;
},
getIsActive: function tableauSoftware_StoryPointInfo$getIsActive() {
return this._impl.isActive;
},
getIsUpdated: function tableauSoftware_StoryPointInfo$getIsUpdated() {
return this._impl.isUpdated;
},
getParentStory: function tableauSoftware_StoryPointInfo$getParentStory() {
return this._impl.parentStoryImpl.get_story();
}
////////////////////////////////////////////////////////////////////////////////
// tab.StoryPointSwitchEvent
};tab.StoryPointSwitchEvent = function tab_StoryPointSwitchEvent(eventName, viz, oldStoryPointInfo, newStoryPoint) {
tab.StoryPointSwitchEvent.initializeBase(this, [eventName, viz]);
this._oldStoryPointInfo$1 = oldStoryPointInfo;
this._newStoryPoint$1 = newStoryPoint;
};
tab.StoryPointSwitchEvent.prototype = {
_oldStoryPointInfo$1: null,
_newStoryPoint$1: null,
getOldStoryPointInfo: function tab_StoryPointSwitchEvent$getOldStoryPointInfo() {
return this._oldStoryPointInfo$1;
},
getNewStoryPoint: function tab_StoryPointSwitchEvent$getNewStoryPoint() {
return this._newStoryPoint$1;
}
////////////////////////////////////////////////////////////////////////////////
// tab.TableauEvent
};tab.TableauEvent = function tab_TableauEvent(eventName, viz) {
this._viz = viz;
this._eventName = eventName;
};
tab.TableauEvent.prototype = {
_viz: null,
_eventName: null,
getViz: function tab_TableauEvent$getViz() {
return this._viz;
},
getEventName: function tab_TableauEvent$getEventName() {
return this._eventName;
}
////////////////////////////////////////////////////////////////////////////////
// tab.EventContext
};tab.EventContext = function tab_EventContext(workbookImpl, worksheetImpl) {
this._workbookImpl = workbookImpl;
this._worksheetImpl = worksheetImpl;
};
tab.EventContext.prototype = {
_workbookImpl: null,
_worksheetImpl: null,
get__workbookImpl: function tab_EventContext$get__workbookImpl() {
return this._workbookImpl;
},
get__worksheetImpl: function tab_EventContext$get__worksheetImpl() {
return this._worksheetImpl;
}
////////////////////////////////////////////////////////////////////////////////
// tab.TabSwitchEvent
};tab.TabSwitchEvent = function tab_TabSwitchEvent(eventName, viz, oldName, newName) {
tab.TabSwitchEvent.initializeBase(this, [eventName, viz]);
this._oldName$1 = oldName;
this._newName$1 = newName;
};
tab.TabSwitchEvent.prototype = {
_oldName$1: null,
_newName$1: null,
getOldSheetName: function tab_TabSwitchEvent$getOldSheetName() {
return this._oldName$1;
},
getNewSheetName: function tab_TabSwitchEvent$getNewSheetName() {
return this._newName$1;
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Viz
};tableauSoftware.Viz = function tableauSoftware_Viz(parentElement, url, options) {
var messageRouter = tab._ApiObjectRegistry.getCrossDomainMessageRouter();
this._impl = new tab.VizImpl(messageRouter, this, parentElement, url, options);
this._impl._create();
};
tableauSoftware.Viz.getLastRequestMessage = function tableauSoftware_Viz$getLastRequestMessage() {
return tab._ApiCommand.lastRequestMessage;
};
tableauSoftware.Viz.getLastResponseMessage = function tableauSoftware_Viz$getLastResponseMessage() {
return tab._ApiCommand.lastResponseMessage;
};
tableauSoftware.Viz.getLastClientInfoResponseMessage = function tableauSoftware_Viz$getLastClientInfoResponseMessage() {
return tab._ApiCommand.lastClientInfoResponseMessage;
};
tableauSoftware.Viz.prototype = {
_impl: null,
getAreTabsHidden: function tableauSoftware_Viz$getAreTabsHidden() {
return this._impl.get__areTabsHidden();
},
getIsToolbarHidden: function tableauSoftware_Viz$getIsToolbarHidden() {
return this._impl.get__isToolbarHidden();
},
getIsHidden: function tableauSoftware_Viz$getIsHidden() {
return this._impl.get__isHidden();
},
getInstanceId: function tableauSoftware_Viz$getInstanceId() {
return this._impl.get_instanceId();
},
getParentElement: function tableauSoftware_Viz$getParentElement() {
return this._impl.get__parentElement();
},
getUrl: function tableauSoftware_Viz$getUrl() {
return this._impl.get__url();
},
getVizSize: function tableauSoftware_Viz$getVizSize() {
return this._impl.get__vizSize();
},
getWorkbook: function tableauSoftware_Viz$getWorkbook() {
return this._impl.get__workbook();
},
getAreAutomaticUpdatesPaused: function tableauSoftware_Viz$getAreAutomaticUpdatesPaused() {
return this._impl.get__areAutomaticUpdatesPaused();
},
getCurrentUrlAsync: function tableauSoftware_Viz$getCurrentUrlAsync() {
return this._impl.getCurrentUrlAsync();
},
addEventListener: function tableauSoftware_Viz$addEventListener(eventName, handler) {
this._impl.addEventListener(eventName, handler);
},
removeEventListener: function tableauSoftware_Viz$removeEventListener(eventName, handler) {
this._impl.removeEventListener(eventName, handler);
},
dispose: function tableauSoftware_Viz$dispose() {
this._impl._dispose();
},
show: function tableauSoftware_Viz$show() {
this._impl._show();
},
hide: function tableauSoftware_Viz$hide() {
this._impl._hide();
},
showExportDataDialog: function tableauSoftware_Viz$showExportDataDialog(worksheetWithinDashboard) {
this._impl._showExportDataDialog(worksheetWithinDashboard);
},
showExportCrossTabDialog: function tableauSoftware_Viz$showExportCrossTabDialog(worksheetWithinDashboard) {
this._impl._showExportCrossTabDialog(worksheetWithinDashboard);
},
showExportImageDialog: function tableauSoftware_Viz$showExportImageDialog() {
this._impl._showExportImageDialog();
},
showExportPDFDialog: function tableauSoftware_Viz$showExportPDFDialog() {
this._impl._showExportPDFDialog();
},
revertAllAsync: function tableauSoftware_Viz$revertAllAsync() {
return this._impl._revertAllAsync();
},
refreshDataAsync: function tableauSoftware_Viz$refreshDataAsync() {
return this._impl._refreshDataAsync();
},
showShareDialog: function tableauSoftware_Viz$showShareDialog() {
this._impl._showShareDialog();
},
showDownloadWorkbookDialog: function tableauSoftware_Viz$showDownloadWorkbookDialog() {
this._impl._showDownloadWorkbookDialog();
},
pauseAutomaticUpdatesAsync: function tableauSoftware_Viz$pauseAutomaticUpdatesAsync() {
return this._impl._pauseAutomaticUpdatesAsync();
},
resumeAutomaticUpdatesAsync: function tableauSoftware_Viz$resumeAutomaticUpdatesAsync() {
return this._impl._resumeAutomaticUpdatesAsync();
},
toggleAutomaticUpdatesAsync: function tableauSoftware_Viz$toggleAutomaticUpdatesAsync() {
return this._impl._toggleAutomaticUpdatesAsync();
},
refreshSize: function tableauSoftware_Viz$refreshSize() {
this._impl._refreshSize();
},
setFrameSize: function tableauSoftware_Viz$setFrameSize(width, height) {
var widthString = width;
var heightString = height;
if (tab._Utility.isNumber(width)) {
widthString = width + 'px';
}
if (tab._Utility.isNumber(height)) {
heightString = height + 'px';
}
this._impl._setFrameSizeAndUpdate(widthString, heightString);
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.VizManager
};tableauSoftware.VizManager = function tableauSoftware_VizManager() {};
tableauSoftware.VizManager.getVizs = function tableauSoftware_VizManager$getVizs() {
return tab._VizManagerImpl.get__clonedVizs();
};
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Workbook
tableauSoftware.Workbook = function tableauSoftware_Workbook(workbookImpl) {
this._workbookImpl = workbookImpl;
};
tableauSoftware.Workbook.prototype = {
_workbookImpl: null,
getViz: function tableauSoftware_Workbook$getViz() {
return this._workbookImpl.get_viz();
},
getPublishedSheetsInfo: function tableauSoftware_Workbook$getPublishedSheetsInfo() {
return this._workbookImpl.get_publishedSheets()._toApiCollection();
},
getName: function tableauSoftware_Workbook$getName() {
return this._workbookImpl.get_name();
},
getActiveSheet: function tableauSoftware_Workbook$getActiveSheet() {
return this._workbookImpl.get_activeSheetImpl().get_sheet();
},
getActiveCustomView: function tableauSoftware_Workbook$getActiveCustomView() {
return this._workbookImpl.get_activeCustomView();
},
activateSheetAsync: function tableauSoftware_Workbook$activateSheetAsync(sheetNameOrIndex) {
return this._workbookImpl._setActiveSheetAsync(sheetNameOrIndex);
},
revertAllAsync: function tableauSoftware_Workbook$revertAllAsync() {
return this._workbookImpl._revertAllAsync();
},
getCustomViewsAsync: function tableauSoftware_Workbook$getCustomViewsAsync() {
return this._workbookImpl._getCustomViewsAsync();
},
showCustomViewAsync: function tableauSoftware_Workbook$showCustomViewAsync(customViewName) {
return this._workbookImpl._showCustomViewAsync(customViewName);
},
removeCustomViewAsync: function tableauSoftware_Workbook$removeCustomViewAsync(customViewName) {
return this._workbookImpl._removeCustomViewAsync(customViewName);
},
rememberCustomViewAsync: function tableauSoftware_Workbook$rememberCustomViewAsync(customViewName) {
return this._workbookImpl._rememberCustomViewAsync(customViewName);
},
setActiveCustomViewAsDefaultAsync: function tableauSoftware_Workbook$setActiveCustomViewAsDefaultAsync() {
return this._workbookImpl._setActiveCustomViewAsDefaultAsync();
},
getParametersAsync: function tableauSoftware_Workbook$getParametersAsync() {
return this._workbookImpl._getParametersAsync();
},
changeParameterValueAsync: function tableauSoftware_Workbook$changeParameterValueAsync(parameterName, value) {
return this._workbookImpl._changeParameterValueAsync(parameterName, value);
}
////////////////////////////////////////////////////////////////////////////////
// tableauSoftware.Worksheet
};tableauSoftware.Worksheet = function tableauSoftware_Worksheet(impl) {
tableauSoftware.Worksheet.initializeBase(this, [impl]);
};
tableauSoftware.Worksheet.prototype = {
_impl: null,
getParentDashboard: function tableauSoftware_Worksheet$getParentDashboard() {
return this._impl.get_parentDashboard();
},
getParentStoryPoint: function tableauSoftware_Worksheet$getParentStoryPoint() {
return this._impl.get_parentStoryPoint();
},
getDataSourcesAsync: function tableauSoftware_Worksheet$getDataSourcesAsync() {
return this._impl._getDataSourcesAsync();
},
getFilterAsync: function tableauSoftware_Worksheet$getFilterAsync(fieldName, options) {
return this._impl._getFilterAsync(null, fieldName, options);
},
getFiltersAsync: function tableauSoftware_Worksheet$getFiltersAsync(options) {
return this._impl._getFiltersAsync(options);
},
applyFilterAsync: function tableauSoftware_Worksheet$applyFilterAsync(fieldName, values, updateType, options) {
return this._impl._applyFilterAsync(fieldName, values, updateType, options);
},
clearFilterAsync: function tableauSoftware_Worksheet$clearFilterAsync(fieldName) {
return this._impl._clearFilterAsync(fieldName);
},
applyRangeFilterAsync: function tableauSoftware_Worksheet$applyRangeFilterAsync(fieldName, options) {
return this._impl._applyRangeFilterAsync(fieldName, options);
},
applyRelativeDateFilterAsync: function tableauSoftware_Worksheet$applyRelativeDateFilterAsync(fieldName, options) {
return this._impl._applyRelativeDateFilterAsync(fieldName, options);
},
applyHierarchicalFilterAsync: function tableauSoftware_Worksheet$applyHierarchicalFilterAsync(fieldName, values, updateType, options) {
return this._impl._applyHierarchicalFilterAsync(fieldName, values, updateType, options);
},
clearSelectedMarksAsync: function tableauSoftware_Worksheet$clearSelectedMarksAsync() {
return this._impl._clearSelectedMarksAsync();
},
selectMarksAsync: function tableauSoftware_Worksheet$selectMarksAsync(fieldNameOrFieldValuesMap, valueOrUpdateType, updateType) {
return this._impl._selectMarksAsync(fieldNameOrFieldValuesMap, valueOrUpdateType, updateType);
},
getSelectedMarksAsync: function tableauSoftware_Worksheet$getSelectedMarksAsync() {
return this._impl._getSelectedMarksAsync();
}
////////////////////////////////////////////////////////////////////////////////
// tab.WorksheetEvent
};tab.WorksheetEvent = function tab_WorksheetEvent(eventName, viz, worksheetImpl) {
tab.WorksheetEvent.initializeBase(this, [eventName, viz]);
this._worksheetImpl$1 = worksheetImpl;
};
tab.WorksheetEvent.prototype = {
_worksheetImpl$1: null,
getWorksheet: function tab_WorksheetEvent$getWorksheet() {
return this._worksheetImpl$1.get_worksheet();
}
////////////////////////////////////////////////////////////////////////////////
// tab._jQueryShim
};tab._jQueryShim = function tab__jQueryShim() {};
tab._jQueryShim.isFunction = function tab__jQueryShim$isFunction(obj) {
return tab._jQueryShim.type(obj) === 'function';
};
tab._jQueryShim.isArray = function tab__jQueryShim$isArray(obj) {
if (ss.isValue(Array.isArray)) {
return Array.isArray(obj);
}
return tab._jQueryShim.type(obj) === 'array';
};
tab._jQueryShim.type = function tab__jQueryShim$type(obj) {
return obj == null ? String(obj) : tab._jQueryShim._class2type[tab._jQueryShim._toString.call(obj)] || 'object';
};
tab._jQueryShim.trim = function tab__jQueryShim$trim(text) {
if (ss.isValue(tab._jQueryShim._trim)) {
return text == null ? '' : tab._jQueryShim._trim.call(text);
}
return text == null ? '' : text.replace(tab._jQueryShim._trimLeft, '').replace(tab._jQueryShim._trimRight, '');
};
tab._jQueryShim.parseJSON = function tab__jQueryShim$parseJSON(data) {
if (typeof data !== 'string' || ss.isNullOrUndefined(data)) {
return null;
}
data = tab._jQueryShim.trim(data);
if (window.JSON && window.JSON.parse) {
return window.JSON.parse(data);
}
if (tab._jQueryShim._rvalidchars.test(data.replace(tab._jQueryShim._rvalidescape, '@').replace(tab._jQueryShim._rvalidtokens, ']').replace(tab._jQueryShim._rvalidbraces, ''))) {
return new Function("return " + data)();
}
throw new Error('Invalid JSON: ' + data);
};
tab._ApiCommand.registerClass('tab._ApiCommand');
tab._ApiServerResultParser.registerClass('tab._ApiServerResultParser');
tab._ApiServerNotification.registerClass('tab._ApiServerNotification');
tab._CommandReturnHandler.registerClass('tab._CommandReturnHandler');
tab._crossDomainMessageRouter.registerClass('tab._crossDomainMessageRouter', null, tab.ICrossDomainMessageRouter);
tab._doNothingCrossDomainHandler.registerClass('tab._doNothingCrossDomainHandler', null, tab.ICrossDomainMessageHandler);
tab.CrossDomainMessagingOptions.registerClass('tab.CrossDomainMessagingOptions');
tab._enums.registerClass('tab._enums');
tab._ApiBootstrap.registerClass('tab._ApiBootstrap');
tab._ApiObjectRegistry.registerClass('tab._ApiObjectRegistry');
tab._CustomViewImpl.registerClass('tab._CustomViewImpl');
tab._SheetImpl.registerClass('tab._SheetImpl');
tab._DashboardImpl.registerClass('tab._DashboardImpl', tab._SheetImpl);
tab._DataSourceImpl.registerClass('tab._DataSourceImpl');
tab._deferredUtil.registerClass('tab._deferredUtil');
tab._CollectionImpl.registerClass('tab._CollectionImpl');
tab._DeferredImpl.registerClass('tab._DeferredImpl');
tab._PromiseImpl.registerClass('tab._PromiseImpl');
tab._markImpl.registerClass('tab._markImpl');
tab._Param.registerClass('tab._Param');
tab._parameterImpl.registerClass('tab._parameterImpl');
tab._StoryImpl.registerClass('tab._StoryImpl', tab._SheetImpl);
tab._StoryPointImpl.registerClass('tab._StoryPointImpl');
tab.StoryPointInfoImplUtil.registerClass('tab.StoryPointInfoImplUtil');
tab._TableauException.registerClass('tab._TableauException');
tab._Utility.registerClass('tab._Utility');
tab.VizImpl.registerClass('tab.VizImpl', null, tab.ICrossDomainMessageHandler);
tab._VizManagerImpl.registerClass('tab._VizManagerImpl');
tab._VizParameters.registerClass('tab._VizParameters');
tab._WorkbookImpl.registerClass('tab._WorkbookImpl');
tab._WorksheetImpl.registerClass('tab._WorksheetImpl', tab._SheetImpl);
tab.JsonUtil.registerClass('tab.JsonUtil');
tableauSoftware.CustomView.registerClass('tableauSoftware.CustomView');
tab.TableauEvent.registerClass('tab.TableauEvent');
tab.CustomViewEvent.registerClass('tab.CustomViewEvent', tab.TableauEvent);
tab.EventContext.registerClass('tab.EventContext');
tab._customViewEventContext.registerClass('tab._customViewEventContext', tab.EventContext);
tableauSoftware.Sheet.registerClass('tableauSoftware.Sheet');
tableauSoftware.Dashboard.registerClass('tableauSoftware.Dashboard', tableauSoftware.Sheet);
tableauSoftware.DashboardObject.registerClass('tableauSoftware.DashboardObject');
tableauSoftware.DataSource.registerClass('tableauSoftware.DataSource');
tableauSoftware.Field.registerClass('tableauSoftware.Field');
tableauSoftware.Filter.registerClass('tableauSoftware.Filter');
tableauSoftware.CategoricalFilter.registerClass('tableauSoftware.CategoricalFilter', tableauSoftware.Filter);
tab.WorksheetEvent.registerClass('tab.WorksheetEvent', tab.TableauEvent);
tab.FilterEvent.registerClass('tab.FilterEvent', tab.WorksheetEvent);
tab._filterEventContext.registerClass('tab._filterEventContext', tab.EventContext);
tableauSoftware.HierarchicalFilter.registerClass('tableauSoftware.HierarchicalFilter', tableauSoftware.Filter);
tableauSoftware.QuantitativeFilter.registerClass('tableauSoftware.QuantitativeFilter', tableauSoftware.Filter);
tableauSoftware.RelativeDateFilter.registerClass('tableauSoftware.RelativeDateFilter', tableauSoftware.Filter);
tab.FirstVizSizeKnownEvent.registerClass('tab.FirstVizSizeKnownEvent', tab.TableauEvent);
tableauSoftware.Version.registerClass('tableauSoftware.Version');
tab.VizResizeEvent.registerClass('tab.VizResizeEvent', tab.TableauEvent);
tableauSoftware.Mark.registerClass('tableauSoftware.Mark');
tab.MarksEvent.registerClass('tab.MarksEvent', tab.WorksheetEvent);
tab._marksEventContext.registerClass('tab._marksEventContext', tab.EventContext);
tableauSoftware.Pair.registerClass('tableauSoftware.Pair');
tableauSoftware.Parameter.registerClass('tableauSoftware.Parameter');
tab.ParameterEvent.registerClass('tab.ParameterEvent', tab.TableauEvent);
tab._parameterEventContext.registerClass('tab._parameterEventContext', tab.EventContext);
tableauSoftware.SheetInfo.registerClass('tableauSoftware.SheetInfo');
tab.SheetSizeFactory.registerClass('tab.SheetSizeFactory');
tableauSoftware.Story.registerClass('tableauSoftware.Story', tableauSoftware.Sheet);
tableauSoftware.StoryPoint.registerClass('tableauSoftware.StoryPoint');
tableauSoftware.StoryPointInfo.registerClass('tableauSoftware.StoryPointInfo');
tab.StoryPointSwitchEvent.registerClass('tab.StoryPointSwitchEvent', tab.TableauEvent);
tab.TabSwitchEvent.registerClass('tab.TabSwitchEvent', tab.TableauEvent);
tableauSoftware.Viz.registerClass('tableauSoftware.Viz');
tableauSoftware.VizManager.registerClass('tableauSoftware.VizManager');
tableauSoftware.Workbook.registerClass('tableauSoftware.Workbook');
tableauSoftware.Worksheet.registerClass('tableauSoftware.Worksheet', tableauSoftware.Sheet);
tab._jQueryShim.registerClass('tab._jQueryShim');
tab._ApiCommand.crossDomainEventNotificationId = 'xdomainSourceId';
tab._ApiCommand.lastRequestMessage = null;
tab._ApiCommand.lastResponseMessage = null;
tab._ApiCommand.lastClientInfoResponseMessage = null;
tab._ApiObjectRegistry._creationRegistry = null;
tab._ApiObjectRegistry._singletonInstanceRegistry = null;
tab._SheetImpl.noZoneId = 4294967295;
tab._VizManagerImpl._vizs = [];
tab._WorksheetImpl._regexHierarchicalFieldName$1 = new RegExp('\\[[^\\]]+\\]\\.', 'g');
tableauSoftware.Version._currentVersion = new tableauSoftware.Version(2, 0, 0, null);
tab._jQueryShim._class2type = { '[object Boolean]': 'boolean', '[object Number]': 'number', '[object String]': 'string', '[object Function]': 'function', '[object Array]': 'array', '[object Date]': 'date', '[object RegExp]': 'regexp', '[object Object]': 'object' };
tab._jQueryShim._trim = String.prototype.trim;
tab._jQueryShim._toString = Object.prototype.toString;
tab._jQueryShim._trimLeft = new RegExp('^[\\s\\xA0]+');
tab._jQueryShim._trimRight = new RegExp('[\\s\\xA0]+$');
tab._jQueryShim._rvalidchars = new RegExp('^[\\],:{}\\s]*$');
tab._jQueryShim._rvalidescape = new RegExp('\\\\(?:["\\\\\\/bfnrt]|u[0-9a-fA-F]{4})', 'g');
tab._jQueryShim._rvalidtokens = new RegExp('"[^"\\\\\\n\\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?', 'g');
tab._jQueryShim._rvalidbraces = new RegExp('(?:^|:|,)(?:\\s*\\[)+', 'g');
tableauSoftware.Promise = tab._PromiseImpl;
tab._Deferred = tab._DeferredImpl;
tab._Collection = tab._CollectionImpl;
////////////////////////////////////////////////////////////////////////////////
// Enums
////////////////////////////////////////////////////////////////////////////////
tableauSoftware.DashboardObjectType = {
BLANK: 'blank',
WORKSHEET: 'worksheet',
QUICK_FILTER: 'quickFilter',
PARAMETER_CONTROL: 'parameterControl',
PAGE_FILTER: 'pageFilter',
LEGEND: 'legend',
TITLE: 'title',
TEXT: 'text',
IMAGE: 'image',
WEB_PAGE: 'webPage'
};
tableauSoftware.FilterType = {
CATEGORICAL: 'categorical',
QUANTITATIVE: 'quantitative',
HIERARCHICAL: 'hierarchical',
RELATIVEDATE: 'relativedate'
};
tableauSoftware.ParameterDataType = {
FLOAT: 'float',
INTEGER: 'integer',
STRING: 'string',
BOOLEAN: 'boolean',
DATE: 'date',
DATETIME: 'datetime'
};
tableauSoftware.ParameterAllowableValuesType = {
ALL: 'all',
LIST: 'list',
RANGE: 'range'
};
tableauSoftware.PeriodType = {
YEAR: 'year',
QUARTER: 'quarter',
MONTH: 'month',
WEEK: 'week',
DAY: 'day',
HOUR: 'hour',
MINUTE: 'minute',
SECOND: 'second'
};
tableauSoftware.DateRangeType = {
LAST: 'last',
LASTN: 'lastn',
NEXT: 'next',
NEXTN: 'nextn',
CURR: 'curr',
TODATE: 'todate'
};
tableauSoftware.SheetSizeBehavior = {
AUTOMATIC: 'automatic',
EXACTLY: 'exactly',
RANGE: 'range',
ATLEAST: 'atleast',
ATMOST: 'atmost'
};
tableauSoftware.SheetType = {
WORKSHEET: 'worksheet',
DASHBOARD: 'dashboard',
STORY: 'story'
};
tableauSoftware.FilterUpdateType = {
ALL: 'all',
REPLACE: 'replace',
ADD: 'add',
REMOVE: 'remove'
};
tableauSoftware.SelectionUpdateType = {
REPLACE: 'replace',
ADD: 'add',
REMOVE: 'remove'
};
tableauSoftware.NullOption = {
NULL_VALUES: 'nullValues',
NON_NULL_VALUES: 'nonNullValues',
ALL_VALUES: 'allValues'
};
tableauSoftware.ErrorCode = {
INTERNAL_ERROR: 'internalError',
SERVER_ERROR: 'serverError',
INVALID_AGGREGATION_FIELD_NAME: 'invalidAggregationFieldName',
INVALID_PARAMETER: 'invalidParameter',
INVALID_URL: 'invalidUrl',
STALE_DATA_REFERENCE: 'staleDataReference',
VIZ_ALREADY_IN_MANAGER: 'vizAlreadyInManager',
NO_URL_OR_PARENT_ELEMENT_NOT_FOUND: 'noUrlOrParentElementNotFound',
INVALID_FILTER_FIELDNAME: 'invalidFilterFieldName',
INVALID_FILTER_FIELDVALUE: 'invalidFilterFieldValue',
INVALID_FILTER_FIELDNAME_OR_VALUE: 'invalidFilterFieldNameOrValue',
FILTER_CANNOT_BE_PERFORMED: 'filterCannotBePerformed',
NOT_ACTIVE_SHEET: 'notActiveSheet',
INVALID_CUSTOM_VIEW_NAME: 'invalidCustomViewName',
MISSING_RANGEN_FOR_RELATIVE_DATE_FILTERS: 'missingRangeNForRelativeDateFilters',
MISSING_MAX_SIZE: 'missingMaxSize',
MISSING_MIN_SIZE: 'missingMinSize',
MISSING_MINMAX_SIZE: 'missingMinMaxSize',
INVALID_SIZE: 'invalidSize',
INVALID_SIZE_BEHAVIOR_ON_WORKSHEET: 'invalidSizeBehaviorOnWorksheet',
SHEET_NOT_IN_WORKBOOK: 'sheetNotInWorkbook',
INDEX_OUT_OF_RANGE: 'indexOutOfRange',
DOWNLOAD_WORKBOOK_NOT_ALLOWED: 'downloadWorkbookNotAllowed',
NULL_OR_EMPTY_PARAMETER: 'nullOrEmptyParameter',
BROWSER_NOT_CAPABLE: 'browserNotCapable',
UNSUPPORTED_EVENT_NAME: 'unsupportedEventName',
INVALID_DATE_PARAMETER: 'invalidDateParameter',
INVALID_SELECTION_FIELDNAME: 'invalidSelectionFieldName',
INVALID_SELECTION_VALUE: 'invalidSelectionValue',
INVALID_SELECTION_DATE: 'invalidSelectionDate',
NO_URL_FOR_HIDDEN_WORKSHEET: 'noUrlForHiddenWorksheet',
MAX_VIZ_RESIZE_ATTEMPTS: 'maxVizResizeAttempts'
};
tableauSoftware.TableauEventName = {
CUSTOM_VIEW_LOAD: 'customviewload',
CUSTOM_VIEW_REMOVE: 'customviewremove',
CUSTOM_VIEW_SAVE: 'customviewsave',
CUSTOM_VIEW_SET_DEFAULT: 'customviewsetdefault',
FILTER_CHANGE: 'filterchange',
FIRST_INTERACTIVE: 'firstinteractive',
FIRST_VIZ_SIZE_KNOWN: 'firstvizsizeknown',
MARKS_SELECTION: 'marksselection',
PARAMETER_VALUE_CHANGE: 'parametervaluechange',
STORY_POINT_SWITCH: 'storypointswitch',
TAB_SWITCH: 'tabswitch',
VIZ_RESIZE: 'vizresize'
};
tableauSoftware.FieldRoleType = {
DIMENSION: 'dimension',
MEASURE: 'measure',
UNKNOWN: 'unknown'
};
tableauSoftware.FieldAggregationType = {
SUM: 'SUM',
AVG: 'AVG',
MIN: 'MIN',
MAX: 'MAX',
STDEV: 'STDEV',
STDEVP: 'STDEVP',
VAR: 'VAR',
VARP: 'VARP',
COUNT: 'COUNT',
COUNTD: 'COUNTD',
MEDIAN: 'MEDIAN',
ATTR: 'ATTR',
NONE: 'NONE',
PERCENTILE: 'PERCENTILE',
YEAR: 'YEAR',
QTR: 'QTR',
MONTH: 'MONTH',
DAY: 'DAY',
HOUR: 'HOUR',
MINUTE: 'MINUTE',
SECOND: 'SECOND',
WEEK: 'WEEK',
WEEKDAY: 'WEEKDAY',
MONTHYEAR: 'MONTHYEAR',
MDY: 'MDY',
END: 'END',
TRUNC_YEAR: 'TRUNC_YEAR',
TRUNC_QTR: 'TRUNC_QTR',
TRUNC_MONTH: 'TRUNC_MONTH',
TRUNC_WEEK: 'TRUNC_WEEK',
TRUNC_DAY: 'TRUNC_DAY',
TRUNC_HOUR: 'TRUNC_HOUR',
TRUNC_MINUTE: 'TRUNC_MINUTE',
TRUNC_SECOND: 'TRUNC_SECOND',
QUART1: 'QUART1',
QUART3: 'QUART3',
SKEWNESS: 'SKEWNESS',
KURTOSIS: 'KURTOSIS',
INOUT: 'INOUT',
SUM_XSQR: 'SUM_XSQR',
USER: 'USER'
};
tableauSoftware.ToolbarPosition = {
TOP: 'top',
BOTTOM: 'bottom'
};
////////////////////////////////////////////////////////////////////////////////
// API Initialization
////////////////////////////////////////////////////////////////////////////////
// Clean up the mscorlib stuff.
restoreTypeSystem();
tab._ApiBootstrap.initialize();
})();
module.exports = tableauSoftware;
/***/ })
/******/ ]);
|
/* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
APP: {
defaultLocale: 'en'
// Here you can pass flags/options to your application instance
// when it is created
}
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
if (environment === 'production') {
}
return ENV;
};
|
var sys = require('sys');
var fs = require( 'fs' );
function writeFile(filename, text) {
var file = fs.openSync( filename, 'w' );
fs.writeSync( file, text );
fs.closeSync( file );
}
function elapsed(startTime, endTime) {
return (endTime - startTime)/1000;
}
function ISODateString(d) {
function pad(n) { return n < 10 ? '0'+n : n; }
return d.getFullYear() + '-'
+ pad(d.getMonth()+1) +'-'
+ pad(d.getDate()) + 'T'
+ pad(d.getHours()) + ':'
+ pad(d.getMinutes()) + ':'
+ pad(d.getSeconds());
}
/**
* Generates JUnit XML for the given spec run.
* Allows the test results to be used in java based CI
* systems like CruiseControl and Hudson.
*/
var JUnitXmlReporter = function(savePath) {
this.savePath = savePath || fs.realpathSync( __dirname + '/../../../reports/' );
};
JUnitXmlReporter.prototype = {
reportRunnerResults: function(runner) {
this.log("Runner Finished.");
},
reportRunnerStarting: function(runner) {
this.log("Runner Started.");
},
reportSpecResults: function(spec) {
var resultText = "Failed.";
if (spec.results().passed()) {
resultText = "Passed.";
}
spec.endTime = new Date();
this.log(resultText);
},
reportSpecStarting: function(spec) {
spec.startTime = new Date();
if (! spec.suite.startTime) {
spec.suite.startTime = new Date();
}
this.log(spec.suite.description + ' : ' + spec.description + ' ... ');
},
reportSuiteResults: function(suite) {
var output = [],
fileName = 'TEST-' + suite.description.replace(/\s/g, '') + '.xml',
results = suite.results(),
items = results.getItems(),
item,
spec,
expectedResults,
trace,
i,
j;
suite.endTime = new Date();
output.push('<?xml version="1.0" encoding="UTF-8" ?>');
output.push('<testsuite name="' + suite.description + '" errors="0" failures="'
+ results.failedCount + '" tests="' + results.totalCount + '" time="'
+ elapsed(suite.startTime, suite.endTime) + '" timestamp="' + ISODateString(suite.startTime) + '">');
for (i = 0; i < items.length; i++) {
item = items[i];
spec = suite.specs()[i];
output.push(' <testcase classname="' + suite.description + '" name="'
+ item.description + '" time="' + elapsed(spec.startTime, spec.endTime) + '">');
if (!item.passed()) {
expectedResults = item.getItems();
for (j = 0; j < expectedResults.length; j++) {
trace = expectedResults[j].trace;
if (trace instanceof Error) {
output.push('<failure>' + trace.message + '</failure>');
break;
}
}
}
output.push('</testcase>');
}
output.push('</testsuite>');
writeFile(this.savePath + '/' + fileName, output.join(''));
this.log(suite.description + ": " + results.passedCount + " of " + results.totalCount + " passed.");
},
log: function(str) {
var console = jasmine.getGlobal().console;
if (console && console.log) {
console.log(str);
}
}
};
exports.Reporter = new JUnitXmlReporter();
|
"use strict";
ace.define("ace/snippets/haxe", ["require", "exports", "module"], function (e, t, n) {
"use strict";
t.snippetText = undefined, t.scope = "haxe";
});
|
import VueRouter from 'vue-router';
import Home from '@/components/Home';
import Search from '@/components/Search/Search';
import About from '@/components/About';
import Login from '@/components/Login';
import NotFound from '@/components/NotFound';
const routes = [
{
path: '/',
component: Home
},
{
path: '/search',
component: Search
},
{
path: '/about',
component: About
},
{
path: '/login',
component: Login
},
{
path: '*',
component: NotFound
}
];
// export default routes;
const router = new VueRouter({
routes,
mode: 'history',
linkActiveClass: 'active'
});
export default router;
|
import React from 'react'
import BrandGallery from '../components/BrandGallery'
export default () => (
<BrandGallery brand='Kandinsky' />
)
|
/**
* (c) 2013, Cybozu.
*/
goog.provide('nhiro.assert');
goog.scope(function() {
/**
* @param {boolean} condition .
* @param {string=} opt_message .
* @param {boolean=} use_alert .
*/
nhiro.assert = function(condition, opt_message, use_alert) {
if (!condition) {
_._show(opt_message, use_alert);
// breakpoint
if (nhiro.assert.to_break) debugger;
}
};
var _ = nhiro.assert;
_.assert = nhiro.assert;
/**
* @suppress {checkTypes}
* @param {string=} opt_message .
* @param {boolean=} use_alert .
*/
_._show = function(opt_message, use_alert) {
if (window.console) {
// show message
window.console.log('Assertion Failure');
if (opt_message) {
window.console.log('Message: ' + opt_message);
if (use_alert) {
window.alert(opt_message);
}
}
// show stacktrace
if (window.console.trace) window.console.trace();
if (Error().stack) window.console.log(Error().stack);
}
};
/**
* When true, enter into debugger mode on assertion error.
*/
_.to_break = true;
/**
* @param {string=} opt_message message.
*/
nhiro.assert.not_here = function(opt_message) {
_._show(opt_message);
// breakpoint
if (nhiro.assert.to_break) debugger;
};
});
|
const Client = require('elasticsearch').Client;
const Async = require('async');
const config = require('../../config');
const elastic = new Client(config.elasticsearch);
const getElasticDocument = require('./get-elastic-document');
const Fs = require('fs');
const Path = require('path');
const dirData = Path.join(__dirname, 'elastic-responses');
const copyEsDocs = require('./copy-es-docs');
const copyEsSearches = require('./copy-es-searches');
const copyEsrelated = require('./copy-es-related');
const copyEsChildren = require('./copy-es-children');
const copyEsAutocompletes = require('./copy-es-autocompletes');
const search = require('../../lib/search');
const createQueryParams = require('../../lib/query-params/query-params');
Async.parallel([
/**
* Create files for transforms tests
*/
(cb) => {
Async.each([
{ id: 'cp50417', type: 'agent', filename: 'example-get-response-death' },
{ id: 'aa110000003', type: 'archive', filename: 'example-get-response-document' },
{ id: 'aa110014918', type: 'archive', filename: 'example-get-response-document2' },
{ id: 'co8245103', type: 'object', filename: 'example-get-response-object' },
{ id: 'co205752', type: 'object', filename: 'example-get-response-object2' },
{ id: 'co8447906', type: 'object', filename: 'example-get-response-object3' },
{ id: 'co503422', type: 'object', filename: 'example-get-response-object4' },
{ id: 'cp5207', type: 'agent', filename: 'example-get-response-organisation' },
{ id: 'cp36993', type: 'agent', filename: 'example-get-response-person' },
{ id: 'cp86306', type: 'agent', filename: 'example-get-response-with-places' }
], (data, cb) => {
getElasticDocument(elastic, data.type, data.id, (err, response) => {
if (err) {
console.log('Error Elastic', data.id);
return cb(err);
}
Fs.writeFile(`${dirData}/${data.filename}.json`, JSON.stringify(response, null, 2), 'utf-8', cb);
});
}, cb);
},
/**
* Create mock elasticsaerch database for get and search tests
*/
(cb) => {
const dataToCopy = [
{ type: 'archive', id: 'aa110000316' },
{ type: 'archive', id: 'aawrongid' },
{ type: 'archive', id: 'aa110069402' },
{ type: 'archive', id: 'aa110000003' },
{ type: 'archive', id: 'aa110066453' },
{ type: 'object', id: 'co37959' },
{ type: 'object', id: 'cowrongid' },
{ type: 'object', id: 'co67812' },
{ type: 'object', id: 'co520148' },
{ type: 'object', id: 'co8229027' },
{ type: 'object', id: 'co114820' },
{ type: 'agent', id: 'cp17351' },
{ type: 'agent', id: 'cp36993' },
{ type: 'agent', id: 'cpwrongid' },
{ type: 'agent', id: 'ap24329' }
];
const searchToCopy = [
{ q: 'babbage', params: { type: 'documents' } },
{ q: 'test', params: {} },
{ q: 'test people', params: { type: 'people' } },
{ q: 'test objects', params: { type: 'objects' } },
{ q: 'test documents', params: { type: 'documents' } },
{ q: 'ada', params: {} },
{ q: 'rocket', params: { type: 'objects' } },
{ q: 'ada objects', params: { type: 'objects' } },
{ q: '2016-5008/49', params: { type: 'objects' } },
{ q: 'ada people', params: { type: 'people' } },
{ q: 'Lumière', params: { type: 'people' } },
{ q: 'Lumière filmmaker', queryParams: { 'filter[occupation]': 'filmmaker' }, params: { type: 'people' } },
{ q: 'hawking painting', params: {} },
{ q: 'all', params: {} },
{ q: 'plumed hat', params: { type: 'objects' } }
];
const related = [
{ id: 'cp36993' },
{ id: 'cp17351' },
{ id: 'cp2735' }
];
const children = [
{ id: 'aa110000003' },
{ id: 'aa110000316' },
{ id: 'aa110000036' },
{ id: 'aa110066453' },
{ id: 'aa110000009' }
];
const autocompletes = [
{ q: 'babb' }
];
const database = {};
Async.parallel([
(cb) => copyEsDocs(elastic, dataToCopy, database, cb),
(cb) => copyEsSearches(elastic, searchToCopy, database, cb),
(cb) => copyEsrelated(elastic, related, database, cb),
(cb) => copyEsChildren(elastic, children, database, cb),
(cb) => copyEsAutocompletes(elastic, autocompletes, database, cb)
], (err) => {
if (err) {
throw err;
}
Fs.writeFile(dirData + '/database.json', JSON.stringify(database, null, 2), 'utf-8', cb);
});
},
// Aggregations
async () => {
try {
const response = await search(elastic, createQueryParams('html', { query: { q: 'test' }, params: {} }));
Fs.writeFile(dirData + '/../../helpers/aggregations-all.json',
JSON.stringify(response.aggregations.all, null, 2),
'utf-8',
(err) => {
if (err) throw err;
console.log('The file has been saved!');
});
} catch (err) { throw err; }
}
], (err) => {
if (err) throw err;
});
|
define(function (require, exports, module) {
'use strict';
var Widget = require('widget');
require('http://ue2.17173cdn.com/cache/lib/v2/ue/opinion/article-tags.min.js');
var Viewpoint = Widget.extend({
defaults: {
articleTitle : '',
articleUrl : ''
},
setup: function () {
var localUrl = window.location.protocol + '//' + window.location.hostname + (!!window.location.port ? ':' + window.location.port : '') + window.location.pathname;
var url = this.option('articleUrl') || localUrl,
title = this.option('articleTitle');
new window.ArticleTagsLoader({
ct: '.article-tags-content',
channel: window.article.infoChannel,
newsId: window.article.infoWholeId,
newsTitle: title,
newsUrl: url
});
}
});
module.exports = Viewpoint;
});
|
'use strict';
angular.module('doggerApp', [
'ngRoute',
'ngResource',
'ui.bootstrap',
'ngAnimate',
'angular-growl',
// All templates are compiled in this module
'templates',
// App Modules
'doggerApp.factories',
'doggerApp.filters',
'doggerApp.services',
'doggerApp.directives',
'doggerApp.controllers'
]);
angular.module('doggerApp.controllers', []);
angular.module('doggerApp.directives', []);
angular.module('doggerApp.services', []);
angular.module('doggerApp.filters', []);
angular.module('doggerApp.factories', []);
// Config Routes
angular.module('doggerApp')
.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
})
.when('/about', {
templateUrl: 'views/about.html'
})
.otherwise({ redirectTo: '/' });
// Set HTML5 mode
$locationProvider.html5Mode(true);
}]);
|
(function() {
'use strict';
angular
.module('routes', [])
.config(config);
config.$inject = ['$routeProvider', '$locationProvider'];
function config($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
controller: 'HomeController',
templateUrl: 'home/home.view.html',
controllerAs: 'vm'
})
.when('/login', {
controller: 'LoginController',
templateUrl: 'login/login.view.html',
controllerAs: 'vm'
})
.when('/register', {
controller: 'RegisterController',
templateUrl: 'register/register.view.html',
controllerAs: 'vm'
})
.when('/accounts', {
controller: 'AccountsController',
templateUrl: 'accounts/accounts.view.html',
controllerAs: 'vm'
})
.when('/account/:account_id', {
controller: 'AccountController',
templateUrl: 'account/account.view.html',
controllerAs: 'vm'
})
.otherwise({redirectTo: '/login'});
$locationProvider.html5Mode(true);
};
})();
|
CREATE (b:Business {
yelp_id: {bus.id},
name: {bus.name},
phone: {bus.phone},
display_phone: {bus.display_phone},
image_url: {bus.image_url},
street: {bus.location.cross_streets},
address: [bus.location.address],
city: {bus.location.city},
postal_code: {bus.location.postal_code},
country_code: {bus.location.country_code},
state_code: {bus.location.state_code}
}),
(menu:Menu { score:4.82 , name:{bus.name}}),
(i:Item {name: {bus.name}, rating: {bus.rating}, review_count: {bus.review_count}, likes: 10,
top_image_url: {bus.image_url}
}),
(rev:Review {
review_text: {bus.snippet_text},
down: 5,
up: {bus.review_count}
}),
(p:Photo {
image_url: {bus.image_url},
likes: {bus.review_count},
is_top: true
}),
(b)-[:HAS_MENU]->(menu),
(menu)-[:BELONGS_TO]->(b),
(menu)-[:HAS_ITEM]->(I),
(i)-[:FROM_MENU]->(menu),
(i)-[:HAS_PHOTO]->(p),
(i)-[:HAS_REVIEW]->(rev),
(rev)-[:OF_ITEM]->(i),
(rev)-[:HAS_PHOTO]->(p),
(p)-[:FROM_REVIEW]->(rev),
(p)-[:OF_ITEM]->(i),
match (u:User {name: "Joel Cox"}),
(p)-[:BY]->(u),
(u)-[:TOOK_PHOTO]->(p),
(u)-[:MADE_REVIEW]->(rev),
(u)-[:HAS_COLLECTED]->(i)
RETURN u,i,rev,p,menu
//
// { is_claimed: false,
// rating: 2,
// mobile_url: 'http://m.yelp.com/biz/fish-and-chips-and-chicken-stop-and-soul-food-oakland',
// rating_img_url: 'http://s3-media2.fl.yelpcdn.com/assets/2/www/img/b561c24f8341/ico/stars/v1/stars_2.png',
// review_count: 1,
// name: 'Fish & Chips & Chicken Stop & Soul Food',
// snippet_image_url: 'http://s3-media2.fl.yelpcdn.com/photo/Tx8oXPMPyGdIqq20HRbKxA/ms.jpg',
// rating_img_url_small: 'http://s3-media2.fl.yelpcdn.com/assets/2/www/img/a6210baec261/ico/stars/v1/stars_small_2.png',
// url: 'http://www.yelp.com/biz/fish-and-chips-and-chicken-stop-and-soul-food-oakland',
// phone: '5109695267',
// snippet_text: 'i received a pm from the new owner stating he had taken over and they\'ve added soul food. the place looks the same and a very young cashier (son) is...',
// image_url: 'http://s3-media3.fl.yelpcdn.com/bphoto/uRQq39Hzd83MvUuXlRD3sw/ms.jpg',
// categories:
// [ [ 'Cajun/Creole', 'cajun' ],
// [ 'Soul Food', 'soulfood' ],
// [ 'Fish & Chips', 'fishnchips' ] ],
// display_phone: '+1-510-969-5267',
// rating_img_url_large: 'http://s3-media4.fl.yelpcdn.com/assets/2/www/img/c00926ee5dcb/ico/stars/v1/stars_large_2.png',
// id: 'fish-and-chips-and-chicken-stop-and-soul-food-oakland',
// is_closed: false,
// location:
// { cross_streets: '89th Ave & 90th Ave',
// city: 'Oakland',
// display_address: [ '8929 MacArthur Blvd', 'East Oakland', 'Oakland, CA 94605' ],
// neighborhoods: [ 'East Oakland' ],
// postal_code: '94605',
// country_code: 'US',
// address: [ '8929 MacArthur Blvd' ],
// state_code: 'CA' } }
//
// // mobile_url: 'http://m.yelp.com/biz/fish-and-chips-and-chicken-stop-and-soul-food-oakland',
// // rating_img_url: 'http://s3-media2.fl.yelpcdn.com/assets/2/www/img/b561c24f8341/ico/stars/v1/stars_2.png',
// CREATE (u:User {name: "Joel Cox"}),
// (b:Business {
// yelp_id: 'fish-and-chips-and-chicken-stop-and-soul-food-oakland',
// name: 'Fish & Chips & Chicken Stop & Soul Food',
// phone: '5109695267',
// display_phone: '+1-510-969-5267',
// image_url: 'http://s3-media3.fl.yelpcdn.com/bphoto/uRQq39Hzd83MvUuXlRD3sw/ms.jpg',
// categories:
// [ [ 'Cajun/Creole', 'cajun' ],
// [ 'Soul Food', 'soulfood' ],
// [ 'Fish & Chips', 'fishnchips' ] ],
// location:
// { street: '89th Ave & 90th Ave',
// address: [ '8929 MacArthur Blvd' ],
// city: 'Oakland',
// postal_code: '94605',
// country_code: 'US',
// state_code: 'CA' }
// display_address: [ '8929 MacArthur Blvd', 'East Oakland', 'Oakland, CA 94605' ],
// neighborhoods: [ 'East Oakland' ]
// }),
// (menu:Menu { score:4.82 , name:"Fish & Chips & Chicken Stop & Soul Food" , lon:-122.4167, lat:37.7833 }),
// (i:Item {name: "Fish Dinner", rating: 2, review_count: 1, likes: 2034,
// top_image_url: 'http://s3-media3.fl.yelpcdn.com/bphoto/uRQq39Hzd83MvUuXlRD3sw/ms.jpg'
// }),
// (rev:Review {
// review_text: 'i received a pm from the new owner stating he had taken over and they\'ve added soul food. the place looks the same and a very young cashier (son) is...',
// down: 100,
// up: 0
// }),
// (p:Photo {
// image_url: 'http://s3-media3.fl.yelpcdn.com/bphoto/uRQq39Hzd83MvUuXlRD3sw/ms.jpg',
// likes: 4000,
// is_top: true
// }),
// (b)-[:HAS_MENU]->(menu),
// (menu)-[:BELONGS_TO]->(b),
// (menu)-[:HAS_ITEM]->(I),
// (i)-[:FROM_MENU]->(menu),
// (i)-(:HAS_PHOTO)->(p),
// (i)-[:HAS_REVIEW]->(rev),
// (rev)-[:OF_ITEM]->(i),
// (rev)-[:HAS_PHOTO]->(p),
// (p)-[:FROM_REVIEW]->(rev),
// (p)-[:OF_ITEM]->(i),
// (p)-[:BY]->(u),
// (u)-[:TOOK_PHOTO]->(p),
// (u)-[:MADE_REVIEW]->(rev),
// (u)-[:HAS_COLLECTED]->(i);
//
//
// MATCH (n)
// OPTIONAL MATCH (n)-[r]-()
// DELETE n,r
//
// // review_count: 1,
//
// // ( blowfish:Menu { score:4.38 , name:"Blowfish Sushi" , lon:-122.4167, lat:37.7833 }),
// // ( patala:Menu { score:3.61 , name:"Patala Cafe" , lon:-122.4167, lat:37.7833 }),
// // ( frenchys:Menu { score:1.19 , name:"Frenchy's Joint" , lon:-122.4167, lat:37.7833 }),
//
// //
// =========================== USER MATCHING query
// match (u:User {name: "Joel Cox"}),(rev:Review),(p:Photo),(i:Item)
// create (u)-[:MADE_REVIEW]->(rev),(u)-[:TOOK_PHOTO]->(p),(u)-[:COLLECTED]->(i),(u)-[:REVIEWED]->(i)
// RETURN u
// =========================== YELP SCHEMA
//
yelp.search({location: "yelp-san-francisco"}, function(error, data) {
if(error) return handleError(res, error)
_(data.businesses).forEach(function(bus){
db.cypherQuery(
"CREATE (m:Menu {"+
"yelp_id: '"+bus.id+"',"+
"name: '"+bus.name+" YOLO',"+
"phone: '"+bus.phone+"',"+
"display_phone: '"+bus.display_phone+"',"+
"image_url: '"+bus.image_url+"',"+
"street: '"+bus.location.cross_streets+"',"+
"address: '"+bus.location.address[0]+"',"+
"city: '"+bus.location.city+"',"+
"postal_code: '"+bus.location.postal_code+"',"+
"country_code: '"+bus.location.country_code+"',"+
"state_code: '"+bus.location.state_code+"'"+
"}),"+
// "(menu:Menu { score:4.82, name:'"+bus.name+"'}),"+
"(i1:Item {name: '"+bus.name+"', rating: '"+bus.rating+"', review_count: '"+bus.review_count+"', likes: 10, top_image_url: '"+bus.image_url+"' }),"+
"(r1:Review {created_at: timestamp()}),"+
"(e1:Essay {review_text: '"+bus.snippet_text+"', down: 5, up: '"+bus.review_count+"'}),"+
"(p1:Photo {"+
"image_url: '"+bus.image_url+"',"+
"likes: '"+bus.review_count+"',"+
"is_top: true"+
"}),"+
"(rate1:Rating {value: '"+bus.rating+"'}),"+
"(m)-[:HAS_ITEM]->(i1),"+
"(r1)-[:REVIEW_OF]->(i1),"+
"(r1)-[:HAS_ESSAY]->(e1),"+
"(r1)-[:HAS_PHOTO]->(p1),"+
"(r1)-[:HAS_RATE]->(rate1)",
function(err, result){
if(err) throw err;
console.log(result.data); // delivers an array of query results
console.log(result.columns); // delivers an array of names of objects getting returned
// res.json(result.data)
// res.json(200, result)
});
})
})
|
'use strict';
require('should');
const sinon = require('sinon');
const createLogger = require('../../../lib/logger/logger');
describe('Logger wrapper', () => {
it('should call the logger with the same parameters', () => {
const settings = {};
const debugStub = sinon.stub();
const createLoggerStub = () => {
return {
debug: debugStub
};
};
const logger = createLogger(settings, createLoggerStub);
logger.debug('test', { a: '123' }, [ 1, 2, 4]);
debugStub.withArgs('test', { a: '123' }, [ 1, 2, 4]).calledOnce.should.be.ok();
});
});
|
export default {
key: 'E',
suffix: 'major',
positions: [
{
frets: '022100',
fingers: '023100'
},
{
frets: 'xx2454',
fingers: '001243'
},
{
frets: 'x76454',
fingers: '043121',
barres: 4,
capo: true
},
{
frets: 'x79997',
fingers: '012341',
barres: 7,
capo: true
}
]
};
|
function in_array(array, element){
try{
if (array.indexOf(element) >= 0){
return true;
}
return false;
} catch (e){
console.log(e);
}
}
function extract(data, where) {
for (var key in data) {
where[key] = data[key];
}
}
local_storage = function(database_name, database_object){
try{
var local_storage_prefix = 'WyvernDB-';
if (database_object){
localStorage.setItem(local_storage_prefix + database_name, JSON.stringify(database_object));
} else {
return JSON.parse( localStorage.getItem(local_storage_prefix + database_name) );
}
} catch (e){
console.log(e);
}
}
function WyvernDB (name){
var database = this;
this.guid = function() {
function s4(){
return Math.floor((1 + Math.random()) * 0x100000).toString(16).substring(1);
}
return s4() + s4() + '-' + s4() + s4() + '-' + s4() + s4() + '-' + s4() + s4()
}
this.size = function (){
var result = {
wyvern_total_count : 0,
}
for (var table in database.tables){
result[table] = JSON.stringify(database.tables[table]).length;
result['wyvern_total_count'] += result[table]
}
return result;
}
this.create_table = function (name, columns, options){
if (!database.tables){
database.tables = {};
}
if (database.tables[name]){
throw 'Table ' + name + ' already exists.';
return null;
}
if (!options.autoincrement_index){
options.autoincrement_index = 0;
}
database.tables[name] = {
columns : columns,
rows : [],
options : options,
};
console.log('Table ' + name + ' created.');
local_storage(database.name, database.tables)
}
this.insert = function (table, rows){
var columns = database.tables[table]['columns'];
var index_columns = [];
if (typeof rows != 'array'){
rows = [rows]
}
if (database.tables[table]['unique']){
index_columns = database.tables[table]['unique']
}
for (var i = 0; i < rows.length; i++){
var row = rows[i];
for (var key in row){
if (!in_array(columns, key)){
throw 'Key ' + key + ' not in set of columns ' + columns + ' for table ' + table;
return null;
}
if (in_array(index_columns, key)){
var exists = database.tables[table].rows.filter(function (elem){
if (elem[key] === row[key]){
throw 'Row with indexed column ' + key +' already exists. Try update instead.';
return null;
}
})
}
rows[i]['create_timestamp'] = new Date().getTime();
rows[i]['last_modified_timestamp'] = new Date().getTime();
if (database.tables[table]['options']['guid']){
for (var j = 0; j < database.tables[table]['options']['guid'].length; j++){
row[database.tables[table]['options']['guid'][j]] = database.guid();
}
}
if (database.tables[table]['options']['autoincrement']){
for (var j = 0; j < database.tables[table]['options']['autoincrement'].length; j++){
row[database.tables[table]['options']['autoincrement'][j]] = database.tables[table]['options']['autoincrement_index'];
}
}
}
if (database.tables[table]['options']['autoincrement']){
database.tables[table]['options']['autoincrement_index']++;
}
}
database.tables[table].rows = database.tables[table].rows.concat(rows);
local_storage(database.name, database.tables);
return (true, rows);
}
this.select = function (table, where){
var results = database.tables[table].rows.filter(function (row){
extract(row, this)
if (typeof eval(where) === 'boolean'){
if (eval(where)){
return row;
}
}
})
return results;
}
this.remove = function (table, where){
var results = [];
database.tables[table].rows.forEach(function (row, i){
extract(row, this);
if (eval(where)){
database.tables[table].rows.splice(i, 1);
results.push(row);
}
})
local_storage(database.name, database.tables)
return results;
}
this.update = function (table, rows){
var columns = [];
var index_columns = [];
if (typeof rows != 'array'){
rows = [rows]
}
for (var i = 0; i < database.tables[table]['columns'].length; i++){
columns.push(database.tables[table]['columns'][i]['name']);
if (database.tables[table]['columns'][i]['unique']){
index_columns.push(database.tables[table]['columns'][i]['name'])
}
}
for (var i = 0; i < rows.length; i++){
var row = rows[i];
for (var key in row){
if (!in_array(columns, key)){
throw 'Key ' + key + ' not in set of columns ' + columns + ' for table ' + table;
return null;
}
if (in_array(index_columns, key)){
for (var i = 0; i < database.tables[table].rows.length; i++){
var elem = database.tables[table].rows[i];
if (elem[key] === row[key]){
database.tables[table].rows[i] = row;
}
}
}
}
row[i]['last_modified_timestamp'] = new Date().getTime();
}
local_storage(database.name, database.tables);
return (true, rows);
}
return this;
}
|
'use strict';
var assert = require('assert');
var extraStep = require('../../../lib/tasks/extra-step');
var MockUI = require('ember-cli/tests/helpers/mock-ui');
describe('Extra Step', function() {
var ui;
var dummySteps = [
{ command: 'echo "command number 1"' },
{ command: 'echo "command number 2"' },
{ command: 'echo "command number 3"' }
];
var dummyCommands = [
'echo "command number 1"',
'echo "command number 2"',
'echo "command number 3"'
];
var failingStep = [ { command: 'exit 1', fail: true } ];
var nonFailingStep = [ { command: 'exit 1', fail: false } ];
var singleFailingStep = [ nonFailingStep[0], failingStep[0], nonFailingStep[0] ];
var dummyOptions = {
foo: 'bar',
truthy: true,
falsy: false,
someOption: 'i am a string',
num: 24
};
var dummyStepsWithOptions = [
{
command: 'echo "command number 4"',
includeOptions: ['foo', 'falsy', 'num']
},
{
command: 'echo "command number 5"',
includeOptions: ['truthy', 'someOption', 'nonExistent']
}
];
var dummyCommandsWithOptions = [
"echo \"command number 4\" --foo bar --num 24",
"echo \"command number 5\" --truthy --some-option 'i am a string'",
];
beforeEach(function() {
ui = new MockUI;
});
it('Runs an array of commands passed to it', function() {
return extraStep(dummySteps, dummyOptions, ui).then(function(result) {
assert.deepEqual(result, dummyCommands, 'Correct commands were run.');
}, function(error) {
assert.ok(false, 'An error occurred');
});
});
it('The proper commands are built and run', function() {
return extraStep(dummyStepsWithOptions, dummyOptions, ui).then(function(result) {
assert.deepEqual(result, dummyCommandsWithOptions, 'Correct commands were built and run.');
}, function(error) {
assert.ok(false, 'An error occurred');
});
});
it('Fail-safe command, with non 0 exit code, returns rejected promise', function() {
return extraStep(failingStep, null, ui).then(function(result) {
assert.ok(false, 'steps should have failed.');
}, function(err) {
assert.ok(true, 'steps failed as expected.');
});
});
it('Fail-friendly command, with non 0 exit code, returns resolved promise', function() {
return extraStep(nonFailingStep, null, ui).then(function(result) {
assert.ok(true, 'steps kept running after failed command, as expected.');
}, function(err) {
assert.ok(false, 'Steps did not continue running as expected');
});
});
});
|
/* Copyright (c) 2010 Scott Lembcke
*
* 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.
*/
/**
@defgroup cpSpatialIndex cpSpatialIndex
Spatial indexes are data structures that are used to accelerate collision detection
and spatial queries. Chipmunk provides a number of spatial index algorithms to pick from
and they are programmed in a generic way so that you can use them for holding more than
just Shapes.
It works by using pointers to the objects you add and using a callback to ask your code
for bounding boxes when it needs them. Several types of queries can be performed an index as well
as reindexing and full collision information. All communication to the spatial indexes is performed
through callback functions.
Spatial indexes should be treated as opaque structs.
This means you shouldn't be reading any of the fields directly.
All spatial indexes define the following methods:
// The number of objects in the spatial index.
count = 0;
// Iterate the objects in the spatial index. @c func will be called once for each object.
each(func);
// Returns true if the spatial index contains the given object.
// Most spatial indexes use hashed storage, so you must provide a hash value too.
contains(obj, hashid);
// Add an object to a spatial index.
insert(obj, hashid);
// Remove an object from a spatial index.
remove(obj, hashid);
// Perform a full reindex of a spatial index.
reindex();
// Reindex a single object in the spatial index.
reindexObject(obj, hashid);
// Perform a point query against the spatial index, calling @c func for each potential match.
// A pointer to the point will be passed as @c obj1 of @c func.
// func(shape);
pointQuery(point, func);
// Perform a segment query against the spatial index, calling @c func for each potential match.
// func(shape);
segmentQuery(vect a, vect b, t_exit, func);
// Perform a rectangle query against the spatial index, calling @c func for each potential match.
// func(shape);
query(bb, func);
// Simultaneously reindex and find all colliding objects.
// @c func will be called once for each potentially overlapping pair of objects found.
// If the spatial index was initialized with a static index, it will collide it's objects against that as well.
reindexQuery(func);
*/
var SpatialIndex = cp.SpatialIndex = function(staticIndex)
{
this.staticIndex = staticIndex;
if(staticIndex){
if(staticIndex.dynamicIndex){
throw new Error("This static index is already associated with a dynamic index.");
}
staticIndex.dynamicIndex = this;
}
};
// Collide the objects in an index against the objects in a staticIndex using the query callback function.
SpatialIndex.prototype.collideStatic = function(staticIndex, func)
{
if(staticIndex.count > 0){
var query = staticIndex.query;
this.each(function(obj) {
query(obj, new BB(obj.bb_l, obj.bb_b, obj.bb_r, obj.bb_t), func);
});
}
};
|
// https://github.com/gruntjs/grunt-contrib-uglify
module.exports = function(grunt) {
grunt.config('cssmin', {
build: {
files: {
'build/styles.css': [ 'build/**/*.css' ]
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
};
|
/**
* This file/module contains all configuration for the build process.
*/
module.exports = {
/**
* The `build_dir` folder is where our projects are compiled during
* development and the `compile_dir` folder is where our app resides once it's
* completely built.
*/
build_dir: 'build',
test_dir: 'test',
compile_dir: 'bin',
/**
* This is a collection of file patterns that refer to our app code (the
* stuff in `src/`). These file paths are used in the configuration of
* build tasks. `js` is all project javascript, less tests. `ctpl` contains
* our reusable components' (`src/common`) template HTML files, while
* `atpl` contains the same, but for our app's code. `html` is just our
* main HTML file, `less` is our main stylesheet, and `unit` contains our
* app's unit tests.
*/
app_files: {
js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ],
jsunit: [ 'src/**/*.spec.js' ],
atpl: [ 'src/app/**/*.tpl.html' ],
ctpl: [ 'src/common/**/*.tpl.html' ],
html: [ 'src/index.html' ],
less: 'src/less/main.less'
},
/**
* This is a collection of files used during testing only.
*/
test_files: {
js: [
'vendor/angular-mocks/angular-mocks.js'
]
},
/**
* This is the same as `app_files`, except it contains patterns that
* reference vendor code (`vendor/`) that we need to place into the build
* process somewhere. While the `app_files` property ensures all
* standardized files are collected for compilation, it is the user's job
* to ensure non-standardized (i.e. vendor-related) files are handled
* appropriately in `vendor_files.js`.
*
* The `vendor_files.js` property holds files to be automatically
* concatenated and minified with our project source files.
*
* The `vendor_files.css` property holds any CSS files to be automatically
* included in our app.
*
* The `vendor_files.assets` property holds any assets to be copied along
* with our app's assets. This structure is flattened, so it is not
* recommended that you use wildcards.
*/
vendor_files: {
js: [
'vendor/jquery/dist/jquery.min.js',
'vendor/angular/angular.js',
'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
'vendor/placeholders/angular-placeholders-0.0.1-SNAPSHOT.min.js',
'vendor/angular-ui-router/release/angular-ui-router.js',
'vendor/angular-ui-utils/modules/route/route.js',
'vendor/restangular/dist/restangular.min.js',
'vendor/lodash/dist/lodash.min.js',
'vendor/angular-mocks/angular-mocks.js',
'vendor/chartist/dist/chartist.min.js',
'vendor/angular-filter/dist/angular-filter.min.js',
'vendor/angular-chartist.js/dist/angular-chartist.js',
'vendor/ladda/dist/spin.min.js',
'vendor/ladda/dist/ladda.min.js',
'vendor/angular-ladda/dist/angular-ladda.js',
'vendor/raphael/raphael-min.js',
'vendor/morris.js/morris.min.js'
],
css: [
'vendor/font-awesome/css/font-awesome.min.css',
'vendor/chartist/dist/chartist.min.css',
'vendor/ladda/dist/ladda.min.css',
'vendor/morris.js/morris.css'
],
assets: [
],
fonts: [
'vendor/bootstrap/fonts/glyphicons-halflings-regular.eot',
'vendor/bootstrap/fonts/glyphicons-halflings-regular.svg',
'vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf',
'vendor/bootstrap/fonts/glyphicons-halflings-regular.woff',
'vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2',
'vendor/font-awesome/fonts/fontawesome-webfont.eot',
'vendor/font-awesome/fonts/fontawesome-webfont.svg',
'vendor/font-awesome/fonts/fontawesome-webfont.ttf',
'vendor/font-awesome/fonts/fontawesome-webfont.woff',
'vendor/font-awesome/fonts/fontawesome-webfont.woff2'
]
},
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.