/*############################################################################## # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################## */ define([ "dojo/_base/declare", "dojo/_base/sniff", "dojo/aspect", "dojo/dom" ], function (declare, sniff, aspect, dom) { return declare(null, { id: "gvc", width: "", height: "", installed: false, markup: "", obj: {}, eventsRegistered: false, onInitialize: function () { // Creater can override. }, onLayoutFinished: function () { // Creater can override. }, onMouseDoubleClick: function (item) { // Creater can override. }, onSelectionChanged: function (items) { // Creater can override. }, // The constructor constructor: function (args, parentNode) { declare.safeMixin(this, args); if (sniff("ie")) { this.installed = (function () { try { var o = new ActiveXObject("HPCCSystems.HPCCSystemsGraphViewControl.1"); return true; } catch (e) { } return false; })(); if (!this.installed) { this.markup = this.getInstallMarkup(); } else { this.markup = ''; } } else { this.installed = (function () { for (var i = 0, p = navigator.plugins, l = p.length; i < l; i++) { if (p[i].name.indexOf("HPCCSystemsGraphViewControl") > -1) { return true; } } return false; })(); if (!this.installed) { this.markup = this.getInstallMarkup(); } else { this.markup = ''; } } parentNode.innerHTML = this.markup; this.obj = dom.byId(this.id); var context = this; setTimeout(function () { context.onInitialize(); }, 20); }, getInstallMarkup: function () { return "
To enable graph views, please install the Graph View Control plugin:
" + "Internet Explorer + Firefox (32bit)