<commit_before>/* SmartCollection
 * (c) 2015 by StackEngine under the MIT license
 */

angular.module('SmartCollection', [])
.factory('SmartCollection', function($http){
  return function(config) {

    var loaded = false;
    var routes = config.routes || {};
    var key = config.key || 'id';
    var items = [];
    var itemIndex = {};
    var pendingItems = {};
    var promises = {};
    var model = config.model || (function GenericModel(attrs) {
      var self = this;
      angular.forEach(attrs, function(value, key) {
        self[key] = value;
      });
    });

    // PRIVATE INTERFACE ------------------------------------------------

    var performRequest = function(routeName, item) {
      var collection = this;
      var route = routes[routeName];

      // Do some sanity checking to make sure required values exist.
      if (!route) throw "Unknown route named '"+routeName+"'";
      angular.forEach(['url', 'method'], function(key) {
        if (!route[key]) {
          throw "Route '"+routeName+"' does not have required parameter: "+key;
        }
      });

      // Convert plain a plain key item to an object so we support both query types
      if (typeof item !== 'object') {
        var obj = {};
        obj[key] = item;
        item = obj;
      }

      // Compose the URL we will be using.
      var url = composeUrl(item, route.url, route.urlKeys);

      // If a request is already in process for this route, lets just
      // piggyback.  Instead of issuing another request, just return the
      // previous promise.
      var promiseKey = route.method+' '+url;
      if (promises[promiseKey]) {
        return promises[promiseKey];
      }

      // Transform the parameters if necessary.
      var params = angular.copy(item);
      if (route.transformRequestData) {
        params = route.transformRequestData(item);
      }

      var promise = $http[route.method](url, params).then(function(response) {
        // clean up after ourselves -- since this request is complete, remove
        // our cached promise reference so future requests to this route will
        // generate a new request.
        delete promises[promiseKey];

        var data = response.data;
        if (route.responsePrefix) {
          data = data[route.responsePrefix];
        }
        if (route.transformResponseData) {
          data = route.transformResponseData(response.data, item)
        }

        // GET requests will set loaded to true.  This is just a convenience
        // way to know if items have been retrieved.
        if (route.method.toLowerCase() == 'get') {
          loaded = true;
        }

        if (route.responseType == 'array') {
          updateAllItems(data);
          return items;
        } else if (route.responseType == 'one') {
          updateOneItem(data);
          return items[data[key]];
        } else if (route.responseType == 'remove') {
          // Ignores the response from the API but removes the item from our
          // collection.
          removeItem(item);
          return items;
        } else if (route.responseType == 'ignore' || typeof response.routeType == 'undefined') {
          // By default we will ignore everything sent back from the API.
          return data;
        } else {
          throw "Unknown route responseType '"+route.responseType+"' for route "+routeName;
        }
      });

      promises[promiseKey] = promise;
      return promise;
    };

    var updateAllItems = function(data) {
      // Add new items and update existing items with new values
      var currentKeys = {};
      angular.forEach(data, function(item) {
        updateOneItem(item);
        currentKeys[item[key]] = 1;
      });
      // Remove items from the array and index.
      for (var i=0; i < items.length; i++) {
        var currentItem = items[i]
        if (!currentKeys[currentItem[key]]) {
          items.splice(i, 1);
          delete itemIndex[currentItem[key]];
          i--; // decrement since we removed one value from the array
        }
      }
    };

    var updateOneItem = function(data) {
      injectItem(new model(data));
    };

    var removeItem = function(item) {
      for (var i=0; i < items.length; i++) {
        var currentItem = items[i];
        if (currentItem[key] == item[key]) {
          items.splice(i, 1);
          delete itemIndex[currentItem[key]]
          return;
        }
      }
    };

    var injectItem = function(item) {
      if (itemIndex[item[key]]) {
        angular.extend(itemIndex[item[key]], item);
      } else if (pendingItems[item[key]]) {
        itemIndex[item[key]] = angular.extend(pendingItems[item[key]], item);
        items.push(itemIndex[item[key]]);
        delete pendingItems[item[key]];
      } else {
        itemIndex[item[key]] = item;
        items.push(item);
      }
    };

    // Takes a url pattern and replaces variables with values from item as
    // mapped by the keys hash.  For example "/users/:id" becomes "/users/3".
    var composeUrl = function(item, url, keys) {
      var matches;
      while (matches = url.match(/:([^\/\?$]+)/)) {
        url = url.replace(matches[0], item[matches[1]]);
      }
      return url;
    };

    // PUBLIC INTERFACE ------------------------------------------------

    var SmartCollection = function() {};
    SmartCollection.prototype.items = function() { return items; };
    SmartCollection.prototype.item = function(keyValue) {
      if (typeof itemIndex[keyValue] !== 'undefined') {
        return itemIndex[keyValue];
      } else if (typeof pendingItems[keyValue] !== 'undefined') {
        return pendingItems[keyValue];
      } else {
        var obj = {};
        obj[key] = keyValue;
        pendingItems[keyValue] = new model(obj);
        return pendingItems[keyValue];
      }
    };

    // Create a function for each route dynamically
    angular.forEach(routes, function(route, routeName) {
      if (SmartCollection.prototype[routeName])
        throw "Cannot create a route using reserved name '"+routeName+"'";
      SmartCollection.prototype[routeName] = function(item) {
        return performRequest(routeName, item);
      };
    });

    return new SmartCollection();
  };
});
<commit_msg>allow object references for item lookups<commit_after>/* SmartCollection
 * (c) 2015 by StackEngine under the MIT license
 */

angular.module('SmartCollection', [])
.factory('SmartCollection', function($http){
  return function(config) {

    var loaded = false;
    var routes = config.routes || {};
    var key = config.key || 'id';
    var items = [];
    var itemIndex = {};
    var pendingItems = {};
    var promises = {};
    var model = config.model || (function GenericModel(attrs) {
      var self = this;
      angular.forEach(attrs, function(value, key) {
        self[key] = value;
      });
    });

    // PRIVATE INTERFACE ------------------------------------------------

    var performRequest = function(routeName, item) {
      var collection = this;
      var route = routes[routeName];

      // Do some sanity checking to make sure required values exist.
      if (!route) throw "Unknown route named '"+routeName+"'";
      angular.forEach(['url', 'method'], function(key) {
        if (!route[key]) {
          throw "Route '"+routeName+"' does not have required parameter: "+key;
        }
      });

      // Convert plain a plain key item to an object so we support both query types
      if (typeof item !== 'object') {
        var obj = {};
        obj[key] = item;
        item = obj;
      }

      // Compose the URL we will be using.
      var url = composeUrl(item, route.url, route.urlKeys);

      // If a request is already in process for this route, lets just
      // piggyback.  Instead of issuing another request, just return the
      // previous promise.
      var promiseKey = route.method+' '+url;
      if (promises[promiseKey]) {
        return promises[promiseKey];
      }

      // Transform the parameters if necessary.
      var params = angular.copy(item);
      if (route.transformRequestData) {
        params = route.transformRequestData(item);
      }

      var promise = $http[route.method](url, params).then(function(response) {
        // clean up after ourselves -- since this request is complete, remove
        // our cached promise reference so future requests to this route will
        // generate a new request.
        delete promises[promiseKey];

        var data = response.data;
        if (route.responsePrefix) {
          data = data[route.responsePrefix];
        }
        if (route.transformResponseData) {
          data = route.transformResponseData(response.data, item)
        }

        // GET requests will set loaded to true.  This is just a convenience
        // way to know if items have been retrieved.
        if (route.method.toLowerCase() == 'get') {
          loaded = true;
        }

        if (route.responseType == 'array') {
          updateAllItems(data);
          return items;
        } else if (route.responseType == 'one') {
          updateOneItem(data);
          return items[data[key]];
        } else if (route.responseType == 'remove') {
          // Ignores the response from the API but removes the item from our
          // collection.
          removeItem(item);
          return items;
        } else if (route.responseType == 'ignore' || typeof response.routeType == 'undefined') {
          // By default we will ignore everything sent back from the API.
          return data;
        } else {
          throw "Unknown route responseType '"+route.responseType+"' for route "+routeName;
        }
      });

      promises[promiseKey] = promise;
      return promise;
    };

    var updateAllItems = function(data) {
      // Add new items and update existing items with new values
      var currentKeys = {};
      angular.forEach(data, function(item) {
        updateOneItem(item);
        currentKeys[item[key]] = 1;
      });
      // Remove items from the array and index.
      for (var i=0; i < items.length; i++) {
        var currentItem = items[i]
        if (!currentKeys[currentItem[key]]) {
          items.splice(i, 1);
          delete itemIndex[currentItem[key]];
          i--; // decrement since we removed one value from the array
        }
      }
    };

    var updateOneItem = function(data) {
      injectItem(new model(data));
    };

    var removeItem = function(item) {
      for (var i=0; i < items.length; i++) {
        var currentItem = items[i];
        if (currentItem[key] == item[key]) {
          items.splice(i, 1);
          delete itemIndex[currentItem[key]]
          return;
        }
      }
    };

    var injectItem = function(item) {
      if (itemIndex[item[key]]) {
        angular.extend(itemIndex[item[key]], item);
      } else if (pendingItems[item[key]]) {
        itemIndex[item[key]] = angular.extend(pendingItems[item[key]], item);
        items.push(itemIndex[item[key]]);
        delete pendingItems[item[key]];
      } else {
        itemIndex[item[key]] = item;
        items.push(item);
      }
    };

    // Takes a url pattern and replaces variables with values from item as
    // mapped by the keys hash.  For example "/users/:id" becomes "/users/3".
    var composeUrl = function(item, url, keys) {
      var matches;
      while (matches = url.match(/:([^\/\?$]+)/)) {
        url = url.replace(matches[0], item[matches[1]]);
      }
      return url;
    };

    // PUBLIC INTERFACE ------------------------------------------------

    var SmartCollection = function() {};
    SmartCollection.prototype.items = function() { return items; };
    SmartCollection.prototype.item = function(keyValue) {
      if (typeof itemIndex[keyValue] !== 'undefined') {
        return itemIndex[keyValue];
      } else if (typeof pendingItems[keyValue] !== 'undefined') {
        return pendingItems[keyValue];
      } else if (typeof keyValue == 'object') {
        var obj = keyValue;
        keyValue = obj[key];
        pendingItems[keyValue] = new model(obj);
        return pendingItems[keyValue];
      } else {
        var obj = {};
        obj[key] = keyValue;
        pendingItems[keyValue] = new model(obj);
        return pendingItems[keyValue];
      }
    };

    // Create a function for each route dynamically
    angular.forEach(routes, function(route, routeName) {
      if (SmartCollection.prototype[routeName])
        throw "Cannot create a route using reserved name '"+routeName+"'";
      SmartCollection.prototype[routeName] = function(item) {
        return performRequest(routeName, item);
      };
    });

    return new SmartCollection();
  };
});<|endoftext|>


