The controller for the 'popover' directive.
@constructor
@ngInject
@ngdoc controller
@ngname NgeoPopoverController
@param {angular.IScope} $scope Scope.
@private
@hidden
170056
function PopoverController($scope) {
  /**
   * The state of the popover (displayed or not)
   * @type {boolean}
   */
  this.shown = false;

  /**
   * @type {?JQuery}
   */
  this.anchorElm = null;

  /**
   * @type {?JQuery}
   */
  this.bodyElm = null;

  const clickHandler = (clickEvent) => {
    if (!this.anchorElm) {
      throw new Error('Missing anchorElm');
    }
    if (!this.bodyElm) {
      throw new Error('Missing bodyElm');
    }
    if (this.anchorElm[0] !== clickEvent.target &&
      this.bodyElm.parent()[0] !== clickEvent.target &&
      this.bodyElm.parent().find(clickEvent.target).length === 0 && this.shown) {
      this.dismissPopover();
    }
  };

  document.body.addEventListener('click', clickHandler);

  $scope.$on('$destroy', () => {
    document.body.removeEventListener('click', clickHandler);
  });
}
323047
protected static function selectOverrideScope( $scope, $identifier, $dir, $default )
    {
        if ( $scope !== null )
        {
            $def = self::defaultOverrideDirs();
            if ( isset( $def[$scope] ) )
                return $scope;
            eZDebug::writeWarning( "Undefined override dir scope: '$scope' with dir: '$dir'", __METHOD__ );
        }
        if ( $identifier === 'siteaccess' )
            return 'siteaccess';
        else if ( $identifier && strpos($identifier, 'extension:') === 0 )
            return 'extension';
        else if ( strpos($dir, 'siteaccess') !== false )
            return 'siteaccess';
        else if ( strpos($dir, 'extension') !== false )
            return 'extension';

        eZDebug::writeStrict( "Could not figgure out INI scope for \$identifier: '$identifier' with \$dir: '$dir', falling back to '$default'", __METHOD__ );
        return $default;
    }
1330816
public function addDefaultScope(IScope $scope)
    {
        if (!$this->defaultScopes->contains($scope)) {
            $this->defaultScopes->attach($scope);
        } else {
            throw new \InvalidArgumentException("Scope '{$scope->getId()}' is already registered as default scope.");
        }
    }
890770
function MainController($timeout) {
  /**
   * @type {import("ol/Map.js").default}
   */
  this.map = new olMap({
    layers: [
      new olLayerTile({
        source: new olSourceOSM()
      })
    ],
    view: new olView({
      center: [0, 0],
      zoom: 4
    })
  });

  /**
   * @type {boolean}
   */
  this.open = false;

  // We want the sidebar to be open at application launch so we set the `open`
  // property to true at startup.
  // But we need to do it asynchronously in order to have the `resizemap`
  // directive working. If we don't, the `ng-class` directive doesn't fire the
  // animation hooks.
  const self = this;
  $timeout(() => {
    self.open = true;
  }, 0);
}
1135964
public function update(Queries\IScope $scope)
    {
        if ($this->scope === $scope) {
            return $this;
        }

        return new self($scope);
    }
246278
function notifyController($scope, $rootScope) {

    /**
     * Default settings
     */
    var DEFAULT_STATUS = "info";
    var DEFAULT_HEADING = "Browsersync:";
    var DEFAULT_MESSAGE = "Welcome to Browsersync";
    var DEFAULT_TIMEOUT = 2000;

    /**
     * Default state
     * @type {{visible: boolean, status: string, heading: string, text: string}}
     */
    $scope.ui = {
        status: DEFAULT_STATUS,
        heading: DEFAULT_HEADING,
        message: DEFAULT_MESSAGE
    };

    /**
     * @param evt
     * @param data
     */
    $scope.show = function (evt, data) {

        data = data || {};

        /**
         *
         * Clear any previous timers
         *
         */
        if ($scope._timer) {
            clearTimeout($scope._timer);
        }

        /**
         *
         * Set a reset timer
         *
         */
        $scope._timer = window.setTimeout($scope.reset, data.timeout || DEFAULT_TIMEOUT);

        /**
         *
         * Set UI flags
         *
         */
        $scope.ui.visible = true;
        $scope.ui.status = data.status || DEFAULT_STATUS;
        $scope.ui.heading = data.heading || DEFAULT_HEADING;
        $scope.ui.message = data.message || DEFAULT_HEADING;
    };

    /**
     * Reset the UI
     */
    $scope.reset = function () {
        $scope.ui.visible = false;
        $scope.$digest();
    };

    /**
     * Listen to events on the $rootScope
     */
    $rootScope.$on("notify:flash", $scope.show);
}
1040792
public function clear($scope = null)
    {
        if ($scope === null) {
            $this->messages = array();
        } else {
            foreach ($this->messages as $key => $message) {
                if ($message['scope'] === $scope) {
                    unset($this->messages[$key]);
                }
            }
        }
        return $this;
    }
