Adds the panel's CSS and JavaScript to the &lt;head&gt;.
287
public function head()
    {
        global $event, $theme;

        if ($event != 'rah_backup') {
            return;
        }

        gTxtScript(array(
            'rah_backup_confirm_backup',
        ));

        $msg = array(
            'backup' => escape_js($theme->announce_async(gTxt('rah_backup_taking'))),
            'error' => escape_js($theme->announce_async(gTxt('rah_backup_task_error'))),
        );

        $js = <<<EOF
            $(function ()
            {
                $('.rah_backup_take').on('click', function (e)
                {
                    e.preventDefault();
                    var obj = $(this), href, spinner;

                    if (obj.hasClass('disabled') || !verify(textpattern.gTxt('rah_backup_confirm_backup'))) {
                        return false;
                    }

                    $.globalEval('{$msg['backup']}');

                    spinner = $('<span> <span class="spinner"></span> </span>');
                    href = obj.attr('href');
                    obj.addClass('disabled').attr('href', '#').after(spinner);

                    $.ajax('index.php', {
                        data: href.substr(1) + '&app_mode=async',
                        dataType: 'script',
                        timeout: 1800000
                    }).fail(function ()
                    {
                        $.globalEval('{$msg['error']}');
                    }).always(function ()
                    {
                        obj.removeClass('disabled').attr('href', href);
                        spinner.remove();
                    });
                });
            });
EOF;

        echo script_js($js);
    }
152346
public void addStyleSheetProperties(Content head) {
        String stylesheetfile = configuration.stylesheetfile;
        DocPath stylesheet;
        if (stylesheetfile.isEmpty()) {
            stylesheet = DocPaths.STYLESHEET;
        } else {
            DocFile file = DocFile.createFileForInput(configuration, stylesheetfile);
            stylesheet = DocPath.create(file.getName());
        }
        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css",
                pathToRoot.resolve(stylesheet).getPath(),
                "Style");
        head.addContent(link);
        if (configuration.createindex) {
            HtmlTree jq_link = HtmlTree.LINK("stylesheet", "text/css",
                    pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(DocPaths.JQUERY_STYLESHEET_FILE)).getPath(),
                    "Style");
            head.addContent(jq_link);
        }
    }
