{"size": 1123, "ext": "js", "max_stars_repo_path": "core/components/com_dataviewer/admin/tasks/html/config.js", "max_stars_repo_name": "anthonyfuentes/hubzero-cms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "core/components/com_dataviewer/admin/tasks/html/config.js", "max_issues_repo_name": "anthonyfuentes/hubzero-cms", "max_issues_repo_issues_event_min_datetime": "2019-03-13T11:01:21.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-13T11:01:21.000Z", "max_forks_repo_path": "core/components/com_dataviewer/admin/tasks/html/config.js", "max_forks_repo_name": "anthonyfuentes/hubzero-cms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 26.7380952381, "max_line_length": 88, "alphanum_fraction": 0.6571682992}
/**
 * @package    hubzero-cms
 * @copyright  Copyright 2005-2019 HUBzero Foundation, LLC.
 * @license    http://opensource.org/licenses/MIT MIT
 */


db.dbJQ(document).ready(function($) {

	var editor = ace.edit('db-conf-editor');
	editor.getSession().setUseSoftTabs(false);
	editor.setTheme('ace/theme/github');
	editor.getSession().setMode('ace/mode/json');
	editor.setFontSize('16px');

	$('#db-config-update').on('click', function() {
		$('#db-conf-update-form input[name="conf_text"]').val(editor.getSession().getValue());
		$('#db-conf-update-form').submit();
	});


	var viewer = ace.edit('db-conf-viewer');
	viewer.getSession().setUseSoftTabs(false);
	viewer.setTheme('ace/theme/github');
	viewer.getSession().setMode('ace/mode/json');
	viewer.setFontSize('16px');
	viewer.setReadOnly(true);

	$('#db-config-view').on('click', function() {
		var v = viewer;
		$.get($(this).data('link'), function(data) {
			v.getSession().setValue(data)
			$('#dv-view-conf').dialog({
				title: "Current configuration for the data viewer for this database",
				modal: true,
				height: 600,
				width: 800
			});
		});
	});
});