<commit_before>import compact from '../lib/compact'
import expect from 'expect.js'

describe.only('compact', () => {
  it('Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN ] ) ).to.eql( [] )
  })

  it('Creates an array with all falsey values removed.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN, 'Devon' ] ) ).to.eql( ['Devon'] )
  })

  it('Creates an array with all falsey values removed.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN, 'Devon', 5, true ] ) ).to.eql( [ 'Devon', 5, true ] )
  })
})
<commit_msg>remove .only on describe so all test can run<commit_after>import compact from '../lib/compact'
import expect from 'expect.js'

describe('compact', () => {
  it('Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN ] ) ).to.eql( [] )
  })

  it('Creates an array with all falsey values removed.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN, 'Devon' ] ) ).to.eql( ['Devon'] )
  })

  it('Creates an array with all falsey values removed.', () => {
    expect( compact( [ false, null, 0, "", undefined, NaN, 'Devon', 5, true ] ) ).to.eql( [ 'Devon', 5, true ] )
  })
})
<|endoftext|>


<commit_before>console.log("Loaded editor.js");
function submitData(path){
	var data = editor.getSession().getValue();
	console.log("Got data: " + data);
	$.ajax({
		type: "POST",
		url: path,
		data: { code: data},
		success: function(d){
			console.log("Got reply from server: " + d);
			// Take the reply and make it the new document now.
			document = d;
			console.log("set document");
		}
	});
}<commit_msg>Fix that displays the data sent back by the server<commit_after>console.log("Loaded editor.js");
function submitData(path){
	var data = editor.getSession().getValue();
	console.log("Got data: " + data);
	$.ajax({
		type: "POST",
		url: path,
		data: { code: data},
		success: function(d){
			console.log("Got reply from server: " + d);
			// Take the reply and make it the new document now.
			document.open();
			document.write(d);
			document.close();
			// document = d;
			console.log("set document");
		}
	});
}<|endoftext|>


<commit_before>SLED = {};
SLED.grammar = {};
SLED.grammar.root = {
	title: "StyledLayerDescriptor",
	content: [
		{ name: "NamedLayer",	mult: [0,99] }
	]
};
SLED.grammar.NamedLayer = {
	title: "NamedLayer",
	content: [
		{ name: "Name",	mult: [1,1] },
		{ name: "UserStyle",	mult: [0,99] }
	]
};
SLED.grammar.UserStyle = {
	title: "UserStyle",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "FeatureTypeStyle",	mult: [1,99] }
	]
};
SLED.grammar.FeatureTypeStyle = {
	title: "FeatureTypeStyle",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "Rule",	mult: [1,99] }
	]
};
SLED.grammar.Rule = {
	title: "Rule",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "MinScale",	mult: [0,1] },
		{ name: "MaxScale",	mult: [0,1] },
		{ name: "PointSymbolizer",	mult: [0,99] },
		{ name: "LineSymbolizer",	mult: [0,99] },
		{ name: "PolygonSymbolizer",	mult: [0,99] },
		{ name: "TextSymbolizer",	mult: [0,99] }
	]
};
SLED.grammar.PointSymbolizer = {
	title: "Point",
	content: [
		{	name: "Graphic",	mult: [0,1] }
	]
};
SLED.grammar.LineSymbolizer = {
	title: "Line",
	content: [
		{	name: "Stroke",	mult: [1,1] },
		{	name: "PerpendicularOffset",	mult: [0,1] }
	]
};
SLED.grammar.PolygonSymbolizer = {
	title: "Polygon",
	content: [
		{	name: "Fill",	mult: [0,1] },
		{	name: "Stroke",	mult: [0,1] }
	]
};
SLED.grammar.TextSymbolizer = {
	title: "Text",
	content: [
		{	name: "Label",	mult: [0,1] },
		{	name: "Font",	mult: [0,1] },
		{	name: "LabelPlacement",	mult: [0,1] },
		{	name: "Halo",	mult: [0,1] },
		{	name: "Fill",	mult: [0,1] },
		{	name: "Graphic",	mult: [0,1] },
		{	name: "Priority",	mult: [0,1] }
	]
};
SLED.grammar.Graphic = {
	title: "Graphic",
	content: [
		{	name: "ExternalGraphic",	mult: [0,1] },
		{	name: "Mark",		mult: [0,1] },
		{	name: "Opacity",	mult: [0,1] },
		{	name: "Size",		mult: [0,1] },
		{	name: "Rotation",	mult: [0,1] }
	]
};
SLED.grammar.Fill = {
	title: "Fill",
	content: [
		{	name: "GraphicFill",	mult: [0,1] },
		{	name: "FillColor",		mult: [0,1] },
		{	name: "FillOpacity",	mult: [0,1] }
	]
};
SLED.grammar.GraphicFill = {
	title: "GraphicFill",
	content: [
		{	name: "Graphic",	mult: [1,1] }
	]
};
SLED.grammar.Stroke = {
	title: "Stroke",
	content: [
		{	name: "GraphicFill",	mult: [0,1] },
		{	name: "GraphicStroke",	mult: [0,1] },
		{	name: "StrokeColor",	mult: [0,1] },
		{	name: "Width",	mult: [0,1] },
		{	name: "StrokeOpacity",	mult: [0,1] },
		{	name: "LineJoin",	mult: [0,1] },
		{	name: "LineCap",	mult: [0,1] },
		{	name: "DashArray",	mult: [0,1] },
		{	name: "DashOffset",	mult: [0,1] }
	]
};
SLED.grammar.GraphicStroke = {
	title: "GraphicStroke",
	content: [
		{	name: "Graphic",	mult: [0,1] }
	]
};
SLED.grammar.ExternalGraphic = {
	title: "ExternalGraphic",
	content: [
		{	name: "OnlineResource",	mult: [1,1] },
		{	name: "Format",	mult: [1,1] }
	]
};
SLED.grammar.Mark = {
	title: "Mark",
	content: [
		{	name: "WellKnownName",	mult: [1,1] },
		{	name: "Fill",	mult: [0,1] },
		{	name: "Stroke",	mult: [0,1] }
	]
};
SLED.grammar.OnlineResource = {
	title: "OnlineResource",
	template: '<OnlineResource  xlink:type="simple" xlink:href="$val" />',
	val: "http://"

};
SLED.grammar.Format = {
	title: "Format",
	val: "image/png"
};
SLED.grammar.WellKnownName = {
	title: "WellKnownName",
	val: "circle",
	size: 30
};
SLED.grammar.Label = {
	title: "Label",
	content: [
		{	name: "PropertyName",	mult: [0,1] }
	]
};
SLED.grammar.LabelPlacement = {
	title: "LabelPlacement",
	content: [
		{	name: "PointPlacement",	mult: [0,1] },
		{	name: "LinePlacement",	mult: [0,1] }
	]
};
SLED.grammar.PointPlacement = {
	title: "PointPlacement",
	content: [
		{	name: "AnchorPoint",	mult: [0,1] },
		{	name: "Displacement",	mult: [0,1] },
		{	name: "Rotation",	mult: [0,1] }
	]
};
SLED.grammar.AnchorPoint = {
	title: "AnchorPoint",
	content: [
		{	name: "AnchorPointX",	mult: [1,1] },
		{	name: "AnchorPointY",	mult: [1,1] }
	]
};
SLED.grammar.Displacement = {
	title: "Displacement",
	content: [
		{	name: "DisplacementX",	mult: [1,1] },
		{	name: "DisplacementY",	mult: [1,1] }
	]
};

SLED.grammar.LinePlacement = {
	title: "LinePlacement",
	content: [
		{	name: "PerpendicularOffset",	mult: [1,1] }
	]
};

SLED.grammar.Font = {
	title: "Font",
	content: [
		{	name: "FontFamily",	mult: [0,1] },
		{	name: "FontStyle",	mult: [0,1] },
		{	name: "FontWeight",	mult: [0,1] },
		{	name: "FontSize",	mult: [0,1] }
	]
};