415879
function() {
      var editor = $('<div></div>').addClass('kelmu-editor').css('z-order', '60000');
      editor.css('position', 'absolute').css('top', '10px').css('left', (container.children('div').last().outerWidth() + 100) + 'px');
      editor.css('border-radius', '5px').css('box-shadow', '3px 3px 5px #888888').css('background-color', '#FFFAE5');
      editor.css('padding', '10').css('cursor', 'move').draggable();
      editor.appendTo(container);

      editor.append($('<h3>Annotation editor</h3>').css('margin', '5px 0px'));

      // *********************************************************************************************************

      var statusView = $('<div></div>').text('Step 1, substep 1 of 1').addClass('kelmu-editor-status');
      statusView.appendTo(editor);

      // *********************************************************************************************************

      var generalButtons = $('<div></div>').addClass('kelmu-editor-general-buttons');
      generalButtons.appendTo(editor);

      $('<button></button>').text('Settings').addClass('btn').appendTo(generalButtons).click(function(e) {
        e.preventDefault();
        container.find('.kelmu-editor-pane').remove();
        editor.css('height', '');
        editor.css('width', '');
        window.kelmu.data[id].selectedElementNumber = -1;
        window.kelmu.data[id].previousSelectedElementNumber = -1;

        var settingsPanel = $('<div></div>').addClass('kelmu-editor-pane').appendTo(editor);

        addComponent('Length (ms)', settingsPanel, 'kelmu-editor-animation-length', window.kelmu.data[id].settings.animationLength, 'text');

        var helpShown = false;

        var pickerFunction = function() {

          if (!helpShown) {
            alert('Move the mouse cursor on top of the button and\nkeep moving the cursor until it gets a green border.');
            helpShown = true;
          }

          buttonPickerEnabled = true;
          element.find('a, button').css('border', '');
          if (!buttonPickerCreated) {
            createButtonPicker();
          }
        };

        addComponent('Begin button', settingsPanel, 'kelmu-editor-begin-button', window.kelmu.data[id].settings.begin, 'text');
        $('<br>').appendTo(settingsPanel);
        $('<button></button>').text('Point Begin button').appendTo(settingsPanel).click(function(e) {
          e.preventDefault();
          buttonToPick = 'begin';
          pickerFunction();
        });
        $('<br>').appendTo(settingsPanel);

        addComponent('Undo button', settingsPanel, 'kelmu-editor-undo-button', window.kelmu.data[id].settings.undo, 'text');
        $('<br>').appendTo(settingsPanel);
        $('<button></button>').text('Point Undo button').appendTo(settingsPanel).click(function(e) {
          e.preventDefault();
          buttonToPick = 'undo';
          pickerFunction();
        });
        $('<br>').appendTo(settingsPanel);

        addComponent('Step button', settingsPanel, 'kelmu-editor-step-button', window.kelmu.data[id].settings.step, 'text');
        $('<br>').appendTo(settingsPanel);
        $('<button></button>').text('Point Step button').appendTo(settingsPanel).click(function(e) {
          e.preventDefault();
          buttonToPick = 'step';
          pickerFunction();
        });
        $('<br>').appendTo(settingsPanel);

        addComponent('Redo button', settingsPanel, 'kelmu-editor-redo-button', window.kelmu.data[id].settings.redo, 'text');
        $('<br>').appendTo(settingsPanel);
        $('<button></button>').text('Point Redo button').appendTo(settingsPanel).click(function(e) {
          e.preventDefault();
          buttonToPick = 'redo';
          pickerFunction();
        });
        $('<br>').appendTo(settingsPanel);

        $('<button></button>').text('Save settings').appendTo($('<p></p>').appendTo(settingsPanel)).click(function(e) {
          e.preventDefault();

          window.kelmu.data[id].settings.animationLength = parseInt(settingsPanel.find('.kelmu-editor-animation-length').val(), 10);
          window.kelmu.data[id].settings.undo = settingsPanel.find('.kelmu-editor-undo-button').val();
          window.kelmu.data[id].settings.step = settingsPanel.find('.kelmu-editor-step-button').val();
          window.kelmu.data[id].settings.redo = settingsPanel.find('.kelmu-editor-redo-button').val();
          window.kelmu.data[id].settings.begin = settingsPanel.find('.kelmu-editor-begin-button').val();

          buttonPickerEnabled = false;

          window.kelmu.data[id].actions.update();
          updateView(true, true);
          window.kelmu.data[id].actions.initButtons();

          alert('Settings saved.');

        });

      });

      $('<button></button>').text('Import').addClass('btn').appendTo(generalButtons).click(function(e) {
        e.preventDefault();
        container.find('.kelmu-editor-pane').remove();
        editor.css('height', '');
        editor.css('width', '');
        window.kelmu.data[id].selectedElementNumber = -1;
        window.kelmu.data[id].previousSelectedElementNumber = -1;

        var importPanel = $('<div></div>').addClass('kelmu-editor-pane').appendTo(editor);
        var helpLabel = $('<p></p>').css('font-size', '11px').appendTo(importPanel);
        helpLabel.text('Copy and paste the definition below.');
        var textarea = $('<textarea></textarea>').appendTo(importPanel);
        textarea.css('font-size', '10px').css('min-height', '200px');
        $('<button></button>').text('Import').appendTo($('<p></p>').appendTo(importPanel)).click(function(e) {
          e.preventDefault();

          var text = textarea.val().trim();
          if (text.indexOf('kelmuCb(') >= 0) {
            text = text.substring(8, text.length - 1);
          }

          try {
            var parsed = JSON.parse(text);
            if (parsed[id] && parsed[id].settings && parsed[id].definitions) {
              window.kelmu.data[id].settings = parsed[id].settings;
              window.kelmu.data[id].definitions = parsed[id].definitions;
              alert('Definitions succesfully imported.');
              window.kelmu.data[id].actions.update();
              updateView(true, true);
              window.kelmu.data[id].actions.initButtons();
            } else {
              alert('Definition for ' + id + ' was not found or it is incomplete!');
            }
          } catch (error) {
            alert('Malformed definition!');
          }

        });
      });

      $('<button></button>').text('Export').addClass('btn').appendTo(generalButtons).click(function(e) {
        e.preventDefault();
        container.find('.kelmu-editor-pane').remove();
        editor.css('height', '');
        editor.css('width', '');
        window.kelmu.data[id].selectedElementNumber = -1;
        window.kelmu.data[id].previousSelectedElementNumber = -1;

        var exportedData = {};
        exportedData[id] = { definitions: window.kelmu.data[id].definitions, settings: window.kelmu.data[id].settings };

        var exportPanel = $('<div></div>').addClass('kelmu-editor-pane').appendTo(editor);
        var helpLabel = $('<p></p>').css('font-size', '11px').appendTo(exportPanel);
        helpLabel.text('Copy and paste the following definition in a file with extension .jsonp');
        var textarea = $('<textarea></textarea>').appendTo(exportPanel);
        textarea.css('font-size', '10px').css('min-height', '200px');
        textarea.val('kelmuCb(' + JSON.stringify(exportedData) + ')');
      });

      // *********************************************************************************************************

      var buttons = $('<div></div>').addClass('kelmu-editor-move-buttons');
      buttons.appendTo(editor);

      // Previous substep
      $('<button></button>').text('<').addClass('btn').appendTo(buttons).click(function(e) {
        e.preventDefault();
        if (window.kelmu.data[id].subStepNumber > 0) {
          window.kelmu.data[id].actions.setSubstep(window.kelmu.data[id].subStepNumber - 1);
        }
        window.kelmu.data[id].selectedElementNumber = -1;
        updateView(true, false);
      });

      // Next substep
      $('<button></button>').text('>').addClass('btn').appendTo(buttons).click(function(e) {
        e.preventDefault();
        if (window.kelmu.data[id].subStepNumber < (window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber] || []).length - 1) {
          window.kelmu.data[id].actions.setSubstep(window.kelmu.data[id].subStepNumber + 1);
        }
        window.kelmu.data[id].selectedElementNumber = -1;
        updateView(true, false);
      });

      // New substep
      $('<button></button>').text('+Substep').addClass('btn').appendTo(buttons).click(function(e) {
        e.preventDefault();

        if (!window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber]) {
          // Create new definition block for the substep
          window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber] = [[]];
        }

        window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber].splice(window.kelmu.data[id].subStepNumber + 1, 0, []);
        window.kelmu.data[id].actions.setSubstep(window.kelmu.data[id].subStepNumber + 1);
        window.kelmu.data[id].selectedElementNumber = -1;
        updateView(true, false);
        notifyModifications();
      });

      // Remove substep
      $('<button></button>').text('-Substep').addClass('btn').appendTo(buttons).click(function(e) {
        e.preventDefault();
        if ((window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber] || []).length > 1) {
          if (confirm('Do you really want to remove this substep?')) {
            // Remove the definition block and make sure that the substep in the editor exists
            window.kelmu.data[id].definitions['step' + window.kelmu.data[id].stepNumber].splice(window.kelmu.data[id].subStepNumber, 1);
            window.kelmu.data[id].actions.setSubstep(Math.max(window.kelmu.data[id].subStepNumber - 1, 0));
          }

          window.kelmu.data[id].selectedElementNumber = -1;
          updateView(true, false);
          notifyModifications();
        } else {
          alert('You cannot remove the only substep!');
        }
      });

      // *********************************************************************************************************

      var newButtons = $('<div></div>').addClass('kelmu-editor-new-buttons');
      newButtons.appendTo(editor);

      var createNewButton = function(name, defaults, values) {
        return $('<button></button>').text(name).addClass('btn').appendTo(newButtons).click(function(e) {
          e.preventDefault();
          var data = window.kelmu.data[id];

          // Create new definition array for this step if it doesn't exist
          if (!data.definitions['step' + data.stepNumber]) {
            data.definitions['step' + data.stepNumber] = [[]];
          }

          data.definitions['step' + data.stepNumber][data.subStepNumber].push($.extend({}, values, defaults));
          data.selectedElementNumber = data.definitions['step' + data.stepNumber][data.subStepNumber].length - 1;
          data.actions.update();
          updateView(true, true);
          notifyModifications();
        });
      };

      // New text annotation
      createNewButton('+Text', window.kelmu.defaults.text, {
        text: 'New text',
        width: 400,
        height: 80,
        left: 10,
        top: 10
      }).appendTo(newButtons);

      // New arrow
      createNewButton('+Arrow', window.kelmu.defaults.arrow, {
        y1: 10,
        x1: 10,
        y2: 60,
        x2: 60
      }).appendTo(newButtons);

      // New line annotation
      createNewButton('+Line', window.kelmu.defaults.line, {
        y1: 10,
        x1: 10,
        y2: 60,
        x2: 60
      }).appendTo(newButtons);

      // New button
      createNewButton('+Button', window.kelmu.defaults.button, {}).appendTo(newButtons);

      // New action event
      createNewButton('+Action', window.kelmu.defaults.action, {}).appendTo(newButtons);

      // New sound
      createNewButton('+Sound', window.kelmu.defaults.sound, {}).click(function(e) {
        e.preventDefault();
        container.find('.kelmu-sound-control').show();
      }).appendTo(newButtons);

      // *********************************************************************************************************
      var componentPanel = $('<div></div>').addClass('kelmu-editor-components');
      componentPanel.appendTo(editor);

      // *********************************************************************************************************

      return editor;

    }
