{"size": 1722, "ext": "js", "max_stars_repo_path": "app/utils/Helper.js", "max_stars_repo_name": "erfgoedleiden/kaartviewer", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/utils/Helper.js", "max_issues_repo_name": "erfgoedleiden/kaartviewer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/utils/Helper.js", "max_forks_repo_name": "erfgoedleiden/kaartviewer", "max_forks_repo_forks_event_min_datetime": "2016-12-12T16:33:21.000Z", "max_forks_repo_forks_event_max_datetime": "2017-02-08T12:22:43.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 22.3636363636, "max_line_length": 86, "alphanum_fraction": 0.5569105691}
define(["dojo/cookie", "dojo/has","dojo/_base/array"], function(cookie, has, array){
	/**
	 * Helper
	 * @class Helper
	 * 
	 * Collection of helper functions
	 *
	 * NOTE: Requires Jquery
	 */
	return {
		resetLayout: function()
		{
			$(".region-center").each(function(){
				var l = $(this).siblings(".region-left:visible").outerWidth(),
					r = $(this).siblings(".region-right:visible").outerWidth(),
					t = $(this).siblings(".region-top:visible").outerHeight(),
					b = $(this).siblings(".region-bottom:visible").outerHeight(),
					x = l + r,
					y = t + b;
					if ($("#application-window").width() <= 780 && $(this).attr("id") === "content"){
						y = y - $("#header-text").outerHeight() - 25;
					}
				$(this).css({
					"height" : $(this).parent().outerHeight() - y,
					"width" : $(this).parent().outerWidth() - x
				});
			});
		},

		syncMaps: function(maps,currentMap,extent)
		{
			dojo.forEach(maps,function(map){
				if (map !== currentMap){
					map.setExtent(extent);
				}
			});
		},

		getWebmaps: function(webmaps)
		{
			if(webmaps.indexOf(',') !== -1){
				var mapIds = webmaps.split(',');
				webmapresults = array.map(mapIds, function (mapId) {
					return {
						id: mapId,
						title: ""
					};
				});
			}
			else{
				var previewWebMap = {
					id: webmaps,
					title: ""
				};

				webmapresults = [previewWebMap];
			}
			return webmapresults;
		},

		getWebmapTitles: function(titles)
		{
			if(titles.indexOf(',') !== -1){
				var mapTitles = titles.split(',');
				webmapresults = array.map(mapTitles, function (item) {
					return item;
				});
			}
			else{
				var previewWebMap = titles;

				webmapresults = [previewWebMap];
			}
			return webmapresults;
		}
	}
});