SLED.grammar.AnchorPointX = {
	title: "AnchorPointX",
	val: ".5",
	size: 5
};
SLED.grammar.AnchorPointY = {
	title: "AnchorPointY",
	val: ".5",
	size: 5
};
SLED.grammar.DisplacementX = {
	title: "DisplacementX",
	val: "0",
	size: 5
};
SLED.grammar.DisplacementY = {
	title: "DisplacementY",
	val: "0",
	size: 5
};
SLED.grammar.Halo = {
	title: "Halo",
	val: "1"
};
SLED.grammar.Priority = {
	title: "Priority",
	val: "1000"
};
SLED.grammar.FontFamily = {
	title: "family",
	css: "font-family",
	val: "Arial"
};
SLED.grammar.FontStyle = {
	title: "style",
	css: "font-style",
	val: "italic"
};
SLED.grammar.FontWeight = {
	title: "weight",
	css: "font-weight",
	val: "bold"
};
SLED.grammar.FontSize = {
	title: "size",
	css: "font-size",
	val: "10"
};
SLED.grammar.Opacity = {
	title: "Opacity",
	val: "1"
};
SLED.grammar.Size = {
	title: "Size",
	val: "10"
};
SLED.grammar.Rotation = {
	title: "Rotation",
	val: "0"
};
SLED.grammar.MinScale = {
	title: "MinScale",
	val: "0",
	size: 7
};
SLED.grammar.MaxScale = {
	title: "MaxScale",
	val: "10,000,000",
	size: 7
};
SLED.grammar.Name = {
	title: "Name"
};
SLED.grammar.Title = {
	title: "Title"
};
SLED.grammar.Abstract = {
	title: "Abstract"
};
SLED.grammar.FillColor = {
	title: "color",
	type: "color",
	css: "fill",
	val: "000000",
	size: 6
};
SLED.grammar.FillOpacity = {
	title: "opacity",
	css: "fill-opacity",
	val: "1",
	size: 5
};
SLED.grammar.StrokeColor = {
	title: "color",
	type: "color",
	css: "stroke",
	val: "000000",
	size: 6
};
SLED.grammar.Width = {
	title: "width",
	css: "stroke-width",
	val: "1"
};
SLED.grammar.StrokeOpacity = {
	title: "opacity",
	css: "stroke-opacity",
	size: 5,
	val: "1"
};
SLED.grammar.LineJoin = {
	title: "linejoin",
	css: "stroke-linejoin",
	val: "round",
	size: 6
};
SLED.grammar.LineCap = {
	title: "linecap",
	css: "stroke-linecap",
	val: "round"
};
SLED.grammar.DashArray = {
	title: "dasharray",
	css: "stroke-dasharray",
	val: "5 2"
};
SLED.grammar.DashOffset = {
	title: "dashoffset",
	css: "stroke-dashoffset",
	val: "0"
};
SLED.grammar.PerpendicularOffset = {
	title: "PerpendicularOffset",
	val: "1"
};
SLED.grammar.PropertyName = {
	title: "PropertyName"
};
<commit_msg>Add Filter rules<commit_after>SLED = {};
SLED.grammar = {};
SLED.grammar.root = {
	title: "StyledLayerDescriptor",
	content: [
		{ name: "NamedLayer",	mult: [0,99] }
	]
};
SLED.grammar.NamedLayer = {
	title: "NamedLayer",
	content: [
		{ name: "Name",	mult: [1,1] },
		{ name: "UserStyle",	mult: [0,99] }
	]
};
SLED.grammar.UserStyle = {
	title: "UserStyle",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "FeatureTypeStyle",	mult: [1,99] }
	]
};
SLED.grammar.FeatureTypeStyle = {
	title: "FeatureTypeStyle",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "Rule",	mult: [1,99] }
	]
};
SLED.grammar.Rule = {
	title: "Rule",
	content: [
		{ name: "Name",	mult: [0,1] },
		{ name: "Title",	mult: [0,1] },
		{ name: "Abstract",	mult: [0,1] },
		{ name: "Filter",	mult: [0,1] },
		{ name: "MinScale",	mult: [0,1] },
		{ name: "MaxScale",	mult: [0,1] },
		{ name: "PointSymbolizer",	mult: [0,99] },
		{ name: "LineSymbolizer",	mult: [0,99] },
		{ name: "PolygonSymbolizer",	mult: [0,99] },
		{ name: "TextSymbolizer",	mult: [0,99] }
	]
};
SLED.grammar.Filter = {
	title: "Filter",
	content: [
		{	name: "And",	mult: [0,1] },
		{	name: "PropertyIsLessThan",	mult: [0,1] },
		{	name: "PropertyIsLessThanOrEqualTo",	mult: [0,1] },
		{	name: "PropertyIsGreaterThan",	mult: [0,1] },
		{	name: "PropertyIsGreaterThanOrEqualTo",	mult: [0,1] }
	]
};
SLED.grammar.And = {
	title: "And",
	content: [
		{	name: "PropertyIsLessThan",	mult: [0,1] },
		{	name: "PropertyIsLessThanOrEqualTo",	mult: [0,1] },
		{	name: "PropertyIsGreaterThan",	mult: [0,1] },
		{	name: "PropertyIsGreaterThanOrEqualTo",	mult: [0,1] }
	]
};
SLED.grammar.PropertyIsLessThan = {
	title: "<",
	content: [
		{	name: "PropertyName",	mult: [1,1] },
		{	name: "Literal",	mult: [1,1] }
	]
};
SLED.grammar.PropertyIsLessThanOrEqualTo = {
	title: "<=",
	content: [
		{	name: "PropertyName",	mult: [1,1] },
		{	name: "Literal",	mult: [1,1] }
	]
};
SLED.grammar.PropertyIsGreaterThan = {
	title: ">",
	content: [
		{	name: "PropertyName",	mult: [1,1] },
		{	name: "Literal",	mult: [1,1] }
	]
};
SLED.grammar.PropertyIsGreaterThanOrEqualTo = {
	title: ">=",
	content: [
		{	name: "PropertyName",	mult: [1,1] },
		{	name: "Literal",	mult: [1,1] }
	]
};
SLED.grammar.PropertyName = {
	title: "PropertyName"
};
SLED.grammar.Literal = {
	title: "Literal"
};
SLED.grammar.PointSymbolizer = {
	title: "Point",
	content: [
		{	name: "Graphic",	mult: [0,1] }
	]
};
SLED.grammar.LineSymbolizer = {
	title: "Line",
	content: [
		{	name: "Stroke",	mult: [1,1] },
		{	name: "PerpendicularOffset",	mult: [0,1] }
	]
};
SLED.grammar.PolygonSymbolizer = {
	title: "Polygon",
	content: [
		{	name: "Fill",	mult: [0,1] },
		{	name: "Stroke",	mult: [0,1] }
	]
};
SLED.grammar.TextSymbolizer = {
	title: "Text",
	content: [
		{	name: "Label",	mult: [0,1] },
		{	name: "Font",	mult: [0,1] },
		{	name: "LabelPlacement",	mult: [0,1] },
		{	name: "Halo",	mult: [0,1] },
		{	name: "Fill",	mult: [0,1] },
		{	name: "Graphic",	mult: [0,1] },
		{	name: "Priority",	mult: [0,1] }
	]
};
SLED.grammar.Graphic = {
	title: "Graphic",
	content: [
		{	name: "ExternalGraphic",	mult: [0,1] },
		{	name: "Mark",		mult: [0,1] },
		{	name: "Opacity",	mult: [0,1] },
		{	name: "Size",		mult: [0,1] },
		{	name: "Rotation",	mult: [0,1] }
	]
};
SLED.grammar.Fill = {
	title: "Fill",
	content: [
		{	name: "GraphicFill",	mult: [0,1] },
		{	name: "FillColor",		mult: [0,1] },
		{	name: "FillOpacity",	mult: [0,1] }
	]
};
SLED.grammar.GraphicFill = {
	title: "GraphicFill",
	content: [
		{	name: "Graphic",	mult: [1,1] }
	]
};
SLED.grammar.Stroke = {
	title: "Stroke",
	content: [
		{	name: "GraphicFill",	mult: [0,1] },
		{	name: "GraphicStroke",	mult: [0,1] },
		{	name: "StrokeColor",	mult: [0,1] },
		{	name: "Width",	mult: [0,1] },
		{	name: "StrokeOpacity",	mult: [0,1] },
		{	name: "LineJoin",	mult: [0,1] },
		{	name: "LineCap",	mult: [0,1] },
		{	name: "DashArray",	mult: [0,1] },
		{	name: "DashOffset",	mult: [0,1] }
	]
};
SLED.grammar.GraphicStroke = {
	title: "GraphicStroke",
	content: [
		{	name: "Graphic",	mult: [0,1] }
	]
};
SLED.grammar.ExternalGraphic = {
	title: "ExternalGraphic",
	content: [
		{	name: "OnlineResource",	mult: [1,1] },
		{	name: "Format",	mult: [1,1] }
	]
};
SLED.grammar.Mark = {
	title: "Mark",
	content: [
		{	name: "WellKnownName",	mult: [1,1] },
		{	name: "Fill",	mult: [0,1] },
		{	name: "Stroke",	mult: [0,1] }
	]
};
SLED.grammar.OnlineResource = {
	title: "OnlineResource",
	template: '<OnlineResource  xlink:type="simple" xlink:href="$val" />',
	val: "http://"

};
SLED.grammar.Format = {
	title: "Format",
	val: "image/png"
};
SLED.grammar.WellKnownName = {
	title: "WellKnownName",
	val: "circle",
	size: 30
};
SLED.grammar.Label = {
	title: "Label",
	content: [
		{	name: "PropertyName",	mult: [0,1] }
	]
};
SLED.grammar.LabelPlacement = {
	title: "LabelPlacement",
	content: [
		{	name: "PointPlacement",	mult: [0,1] },
		{	name: "LinePlacement",	mult: [0,1] }
	]
};
SLED.grammar.PointPlacement = {
	title: "PointPlacement",
	content: [
		{	name: "AnchorPoint",	mult: [0,1] },
		{	name: "Displacement",	mult: [0,1] },
		{	name: "Rotation",	mult: [0,1] }
	]
};
SLED.grammar.AnchorPoint = {
	title: "AnchorPoint",
	content: [
		{	name: "AnchorPointX",	mult: [1,1] },
		{	name: "AnchorPointY",	mult: [1,1] }
	]
};
SLED.grammar.Displacement = {
	title: "Displacement",
	content: [
		{	name: "DisplacementX",	mult: [1,1] },
		{	name: "DisplacementY",	mult: [1,1] }
	]
};

SLED.grammar.LinePlacement = {
	title: "LinePlacement",
	content: [
		{	name: "PerpendicularOffset",	mult: [1,1] }
	]
};

SLED.grammar.Font = {
	title: "Font",
	content: [
		{	name: "FontFamily",	mult: [0,1] },
		{	name: "FontStyle",	mult: [0,1] },
		{	name: "FontWeight",	mult: [0,1] },
		{	name: "FontSize",	mult: [0,1] }
	]
};

SLED.grammar.AnchorPointX = {
	title: "AnchorPointX",
	val: ".5",
	size: 5
};
SLED.grammar.AnchorPointY = {
	title: "AnchorPointY",
	val: ".5",
	size: 5
};
SLED.grammar.DisplacementX = {
	title: "DisplacementX",
	val: "0",
	size: 5
};
SLED.grammar.DisplacementY = {
	title: "DisplacementY",
	val: "0",
	size: 5
};
SLED.grammar.Halo = {
	title: "Halo",
	val: "1"
};
SLED.grammar.Priority = {
	title: "Priority",
	val: "1000"
};
SLED.grammar.FontFamily = {
	title: "family",
	css: "font-family",
	val: "Arial"
};
SLED.grammar.FontStyle = {
	title: "style",
	css: "font-style",
	val: "italic"
};
SLED.grammar.FontWeight = {
	title: "weight",
	css: "font-weight",
	val: "bold"
};
SLED.grammar.FontSize = {
	title: "size",
	css: "font-size",
	val: "10"
};
SLED.grammar.Opacity = {
	title: "Opacity",
	val: "1"
};
SLED.grammar.Size = {
	title: "Size",
	val: "10"
};
SLED.grammar.Rotation = {
	title: "Rotation",
	val: "0"
};
SLED.grammar.MinScale = {
	title: "MinScale",
	val: "0",
	size: 7
};
SLED.grammar.MaxScale = {
	title: "MaxScale",
	val: "10,000,000",
	size: 7
};
SLED.grammar.Name = {
	title: "Name"
};
SLED.grammar.Title = {
	title: "Title"
};
SLED.grammar.Abstract = {
	title: "Abstract"
};
SLED.grammar.FillColor = {
	title: "color",
	type: "color",
	css: "fill",
	val: "000000",
	size: 6
};
SLED.grammar.FillOpacity = {
	title: "opacity",
	css: "fill-opacity",
	val: "1",
	size: 5
};
SLED.grammar.StrokeColor = {
	title: "color",
	type: "color",
	css: "stroke",
	val: "000000",
	size: 6
};
SLED.grammar.Width = {
	title: "width",
	css: "stroke-width",
	val: "1"
};
SLED.grammar.StrokeOpacity = {
	title: "opacity",
	css: "stroke-opacity",
	size: 5,
	val: "1"
};
SLED.grammar.LineJoin = {
	title: "linejoin",
	css: "stroke-linejoin",
	val: "round",
	size: 6
};
SLED.grammar.LineCap = {
	title: "linecap",
	css: "stroke-linecap",
	val: "round"
};
SLED.grammar.DashArray = {
	title: "dasharray",
	css: "stroke-dasharray",
	val: "5 2"
};
SLED.grammar.DashOffset = {
	title: "dashoffset",
	css: "stroke-dashoffset",
	val: "0"
};
SLED.grammar.PerpendicularOffset = {
	title: "PerpendicularOffset",
	val: "1"
};
SLED.grammar.PropertyName = {
	title: "PropertyName"
};
<|endoftext|>