182018
function () {
            var carousel = this,
                cssClass = carousel.CLASSES;

            if (carousel.fireEvent(beforeShowEvent) !== false) {
                carousel.addClass(cssClass.VISIBLE);
                carousel.fireEvent(showEvent);
            }
        }
899248
function injectStyles() {
  if (_stylesInjected) return;
  _stylesInjected = true;

  let node = doc.createElement('style');
  node.innerHTML = css;
  node.type = 'text/css';

  if (doc.head.childNodes.length > 0) {
    doc.head.insertBefore(node, doc.head.childNodes[0]);
  } else {
    doc.head.appendChild(node);
  }
}
703973
public function Initialize() {
      $this->Head = new HeadModule($this);
      $this->AddCssFile('setup.css');
      $this->AddJsFile('jquery.js');
      // Make sure all errors are displayed.
      SaveToConfig('Garden.Errors.MasterView', 'deverror.master.php', array('Save' => FALSE));
   }
232251
public function Initialize() {
      // Set up head
      $this->Head = new HeadModule($this);
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      
      if (in_array($this->ControllerName, array('profilecontroller', 'activitycontroller'))) {
         $this->AddCssFile('style.css');
      } else {
         $this->AddCssFile('admin.css');
      }
      
      // Change master template
      $this->MasterView = 'admin';
      parent::Initialize();
      Gdn_Theme::Section('Dashboard');
   }
