Creates the close button HTML element and adds it to Calendar container DIV

@method createCloseButton
@return The close HTML element created
334705
function() {
        var cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,
            cssLinkClose = this.Style.CSS_LINK_CLOSE,
            DEPR_CLOSE_PATH = "us/my/bn/x_d.gif",
            
            lnk = Dom.getElementsByClassName(cssLinkClose, "a", this.oDomContainer)[0],
            strings = this.cfg.getProperty(DEF_CFG.STRINGS.key),
            closeStr = (strings && strings.close) ? strings.close : "";

        if (!lnk) {
            lnk = document.createElement("a");
            Event.addListener(lnk, "click", function(e, cal) {
                cal.hide(); 
                Event.preventDefault(e);
            }, this);
        }

        lnk.href = "#";
        lnk.className = cssLinkClose;

        if (Calendar.IMG_ROOT !== null) {
            var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img");
            img.src = Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
            img.className = cssClose;
            lnk.appendChild(img);
        } else {
            lnk.innerHTML = '<span class="' + cssClose + ' ' + this.Style.CSS_CLOSE + '">' + closeStr + '</span>';
        }
        this.oDomContainer.appendChild(lnk);

        return lnk;
    }
1368434
function focusOnOpen() {
        if (options.focusOnOpen) {
          var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;
          target.focus();
        }

        /**
         * If no element with class dialog-close, try to find the last
         * button child in md-actions and assume it is a close button.
         *
         * If we find no actions at all, log a warning to the console.
         */
        function findCloseButton() {
          return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');
        }
      }
1050915
@SuppressWarnings("serial")
    private Button createSaveButton() {

        Button saveBtn = CmsToolBar.createButton(FontOpenCms.SAVE, m_messages.key(Messages.GUI_BUTTON_SAVE_0));
        saveBtn.addClickListener(new ClickListener() {

            public void buttonClick(ClickEvent event) {

                saveAction();
            }

        });
        saveBtn.setEnabled(false);
        return saveBtn;
    }
1161891
function(){
    if (this.isClosed) { return; }

    // allow the close to be stopped by returning `false`
    // from the `onBeforeClose` method
    var shouldClose = this.triggerMethod("before:close");
    if (shouldClose === false){
      return;
    }

    // mark as closed before doing the actual close, to
    // prevent infinite loops within "close" event handlers
    // that are trying to close other views
    this.isClosed = true;
    this.triggerMethod("close");

    // unbind UI elements
    this.unbindUIElements();

    // remove the view from the DOM
    this.remove();
  }
1060325
public ISynchronizationPoint<Exception> closeElement() {
		if (!Type.START_ELEMENT.equals(event.type))
			return new SynchronizationPoint<>(new Exception("Invalid call of closeElement: it must be called on a start element"));
		if (event.isClosed)
			return new SynchronizationPoint<>(true);
		ElementContext ctx = event.context.getFirst();
		return closeElement(ctx);
	}
184044
function() {
      this.tableOptions = inputEx.cn('a', {href: '#'}, null, msgs.tableOptions);
      this.options.parentEl.appendChild(this.tableOptions);
      
      this.tableOptionsDlg = new YAHOO.widget.SimpleDialog( Dom.generateId(), {
              width: "30em",
		        visible: false,
		        modal: true,
		        buttons: [ 
				      { text:msgs.columnDialogCloseButton,  handler: function(e) { this.hide(); } }
              ],
              fixedcenter: true,
              constrainToViewport: true
	   });
	
		Dom.addClass(this.tableOptionsDlg.element.firstChild, "inputex-datatable-columnsDlg");
		
	   this.tableOptionsDlg.bodyId = Dom.generateId();
	   this.tableOptionsDlg.setHeader(msgs.columnDialogTitle);
	   this.tableOptionsDlg.setBody("<div id='"+this.tableOptionsDlg.bodyId+"'></div>");
	   this.tableOptionsDlg.render(document.body);
   }
840782
function() {
        if (this.parent) {
            var newListItem = document.createElement(CHILD_TAG);

            if (this.notesEl) {
                newListItem.appendChild(this.notesEl);
            }

            if (!this.keep) {
                var el = this.templates.get('removeButton');
                el.addEventListener('click', this.remove.bind(this));
                newListItem.appendChild(el);
            }

            newListItem.appendChild(this.el);

            this.parent.el.querySelector(CHILDREN_TAG).appendChild(newListItem);
        }
    }
429829
function() {
      
      this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
      
      //  field
      this.editorField = inputEx(this.options.editorField,this);
      var editorFieldEl = this.editorField.getEl();
      
      this.editorContainer.appendChild( editorFieldEl );
      Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
      
      this.okButton = new inputEx.widget.Button({
         type: this.options.buttonTypes.ok,
         parentEl: this.editorContainer,
         value: inputEx.messages.okEditor,
         className: "inputEx-Button "+CSS_PREFIX+'OkButton',
         onClick: {fn: this.onOkEditor, scope:this}
      });

      this.cancelLink = new inputEx.widget.Button({
         type: this.options.buttonTypes.cancel,
         parentEl: this.editorContainer,
         value: inputEx.messages.cancelEditor,
         className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
         onClick: {fn: this.onCancelEditor, scope:this}
      });
      
      // Line breaker ()
      this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
      
      this.fieldContainer.appendChild(this.editorContainer);
      
   }