<commit_before>var SLIDE_CONFIG = {
  // Slide settings
  settings: {
    title: 'Title Goes Here
Up To Two Lines',
    subtitle: 'Subtitle Goes Here',
    //eventTitle: 'Google I/O 2013',
    useBuilds: true, // Default: true. False will turn off slide animation builds.
    usePrettify: true, // Default: true
    enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides.
    enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch.
    //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead.
    favIcon: 'images/google_developers_logo_tiny.png',
    fonts: [
      'Open Sans:regular,semibold,italic,italicsemibold',
      'Source Code Pro'
    ],
    //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension.
  },

  // Author information
  presenters: [{
    name: 'Firstname Lastname',
    company: 'Job Title, Google',
    gplus: 'http://plus.google.com/1234567890',
    twitter: '@yourhandle',
    www: 'http://www.you.com',
    github: 'http://github.com/you'
  }/*, {
    name: 'Second Name',
    company: 'Job Title, Google',
    gplus: 'http://plus.google.com/1234567890',
    twitter: '@yourhandle',
    www: 'http://www.you.com',
    github: 'http://github.com/you'
  }*/]
};

<commit_msg>Setting up basic presentation info<commit_after>var SLIDE_CONFIG = {
  // Slide settings
  settings: {
    title: 'Testes de Unidade
na prática',
    subtitle: 'Por quê? Quando? Como?',
    eventTitle: 'XVII SECCOM',
    useBuilds: true, // Default: true. False will turn off slide animation builds.
    usePrettify: true, // Default: true
    enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides.
    enableTouch: false, // Default: true. If touch support should enabled. Note: the device must support touch.
    //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead.
    favIcon: 'images/google_developers_logo_tiny.png',
    fonts: [
      'Open Sans:regular,semibold,italic,italicsemibold',
      'Source Code Pro'
    ]
    //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension.
  },

  // Author information
  presenters: [
      {
          name: 'Tiago Furtado',
          company: 'Full-stack developer, Meritt Informação Educacional',
          //gplus: 'http://plus.google.com/1234567890',
          twitter: '@tiagobronca',
          //www: 'http://www.you.com',
          github: 'http://github.com/tfurtado'
      }
  ]
};

<|endoftext|>


<commit_before>var VOX = VOX || {};

VOX.Quotes = ( function ( $ ) {

  var headline = $( '#headline' );
  var selectedText,
      selectionStart,
      selectionLength,
      selectionEnd,
      range;

  var handleQuotes = function ( event ) {
    var headline = $( this );
    // reworked from smartquotes.js
    // https://github.com/kellym/smartquotesjs/blob/master/src/smartquotes.js
    var new_value = headline.val()
      .replace(/(\W|^)"/g, '$1\u201c')                                             // beginning "
      .replace(/(\u201c[^"]*)"([^"]*$|[^\u201c"]*\u201c)/g, '$1\u201d$2')          // ending "
      .replace(/([^0-9])"/g,'$1\u201d')                                            // remaining " at end of word
      .replace(/(\W|^)'(\S)/g, '$1\u2018')                                         // beginning '
      .replace(/(\W|^)\u2032(\S)/g,'$1\u2018$2')                                   // beginning '
      .replace(/(\W|^)\u2019(\S)/g,'$1\u2018$2')                                   // beginning '
      .replace(/([a-z])'([a-z])/ig, '$1\u2019$2')                                  // conjunction's possession
      .replace(/((\u2018[^']*)|[a-z])'([^0-9]|$)/ig, '$1\u2019$3')                 // ending '
      .replace(/(\u2018)([0-9]{2}[^\u2019]*)(\u2018([^0-9]|$)|$|\u2019[a-z])/ig, '\u2019$2$3')     // abbrev. years like '93
      .replace(/(\B|^)\u2018(?=([^\u2019]*\u2019\b)*([^\u2019\u2018]*\W[\u2019\u2018]\b|[^\u2019\u2018]*$))/ig, '$1\u2019') // backwards apostrophe
      .replace(/'''/g, '\u2034')                                                   // triple prime
      .replace(/("|'')/g, '\u2033')                                                // double prime
      .replace(/("|'')/g, '\u2033')                                                // double prime
      // .replace(/(\W|^)\u2019(\d+)/g,'$1\u2032$2')                                  // prime
      .replace(/'/g, '\u2032')                                                 // prime
      .replace(/\u2013\u2013|--/g, ' \u2014 '); // mdash
    headline.val( new_value );
  };

  var addQuoteSelector = function ( event ) {
    // Get selected text
    selectedText = window.getSelection();
    range = selectedText.getRangeAt( 0 );
    selectedTextString = selectedText.toString();
    selectionStart = headline[0].selectionStart;
    selectionEnd = headline[0].selectionEnd;
    selectionLength = selectedTextString.length;
    // if selected text is just one character
    // for now
    // build in better popup reasons in the future
    if ( selectionLength == 1 ) {
      $( '#popup-quote' ).show();
    }
  };

  var removeQuoteSelector = function ( event ) {
    $( '#popup-quote' ).hide();
  };

  var addQuote = function ( event ) {
    removeQuoteSelector();
    var newQuote = $( this ).html();
    headline.val( headline.val().substring( 0, selectionStart ) + newQuote + headline.val().substring( selectionEnd, selectionLength ) );
  };

  var addEvents = function () {
    headline.bind( 'propertychange change input paste', handleQuotes );
    headline.bind( 'select', addQuoteSelector );
    $( '#popup-quote div' ).on( 'click', addQuote );
  };

  var init = function () {
    addEvents();
  }

  init();

} )( jQuery );
<commit_msg>select and replace finally works<commit_after>var VOX = VOX || {};

VOX.Quotes = ( function ( $ ) {

  var headline = $( '#headline' );
  var selectedText,
      headlineStart,
      headlineLength,
      headlineEnd,
      range;

  var handleQuotes = function ( event ) {
    var headline = $( this );
    // reworked from smartquotes.js
    // https://github.com/kellym/smartquotesjs/blob/master/src/smartquotes.js
    var new_value = headline.val()
      .replace(/(\W|^)"/g, '$1\u201c')                                             // beginning "
      .replace(/(\u201c[^"]*)"([^"]*$|[^\u201c"]*\u201c)/g, '$1\u201d$2')          // ending "
      .replace(/([^0-9])"/g,'$1\u201d')                                            // remaining " at end of word
      .replace(/(\W|^)'(\S)/g, '$1\u2018')                                         // beginning '
      .replace(/(\W|^)\u2032(\S)/g,'$1\u2018$2')                                   // beginning '
      .replace(/(\W|^)\u2019(\S)/g,'$1\u2018$2')                                   // beginning '
      .replace(/([a-z])'([a-z])/ig, '$1\u2019$2')                                  // conjunction's possession
      .replace(/((\u2018[^']*)|[a-z])'([^0-9]|$)/ig, '$1\u2019$3')                 // ending '
      .replace(/(\u2018)([0-9]{2}[^\u2019]*)(\u2018([^0-9]|$)|$|\u2019[a-z])/ig, '\u2019$2$3')     // abbrev. years like '93
      .replace(/(\B|^)\u2018(?=([^\u2019]*\u2019\b)*([^\u2019\u2018]*\W[\u2019\u2018]\b|[^\u2019\u2018]*$))/ig, '$1\u2019') // backwards apostrophe
      .replace(/'''/g, '\u2034')                                                   // triple prime
      .replace(/("|'')/g, '\u2033')                                                // double prime
      .replace(/("|'')/g, '\u2033')                                                // double prime
      // .replace(/(\W|^)\u2019(\d+)/g,'$1\u2032$2')                                  // prime
      .replace(/'/g, '\u2032')                                                 // prime
      .replace(/\u2013\u2013|--/g, ' \u2014 '); // mdash
    headline.val( new_value );
  };

  var addQuoteSelector = function ( event ) {
    // Get selected text
    selectedText = window.getSelection();
    range = selectedText.getRangeAt( 0 );
    selectedTextString = selectedText.toString();
    headlineStart = headline[0].selectionStart;
    headlineEnd = headline[0].selectionEnd;
    headlineLength = headline[0].length;
    selectionLength = selectedTextString.length;
    // if selected text is just one character
    // for now
    // build in better popup reasons in the future
    if ( selectionLength == 1 ) {
      $( '#popup-quote' ).show();
    }
  };

  var removeQuoteSelector = function ( event ) {
    $( '#popup-quote' ).hide();
  };

  var addQuote = function ( event ) {
    removeQuoteSelector();
    var newQuote = $( this ).html();

    headline.val( headline.val().substring( 0, headlineStart ) + newQuote + headline.val().substring( headlineEnd, headlineLength ) );
  };

  var addEvents = function () {
    headline.bind( 'propertychange change input paste', handleQuotes );
    headline.bind( 'select', addQuoteSelector );
    $( '#popup-quote div' ).on( 'click', addQuote );
  };

  var init = function () {
    addEvents();
  }

  init();

} )( jQuery );
<|endoftext|>


<commit_before>function setup() {
  createCanvas(windowWidth, windowHeight)
}
var x = 0
var y = 5
var countingUp = 1;

function draw() {
  background('white')
  text("Mouse: " + mouseX + ", " + mouseY, 0, 10)
  text("Window: " + windowWidth + ", " + windowHeight, 0, 20)
  text(x, 0, 30)
  fill('yellow')
  ellipse(windowWidth / 2, windowHeight / 2, abs(y - 37), 37)

  translate(width / 2, height / 2);

  strokeWeight(y)
  rotate((PI / 3.0) * x / 1000);
  point(windowWidth / 4, windowHeight / 4);
  y += (1 * countingUp);
  strokeWeight(8)
  rotate(PI)
  point(windowWidth / 6, windowHeight / 6);
  rotate((PI / 3.0) * x / 100);
  point(windowWidth / 8, windowHeight / 8);
  rotate(PI)
  point(windowWidth / 15, windowHeight / 10);
  rotate((PI / 3.0) * x / 100);

  if (y == 75 || y == 5) {
    countingUp *= -1;
  }
  rotate(PI);
  point(windowWidth / 15, windowHeight / 15);
  rotate(PI);
  point(windowWidth / 30, windowHeight / 30);

  x = x + 10

}

function windowResized() {
  resizeCanvas(windowWidth, windowHeight)
}

function mousePressed() {
  noLoop();
}

function mouseReleased() {
  loop();
}<commit_msg>orbits<commit_after>function setup() {
  createCanvas(windowWidth, windowHeight)
}
var x = 0
var y = 5
var countingUp = 1;

function draw() {
  background(5)
  fill('white')
  text("Mouse: " + mouseX + ", " + mouseY, 0, 10)
  text("Window: " + windowWidth + ", " + windowHeight, 0, 20)
  text(x, 0, 30)
  fill('#FFF400')
  ellipse(windowWidth / 2, windowHeight / 2, abs(y + 1), abs(y + 1))

  translate(width / 2, height / 2);
stroke('#E32173')
  strokeWeight(y)
  rotate((PI / 3.0) * x / 1000);
  point(windowWidth / 4, windowHeight / 4);
  y += (1 * countingUp);
  strokeWeight(8)
  rotate(PI)
  stroke('#70E6BF')
  point(windowWidth / 6, windowHeight / 6);
  rotate((PI / 3.0) * x / 100);
  stroke('#EDB538')
  point(windowWidth / 8, windowHeight / 8);
  rotate(PI)
  stroke('#FF6600')
  point(windowWidth / 15, windowHeight / 10);
  rotate((PI / 3.0) * x / 100);

  if (y == 75 || y == 5) {
    countingUp *= -1;
  }
  rotate(PI);
  stroke('#FFEBFF')
  point(windowWidth / 15, windowHeight / 15);
  rotate(PI);
  stroke('#4FC2A1')
  point(windowWidth / 30, windowHeight / 30);

  x = x + 10

}

function windowResized() {
  resizeCanvas(windowWidth, windowHeight)
}

function mousePressed() {
  noLoop();
}

function mouseReleased() {
  loop();
}<|endoftext|>


<commit_before>/**Highcharts Glow Effects
Created Summer 2016
Author: Branden Keck
www.brandenkeck.com
你好，世界*/

/**Copyright (c) <2016> <Branden Keck>
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.*/

var hgeStoreColor = new Array();
var hgeCurrColor = new Array();
var hgeIsSelected = new Array();
var hgeUserInterval = new Array();
var hgeCharts = new Array();
var hgeChartNumber = 0;

function hgeAddHoverRainbow(myChart, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 1);
		}
		hgeInitHover(myChart, c, i, f1, f2);
	}
}

function hgeAddSelectRainbow(myChart, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 1);
		}
		hgeInitSelect(myChart, c, i, f1, f2);
	}
}

function hgeAddHoverFlash(myChart, color, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 2, color);
		}
		hgeInitHover(myChart, c, i, f1, f2);
	}
}

function hgeAddSelectFlash(myChart, color, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 2, color);
		}
		hgeInitSelect(myChart, c, i, f1, f2);
	}
}

function hgeAddHoverBlink(myChart, color, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 3, color);
		}
		hgeInitHover(myChart, c, i, f1, f2);
	}
}

