Skip to content

Commit

Permalink
Implements #5: Remote call using PHPStorm's web API.
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Jul 18, 2016
1 parent 645e488 commit cb86175
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Plugin/View/LayoutPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ protected function _getBlockInfo($name)
$result = json_encode([
'name' => addslashes($block->getNameInLayout()),
'templateFile' => $this->_getBlockTemplatePath($block),
'absolutePath' => $block->getTemplateFile(),
'moduleName' => $block->getModuleName(),
'class' => addslashes(get_class($block)),
'cache' => ['keyInfo' => $block->getCacheKeyInfo()],
Expand Down
13 changes: 12 additions & 1 deletion view/base/web/js/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
})


$(document).on('mouseout', '.ho-hint', function(event){
$(document).on('mouseout', '.ho-hint', function(event){
if (!event.shiftKey) {
return
}
Expand Down Expand Up @@ -106,11 +106,22 @@ document.addEventListener("DOMContentLoaded", function(event) {
console.log(hintData[key]);
})
console.log(hintData['cache'])
console.log('http://localhost:63342/api/file/'+hintData['absolutePath']);
console.log(elem)

console.groupEnd()
break;
}
}

window.openTemplate = function(elem) {
var hintElem = $(elem)
var hintData = hintElem.data('ho-hintdata');
hintElem.removeAttr('data-ho-hintdata')

if (hintData['absolutePath']) {
$.get('http://localhost:63342/api/file/'+hintData['absolutePath']);
}
}
})
})

0 comments on commit cb86175

Please sign in to comment.