Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * jQuery custom cloudsense widget plug-in 1.0.0
- *
- * Author Akshay Daxini
- */
- (function(factory) {
- if (typeof define === "function" && define.amd) {
- // AMD. Register as an anonymous module.
- define([
- "jquery",
- // These are only for backcompat
- // TODO: Remove after 1.12
- "./controlgroup",
- "./checkboxradio",
- "../keycode",
- "../widget"
- ], factory);
- } else {
- // Browser globals
- factory(jQuery);
- }
- }(function($) {
- $.widget("cs.herokuDynoWidget", $.cs.gridStackItemWidget, {
- version: "1.0.0",
- dynoState: 0,
- iframHTML: '',
- options: {
- apiEnabled: true,
- apiUrlStart: 'https://localhost:3000/api/heroku/startStopDyno',
- },
- connect: function() {
- },
- _getCreateOptions: function() {
- let options = this._super() || {};
- return options;
- },
- startStop: function() {
- if (this.options.dynoState === 0) {
- }
- },
- _create: function() {
- console.log(this.element);
- this.element
- .find('.grid-stack-item-content')
- .append('<button class="btn btn-info">Start/Stop</button>');
- this._super(this.element);
- },
- _destroy: function() {},
- _setOptions: function(options) {
- this._super(this.options);
- },
- _setOption: function(key, value) {
- this._super(key, value);
- },
- refresh: function() {}
- });
- return $.cs.gridStackItemWidget;
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement