| @@ 153-167 (lines=15) @@ | ||
| 150 | * @throws InvalidEntityException |
|
| 151 | * @throws DuplicateCollectionIdentifierException |
|
| 152 | */ |
|
| 153 | public function addEditorScript($handle, array $dependencies = array()) |
|
| 154 | { |
|
| 155 | if($this->assets->hasJavascriptAsset($handle)){ |
|
| 156 | return $this->assets->getJavascriptAsset($handle); |
|
| 157 | } |
|
| 158 | return parent::addJavascript( |
|
| 159 | $handle, |
|
| 160 | $this->registry->getJsUrl( |
|
| 161 | $this->domain->assetNamespace(), |
|
| 162 | $handle |
|
| 163 | ), |
|
| 164 | $this->addDefaultBlockScriptDependencies($dependencies) |
|
| 165 | ) |
|
| 166 | ->setRequiresTranslation(); |
|
| 167 | } |
|
| 168 | ||
| 169 | ||
| 170 | /** |
|
| @@ 204-218 (lines=15) @@ | ||
| 201 | * @throws InvalidEntityException |
|
| 202 | * @throws DuplicateCollectionIdentifierException |
|
| 203 | */ |
|
| 204 | public function addScript($handle, array $dependencies = array()) |
|
| 205 | { |
|
| 206 | if ($this->assets->hasJavascriptAsset($handle)) { |
|
| 207 | return $this->assets->getJavascriptAsset($handle); |
|
| 208 | } |
|
| 209 | return parent::addJavascript( |
|
| 210 | $handle, |
|
| 211 | $this->registry->getJsUrl( |
|
| 212 | $this->domain->assetNamespace(), |
|
| 213 | $handle |
|
| 214 | ), |
|
| 215 | $dependencies + array( CoreAssetManager::JS_HANDLE_EE_COMPONENTS ) |
|
| 216 | ) |
|
| 217 | ->setRequiresTranslation(); |
|
| 218 | } |
|
| 219 | ||
| 220 | ||
| 221 | /** |
|