Returns the js code to attach a Google event or a Dom event to a js object

@param string $name the object name

@return string the js event
10046
public function getJs($name)
    {
        switch ($this->getType()) {
            case EventType::DEFAULT_ONCE:
                return $this->getEventJs($name, true);
            case EventType::DOM:
                return $this->getDomEventJs($name);
            case EventType::DOM_ONCE:
                return $this->getDomEventJs($name, true);
            case EventType::DEFAULT_EVENT:
            default:
                return $this->getEventJs($name);
        }
    }
886656
public function getScript() {
		$jsCode="$('".$this->attachTo." a').click(function (event) { event.preventDefault();$(this).tab('show');});";
		$this->jquery_code_for_compile []=$jsCode;
		$this->compileEvents();
		return $this->compileJQueryCode();
	}
491018
public static function instance($name = 'default')
    {
        if (!isset(static::$_instances[$name])) {
            static::$_instances[$name] = new EventDispatcher();
        }

        return static::$_instances[$name];
    }
158064
public function getCustomStringFunction($name)
    {
        $name = strtolower($name);

        return isset($this->_attributes['customStringFunctions'][$name])
            ? $this->_attributes['customStringFunctions'][$name]
            : null;
    }
887605
public static function attrNameToOID(string $name): string
    {
        // if already in OID form
        if (preg_match('/^[0-9]+(?:\.[0-9]+)*$/', $name)) {
            return $name;
        }
        $map = self::_oidReverseMap();
        $k = strtolower($name);
        if (!isset($map[$k])) {
            throw new \OutOfBoundsException("No OID for $name.");
        }
        return $map[$k];
    }
784839
public function getService($name)
    {
        // If we haven't created this service, we'll create it based on the config provided.
        // todo: Caching the service is causing some strange PHP7 only memory issues.
//        if (!isset($this->services[$name])) {
        $service = $this->makeService($name);

//            if ($this->app->bound('events')) {
//                $connection->setEventDispatcher($this->app['events']);
//            }

        $this->services[$name] = $service;

//        }

        return $this->services[$name];
    }
895703
public function outputJavascriptGlobal(string $name, array $data)
    {
        $output = "<script type=\"text/javascript\">\n\r";
        $output .= "/* <![CDATA[ */\n\r";
        $output .= "var {$name} = {\n\r";

        if (! empty($data) && is_array($data)) {
            foreach ($data as $key => $value) {
                $output .= $key.': '.json_encode($value).",\n\r";
            }
        }

        $output .= "};\n\r";
        $output .= "/* ]]> */\n\r";
        $output .= '</script>';

        return $output;
    }
397986
public function getJs()
    {
        $name = $this->getName();
        $reflection = new \ReflectionClass($this);
        $object = $reflection->getShortName();
        $js[] = "var {$name} = new google.maps.{$object}();";
        $js[] = "$name.setMap({$this->map});";

        return implode("\n", $js);
    }
570173
protected function buildClass($name)
	{
		$stub = parent::buildClass($name);

		$event = $this->option('event');

		if ( ! starts_with($event, $this->getAppNamespace()))
		{
			$event = $this->getAppNamespace().'Events\\'.$event;
		}

		$stub = str_replace(
			'{{event}}', class_basename($event), $stub
		);

		$stub = str_replace(
			'{{fullEvent}}', $event, $stub
		);

		return $stub;
	}
609233
public function getElement($name)
    {
        if (null === $this->pageObjectFactory) {
            throw new \RuntimeException('To create elements you need to pass a factory with setPageObjectFactory()');
        }

        return $this->pageObjectFactory->createElement($name);
    }
16237
protected function getMethod($name) 
    {
        if (isset(self::$_methods[$name])) {
            return $name;
        }

        if (isset(self::$_methods['array_'.$name])) {
            return 'array_'.$name;
        }

        $uncamel = strtolower(preg_replace("/([A-Z])/", "_$1", $name));

        if (isset(self::$_methods[$uncamel])) {
            return $uncamel;
        }

        if (isset(self::$_methods['array_'.$uncamel])) {
            return 'array_'.$uncamel;
        }

        return $name;
    }
48483
public function get_script($name)
    {
        if (!$this->sieve)
            return $this->_set_error(self::ERROR_INTERNAL);

        $content = $this->sieve->getScript($name);

        if (is_a($content, 'PEAR_Error')) {
            return $this->_set_error(self::ERROR_OTHER);
        }

        return $content;
    }
567557
public function getHtml(string $name)
    {
        return $this->htmlContentAreas->where(function (HtmlContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        })->first();
    }
1081061
private function & _getScriptsGroupContainer ($name = '') {
		$ctrlActionKey = $this->getCtrlActionKey();
		if (!isset(self::$scriptsGroupContainer[$ctrlActionKey])) {
			self::$scriptsGroupContainer[$ctrlActionKey] = [];
		}
		if (!isset(self::$scriptsGroupContainer[$ctrlActionKey][$name])) {
			self::$scriptsGroupContainer[$ctrlActionKey][$name] = [];
		}
		return self::$scriptsGroupContainer[$ctrlActionKey][$name];
	}
896599
protected function parseFragment($name) {
		$fileName = $this->loader->findFilename($name);
		$html5 = new HTML5();
		$dom = $html5->loadHTMLFragment(file_get_contents($fileName));

		if($html5->getErrors()) {
			$errors = "";
			foreach($html5->getErrors() as $error) {
				$errors .= "\n". $error;
			}
			throw new \Exception("Parsing error for template " . $name . " Errors: " . $errors);
		}

		return $dom;
	}
343858
protected function getRealName($name)
    {
        $pattern = '/(html|htm|xhtml|php|js|css|xml|json)$/';
        if (0 === preg_match($pattern, $name)) {
            $name = preg_replace('/(\/)$/', '', $name).'/'.$this->indexName;
        }

        return $name;
    }
423762
public function getElementsByName($name) {

		if(isset($this->elements[$name])) {
			return $this->elements[$name];
		}
		
		throw new \InvalidArgumentException(sprintf("Unknown form element '%s'", $name));

	}