697474
public void setHeader(HasJqmHeader header) {
        removeHeader();
        this.header = header;
        if (this.header == null) return;

        addLogical(header.getHeaderStage());

        if (panel == null) {
        	getElement().insertBefore(header.getJqmHeader().getElement(), getElement().getFirstChild());
        } else {
        	getElement().insertAfter(header.getJqmHeader().getElement(), panel.getElement());
        }
    }
12648
void updateCss() {

        String formatterId = m_formatterSelect.getFormValueAsString();
        CmsFormatterConfig formatter = m_elementBean.getFormatters().get(m_containerId).get(formatterId);
        Set<String> cssResources = formatter.getCssResources();
        for (String cssResource : cssResources) {
            CmsDomUtil.ensureStyleSheetIncluded(cssResource);
        }
        if (formatter.hasInlineCss()) {
            ensureInlineCss(formatterId, formatter.getInlineCss());
        }
    }
114320
function() {
	      
	   // Add element button
	   if(this.options.useButtons) {
	      this.addButton = inputEx.cn('img', {src: inputEx.spacerUrl, className: 'inputEx-ListField-addButton'});
	      this.fieldContainer.appendChild(this.addButton);
      }
	      
	   // List label
	   this.fieldContainer.appendChild( inputEx.cn('span', null, {marginLeft: "4px"}, this.options.listLabel) );
	      
	   // Div element to contain the children
	   this.childContainer = inputEx.cn('div', {className: 'inputEx-ListField-childContainer'});
	   this.fieldContainer.appendChild(this.childContainer);
	   
	   // Add link
	   if(!this.options.useButtons) {
	      this.addButton = inputEx.cn('a', {className: 'inputEx-List-link'}, null, this.options.listAddLabel);
	      this.fieldContainer.appendChild(this.addButton);
      }
	}
