(function () { var $ = window.jQuery; // IIFE Wrapped Content Begins: /** This mixin provides an 'ajax' method that can be used to perform ajax requests that respect Discourse paths and the run loop. **/ var _trackView = false; var _transientHeader = null; Discourse.Ajax = Em.Mixin.create({ setTransientHeader: function(k, v) { _transientHeader = {key: k, value: v}; }, viewTrackingRequired: function() { _trackView = true; }, /** Our own $.ajax method. Makes sure the .then method executes in an Ember runloop for performance reasons. Also automatically adjusts the URL to support installs in subfolders. @method ajax **/ ajax: function() { var url, args; var ajax; if (arguments.length === 1) { if (typeof arguments[0] === "string") { url = arguments[0]; args = {}; } else { args = arguments[0]; url = args.url; delete args.url; } } else if (arguments.length === 2) { url = arguments[0]; args = arguments[1]; } if (args.success || args.error) { throw "Discourse.ajax should use promises"; } var performAjax = function(resolve, reject) { args.headers = args.headers || {}; if (_transientHeader) { args.headers[_transientHeader.key] = _transientHeader.value; _transientHeader = null; } if (_trackView && (!args.type || args.type === "GET")) { _trackView = false; // DON'T CHANGE: rack is prepending "HTTP_" in the header's name args.headers['Discourse-Track-View'] = "true"; } args.success = function(data, textStatus, xhr) { if (xhr.getResponseHeader('Discourse-Readonly')) { Ember.run(function() { Discourse.Site.currentProp('isReadOnly', true); }); } if (args.returnXHR) { data = { result: data, xhr: xhr }; } Ember.run(null, resolve, data); }; args.error = function(xhr, textStatus, errorThrown) { // note: for bad CSRF we don't loop an extra request right away. // this allows us to eliminate the possibility of having a loop. if (xhr.status === 403 && xhr.responseText === "['BAD CSRF']") { Discourse.Session.current().set('csrfToken', null); } // If it's a parsererror, don't reject if (xhr.status === 200) return args.success(xhr); // Fill in some extra info xhr.jqTextStatus = textStatus; xhr.requestedUrl = url; Ember.run(null, reject, { jqXHR: xhr, textStatus: textStatus, errorThrown: errorThrown }); }; // We default to JSON on GET. If we don't, sometimes if the server doesn't return the proper header // it will not be parsed as an object. if (!args.type) args.type = 'GET'; if (!args.dataType && args.type.toUpperCase() === 'GET') args.dataType = 'json'; if (args.dataType === "script") { args.headers['Discourse-Script'] = true; } if (args.type === 'GET' && args.cache !== true) { args.cache = false; } ajax = $.ajax(Discourse.getURL(url), args); }; var promise; // For cached pages we strip out CSRF tokens, need to round trip to server prior to sending the // request (bypass for GET, not needed) if(args.type && args.type.toUpperCase() !== 'GET' && !Discourse.Session.currentProp('csrfToken')){ promise = new Ember.RSVP.Promise(function(resolve, reject){ ajax = $.ajax(Discourse.getURL('/session/csrf'), {cache: false}) .success(function(result){ Discourse.Session.currentProp('csrfToken', result.csrf); performAjax(resolve, reject); }); }); } else { promise = new Ember.RSVP.Promise(performAjax); } promise.abort = function(){ if (ajax) { ajax.abort(); } }; return promise; } }); // IIFE Wrapped Content Ends })(this); (function () { var $ = window.jQuery; // IIFE Wrapped Content Begins: /*global Favcount:true*/ var DiscourseResolver = require('discourse/ember/resolver').default; // Allow us to import Ember define('ember', ['exports'], function(__exports__) { __exports__.default = Ember; }); var _pluginCallbacks = []; window.Discourse = Ember.Application.extend(Discourse.Ajax, { rootElement: '#main', _docTitle: document.title, __TAGS_INCLUDED__: true, getURL: function(url) { if (!url) return url; // if it's a non relative URL, return it. if (url !== '/' && !/^\/[^\/]/.test(url)) return url; if (url.indexOf(Discourse.BaseUri) !== -1) return url; if (url[0] !== "/") url = "/" + url; return Discourse.BaseUri + url; }, getURLWithCDN: function(url) { url = this.getURL(url); // only relative urls if (Discourse.CDN && /^\/[^\/]/.test(url)) { url = Discourse.CDN + url; } else if (Discourse.S3CDN) { url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN); } return url; }, Resolver: DiscourseResolver, _titleChanged: function() { var title = this.get('_docTitle') || Discourse.SiteSettings.title; // if we change this we can trigger changes on document.title // only set if changed. if($('title').text() !== title) { $('title').text(title); } var notifyCount = this.get('notifyCount'); if (notifyCount > 0 && !Discourse.User.currentProp('dynamic_favicon')) { title = "(" + notifyCount + ") " + title; } document.title = title; }.observes('_docTitle', 'hasFocus', 'notifyCount'), faviconChanged: function() { if(Discourse.User.currentProp('dynamic_favicon')) { var url = Discourse.SiteSettings.favicon_url; if (/^http/.test(url)) { url = Discourse.getURL("/favicon/proxied?" + encodeURIComponent(url)); } new Favcount(url).set( this.get('notifyCount') ); } }.observes('notifyCount'), // The classes of buttons to show on a post postButtons: function() { return Discourse.SiteSettings.post_menu.split("|").map(function(i) { return i.replace(/\+/, '').capitalize(); }); }.property(), notifyTitle: function(count) { this.set('notifyCount', count); }, notifyBackgroundCountIncrement: function() { if (!this.get('hasFocus')) { this.set('backgroundNotify', true); this.set('notifyCount', (this.get('notifyCount') || 0) + 1); } }, resetBackgroundNotifyCount: function() { if (this.get('hasFocus') && this.get('backgroundNotify')) { this.set('notifyCount', 0); } this.set('backgroundNotify', false); }.observes('hasFocus'), authenticationComplete: function(options) { // TODO, how to dispatch this to the controller without the container? var loginController = Discourse.__container__.lookup('controller:login'); return loginController.authenticationComplete(options); }, /** Start up the Discourse application by running all the initializers we've defined. @method start **/ start: function() { $('noscript').remove(); Object.keys(requirejs._eak_seen).forEach(function(key) { if (/\/pre\-initializers\//.test(key)) { var module = require(key, null, null, true); if (!module) { throw new Error(key + ' must export an initializer.'); } Discourse.initializer(module.default); } }); Object.keys(requirejs._eak_seen).forEach(function(key) { if (/\/initializers\//.test(key)) { var module = require(key, null, null, true); if (!module) { throw new Error(key + ' must export an initializer.'); } var init = module.default; var oldInitialize = init.initialize; init.initialize = function(app) { oldInitialize.call(this, app.container, Discourse); }; Discourse.instanceInitializer(init); } }); // Plugins that are registered via `"; window.open('data:text/html;base64,' + btoa(newWindowContents), windowName); var form = document.createElement("form"); form.setAttribute('id', 'query-download-result'); form.setAttribute('method', 'post'); form.setAttribute('action', Discourse.getURL('/admin/plugins/explorer/queries/' + this.get('query.id') + '/run.' + format + '?download=1')); form.setAttribute('target', windowName); form.setAttribute('style', 'display:none;'); function addInput(name, value) { var field = undefined; field = document.createElement('input'); field.setAttribute('name', name); field.setAttribute('value', value); form.appendChild(field); } addInput('params', JSON.stringify(this.get('params'))); addInput('explain', this.get('hasExplain')); addInput('limit', '1000000'); Discourse.ajax('/session/csrf.json').then(function (csrf) { addInput('authenticity_token', csrf.csrf); document.body.appendChild(form); form.submit(); Em.run.next('afterRender', function () { document.body.removeChild(form); }); }); }, actions: { downloadResultJson: function () { this.downloadResult('json'); }, downloadResultCsv: function () { this.downloadResult('csv'); } }, parent: (function () { return this; }).property() }); __exports__["default"] = QueryResultComponent; }); define("discourse/plugins/discourse-data-explorer/discourse/components/query-row-content", ["discourse/helpers/category-link","discourse/lib/formatter","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; var categoryLinkHTML = __dependency1__.categoryLinkHTML; var autoUpdatingRelativeAge = __dependency2__.autoUpdatingRelativeAge; function icon_or_image_replacement(str, ctx) { str = Ember.get(ctx.contexts[0], str); if (Ember.isEmpty(str)) { return ""; } if (str.indexOf('fa-') === 0) { return new Handlebars.SafeString(""); } else { return new Handlebars.SafeString(""); } } function category_badge_replacement(str, ctx) { var category = Ember.get(ctx.contexts[0], str); return categoryLinkHTML(category, { allowUncategorized: true }); } function bound_date_replacement(str, ctx) { var value = Ember.get(ctx.contexts[0], str); return new Handlebars.SafeString(autoUpdatingRelativeAge(new Date(value), { title: true })); } var esc = Handlebars.Utils.escapeExpression; var QueryRowContentComponent = Ember.Component.extend({ tagName: "tr", render: function (buffer) { var self = this; var row = this.get('row'); var parent = self.get('parent'); var fallback = parent.get('fallbackTemplate'); var helpers = { "icon-or-image": icon_or_image_replacement, "category-link": category_badge_replacement, "reltime": bound_date_replacement }; var parts = this.get('columnTemplates').map(function (t, idx) { var value = row[idx], id = parseInt(value); var ctx = { value: value, id: id, baseuri: Discourse.BaseUri === '/' ? '' : Discourse.BaseUri }; var params = {}; if (row[idx] === null) { return "NULL"; } else if (t.name === "text") { return esc(row[idx]); } var lookupFunc = parent['lookup' + t.name.capitalize()]; if (lookupFunc) { ctx[t.name] = parent['lookup' + t.name.capitalize()](id); } if (t.name === "category" || t.name === "badge" || t.name === "reltime") { // only replace helpers if needed params.helpers = helpers; } try { return new Handlebars.SafeString((t.template || fallback)(ctx, params)); } catch (e) { console.error(e); debugger; return "error"; } }); buffer.push("" + parts.join("") + ""); } }); __exports__["default"] = QueryRowContentComponent; }); define("discourse/plugins/discourse-data-explorer/discourse/components/param-input", ["exports"], function(__exports__) { "use strict"; // import Category from 'discourse/models/category'; var Category = Discourse.Category; var layoutMap = { int: 'int', bigint: 'int', boolean: 'boolean', string: 'generic', time: 'generic', date: 'generic', datetime: 'generic', double: 'string', user_id: 'user_id', post_id: 'string', topic_id: 'generic', category_id: 'generic', group_id: 'generic', badge_id: 'generic', int_list: 'generic', string_list: 'generic', user_list: 'user_list' }; function allowsInputTypeTime() { try { var inp = document.createElement('input'); inp.attributes.type = 'time'; inp.attributes.type = 'date'; return true; } catch (e) { return false; } } __exports__["default"] = Ember.Component.extend({ classNameBindings: ['valid:valid:invalid', ':param'], boolTypes: [{ name: I18n.t('explorer.types.bool.true'), id: 'Y' }, { name: I18n.t('explorer.types.bool.false'), id: 'N' }, { name: I18n.t('explorer.types.bool.null_'), id: '#null' }], value: (function (key, value, previousValue) { if (arguments.length > 1) { this.get('params')[this.get('info.identifier')] = value.toString(); } return this.get('params')[this.get('info.identifier')]; }).property('params', 'info.identifier'), valueBool: (function (key, value, previousValue) { if (arguments.length > 1) { this.get('params')[this.get('info.identifier')] = (!!value).toString(); } return this.get('params')[this.get('info.identifier')] !== 'false'; }).property('params', 'info.identifier'), valid: (function () { var type = this.get('info.type'), value = this.get('value'); if (Em.isEmpty(this.get('value'))) { return this.get('info.nullable'); } function matches(regex) { return regex.test(value); } var intVal = parseInt(value, 10); var intValid = !isNaN(intVal) && intVal < 2147483648 && intVal > -2147483649; var isPositiveInt = /^\d+$/.test(value); switch (type) { case 'int': return (/^-?\d+$/.test(value) && intValid ); case 'bigint': return (/^-?\d+$/.test(value) && !isNaN(intVal) ); case 'boolean': return (/^Y|N|#null|true|false/.test(value) ); case 'double': return !isNaN(parseFloat(value)) || /^(-?)Inf(inity)?$/i.test(value) || /^(-?)NaN$/i.test(value); case 'int_list': return value.split(',').every(function (i) { return (/^(-?\d+|null)$/.test(i.trim()) ); }); case 'post_id': return isPositiveInt || /\d+\/\d+(\?u=.*)?$/.test(value); case 'category_id': if (!isPositiveInt && value !== value.dasherize()) { this.set('value', value.dasherize()); } if (isPositiveInt) { return !!this.site.categories.find(function (c) { return c.get('id') === intVal; }); } else if (/\//.test(value)) { var match = /(.*)\/(.*)/.exec(value); if (!match) return false; var result = Category.findBySlug(match[2].dasherize(), match[1].dasherize()); return !!result; } else { return !!Category.findBySlug(value.dasherize()); } case 'group_id': var groups = this.site.get('groups'); if (isPositiveInt) { return !!groups.find(function (g) { return g.id === intVal; }); } else { return !!groups.find(function (g) { return g.name === value; }); } } return true; }).property('value', 'info.type', 'info.nullable'), layoutType: (function () { var type = this.get('info.type'); if ((type === "time" || type === "date") && !allowsInputTypeTime()) { return "string"; } if (layoutMap[type]) { return layoutMap[type]; } return 'generic'; }).property('info.type'), layoutName: (function () { return "admin/components/q-params/" + this.get('layoutType'); }).property('layoutType') }); }); define("discourse/plugins/discourse-data-explorer/discourse/controllers/import-query", ["discourse/mixins/modal-functionality","discourse/lib/ajax-error","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; var ModalFunctionality = __dependency1__["default"]; var popupAjaxError = __dependency2__.popupAjaxError; __exports__["default"] = Ember.Controller.extend(ModalFunctionality, { notReady: Em.computed.not('ready'), needs: ['admin-plugins-explorer'], ready: (function () { var parsed = undefined; try { parsed = JSON.parse(this.get('queryFile')); } catch (e) { return false; } return !!parsed["query"]; }).property('queryFile'), actions: { doImport: function () { var self = this; var object = JSON.parse(this.get('queryFile')).query; // Slight fixup before creating object object.id = 0; // 0 means no Id yet this.set('loading', true); this.store.createRecord('query', object).save().then(function (query) { self.send('closeModal'); self.set('loading', false); var parentController = self.get('controllers.admin-plugins-explorer'); parentController.addCreatedRecord(query.target); }).catch(popupAjaxError); } } }); }); define("discourse/plugins/discourse-data-explorer/discourse/controllers/admin-plugins-explorer", ["discourse/lib/show-modal","discourse/plugins/discourse-data-explorer/discourse/models/query","discourse/lib/ajax-error","exports"], function(__dependency1__, __dependency2__, __dependency3__, __exports__) { "use strict"; var showModal = __dependency1__["default"]; var Query = __dependency2__["default"]; var popupAjaxError = __dependency3__.popupAjaxError; var NoQuery = Query.create({ name: "No queries", fake: true }); __exports__["default"] = Ember.ArrayController.extend({ queryParams: { selectedQueryId: "id" }, selectedQueryId: null, showResults: false, hideSchema: false, loading: false, explain: false, saveDisabled: Ember.computed.not('selectedItem.dirty'), runDisabled: Ember.computed.alias('selectedItem.dirty'), results: Em.computed.alias('selectedItem.results'), editing: false, everEditing: false, selectedItem: (function () { var _id = this.get('selectedQueryId'); var id = parseInt(_id); var item = this.get('content').find(function (q) { return q.get('id') === id; }); return item || NoQuery; }).property('selectedQueryId'), othersDirty: (function () { var selected = this.get('selectedItem'); return !!this.get('content').find(function (q) { return q !== selected && q.get('dirty'); }); }).property('selectedItem', 'selectedItem.dirty'), setEverEditing: (function () { if (this.get('editing') && !this.get('everEditing')) { this.set('everEditing', true); } }).observes('editing'), addCreatedRecord: function (record) { this.pushObject(record); this.set('selectedQueryId', Ember.get(record, 'id')); this.get('selectedItem').set('dirty', false); this.set('showResults', false); this.set('results', null); this.set('editing', true); }, save: function () { var self = this; this.set('loading', true); return this.get('selectedItem').save().then(function () { var query = self.get('selectedItem'); query.markNotDirty(); self.set('editing', false); }).catch(function (x) { popupAjaxError(x); throw x; }).finally(function () { self.set('loading', false); }); }, actions: { dummy: function () {}, importQuery: function () { showModal('import-query'); this.set('showCreate', false); }, showCreate: function () { this.set('showCreate', true); }, editName: function () { this.set('editing', true); }, download: function () { window.open(this.get('selectedItem.downloadUrl'), "_blank"); }, resetParams: function () { this.get('selectedItem').resetParams(); }, saveDefaults: function () { this.get('selectedItem').saveDefaults(); }, save: function () { this.save(); }, saverun: function () { var _this = this; this.save().then(function () { return _this.send('run'); }); }, create: function () { var self = this; this.set('loading', true); this.set('showCreate', false); var newQuery = this.store.createRecord('query', { name: this.get('newQueryName') }); newQuery.save().then(function (result) { self.addCreatedRecord(result.target); }).catch(popupAjaxError).finally(function () { self.set('loading', false); }); }, discard: function () { var self = this; this.set('loading', true); this.store.find('query', this.get('selectedItem.id')).then(function (result) { var query = self.get('selectedItem'); query.setProperties(result.getProperties(Query.updatePropertyNames)); query.markNotDirty(); self.set('editing', false); }).catch(popupAjaxError).finally(function () { self.set('loading', false); }); }, destroy: function () { var self = this; var query = this.get('selectedItem'); this.set('loading', true); this.store.destroyRecord('query', query).then(function () { query.set('destroyed', true); }).catch(popupAjaxError).finally(function () { self.set('loading', false); }); }, recover: function () { var self = this; var query = this.get('selectedItem'); this.set('loading', true); query.save().then(function () { query.set('destroyed', false); }).catch(popupAjaxError).finally(function () { self.set('loading', false); }); }, run: function () { var self = this; if (this.get('selectedItem.dirty')) { return; } if (this.get('runDisabled')) { return; } this.set('loading', true); this.set('showResults', false); Discourse.ajax("/admin/plugins/explorer/queries/" + this.get('selectedItem.id') + "/run", { type: "POST", data: { params: JSON.stringify(this.get('selectedItem.params')), explain: this.get('explain') } }).then(function (result) { self.set('results', result); if (!result.success) { self.set('showResults', false); return; } self.set('showResults', true); }).catch(function (err) { self.set('showResults', false); if (err.jqXHR && err.jqXHR.status === 422 && err.jqXHR.responseJSON) { self.set('results', err.jqXHR.responseJSON); } else { popupAjaxError(err); } }).finally(function () { self.set('loading', false); }); } } }); }); define("discourse/plugins/discourse-data-explorer/discourse/explorer-route-map", ["exports"], function(__exports__) { "use strict"; __exports__["default"] = { resource: 'admin.adminPlugins', path: '/plugins', map: function () { this.route('explorer'); } }; }); define("discourse/plugins/discourse-data-explorer/discourse/initializers/initialize-data-explorer", ["exports"], function(__exports__) { "use strict"; __exports__["default"] = { name: 'initialize-data-explorer', initialize: function (container) { container.lookup('store:main').addPluralization('query', 'queries'); if (!String.prototype.endsWith) { String.prototype.endsWith = function (searchString, position) { var subjectString = this.toString(); if (position === undefined || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }; } // load route require('discourse/plugins/discourse-data-explorer/discourse/explorer-route-map'); } }; }); define("discourse/plugins/discourse-data-explorer/discourse/routes/admin-plugins-explorer", ["exports"], function(__exports__) { "use strict"; __exports__["default"] = Discourse.Route.extend({ controllerName: 'admin-plugins-explorer', queryParams: { id: { replace: true } }, model: function () { var p1 = this.store.findAll('query'); var p2 = Discourse.ajax('/admin/plugins/explorer/schema.json', { cache: true }); return p1.then(function (model) { model.forEach(function (query) { return query.markNotDirty(); }); return p2.then(function (schema) { return { model: model, schema: schema }; }); }).catch(function () { p2.catch(function () {}); return { model: null, schema: null, disallow: true }; }); }, setupController: function (controller, model) { controller.setProperties(model); } }); }); Ember.TEMPLATES["javascripts/explorer/post.raw"] = Discourse.EmberCompatHandlebars.template({"1":function(container,depth0,helpers,partials,data) { var stack1; return ""; },"3":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"id",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})); },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},"post",{"name":"if","hash":{},"hashTypes":{},"hashContexts":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : ""); },"useData":true}); Ember.TEMPLATES["javascripts/explorer/text.raw"] = Discourse.EmberCompatHandlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"value",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"useData":true}); Ember.TEMPLATES["javascripts/explorer/group.raw"] = Discourse.EmberCompatHandlebars.template({"1":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"group.name",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"3":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"id",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},"group",{"name":"if","hash":{},"hashTypes":{},"hashContexts":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : ""); },"useData":true}); Ember.TEMPLATES["javascripts/explorer/html.raw"] = Discourse.EmberCompatHandlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers.get.call(depth0 != null ? depth0 : {},"value",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : "") + "\n"; },"useData":true}); Ember.TEMPLATES["javascripts/explorer/reltime.raw"] = Discourse.EmberCompatHandlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return container.escapeExpression((helpers.reltime || (depth0 && depth0.reltime) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"value",{"name":"reltime","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"useData":true}); Ember.TEMPLATES["javascripts/explorer/user.raw"] = Discourse.EmberCompatHandlebars.template({"1":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression((helpers.avatar || (depth0 && depth0.avatar) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"user",{"name":"avatar","hash":{"imageSize":"tiny"},"hashTypes":{"imageSize":"StringLiteral"},"hashContexts":{"imageSize":depth0},"types":["PathExpression"],"contexts":[depth0],"data":data})) + " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"user.username",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"3":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"id",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},"user",{"name":"if","hash":{},"hashTypes":{},"hashContexts":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : ""); },"useData":true}); Ember.TEMPLATES["javascripts/explorer/category.raw"] = Discourse.EmberCompatHandlebars.template({"1":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression((helpers["category-link"] || (depth0 && depth0["category-link"]) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"category",{"name":"category-link","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"3":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"id",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},"category",{"name":"if","hash":{},"hashTypes":{},"hashContexts":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : ""); },"useData":true}); Ember.TEMPLATES["javascripts/explorer/topic.raw"] = Discourse.EmberCompatHandlebars.template({"1":function(container,depth0,helpers,partials,data) { var stack1; return " " + ((stack1 = helpers.get.call(depth0 != null ? depth0 : {},"topic.fancy_title",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : "") + " (" + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"topic.posts_count",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + ")\n"; },"3":function(container,depth0,helpers,partials,data) { return " " + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"id",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},"topic",{"name":"if","hash":{},"hashTypes":{},"hashContexts":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"types":["PathExpression"],"contexts":[depth0],"data":data})) != null ? stack1 : ""); },"useData":true}); Ember.TEMPLATES["javascripts/explorer/badge.raw"] = Discourse.EmberCompatHandlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "" + container.escapeExpression((helpers["icon-or-image"] || (depth0 && depth0["icon-or-image"]) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"badge.icon",{"name":"icon-or-image","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n" + container.escapeExpression(helpers.get.call(depth0 != null ? depth0 : {},"badge.displayName",{"name":"get","hash":{},"hashTypes":{},"hashContexts":{},"types":["PathExpression"],"contexts":[depth0],"data":data})) + "\n"; },"useData":true}); Ember.TEMPLATES["javascripts/explorer-query-result"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("pre"); var el2 = dom.createElement("code"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1, 0]),0,0); content(env, morph0, context, "content.explain"); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("th"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),0,0); set(env, context, "col", blockArguments[0]); content(env, morph0, context, "col"); return fragment; } }; }()); var child2 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "query-row-content", [], {"row": get(env, context, "row"), "columnTemplates": get(env, context, "columnTemplates"), "parent": get(env, context, "controller")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","result-info"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","result-about"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("table"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("thead"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("tr"); dom.setAttribute(el3,"class","headers"); var el4 = dom.createTextNode("\n"); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode(" "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("tbody"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline, content = hooks.content, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [0]); var element1 = dom.childAt(fragment, [3]); var morph0 = dom.createMorphAt(element0,1,1); var morph1 = dom.createMorphAt(element0,3,3); var morph2 = dom.createMorphAt(element0,5,5); var morph3 = dom.createMorphAt(dom.childAt(element0, [7]),1,1); var morph4 = dom.createMorphAt(fragment,1,1,contextualElement); var morph5 = dom.createMorphAt(dom.childAt(element1, [1, 1]),1,1); var morph6 = dom.createMorphAt(dom.childAt(element1, [3]),0,0); inline(env, morph0, context, "i18n", ["explorer.download"], {}); inline(env, morph1, context, "d-button", [], {"action": "downloadResultJson", "icon": "download", "label": "explorer.download_json"}); inline(env, morph2, context, "d-button", [], {"action": "downloadResultCsv", "icon": "download", "label": "explorer.download_csv"}); content(env, morph3, context, "duration"); block(env, morph4, context, "if", [get(env, context, "hasExplain")], {}, child0, null); block(env, morph5, context, "each", [get(env, context, "columnDispNames")], {}, child1, null); block(env, morph6, context, "each", [get(env, context, "rows")], {"keyword": "row"}, child2, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/plugins-explorer"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("h2"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),0,0); inline(env, morph0, context, "i18n", ["explorer.admins_only"], {}); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","query-create"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element8 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(element8,1,1); var morph1 = dom.createMorphAt(element8,3,3); inline(env, morph0, context, "text-field", [], {"value": get(env, context, "newQueryName"), "placeholderKey": "explorer.create_placeholder"}); inline(env, morph1, context, "d-button", [], {"action": "create", "label": "explorer.create", "icon": "plus", "class": "btn-primary"}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","warning"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element7 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(element7,1,1); var morph1 = dom.createMorphAt(element7,3,3); inline(env, morph0, context, "fa-icon", ["warning"], {}); inline(env, morph1, context, "i18n", ["explorer.others_dirty"], {}); return fragment; } }; }()); var child2 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("a"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline, element = hooks.element; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element6 = dom.childAt(fragment, [3]); var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); var morph1 = dom.createMorphAt(element6,0,0); inline(env, morph0, context, "i18n", ["explorer.no_queries"], {}); element(env, element6, context, "action", ["showCreate"], {}); inline(env, morph1, context, "i18n", ["explorer.no_queries_hook"], {}); return fragment; } }; }()); var child3 = (function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","name"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","desc"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); var morph1 = dom.createMorphAt(dom.childAt(fragment, [3]),1,1); inline(env, morph0, context, "text-field", [], {"value": get(env, context, "selectedItem.name")}); inline(env, morph1, context, "textarea", [], {"value": get(env, context, "selectedItem.description")}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","name"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("h2"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","desc"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element1 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(dom.childAt(element1, [1]),0,0); var morph1 = dom.createMorphAt(element1,3,3); var morph2 = dom.createMorphAt(dom.childAt(fragment, [3]),1,1); content(env, morph0, context, "selectedItem.name"); inline(env, morph1, context, "d-button", [], {"action": "editName", "icon": "pencil", "class": "no-text btn-small"}); content(env, morph2, context, "selectedItem.description"); return fragment; } }; }()); var child2 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","right-panel"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("div"); dom.setAttribute(el3,"class","schema grippie-target"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","editor-panel"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","grippie"); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","clear"); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, subexpr = hooks.subexpr, concat = hooks.concat, attribute = hooks.attribute, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var attrMorph0 = dom.createAttrMorph(element0, 'class'); var morph0 = dom.createMorphAt(dom.childAt(element0, [1, 1]),1,1); var morph1 = dom.createMorphAt(dom.childAt(element0, [3]),1,1); attribute(env, attrMorph0, element0, "class", concat(env, ["query-editor ", subexpr(env, context, "if", [get(env, context, "hideSchema"), "no-schema"], {})])); inline(env, morph0, context, "explorer-schema", [], {"schema": get(env, context, "schema"), "hideSchema": get(env, context, "hideSchema")}); inline(env, morph1, context, "ace-editor", [], {"content": get(env, context, "selectedItem.sql"), "mode": "sql"}); return fragment; } }; }()); var child3 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","sql"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); inline(env, morph0, context, "hljs-code-view", [], {"value": get(env, context, "selectedItem.sql"), "codeClass": "sql"}); return fragment; } }; }()); var child4 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "save", "label": "explorer.save", "disabled": get(env, context, "saveDisabled"), "class": "btn-primary"}); return fragment; } }; }()); var child5 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "editName", "label": "explorer.edit", "icon": "pencil", "class": "btn-primary"}); return fragment; } }; }()); var child6 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "recover", "class": "", "icon": "undo", "label": "explorer.recover"}); return fragment; } }; }()); var child7 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "discard", "class": "btn-danger", "icon": "undo", "label": "explorer.undo", "disabled": get(env, context, "saveDisabled")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(fragment,2,2,contextualElement); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "everEditing")], {}, child0, null); inline(env, morph1, context, "d-button", [], {"action": "destroy", "class": "btn-danger", "icon": "trash", "label": "explorer.delete"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","clear"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","pull-left"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","pull-right"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","clear"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element2 = dom.childAt(fragment, [6]); var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(fragment,2,2,contextualElement); var morph2 = dom.createMorphAt(element2,1,1); var morph3 = dom.createMorphAt(element2,3,3); var morph4 = dom.createMorphAt(dom.childAt(fragment, [8]),1,1); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "editing")], {}, child0, child1); block(env, morph1, context, "if", [get(env, context, "everEditing")], {}, child2, child3); block(env, morph2, context, "if", [get(env, context, "everEditing")], {}, child4, child5); inline(env, morph3, context, "d-button", [], {"action": "download", "label": "explorer.export", "disabled": get(env, context, "runDisabled"), "icon": "download"}); block(env, morph4, context, "if", [get(env, context, "selectedItem.destroyed")], {}, child6, child7); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); set(env, context, "pinfo", blockArguments[0]); inline(env, morph0, context, "param-input", [], {"params": get(env, context, "selectedItem.params"), "info": get(env, context, "pinfo")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","query-params"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); block(env, morph0, context, "each", [get(env, context, "selectedItem.param_info")], {}, child0, null); return fragment; } }; }()); var child2 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"label": "explorer.run", "disabled": "true", "class": "btn-primary"}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "saverun", "label": "explorer.saverun"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "saveDisabled")], {}, child0, child1); return fragment; } }; }()); var child3 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "run", "label": "explorer.run", "disabled": get(env, context, "runDisabled"), "class": "btn-primary", "type": "submit"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("form"); dom.setAttribute(el1,"class","query-run"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); var el2 = dom.createElement("label"); dom.setAttribute(el2,"class","query-plan"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("hr"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, subexpr = hooks.subexpr, concat = hooks.concat, attribute = hooks.attribute, block = hooks.block, element = hooks.element, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element3 = dom.childAt(fragment, [1]); var element4 = dom.childAt(fragment, [3]); var element5 = dom.childAt(element4, [4]); var morph0 = dom.createMorphAt(element3,1,1); var attrMorph0 = dom.createAttrMorph(element3, 'class'); var morph1 = dom.createMorphAt(element4,1,1); var morph2 = dom.createMorphAt(element4,2,2); var morph3 = dom.createMorphAt(element5,0,0); var morph4 = dom.createMorphAt(element5,2,2); attribute(env, attrMorph0, element3, "class", concat(env, ["query-edit ", subexpr(env, context, "if", [get(env, context, "editName"), "editing"], {})])); block(env, morph0, context, "if", [get(env, context, "selectedItem")], {}, child0, null); element(env, element4, context, "action", ["run"], {"on": "submit"}); block(env, morph1, context, "if", [get(env, context, "selectedItem.hasParams")], {}, child1, null); block(env, morph2, context, "if", [get(env, context, "runDisabled")], {}, child2, child3); inline(env, morph3, context, "input", [], {"type": "checkbox", "checked": get(env, context, "explain"), "name": "explain"}); inline(env, morph4, context, "i18n", ["explorer.explain_label"], {}); return fragment; } }; }()); var child4 = (function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "query-result", [], {"query": get(env, context, "selectedItem"), "content": get(env, context, "results")}); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("pre"); dom.setAttribute(el1,"class","query-error"); var el2 = dom.createElement("code"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1, 0]),0,0); set(env, context, "err", blockArguments[0]); content(env, morph0, context, "err"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "each", [get(env, context, "results.errors")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","query-results"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); block(env, morph0, context, "if", [get(env, context, "showResults")], {}, child0, child1); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "results")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","query-list"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("hr"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","explorer-pad-bottom"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element9 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(element9,1,1); var morph1 = dom.createMorphAt(element9,3,3); var morph2 = dom.createMorphAt(element9,5,5); var morph3 = dom.createMorphAt(fragment,3,3,contextualElement); var morph4 = dom.createMorphAt(fragment,5,5,contextualElement); var morph5 = dom.createMorphAt(fragment,9,9,contextualElement); var morph6 = dom.createMorphAt(fragment,11,11,contextualElement); var morph7 = dom.createMorphAt(fragment,13,13,contextualElement); inline(env, morph0, context, "combo-box", [], {"valueAttribute": "id", "value": get(env, context, "selectedQueryId"), "nameProperty": "listName", "content": get(env, context, "content"), "castInteger": "true", "nameChanges": "true"}); inline(env, morph1, context, "d-button", [], {"action": "showCreate", "icon": "plus", "class": "no-text"}); inline(env, morph2, context, "d-button", [], {"action": "importQuery", "label": "explorer.import.label", "icon": "upload"}); block(env, morph3, context, "if", [get(env, context, "showCreate")], {}, child0, null); block(env, morph4, context, "if", [get(env, context, "othersDirty")], {}, child1, null); block(env, morph5, context, "if", [get(env, context, "selectedItem.fake")], {}, child2, child3); inline(env, morph6, context, "conditional-loading-spinner", [], {"condition": get(env, context, "loading")}); block(env, morph7, context, "unless", [get(env, context, "selectedItem.fake")], {}, child4, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "disallow")], {}, child0, child1); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/generic"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [2]),0,0); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "text-field", [], {"value": get(env, context, "value")}); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/boolean"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "combo-box", [], {"valueAttribute": "id", "value": get(env, context, "value"), "nameProperty": "name", "content": get(env, context, "boolTypes")}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "input", [], {"type": "checkbox", "checked": get(env, context, "valueBool")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [1]),0,0); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "info.nullable")], {}, child0, child1); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/user_list"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [2]),0,0); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "user-selector", [], {"usernames": get(env, context, "value")}); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/int"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [2]),0,0); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "input", [], {"type": "number", "value": get(env, context, "value")}); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/user_id"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [2]),0,0); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "user-selector", [], {"usernames": get(env, context, "value"), "single": "true"}); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/admin/components/q-params/string"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","param-name"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [2]),0,0); dom.insertBoundary(fragment, 0); inline(env, morph0, context, "text-field", [], {"value": get(env, context, "value"), "type": "text"}); content(env, morph1, context, "info.identifier"); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/explorer-schema-onetable"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("i"); dom.setAttribute(el1,"class","fa fa-caret-down"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("i"); dom.setAttribute(el1,"class","fa fa-caret-right"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child2 = (function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("i"); dom.setAttribute(el1,"class","fa fa-warning"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child1 = (function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "explorer-schema-enuminfo", [], {"col": get(env, context, "col")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("i"); dom.setAttribute(el1,"class","fa fa-info popup-info"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","popup"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1, 1]); var morph0 = dom.createMorphAt(element0,1,1); var morph1 = dom.createMorphAt(element0,3,3); content(env, morph0, context, "col.column_desc"); block(env, morph1, context, "if", [get(env, context, "col.enum")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("br"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","schema-typenotes"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,3,3,contextualElement); var morph1 = dom.createMorphAt(dom.childAt(fragment, [5]),1,1); block(env, morph0, context, "if", [get(env, context, "col.havepopup")], {}, child0, null); content(env, morph1, context, "col.notes"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("dt"); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("dd"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, subexpr = hooks.subexpr, concat = hooks.concat, attribute = hooks.attribute, block = hooks.block, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element1 = dom.childAt(fragment, [1]); var element2 = dom.childAt(element1, [1]); var element3 = dom.childAt(element1, [3]); var morph0 = dom.createMorphAt(element2,1,1); var morph1 = dom.createMorphAt(element2,3,3); var attrMorph0 = dom.createAttrMorph(element2, 'class'); var attrMorph1 = dom.createAttrMorph(element2, 'title'); var morph2 = dom.createMorphAt(element3,1,1); var morph3 = dom.createMorphAt(element3,3,3); set(env, context, "col", blockArguments[0]); attribute(env, attrMorph0, element2, "class", concat(env, [subexpr(env, context, "if", [get(env, context, "col.sensitive"), "sensitive"], {})])); attribute(env, attrMorph1, element2, "title", concat(env, [subexpr(env, context, "if", [get(env, context, "col.sensitive"), subexpr(env, context, "i18n", ["explorer.schema.sensitive"], {})], {})])); block(env, morph0, context, "if", [get(env, context, "col.sensitive")], {}, child0, null); content(env, morph1, context, "col.column_name"); content(env, morph2, context, "col.data_type"); block(env, morph3, context, "if", [get(env, context, "col.havetypeinfo")], {}, child1, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("dl"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); block(env, morph0, context, "each", [get(env, context, "table.columns")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","schema-table-name"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","schema-table-cols"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element4 = dom.childAt(fragment, [0]); var morph0 = dom.createMorphAt(element4,1,1); var morph1 = dom.createMorphAt(element4,3,3); var morph2 = dom.createMorphAt(dom.childAt(fragment, [2]),1,1); block(env, morph0, context, "if", [get(env, context, "table.open")], {}, child0, child1); content(env, morph1, context, "table.name"); block(env, morph2, context, "if", [get(env, context, "table.open")], {}, child2, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/explorer-schema"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"action": "expandSchema", "icon": "chevron-left", "class": "no-text unhide"}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); set(env, context, "table", blockArguments[0]); inline(env, morph0, context, "explorer-schema-onetable", [], {"table": get(env, context, "table")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","schema-container"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("ul"); var el4 = dom.createTextNode("\n"); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode(" "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, subexpr = hooks.subexpr, concat = hooks.concat, attribute = hooks.attribute, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); var morph1 = dom.createMorphAt(element0,1,1); var morph2 = dom.createMorphAt(element0,3,3); var morph3 = dom.createMorphAt(element0,5,5); var attrMorph0 = dom.createAttrMorph(element0, 'class'); var morph4 = dom.createMorphAt(dom.childAt(element0, [7, 1]),1,1); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "hideSchema")], {}, child0, null); attribute(env, attrMorph0, element0, "class", concat(env, [subexpr(env, context, "if", [get(env, context, "hideSchema"), "hidden"], {})])); inline(env, morph1, context, "text-field", [], {"value": get(env, context, "filter"), "placeholderKey": "explorer.schema.filter"}); inline(env, morph2, context, "d-button", [], {"action": "collapseSchema", "icon": "chevron-right", "class": "no-text btn-small"}); inline(env, morph3, context, "conditional-loading-spinner", [], {"condition": get(env, context, "loading")}); block(env, morph4, context, "each", [get(env, context, "tables")], {}, child1, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/explorer-schema-enuminfo"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, concat = hooks.concat, attribute = hooks.attribute, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(element0,1,1); var attrMorph0 = dom.createAttrMorph(element0, 'value'); set(env, context, "enum", blockArguments[0]); attribute(env, attrMorph0, element0, "value", concat(env, [get(env, context, "enum.value")])); content(env, morph0, context, "enum.name"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "each", [get(env, context, "enuminfo")], {}, child0, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/modal/import-query"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("form"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","modal-body"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","modal-footer"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, element = hooks.element, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [0]); var morph0 = dom.createMorphAt(dom.childAt(element0, [1]),1,1); var morph1 = dom.createMorphAt(dom.childAt(element0, [3]),1,1); element(env, element0, context, "action", ["dummy"], {"on": "submit"}); inline(env, morph0, context, "json-file-uploader", [], {"value": get(env, context, "queryFile"), "extension": ".dcquery.json"}); inline(env, morph1, context, "d-button", [], {"class": "btn-primary", "action": "doImport", "type": "submit", "disabled": get(env, context, "notReady"), "icon": "plus", "label": "explorer.import.label"}); return fragment; } }; }())); define("discourse/plugins/discourse-details/initializers/apply-details", ["discourse/lib/plugin-api","exports"], function(__dependency1__, __exports__) { "use strict"; var withPluginApi = __dependency1__.withPluginApi; __exports__["default"] = { name: "apply-details", initialize: function () { withPluginApi('0.1', function (api) { api.decorateCooked(function ($elem) { return $("details", $elem).details(); }); }); } }; }); define("discourse/plugins/discourse-google-dfp/discourse/components/google-dfp-ad", ["discourse/lib/load-script","exports"], function(__dependency1__, __exports__) { "use strict"; var loadScript = __dependency1__["default"]; var _loaded = false, _promise = null, ads = {}; function loadGoogle(settings) { if (_loaded) { return Ember.RSVP.resolve(); } if (_promise) { return _promise; } var dfpSrc = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; _promise = loadScript(dfpSrc, { scriptTag: true }).then(function () { _loaded = true; if (window.googletag === undefined) { console.log('googletag is undefined!'); } googletag.cmd.push(function () { googletag.pubads().enableSingleRequest(); googletag.pubads().disableInitialLoad(); // we always use refresh() to fetch the ads googletag.enableServices(); }); }); return _promise; } function defineSlot(placement, settings) { if (ads[placement]) { return ads[placement]; } if (Discourse.Mobile.mobileView) { if (placement === 'topic-list-top' && settings.dfp_mobile_show_topic_list_top && settings.dfp_mobile_topic_list_top_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_mobile_topic_list_top_code, [320, 50], 'div-gpt-ad-topic-list-top').addService(googletag.pubads()); } else if (placement === 'topic-top' && settings.dfp_mobile_show_topic_top && settings.dfp_mobile_topic_top_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_mobile_topic_top_code, [320, 50], 'div-gpt-ad-topic-top').addService(googletag.pubads()); } else if (placement === 'topic-bottom' && settings.dfp_mobile_show_topic_bottom && settings.dfp_mobile_topic_bottom_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_mobile_topic_bottom_code, [320, 50], 'div-gpt-ad-topic-bottom').addService(googletag.pubads()); } } else { if (placement === 'topic-list-top' && settings.dfp_show_topic_list_top && settings.dfp_topic_list_top_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_topic_list_top_code, [728, 90], 'div-gpt-ad-topic-list-top').addService(googletag.pubads()); } else if (placement === 'topic-top' && settings.dfp_show_topic_top && settings.dfp_topic_top_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_topic_top_code, [728, 90], 'div-gpt-ad-topic-top').addService(googletag.pubads()); } else if (placement === 'topic-bottom' && settings.dfp_show_topic_bottom && settings.dfp_topic_bottom_code) { ads[placement] = googletag.defineSlot('/' + settings.dfp_id + '/' + settings.dfp_topic_bottom_code, [728, 90], 'div-gpt-ad-topic-bottom').addService(googletag.pubads()); } } return ads[placement]; } __exports__["default"] = Ember.Component.extend({ classNames: ['google-dfp-ad'], loadedGoogletag: false, divId: (function () { return "div-gpt-ad-" + this.get('placement'); }).property('placement'), fixedSize: (function () { if (Discourse.Mobile.mobileView) { return new Ember.Handlebars.SafeString('width: 320px; height: 50px;'); } else { return new Ember.Handlebars.SafeString('width: 728px; height: 90px;'); } }).property(), refreshAd: (function () { var ad = ads[this.get('placement')]; if (!ad) { return; } if (this.get('loadedGoogletag')) { googletag.cmd.push(function () { googletag.pubads().refresh([ad]); }); } }).observes('refreshOnChange'), _initGoogleDFP: (function () { var self = this; loadGoogle(Discourse.SiteSettings).then(function () { self.set('loadedGoogletag', true); googletag.cmd.push(function () { var ad = defineSlot(self.get('placement'), self.siteSettings); if (ad) { googletag.display(self.get('divId')); googletag.pubads().refresh([ad]); } }); }); }).on('didInsertElement') }); }); Ember.TEMPLATES["javascripts/connectors/topic-above-suggested/discourse-google-dfp"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-bottom", "refreshOnChange": get(env, context, "model.id")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_mobile_show_topic_bottom")], {}, child0, null); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-bottom", "refreshOnChange": get(env, context, "model.id")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_show_topic_bottom")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "site.mobileView")], {}, child0, child1); return fragment; } }; }())); Ember.TEMPLATES["javascripts/connectors/discovery-list-container-top/discourse-google-dfp"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-list-top"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_mobile_show_topic_list_top")], {}, child0, null); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-list-top"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_show_topic_list_top")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "site.mobileView")], {}, child0, child1); return fragment; } }; }())); Ember.TEMPLATES["javascripts/connectors/topic-above-post-stream/discourse-google-dfp"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-top", "refreshOnChange": get(env, context, "model.id")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_mobile_show_topic_top")], {}, child0, null); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "google-dfp-ad", [], {"placement": "topic-top", "refreshOnChange": get(env, context, "model.id")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "siteSettings.dfp_show_topic_top")], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "site.mobileView")], {}, child0, child1); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/google-dfp-ad"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","google-dfp-ad-label"); var el2 = dom.createElement("h2"); var el3 = dom.createTextNode("ADVERTISEMENT"); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","dfp-ad-unit"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, concat = hooks.concat, attribute = hooks.attribute; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [2]); var attrMorph0 = dom.createAttrMorph(element0, 'id'); var attrMorph1 = dom.createAttrMorph(element0, 'style'); attribute(env, attrMorph0, element0, "id", concat(env, [get(env, context, "divId")])); attribute(env, attrMorph1, element0, "style", get(env, context, "fixedSize")); return fragment; } }; }())); define("discourse/plugins/discourse-solved/discourse/pre-initializers/extend-category-for-solved", ["ember-addons/ember-computed-decorators","discourse/models/category","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ('value' in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === 'function') { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError('The decorator for method ' + descriptor.key + ' is of the invalid type ' + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var property = __dependency1__["default"]; var Category = __dependency2__["default"]; __exports__["default"] = { name: 'extend-category-for-solved', before: 'inject-discourse-objects', initialize: function () { Category.reopen(_createDecoratedObject([{ key: 'enable_accepted_answers', decorators: [property('custom_fields.enable_accepted_answers')], initializer: function () { return { get: function (enableField) { return enableField === "true"; }, set: function (value) { value = value ? "true" : "false"; this.set("custom_fields.enable_accepted_answers", value); return value; } }; } }])); } }; }); define("discourse/plugins/discourse-solved/discourse/initializers/extend-for-solved-button", ["discourse/views/post","discourse/components/post-menu","discourse/models/topic","discourse/models/user","discourse/views/topic-status","discourse/lib/ajax-error","discourse/lib/plugin-api","exports"], function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) { "use strict"; var PostView = __dependency1__["default"]; var PostMenuComponent = __dependency2__["default"]; var Button = __dependency2__.Button; var Topic = __dependency3__["default"]; var User = __dependency4__["default"]; var TopicStatus = __dependency5__["default"]; var popupAjaxError = __dependency6__.popupAjaxError; var withPluginApi = __dependency7__.withPluginApi; function clearAccepted(topic) { var posts = topic.get('postStream.posts'); posts.forEach(function (post) { if (post.get('post_number') > 1) { post.set('accepted_answer', false); post.set('can_accept_answer', true); post.set('can_unaccept_answer', false); } }); } function unacceptPost(post) { if (!post.get('can_unaccept_answer')) { return; } var topic = post.topic; post.setProperties({ can_accept_answer: true, can_unaccept_answer: false, accepted_answer: false }); topic.set('accepted_answer', undefined); Discourse.ajax("/solution/unaccept", { type: 'POST', data: { id: post.get('id') } }).catch(popupAjaxError); } function acceptPost(post) { var topic = post.topic; clearAccepted(topic); post.setProperties({ can_unaccept_answer: true, can_accept_answer: false, accepted_answer: true }); topic.set('accepted_answer', { username: post.get('username'), post_number: post.get('post_number') }); Discourse.ajax("/solution/accept", { type: 'POST', data: { id: post.get('.id') } }).catch(popupAjaxError); } // Code for older discourse installs for backwards compatibility function oldPluginCode() { PostView.reopen({ classNameBindings: ['post.accepted_answer:accepted-answer'] }); PostMenuComponent.registerButton(function (visibleButtons) { var position = 0; var canAccept = this.get('post.can_accept_answer'); var canUnaccept = this.get('post.can_unaccept_answer'); var accepted = this.get('post.accepted_answer'); var isOp = Discourse.User.currentProp("id") === this.get('post.topic.user_id'); if (!accepted && canAccept && !isOp) { // first hidden position if (this.get('collapsed')) { return; } position = visibleButtons.length - 2; } if (canAccept) { visibleButtons.splice(position, 0, new Button('acceptAnswer', 'solved.accept_answer', 'check-square-o', { className: 'unaccepted' })); } if (canUnaccept || accepted) { var locale = canUnaccept ? 'solved.unaccept_answer' : 'solved.accepted_answer'; visibleButtons.splice(position, 0, new Button('unacceptAnswer', locale, 'check-square', { className: 'accepted fade-out', prefixHTML: '' + I18n.t('solved.solution') + '' })); } }); PostMenuComponent.reopen({ acceptedChanged: (function () { this.rerender(); }).observes('post.accepted_answer'), clickUnacceptAnswer: function () { unacceptPost(this.get('post')); }, clickAcceptAnswer: function () { acceptPost(this.get('post')); } }); } function initializeWithApi(api) { var currentUser = api.getCurrentUser(); api.includePostAttributes('can_accept_answer', 'can_unaccept_answer', 'accepted_answer'); api.addPostMenuButton('solved', function (attrs) { var canAccept = attrs.can_accept_answer; var canUnaccept = attrs.can_unaccept_answer; var accepted = attrs.accepted_answer; var isOp = currentUser && currentUser.id === attrs.topicCreatedById; var position = !accepted && canAccept && !isOp ? 'second-last-hidden' : 'first'; if (canAccept) { return { action: 'acceptAnswer', icon: 'check-square-o', className: 'unaccepted', title: 'solved.accept_answer', position: position }; } else if (canUnaccept || accepted) { var title = canUnaccept ? 'solved.unaccept_answer' : 'solved.accepted_answer'; return { action: 'unacceptAnswer', icon: 'check-square', title: title, className: 'accepted fade-out', position: position, beforeButton: function (h) { return h('span.accepted-text', I18n.t('solved.solution')); } }; } }); api.decorateWidget('post-contents:after-cooked', function (dec) { if (dec.attrs.post_number === 1) { var topic = dec.getModel().get('topic'); if (topic.get('accepted_answer')) { return dec.rawHtml('

' + topic.get('acceptedAnswerHtml') + '

'); } } }); api.attachWidgetAction('post', 'acceptAnswer', function () { var _this = this; var post = this.model; var current = post.get('topic.postStream.posts').filter(function (p) { return p.get('post_number') === 1 || p.get('accepted_answer'); }); acceptPost(post); current.forEach(function (p) { return _this.appEvents.trigger('post-stream:refresh', { id: p.id }); }); }); api.attachWidgetAction('post', 'unacceptAnswer', function () { var post = this.model; var op = post.get('topic.postStream.posts').find(function (p) { return p.get('post_number') === 1; }); unacceptPost(post); this.appEvents.trigger('post-stream:refresh', { id: op.get('id') }); }); } __exports__["default"] = { name: 'extend-for-solved-button', initialize: function () { Topic.reopen({ // keeping this here cause there is complex localization acceptedAnswerHtml: (function () { var username = this.get('accepted_answer.username'); var postNumber = this.get('accepted_answer.post_number'); if (!username || !postNumber) { return ""; } return I18n.t("solved.accepted_html", { username_lower: username.toLowerCase(), username: username, post_path: this.get('url') + "/" + postNumber, post_number: postNumber, user_path: User.create({ username: username }).get('path') }); }).property('accepted_answer', 'id') }); TopicStatus.reopen({ statuses: (function () { var results = this._super(); if (this.topic.has_accepted_answer) { results.push({ openTag: 'span', closeTag: 'span', title: I18n.t('solved.has_accepted_answer'), icon: 'check-square-o' }); } return results; }).property() }); withPluginApi('0.1', initializeWithApi, { noApi: oldPluginCode }); } }; }); Ember.TEMPLATES["javascripts/discourse/connectors/topic-after-cooked/solved-panel"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","solved"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createUnsafeMorphAt(dom.childAt(fragment, [0]),1,1); content(env, morph0, context, "topic.acceptedAnswerHtml"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "topic.accepted_answer")], {}, child0, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/discourse/connectors/category-custom-settings/solved-settings"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("section"); dom.setAttribute(el1,"class","field"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","enable-accepted-answer"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("label"); dom.setAttribute(el3,"class","checkbox-label"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [0, 1, 1]); var morph0 = dom.createMorphAt(element0,1,1); var morph1 = dom.createMorphAt(element0,3,3); inline(env, morph0, context, "input", [], {"type": "checkbox", "checked": get(env, context, "category.enable_accepted_answers")}); inline(env, morph1, context, "i18n", ["solved.allow_accepted_answers"], {}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "unless", [get(env, context, "siteSettings.allow_solved_on_all_topics")], {}, child0, null); return fragment; } }; }())); define("discourse/plugins/Spoiler Alert!/initializers/spoiler-alert", ["discourse/lib/plugin-api","exports"], function(__dependency1__, __exports__) { "use strict"; var withPluginApi = __dependency1__.withPluginApi; var decorateCooked = __dependency1__.decorateCooked; function spoil($elem) { $('.spoiler', $elem).removeClass('spoiler').addClass('spoiled').spoil(); } __exports__["default"] = { name: "apply-spoilers", initialize: function (container) { var siteSettings = container.lookup('site-settings:main'); if (siteSettings.spoiler_enabled) { withPluginApi('0.1', function (api) { return api.decorateCooked(spoil); }, { noApi: function () { return decorateCooked(container, spoil); } }); } } }; }); define("discourse/plugins/staff-notes/discourse/adapters/staff-note", ["discourse/adapters/rest","exports"], function(__dependency1__, __exports__) { "use strict"; var RestAdapter = __dependency1__["default"]; var ajax = Discourse.ajax; __exports__["default"] = RestAdapter.extend({ destroyRecord: function (store, type, record) { var path = this.pathFor(store, type, record.get('id')); var userId = record.get('user_id'); return ajax(path + '?user_id=' + userId, { method: 'DELETE' }); } }); }); define("discourse/plugins/staff-notes/discourse/controllers/staff-notes", ["ember-addons/ember-computed-decorators","discourse/lib/ajax-error","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ('value' in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === 'function') { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError('The decorator for method ' + descriptor.key + ' is of the invalid type ' + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var computed = __dependency1__.default; var on = __dependency1__.on; var popupAjaxError = __dependency2__.popupAjaxError; __exports__["default"] = Ember.Controller.extend(_createDecoratedObject([{ key: 'newNote', initializer: function () { return null; } }, { key: 'saving', initializer: function () { return false; } }, { key: 'user', initializer: function () { return null; } }, { key: 'reset', decorators: [on('init')], value: function () { this.setProperties({ newNote: null, saving: false, callback: null }); } }, { key: 'attachDisabled', decorators: [computed('newNote', 'saving')], value: function (newNote, saving) { return saving || !newNote || newNote.length === 0; } }, { key: '_refreshCount', value: function () { var callback = this.get('callback'); if (callback) { callback(this.get('model.length')); } } }, { key: 'actions', initializer: function () { return { attachNote: function () { var _this = this; var note = this.store.createRecord('staff-note'); var userId = parseInt(this.get('userId')); this.set('saving', true); note.save({ raw: this.get('newNote'), user_id: userId }).then(function () { _this.set('newNote', ''); _this.get('model').pushObject(note); _this._refreshCount(); }).catch(popupAjaxError).finally(function () { return _this.set('saving', false); }); }, removeNote: function (note) { var _this2 = this; bootbox.confirm(I18n.t("staff_notes.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function (result) { if (result) { note.destroyRecord().then(function () { var notes = _this2.get('model'); notes.removeObject(note); _this2._refreshCount(); }).catch(popupAjaxError); } }); } }; } }])); }); define("discourse/plugins/staff-notes/discourse/initializers/enable-staff-notes", ["discourse/lib/plugin-api","discourse/lib/show-modal","discourse/lib/load-script","exports"], function(__dependency1__, __dependency2__, __dependency3__, __exports__) { "use strict"; var withPluginApi = __dependency1__.withPluginApi; var showModal = __dependency2__["default"]; var loadScript = __dependency3__["default"]; __exports__["default"] = { name: 'enable-staff-notes', initialize: function (container) { var siteSettings = container.lookup('site-settings:main'); var currentUser = container.lookup('current-user:main'); if (!siteSettings.staff_notes_enabled || !currentUser || !currentUser.staff) { return; } var store = container.lookup('store:main'); withPluginApi('0.2', function (api) { function showStaffNotes(userId, callback) { return loadScript('defer/html-sanitizer-bundle').then(function () { return store.find('staff-note', { user_id: userId }).then(function (model) { var controller = showModal('staff-notes', { model: model, title: 'staff_notes.title' }); controller.reset(); controller.set('userId', userId); controller.set('callback', callback); return controller; }); }); } function widgetShowStaffNotes() { var _this = this; showStaffNotes(this.attrs.user_id, function (count) { _this.sendWidgetAction('refreshStaffNotes', count); }); } api.attachWidgetAction('post', 'refreshStaffNotes', function (count) { var cfs = this.model.get('user_custom_fields') || {}; cfs.staff_notes_count = count; this.model.set('user_custom_fields', cfs); }); var UserController = container.lookupFactory('controller:user'); UserController.reopen({ staffNotesCount: null, _modelChanged: (function () { this.set('staffNotesCount', this.get('model.custom_fields.staff_notes_count') || 0); }).observes('model').on('init'), actions: { showStaffNotes: function () { var _this2 = this; var user = this.get('model'); showStaffNotes(user.get('id'), function (count) { return _this2.set('staffNotesCount', count); }); } } }); var mobileView = api.container.lookup('site:main').mobileView; var loc = mobileView ? 'before' : 'after'; api.decorateWidget('poster-name:' + loc, function (dec) { var cfs = dec.attrs.userCustomFields || {}; if (cfs.staff_notes_count > 0) { return dec.attach('staff-notes-icon'); } }); api.decorateWidget('post-admin-menu:after', function (dec) { return dec.attach('post-admin-menu-button', { icon: 'pencil', label: 'staff_notes.attach', action: 'showStaffNotes' }); }); api.attachWidgetAction('post-admin-menu', 'showStaffNotes', widgetShowStaffNotes); api.createWidget('staff-notes-icon', { tagName: 'span.staff-notes-icon', click: widgetShowStaffNotes, html: function () { return this.attach('emoji', { name: 'pencil' }); } }); }); } }; }); Ember.TEMPLATES["javascripts/discourse-staff-notes/templates/connectors/user-profile-controls/show-notes-on-profile"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createElement("a"); dom.setAttribute(el2,"href",""); dom.setAttribute(el2,"class","btn"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, element = hooks.element, inline = hooks.inline, get = hooks.get; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element1 = dom.childAt(fragment, [1, 0]); var morph0 = dom.createMorphAt(element1,0,0); var morph1 = dom.createMorphAt(element1,1,1); element(env, element1, context, "action", ["showStaffNotes"], {}); inline(env, morph0, context, "fa-icon", ["pencil"], {}); inline(env, morph1, context, "i18n", ["staff_notes.show"], {"count": get(env, context, "staffNotesCount")}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createElement("a"); dom.setAttribute(el2,"href",""); dom.setAttribute(el2,"class","btn"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, element = hooks.element, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1, 0]); var morph0 = dom.createMorphAt(element0,0,0); var morph1 = dom.createMorphAt(element0,1,1); element(env, element0, context, "action", ["showStaffNotes"], {}); inline(env, morph0, context, "fa-icon", ["pencil"], {}); inline(env, morph1, context, "i18n", ["staff_notes.title"], {}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "staffNotesCount")], {}, child0, child1); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "currentUser.staff")], {}, child0, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/modal/staff-notes"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "avatar", [get(env, context, "n.created_by")], {"imageSize": "small"}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("span"); dom.setAttribute(el1,"class","controls"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); inline(env, morph0, context, "d-button", [], {"action": "removeNote", "actionParam": get(env, context, "n"), "icon": "times", "class": "btn-small btn-danger", "title": "staff_notes.remove"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","staff-note"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","posted-by"); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","note-contents"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("div"); dom.setAttribute(el3,"class","note-info"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("span"); dom.setAttribute(el4,"class","username"); var el5 = dom.createComment(""); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("span"); dom.setAttribute(el4,"class","post-date"); var el5 = dom.createComment(""); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n\n"); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode(" "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("div"); dom.setAttribute(el3,"class","cooked"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","clearfix"); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, block = hooks.block, content = hooks.content, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var element1 = dom.childAt(element0, [3]); var element2 = dom.childAt(element1, [1]); var morph0 = dom.createMorphAt(dom.childAt(element0, [1]),1,1); var morph1 = dom.createMorphAt(dom.childAt(element2, [1]),0,0); var morph2 = dom.createMorphAt(dom.childAt(element2, [3]),0,0); var morph3 = dom.createMorphAt(element2,5,5); var morph4 = dom.createMorphAt(dom.childAt(element1, [3]),1,1); set(env, context, "n", blockArguments[0]); block(env, morph0, context, "user-link", [], {"user": get(env, context, "n.created_by")}, child0, null); content(env, morph1, context, "n.created_by.username"); inline(env, morph2, context, "age-with-tooltip", [get(env, context, "n.created_at")], {}); block(env, morph3, context, "if", [get(env, context, "n.can_delete")], {}, child1, null); inline(env, morph4, context, "cook-text", [get(env, context, "n.raw")], {}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","modal-body staff-notes-modal"); var el2 = dom.createTextNode("\n\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element3 = dom.childAt(fragment, [0]); var morph0 = dom.createMorphAt(element3,1,1); var morph1 = dom.createMorphAt(element3,3,3); var morph2 = dom.createMorphAt(element3,5,5); block(env, morph0, context, "each", [get(env, context, "model")], {}, child0, null); inline(env, morph1, context, "textarea", [], {"value": get(env, context, "newNote")}); inline(env, morph2, context, "d-button", [], {"action": "attachNote", "label": "staff_notes.attach", "class": "btn-primary", "disabled": get(env, context, "attachDisabled")}); return fragment; } }; }())); define("discourse/plugins/hosted-site/initializers/anon-init", ["ember-addons/ember-computed-decorators","exports"], function(__dependency1__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ('value' in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === 'function') { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError('The decorator for method ' + descriptor.key + ' is of the invalid type ' + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var on = __dependency1__.on; __exports__["default"] = { name: 'apply-anon-init', initialize: function (container) { var GlobalNoticeComponent = container.lookupFactory('component:global-notice'); if (GlobalNoticeComponent) { GlobalNoticeComponent.reopen(_createDecoratedObject([{ key: '_hideOtherAlerts', decorators: [on('didInsertElement')], value: function () { Em.run.schedule("afterRender", function () { if ($(".alert .trial-expired-message").size() > 0) { $(".alert-read-only").hide(); $(".alert-too-few-topics").hide(); } }); } }])); } } }; }); define("discourse/plugins/hosted-site/discourse/components/hosted-dashboard", ["discourse/lib/show-modal","exports"], function(__dependency1__, __exports__) { "use strict"; var showModal = __dependency1__["default"]; __exports__["default"] = Ember.Component.extend({ classNameBindings: [':hosted-dashboard', 'shouldHide:hidden'], loading: true, shouldHide: true, showChangeCreditCard: true, changeCreditCardUrl: null, startSubscriptionUrl: null, showEnableSSLButton: true, showCreditCardInfo: false, trialActive: false, trialExpired: false, paid: false, paymentDue: false, fetchAccountInfo: function () { this.set('loading', true); var self = this; return Discourse.ajax("/admin/hosted_account").then(function (data) { if (data.payment_method === 'none') { self.set('shouldHide', true); } else { switch (data.account_status) { case 'trial': self.set('trialActive', true);break; case 'trial_expired': self.set('trialExpired', true);break; case 'subscriber': self.set('paid', true);break; case 'payment_due': self.set('paymentDue', true);break; } self.set('changeCreditCardUrl', data.change_credit_card_url); self.set('startSubscriptionUrl', data.start_subscription_url); self.set('showEnableSSLButton', !data.ssl_requested); self.set('billingEmailAddress', data.billing_email_address); if (data.cc_last4) { self.set('ccBrand', data.cc_brand); self.set('ccLast4', data.cc_last4); self.set('ccExpMonth', data.cc_exp_month); self.set('ccExpYear', data.cc_exp_year); self.set('showCreditCardInfo', true); } else { self.set('showCreditCardInfo', false); } self.set('loading', false); self.set('shouldHide', false); } }, function () { self.set('loading', false); self.set('shouldHide', true); }); }, _initHostedDashboard: (function () { this.fetchAccountInfo(); }).on('didInsertElement'), actions: { changeBillingEmail: function () { showModal('admin-billing-email'); }, enableSSL: function () { var controller = showModal('admin-enable-ssl'); controller.set('startSubscriptionUrl', this.get('startSubscriptionUrl')); } } }); }); Ember.TEMPLATES["javascripts/connectors/admin-dashboard-top/hosted-site"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); content(env, morph0, context, "hosted-dashboard"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "currentUser.admin")], {}, child0, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/hosted-dashboard"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode("@discourse"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-trial-welcome"); var el2 = dom.createTextNode("Welcome to your free trial of Discourse!"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-contact"); var el2 = dom.createTextNode("Feel free to contact us any time if you have questions, by emailing us at "); dom.appendChild(el1, el2); var el2 = dom.createElement("a"); dom.setAttribute(el2,"href","mailto:support@discourse.org"); var el3 = dom.createTextNode("support@discourse.org"); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" or by sending a message to "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" here."); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [3]),3,3); block(env, morph0, context, "link-to", ["user", "discourse"], {}, child0, null); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-trial-expired"); var el2 = dom.createTextNode("Your free trial has expired. Use the button below to start your subscription."); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child2 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-active-subscription"); var el2 = dom.createTextNode("You have an active subscription. Thank you!"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child3 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-payment_due"); var el2 = dom.createElement("strong"); var el3 = dom.createTextNode("You have an overdue subscription payment."); dom.appendChild(el2, el3); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-payment_due"); var el2 = dom.createTextNode("If you need to change your payment method, please use the button below. We will attempt to collect payment again in the next few days."); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); var child4 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("a"); dom.setAttribute(el2,"target","_blank"); dom.setAttribute(el2,"class","btn"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n Change Credit Card\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, concat = hooks.concat, attribute = hooks.attribute, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element3 = dom.childAt(fragment, [1, 1]); var morph0 = dom.createMorphAt(element3,1,1); var attrMorph0 = dom.createAttrMorph(element3, 'href'); attribute(env, attrMorph0, element3, "href", concat(env, [get(env, context, "changeCreditCardUrl")])); inline(env, morph0, context, "fa-icon", ["credit-card"], {}); return fragment; } }; }()); var child5 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("a"); dom.setAttribute(el2,"target","_blank"); dom.setAttribute(el2,"class","btn"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n Start Subscription\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, concat = hooks.concat, attribute = hooks.attribute, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element2 = dom.childAt(fragment, [1, 1]); var morph0 = dom.createMorphAt(element2,1,1); var attrMorph0 = dom.createAttrMorph(element2, 'href'); attribute(env, attrMorph0, element2, "href", concat(env, [get(env, context, "startSubscriptionUrl")])); inline(env, morph0, context, "replace-emoji", [":sparkles:"], {}); return fragment; } }; }()); var child6 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("a"); dom.setAttribute(el2,"class","btn"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n Enable SSL\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, element = hooks.element, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element1 = dom.childAt(fragment, [1, 1]); var morph0 = dom.createMorphAt(element1,1,1); element(env, element1, context, "action", ["enableSSL"], {}); inline(env, morph0, context, "fa-icon", ["lock"], {}); return fragment; } }; }()); var child7 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-current-payment-method"); var el2 = dom.createTextNode("\n Current payment method:\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("span"); dom.setAttribute(el2,"class","hosted-cc-info"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" ****"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" EXP "); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode("/"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1, 1]); var morph0 = dom.createMorphAt(element0,0,0); var morph1 = dom.createMorphAt(element0,2,2); var morph2 = dom.createMorphAt(element0,4,4); var morph3 = dom.createMorphAt(element0,6,6); content(env, morph0, context, "ccBrand"); content(env, morph1, context, "ccLast4"); content(env, morph2, context, "ccExpMonth"); content(env, morph3, context, "ccExpYear"); return fragment; } }; }()); var child8 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-current-billing-email"); var el2 = dom.createTextNode("\n Current billing email address:\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("span"); dom.setAttribute(el2,"class","hosted-email-value"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1, 1]),0,0); content(env, morph0, context, "billingEmailAddress"); return fragment; } }; }()); var child9 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode("@discourse"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); dom.setAttribute(el1,"class","hosted-contact"); var el2 = dom.createTextNode("Feel free to contact us any time if you have questions, by emailing us at "); dom.appendChild(el1, el2); var el2 = dom.createElement("a"); dom.setAttribute(el2,"href","mailto:support@discourse.org"); var el3 = dom.createTextNode("support@discourse.org"); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" or by sending a message to "); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" here."); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),3,3); block(env, morph0, context, "link-to", ["user", "discourse"], {}, child0, null); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","admin-controls"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("h3"); var el3 = dom.createTextNode("Account Management"); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","admin-container"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("ul"); dom.setAttribute(el2,"class","hosted-account-links"); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); var el3 = dom.createElement("li"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("a"); dom.setAttribute(el4,"class","btn"); var el5 = dom.createTextNode("\n "); dom.appendChild(el4, el5); var el5 = dom.createComment(""); dom.appendChild(el4, el5); var el5 = dom.createTextNode("\n Change Billing Email\n "); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","clearfix"); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","clearfix"); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, element = hooks.element, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element4 = dom.childAt(fragment, [2]); var element5 = dom.childAt(element4, [7]); var element6 = dom.childAt(element5, [3, 1]); var morph0 = dom.createMorphAt(element4,1,1); var morph1 = dom.createMorphAt(element4,3,3); var morph2 = dom.createMorphAt(element4,4,4); var morph3 = dom.createMorphAt(element4,5,5); var morph4 = dom.createMorphAt(element5,1,1); var morph5 = dom.createMorphAt(element6,1,1); var morph6 = dom.createMorphAt(element5,5,5); var morph7 = dom.createMorphAt(element5,6,6); var morph8 = dom.createMorphAt(element4,11,11); var morph9 = dom.createMorphAt(element4,13,13); var morph10 = dom.createMorphAt(element4,15,15); block(env, morph0, context, "if", [get(env, context, "trialActive")], {}, child0, null); block(env, morph1, context, "if", [get(env, context, "trialExpired")], {}, child1, null); block(env, morph2, context, "if", [get(env, context, "paid")], {}, child2, null); block(env, morph3, context, "if", [get(env, context, "paymentDue")], {}, child3, null); block(env, morph4, context, "if", [get(env, context, "changeCreditCardUrl")], {}, child4, null); element(env, element6, context, "action", ["changeBillingEmail"], {}); inline(env, morph5, context, "fa-icon", ["envelope-o"], {}); block(env, morph6, context, "if", [get(env, context, "startSubscriptionUrl")], {}, child5, null); block(env, morph7, context, "if", [get(env, context, "showEnableSSLButton")], {}, child6, null); block(env, morph8, context, "if", [get(env, context, "showCreditCardInfo")], {}, child7, null); block(env, morph9, context, "if", [get(env, context, "billingEmailAddress")], {}, child8, null); block(env, morph10, context, "unless", [get(env, context, "trialActive")], {}, child9, null); return fragment; } }; }())); define("discourse/plugins/lazyYT/initializers/lazyYT", ["discourse/lib/plugin-api","exports"], function(__dependency1__, __exports__) { "use strict"; var withPluginApi = __dependency1__.withPluginApi; __exports__["default"] = { name: "apply-lazyYT", initialize: function () { withPluginApi('0.1', function (api) { api.decorateCooked(function ($elem) { return $('.lazyYT', $elem).lazyYT({ onPlay: function (e, $el) { // don't cloak posts that have playing videos in them var postId = parseInt($el.closest('article').data('post-id')); if (postId) { api.preventCloak(postId); } } }); }); }); } }; }); define("discourse/plugins/poll/lib/even-round", ["exports"], function(__exports__) { "use strict"; // stolen from http://stackoverflow.com/a/13484088/11983 function sumsUpTo100(percentages) { return percentages.map(function (p) { return Math.floor(p); }).reduce(function (a, b) { return a + b; }) === 100; } __exports__["default"] = function (percentages) { var sumOfDecimals = Math.ceil(percentages.map(function (a) { return a % 1; }).reduce(function (a, b) { return a + b; })); // compensate error by adding 1 to the first n "non-zero" items for (var i = 0, max = percentages.length; i < sumOfDecimals && i < max; i++) { if (percentages[i] > 0) { percentages[i] = ++percentages[i]; // quit early when there is a rounding issue if (sumsUpTo100(percentages)) break; } } return percentages.map(function (p) { return Math.floor(p); }); } }); define("discourse/plugins/poll/views/poll", ["ember-addons/ember-computed-decorators","exports"], function(__dependency1__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === "function") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var on = __dependency1__.on; __exports__["default"] = Em.View.extend(_createDecoratedObject([{ key: "templateName", initializer: function () { return "poll"; } }, { key: "classNames", initializer: function () { return ["poll"]; } }, { key: "attributeBindings", initializer: function () { return ["data-poll-type", "data-poll-name", "data-poll-status"]; } }, { key: "poll", initializer: function () { return Em.computed.alias("controller.poll"); } }, { key: "data-poll-type", initializer: function () { return Em.computed.alias("poll.type"); } }, { key: "data-poll-name", initializer: function () { return Em.computed.alias("poll.name"); } }, { key: "data-poll-status", initializer: function () { return Em.computed.alias("poll.status"); } }, { key: "_fixPollContainerHeight", decorators: [on("didInsertElement")], value: function () { var pollContainer = this.$(".poll-container"); pollContainer.height(pollContainer.height()); } }])); }); define("discourse/plugins/poll/components/poll-results-number", ["discourse/lib/round","exports"], function(__dependency1__, __exports__) { "use strict"; var round = __dependency1__["default"]; __exports__["default"] = Em.Component.extend({ tagName: "span", totalScore: (function () { return _.reduce(this.get("poll.options"), function (total, o) { var value = parseInt(o.get("html"), 10), votes = parseInt(o.get("votes"), 10); return total + value * votes; }, 0); }).property("poll.options.@each.{html,votes}"), average: (function () { var voters = this.get("poll.voters"); return voters === 0 ? 0 : round(this.get("totalScore") / voters, -2); }).property("totalScore", "poll.voters"), averageRating: (function () { return I18n.t("poll.average_rating", { average: this.get("average") }); }).property("average") }); }); define("discourse/plugins/poll/components/poll-results-standard", ["discourse/plugins/poll/lib/even-round","ember-addons/ember-computed-decorators","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === "function") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var evenRound = __dependency1__["default"]; var computed = __dependency2__["default"]; __exports__["default"] = Em.Component.extend(_createDecoratedObject([{ key: "tagName", initializer: function () { return "ul"; } }, { key: "classNames", initializer: function () { return ["results"]; } }, { key: "options", decorators: [computed("poll.voters", "poll.type", "poll.options.[]")], value: function (voters, type) { var options = this.get("poll.options"); var percentages = voters === 0 ? Array(options.length).fill(0) : _.map(options, function (o) { return 100 * o.get("votes") / voters; }); // properly round percentages if (type === "multiple") { // when the poll is multiple choices, just "round down" percentages = percentages.map(function (p) { return Math.floor(p); }); } else { // when the poll is single choice, adds up to 100% percentages = evenRound(percentages); } options.forEach(function (option, i) { var percentage = percentages[i]; var style = new Handlebars.SafeString("width: " + percentage + "%"); option.setProperties({ percentage: percentage, style: style, title: I18n.t("poll.option_title", { count: option.get("votes") }) }); }); return options; } }])); }); define("discourse/plugins/poll/components/poll-option", ["exports"], function(__exports__) { "use strict"; __exports__["default"] = Em.Component.extend({ tagName: "li", attributeBindings: ["data-poll-option-id", "data-poll-selected"], "data-poll-option-id": Em.computed.alias("option.id"), "data-poll-selected": (function () { return this.get("option.selected") ? "selected" : false; }).property("option.selected"), render: function (buffer) { buffer.push(this.get("option.html")); }, click: function (e) { // ensure we're not clicking on a link if ($(e.target).closest("a").length === 0) { this.sendAction("toggle", this.get("option")); } } }); }); define("discourse/plugins/poll/controllers/poll", ["ember-addons/ember-computed-decorators","exports"], function(__dependency1__, __exports__) { "use strict"; function _createDecoratedObject(descriptors) { var target = {}; for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = true; descriptor.configurable = true; if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === "function") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); } } } if (descriptor.initializer) { descriptor.value = descriptor.initializer.call(target); } Object.defineProperty(target, key, descriptor); } return target; } var computed = __dependency1__["default"]; __exports__["default"] = Ember.Controller.extend(_createDecoratedObject([{ key: "isMultiple", initializer: function () { return Ember.computed.equal("poll.type", "multiple"); } }, { key: "isNumber", initializer: function () { return Ember.computed.equal("poll.type", "number"); } }, { key: "isRandom", initializer: function () { return Ember.computed.equal("poll.order", "random"); } }, { key: "isClosed", initializer: function () { return Ember.computed.equal("poll.status", "closed"); } }, { key: "showingResults", // shows the results when // - poll is closed // - topic is archived // - user wants to see the results initializer: function () { return Em.computed.or("isClosed", "post.topic.archived", "showResults"); } }, { key: "showResultsDisabled", initializer: function () { return Em.computed.equal("poll.voters", 0); } }, { key: "hideResultsDisabled", initializer: function () { return Em.computed.or("isClosed", "post.topic.archived"); } }, { key: "poll", decorators: [computed("model", "vote", "model.voters", "model.options", "model.status")], value: function (poll, vote) { if (poll) { var options = _.map(poll.get("options"), function (o) { return Em.Object.create(o); }); if (vote) { options.forEach(function (o) { return o.set("selected", vote.indexOf(o.get("id")) >= 0); }); } poll.set("options", options); } return poll; } }, { key: "selectedOptions", decorators: [computed("poll.options.@each.selected")], value: function () { return _.map(this.get("poll.options").filterBy("selected"), function (o) { return o.get("id"); }); } }, { key: "min", decorators: [computed("poll.min")], value: function (min) { min = parseInt(min, 10); if (isNaN(min) || min < 1) { min = 1; } return min; } }, { key: "max", decorators: [computed("poll.max", "poll.options.length")], value: function (max, options) { max = parseInt(max, 10); if (isNaN(max) || max > options) { max = options; } return max; } }, { key: "votersText", decorators: [computed("poll.voters")], value: function (count) { return I18n.t("poll.voters", { count: count }); } }, { key: "totalVotes", decorators: [computed("poll.options.@each.votes")], value: function () { return _.reduce(this.get("poll.options"), function (total, o) { return total + parseInt(o.get("votes"), 10); }, 0); } }, { key: "totalVotesText", decorators: [computed("totalVotes")], value: function (count) { return I18n.t("poll.total_votes", { count: count }); } }, { key: "multipleHelpText", decorators: [computed("min", "max", "poll.options.length")], value: function (min, max, options) { if (max > 0) { if (min === max) { if (min > 1) { return I18n.t("poll.multiple.help.x_options", { count: min }); } } else if (min > 1) { if (max < options) { return I18n.t("poll.multiple.help.between_min_and_max_options", { min: min, max: max }); } else { return I18n.t("poll.multiple.help.at_least_min_options", { count: min }); } } else if (max <= options) { return I18n.t("poll.multiple.help.up_to_max_options", { count: max }); } } } }, { key: "canCastVotes", decorators: [computed("isClosed", "showResults", "loading", "isMultiple", "selectedOptions.length", "min", "max")], value: function (isClosed, showResults, loading, isMultiple, selectedOptionCount, min, max) { if (isClosed || showResults || loading) { return false; } if (isMultiple) { return selectedOptionCount >= min && selectedOptionCount <= max; } else { return selectedOptionCount > 0; } } }, { key: "castVotesDisabled", initializer: function () { return Em.computed.not("canCastVotes"); } }, { key: "canToggleStatus", decorators: [computed("loading", "post.user_id", "post.topic.archived")], value: function (loading, userId, topicArchived) { return this.currentUser && (this.currentUser.get("id") === userId || this.currentUser.get("staff")) && !loading && !topicArchived; } }, { key: "actions", initializer: function () { return { toggleOption: function (option) { if (this.get("isClosed")) { return; } if (!this.currentUser) { return this.send("showLogin"); } var wasSelected = option.get("selected"); if (!this.get("isMultiple")) { this.get("poll.options").forEach(function (o) { return o.set("selected", false); }); } option.toggleProperty("selected"); if (!this.get("isMultiple") && !wasSelected) { this.send("castVotes"); } }, castVotes: function () { var _this = this; if (!this.get("canCastVotes")) { return; } if (!this.currentUser) { return this.send("showLogin"); } this.set("loading", true); Discourse.ajax("/polls/vote", { type: "PUT", data: { post_id: this.get("post.id"), poll_name: this.get("poll.name"), options: this.get("selectedOptions") } }).then(function (results) { _this.setProperties({ vote: results.vote, showResults: true }); _this.set("model", Em.Object.create(results.poll)); }).catch(function () { bootbox.alert(I18n.t("poll.error_while_casting_votes")); }).finally(function () { _this.set("loading", false); }); }, toggleResults: function () { this.toggleProperty("showResults"); }, toggleStatus: function () { if (!this.get("canToggleStatus")) { return; } var self = this, confirm = this.get("isClosed") ? "poll.open.confirm" : "poll.close.confirm"; bootbox.confirm(I18n.t(confirm), I18n.t("no_value"), I18n.t("yes_value"), function (confirmed) { if (confirmed) { self.set("loading", true); Discourse.ajax("/polls/toggle_status", { type: "PUT", data: { post_id: self.get("post.id"), poll_name: self.get("poll.name"), status: self.get("isClosed") ? "open" : "closed" } }).then(function (results) { self.set("model", Em.Object.create(results.poll)); }).catch(function () { bootbox.alert(I18n.t("poll.error_while_toggling_status")); }).finally(function () { self.set("loading", false); }); } }); } }; } }])); }); define("discourse/plugins/poll/initializers/extend-for-poll", ["discourse/lib/plugin-api","exports"], function(__dependency1__, __exports__) { "use strict"; var withPluginApi = __dependency1__.withPluginApi; function createPollView(container, post, poll, vote) { var controller = container.lookup("controller:poll", { singleton: false }); var view = container.lookup("view:poll"); controller.set("vote", vote); controller.setProperties({ model: poll, post: post }); view.set("controller", controller); return view; } var _pollViews = undefined; function initializePolls(api) { var TopicController = api.container.lookupFactory('controller:topic'); TopicController.reopen({ subscribe: function () { var _this = this; this._super(); this.messageBus.subscribe("/polls/" + this.get("model.id"), function (msg) { var post = _this.get('model.postStream').findLoadedPost(msg.post_id); if (post) { post.set('polls', msg.polls); } }); }, unsubscribe: function () { this.messageBus.unsubscribe('/polls/*'); this._super(); } }); var Post = api.container.lookupFactory('model:post'); Post.reopen({ _polls: null, pollsObject: null, // we need a proper ember object so it is bindable pollsChanged: (function () { var _this2 = this; var polls = this.get("polls"); if (polls) { this._polls = this._polls || {}; _.map(polls, function (v, k) { var existing = _this2._polls[k]; if (existing) { _this2._polls[k].setProperties(v); } else { _this2._polls[k] = Em.Object.create(v); } }); this.set("pollsObject", this._polls); } }).observes("polls") }); function cleanUpPollViews() { if (_pollViews) { Object.keys(_pollViews).forEach(function (pollName) { return _pollViews[pollName].destroy(); }); } _pollViews = null; } function createPollViews($elem, helper) { var $polls = $('.poll', $elem); if (!$polls.length) { return; } var post = helper.getModel(); api.preventCloak(post.id); var votes = post.get('polls_votes') || {}; post.pollsChanged(); var polls = post.get("pollsObject"); if (!polls) { return; } cleanUpPollViews(); var postPollViews = {}; $polls.each(function (idx, pollElem) { var $div = $("
"); var $poll = $(pollElem); var pollName = $poll.data("poll-name"); var pollId = pollName + "-" + post.id; var pollView = createPollView(helper.container, post, polls[pollName], votes[pollName]); $poll.replaceWith($div); Em.run.next(function () { return pollView.renderer.replaceIn(pollView, $div[0]); }); postPollViews[pollId] = pollView; }); _pollViews = postPollViews; } api.decorateCooked(createPollViews, { onlyStream: true }); api.cleanupStream(cleanUpPollViews); } __exports__["default"] = { name: "extend-for-poll", initialize: function () { withPluginApi('0.1', initializePolls); } }; }); Ember.TEMPLATES["javascripts/poll"] = Ember.HTMLBars.template((function() { var child0 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "poll-results-number", [], {"poll": get(env, context, "poll")}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "poll-results-standard", [], {"poll": get(env, context, "poll")}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "isNumber")], {}, child0, child1); return fragment; } }; }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); set(env, context, "option", blockArguments[0]); inline(env, morph0, context, "poll-option", [], {"option": get(env, context, "option"), "toggle": "toggleOption"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("ul"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode(" "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(dom.childAt(fragment, [1]),1,1); block(env, morph0, context, "each", [get(env, context, "poll.options")], {}, child0, null); return fragment; } }; }()); var child2 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("span"); dom.setAttribute(el2,"class","info-number"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("span"); dom.setAttribute(el2,"class","info-text"); var el3 = dom.createComment(""); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var morph0 = dom.createMorphAt(dom.childAt(element0, [1]),0,0); var morph1 = dom.createMorphAt(dom.childAt(element0, [3]),0,0); content(env, morph0, context, "totalVotes"); content(env, morph1, context, "totalVotesText"); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("p"); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createUnsafeMorphAt(dom.childAt(fragment, [1]),0,0); content(env, morph0, context, "multipleHelpText"); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "showingResults")], {}, child0, child1); return fragment; } }; }()); var child3 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"class": "cast-votes", "title": "poll.cast-votes.title", "label": "poll.cast-votes.label", "disabled": get(env, context, "castVotesDisabled"), "action": "castVotes"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "unless", [get(env, context, "hideResultsDisabled")], {}, child0, null); return fragment; } }; }()); var child4 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"class": "toggle-results", "title": "poll.hide-results.title", "label": "poll.hide-results.label", "icon": "eye-slash", "disabled": get(env, context, "hideResultsDisabled"), "action": "toggleResults"}); return fragment; } }; }()); var child5 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"class": "toggle-results", "title": "poll.show-results.title", "label": "poll.show-results.label", "icon": "eye", "disabled": get(env, context, "showResultsDisabled"), "action": "toggleResults"}); return fragment; } }; }()); var child6 = (function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"class": "toggle-status", "title": "poll.open.title", "label": "poll.open.label", "icon": "unlock-alt", "action": "toggleStatus"}); return fragment; } }; }()); var child1 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, inline = hooks.inline; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,1,1,contextualElement); inline(env, morph0, context, "d-button", [], {"class": "toggle-status btn-danger", "title": "poll.close.title", "label": "poll.close.label", "icon": "lock", "action": "toggleStatus"}); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "if", [get(env, context, "isClosed")], {}, child0, child1); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createElement("div"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","poll-container"); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","poll-info"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("p"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("span"); dom.setAttribute(el4,"class","info-number"); var el5 = dom.createComment(""); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("span"); dom.setAttribute(el4,"class","info-text"); var el5 = dom.createComment(""); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n"); dom.appendChild(el2, el3); var el3 = dom.createComment(""); dom.appendChild(el2, el3); var el3 = dom.createTextNode(" "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n\n"); dom.appendChild(el0, el1); var el1 = dom.createElement("div"); dom.setAttribute(el1,"class","poll-buttons"); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n"); dom.appendChild(el1, el2); var el2 = dom.createComment(""); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element1 = dom.childAt(fragment, [0]); var element2 = dom.childAt(element1, [3]); var element3 = dom.childAt(element2, [1]); var element4 = dom.childAt(fragment, [2]); var morph0 = dom.createMorphAt(dom.childAt(element1, [1]),1,1); var morph1 = dom.createMorphAt(dom.childAt(element3, [1]),0,0); var morph2 = dom.createMorphAt(dom.childAt(element3, [3]),0,0); var morph3 = dom.createMorphAt(element2,3,3); var morph4 = dom.createMorphAt(element4,1,1); var morph5 = dom.createMorphAt(element4,3,3); var morph6 = dom.createMorphAt(element4,5,5); block(env, morph0, context, "if", [get(env, context, "showingResults")], {}, child0, child1); content(env, morph1, context, "poll.voters"); content(env, morph2, context, "votersText"); block(env, morph3, context, "if", [get(env, context, "isMultiple")], {}, child2, null); block(env, morph4, context, "if", [get(env, context, "isMultiple")], {}, child3, null); block(env, morph5, context, "if", [get(env, context, "showingResults")], {}, child4, child5); block(env, morph6, context, "if", [get(env, context, "canToggleStatus")], {}, child6, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/poll-results-standard"] = Ember.HTMLBars.template((function() { var child0 = (function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 1, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createTextNode(" "); dom.appendChild(el0, el1); var el1 = dom.createElement("li"); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","option"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("p"); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createElement("span"); dom.setAttribute(el4,"class","percentage"); var el5 = dom.createComment(""); dom.appendChild(el4, el5); var el5 = dom.createTextNode("%"); dom.appendChild(el4, el5); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); var el4 = dom.createComment(""); dom.appendChild(el3, el4); var el4 = dom.createTextNode("\n "); dom.appendChild(el3, el4); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); var el2 = dom.createElement("div"); dom.setAttribute(el2,"class","bar-back"); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); var el3 = dom.createElement("div"); dom.setAttribute(el3,"class","bar"); dom.appendChild(el2, el3); var el3 = dom.createTextNode("\n "); dom.appendChild(el2, el3); dom.appendChild(el1, el2); var el2 = dom.createTextNode("\n "); dom.appendChild(el1, el2); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement, blockArguments) { var dom = env.dom; var hooks = env.hooks, set = hooks.set, content = hooks.content, get = hooks.get, attribute = hooks.attribute; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var element0 = dom.childAt(fragment, [1]); var element1 = dom.childAt(element0, [1, 1]); var element2 = dom.childAt(element0, [3, 1]); var morph0 = dom.createMorphAt(dom.childAt(element1, [1]),0,0); var morph1 = dom.createUnsafeMorphAt(element1,3,3); var attrMorph0 = dom.createAttrMorph(element2, 'style'); set(env, context, "option", blockArguments[0]); content(env, morph0, context, "option.percentage"); content(env, morph1, context, "option.html"); attribute(env, attrMorph0, element2, "style", get(env, context, "option.style")); return fragment; } }; }()); return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, get = hooks.get, block = hooks.block; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, null); dom.insertBoundary(fragment, 0); block(env, morph0, context, "each", [get(env, context, "options")], {}, child0, null); return fragment; } }; }())); Ember.TEMPLATES["javascripts/components/poll-results-number"] = Ember.HTMLBars.template((function() { return { isHTMLBars: true, revision: "Ember@1.12.2", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); var el1 = dom.createComment(""); dom.appendChild(el0, el1); var el1 = dom.createTextNode("\n"); dom.appendChild(el0, el1); return el0; }, render: function render(context, env, contextualElement) { var dom = env.dom; var hooks = env.hooks, content = hooks.content; dom.detectNamespace(contextualElement); var fragment; if (env.useFragmentCache && dom.canClone) { if (this.cachedFragment === null) { fragment = this.build(dom); if (this.hasRendered) { this.cachedFragment = fragment; } else { this.hasRendered = true; } } if (this.cachedFragment) { fragment = dom.cloneNode(this.cachedFragment, true); } } else { fragment = this.build(dom); } var morph0 = dom.createUnsafeMorphAt(fragment,0,0,contextualElement); dom.insertBoundary(fragment, 0); content(env, morph0, context, "averageRating"); return fragment; } }; }()));