411969
function(html) {
        var C = YAHOO.widget.CalendarNavigator.CLASSES;
        var h = html;

        h[h.length] = '<span class="' + C.BUTTON + ' ' + C.DEFAULT + '">';
        h[h.length] = '<button type="button" id="' + this.id + '_submit' + '">';
        h[h.length] = this.__getCfg("submit", true);
        h[h.length] = '</button>';
        h[h.length] = '</span>';
        h[h.length] = '<span class="' + C.BUTTON +'">';
        h[h.length] = '<button type="button" id="' + this.id + '_cancel' + '">';
        h[h.length] = this.__getCfg("cancel", true);
        h[h.length] = '</button>';
        h[h.length] = '</span>';

        return h;
    }
128154
function() {
	    var toolbar = Dom.get('toolbar');
	    // Buttons :
	    var newButton = new widget.Button({ label:"New", id:"WiringEditor-newButton", container: toolbar });
	    newButton.on("click", this.onNew, this, true);

	    var loadButton = new widget.Button({ label:"Load", id:"WiringEditor-loadButton", container: toolbar });
	    loadButton.on("click", this.load, this, true);

	    var saveButton = new widget.Button({ label:"Save", id:"WiringEditor-saveButton", container: toolbar });
	    saveButton.on("click", this.onSave, this, true);

	    var deleteButton = new widget.Button({ label:"Delete", id:"WiringEditor-deleteButton", container: toolbar });
	    deleteButton.on("click", this.onDelete, this, true);

	    var helpButton = new widget.Button({ label:"Help", id:"WiringEditor-helpButton", container: toolbar });
	    helpButton.on("click", this.onHelp, this, true);
	 }
784019
function( button ) {
            var $element = $('<a/>').addClass( 'wysiwyg-toolbar-icon' )
                                    .prop('href','#')
                                    .prop('unselectable','on')
                                    .append(button.image);
            // pass other properties as "prop()"
            $.each( button, function( name, value )
            {
                switch( name )
                {
                    // classes
                    case 'class':
                        $element.addClass( value );
                        break;
                    // special meaning
                    case 'image':
                    case 'html':
                    case 'popup':
                    case 'click':
                    case 'showstatic':
                    case 'showselection':
                        break;
                    default: // button.title, ...
                        $element.attr( name, value );
                        break;
                }
            });
            return $element;
        }
713651
function () {
    var self = this;

    // Remove child
    self.dropdownContainerView.remove();

    // Remove event listeners
    document.body.removeEventListener("click", self.deferClose);
    if (self.options.closeOnEsc) {
      document.body.removeEventListener("keyup", self.closeOnEsc);
    }
    self.$el.off("click", self.stopDeferClose);
    self.$dropdownButton.off("click", self.toggle);

    // Invoke original backbone methods
    return Backbone.View.prototype.remove.apply(self, arguments);
  }
674410
function _createElements() {
        global $OUTPUT;

        // Get the calendar type used - see MDL-18375.
        $calendartype = \core_calendar\type_factory::get_calendar_instance();

        $this->_elements = array();

        $dateformat = $calendartype->get_date_order($this->_options['startyear'], $this->_options['stopyear']);
        // Reverse date element (Day, Month, Year), in RTL mode.
        if (right_to_left()) {
            $dateformat = array_reverse($dateformat);
        }
        foreach ($dateformat as $key => $value) {
            // E_STRICT creating elements without forms is nasty because it internally uses $this
            $this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value, $this->getAttributes(), true);
        }
        // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
        if ($calendartype->get_name() === 'gregorian') {
            $image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
            $this->_elements[] = $this->createFormElement('link', 'calendar',
                    null, '#', $image,
                    array('class' => 'visibleifjs'));
        }
        // If optional we add a checkbox which the user can use to turn if on
        if ($this->_options['optional']) {
            $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
        }
        foreach ($this->_elements as $element){
            if (method_exists($element, 'setHiddenLabel')){
                $element->setHiddenLabel(true);
            }
        }

    }
1006866
function() {

			// Remove any existing calendar (only one instance per node is allowed)
			var existing = this.el.one('.calendar')
			if (existing._node) {
				existing.remove()
			}

			this.calendarEl = n.node.create('<div class="calendar"></div>')

			var content = []

			for (var i=0;i<this.panes;i++) {
				var prevLink = ''
					, nextLink = ''

				if (i==0) {
					prevLink = '<span class="prev-month"><a href="#">&lt;</a></span>'
				}
				
				if (i+1 == this.panes) {
					nextLink = '<span class="next-month"><a href="#">&gt;</a></span>'
				}

				content = content.concat([
					'<div class="pane" data-month="', this.getOffsetMonth(i) ,'" data-year="', this.getOffsetYear(i), '">',
						'<div class="months">',
							prevLink,
							'<span class="current-month">' + this.renderMonth(i) + ' ' + this.renderYear(i) + '</span>',
							nextLink,
						'</div>',
						'<div class="days">',
							'<table><thead><tr class="weekdays">' + this.weekdayHeaderMarkup() + '</tr></thead>',
								'<tbody>' + this.calendarMarkup(i) + '</tbody>',
							'</table>',
						'</div>',
					'</div>'
				])
			}

			this.calendarEl.setHtml(content.join(''))

			// Position the calendar
			this.calendarEl.appendTo(this.el)

			this.doSelection()

			this.calendarEl.one('.prev-month').on('click', function(e){
				this.month--
				this.loadMonth()
				e.stop()
			}.bind(this))
	
			this.calendarEl.one('.next-month').on('click', function(e){
				this.month++
				this.loadMonth()
				e.stop()
			}.bind(this))
	
			this.calendarEl.on('click', function(e) {
				var dayNumber = parseInt(e.target.getHtml(), 10)
	
				if (isNaN(dayNumber)) {
					return
				}

				var paneEl = e.target.ancestor('.pane')

					, month = parseInt(paneEl.data('month'), 10)
					, year = parseInt(paneEl.data('year'), 10)

					, dateObj = new Date(year, month, dayNumber).getTime()
					, self = this

				function getdPickedDayEl() {
					return self.el.one('.pane[data-month="' + month + '"]').one('td[data-day="' + dayNumber + '"]')
				}

				// Handle single selection
				if (this.mode == 'single') {
					this.selected = [{year:year, month:month, day:dayNumber}]
					this.doSelection()
				}

				// Handle multiple selections
				if (this.mode == 'multiple') {

					if (this.selected.length > 1) {
						// Reset all nodes
						this.selected = [{year:year, month:month, day:dayNumber}]

					} else if (this.selected.length == 1 && this.selected[0].month == month && this.selected[0].year == year && this.selected[0].day == dayNumber ){
						// If the clicked square is the one in the selection, just clear the selection
						this.selected = []
						this.el.fire('pickClear')

					} else if (this.selected.length == 1){

						// Populate the selected array
						var dayI = this.selected[0].day+1,
							monthI = this.selected[0].month,
							yearI = this.selected[0].year

						// Swap values if the clicked day is before the start date
						if (dayI-1 > dayNumber || (monthI > month || yearI > year)) {
							var temp = {year:year, month:month, day:dayNumber}

							dayNumber = dayI-1
							month = monthI
							year = yearI
							
							this.selected = [temp]
							dayI = temp.day
							monthI = temp.month
							yearI = temp.year
						}


						while(true) {

							this.selected.push({year:yearI, month:monthI, day:dayI})

							if (dayI >= dayNumber && monthI >= month && yearI >= year) { break }

							if (dayI >= this.daysInMonth[monthI]) {
								dayI=0
								monthI++
							}
							if (monthI==11) {
								monthI=0
								yearI++
							}
							dayI++
						}

						this.el.fire('rangePick', {
							from: this.selected[0],
							to: {
								year: year,
								month: month,
								day: dayNumber
							}
						})

					} else {
						// First selection, so push something onto the selection stack
						this.selected.push({year:year, month:month, day:dayNumber})
					}

					this.doSelection()
				}

				this.el.fire('pick', {
					year: year,
					month: month,
					day: dayNumber,
					formatted: this.format(dateObj),
					date: dateObj
				})
				e.stop()
			}.bind(this))
		}
1311137
function() {
            this.msg = (typeof this.options.selectMessage == 'string' ?
                        document.getElementById(this.options.selectMessage) :
                        this.options.selectMessage);
            this.closeButton = this.getCloseButton();
            this.msgAutoclose = null;

            this.closeMessage = bind(this.closeMessage, this);
            addEvent(this.closeButton, 'click', this.closeMessage);
        }
517177
function(html) {
        var NAV = YAHOO.widget.CalendarNavigator,
            C = NAV.CLASSES,
            h = html; // just to use a shorter name

        h[h.length] = '<div class="' + C.MONTH + '">';
        this.renderMonth(h);
        h[h.length] = '</div>';
        h[h.length] = '<div class="' + C.YEAR + '">';
        this.renderYear(h);
        h[h.length] = '</div>';
        h[h.length] = '<div class="' + C.BUTTONS + '">';
        this.renderButtons(h);
        h[h.length] = '</div>';
        h[h.length] = '<div class="' + C.ERROR + '" id="' + this.id + NAV.ERROR_SUFFIX + '"></div>';

        return h;
    }
1185100
public Element endElementBuilder() {
        final Element element = (Element) this.configurationStack.removeLast();
        if ( this.characters != null ) {
            element.appendChild( this.document.createTextNode( this.characters.toString() ) );
        }

        this.characters = null;

        return element;
    }