155877
function () {
        var self = this, settings = self.settings;

        self.active(true);

        if (!self.panel) {
          var panelSettings = settings.panel;

          // Wrap panel in grid layout if type if specified
          // This makes it possible to add forms or other containers directly in the panel option
          if (panelSettings.type) {
            panelSettings = {
              layout: 'grid',
              items: panelSettings
            };
          }

          panelSettings.role = panelSettings.role || 'dialog';
          panelSettings.popover = true;
          panelSettings.autohide = true;
          panelSettings.ariaRoot = true;

          self.panel = new FloatPanel(panelSettings).on('hide', function () {
            self.active(false);
          }).on('cancel', function (e) {
            e.stopPropagation();
            self.focus();
            self.hidePanel();
          }).parent(self).renderTo(self.getContainerElm());

          self.panel.fire('show');
          self.panel.reflow();
        } else {
          self.panel.show();
        }

        self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc']));
      }
862487
function( cssFileUrl )
		{
			if ( this.$.createStyleSheet )
				this.$.createStyleSheet( cssFileUrl );
			else
			{
				var link = new CKEDITOR.dom.element( 'link' );
				link.setAttributes(
					{
						rel		:'stylesheet',
						type	: 'text/css',
						href	: cssFileUrl
					});

				this.getHead().append( link );
			}
		}
663091
function Stylesheet() {
  var styleElement = document.createElement('style'),
    head = document.getElementsByTagName('head')[0];

  head.appendChild(styleElement);

  // Safari does not see the new stylesheet unless you append something.
  // However!  IE will blow chunks, so ... filter it thusly:
  if (!window.createPopup) {
    styleElement.appendChild(document.createTextNode(''));
  }

  this.sheet = document.styleSheets[document.styleSheets.length - 1];
}
47293
private void initButtonPanel() {

        if ((m_buttonPanel == null) && m_isFrame) {
            m_buttonPanel = new FlowPanel();
            m_buttonPanel.addStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().popupButtonPanel());
            m_main.add(m_buttonPanel);
        }
    }
503086
private void buildTargetPanel() {
		setUpUtilBar();
		panel.add(utilBar);
		panel.add(heading);
		panel.add(panelContentRO);
		panel.add(menu);
	}
234764
function setup() {
    var tmp = get('skin');
    if (tmp && $.inArray(tmp, my_skins))
      change_skin(tmp);

    //Add the change skin listener
    $("[data-skin]").on('click', function (e) {
      if($(this).hasClass('knob'))
        return;
      e.preventDefault();
      change_skin($(this).data('skin'));
    });

    //Add the layout manager
    $("[data-layout]").on('click', function () {
      change_layout($(this).data('layout'));
    });

    $("[data-controlsidebar]").on('click', function () {
      change_layout($(this).data('controlsidebar'));
      var slide = !AdminLTE.options.controlSidebarOptions.slide;
      AdminLTE.options.controlSidebarOptions.slide = slide;
      if (!slide)
        $('.control-sidebar').removeClass('control-sidebar-open');
    });

    $("[data-sidebarskin='toggle']").on('click', function () {
      var sidebar = $(".control-sidebar");
      if (sidebar.hasClass("control-sidebar-dark")) {
        sidebar.removeClass("control-sidebar-dark")
        sidebar.addClass("control-sidebar-light")
      } else {
        sidebar.removeClass("control-sidebar-light")
        sidebar.addClass("control-sidebar-dark")
      }
    });

    $("[data-enable='expandOnHover']").on('click', function () {
      $(this).attr('disabled', true);
      AdminLTE.pushMenu.expandOnHover();
      if (!$('body').hasClass('sidebar-collapse'))
        $("[data-layout='sidebar-collapse']").click();
    });

    // Reset options
    if ($('body').hasClass('fixed')) {
      $("[data-layout='fixed']").attr('checked', 'checked');
    }
    if ($('body').hasClass('layout-boxed')) {
      $("[data-layout='layout-boxed']").attr('checked', 'checked');
    }
    if ($('body').hasClass('sidebar-collapse')) {
      $("[data-layout='sidebar-collapse']").attr('checked', 'checked');
    }

  }
17955
function attach() {
    const container = this.options.container;

    if (container instanceof HTMLElement) {
        const style = window.getComputedStyle(container);

        if (style.position === 'static') {
            container.style.position = 'relative';
        }
    }

    container.addEventListener('scroll', this._scroll);
    window.addEventListener('resize', this._scroll);
    this._scroll();
    this.attached = true;
}