function hgeAddSelectBlink(myChart, color, f1, f2){
	var c = hgeChartNumber;
	hgeChartNumber++;
	hgePushCharts(myChart);
	for(var i=0; i<myChart.series.length; i++){
		hgePushRows(c);
		for(j=0; j<myChart.series[i].data.length; j++){
			hgePushColumns(myChart, c, i, j);
			hgeSetGlowColor(c, i, j, 3, color);
		}
		hgeInitSelect(myChart, c, i, f1, f2);
	}
}

function hgeInitHover(chart, c, i, f1, f2){
	if(f1 == undefined){f1 = function(){};}
	if(f2 == undefined){f2 = function(){};}
	chart.series[i].update({
		point: {
			events: {
				mouseOver: function(){
					hgeLogSelection(c, this.series.index, this.x, this.color, f1, f2);
				},
				mouseOut: function(){
					hgeLogSelection(c, this.series.index, this.x, this.color, f1, f2);
				},
			},
		},
		states: {
			hover: {
				enabled: false,
			}
		}
	});
}

function hgeInitSelect(chart, c, i, f1, f2){
	if(f1 == undefined){f1 = function(){};}
	if(f2 == undefined){f2 = function(){};}
	chart.series[i].update({
		allowPointSelect: false,
		events: {
			click: function(event){
				hgeLogSelection(c, this.index, event.point.x, event.point.color, f1, f2);
			},
		},
		states: {
			select: {
				enabled: false,
			}
		}
	});
}

function hgePushCharts(chart){
	hgeCharts.push(chart);
	hgeIsSelected.push([]);
	hgeStoreColor.push([]);
	hgeCurrColor.push([]);
	hgeUserInterval.push([]);
}

function hgePushRows(c){
	hgeIsSelected[c].push([]);
	hgeStoreColor[c].push([]);
	hgeCurrColor[c].push([]);
	hgeUserInterval[c].push([]);
}

function hgePushColumns(myChart, c, i, j){
	hgeIsSelected[c][i].push(false);
	hgeStoreColor[c][i].push(myChart.series[i].data[j].color);
	hgeCurrColor[c][i].push(myChart.series[i].data[j].color);
	hgeUserInterval[c][i].push([]);
}

function hgeSetGlowColor(c, k, x, type, choice){
	var onett = 0;
	var twoson = 0;
	var threed = 0;
	var ness = 0;
	var jeff = 0;
	var cHex = "#000000";

	var ogHex = hgeHexToRgb(hgeStoreColor[c][k][x]);
	if(ogHex==undefined){
		var hexFind;
		hexFind=hgeStoredColorValues(hgeStoreColor[c][k][x]);
		ogHex = hgeHexToRgb(hexFind);
	}
	if(ogHex==undefined){
		ogHex = hgeHexToRgb("#000000");
	}

	if(choice == undefined){choice = "#FFFFFF";}
	var newHex = hgeHexToRgb(choice);
	if(newHex==undefined){
		var hexFind;
		hexFind=hgeStoredColorValues(choice);
		newHex = hgeHexToRgb(hexFind);
	}
	if(newHex==undefined){
		newHex = hgeHexToRgb("#FFFFFF");
	}

	switch(type){
		case 1:
			hgeSI1 = setInterval(function(){
				onett+=1;
				if(onett>200){onett=0;}
				twoson+=1;
				if(twoson>350){twoson=0;}
				threed+=1;
				if(threed>500){threed=0;}
				red = parseInt(Math.abs(220*Math.sin(2*onett/200*Math.PI)));
				green = parseInt(Math.abs(220*Math.sin(2*(twoson)/350*Math.PI)));
				blue = parseInt(Math.abs(220*Math.sin(2*(threed)/500*Math.PI)));
				hgeCurrColor[c][k][x] = hgeRGBToHex(red, green, blue);
			}, 20);
		break;
		case 2:
			hgeSI2 = setInterval(function(){
				ness+=1;
				if(ness>100){ness=0;}
				jeff = Math.abs(Math.sin(2*Math.PI*ness/100));
				red = parseInt(((1 - jeff) * newHex.r) + (jeff * ogHex.r));
				green = parseInt(((1 - jeff) * newHex.g) + (jeff * ogHex.g));
				blue = parseInt(((1 - jeff) * newHex.b) + (jeff * ogHex.b));
				hgeCurrColor[c][k][x] = hgeRGBToHex(red, green, blue);
			}, 20);
		break;
		case 3:
			hgeSI3 = setInterval(function(){
				if(ness == 0){
					hgeCurrColor[c][k][x] = hgeRGBToHex(newHex.r, newHex.g, newHex.b);
					ness = 1;
				}
				else{
					hgeCurrColor[c][k][x] = hgeRGBToHex(ogHex.r, ogHex.g, ogHex.b);
					ness = 0;
				}
			}, 400);
		break;
	}
}

function hgeGetGlowColor(c, k, x){
	hgeUserInterval[c][k][x] = setInterval(function(){
		hexColor = hgeCurrColor[c][k][x];
		hgeCharts[c].series[k].data[x].update({color: hexColor});
	}, 10);
}

function hgeRemoveGlowColor(c, k, x){
	clearInterval(hgeUserInterval[c][k][x]);
	hgeCharts[c].series[k].data[x].update({color: hgeStoreColor[c][k][x]});
}

function hgeLogSelection(c, k, x, color, onSelect, onUnselect){

	if(!hgeIsSelected[c][k][x]){
		hgeIsSelected[c][k][x] = true;
		hgeGetGlowColor(c, k, x);
		if(hgeIsAFunction(onSelect)){onSelect();}
		else{console.log("Error: function not found");}
	}
	else{
		hgeIsSelected[c][k][x] = false;
		hgeRemoveGlowColor(c, k, x);
		if(hgeIsAFunction(onUnselect)){onUnselect();}
		else{console.log("Error: function not found");}
	}

}

function hgeGetSelected(){
	var hgeSelected = [];
	for(var b=0; b<hgeIsSelected.length; b++){
		for(var m=0; m<hgeIsSelected[b].length; m++){
			for(var k=0; k<hgeIsSelected[b][m].length; k++){
				if(hgeIsSelected[b][m][k]){
					hgeSelected.push({'chart': hgeCharts[b], 'series': m, 'point': k});
				}
			}
		}
	}

	return hgeSelected;
}

/**Code below this point was recreated using similar code from stackoverflow.com
and is being redistributed in this free plug-in within the terms of the creative
commons license*/

function hgeIsAFunction(checkMe) {
	var eString = {};
	return checkMe && eString.toString.call(checkMe) === '[object Function]';
}

function hgeRGBToHex(r, g, b) {
    return "#" + hgeComponentToHex(r) + hgeComponentToHex(g) + hgeComponentToHex(b);
}

function hgeComponentToHex(c) {
    var hex = c.toString(16);
    return hex.length == 1 ? "0" + hex : hex;
}

function hgeHexToRgb(hex) {
    var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
    return result ? {r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16)} : null;
}

