Created
July 13, 2016 14:08
-
-
Save akool/7945f2e5db3d97ae8597c39595fe0a3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * | |
| * TreeAppend | |
| * Плагин для добавления содержимого в дерево ресурсов | |
| * MODX Evo 1.0.11+ | |
| * | |
| * @category plugin | |
| * @version 0.1 | |
| * @internal @events OnManagerTreeRender | |
| * @internal @modx_category Manager and Admin | |
| * | |
| */ | |
| if ($modx->Event->name == 'OnManagerTreeRender'){ | |
| $output = " | |
| <script> | |
| window.addCallListener = function(func, callback){ | |
| // see: http://habrahabr.ru/post/135001/ | |
| var callNumber = 0; | |
| return function(){ | |
| var args = [].slice.call(arguments); | |
| var result; | |
| try { | |
| result = func.apply(this, arguments); | |
| callNumber++; | |
| } catch (e) { | |
| callback(e, args, this, callNumber); | |
| throw e; | |
| } | |
| callback(result, args, this, callNumber); | |
| return result; | |
| } | |
| } | |
| rpcLoadData = addCallListener(rpcLoadData , function(result, args, self, callNumber){ | |
| styler(); | |
| }); | |
| function styler() { | |
| var el = $$('#node207'); | |
| el.setStyle('margin', '10px 0 0'); | |
| el.setStyle('padding', '10px 0 0'); | |
| el.setStyle('border-top', '1px solid #bbb'); | |
| }; | |
| </script>"; | |
| $modx->Event->output($output); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment