Register a global widget config
@param {string} widget_title Title for new global widget
@param {_cWidget} widget_config
548540
function(widget_title, widget_config) {

		if (!Lava.schema.widget.ALLOW_REDEFINITION && (widget_title in this.widgets))
			Lava.t("storeWidgetSchema: widget is already defined: " + widget_title);

		this.widgets[widget_title] = widget_config;

		if (('sugar' in widget_config) && widget_config.sugar.tag_name) {

			this.sugar_map[widget_config.sugar.tag_name] = {widget_title: widget_title};

		}

	}
1300557
async function init({ options = { config: {} }, handleInsert } = {}) {
  const { publicKey, ...globalConfig } = options.config;
  const baseConfig = { ...defaultConfig, ...globalConfig };

  window.UPLOADCARE_PUBLIC_KEY = publicKey;

  /**
   * Register the effects tab by default because the effects tab is awesome. Can
   * be disabled via config.
   */
  uploadcare.registerTab('preview', uploadcareTabEffects);

  return {
    /**
     * On show, create a new widget, cache it in the widgets object, and open.
     * No hide method is provided because the widget doesn't provide it.
     */
    show: ({ value, config: instanceConfig = {}, allowMultiple, imagesOnly = false } = {}) => {
      const config = { ...baseConfig, imagesOnly, ...instanceConfig };
      const multiple = allowMultiple === false ? false : !!config.multiple;
      const resolvedConfig = { ...config, multiple };
      const files = getFiles(value);

      /**
       * Resolve the promise only if it's ours. Only the jQuery promise objects
       * from the Uploadcare library will have a `state` method.
       */
      if (files && !files.state) {
        return files.then(result => openDialog(result, resolvedConfig, handleInsert));
      } else {
        return openDialog(files, resolvedConfig, handleInsert);
      }
    },

    /**
     * Uploadcare doesn't provide a "media library" widget for viewing and
     * selecting existing files, so we return `false` here so Netlify CMS only
     * opens the Uploadcare widget when called from an editor control. This
     * results in the "Media" button in the global nav being hidden.
     */
    enableStandalone: () => false,
  };
}
922436
function Suite(title) {
  this.title = _.title(title);
  this.parent = null;
  this.runnables = [];
  this.events = {
    pre: 'pre:suite',
    post: 'post:suite'
  };
}
1301902
public function registerWidgets()
    {
        $this->registerWidget(__('Header Widget Area', 'novusopress'), 'header', 'widgets');
        $this->registerWidget(__('Blog Index Sidebar', 'novusopress'), 'sidebar', 'index');
        $this->registerWidget(__('Blog Post Sidebar', 'novusopress'), 'sidebar', 'single');
        $this->registerWidget(__('Front Page Sidebar', 'novusopress'), 'sidebar', 'front-page');
        $this->registerWidget(__('Standard Page Sidebar', 'novusopress'), 'sidebar', 'page');
        $this->registerWidget(__('Archive List Sidebar', 'novusopress'), 'sidebar', 'archive');
        $this->registerWidget(__('Search Results Sidebar', 'novusopress'), 'sidebar', 'search');
        $this->registerWidget(__('Attachment View Sidebar', 'novusopress'), 'sidebar', 'attachment');
        $this->registerWidget(__('404 Error Sidebar', 'novusopress'), 'sidebar', 'not-found');
        $this->registerWidget(__('Footer Area One', 'novusopress'), 'footer', 'one');
        $this->registerWidget(__('Footer Area Two', 'novusopress'), 'footer', 'two');
        $this->registerWidget(__('Footer Area Three', 'novusopress'), 'footer', 'three');
        $this->registerWidget(__('Footer Area Four', 'novusopress'), 'footer', 'four');
    }
1274724
public function add($name, $title, $properties, $controllerClass)
    {

        register_widget(new Widget($name, $title, $properties, $this->plugin, $controllerClass));
    }
852399
function Title( annotations ) {

	// INSTANCE ATTRIBUTES //

	this._parent = annotations;
	this._root = undefined;
	this._children = {};
	this._config = {
		'width': 200,
		'height': 28,
		'position': {
			'left': 0,
			'top': 0
		},
		'text': ''
	};

	// REGISTER //
	if ( annotations._config.hasOwnProperty( 'title' )  ) {
		annotations._config.title.push( this._config );
	} else {
		annotations._config.title = [ this._config ];
	}
	if ( annotations._children.hasOwnProperty( 'title' ) ) {
		annotations._children.title.push( this );
	} else {
		annotations._children.title = [ this ];
	}

	return this;
}
65547
private static function register_widget( $widget_class ) {
		register_widget( $widget_class );

		$callback = [ $widget_class, 'post_registration' ];
		if ( is_callable( $callback, true ) ) {
			call_user_func( $callback );
		}
	}
664470
function(widget_config, attribute_value, descriptor, name) {

		Lava.store(
			widget_config,
			'options',
			name,
			Lava.ExpressionParser.parse(attribute_value, Lava.ExpressionParser.SEPARATORS.SEMICOLON)
		);

	}
1115714
function (cfg, context, lineNumber) {
        this.$BindableWidget.constructor.apply(this, arguments);

        this._cfgOk = ariaCoreJsonValidator.validateCfg(this.WIDGET_CFG, cfg);

        if (!this._cfgOk) {
            return;
        }

        this._registerBindings();

        /**
         * Id generated for the button DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();

    }
31133
public void onModuleLoad() {
        final Button sendButton = new Button( "Send" );
        final TextBox nameField = new TextBox();
        nameField.setText( "GWT User" );
        final Label errorLabel = new Label();

        // We can add style names to widgets
        sendButton.addStyleName( "sendButton" );

        // Add the nameField and sendButton to the RootPanel
        // Use RootPanel.get() to get the entire body element
        RootPanel.get( "nameFieldContainer" ).add( nameField );
        RootPanel.get( "sendButtonContainer" ).add( sendButton );
        RootPanel.get( "errorLabelContainer" ).add( errorLabel );

        // Focus the cursor on the name field when the app loads
        nameField.setFocus( true );
        nameField.selectAll();

        // Create the popup dialog box
        final DialogBox dialogBox = new DialogBox();
        dialogBox.setText( "Remote Procedure Call" );
        dialogBox.setAnimationEnabled( true );
        final Button closeButton = new Button( "Close" );
        // We can set the id of a widget by accessing its Element
        closeButton.getElement().setId( "closeButton" );
        final Label textToServerLabel = new Label();
        final HTML serverResponseLabel = new HTML();
        VerticalPanel dialogVPanel = new VerticalPanel();
        dialogVPanel.addStyleName( "dialogVPanel" );
        dialogVPanel.add( new HTML( "<b>Sending name to the server:</b>" ) );
        dialogVPanel.add( textToServerLabel );
        dialogVPanel.add( new HTML( "<br><b>Server replies:</b>" ) );
        dialogVPanel.add( serverResponseLabel );
        dialogVPanel.setHorizontalAlignment( VerticalPanel.ALIGN_RIGHT );
        dialogVPanel.add( closeButton );
        dialogBox.setWidget( dialogVPanel );

        // Add a handler to close the DialogBox
        closeButton.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent event ) {
                dialogBox.hide();
                sendButton.setEnabled( true );
                sendButton.setFocus( true );
            }
        } );

        // Create a handler for the sendButton and nameField
        class MyHandler implements ClickHandler, KeyUpHandler {

            /**
             * Fired when the user clicks on the sendButton.
             */
            public void onClick( ClickEvent event ) {
                sendNameToServer();
            }

            /**
             * Fired when the user types in the nameField.
             */
            public void onKeyUp( KeyUpEvent event ) {
                if ( event.getNativeKeyCode() == KeyCodes.KEY_ENTER ) {
                    sendNameToServer();
                }
            }

            /**
             * Send the name from the nameField to the server and wait for a response.
             */
            private void sendNameToServer() {
                // First, we validate the input.
                errorLabel.setText( "" );
                String textToServer = nameField.getText();
                if ( !FieldVerifier.isValidName( textToServer ) ) {
                    errorLabel.setText( "Please enter at least four characters" );
                    return;
                }

                // Then, we send the input to the server.
                sendButton.setEnabled( false );
                textToServerLabel.setText( textToServer );
                serverResponseLabel.setText( "" );

                try {
                    new RequestBuilder( RequestBuilder.POST, "hello/greet" ).sendRequest( GREETING_REQUEST_WRITER
                            .write( new GreetingRequest( textToServer ) ), new RequestCallback() {
                        @Override
                        public void onResponseReceived( Request request, Response response ) {
                            GreetingResponse result = GREETING_RESPONSE_READER.read( response.getText() );

                            dialogBox.setText( "Remote Procedure Call" );
                            serverResponseLabel.removeStyleName( "serverResponseLabelError" );
                            serverResponseLabel.setHTML( new SafeHtmlBuilder().appendEscaped( result.getGreeting() )
                                    .appendHtmlConstant( "<br><br>I am running " ).appendEscaped( result.getServerInfo() )
                                    .appendHtmlConstant( ".<br><br>It looks like you are using:<br>" ).appendEscaped( result
                                            .getUserAgent() ).toSafeHtml() );
                            dialogBox.center();
                            closeButton.setFocus( true );
                        }

                        @Override
                        public void onError( Request request, Throwable throwable ) {
                            onRequestFailure();
                        }
                    } );
                } catch ( RequestException e ) {
                    onRequestFailure();
                }
            }

            private void onRequestFailure() {
                // Show the RPC error message to the user
                dialogBox.setText( "Remote Procedure Call - Failure" );
                serverResponseLabel.addStyleName( "serverResponseLabelError" );
                serverResponseLabel.setHTML( SERVER_ERROR );
                dialogBox.center();
                closeButton.setFocus( true );
            }
        }

        // Add a handler to send the name to the server
        MyHandler handler = new MyHandler();
        sendButton.addClickHandler( handler );
        nameField.addKeyUpHandler( handler );
    }
968557
def addTab(self, view, title):
        
        if not isinstance(view, XView):
            return False

        tab = self._tabBar.addTab(title)
        self.addWidget(view)
        tab.titleChanged.connect(view.setWindowTitle)
        
        # create connections
        try:
            view.windowTitleChanged.connect(self.refreshTitles,
                                            QtCore.Qt.UniqueConnection)
            view.sizeConstraintChanged.connect(self.adjustSizeConstraint,
                                            QtCore.Qt.UniqueConnection)
            view.poppedOut.connect(self.disconnectView,
                                   QtCore.Qt.UniqueConnection)
        except RuntimeError:
            pass
        
        self.setCurrentIndex(self.count() - 1)
        
        return True
540125
def on_add(self, widget, data=None):
        
        gv_name = "new_global_%s" % self.global_variable_counter
        self.global_variable_counter += 1
        try:
            self.model.global_variable_manager.set_variable(gv_name, None)
        except (RuntimeError, AttributeError, TypeError) as e:
            logger.warning("Addition of new global variable '{0}' failed: {1}".format(gv_name, e))
        self.select_entry(gv_name)
        return True
422716
public function registerClientScript()
	{
		$chart = Yii::createComponent(
			array(
				'class' => 'booster.widgets.TbGoogleVisualizationChart',
				'visualization' => 'PieChart',
				'containerId' => $this->getId(),
				'data' => $this->data,
				'options' => $this->chartOptions
			)
		);
		$chart->init();
		$chart->run();

		/**
		 * create custom chart update by using the global chart variable
		 * @see TbGoogleVisualizationChart
		 */
		$this->column->grid->componentsAfterAjaxUpdate[__CLASS__] =
			'var $el = $("#' . $this->getId() . '");var data = $el.data("data");var opts = $el.data("options");
			data = google.visualization.arrayToDataTable(data);
			' . $chart->getId() . '=new google.visualization.PieChart(document.getElementById("' . $this->getId() . '"));
			' . $chart->getId() . '.draw(data,opts);';
	}
1334349
function (cfg, context, lineNumber) {
            /**
             * The widget configuration, as declared in the template.
             * @protected
             * @type Object
             */
            this._cfg = cfg;

            /**
             * Template context
             * @protected
             * @type aria.templates.TemplateCtxt
             */
            this._context = context;

            /**
             * Line number for this widget
             * @protected
             * @type Number
             */
            this._lineNumber = lineNumber;

            /**
             * Array of used dynamic ids.
             * @protected
             * @type Array
             */
            this._dynamicIds = null;

            // Notify the Skin Manager that a new widget was created
            ariaTemplatesCSSMgr.loadWidgetDependencies(this.$classpath, this.$css);

            /**
             * True if the CSS is loaded, false otherwise. This is to make sure the CSS is not unloaded twice.
             * @type Boolean
             */
            this.__cssLoaded = true;
        }
36639
function(config, widget, parent_view, template, properties) {

		var name,
			argument,
			constructor;

		this.guid = Lava.guid++;
		if (Lava.schema.DEBUG && config.id && !Lava.isValidId(config.id)) Lava.t();
		if ('id' in config) {
			this.id = config.id;
		}
		if ('label' in config) {
			this.label = config.label;
		}

		Lava.view_manager.registerView(this);

		this._config = config;
		this._widget = widget;
		this._template = template;

		if (parent_view) {

			this._parent_view = parent_view;
			this._parent_with_container = parent_view.getContainer() ? parent_view : parent_view.getParentWithContainer();
			this.depth = parent_view.depth + 1;

		}

		this._initMembers(properties);

		for (name in config.assigns) {

			if (config.assigns[name].once) {

				argument = new Lava.scope.Argument(config.assigns[name], this, this._widget);
				this.set(name, argument.getValue());
				argument.destroy();

			} else {

				if (name in this._property_bindings_by_property) Lava.t("Error initializing assign: property binding already created");

				this._property_bindings_by_property[name] = new Lava.scope.PropertyBinding(this, name, config.assigns[name]);

			}

		}

		if ('container' in config) {

			constructor = Lava.ClassManager.getConstructor(config.container['type'], 'Lava.view.container');
			this._container = new constructor(this, config.container, widget);

		}

		this._postInit();

		if ('roles' in  config) Lava.view_manager.dispatchRoles(this, config.roles);

	}
583817
public function registerClientScript()
    {
        if (!empty($this->pluginOptions)) {
            $options = \CJavaScript::encode($this->pluginOptions);
            \Yii::app()->clientScript
                ->registerScript('Tooltip#' . $this->getId(), "$(document).foundation('tooltip', {$options});");
        }
    }
982826
function (type, config) {
    // fail if we don't have a default for frost-page-title in the config
    if (!config.APP || !config.APP['frost-page-title'].defaultTitle) {
      return
    }

    // insert default page title
    if (type === 'page-title') {
      return config.APP['frost-page-title'].defaultTitle
    }
  }