function hgeStoredColorValues(c){
	var colours = {"aliceblue":"#f0f8ff","antiquewhite":"#faebd7","aqua":"#00ffff","aquamarine":"#7fffd4","azure":"#f0ffff",
    "beige":"#f5f5dc","bisque":"#ffe4c4","black":"#000000","blanchedalmond":"#ffebcd","blue":"#0000ff","blueviolet":"#8a2be2","brown":"#a52a2a","burlywood":"#deb887",
    "cadetblue":"#5f9ea0","chartreuse":"#7fff00","chocolate":"#d2691e","coral":"#ff7f50","cornflowerblue":"#6495ed","cornsilk":"#fff8dc","crimson":"#dc143c","cyan":"#00ffff",
    "darkblue":"#00008b","darkcyan":"#008b8b","darkgoldenrod":"#b8860b","darkgray":"#a9a9a9","darkgreen":"#006400","darkkhaki":"#bdb76b","darkmagenta":"#8b008b","darkolivegreen":"#556b2f",
    "darkorange":"#ff8c00","darkorchid":"#9932cc","darkred":"#8b0000","darksalmon":"#e9967a","darkseagreen":"#8fbc8f","darkslateblue":"#483d8b","darkslategray":"#2f4f4f","darkturquoise":"#00ced1",
    "darkviolet":"#9400d3","deeppink":"#ff1493","deepskyblue":"#00bfff","dimgray":"#696969","dodgerblue":"#1e90ff",
    "firebrick":"#b22222","floralwhite":"#fffaf0","forestgreen":"#228b22","fuchsia":"#ff00ff",
    "gainsboro":"#dcdcdc","ghostwhite":"#f8f8ff","gold":"#ffd700","goldenrod":"#daa520","gray":"#808080","green":"#008000","greenyellow":"#adff2f",
    "honeydew":"#f0fff0","hotpink":"#ff69b4",
    "indianred ":"#cd5c5c","indigo":"#4b0082","ivory":"#fffff0","khaki":"#f0e68c",
    "lavender":"#e6e6fa","lavenderblush":"#fff0f5","lawngreen":"#7cfc00","lemonchiffon":"#fffacd","lightblue":"#add8e6","lightcoral":"#f08080","lightcyan":"#e0ffff","lightgoldenrodyellow":"#fafad2",
    "lightgrey":"#d3d3d3","lightgreen":"#90ee90","lightpink":"#ffb6c1","lightsalmon":"#ffa07a","lightseagreen":"#20b2aa","lightskyblue":"#87cefa","lightslategray":"#778899","lightsteelblue":"#b0c4de",
    "lightyellow":"#ffffe0","lime":"#00ff00","limegreen":"#32cd32","linen":"#faf0e6",
    "magenta":"#ff00ff","maroon":"#800000","mediumaquamarine":"#66cdaa","mediumblue":"#0000cd","mediumorchid":"#ba55d3","mediumpurple":"#9370d8","mediumseagreen":"#3cb371","mediumslateblue":"#7b68ee",
    "mediumspringgreen":"#00fa9a","mediumturquoise":"#48d1cc","mediumvioletred":"#c71585","midnightblue":"#191970","mintcream":"#f5fffa","mistyrose":"#ffe4e1","moccasin":"#ffe4b5",
    "navajowhite":"#ffdead","navy":"#000080",
    "oldlace":"#fdf5e6","olive":"#808000","olivedrab":"#6b8e23","orange":"#ffa500","orangered":"#ff4500","orchid":"#da70d6",
    "palegoldenrod":"#eee8aa","palegreen":"#98fb98","paleturquoise":"#afeeee","palevioletred":"#d87093","papayawhip":"#ffefd5","peachpuff":"#ffdab9","peru":"#cd853f","pink":"#ffc0cb","plum":"#dda0dd","powderblue":"#b0e0e6","purple":"#800080",
    "red":"#ff0000","rosybrown":"#bc8f8f","royalblue":"#4169e1",
    "saddlebrown":"#8b4513","salmon":"#fa8072","sandybrown":"#f4a460","seagreen":"#2e8b57","seashell":"#fff5ee","sienna":"#a0522d","silver":"#c0c0c0","skyblue":"#87ceeb","slateblue":"#6a5acd","slategray":"#708090","snow":"#fffafa","springgreen":"#00ff7f","steelblue":"#4682b4",
    "tan":"#d2b48c","teal":"#008080","thistle":"#d8bfd8","tomato":"#ff6347","turquoise":"#40e0d0",
    "violet":"#ee82ee",
    "wheat":"#f5deb3","white":"#ffffff","whitesmoke":"#f5f5f5",
    "yellow":"#ffff00","yellowgreen":"#9acd32"};

    if (typeof colours[c.toLowerCase()] != 'undefined'){
        return colours[c.toLowerCase()];
	}
}

/*window.onload = function(){
	hgeChartNumber = 0;
}*/<commit_msg>Delete highchartsGlowEffects.js<commit_after><|endoftext|>