85994
function($scope) {
    this.$scope = $scope;

    this.$markdownInput = $scope.find(SELECTORS.MARKDOWN_INPUT);
    this.$form = $scope.find(SELECTORS.FORM);
    this.$titleInput = $scope.find(SELECTORS.TITLE_INPUT);
    this.$deleteButton = $scope.find(SELECTORS.DELETE);

    this.dropzone = new Dropzone(SELECTORS.DROPZONE);
    this.simplemde = new SimpleMDE();

    this.bind();
}
471057
public function setScope($scope)
    {
        if ($scope !== static::UNKNOWN_VALUE) {
            $this->scope = $scope;
            // Now that we have a scope, we can actually generate code to
            // reach the variables inside the analysis.
            $this->pool->codegenHandler->setAllowCodegen(true);
        }
    }
1177247
function MdDialogController($mdDialog, $mdConstant) {
    // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in
    // interimElements. The $mdCompiler simulates the $onInit hook for all versions.
    this.$onInit = function() {
      var isPrompt = this.$type == 'prompt';

      if (isPrompt && this.initialValue) {
        this.result = this.initialValue;
      }

      this.hide = function() {
        $mdDialog.hide(isPrompt ? this.result : true);
      };
      this.abort = function() {
        $mdDialog.cancel();
      };
      this.keypress = function($event) {
        var invalidPrompt = isPrompt && this.required && !angular.isDefined(this.result);

        if ($event.keyCode === $mdConstant.KEY_CODE.ENTER && !invalidPrompt) {
          $mdDialog.hide(this.result);
        }
      };
    };
  }
1073724
public function afterStep($scope)
    {
        // if test is passed, skip taking screenshot
        if ($scope->getTestResult()->isPassed()) {
            return;
        }

        // create filename string
        $featureFolder = preg_replace('/\W/', '', $scope->getFeature()->getTitle());

        $scenarioName = $this->currentScenario->getTitle();
        $fileName = preg_replace('/\W/', '', $scenarioName).'.png';

        // create screenshots directory if it doesn't exist
        if (!file_exists($this->screenshotDir.'/'.$featureFolder)) {
            mkdir($this->screenshotDir.'/'.$featureFolder);
        }

        $this->saveScreenshot($fileName, $this->screenshotDir.'/'.$featureFolder.'/');
    }
852015
public function setScope($scope)
    {
        if (!is_array($scope)) {
            throw new InvalidTypeException('Scope', 'array', gettype($scope));
        }

        $this->scope = $scope;
    }
676439
public function newQueryWithoutScope($scope)
    {
        $this->getGlobalScope($scope)->remove($builder = $this->newQuery(), $this);

        return $builder;
    }
696499
function FormForStateHelper($parse, $scope) {
            this.formForScope_ = $scope;
            this.nestedObjectHelper_ = new formFor.NestedObjectHelper($parse);
            this.formForScope_.fieldNameToErrorMap = $scope.fieldNameToErrorMap || {};
            this.formForScope_.valid = true;
            this.fieldNameToModifiedStateMap_ = {};
            this.formSubmitted_ = false;
            this.fieldNameToErrorMap_ = {};
            this.watchable = 0;
        }
523683
function ($scope) {
    this.options = { headers: {} };
    if ($scope && $scope.constructor == String) {
        this.options.uri = $scope;
        $scope = {};
    }
    this.data = $scope || {};
    this.jsonArray = [];
    this.posts = {};
    this.cookies = {};
    this.headers = {};
    this.vars = {}; //url query variables
}
1100698
public function setScope($scope)
  {
      if (!is_array($scope)) {
          $this->scopes = explode(' ', $scope);
      } else {
          $this->scopes = $scope;
      }

      return $this;
  }
263826
public function checkScope($scope)
  {
      if ($this->OAuthResponse) {
          return $this->OAuthResponse->hasScope($scope);
      }

      return in_array($scope, $this->getScope());
  }