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