<commit_before>
/*
 * Copyright (c) Burak Arslan (burak.arslan-qx@arskom.com.tr).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the Arskom Consultancy Ltd. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

qx.Class.define("soap.test.SoaplibInterop", { extend : qx.dev.unit.TestCase,
    construct : function() {
        this.c = new soap.Client('http://'+document.location.host+'/app/');
        try {
            this.c.easy("!_name_!");
        }
        catch(e) {

        }
        this.ns = "soaplib.test.interop.server._service";
        qx.log.Logger.debug("hey.");
    }

    ,members : {
          c : null
         ,ns: null

        // helper functions

        ,__test_echo: function(service_name, val, cb) {
            var ctx = this;

            ctx.c.easy(service_name
                ,val
                ,function(r) {
                    ctx.resume(function() {
                        if (cb) {
                            cb(r,val)
                        }
                        else {
                            ctx.assertEquals(r, val);
                        }
                    });
                });
            ctx.wait();
        }

        ,__test_echo_array: function(service_name, val, cb) {
            var ctx = this;

            ctx.__test_echo(service_name, val, function(r,v) {
                for (var i=0,l=r.length; i<l; ++i) {
                    if (cb) {
                        cb(r,v,i);
                    }
                    else {
                        ctx.assertEquals(r[i], val[i]);
                    }
                }
            });
        }

        // primitive tests

        ,test_echo_string : function() {
            var service_name = "echo_string";

            var val = "punk üğışçöÜĞİŞÇÖ";

            this.__test_echo(service_name, val);
        }

        ,__get_xml_test_val : function() {
            var doc = qx.xml.Document.create();
            var sub=soap.Client.createSubElementNS(doc, doc, "test_sub", "test_ns");
            var subsub1=soap.Client.createSubElementNS(doc, sub, "test_subsub1", "test_ns");
            var subsubsub1=soap.Client.createSubElementNS(doc, subsub1, "test_subsubsub1", "test_ns");
            var subsub2=soap.Client.createSubElementNS(doc, sub, "test_subsubsub1", "test_ns");
            var subsub3=soap.Client.createSubElementNS(doc, sub, "test_subsubsub1", "test_ns");

            subsub2.nodeValue = "subsub2 value";
            subsub3.nodeValue = "subsub3 value";
            subsubsub1.nodeValue = "subsubsub1 value";

            return sub;
        }

        ,test_echo_any : function() {
            var service_name = "echo_any";

            var val = this.__get_xml_test_val();

            this.__test_echo(service_name, val);
        }

        ,test_echo_any_as_dict : function() {
            var service_name = "echo_any_as_dict";

            var val = this.__get_xml_test_val();

            this.__test_echo(service_name, val);
        }

        ,test_echo_integer : function() {
            var service_name = "echo_integer";

            var val = 10;

            this.__test_echo(service_name, val);
        }

        ,test_echo_float : function() {
            var service_name = "echo_float";

            var val = 10.1;

            this.__test_echo(service_name, val);
        }

        ,test_echo_double : function() {
            var service_name = "echo_double";

            var val = 123132123.124;

            this.__test_echo(service_name, val);
        }

        ,test_echo_boolean : function() {
            var service_name = "echo_boolean";

            var val = true;

            this.__test_echo(service_name, val);
        }

        ,test_echo_datetime : function() {
            var service_name = "echo_datetime";

            var ctx = this;
            var val = new Date();

            this.__test_echo(service_name, val, function(r,v) {
                ctx.assertEquals(r.getTime(), v.getTime());
            });
        }

        // array tests

        ,test_echo_integer_array : function() {
            var service_name = "echo_integer_array";

            var val = [1,3,5,7,11];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_string_array : function() {
            var service_name = "echo_string_array";

            var val = ["hobaaa", "bir", "punk", "üğışçöÜĞİŞÇÖ"];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_float_array : function() {
            var service_name = "echo_float_array";

            var val = [1.1, 3.3, 5.5, 7.7, 11.11];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_double_array : function() {
            var service_name = "echo_double_array";

            var val = [1123123123.12, 12.34];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_boolean_array : function() {
            var service_name = "echo_boolean_array";

            var val = [true,false,true];

            this.__test_echo_array(service_name, val);
        }

        // complex object tests

        ,__test_simple_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
        }

        ,__test_nested_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
            this.assertEquals(r.get_f(), v.get_f());

            for (var i=0; i<r.get_simple().length; ++i) {
                this.__test_simple_class(r.get_simple()[i], v.get_simple()[i]);
            }

            this.__test_other_class(r.get_other(), v.get_other());
        }

        ,__test_other_class : function(r,v) {
            this.assertEquals(r.get_dt().getTime(), v.get_dt().getTime());
            this.assertEquals(r.get_d(), v.get_d());
            this.assertEquals(r.get_b(), v.get_b());
        }

        ,__test_non_nillable_class : function(r,v) {
            this.assertEquals(r.get_dt().getTime(), v.get_dt().getTime());
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
        }

        ,__test_extended_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
            this.assertEquals(r.get_f(), v.get_f());

            for (var i=0; i<r.get_simple().length; ++i) {
                this.__test_simple_class(r.get_simple()[i], v.get_simple()[i]);
            }

            this.__test_other_class(r.get_other(), v.get_other());
            this.__test_non_nillable_class(r.get_p(), v.get_p());
            this.assertEquals(r.get_l().getTime(), v.get_l().getTime());
            this.assertEquals(r.get_q(), v.get_q());
        }

        ,test_echo_simple_class : function() {
            var service_name = "echo_simple_class";
            var ctx = this;

            var val = this.c.get_object(ctx.ns,"SimpleClass");
            val.set_i(45);
            val.set_s("asd");

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_simple_class(r,v);
            });
        }

        ,test_echo_simple_class_array : function() {
            var service_name = "echo_simple_class_array";
            var ctx = this;
            var val = []

            val.push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.push(this.c.get_object(ctx.ns,"SimpleClass"));

            val[0].set_i(45);
            val[0].set_s("asd");

            val[1].set_i(12);
            val[1].set_s("qwe");

            this.__test_echo_array(service_name, val, function(r,v,i) {
                ctx.__test_simple_class(r[i],v[i]);
            });
        }

        ,test_echo_nested_class : function() {
            var service_name = "echo_nested_class";
            var ctx = this;
            var val = this.c.get_object(ctx.ns,"NestedClass");

            val.set_i(45);
            val.set_s("asd");
            val.set_f(12.34);

            val.set_simple([]);
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

            val.get_simple()[0].set_i(45);
            val.get_simple()[0].set_s("asd");
            val.get_simple()[1].set_i(12);
            val.get_simple()[1].set_s("qwe");

            val.set_other(this.c.get_object(ctx.ns,"OtherClass"));
            val.get_other().set_dt(new Date(2010,05,02));
            val.get_other().set_d(123.456);
            val.get_other().set_b(true);

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_nested_class(r,v);
            });
        }

        ,test_echo_nested_class_array : function() {
            var service_name = "echo_nested_class_array";
            var ctx = this;
            var val = []

            val.push(this.c.get_object(ctx.ns,"NestedClass"));
            val.push(this.c.get_object(ctx.ns,"NestedClass"));

            for (var i=0; i< val.length; ++i) {
                val[i].set_i(45 + i);
                val[i].set_s("asd" + i);
                val[i].set_f(12.34 + i);

                val[i].set_simple([]);
                val[i].get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
                val[i].get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

                val[i].get_simple()[0].set_i(45 + i);
                val[i].get_simple()[0].set_s("asd"  + i);
                val[i].get_simple()[1].set_i(12 + i);
                val[i].get_simple()[1].set_s("qwe" + i);

                val[i].set_other(this.c.get_object(ctx.ns,"OtherClass"));
                val[i].get_other().set_dt(new Date(new Date().getTime() + i));
                val[i].get_other().set_d(123.456 + i);
                val[i].get_other().set_b(true);
            }

            this.__test_echo_array(service_name, val, function(r,v,i) {
                ctx.__test_nested_class(r[i],v[i]);
            });
        }

        ,test_echo_extension_class : function() {
            var service_name = "echo_extension_class";
            var ctx = this;
            var val = this.c.get_object(ctx.ns,"ExtensionClass");

            val.set_i(45);
            val.set_s("asd");
            val.set_f(12.34);

            val.set_simple([]);
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

            val.get_simple()[0].set_i(45);
            val.get_simple()[0].set_s("asd");
            val.get_simple()[1].set_i(12);
            val.get_simple()[1].set_s("qwe");

            val.set_other(this.c.get_object(ctx.ns,"OtherClass"));
            val.get_other().set_dt(new Date(2010,05,02));
            val.get_other().set_d(123.456);
            val.get_other().set_b(true);

            val.set_p(this.c.get_object(ctx.ns,"NonNillableClass"));
            val.get_p().set_dt(new Date(2010,06,02));
            val.get_p().set_i(123);
            val.get_p().set_s("punk");

            val.set_l(new Date(2010,07,02));
            val.set_q(5);

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_extended_class(r,v);
            });
        }

        // misc tests
        ,test_empty: function() {
            var ctx=this;
            var service_name = "test_empty";

            ctx.c.easy(service_name
                ,function(r) {
                    ctx.resume(function() {

                    });
                });
            ctx.wait();
        }

        ,test_multi_param: function() {
            var service_name = "multi_param";
            var ctx=this;
            ctx.c.easy(service_name
                ,"string"
                ,123
                ,new Date()
                ,function(r) {
                    ctx.resume(function() {

                    });
                });
            ctx.wait();
        }

        ,test_return_only: function() {
            var service_name = "return_only";
            var ctx=this;
            ctx.c.easy(service_name
                ,function(r) {
                    ctx.resume(function() {
                        ctx.assertEquals(r, 'howdy');
                    });
                });
            ctx.wait();
        }

        ,test_alternate_name: function() {
            var service_name = "do_something";
            var ctx=this;
            var val = 'punk';

            ctx.c.easy(service_name
                ,'punk'
                ,function(r) {
                    ctx.resume(function() {
                        ctx.assertEquals(r, val);
                    });
                });
            ctx.wait();
        }
    }
});
<commit_msg>fix values<commit_after>
/*
 * Copyright (c) Burak Arslan (burak.arslan-qx@arskom.com.tr).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the Arskom Consultancy Ltd. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

qx.Class.define("soap.test.SoaplibInterop", { extend : qx.dev.unit.TestCase,
    construct : function() {
        this.c = new soap.Client('http://'+document.location.host+'/app/');
        try {
            this.c.easy("!_name_!");
        }
        catch(e) {

        }
        this.ns = "soaplib.test.interop.server._service";
        qx.log.Logger.debug("hey.");
    }

    ,members : {
          c : null
         ,ns: null

        // helper functions

        ,__test_echo: function(service_name, val, cb) {
            var ctx = this;

            ctx.c.easy(service_name
                ,val
                ,function(r) {
                    ctx.resume(function() {
                        if (cb) {
                            cb(r,val)
                        }
                        else {
                            ctx.assertEquals(r, val);
                        }
                    });
                });
            ctx.wait();
        }

        ,__test_echo_array: function(service_name, val, cb) {
            var ctx = this;

            ctx.__test_echo(service_name, val, function(r,v) {
                for (var i=0,l=r.length; i<l; ++i) {
                    if (cb) {
                        cb(r,v,i);
                    }
                    else {
                        ctx.assertEquals(r[i], val[i]);
                    }
                }
            });
        }

        // primitive tests

        ,test_echo_string : function() {
            var service_name = "echo_string";

            var val = "punk üğışçöÜĞİŞÇÖ";

            this.__test_echo(service_name, val);
        }

        ,__get_xml_test_val : function() {
            var doc = qx.xml.Document.create();
            var sub=soap.Client.createSubElementNS(doc, doc, "test_sub", "test_ns");
            var subsub1=soap.Client.createSubElementNS(doc, sub, "test_subsub1", "test_ns");
            var subsubsub1=soap.Client.createSubElementNS(doc, subsub1, "test_subsubsub1", "test_ns");
            var subsub2=soap.Client.createSubElementNS(doc, sub, "test_subsub2", "test_ns");
            var subsub3=soap.Client.createSubElementNS(doc, sub, "test_subsub3", "test_ns");

            subsubsub1.nodeValue = "subsubsub1 value";
            subsub2.nodeValue = "subsub2 value";
            subsub3.nodeValue = "subsub3 value";

            return sub;
        }

        ,test_echo_any : function() {
            var service_name = "echo_any";

            var val = this.__get_xml_test_val();

            this.__test_echo(service_name, val);
        }

        ,test_echo_any_as_dict : function() {
            var service_name = "echo_any_as_dict";

            var val = this.__get_xml_test_val();

            this.__test_echo(service_name, val);
        }

        ,test_echo_integer : function() {
            var service_name = "echo_integer";

            var val = 10;

            this.__test_echo(service_name, val);
        }

        ,test_echo_float : function() {
            var service_name = "echo_float";

            var val = 10.1;

            this.__test_echo(service_name, val);
        }

        ,test_echo_double : function() {
            var service_name = "echo_double";

            var val = 123132123.124;

            this.__test_echo(service_name, val);
        }

        ,test_echo_boolean : function() {
            var service_name = "echo_boolean";

            var val = true;

            this.__test_echo(service_name, val);
        }

        ,test_echo_datetime : function() {
            var service_name = "echo_datetime";

            var ctx = this;
            var val = new Date();

            this.__test_echo(service_name, val, function(r,v) {
                ctx.assertEquals(r.getTime(), v.getTime());
            });
        }

        // array tests

        ,test_echo_integer_array : function() {
            var service_name = "echo_integer_array";

            var val = [1,3,5,7,11];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_string_array : function() {
            var service_name = "echo_string_array";

            var val = ["hobaaa", "bir", "punk", "üğışçöÜĞİŞÇÖ"];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_float_array : function() {
            var service_name = "echo_float_array";

            var val = [1.1, 3.3, 5.5, 7.7, 11.11];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_double_array : function() {
            var service_name = "echo_double_array";

            var val = [1123123123.12, 12.34];

            this.__test_echo_array(service_name, val);
        }

        ,test_echo_boolean_array : function() {
            var service_name = "echo_boolean_array";

            var val = [true,false,true];

            this.__test_echo_array(service_name, val);
        }

        // complex object tests

        ,__test_simple_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
        }

        ,__test_nested_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
            this.assertEquals(r.get_f(), v.get_f());

            for (var i=0; i<r.get_simple().length; ++i) {
                this.__test_simple_class(r.get_simple()[i], v.get_simple()[i]);
            }

            this.__test_other_class(r.get_other(), v.get_other());
        }

        ,__test_other_class : function(r,v) {
            this.assertEquals(r.get_dt().getTime(), v.get_dt().getTime());
            this.assertEquals(r.get_d(), v.get_d());
            this.assertEquals(r.get_b(), v.get_b());
        }

        ,__test_non_nillable_class : function(r,v) {
            this.assertEquals(r.get_dt().getTime(), v.get_dt().getTime());
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
        }

        ,__test_extended_class : function(r,v) {
            this.assertEquals(r.get_i(), v.get_i());
            this.assertEquals(r.get_s(), v.get_s());
            this.assertEquals(r.get_f(), v.get_f());

            for (var i=0; i<r.get_simple().length; ++i) {
                this.__test_simple_class(r.get_simple()[i], v.get_simple()[i]);
            }

            this.__test_other_class(r.get_other(), v.get_other());
            this.__test_non_nillable_class(r.get_p(), v.get_p());
            this.assertEquals(r.get_l().getTime(), v.get_l().getTime());
            this.assertEquals(r.get_q(), v.get_q());
        }

        ,test_echo_simple_class : function() {
            var service_name = "echo_simple_class";
            var ctx = this;

            var val = this.c.get_object(ctx.ns,"SimpleClass");
            val.set_i(45);
            val.set_s("asd");

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_simple_class(r,v);
            });
        }

        ,test_echo_simple_class_array : function() {
            var service_name = "echo_simple_class_array";
            var ctx = this;
            var val = []

            val.push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.push(this.c.get_object(ctx.ns,"SimpleClass"));

            val[0].set_i(45);
            val[0].set_s("asd");

            val[1].set_i(12);
            val[1].set_s("qwe");

            this.__test_echo_array(service_name, val, function(r,v,i) {
                ctx.__test_simple_class(r[i],v[i]);
            });
        }

        ,test_echo_nested_class : function() {
            var service_name = "echo_nested_class";
            var ctx = this;
            var val = this.c.get_object(ctx.ns,"NestedClass");

            val.set_i(45);
            val.set_s("asd");
            val.set_f(12.34);

            val.set_simple([]);
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

            val.get_simple()[0].set_i(45);
            val.get_simple()[0].set_s("asd");
            val.get_simple()[1].set_i(12);
            val.get_simple()[1].set_s("qwe");

            val.set_other(this.c.get_object(ctx.ns,"OtherClass"));
            val.get_other().set_dt(new Date(2010,05,02));
            val.get_other().set_d(123.456);
            val.get_other().set_b(true);

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_nested_class(r,v);
            });
        }

        ,test_echo_nested_class_array : function() {
            var service_name = "echo_nested_class_array";
            var ctx = this;
            var val = []

            val.push(this.c.get_object(ctx.ns,"NestedClass"));
            val.push(this.c.get_object(ctx.ns,"NestedClass"));

            for (var i=0; i< val.length; ++i) {
                val[i].set_i(45 + i);
                val[i].set_s("asd" + i);
                val[i].set_f(12.34 + i);

                val[i].set_simple([]);
                val[i].get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
                val[i].get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

                val[i].get_simple()[0].set_i(45 + i);
                val[i].get_simple()[0].set_s("asd"  + i);
                val[i].get_simple()[1].set_i(12 + i);
                val[i].get_simple()[1].set_s("qwe" + i);

                val[i].set_other(this.c.get_object(ctx.ns,"OtherClass"));
                val[i].get_other().set_dt(new Date(new Date().getTime() + i));
                val[i].get_other().set_d(123.456 + i);
                val[i].get_other().set_b(true);
            }

            this.__test_echo_array(service_name, val, function(r,v,i) {
                ctx.__test_nested_class(r[i],v[i]);
            });
        }

        ,test_echo_extension_class : function() {
            var service_name = "echo_extension_class";
            var ctx = this;
            var val = this.c.get_object(ctx.ns,"ExtensionClass");

            val.set_i(45);
            val.set_s("asd");
            val.set_f(12.34);

            val.set_simple([]);
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));
            val.get_simple().push(this.c.get_object(ctx.ns,"SimpleClass"));

            val.get_simple()[0].set_i(45);
            val.get_simple()[0].set_s("asd");
            val.get_simple()[1].set_i(12);
            val.get_simple()[1].set_s("qwe");

            val.set_other(this.c.get_object(ctx.ns,"OtherClass"));
            val.get_other().set_dt(new Date(2010,05,02));
            val.get_other().set_d(123.456);
            val.get_other().set_b(true);

            val.set_p(this.c.get_object(ctx.ns,"NonNillableClass"));
            val.get_p().set_dt(new Date(2010,06,02));
            val.get_p().set_i(123);
            val.get_p().set_s("punk");

            val.set_l(new Date(2010,07,02));
            val.set_q(5);

            this.__test_echo(service_name, val, function(r,v) {
                ctx.__test_extended_class(r,v);
            });
        }

        // misc tests
        ,test_empty: function() {
            var ctx=this;
            var service_name = "test_empty";

            ctx.c.easy(service_name
                ,function(r) {
                    ctx.resume(function() {

                    });
                });
            ctx.wait();
        }

        ,test_multi_param: function() {
            var service_name = "multi_param";
            var ctx=this;
            ctx.c.easy(service_name
                ,"string"
                ,123
                ,new Date()
                ,function(r) {
                    ctx.resume(function() {

                    });
                });
            ctx.wait();
        }

        ,test_return_only: function() {
            var service_name = "return_only";
            var ctx=this;
            ctx.c.easy(service_name
                ,function(r) {
                    ctx.resume(function() {
                        ctx.assertEquals(r, 'howdy');
                    });
                });
            ctx.wait();
        }

        ,test_alternate_name: function() {
            var service_name = "do_something";
            var ctx=this;
            var val = 'punk';

            ctx.c.easy(service_name
                ,'punk'
                ,function(r) {
                    ctx.resume(function() {
                        ctx.assertEquals(r, val);
                    });
                });
            ctx.wait();
        }
    }
});
<|endoftext|>


<commit_before>// SAMPLE
this.manifest = {
    "name": "BetterTweetDeck",
    "icon": "icon.png",
    "settings": [
        {
            "tab": "General",
            "group": "Info",
            "name": "informations",
            "type": "description",
            "text": "

Don't forget to reload any TweetDeck tab after applying your settings
"
        },
        {
            "tab": "General",
            "group": "Time formatting",
            "name": "timestamp",
            "type": "popupButton",
            "label": "Time should be:",
            "options": {
                "values": [
                    {
                        "value": "relative",
                        "text": "Relative (1m, 2h, 3d...)"
                    },
                    {
                        "value": "absolute",
                        "text": "Absolute (dd/mm/yy hh:mm)"
                    },
                    {
                        "value": "absolute_us",
                        "text": "Absolute 'US Style' (mm/dd/yy hh:mm)"
                    }
                ],
            },
        },
        {
            "tab":"General",
            "group":"Time formatting",
            "name":"full_after_24h",
            "type":"checkbox",
            "label":"Display full-time (dd/mm/yy hh:mm) only after 24h"
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "name_display",
            "type": "popupButton",
            "label": "Display name/username as:",
            "options": {
                "values": [
                    {
                        "value": "both",
                        "text": "Full Name @username"
                    },
                    {
                        "value": "inverted",
                        "text": "@Username Full Name"
                    },
                    {
                        "value": "username",
                        "text": "Username only"
                    },
                    {
                        "value": "fullname",
                        "text": "Fullname only"
                    }
                ],
            },
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "typeahead_display_username_only",
            "type": "checkbox",
            "label": "In the mention helper display the username only"
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "circled_avatars",
            "type": "checkbox",
            "label": "Display rounded avatars (it's fancy!)"
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "reduced_padding",
            "type": "checkbox",
            "label": "Columns take less space"
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "no_columns_icons",
            "type": "checkbox",
            "label": "Display icons in column headers",
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "grayscale_notification_icons",
            "type": "checkbox",
            "label": "Icons in Notification column should be in grayscales"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "yt_rm_button",
            "type": "checkbox",
            "label": "Hide play button on YouTube previews"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "url_redirection",
            "type": "checkbox",
            "label": "Remove t.co redirection"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview",
            "type": "popupButton",
            "label": " Size of non-Twitter thumbnails displayed",
            "options": {
                "values": [
                    {
                        "value": false,
                        "text": "No"
                    },
                    {
                        "value": "small",
                        "text": "Small"
                    },
                    {
                        "value": "medium",
                        "text": "Medium"
                    },
                    {
                        "value": "large",
                        "text": "Large"
                    }
                ],
            },
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_imgur",
            "type": "checkbox",
            "label": " Display previews from Imgur"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_tumblr",
            "type": "checkbox",
            "label": " Display previews from Tumblr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_droplr",
            "type": "checkbox",
            "label": " Display previews from Droplr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_instagram",
            "type": "checkbox",
            "label": " Display previews from Instagram"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_flickr",
            "type": "checkbox",
            "label": " Display previews from Flickr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_500px",
            "type": "checkbox",
            "label": " Display previews from 500px"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_cloud",
            "type": "checkbox",
            "label": " Display previews from CloudApp"
        },
        {
            "tab": "About",
            "group": "About",
            "name": "about",
            "type": "description",
            "text": "Thanks for using this extension ! This extension is free, but development takes time, so if you found it useful and want to help me you can give a little money or help me developing it !

BetterTweetDeck on Github

Follow me on Twitter !

"
        },
        {
            "tab": "About",
            "group": "Donation",
            "name": "donate",
            "type": "description",
            "text": "<form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_top'><input type='hidden' name='cmd' value='_s-xclick'><input type='hidden' name='hosted_button_id' value='RRY2KKZLNBJDG'><input type='image' src='https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'></form>"
        }
    ]
};
<commit_msg>Fixed options (typo, logic)<commit_after>// SAMPLE
this.manifest = {
    "name": "BetterTweetDeck",
    "icon": "icon.png",
    "settings": [
        {
            "tab": "General",
            "group": "Info",
            "name": "informations",
            "type": "description",
            "text": "

Don't forget to reload any TweetDeck tab after applying your settings
"
        },
        {
            "tab": "General",
            "group": "Time formatting",
            "name": "timestamp",
            "type": "popupButton",
            "label": "Time should be:",
            "options": {
                "values": [
                    {
                        "value": "relative",
                        "text": "Relative (1m, 2h, 3d...)"
                    },
                    {
                        "value": "absolute",
                        "text": "Absolute (dd/mm/yy hh:mm)"
                    },
                    {
                        "value": "absolute_us",
                        "text": "Absolute 'US Style' (mm/dd/yy hh:mm)"
                    }
                ],
            },
        },
        {
            "tab":"General",
            "group":"Time formatting",
            "name":"full_after_24h",
            "type":"checkbox",
            "label":"Display full-time (dd/mm/yy hh:mm) only after 24h"
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "name_display",
            "type": "popupButton",
            "label": "Display name/username as:",
            "options": {
                "values": [
                    {
                        "value": "both",
                        "text": "Full Name @username"
                    },
                    {
                        "value": "inverted",
                        "text": "@Username Full Name"
                    },
                    {
                        "value": "username",
                        "text": "Username only"
                    },
                    {
                        "value": "fullname",
                        "text": "Fullname only"
                    }
                ],
            },
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "typeahead_display_username_only",
            "type": "checkbox",
            "label": "Only display the username in the mention helper"
        },
        {
            "tab": "General",
            "group": "Users",
            "name": "circled_avatars",
            "type": "checkbox",
            "label": "Display rounded avatars (it's fancy!)"
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "reduced_padding",
            "type": "checkbox",
            "label": "Columns take less space"
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "no_columns_icons",
            "type": "checkbox",
            "label": "No icons in column headers",
        },
        {
            "tab": "General",
            "group": "Appearance",
            "name": "grayscale_notification_icons",
            "type": "checkbox",
            "label": "Icons in Notification column should be in grayscales"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "yt_rm_button",
            "type": "checkbox",
            "label": "Hide play button on YouTube previews"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "url_redirection",
            "type": "checkbox",
            "label": "Remove t.co redirection"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview",
            "type": "popupButton",
            "label": " Size of non-Twitter thumbnails displayed",
            "options": {
                "values": [
                    {
                        "value": "small",
                        "text": "Small"
                    },
                    {
                        "value": "medium",
                        "text": "Medium"
                    },
                    {
                        "value": "large",
                        "text": "Large"
                    }
                ],
            },
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_imgur",
            "type": "checkbox",
            "label": " Display previews from Imgur"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_tumblr",
            "type": "checkbox",
            "label": " Display previews from Tumblr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_droplr",
            "type": "checkbox",
            "label": " Display previews from Droplr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_instagram",
            "type": "checkbox",
            "label": " Display previews from Instagram"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_flickr",
            "type": "checkbox",
            "label": " Display previews from Flickr"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_500px",
            "type": "checkbox",
            "label": " Display previews from 500px"
        },
        {
            "tab": "General",
            "group": "Content",
            "name": "img_preview_cloud",
            "type": "checkbox",
            "label": " Display previews from CloudApp"
        },
        {
            "tab": "About",
            "group": "About",
            "name": "about",
            "type": "description",
            "text": "Thanks for using this extension ! This extension is free, but development takes time, so if you found it useful and want to help me you can give a little money or help me developing it !

BetterTweetDeck on Github

Follow me on Twitter !

"
        },
        {
            "tab": "About",
            "group": "Donation",
            "name": "donate",
            "type": "description",
            "text": "<form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_top'><input type='hidden' name='cmd' value='_s-xclick'><input type='hidden' name='hosted_button_id' value='RRY2KKZLNBJDG'><input type='image' src='https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'></form>"
        }
    ]
};
<|endoftext|>