Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * jQuery custom cloudsense widget plug-in 1.0.0
  3.  *
  4.  * Author Akshay Daxini
  5.  */
  6. (function(factory) {
  7.     if (typeof define === "function" && define.amd) {
  8.         // AMD. Register as an anonymous module.
  9.         define([
  10.             "jquery",
  11.             // These are only for backcompat
  12.             // TODO: Remove after 1.12
  13.             "./controlgroup",
  14.             "./checkboxradio",
  15.             "../keycode",
  16.             "../widget"
  17.         ], factory);
  18.     } else {
  19.         // Browser globals
  20.         factory(jQuery);
  21.     }
  22. }(function($) {
  23.     $.widget("cs.herokuDynoWidget", $.cs.gridStackItemWidget, {
  24.         version: "1.0.0",
  25.         dynoState: 0,
  26.         iframHTML: '',
  27.         options: {
  28.             apiEnabled: true,
  29.             apiUrlStart: 'https://localhost:3000/api/heroku/startStopDyno',
  30.         },
  31.         connect: function() {
  32.  
  33.         },
  34.         _getCreateOptions: function() {
  35.             let options = this._super() || {};
  36.             return options;
  37.         },
  38.         startStop: function() {
  39.             if (this.options.dynoState === 0) {
  40.  
  41.             }
  42.         },
  43.         _create: function() {
  44.             console.log(this.element);
  45.             this.element
  46.                 .find('.grid-stack-item-content')
  47.                 .append('<button class="btn btn-info">Start/Stop</button>');
  48.  
  49.             this._super(this.element);
  50.         },
  51.         _destroy: function() {},
  52.         _setOptions: function(options) {
  53.             this._super(this.options);
  54.         },
  55.         _setOption: function(key, value) {
  56.             this._super(key, value);
  57.         },
  58.         refresh: function() {}
  59.     });
  60.     return $.cs.gridStackItemWidget;
  61. }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement